1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9204],{99204:function(t,e,a){a.d(e,{VP:function(){return j},pN:function(){return B},Oi:function(){return k},CZ:function(){return F},JC:function(){return l},x1:function(){return z},Rt:function(){return M},lS:function(){return q},Os:function(){return f},TV:function(){return O},mE:function(){return W},r9:function(){return b},iC:function(){return T},f_:function(){return G},i:function(){return A},km:function(){return V},gz:function(){return X},QI:function(){return I},eE:function(){return E},gS:function(){return D},$$:function(){return c},Mt:function(){return h},UO:function(){return N},Mz:function(){return H}});var n=a(83464),o=a(79125),i=a(63921);a(40257);var s=a(83125),r=a(40257);let l="/no-image.png";function c(t){return t===l?"object-contain object-center":"object-cover"}let d=new Set(["blii.me","postboxmap-images.blii.me","images.postboxmap.co.uk"]);function u(t){return d.has(t.toLowerCase())}function p(t){return!!(t&&(t.size||null!=t.w||null!=t.h))}function g(){var t;let e=null===(t=r.env.NEXT_PUBLIC_IMAGES_PUBLIC_BASE_URL)||void 0===t?void 0:t.trim().replace(/\/$/,"");if(e)try{let t=new URL(e).hostname.toLowerCase();if(!function(t){let e=t.toLowerCase();return!!u(e)||"postboxmap.co.uk"===e||"www.postboxmap.co.uk"===e}(t))return e}catch(t){}return i._O.includes("postboxmap.co.uk")?"https://img.postboxmap.co.uk":null}function m(){var t;return((null===(t=r.env.NEXT_PUBLIC_IMAGE_PROXY_PREFIX)||void 0===t?void 0:t.trim())||i._O).replace(/\/$/,"")}let w="token";function y(){let t="https://api.postboxmap.co.uk/api".trim();return t?t.replace(/\/$/,""):"".concat(window.location.origin,"/api")}function v(){let t="https:"===window.location.protocol;return"; SameSite=Lax".concat(t?"; Secure":"")}function h(t){t&&(document.cookie="".concat(w,"=").concat(encodeURIComponent(t),"; path=/; max-age=").concat(31536e3).concat(v()))}function f(){document.cookie="".concat(w,"=; path=/; max-age=0").concat(v())}function b(){let t=y().replace(/\/api\/?$/,"");return!t||t.startsWith("/")?window.location.origin:t||window.location.origin}let _=n.Z.create({headers:{"Content-Type":"application/json"},timeout:3e4,withCredentials:!0});_.interceptors.request.use(t=>(t.baseURL=y(),t));let S={};function x(t){if(!t.startsWith("/postboxes/map?"))return t;let e=t.indexOf("?");if(e<0)return t;let a=new URLSearchParams(t.slice(e+1)),n=a.get("bounds");if(!n)return t;let o=n.split(",").map(t=>parseFloat(t.trim()));return 4!==o.length||o.some(t=>!Number.isFinite(t))?t:(a.set("bounds",o.map(t=>Math.round(100*t)/100).join(",")),"/postboxes/map?".concat(a.toString()))}function P(t){let e=x(t),a=Date.now(),n=t.startsWith("/countries")?3e5:t.startsWith("/site-config")?18e4:t.startsWith("/postboxes/map?")?45e3:t.startsWith("/postboxes/aggregates/county?")||t.startsWith("/postboxes/tiles?")?36e5:t.startsWith("/feed?")?12e4:6e4,o=S[e];if(o){if(o.expires>a&&void 0!==o.data)return Promise.resolve(o.data);if(o.promise)return o.promise}let i=_.get(t).then(t=>t.data);return S[e]={expires:a+n,promise:i},i.then(t=>(S[e]={data:t,expires:a+n},t),t=>{throw S[e]={expires:0},t})}function O(){let t=["/site-config","/stats","/feed?","/countries","/postboxes/map?","/postboxes/tiles?","/postboxes/aggregates/","/postbox-subtypes","/leaderboard"];for(let e of Object.keys(S))t.some(t=>e===t||e.startsWith(t))||delete S[e]}function R(){delete S["/site-config"]}let C="E5001",U=new Set(["Failed to fetch","NetworkError","Network request failed","Load failed"]),k="We could not reach the server. Check your internet connection and try again.";function L(t){let e=t.trim();return!!e&&!!(U.has(e)||"Network Error"===e||"Network error. Please try again."===e||/^failed to fetch/i.test(e))}function I(t){var e;return!!(t instanceof TypeError&&U.has(t.message)||"string"==typeof t&&L(t))||!!t&&"object"==typeof t&&null==(e=t).response&&("ERR_NETWORK"===e.code||"ECONNABORTED"===e.code||"Network Error"===e.message||e.apiErrorCode===C)}function E(t){return I(t)}function A(t,e){return I(t)?k:t instanceof Error&&t.message.trim()?D(t.message,e):"string"==typeof t&&t.trim()?D(t,e):e}function D(t,e){return(null==t?void 0:t.trim())?L(t)?k:t.trim():e}function T(t,e){var a;let n=t&&"object"==typeof t&&"apiErrorCode"in t?t.apiErrorCode:void 0,o=n?" (".concat(n,")"):"";if(!t||"object"!=typeof t)return e+o;if(!("response"in t)||null==t.response)return I(t)?k:D(t instanceof Error?t.message:"string"==typeof t.message?t.message:"",e);let i=null===(a=t.response)||void 0===a?void 0:a.data;if(!i||"object"!=typeof i)return e+o;let s=i.error;if("string"==typeof s)return s.includes(" (E")?s:s+o;if(s&&"object"==typeof s&&"string"==typeof s.message){let t=s.message;return t.includes(" (E")?t:t+o}let r=i.message,l="string"==typeof r?r:e;return l.includes(" (E")?l:l+o}function N(t){if(!t||!String(t).trim())return"";let e=String(t).trim();return e.replace(/\s*\(E\d+\)\s*$/,"").trim()||e}async function M(){try{let t=await fetch("".concat(window.location.origin,"/api/health"),{method:"GET",credentials:"include",signal:AbortSignal.timeout(8e3)});if(429===t.status)return{ok:!0};let e=(t.ok,await t.json().catch(()=>({}))),a=200===t.status&&(null==e?void 0:e.database)==="connected",n=503===t.status&&((null==e?void 0:e.downtime)===!0||(null==e?void 0:e.database)==="disconnected");return{ok:a,...n&&{downtime:!0}}}catch(t){return{ok:!1,unreachable:!0}}}let j="postboxmap:downtime";
1function q(){Object.keys(S).forEach(t=>delete S[t]);try{localStorage.removeItem(w)}catch(t){}try{f()}catch(t){}}_.interceptors.response.use(t=>t,async t=>{var e,a,n,o,i,s,r,l,c;let d=!(null==t?void 0:t.response)&&((null==t?void 0:t.code)==="ERR_NETWORK"||(null==t?void 0:t.message)==="Network Error"),u=null==t?void 0:null===(e=t.config)||void 0===e?void 0:e.__networkRetry,p=String(null!==(s=null==t?void 0:null===(a=t.config)||void 0===a?void 0:a.method)&&void 0!==s?s:"get").toLowerCase();if(d&&!u&&(null==t?void 0:t.config)&&"get"===p)return t.config.__networkRetry=!0,await new Promise(t=>setTimeout(t,800)),_.request(t.config);if((null==t?void 0:null===(n=t.response)||void 0===n?void 0:n.status)===429){let e=null===(r=t.response)||void 0===r?void 0:r.data,a="object"==typeof e&&null!==e&&"string"==typeof e.message&&e.message||"object"==typeof e&&null!==e&&"string"==typeof e.error&&e.error||("string"==typeof e?e:"Too many requests. Please try again in a moment.");try{window.dispatchEvent(new CustomEvent("postboxmap:toast",{detail:{message:a,type:"info"}}))}catch(t){}}if((null==t?void 0:null===(o=t.response)||void 0===o?void 0:o.status)===503)try{window.dispatchEvent(new CustomEvent(j))}catch(t){}if((null==t?void 0:null===(i=t.response)||void 0===i?void 0:i.status)===401){let e="string"==typeof(null===(l=t.config)||void 0===l?void 0:l.url)?t.config.url:"",a=!!((null===(c=t.config)||void 0===c?void 0:c.headers)&&"string"==typeof t.config.headers.Authorization);(e.includes("/auth/me")||e.includes("/admin")||e.includes("/moderator")||e.includes("/owner"))&&a&&(q(),window.location.href="/login?error=SessionExpired&redirect="+encodeURIComponent(window.location.pathname||"/"))}return(null==t?void 0:t.response)||(null==t?void 0:t.code)!=="ERR_NETWORK"&&(null==t?void 0:t.message)!=="Network Error"||"object"!=typeof t||(t.apiErrorCode=C),Promise.reject(t)}),_.interceptors.request.use(async t=>{t.baseURL="".concat(b(),"/api");let e="string"==typeof t.url?t.url:(t.baseURL||"")+(t.url||"");if(e.includes("/owner/")||e.includes("/admin/")||e.includes("/moderator/")){let e=localStorage.getItem(w);e&&(t.headers.Authorization="Bearer ".concat(e))}t.data instanceof FormData&&(t.headers&&(delete t.headers["Content-Type"],delete t.headers["content-type"]),t.timeout=3e5);let a=(0,o.s)();if(a&&(t.headers["X-Country-Code"]=a,"get"===t.method&&t.params&&(t.params.country=a)),!t.headers.Authorization){let e=localStorage.getItem(w);e&&(t.headers.Authorization="Bearer ".concat(e))}return t.headers[s.uS]=(0,s.aj)(),t});let B=120,F="notifications-updated";function W(){window.dispatchEvent(new CustomEvent(F))}let z={register:async(t,e,a,n)=>(await _.post("/auth/register",{email:t,display_name:e,password:a,...n?{signup_platform:n}:{}})).data,checkDisplayNameAvailability:async t=>(await _.get("/auth/display-name-availability?display_name=".concat(encodeURIComponent(t)))).data,checkMyDisplayNameAvailability:async t=>(await _.get("/auth/me/display-name-availability?display_name=".concat(encodeURIComponent(t)))).data,login:async(t,e)=>(await _.post("/auth/login",{email:t,password:e})).data,logout(){q()},clearAuthCache:q,getMe:async()=>(await _.get("/auth/me")).data,getEmailPreferences:async()=>(await _.get("/auth/me/email-preferences")).data,updateEmailPreferences:async t=>(await _.put("/auth/me/email-preferences",t)).data,getNotificationPreferences:async()=>(await _.get("/auth/me/notification-preferences")).data,updateNotificationPreferences:async t=>(await _.put("/auth/me/notification-preferences",t)).data,putFieldModePendingStatus:async t=>(await _.put("/auth/me/field-mode-pending-status",t)).data,getPushStatus:async()=>(await _.get("/push/status")).data,updatePushStatus:async t=>(await _.put("/push/status",{enabled:t})).data,getPushVapidPublicKey:async()=>(await _.get("/push/vapid-public-key")).data,savePushSubscription:async t=>(await _.post("/push/subscribe",{subscription:t})).data,deletePushSubscription:async t=>(await _.delete("/push/subscribe",{data:t?{endpoint:t}:{}})).data,getLocationPreferences:async()=>(await _.get("/auth/me/location-preferences")).data,updateLocationPreferences:async t=>(await _.put("/auth/me/location-preferences",t)).data,putAppStylePreference:async t=>(await _.put("/auth/me/app-style-preference",{prefer_app_style:t})).data,async getDataExport(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"json";return(await _.get("/auth/me/export",{responseType:"blob",params:"json"===t?{}:{format:t},timeout:3e5})).data},async deleteMyAccount(){await _.post("/auth/delete-account")},forgotPassword:async t=>(await _.post("/auth/forgot-password",{email:t})).data,resetPassword:async(t,e)=>(await _.post("/auth/reset-password",{token:t,password:e})).data,async getProfileWithSecurity(){var t,e,a,n,o,i,s,r,l,c,d,u;let p=null===(t=(await _.get("/auth/me")).data)||void 0===t?void 0:t.user;if(!p)throw Error("Failed to load profile");return{display_name:null!==(e=p.display_name)&&void 0!==e?e:"",bio:null!=p.bio&&""!==p.bio?String(p.bio):"",profile_image:null!==(a=p.profile_image)&&void 0!==a?a:null,bluesky_handle:null!==(n=p.bluesky_handle)&&void 0!==n?n:null,mastodon_handle:null!==(o=p.mastodon_handle)&&void 0!==o?o:null,instagram_handle:null!==(i=p.instagram_handle)&&void 0!==i?i:null,email:null!==(s=p.email)&&void 0!==s?s:"",has_password:null===(r=p.has_password)||void 0===r||r,linked_accounts:null!==(l=p.linked_accounts)&&void 0!==l?l:[],mfa_enabled:null!==(c=p.mfa_enabled)&&void 0!==c&&c,needs_signup_source:null!==(d=p.needs_signup_source)&&void 0!==d&&d,signup_source:null!==(u=p.signup_source)&&void 0!==u?u:null}},setSignupSource:async t=>(await _.post("/auth/me/signup-source",t)).data,dismissSignupSource:async()=>(await _.post("/auth/me/signup-source/dismiss")).data,async recordSoftPromptEvent(t){await _.post("/auth/me/soft-prompt-event",t)},mfaSetup:async()=>(await _.post("/auth/me/mfa/setup")).data,mfaVerify:async t=>(await _.post("/auth/me/mfa/verify",{code:t})).data,mfaDisable:async t=>(await _.post("/auth/me/mfa/disable",{password:t})).data,setPassword:async t=>(await _.post("/auth/me/password",{password:t})).data,changePassword:async(t,e)=>(await _.put("/auth/me/password",{currentPassword:t,newPassword:e})).data,changeEmail:async(t,e)=>(await _.put("/auth/me/email",{email:t,password:e})).data,unlinkProvider:async t=>(await _.delete("/auth/me/accounts/".concat(encodeURIComponent(t)))).data,linkGoogleAccount:async t=>(await _.post("/auth/me/link-google",{id_token:t})).data,updateProfile:async t=>(await _.put("/auth/me",t)).data,async pingActivity(){await _.post("/auth/me/ping")},async uploadProfileImage(t){var e,a;let n=new FormData;n.append("image",t);let o=null!==(a=null===(e=(await _.post("/auth/me/profile-image",n)).data)||void 0===e?void 0:e.url)&&void 0!==a?a:"";return{url:o.startsWith("http")?o:"".concat(b()).concat(o.startsWith("/")?"":"/").concat(o)}},getMyTestimonial:async()=>(await _.get("/testimonials/me")).data,async submitMyTestimonial(t){var e,a;let n=new FormData;return n.append("testimonial_length",t.testimonial_length),n.append("content",t.content),n.append("consent_to_publish",String(t.consent_to_publish)),n.append("is_anonymous",String(t.is_anonymous)),n.append("link_profile",String(null===(e=t.link_profile)||void 0===e||e)),n.append("display_name",null!==(a=t.display_name)&&void 0!==a?a:""),t.photo&&n.append("photo",t.photo),(await _.post("/testimonials/me",n)).data},async getPublishedTestimonialsHome(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12;return(await _.get("/testimonials/published/home",{params:{limit:t}})).data},async getPublishedStoriesIndex(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;return(await _.get("/testimonials/published/stories",{params:{limit:t}})).data},async getPublishedUserStory(t){var e,a,n;try{let n=await _.get("/testimonials/published/user/".concat(encodeURIComponent(t)));return null!==(a=null===(e=n.data)||void 0===e?void 0:e.testimonial)&&void 0!==a?a:null}catch(t){if(404===(t&&"object"==typeof t&&"response"in t?null===(n=t.response)||void 0===n?void 0:n.status:void 0))return null;throw t}},async getCountries(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return P("/countries".concat(t?"?active_only=true":""))},getCountry:async t=>P("/countries/".concat(t)),getDefaultCountry:async()=>P("/countries/default"),getCountryPostboxTypes:async t=>(await _.get("/countries/".concat(t,"/postbox-types"))).data,getCountryReigns:async t=>(await _.get("/countries/".concat(t,"/reigns"))).data,getCountrySettings:async t=>(await _.get("/countries/".concat(t,"/settings"))).data,async searchPostboxes(t,e){var a,n,o,i,s,r,l,c;let d=new URLSearchParams;(null==t?void 0:t.q)&&d.append("q",t.q),(null==t?void 0:null===(a=t.subtype)||void 0===a?void 0:a.trim())&&d.append("subtype",t.subtype.trim()),(null==t?void 0:null===(n=t.design_variant_id)||void 0===n?void 0:n.trim())&&d.append("design_variant_id",t.design_variant_id.trim()),(null==t?void 0:null===(o=t.homepage_type)||void 0===o?void 0:o.trim())&&d.append("homepage_type",t.homepage_type.trim()),(null==t?void 0:null===(i=t.type)||void 0===i?void 0:i.trim())&&d.append("type",t.type.trim()),(null==t?void 0:null===(s=t.manufacturer)||void 0===s?void 0:s.trim())&&d.append("manufacturer",t.manufacturer.trim()),(null==t?void 0:null===(r=t.finish)||void 0===r?void 0:r.trim())&&d.append("finish",t.finish.trim()),(null==t?void 0:null===(l=t.box_status)||void 0===l?void 0:l.trim())&&d.append("box_status",t.box_status.trim()),(null==t?void 0:null===(c=t.designation_code)||void 0===c?void 0:c.trim())&&d.append("designation_code",t.designation_code.trim()),(null==t?void 0:t.reign)&&d.append("reign",t.reign),(null==t?void 0:t.bounds)&&d.append("bounds",t.bounds),(null==t?void 0:t.country)&&d.append("country",t.country),(null==t?void 0:t.limit)!=null&&d.append("limit",String(t.limit)),(null==t?void 0:t.offset)!=null&&d.append("offset",String(t.offset));let u=d.toString(),p="/search?".concat(u);
1return e?(await _.get(p,{signal:e})).data:_.get(p).then(t=>t.data)},async getPostboxes(t,e){var a,n,o,i,s,r,l;let c=new URLSearchParams;(null==t?void 0:t.reign)&&c.append("reign",t.reign),(null==t?void 0:t.bounds)&&c.append("bounds",t.bounds),(null==t?void 0:t.country)&&c.append("country",t.country),(null==t?void 0:t.q)&&c.append("q",t.q),(null==t?void 0:null===(a=t.reg_no)||void 0===a?void 0:a.trim())&&c.append("reg_no",t.reg_no.trim()),(null==t?void 0:null===(n=t.subtype)||void 0===n?void 0:n.trim())&&c.append("subtype",t.subtype.trim()),(null==t?void 0:null===(o=t.type)||void 0===o?void 0:o.trim())&&c.append("type",t.type.trim()),(null==t?void 0:null===(i=t.manufacturer)||void 0===i?void 0:i.trim())&&c.append("manufacturer",t.manufacturer.trim()),(null==t?void 0:null===(s=t.finish)||void 0===s?void 0:s.trim())&&c.append("finish",t.finish.trim()),(null==t?void 0:null===(r=t.box_status)||void 0===r?void 0:r.trim())&&c.append("box_status",t.box_status.trim()),(null==t?void 0:null===(l=t.designation_code)||void 0===l?void 0:l.trim())&&c.append("designation_code",t.designation_code.trim()),(null==t?void 0:t.limit)!=null&&c.append("limit",String(t.limit)),(null==t?void 0:t.offset)!=null&&c.append("offset",String(t.offset));let d=c.toString(),u=d?"/postboxes?".concat(d):"/postboxes?";return e?(await _.get(u,{signal:e})).data:P(u)},async getPostboxesForMap(t,e){var a,n,o,i,s;let r=new URLSearchParams({bounds:t.bounds});t.reign&&r.append("reign",t.reign),(null===(a=t.subtype)||void 0===a?void 0:a.trim())&&r.append("subtype",t.subtype.trim()),(null===(n=t.type)||void 0===n?void 0:n.trim())&&r.append("type",t.type.trim()),(null===(o=t.q)||void 0===o?void 0:o.trim())&&r.append("q",t.q.trim()),t.country&&r.append("country",t.country),(null===(i=t.box_status)||void 0===i?void 0:i.trim())&&r.append("box_status",t.box_status.trim()),(null===(s=t.finish)||void 0===s?void 0:s.trim())&&r.append("finish",t.finish.trim());let l="/postboxes/map?".concat(r.toString());if(e){{let t=S[x(l)],e=Date.now();if((null==t?void 0:t.expires)>e&&void 0!==t.data)return t.data}let t=await _.get(l,{signal:e});{let e=x(l),a=Date.now();S[e]={data:t.data,expires:a+45e3}}return t.data}return P(l)},async getPostboxTiles(t,e,a,n){var o,i,s;let r=new URLSearchParams({bounds:t,zoom:String(Math.round(e))});(null==a?void 0:a.reign)&&r.append("reign",a.reign),(null==a?void 0:null===(o=a.q)||void 0===o?void 0:o.trim())&&r.append("q",a.q.trim()),(null==a?void 0:null===(i=a.subtype)||void 0===i?void 0:i.trim())&&r.append("subtype",a.subtype.trim()),(null==a?void 0:null===(s=a.manufacturer)||void 0===s?void 0:s.trim())&&r.append("manufacturer",a.manufacturer.trim());let l="/postboxes/tiles?".concat(r.toString());return n?(await _.get(l,{signal:n})).data:P(l)},async getPostboxCountyAggregates(t,e){var a,n,o,i,s;let r=new URLSearchParams({bounds:t.bounds});t.reign&&r.append("reign",t.reign),(null===(a=t.subtype)||void 0===a?void 0:a.trim())&&r.append("subtype",t.subtype.trim()),(null===(n=t.type)||void 0===n?void 0:n.trim())&&r.append("type",t.type.trim()),(null===(o=t.q)||void 0===o?void 0:o.trim())&&r.append("q",t.q.trim()),t.country&&r.append("country",t.country),(null===(i=t.box_status)||void 0===i?void 0:i.trim())&&r.append("box_status",t.box_status.trim()),(null===(s=t.finish)||void 0===s?void 0:s.trim())&&r.append("finish",t.finish.trim());let l="/postboxes/aggregates/county?".concat(r.toString());return e?(await _.get(l,{signal:e})).data:P(l)},async getPostboxesNearby(t,e,a,n,o){let i=new URLSearchParams({lat:String(t),lng:String(e)});return null!=a&&a>0&&i.set("radius_km",String(a)),(null==n?void 0:n.includeMarkers)&&i.set("include_markers","1"),(o?await _.get("/postboxes/nearby?".concat(i.toString()),{signal:o}):await _.get("/postboxes/nearby?".concat(i.toString()))).data},async getRegNoExists(t,e,a){let n=new URLSearchParams({reg_no:t.trim()});(null==e?void 0:e.trim())&&n.set("country",e.trim().toUpperCase());let o="/postboxes/reg-no-exists?".concat(n.toString());return(a?await _.get(o,{signal:a}):await _.get(o)).data},async getPostboxesNearMe(t,e,a,n){let o=new URLSearchParams({lat:String(t),lng:String(e)});(null==a?void 0:a.radius_km)!=null&&a.radius_km>0&&o.set("radius_km",String(a.radius_km)),(null==a?void 0:a.limit)!=null&&o.set("limit",String(a.limit)),(null==a?void 0:a.no_photos_only)&&o.set("no_photos_only","1"),(null==a?void 0:a.log_search)&&o.set("log_search","1");let i="/postboxes/near-me?".concat(o.toString());return(n?await _.get(i,{signal:n}):await _.get(i)).data},async getOsmPostBoxByRef(t,e){let a=new URLSearchParams({ref:t.trim()}),n="/osm/post-box-by-ref?".concat(a.toString());return(e?await _.get(n,{signal:e}):await _.get(n)).data},dismissOsmPostbox:async t=>(await _.post("/osm/dismiss",t)).data,async getSuggestLocation(t,e){let a=new URLSearchParams({lat:String(t),lng:String(e)});return(await _.get("/osm/suggest-location?".concat(a.toString()))).data},async geocodeForward(t){let e=t.trim();if(!e)return null;try{let t=new URLSearchParams({q:e}),a=(await _.get("/geo/forward?".concat(t.toString()))).data;if((null==a?void 0:a.lat)!=null&&(null==a?void 0:a.lng)!=null&&Number.isFinite(a.lat)&&Number.isFinite(a.lng))return{lat:a.lat,lng:a.lng};return null}catch(t){var a;if(404===(null==t?void 0:null===(a=t.response)||void 0===a?void 0:a.status))return null;throw t}},async getOsmNearbyPostboxes(t,e,a,n){let o=new URLSearchParams({lat:String(t),lng:String(e)});(null==a?void 0:a.radius)!=null&&o.set("radius",String(a.radius)),(null==a?void 0:a.limit)!=null&&o.set("limit",String(a.limit)),(null==a?void 0:a.exclude_near_db)&&o.set("exclude_near_db","1");let i="/osm/nearby-postboxes?".concat(o.toString());return(n?await _.get(i,{signal:n}):await _.get(i)).data},async getOsmNearbyPostbox(t,e,a,n){let o;let i=new URLSearchParams({lat:String(t),lng:String(e)});null!=a&&a>0&&i.set("radius",String(a));let s="/osm/nearby-postbox?".concat(i.toString());for(let t=1;t<=3;t++)try{return(n?await _.get(s,{signal:n}):await _.get(s)).data}catch(a){var r;if((null==a?void 0:a.name)==="AbortError")throw a;o=a;let e=null==a?void 0:null===(r=a.response)||void 0===r?void 0:r.status;if(!(500===e||503===e||504===e)||3===t)throw a;await new Promise((t,e)=>{let a=setTimeout(t,1500);if(n){let t=()=>{clearTimeout(a),n.removeEventListener("abort",t);let o=Error("Request aborted");o.name="AbortError",e(o)};n.addEventListener("abort",t,{once:!0})}})}throw o},async getPostbox(t,e){let a=(null==e?void 0:e.cookieHeader)?{headers:{Cookie:e.cookieHeader}}:void 0;return(await _.get("/postboxes/".concat(t),a)).data},async getPostboxTimeline(t,e){let a=(null==e?void 0:e.cookieHeader)?{headers:{Cookie:e.cookieHeader}}:void 0;return(await _.get("/postboxes/".concat(t,"/timeline"),a)).data},addPostboxTimelineEvent:async(t,e)=>(await _.post("/postboxes/".concat(t,"/timeline"),e)).data,async getPostboxHistory(t,e){let a=(null==e?void 0:e.cookieHeader)?{headers:{Cookie:e.cookieHeader}}:void 0;return(await _.get("/postboxes/".concat(t,"/history"),a)).data},postPostboxVerifyVote:async(t,e)=>(await _.post("/postboxes/".concat(t,"/verify-vote"),e)).data,async getMySubmissions(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,o=new URLSearchParams({limit:String(e),offset:String(a)});return(null==n?void 0:n.status)&&"all"!==n.status&&o.set("status",n.status),(null==n?void 0:n.sort)&&o.set("sort",n.sort),(null==n?void 0:null===(t=n.q)||void 0===t?void 0:t.trim())&&o.set("q",n.q.trim()),(await _.get("/postboxes/my-submissions?".concat(o.toString()))).data},async getMySubmissionsTiles(t,e,a){let n=new URLSearchParams({bounds:t,zoom:String(Math.round(e))});return(a?await _.get("/postboxes/my-submissions/tiles?".concat(n.toString()),{signal:a}):await _.get("/postboxes/my-submissions/tiles?".concat(n.toString()))).data},async getSubmissionsTilesForUser(t,e,a,n){let o=new URLSearchParams({bounds:e,zoom:String(Math.round(a))}),i="/users/".concat(t,"/submissions/tiles?").concat(o.toString());return(n?await _.get(i,{signal:n}):await _.get(i)).data},async getSubmissionsByUser(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=new URLSearchParams({limit:String(e),offset:String(a)});(null==n?void 0:n.bounds)&&i.set("bounds",n.bounds);let s="/users/".concat(t,"/submissions?").concat(i.toString()),r=o?await _.get(s,{signal:o}):await _.get(s);return Array.isArray(r.data)?r.data:[]},async submitPostbox(t,e,a){let n=e?"?country=".concat(encodeURIComponent(e)):"",o={};
1return a&&(o["X-Queue-Id"]=a),t.has("submission_source")||t.append("submission_source",(0,s.Kk)()),(await _.post("/postboxes/submit".concat(n),t,o?{headers:o}:void 0)).data},async stageSubmitPostboxImages(t,e){let a=new FormData;for(let e of t)a.append("images",e);return(await _.post("/postboxes/submit/stage-images",a,e?{signal:e}:void 0)).data},async abortSubmitPostboxStaging(t){await _.delete("/postboxes/submit/stage-images/".concat(encodeURIComponent(t)))},async validateImportFile(t){let e=new FormData;return e.append("file",t),e.append("country_code","GB"),(await _.post("/postboxes/import/validate",e)).data},submitImport:async t=>(await _.post("/postboxes/import",{...t,country_code:"GB"})).data,async uploadPostboxPhoto(t,e,a){var n;let o=Array.isArray(e)?e:[e],i=new FormData;for(let t of o)i.append("image",t);let s=null==a?void 0:null===(n=a.photo_taken_at)||void 0===n?void 0:n.trim();return s&&i.append("photo_taken_at",s),(await _.post("/postboxes/".concat(t,"/upload-photo"),i)).data},deletePostboxGalleryPhoto:async(t,e)=>(await _.delete("/postboxes/".concat(t,"/photos/").concat(encodeURIComponent(e)))).data,updateMyPendingSubmission:async(t,e)=>(await _.put("/postboxes/".concat(t),e)).data,getMySubmissionBackfillSuggest:async t=>(await _.get("/postboxes/".concat(t,"/backfill-suggest"))).data,async deleteMySubmission(t){await _.delete("/postboxes/".concat(t))},async getFeed(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"recent",n=arguments.length>3?arguments[3]:void 0,o=new URLSearchParams({limit:String(t),offset:String(e)});return"popular"===a&&(o.set("sort","popular"),n&&o.set("period",n)),P("/feed?".concat(o.toString()))},getSortingOfficeNext:async()=>(await _.get("/sorting-office/next")).data,postSortingOfficeVote:async(t,e)=>(await _.post("/sorting-office/vote",{pending_id:t,choice:e})).data,async addVisited(t,e){var a;let n=(null==e?void 0:null===(a=e.visited_at)||void 0===a?void 0:a.trim())?{visited_at:e.visited_at.trim()}:{};return(await _.post("/auth/me/visits/".concat(t),n)).data},getMyVisitForPostbox:async t=>(await _.get("/auth/me/visits/".concat(t))).data,removeVisited:async t=>(await _.delete("/auth/me/visits/".concat(t))).data,async getMyVisits(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(await _.get("/auth/me/visits".concat(t?"?full=true":""))).data},async getMyPointsLedger(t){let e=new URLSearchParams;(null==t?void 0:t.limit)!=null&&e.set("limit",String(t.limit));let a=e.toString();return(await _.get("/auth/me/points-ledger".concat(a?"?".concat(a):""))).data},getUserVisits:async t=>(await _.get("/users/".concat(t,"/visits"))).data,logPostboxView:async t=>(await _.post("/postboxes/".concat(t,"/view"))).data,async getNotifications(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new URLSearchParams({limit:String(t),offset:String(e)});return a&&n.append("unread_only","true"),(await _.get("/notifications?".concat(n.toString()))).data},getNotificationsUnreadCount:async()=>(await _.get("/notifications/unread-count")).data,async markNotificationRead(t){await _.patch("/notifications/".concat(t,"/read"))},markAllNotificationsRead:async()=>(await _.post("/notifications/mark-all-read")).data,async deleteNotification(t){await _.delete("/notifications/".concat(t))},async getLeaderboard(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all-time",e=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,o=new URLSearchParams({period:t,page:String(a),limit:String(n)});return e&&o.append("reign",e),_.get("/leaderboard?".concat(o.toString())).then(t=>t.data)},getChallenges:async()=>(await _.get("/challenges")).data,async getChallenge(t,e){let a=new URLSearchParams;(null==e?void 0:e.lat)!=null&&(null==e?void 0:e.lng)!=null&&Number.isFinite(e.lat)&&Number.isFinite(e.lng)&&(a.set("lat",String(e.lat)),a.set("lng",String(e.lng)));let n=a.toString();return(await _.get("/challenges/".concat(encodeURIComponent(t)).concat(n?"?".concat(n):""))).data},async getChallengeLeaderboard(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return(await _.get("/challenges/".concat(encodeURIComponent(t),"/leaderboard?limit=").concat(e))).data},getChallengeUnreadSummary:async()=>(await _.get("/challenges/unread-summary")).data,markChallengeNotificationsRead:async t=>(await _.post("/challenges/notifications/read",t?{slug:t}:{})).data,getCompletedChallenges:async()=>(await _.get("/challenges/completed")).data,getStats:async()=>
1P("/stats"),getStatsSummary:async()=>P("/stats/summary"),getPostboxSubtypes:async()=>P("/postbox-subtypes"),async getTrends(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"month";return(await _.get("/trends?period=".concat(t))).data},getUserProfile:async t=>(await _.get("/users/".concat(t))).data,async getUserSubmissions(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(await _.get("/users/".concat(t,"/submissions?limit=").concat(e,"&offset=").concat(a))).data},getUserSubmissionsMap:async t=>(await _.get("/users/".concat(t,"/submissions/map"))).data,async getUserVisitsPreview(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;return(await _.get("/users/".concat(t,"/visits/preview?limit=").concat(e))).data},async getUserActivity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;return(await _.get("/users/".concat(t,"/activity?limit=").concat(e))).data},getUserVisitsMap:async t=>(await _.get("/users/".concat(t,"/visits/map"))).data,async getComments(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(await _.get("/postboxes/".concat(t,"/comments?limit=").concat(e,"&offset=").concat(a))).data},async createComment(t,e,a){let n={text:e};return a&&(n.parent_id=a),(await _.post("/postboxes/".concat(t,"/comments"),n)).data},deleteComment:async(t,e)=>(await _.delete("/postboxes/".concat(t,"/comments/").concat(e))).data,async adminLogin(t,e){return this.login(t,e)},async getAdminPostboxes(t){let e=t?"?statuses=".concat(t.join(",")):"";return(await _.get("/admin/postboxes".concat(e))).data},approvePostbox:async(t,e)=>(await _.put("/admin/postboxes/".concat(t,"/approve"),null!=e?e:{})).data,async rejectPostbox(t,e,a,n){let o={reason:e};return"string"==typeof a&&a.trim()&&(o.comment=a.trim()),(null==n?void 0:n.silent)===!0&&(o.silent=!0),(await _.post("/admin/postboxes/".concat(t,"/reject"),o)).data},updateAdminPostbox:async(t,e)=>(await _.put("/admin/postboxes/".concat(t),e)).data,async getAdminUsersSuggest(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,a=new URLSearchParams({q:t,limit:String(e)});return(await _.get("/admin/users/suggest?".concat(a.toString()))).data},async getAdminPostboxBackfillSuggest(t,e){let a=(null==e?void 0:e.lat)!=null&&(null==e?void 0:e.lng)!=null&&Number.isFinite(e.lat)&&Number.isFinite(e.lng)?{lat:e.lat,lng:e.lng}:void 0;return(await _.get("/admin/postboxes/".concat(t,"/backfill-suggest"),{params:a})).data},mergePostboxes:async(t,e,a)=>(await _.post("/admin/postboxes/merge",{sourceId:t,targetId:e,pullFromSource:a})).data,async getAdminAmalgamateTarget(t,e){let a={};return(null==e?void 0:e.reg_no)!=null&&String(e.reg_no).trim()&&(a.reg_no=String(e.reg_no).trim()),(null==e?void 0:e.target_id)!=null&&String(e.target_id).trim()&&(a.target_id=String(e.target_id).trim()),(await _.get("/admin/postboxes/".concat(t,"/amalgamate-target"),{params:Object.keys(a).length>0?a:void 0})).data},amalgamatePendingPhotosToCanonical:async(t,e,a)=>(await _.post("/admin/postboxes/".concat(t,"/amalgamate-photos"),{targetId:e,pullNotes:(null==a?void 0:a.pullNotes)===!0})).data,getPendingCorrections:async()=>(await _.get("/admin/corrections")).data,getPendingImages:async()=>(await _.get("/admin/pending-images")).data,approvePendingImage:async(t,e)=>(await _.post("/admin/pending-images/".concat(t,"/approve"),null!=e?e:{})).data,approvePendingImagesBatch:async t=>(await _.post("/admin/pending-images/batch/approve",t)).data,rejectPendingImage:async(t,e)=>(await _.post("/admin/pending-images/".concat(t,"/reject"),{reason:e})).data,rejectPendingImagesBatch:async(t,e)=>(await _.post("/admin/pending-images/batch/reject",{ids:t,reason:e})).data,getDashboard:async()=>(await _.get("/admin/dashboard")).data,getOwnerDashboard:async()=>(await _.get("/owner/dashboard")).data,async getOwnerActivityStats(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:30;return(await _.get("/owner/activity-stats",{params:{days:t}})).data},async getOwnerPlatformUsage(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:30;return(await _.get("/owner/platform-usage",{params:{days:t}})).data},getOwnerPlatformUsageUsers:async t=>(await _.get("/owner/platform-usage/users",{params:{days:null==t?void 0:t.days,platform:null==t?void 0:t.platform,multi_only:(null==t?void 0:t.multiOnly)?"1":void 0,limit:null==t?void 0:t.limit,offset:null==t?void 0:t.offset}})).data,getOwnerSortingOfficeStats:async()=>(await _.get("/owner/sorting-office-stats")).data,getOwnerSortingOfficeQuestions:async t=>(await _.get("/owner/sorting-office-questions",{params:null!=t?{limit:t}:{}})).data,getOwnerModerationQueueCount:async()=>(await _.get("/owner/moderation-queue-count")).data,getOwnerTestimonials:async t=>(await _.get("/testimonials",{params:t?{status:t}:{}})).data,postOwnerPublishTestimonial:async t=>(await _.post("/testimonials/".concat(encodeURIComponent(t),"/publish"))).data,postOwnerRejectTestimonial:async(t,e)=>(await _.post("/testimonials/".concat(encodeURIComponent(t),"/reject"),{reason:null!=e?e:""})).data,postOwnerUnpublishTestimonial:async t=>(await _.post("/testimonials/".concat(encodeURIComponent(t),"/unpublish"))).data,postOwnerFeatureTestimonial:async(t,e)=>(await _.post("/testimonials/".concat(encodeURIComponent(t),"/featured"),{featured:e})).data,async patchOwnerTestimonial(t,e){var a,n;let o=new FormData;return o.append("testimonial_length",e.testimonial_length),o.append("content",e.content),o.append("consent_to_publish",String(e.consent_to_publish)),o.append("is_anonymous",String(e.is_anonymous)),o.append("link_profile",String(null===(a=e.link_profile)||void 0===a||a)),o.append("display_name",null!==(n=e.display_name)&&void 0!==n?n:""),void 0!==e.link_to_full_story&&o.append("link_to_full_story",String(e.link_to_full_story)),e.clear_photo&&o.append("clear_photo","true"),e.photo&&o.append("photo",e.photo),(await _.patch("/testimonials/".concat(encodeURIComponent(t)),o)).data}
1,async deleteOwnerTestimonial(t){await _.delete("/testimonials/".concat(encodeURIComponent(t)))},async postOwnerCreateTestimonial(t){var e,a,n,o;let i=new FormData;return i.append("user_id",t.user_id),i.append("testimonial_length",t.testimonial_length),i.append("content",t.content),i.append("consent_to_publish",String(null===(e=t.consent_to_publish)||void 0===e||e)),i.append("is_anonymous",String(t.is_anonymous)),i.append("link_profile",String(null===(a=t.link_profile)||void 0===a||a)),i.append("display_name",null!==(n=t.display_name)&&void 0!==n?n:""),i.append("publish",String(null!==(o=t.publish)&&void 0!==o&&o)),t.photo&&i.append("photo",t.photo),(await _.post("/testimonials",i)).data},async postOwnerCreateShortExcerpt(t,e){var a,n;return(await _.post("/testimonials/".concat(encodeURIComponent(t),"/short-excerpt"),{content:e.content,publish:null!==(a=e.publish)&&void 0!==a&&a,link_to_full_story:null===(n=e.link_to_full_story)||void 0===n||n})).data},getOwnerSearchLog:async()=>(await _.get("/owner/search-log")).data,getOwnerSoftPromptEvents:async t=>(await _.get("/owner/soft-prompt-events",{params:t})).data,getOwnerOverpassStats:async t=>(await _.get("/owner/overpass-stats",{params:null!=t?{days:t}:{}})).data,getOwnerApiKeysUsage:async t=>(await _.get("/owner/api-keys-usage",{params:null!=t?{days:t}:{}})).data,async getOwnerRateLimitHits(t){var e;let a=new URLSearchParams;return(null==t?void 0:t.limit)!=null&&a.set("limit",String(t.limit)),(null==t?void 0:null===(e=t.ip)||void 0===e?void 0:e.trim())&&a.set("ip",t.ip.trim()),(await _.get("/owner/rate-limit-hits".concat(a.toString()?"?".concat(a.toString()):""))).data},getOwnerRateLimitStats:async t=>(await _.get("/owner/rate-limit-stats",{params:null!=t?{days:t}:{}})).data,getOwnerRateLimitExemptIps:async()=>(await _.get("/owner/rate-limit-exempt-ips")).data,addOwnerRateLimitExemptIp:async t=>(await _.post("/owner/rate-limit-exempt-ips",{ip:t.trim()})).data,removeOwnerRateLimitExemptIp:async t=>(await _.delete("/owner/rate-limit-exempt-ips/".concat(encodeURIComponent(t.trim())))).data,getOwnerCanRestoreOwner:async()=>(await _.get("/owner/can-restore-owner")).data,postOwnerRestoreOwner:async()=>(await _.post("/owner/restore-owner")).data,getOwnerMigrationStatus:async()=>(await _.get("/owner/migrations/status")).data,postOwnerRunMigrations:async()=>(await _.post("/owner/migrations/run")).data,getOwnerDbBackup:async()=>(await _.get("/owner/db-backup",{responseType:"blob"})).data,getOwnerOrphanedImages:async t=>(await _.get("/owner/orphaned-images",{params:t})).data,async cleanupOwnerOrphanedImages(t){let e={};return(null==t?void 0:t.dryRun)&&(e.dry_run=!0),(null==t?void 0:t.prefix)!=null&&(e.prefix=t.prefix),(null==t?void 0:t.max_keys)!=null&&(e.max_keys=t.max_keys),(await _.post("/owner/cleanup-orphaned-images",e)).data},getOwnerDetachedListingPhotos:async t=>(await _.get("/owner/detached-listing-photos",{params:t})).data,restoreOwnerDetachedListingPhoto:async t=>(await _.post("/owner/detached-listing-photos/restore",t)).data,getOwnerRejectedPendingPhotos:async t=>(await _.get("/owner/pending-images/rejected",{params:t})).data,patchOwnerPendingImageStatus:async(t,e)=>(await _.patch("/owner/pending-images/".concat(t),e)).data,getOwnerCleanupRejectedPendingPhotos:async()=>(await _.get("/owner/cleanup/rejected-pending-photos")).data,postOwnerCleanupRejectedPendingPhotos:async t=>(await _.post("/owner/cleanup/rejected-pending-photos",t?{dry_run:!0}:{})).data,getOwnerCleanupOrphanedCorrections:async()=>(await _.get("/owner/cleanup/orphaned-corrections")).data,getOwnerMergeReconciliation:async()=>(await _.get("/owner/cleanup/merge-reconciliation")).data,postOwnerCleanupOrphanedCorrections:async t=>(await _.post("/owner/cleanup/orphaned-corrections",t?{dry_run:!0}:{})).data,getOwnerCleanupRejectedCorrections:async()=>(await _.get("/owner/cleanup/rejected-corrections")).data,postOwnerCleanupRejectedCorrections:async t=>(await _.post("/owner/cleanup/rejected-corrections",t?{dry_run:!0}:{})).data,getOwnerCleanupRejectedSubmissions:async()=>(await _.get("/owner/cleanup/rejected-submissions")).data,postOwnerCleanupRejectedSubmissions:async t=>(await _.post("/owner/cleanup/rejected-submissions",t?{dry_run:!0}:{})).data,getOwnerCleanupOrphanedModeratorApprovals:async()=>(await _.get("/owner/cleanup/orphaned-moderator-approvals")).data,postOwnerCleanupOrphanedModeratorApprovals:async t=>(await _.post("/owner/cleanup/orphaned-moderator-approvals",t?{dry_run:!0}:{})).data,postOwnerReengagementRun:async(t,e)=>(await _.post("/owner/reengagement/run",{flow:t,dry_run:e})).data,async postOwnerReengagementSendToUser(t,e){let a=e.includes("@")?{flow:t,email:e}:{flow:t,user_id:e};return(await _.post("/owner/reengagement/send-to-user",a)).data},async getOwnerUsers(t){let e=new URLSearchParams;return(null==t?void 0:t.role)&&e.set("role",t.role),(null==t?void 0:t.search)&&e.set("search",t.search),(await _.get("/owner/users?".concat(e.toString()))).data},getOwnerUser:async t=>(await _.get("/owner/users/".concat(encodeURIComponent(t)))).data,async getOwnerUsersSuggest(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,a=new URLSearchParams;return t.trim()&&a.set("q",t.trim()),15!==e&&a.set("limit",String(e)),(await _.get("/owner/users/suggest?".concat(a.toString()))).data},putOwnerUser:async(t,e)=>(await _.put("/owner/users/".concat(t),e)).data,postOwnerUserRecalcStats:async t=>(await _.post("/owner/users/".concat(t,"/recalc-stats"))).data,postOwnerUserSyncBrevo:async t=>(await _.post("/owner/users/".concat(t,"/sync-brevo"))).data,postOwnerBrevoSyncAttributes:async()=>(await _.post("/owner/brevo/sync-attributes")).data,postOwnerBrevoResync:async()=>(await _.post("/owner/brevo/resync")).data,getOwnerEmailTemplates:async()=>(await _.get("/owner/email-templates")).data,postOwnerUserSendEmail:async(t,e)=>(await _.post("/owner/users/".concat(t,"/send-email"),{template_name:e})).data,postOwnerUserResendVerification:async t=>(await _.post("/owner/users/".concat(t,"/resend-verification"))).data,postOwnerRecalcAllStats:async()=>(await _.post("/owner/recalc-all-stats")).data,postOwnerIndexNowSubmit:async()=>(await _.post("/owner/indexnow-submit",void 0,{timeout:12e4})).data,postOwnerIndexNowSubmitSitemap:async()=>(await _.post("/owner/indexnow-submit-sitemap",void 0,{timeout:6e5})).data,getOwnerValidateTownsStats:async()=>(await _.get("/owner/validate-towns/stats")).data,postOwnerValidateTowns:async()=>(await _.post("/owner/validate-towns")).data,async getOwnerUserAuditLog(t,e){let a=new URLSearchParams;(null==e?void 0:e.limit)!=null&&a.set("limit",String(e.limit)),(null==e?void 0:e.includeActivity)===!1&&a.set("include_activity","false");let n=a.toString()?"?".concat(a.toString()):"";return(await _.get("/owner/users/".concat(t,"/audit-log").concat(n))).data},getOwnerUserActivityLog:async(t,e)=>(await _.get("/owner/users/".concat(t,"/activity-log").concat(null!=e?"?limit=".concat(e):""))).data,async getOwnerUserPointsLedger(t,e){let a=new URLSearchParams;(null==e?void 0:e.limit)!=null&&a.set("limit",String(e.limit)),(null==e?void 0:e.source)&&"all"!==e.source&&a.set("source",e.source);let n=a.toString();return(await _.get("/owner/users/".concat(t,"/points-ledger").concat(n?"?".concat(n):""))).data},postOwnerUserPointsLedgerRebuild:async t=>(await _.post("/owner/users/".concat(t,"/points-ledger/rebuild"))).data,getOwnerUserBadges:async t=>(await _.get("/owner/users/".concat(t,"/badges"))).data,awardOwnerUserBadge:async(t,e)=>(await _.post("/owner/users/".concat(t,"/badges"),{badge_id:e})).data,revokeOwnerUserBadge:async(t,e)=>(await _.delete("/owner/users/".concat(t,"/badges/").concat(encodeURIComponent(e)))).data,putOwnerUserPassword:async(t,e)=>(await _.put("/owner/users/".concat(t,"/password"),{newPassword:e})).data,putOwnerUserEmail:async(t,e)=>(await _.put("/owner/users/".concat(t,"/email"),{email:e})).data,putOwnerUserMfa:async(t,e)=>(await _.put("/owner/users/".concat(t,"/mfa"),{mfa_enabled:e})).data,async getOwnerSubmissions(t){var e,a,n;let o=new URLSearchParams;(null==t?void 0:null===(e=t.statuses)||void 0===e?void 0:e.length)&&o.set("statuses",t.statuses.join(",")),(null==t?void 0:t.user_id)&&o.set("user_id",t.user_id),(null==t?void 0:t.reign)&&o.set("reign",t.reign),(null==t?void 0:t.type)&&o.set("type",t.type),(null==t?void 0:t.q)&&o.set("q",t.q),(null==t?void 0:null===(a=t.id)||void 0===a?void 0:a.trim())&&o.set("id",t.id.trim()),(null==t?void 0:t.lat)!=null&&Number.isFinite(t.lat)&&o.set("lat",String(t.lat)),(null==t?void 0:t.lng)!=null&&Number.isFinite(t.lng)&&o.set("lng",String(t.lng)),(null==t?void 0:null===(n=t.lat_lng)||void 0===n?void 0:n.trim())&&((null==t?void 0:t.lat)==null||(null==t?void 0:t.lng)==null)&&o.set("lat_lng",t.lat_lng.trim()),(null==t?void 0:t.limit)!=null&&o.set("limit",String(t.limit)),(null==t?void 0:t.offset)!=null&&o.set("offset",String(t.offset));let i=o.toString();return(await _.get("/owner/submissions".concat(i?"?".concat(i):""))).data},postOwnerSubmissionsBulk:async t=>(await _.post("/owner/submissions/bulk",t)).data,putOwnerSubmission:async(t,e)=>(await _.put("/owner/submissions/".concat(t),e)).data,deleteOwnerSubmission:async t=>(await _.delete("/owner/submissions/".concat(t))).data,deleteOwnerUser:async t=>(await _.delete("/owner/users/".concat(t))).data,async getOwnerBackfillCandidates(t){let e=new URLSearchParams;(null==t?void 0:t.limit)!=null&&e.set("limit",String(t.limit)),(null==t?void 0:t.status)&&"all"!==t.status&&e.set("status",t.status),(null==t?void 0:t.include_name_coords)&&e.set("include_name_coords","true");let a=e.toString()?"?".concat(e.toString()):"";return(await _.get("/owner/backfill-candidates".concat(a))).data},getOwnerBackfillSuggest:async t=>(await _.get("/owner/backfill-candidates/suggest?postboxId=".concat(encodeURIComponent(t)))).data,async getOwnerManufacturerBackfillCandidates(t){let e=new URLSearchParams;(null==t?void 0:t.limit)!=null&&e.set("limit",String(t.limit));let a=e.toString()?"?".concat(e.toString()):"";return(await _.get("/owner/backfill-candidates/manufacturer".concat(a))).data},async getOwnerInvalidManufacturerCandidates(t){let e=new URLSearchParams;(null==t?void 0:t.limit)!=null&&e.set("limit",String(t.limit));let a=e.toString()?"?".concat(e.toString()):"";return(await _.get("/owner/backfill-candidates/invalid-manufacturer".concat(a))).data},postOwnerBackfill:async t=>(await _.post("/owner/backfill",{updates:t})).data,async getOwnerPhotoDatesBackfillCandidates(t){let e=new URLSearchParams;(null==t?void 0:t.limit)!=null&&e.set("limit",String(t.limit));let a=e.toString()?"?".concat(e.toString()):"";return(await _.get("/owner/backfill-candidates/photo-dates".concat(a))).data},postOwnerApplyPhotoDatesBackfill:async t=>(await _.post("/owner/backfill/photo-dates",{updates:t})).data,async getOwnerPerImageDatesBackfillCandidates(t){let e=new URLSearchParams;(null==t?void 0:t.limit)!=null&&e.set("limit",String(t.limit));let a=e.toString()?"?".concat(e.toString()):"";return(await _.get("/owner/backfill-candidates/per-image-dates".concat(a))).data},postOwnerApplyPerImageDatesBackfill:async t=>(await _.post("/owner/backfill/per-image-dates",{postboxIds:t})).data,async postOwnerImportValidate(t,e){let a=new FormData;return a.append("file",t),a.append("country_code","GB"),e&&a.append("csv_mapping",JSON.stringify(e)),(await _.post("/owner/import/validate",a)).data},postOwnerImport:async t=>(await _.post("/owner/import",{...t,country_code:"GB"})).data,async postOwnerImportWithPhotos(t,e){let a=new FormData;return a.append("file",t),a.append("items",JSON.stringify(e.items)),a.append("country_code","GB"),e.assign_to_user_id&&a.append("assign_to_user_id",e.assign_to_user_id),e.require_approval&&a.append("require_approval","true"),(await _.post("/owner/import/with-photos",a)).data},async postOwnerImportPhotos(t,e){let a=new FormData;return a.append("file",t),(null==e?void 0:e.submitted_by_user_id)&&a.append("submitted_by_user_id",e.submitted_by_user_id),(null==e?void 0:e.status)&&a.append("status",e.status),(null==e?void 0:e.bypass_validation)&&a.append("bypass_validation","true"),(await _.post("/owner/import-photos",a)).data},getOwnerNotificationSettings:async()=>(await _.get("/owner/notification-settings")).data,getOwnerSocialStatus:async()=>(await _.get("/owner/social/status")).data,getOwnerSocialSettings:async()=>(await _.get("/owner/social-settings")).data,getSiteConfig:async()=>P("/site-config"),getOwnerFeatureFlags:async()=>(await _.get("/owner/feature-flags")).data,async updateOwnerFeatureFlags(t){let e=await _.put("/owner/feature-flags",t);return R(),e.data},getOwnerChallenges:async()=>(await _.get("/owner/challenges")).data,getOwnerChallenge:async t=>(await _.get("/owner/challenges/".concat(encodeURIComponent(t)))).data,createOwnerChallenge:async t=>(await _.post("/owner/challenges",t)).data,updateOwnerChallenge:async(t,e)=>(await _.put("/owner/challenges/".concat(encodeURIComponent(t)),e)).data,duplicateOwnerChallenge:async t=>(await _.post("/owner/challenges/".concat(encodeURIComponent(t),"/duplicate"))).data,endOwnerChallenge:async t=>(await _.post("/owner/challenges/".concat(encodeURIComponent(t),"/end"))).data,async deleteO
1wnerChallenge(t){await _.delete("/owner/challenges/".concat(encodeURIComponent(t)))},previewOwnerChallenge:async t=>(await _.get("/owner/challenges/".concat(encodeURIComponent(t),"/preview"))).data,previewOwnerChallengeInput:async t=>(await _.post("/owner/challenges/preview",t)).data,async reorderOwnerChallenges(t){await _.put("/owner/challenges/reorder",{items:t})},bulkEnableChallengesBeta:async t=>(await _.post("/owner/challenges/beta-enable",{user_ids:t})).data,getFeaturedChallenge:async()=>(await _.get("/challenges/featured")).data,async getOwnerChallengeCompletions(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return(await _.get("/owner/challenges/".concat(encodeURIComponent(t),"/completions?limit=").concat(e))).data},async getOwnerLeafTaxonomy(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"GB";return(await _.get("/owner/taxonomy/leaf-types",{params:{country:t}})).data},async getOwnerDesignVariantMismatches(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"GB",e=arguments.length>1?arguments[1]:void 0,a={country:t};return(null==e?void 0:e.limit)!=null&&(a.limit=String(e.limit)),(null==e?void 0:e.skip)!=null&&(a.skip=String(e.skip)),(await _.get("/owner/taxonomy/design-variant-mismatches",{params:a})).data},async postOwnerLeafTaxonomyItem(t){let e=await _.post("/owner/taxonomy/leaf-types",t);return R(),e.data},async putOwnerLeafTaxonomyItem(t,e){let a=await _.put("/owner/taxonomy/leaf-types/".concat(encodeURIComponent(t)),e);return R(),a.data},async putOwnerLeafPatternLabel(t){let e=await _.put("/owner/taxonomy/pattern-labels",t);return R(),e.data},getOwnerLeafTaxonomyItemUsage:async(t,e)=>(await _.get("/owner/taxonomy/leaf-types/".concat(encodeURIComponent(t),"/usage"),{params:{country:e}})).data,async deleteOwnerLeafTaxonomyItem(t,e){let a=await _.delete("/owner/taxonomy/leaf-types/".concat(encodeURIComponent(t)),{params:{country:e}});return R(),a.data},updateOwnerSocialSettings:async t=>(await _.put("/owner/social-settings",t)).data,getOwnerSocialPreview:async t=>(await _.get("/owner/social/preview",{params:{postboxId:t}})).data,postOwnerSocialPostRandom:async t=>(await _.post("/owner/social/post-random",{platforms:t})).data,postOwnerSocialPost:async(t,e,a)=>(await _.post("/owner/social/post",{postboxId:t,platforms:e,...(null==a?void 0:a.customText)!==void 0&&{customText:a.customText},...(null==a?void 0:a.customImageAlt)!==void 0&&{customImageAlt:a.customImageAlt}})).data,updateOwnerNotificationSettings:async t=>(await _.put("/owner/notification-settings",t)).data,postOwnerNotificationTest:async()=>(await _.post("/owner/notification-settings/test")).data,getModeratorMe:async()=>(await _.get("/moderator/me")).data,getModeratorModerationQueueCount:async()=>(await _.get("/moderator/moderation-queue-count")).data,async logModeratorSkip(t,e){await _.post("/moderator/log-action",{action:"skip",task_type:t,task_id:e})},async getMySubmissionsRecentComments(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return(await _.get("/postboxes/my-submissions/recent-comments?limit=".concat(t))).data},canApplyForModerator:async()=>(await _.get("/moderator/can-apply")).data,applyForModerator:async t=>(await _.post("/moderator/apply",{reason:t})).data,getModeratorApplications:async()=>(await _.get("/moderator/applications")).data,approveModeratorApplication:async t=>(await _.post("/moderator/applications/".concat(t,"/approve"))).data,rejectModeratorApplication:async(t,e)=>(await _.post("/moderator/applications/".concat(t,"/reject"),null!=e?{reason:e}:{})).data,createAPIKey:async t=>(await _.post("/api-keys",{name:t})).data,getAPIKeys:async()=>(await _.get("/api-keys")).data,revokeAPIKey:async t=>(await _.delete("/api-keys/".concat(t))).data,async getAPIKeyUsage(t,e,a){let n=new URLSearchParams;return e&&n.append("startDate",e),a&&n.append("endDate",a),(await _.get("/api-keys/".concat(t,"/usage?").concat(n.toString()))).data},async getMyCorrections(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(await _.get("/corrections/my-corrections?limit=".concat(t,"&offset=").concat(e))).data},getPendingCorrectionsForPostbox:async t=>(await _.get("/corrections/postbox/".concat(t,"/pending"))).data,getPendingSuggestionCountsOnMyPostboxes:async()=>(await _.get("/corrections/on-my-postboxes/counts")).data,respondToCorrectionSuggestion:async(t,e,a)=>(await _.post("/corrections/".concat(t,"/owner-response"),{response:e,comment:a})).data,getCorrectionsByPostbox:async t=>(await _.get("/corrections/postbox/".concat(t))).data,submitCorrection:async(t,e,a,n,o,i)=>(await _.post("/corrections",{postbox_id:t,field:e,old_value:a,new_value:n,reason:o,...i?{duplicate_of_postbox_id:i}:{}})).data,approveCorrection:async t=>(await _.post("/corrections/".concat(t,"/approve"))).data,async rejectCorrection(t,e,a){let n={reason:e||"Correction was not accepted."};return"string"==typeof(null==a?void 0:a.comment)&&a.comment.trim()&&(n.comment=a.comment.trim()),(null==a?void 0:a.silent)===!0&&(n.silent=!0),(await _.post("/corrections/".concat(t,"/reject"),n)).data},getDiscussionHomeFeeds:async()=>(await _.get("/discussions/home-feeds")).data,async listDiscussions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new URLSearchParams;return t.category&&e.set("category",t.category),t.postbox_id&&e.set("postbox_id",t.postbox_id),!0===t.research_needed&&e.set("research_needed","true"),t.thread_type&&e.set("thread_type",t.thread_type),t.reign_name&&e.set("reign_name",t.reign_name),t.tag&&e.set("tag",t.tag),t.sort&&e.set("sort",t.sort),null!=t.limit&&e.set("limit",String(t.limit)),null!=t.offset&&e.set("offset",String(t.offset)),!0===t.exclude_closed&&e.set("exclude_closed","true"),!0===t.pinned_only&&e.set("pinned_only","true"),!0===t.exclude_pinned&&e.set("exclude_pinned","true"),(await _.get("/discussions?".concat(e.toString()))).data},async getDiscussion(t){var e;let a=(await _.get("/discussions/".concat(t))).data.thread;return{...a,posts:null!==(e=a.posts)&&void 0!==e?e:[]}},recordDiscussionView:async t=>(await _.post("/discussions/".concat(t,"/view"))).data,async getDiscussionsByPostbox(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,a=new URLSearchParams({limit:String(e)});return(await _.get("/discussions/postbox/".concat(t,"?").concat(a.toString()))).data},async getDiscussionsResearchNeeded(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=new URLSearchParams({limit:String(t),offset:String(e)});return(await _.get("/discussions/research-needed?".concat(a.toString()))).data},async searchDiscussions(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new URLSearchParams({q:t,limit:String(e),offset:String(a)});return(await _.get("/discussions/search?".concat(n.toString()))).data},async createDiscussionThread(t){let e=new FormData;if(e.append("intent",t.intent),e.append("title",t.title),e.append("content",t.content),t.postbox_id&&e.append("postbox_id",t.postbox_id),t.research_needed_types)for(let a of t.research_needed_types)e.append("research_needed_types",a);if(t.tags)for(let a of t.tags)e.append("tags",a);if(t.photos)for(let a of t.photos)e.append("photos",a);let a=await _.post("/discussions",e,{headers:{"Content-Type":"multipart/form-data"}});return{thread:a.data.thread,gallery_queue:a.data.gallery_queue}},async createDiscussionPost(t,e){let a=new FormData;if(a.append("content",e.content),e.parent_id&&a.append("parent_id",e.parent_id),e.quote_post_id&&a.append("quote_post_id",e.quote_post_id),e.photos)for(let t of e.photos)a.append("photos",t);let n=await _.post("/discussions/".concat(t,"/posts"),a,{headers:{"Content-Type":"multipart/form-data"}});return{post:n.data.post,gallery_queue:n.data.gallery_queue}},async deleteDiscussionPost(t){await _.delete("/discussions/posts/".concat(t))},updateDiscussionPost:async(t,e)=>(await _.patch("/discussions/posts/".concat(t),{content:e})).data.post,toggleDiscussionUpvote:async t=>(await _.post("/discussions/posts/".concat(t,"/upvote"))).data,toggleDiscussionWatch:async t=>(await _.post("/discussions/".concat(t,"/watch"))).data,togglePostboxFollow:async t=>(await _.post("/postboxes/".concat(t,"/follow"))).data,async markDiscussionPostHelpful(t){await _.post("/discussions/posts/".concat(t,"/helpful"))},async getMyDiscussionActivity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=new URLSearchParams({limit:String(t)});return(await _.get("/discussions/my-activity?".concat(e.toString()))).data},getDiscussionUnreadSummary:async()=>(await _.get("/discussions/unread-summary")).data,markDiscussionNotificationsRead:async t=>(await _.post("/discussions/notifications/read",t?{thread_id:t}:{})).data,async suggestDiscussionMentions(t,e){var a;let n=new URLSearchParams({q:t});return e&&n.set("thread_id",e),null!==(a=(await _.get("/discussions/mention-suggest?".concat(n.toString()))).data.users)&&void 0!==a?a:[]}
1,async reportDiscussion(t){await _.post("/discussions/reports",t)},async listDiscussionReports(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"open";return(await _.get("/discussions/reports?status=".concat(t))).data},async resolveDiscussionReport(t){await _.post("/discussions/reports/".concat(t,"/resolve"))},async lockDiscussionThread(t,e){await _.post("/discussions/".concat(t,"/lock"),{locked:e})},async closeDiscussionThread(t,e){await _.post("/discussions/".concat(t,"/close"),{reason:e})},async pinDiscussionThread(t,e){await _.post("/discussions/".concat(t,"/pin"),{pinned:e})},async reorderPinnedDiscussions(t){await _.put("/discussions/pinned-order",{thread_ids:t})},async mergeDiscussionThreads(t,e){await _.post("/discussions/".concat(t,"/merge"),{target_id:e})},async deleteDiscussionThread(t){await _.delete("/discussions/".concat(t))},ownerUpdateDiscussionThread:async(t,e)=>(await _.patch("/discussions/".concat(t,"/metadata"),e)).data,getPendingExpertiseBadges:async()=>(await _.get("/discussions/expertise/pending")).data,async awardUserExpertise(t,e){await _.post("/discussions/users/".concat(t,"/expertise"),{badge_id:e})},getOwnerDiscussionSettings:async()=>(await _.get("/owner/discussion-settings")).data,updateOwnerDiscussionSettings:async t=>(await _.put("/owner/discussion-settings",t)).data,getOwnerStaleDiscussionPreview:async()=>(await _.get("/owner/discussion-settings/stale-preview")).data,closeOwnerStaleDiscussions:async()=>(await _.post("/owner/discussion-settings/close-stale")).data};
1function V(t,e){return t&&"no_image.png"!==t?function(t,e){let a=function(t){let e=(t||"").trim();if(!e||"no_image.png"===e)return null;let a=e.replace(/\\/g,"/");if(a.startsWith("http://")||a.startsWith("https://"))try{a=new URL(a).pathname.replace(/^\/+/,"")}catch(t){return null}else a.startsWith("/")&&(a=a.slice(1));return!a||a.includes("..")?null:(a.startsWith("images/")&&(a=a.slice(7)),a.includes("/"))?a:null}(t);if(!a){if(t.startsWith("http://")||t.startsWith("https://")){try{if(u(new URL(t).hostname))return""}catch(t){return""}return t}return""}let n=g();if(n&&!p(e))return"".concat(n,"/").concat(a);if(p(e))return function(t,e){var a;let n=(null===(a=r.env.NEXT_PUBLIC_IMAGES_RESIZE_BASE_URL)||void 0===a?void 0:a.trim().replace(/\/$/,""))||(i._O.includes("postboxmap.co.uk")?"https://resize.postboxmap.co.uk":g());if(!n){let a=m().replace(/\/$/,"");return"".concat(a,"/images/").concat(t).concat(function(t){if(!t)return"";let e=new URLSearchParams;t.size&&e.set("size",t.size),null!=t.w&&e.set("w",String(t.w)),null!=t.h&&e.set("h",String(t.h));let a=e.toString();return a?"?".concat(a):""}(e))}let o=new URLSearchParams;return o.set("f",t),(null==e?void 0:e.size)&&o.set("size",e.size),(null==e?void 0:e.w)!=null&&o.set("w",String(e.w)),(null==e?void 0:e.h)!=null&&o.set("h",String(e.h)),"".concat(n,"/view.php?").concat(o.toString())}(a,e);let o=m();return"".concat(o,"/images/").concat(a)}(t,e):""}let X=V,G=V;function H(t,e){let a=b(),n=new AbortController,o=localStorage.getItem(w),i={};return o&&(i.Authorization="Bearer ".concat(o)),fetch("".concat(a,"/api/moderator/queue-events"),{credentials:"include",signal:n.signal,headers:i}).then(a=>{var n;if(!a.ok){null==e||e(Error("Queue events: ".concat(a.status)));return}let o=null===(n=a.body)||void 0===n?void 0:n.getReader();if(!o){null==e||e(Error("No response body"));return}let i=new TextDecoder,s="";!function a(){o.read().then(e=>{var n;let{done:o,value:r}=e;if(o)return;let l=(s+=i.decode(r,{stream:!0})).split("\n");for(let e of(s=null!==(n=l.pop())&&void 0!==n?n:"",l))if(e.startsWith("data: "))try{let a=JSON.parse(e.slice(6));a.task_type&&a.task_id&&t(a)}catch(t){}a()}).catch(t=>{(null==t?void 0:t.name)!=="AbortError"&&(null==e||e(t))})}()}).catch(t=>{(null==t?void 0:t.name)!=="AbortError"&&(null==e||e(t))}),()=>n.abort()}},79125:function(t,e,a){a.d(e,{s:function(){return n}});function n(){let t=localStorage.getItem("country_code");if(t)return t;let e=window.location.hostname.match(/^([a-z]{2})\./);if(e){let t=e[1].toUpperCase();return localStorage.setItem("country_code",t),t}let a=window.location.pathname.match(/^\/countries\/([A-Z]{2})/);if(a){let t=a[1];return localStorage.setItem("country_code",t),t}return null}},76374:function(t,e,a){a.d(e,{Or:function(){return r},XX:function(){return i},sp:function(){return s},we:function(){return l}});var n=a(40257);let o=new Set(["postboxmap.co.uk","www.postboxmap.co.uk","localhost","127.0.0.1","0.0.0.0"]);function i(t){let e;let a=(null!=t?t:"").trim();if(!a||!/^https?:\/\//i.test(a))return t;try{e=new URL(a)}catch(e){return t}return function(t){var e;let a=t.toLowerCase();if(o.has(a)||a.endsWith(".local"))return!0;let i=void 0!==n?null===(e=n.env)||void 0===e?void 0:"https://postboxmap.co.uk".trim():"";if(!i)return!1;try{let t=new URL(i).hostname.toLowerCase();if(a===t||a==="www.".concat(t)||t==="www.".concat(a))return!0}catch(t){}return!1}(e.hostname)||e.searchParams.has("ref")?t:(e.searchParams.set("ref","postboxmap.co.uk"),e.toString())}function s(t){return i("https://www.google.com/maps?layer=c&cbll=".concat(t))}function r(t){return i("https://www.google.com/maps/search/?api=1&query=".concat(encodeURIComponent(t)))}function l(t,e){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:17;return i("https://www.openstreetmap.org/?mlat=".concat(t,"&mlon=").concat(e,"&zoom=").concat(a))}},63921:function(t,e,a){a.d(e,{NA:function(){return p},_O:function(){return d},_v:function(){return u}});var n,o,i,s,r=a(76374),l=a(40257);let c="https://postboxmap.co.uk",d=function(t){let e=(null!=t?t:"").trim();if(!e)return c;let a=e.replace(/\/$/,"");try{let t=new URL(a).hostname.toLowerCase();if("localhost"===t||"0.0.0.0"===t||"127.0.0.1"===t||t.endsWith(".local"))return c;return a}catch(t){return c}}("https://postboxmap.co.uk");void 0!==l&&(null===(o=l.env)||void 0===o||null===(n=o.NEXT_PUBLIC_OG_IMAGE_URL)||void 0===n||n.trim());let u=(0,r.XX)(void 0!==l&&(null===(s=l.env)||void 0===s?void 0:null===(i=s.NEXT_PUBLIC_INSTAGRAM_URL)||void 0===i?void 0:i.trim())||"https://www.instagram.com/postboxmap.co.uk/"),p=(0,r.XX)("https://www.buymeacoffee.com/lukedev");(0,r.XX)("https://mastodon.social/@postboxmap"),(0,r.XX)("https://bsky.app/profile/postboxmap.bsky.social")},83125:function(t,e,a){a.d(e,{Kk:function(){return d},LC:function(){return c},Rb:function(){return r},aj:function(){return l},cz:function(){return i},uS:function(){return n},xP:function(){return s}});let n="X-Client-Platform";function o(){return window.Capacitor}function i(){var t;
1return function(){let t=o();if(!t)return!1;try{var e,a;if((null===(e=t.isNativePlatform)||void 0===e?void 0:e.call(t))!==!0)return!1;let n=null===(a=t.getPlatform)||void 0===a?void 0:a.call(t);if("web"===n)return!1;if("ios"===n||"android"===n)return!0;return"string"!=typeof n||0===n.length}catch(t){return!1}}()||"undefined"!=typeof navigator&&!!((t=navigator.userAgent)&&t.includes("PostboxMapNative"))}function s(){if(i())return!0;try{if(window.matchMedia("(display-mode: standalone)").matches)return!0}catch(t){}return!0===navigator.standalone}function r(){return i()?"native":s()?"pwa":"browser"}function l(){let t=o();try{var e,a;if((null==t?void 0:null===(e=t.isNativePlatform)||void 0===e?void 0:e.call(t))===!0){let e=null===(a=t.getPlatform)||void 0===a?void 0:a.call(t);if("ios"===e)return"ios";if("android"===e)return"android"}}catch(t){}if(i()){let t="undefined"!=typeof navigator?navigator.userAgent:"";if(/iPhone|iPad|iPod/i.test(t))return"ios";if(/Android/i.test(t))return"android"}return s()?"pwa":"web"}function c(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l();"undefined"!=typeof document&&(document.cookie="".concat("pbm_google_signup_platform","=").concat(encodeURIComponent(t),"; path=/; max-age=300; SameSite=Lax"))}function d(){let t=l();return"ios"===t?"iOS":"android"===t?"Android":"pwa"===t?"PWA":"Web"}}}]);
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.