1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7069],{17984:function(t,e,n){function o(t){return t.map(t=>"".concat(t.name,":").concat(t.size,":").concat(t.lastModified)).join("|")}function r(t){var e,n;if(!t||"object"!=typeof t)return!1;let o=null===(e=t.response)||void 0===e?void 0:e.data;if(400===(null===(n=t.response)||void 0===n?void 0:n.status)&&o&&"object"==typeof o){let t=o.error,e="string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.message?t.message:"";if(/E2144/.test(e)||/Prepared photos are no longer valid/i.test(e))return!0}let r=t instanceof Error?t.message:"string"==typeof t.message?t.message:"";return/E2144/.test(r)||/Prepared photos are no longer valid/i.test(r)}function i(t){return t.fileCount<=0?"none":t.stagingReady&&t.signatureMatches&&t.stagingId?"staging":"multipart"}async function a(t,e){let n;try{return await Promise.race([t.then(t=>t),new Promise(t=>{n=setTimeout(()=>t(null),e)})])}finally{n&&clearTimeout(n)}}n.d(e,{HY:function(){return a},Ig:function(){return i},f3:function(){return o},n:function(){return r},wr:function(){return u}});let u=9e4},17803:function(t,e,n){n.d(e,{AppExperienceProvider:function(){return l},l:function(){return s}});var o=n(57437),r=n(2265);let i="app-experience-enabled",a="app-experience-popup-dismissed",u=(0,r.createContext)(null);function l(t){let{children:e}=t,[n,l]=(0,r.useState)(!1),[s,c]=(0,r.useState)(!1),[f,d]=(0,r.useState)(!1);(0,r.useEffect)(()=>{d(!0)},[]),(0,r.useEffect)(()=>{f&&(l(function(){try{return"1"===localStorage.getItem(i)}catch(t){return!1}}()),c(function(){try{return"1"===localStorage.getItem(a)}catch(t){return!1}}()))},[f]);let p=(0,r.useCallback)(t=>{try{t?localStorage.setItem(i,"1"):localStorage.removeItem(i)}catch(t){}l(t)},[]),h=(0,r.useCallback)(t=>{try{t?localStorage.setItem(a,"1"):localStorage.removeItem(a)}catch(t){}c(t)},[]);return(0,o.jsx)(u.Provider,{value:{preferAppExperience:n,setPreferAppExperience:p,popupDismissed:s,setPopupDismissed:h},children:e})}function s(){return(0,r.useContext)(u)||{preferAppExperience:!1,setPreferAppExperience:()=>{},popupDismissed:!1,setPopupDismissed:()=>{}}}},68039:function(t,e,n){n.d(e,{L6:function(){return l},ZS:function(){return u}});var o=n(63921),r=n(83125);let i="/api/auth/google-callback";function a(t){return t.replace(/\/$/,"")}function u(t){return t.hasClientId&&t.clientReady&&!t.isNativeShell}function l(t){var e;let{flow:n,useRedirect:u="link"!==n,redirectPath:l="/dashboard"}=t;if("link"===n)return{useOneTap:!1,itp_support:!0,theme:"filled_blue",size:"medium",text:"continue_with",shape:"rectangular"};let s={useOneTap:!0,auto_select:"signin"===n,itp_support:!0,theme:"filled_blue",size:"large",text:"signup"===n?"signup_with":"continue_with",shape:"rectangular",width:"320",context:"signup"===n?"signup":"signin"};return u&&("undefined"!=typeof document&&(document.cookie="".concat("pwa_google_redirect","=").concat(encodeURIComponent(l),"; path=/; max-age=300; SameSite=Lax"),(0,r.LC)()),s.ux_mode="redirect",s.login_uri=(null===(e=window.location)||void 0===e?void 0:e.origin)?"".concat(a(window.location.origin)).concat(i):"https://postboxmap.co.uk/api/auth/google-callback".trim()||"".concat(a(o._O)).concat(i)),s}},1072:function(t,e,n){n.d(e,{NativeShellHintProvider:function(){return a},P:function(){return u}});var o=n(57437),r=n(2265);let i=(0,r.createContext)(!1);function a(t){let{initialIsNative:e,children:n}=t;return(0,o.jsx)(i.Provider,{value:e,children:n})}function u(){return(0,r.useContext)(i)}},11233:function(t,e,n){n.d(e,{A7:function(){return u},J2:function(){return v},Sd:function(){return f},TJ:function(){return w},a8:function(){return S},gM:function(){return m},t2:function(){return g}});var o=n(17984);let r=[255,216,255],i=[137,80,78,71],a=[82,73,70,70];function u(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1920,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.85;return new Promise((o,r)=>{if("undefined"==typeof Image){o(t);return}let i=new Image,a=URL.createObjectURL(t);i.onload=()=>{URL.revokeObjectURL(a);let{width:r,height:u}=i;if(r<=e&&u<=e&&"image/jpeg"===t.type){o(t);return}let l=Math.min(1,e/Math.max(r,u)),s=document.createElement("canvas");s.width=Math.max(1,Math.round(r*l)),s.height=Math.max(1,Math.round(u*l));let c=s.getContext("2d");if(!c){o(t);return}c.drawImage(i,0,0,s.width,s.height),s.toBlob(e=>e?o(e):o(t),"image/jpeg",n)},i.onerror=()=>{URL.revokeObjectURL(a),r(Error("Could not read this photo. Try choosing it again."))},i.src=a})}async function l(t,e){let n=e||t.type||"image/jpeg";try{if("function"==typeof t.arrayBuffer){let e=await t.arrayBuffer();if(e.byteLength>0)return new Blob([e],{type:n})}}catch(t){}return new Blob([t],{type:n})}function s(t){return!(t.length<4)&&(!!(r.every((e,n)=>t[n]===e)||i.every((e,n)=>t[n]===e))||!!a.every((e,n)=>t[n]===e)&&t.length>=12&&87===t[8]&&69===t[9]&&66===t[10]&&80===t[11])}async function c(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;try{let n="function"==typeof t.slice?t.slice(0,e):t;if("function"==typeof n.arrayBuffer){let t=await n.arrayBuffer();if(t.byteLength>0)return new Uint8Array(t)}}catch(t){}return null}async function f(t){let e=[];for(let n=0;n<t.length;n++){let o=t[n];if(!(null==o?void 0:o.blob)||0===o.blob.size)throw Error("A photo is missing or empty. Choose your photos again.");let r=await u(o.blob),i=await l(r,"image/jpeg");if(0===i.size)throw Error("A photo could not be prepared. Choose it again.");let a=(o.name||"photo-".concat(n+1)).replace(/\.[^.]+$/,"")||"photo-".concat(n+1),s="".concat(a,".jpg");e.push({name:s,type:"image/jpeg",blob:new File([i],s,{type:"image/jpeg",lastModified:Date.now()})})}return e}async function d(t){if(!t.length)return{ok:!1,reason:"missing",message:"This draft has no photos on this device. Delete it and add the postbox again with Submit (not Save draft)."};for(let e of t){if(!e.blob||0===e.blob.size)return{ok:!1,reason:"empty",message:"A photo from this draft is missing on this device. Delete the draft and add the postbox again with Submit (not Save draft)."};try{let t=await c(e.blob,16);if(t&&!s(t))return{ok:!1,reason:"corrupt",message:"A photo from this draft is damaged on this device. Delete the draft and add the postbox again with Submit (not Save draft)."}}catch(t){return{ok:!1,reason:"corrupt",message:"A photo from this draft could not be read. Delete the draft and add the postbox again with Submit (not Save draft)."}}}return{ok:!0}}function p(t){var e;if(!t||"object"!=typeof t||!("response"in t))return;let n=null===(e=t.response)||void 0===e?void 0:e.status;return"number"==typeof n?n:void 0}function h(t){if(!t||"object"!=typeof t)return"";if("response"in t){var e;let n=null===(e=t.response)||void 0===e?void 0:e.data,o=null==n?void 0:n.error;if("string"==typeof o)return o;if(o&&"object"==typeof o&&"string"==typeof o.message)return o.message}return t instanceof Error?t.message:""}function g(t){let e=p(t);if(401===e||403===e||429===e||413===e||null!=e&&400!==e)return!1;let n=h(t);return/E0005/i.test(n)||/truncated or invalid/i.test(n)||/Unexpected end of form/i.test(n)}let m="The photo upload did not finish (connection or a damaged draft photo). Stay on WiâFi, tap Submit again, or delete this draft and add the postbox with Submit (not Save draft).",b="Photo upload timed out. Stay on WiâFi and tap Submit again. If it keeps failing, delete the draft and add the postbox with Submit (not Save draft).";async function v(t){let e=await d(t);if(!e.ok)return{ok:!1,message:e.message};let n=[];for(let e=0;e<t.length;e++){let o=t[e],r=o.name||"photo-".concat(e+1,".jpg"),i=o.type||"image/jpeg";try{let t=await l(o.blob,i);if(0===t.size)return{ok:!1,message:"A photo from this draft is missing on this device. Delete the draft and add the postbox again with Submit (not Save draft)."};let e=await c(t,16);if(e&&!s(e))return{ok:!1,message:"A photo from this draft is damaged on this device. Delete the draft and add the postbox again with Submit (not Save draft)."};n.push({name:r,type:i,blob:new File([t],r,{type:i,lastModified:Date.now()})})}catch(t){return{ok:!1,message:"A photo from this draft could not be read. Delete the draft and add the postbox again with Submit (not Save draft)."}}}return{ok:!0,files:n.map((t,e)=>{let n=t.name||"photo-".concat(e+1,".jpg"),o=t.type||"image/jpeg";return t.blob instanceof File?t.blob:new File([t.blob],n,{type:o})}),images:n}}function y(t){return new Promise(e=>setTimeout(e,t))}async function w(t,e,n){var r,i,a,u;if(0===t.length)return{ok:!1,error:Error("No photos to upload.")};let l=null!==(r=null==n?void 0:n.attempts)&&void 0!==r?r:3,s=null!==(i=null==n?void 0:n.timeoutMs)&&void 0!==i?i:o.wr,c=null!==(a=null==n?void 0:n.retryGapMs)&&void 0!==a?a:1200,f=Error("Photo upload failed."),d=!1;for(let r=1;r<=l;r++){null==n||null===(u=n.onAttempt)||void 0===u||u.call(n,r,l);let i="undefined"!=typeof AbortController?new AbortController:null,a=e(t,null==i?void 0:i.signal).then(t=>({ok:!0,stagingId:t.stagingId}),t=>({ok:!1,error:t})),h=await (0,o.HY)(a,s);if(null==h){null==i||i.abort(),d=!0,f=Error(b),r<l&&await y(c);continue}if(h.ok)return{ok:!0,stagingId:h.stagingId};f=h.error,d=!1;let m=p(h.error);if(401===m||403===m||429===m||413===m)return{ok:!1,error:h.error};if(r<l&&(g(h.error)||null==m)){await y(c);continue}r<l&&await y(c)}return{ok:!1,error:f,timedOut:d}}function S(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Could not submit. Try again.";if(t instanceof Error&&t.message===b)return b;if(g(t))return m;let n=p(t),o=h(t).trim();return 401===n?o||"Sign in again, then tap Submit on this draft.":403===n?o?"".concat(o," (HTTP 403)"):"Upload was blocked (HTTP 403). Try again on WiâFi, or delete the draft and add the postbox with Submit.":429===n?o||"Too many uploads. Wait a minute, then tap Submit again.":413===n?o||"Photo is too large. Delete the draft and add again with a smaller photo.":o?n&&n>=400?"".concat(o," (HTTP ").concat(n,")"):o:e}},1996:function(t,e,n){n.d(e,{d:function(){return r}});var o=n(2265);function r(){let[t,e]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{let t=window.matchMedia("(max-width: ".concat(767,"px)")),n=()=>e(t.matches);
1return n(),t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[]),t}},91472:function(t,e,n){n.d(e,{DE:function(){return f},Hk:function(){return s},J7:function(){return p},mK:function(){return d},wB:function(){return c}});var o=n(2265),r=n(17803),i=n(1996),a=n(83125),u=n(68039),l=n(1072);function s(){let t=(0,l.P)(),[e,n]=(0,o.useState)(t),u=(0,i.d)(),{preferAppExperience:s}=(0,r.l)();return(0,o.useEffect)(()=>{n((0,a.xP)())},[]),e||t||u&&s}function c(){let t=(0,l.P)(),[e,n]=(0,o.useState)(t);return(0,o.useEffect)(()=>{n((0,a.xP)())},[]),e||t}function f(){let t=(0,l.P)(),[e,n]=(0,o.useState)(t);return(0,o.useEffect)(()=>{if((0,a.cz)()){n(!0);return}let t=!1,e=0,o=()=>{if(!t){if((0,a.cz)()||e>=30){n(!0);return}e+=1,window.setTimeout(o,50)}};return o(),()=>{t=!0}},[]),e}function d(){let t=(0,l.P)(),[e,n]=(0,o.useState)(t),r=f();return(0,o.useEffect)(()=>{r&&n((0,a.cz)())},[r]),e||t}function p(t){let e=d(),n=f();return(0,u.ZS)({hasClientId:t,clientReady:n,isNativeShell:e})}}}]);
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.