PageSourceSearch

https://every-headless.netlify.app/component---src-templates-accou…ile-subscription-js-030ef7834f2e1859bd89.js

js every-headless.netlify.app collected 2026-10-03 10:43:26 UTC 16,748 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="812d1404-8fdb-45e3-94a9-ad995963a93a",e._sentryDebugIdIdentifier="sentry-dbid-812d1404-8fdb-45e3-94a9-ad995963a93a")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"d9f2524b01d9b4b1f11ad0665b6e90406108a90f"},(self.webpackChunkevery_headless=self.webpackChunkevery_headless||[]).push([[297],{14453:function(e,t,n){n.d(t,{h:function(){return c}});var l,a,r=n(96540);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},o.apply(null,arguments)}var c=function(e){return r.createElement("svg",o({width:23,height:23,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),l||(l=r.createElement("circle",{cx:11.101,cy:11.334,r:11.101,fill:"#000"})),a||(a=r.createElement("path",{d:"M6.056 11.6h5.046m5.046 0h-5.046m0 0v4.781m0-4.78V6.289",stroke:"#fff",strokeWidth:1.009})))}},18507:function(e,t,n){var l=n(96540),a=n(86133),r=n(13561),o=n(92898),c=n(23234),i=n(48900),d=n(20967);t.A=e=>{let{children:t,path:n,header:s,footer:u,headerImage:m,pageSettings:f}=e;const{draftChanges:p,paymentMethods:v,isFetched:g}=(0,r.d4)(e=>e.account.subscription),E=(0,r.wA)();return(0,l.useEffect)(()=>{p.unsaved&&setTimeout(()=>{E({type:c.G6})},1e3)},[]),(0,l.useEffect)(()=>{v.length||E((0,d.fb)())},[]),l.createElement(a.A,{path:n,header:s,footer:u,pageSettings:f},l.createElement("div",{className:(0,i.A)("flex w-full mx-auto hd-screen-max-width",m?"mt-2":"lg:mt-16 mt-8")},l.createElement("div",{className:"flex flex-col overflow-hidden w-full"},l.createElement("div",{className:"w-full lg:w-90 mx-auto lg:px-0 px-5"},m&&g&&l.createElement(o.A,{data:m})),t)))}},22653:function(e,t,n){var l=n(96540),a=n(48900);t.A=e=>{let{amount:t=1,width:n="w-full",height:r="h-4",rounded:o="rounded-md",className:c=""}=e;return l.createElement("div",{role:"status","aria-busy":"true","aria-live":"polite"},Array.from({length:t}).map((e,t)=>l.createElement("div",{key:t,className:(0,a.A)("bg-gray-200 animate-pulse my-2",n,r,o,c)})))}},55330:function(e,t,n){n.r(t),n.d(t,{Head:function(){return Q.p},default:function(){return X}});var l=n(96540),a=n(55397),r=n(13561),o=n(27247),c=n(14453),i=n(66057);var d,s,u,m,f=()=>{var e,t,n,a;const{translation:d}=(0,i.S)(),{emailAddress:{emailAddress:s}}=(0,r.d4)(e=>e.account.profile);return l.createElement("div",{className:"no-subscription-container"},l.createElement("div",{className:"w-full"},l.createElement("h2",{className:"mb-2 break-words"},null===(e=d.subscription)||void 0===e||null===(t=e.no_subs)||void 0===t?void 0:t.replace("{email}",s)),l.createElement("span",null,null==d||null===(n=d.subscription)||void 0===n?void 0:n.check_promos),l.createElement(o.A,{to:"/box"},l.createElement("div",{className:"flex justify-center my-4"},l.createElement(c.h,null)," ",l.createElement("span",{className:"ml-2"},null==d||null===(a=d.subscription)||void 0===a?void 0:a.order_now)))))},p=n(55446),v=n(98230);function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},g.apply(null,arguments)}var E,h,b,w,y=function(e){return l.createElement("svg",g({viewBox:"0 0 48 48","aria-hidden":"true"},e),d||(d=l.createElement("rect",{x:8,y:10,width:28,height:28,rx:2,fill:"#2B78C4"})),s||(s=l.createElement("rect",{x:18,y:20,width:28,height:20,rx:2,fill:"#1B4F99"})),u||(u=l.createElement("circle",{cx:22,cy:24,r:8,fill:"#fff"})),m||(m=l.createElement("text",{x:22,y:28,fill:"#1B4F99"},"O")))};function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},x.apply(null,arguments)}var A,N=function(e){return l.createElement("svg",x({viewBox:"0 0 48 48","aria-hidden":"true"},e),E||(E=l.createElement("path",{fill:"#EA4335",d:"M24 9.5c3.7 0 6.3 1.6 7.8 3l5.3-5.2C33.6 4.6 29.2 3 24 3 14.8 3 6.9 8.5 3.4 16.3l6.8 5.3C12 15 17.4 9.5 24 9.5z"})),h||(h=l.createElement("path",{fill:"#4285F4",d:"M46.5 24.5c0-1.6-.1-2.7-.3-3.9H24v7.3h12.8c-.3 2.3-1.8 5.6-5.3 7.9l8.1 6.3c4.7-4.4 6.9-10.9 6.9-17.6z"})),b||(b=l.createElement("path",{fill:"#FBBC05",d:"m10.2 21.6-6.8-5.3C1.3 20.9 0 24.3 0 28c0 3.6 1.3 7 3.4 9.7l6.8-5.3c-1.1-2.2-1.7-3.2-1.7-4.4 0-1.2.6-2.3 1.7-3.4z"})),w||(w=l.createElement("path",{fill:"#34A853",d:"M24 48c6.3 0 11.7-2.1 15.6-5.8l-8.1-6.3c-2.2 1.5-5 2.3-7.5 2.3-6.6 0-12-5.4-13.7-12.6l-6.8 5.3C6.9 43.5 14.8 48 24 48z"})))};function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},C.apply(null,arguments)}var k=function(e){return l.createElement("svg",C({viewBox:"0 0 24 24","aria-hidden":"true"},e),A||(A=l.createElement("path",{fill:"currentColor",d:"M19.67 16.28c-.35.8-.52 1.16-1 1.88-.65.98-1.59 2.2-2.75 2.22-1.03.02-1.29-.66-2.86-.66-1.56 0-1.86.64-2.88.68-1.15.04-2.03-1.07-2.7-2.03-1.47-2.07-2.59-5.86-1.08-8.43.75-1.29 2.11-2.11 3.58-2.13 1.12-.02 2.17.73 2.86.73.7 0 1.96-.9 3.3-.77.56.02 2.14.23 3.15 1.72-2.68 1.45-2.25 5.26.38 6.79zM14.9 2.6c.58-.7 1.4-1.2 2.27-1.26.11.93-.24 1.86-.8 2.53-.57.68-1.36 1.18-2.27 1.11-.09-.92.24-1.84.8-2.38z"})))},_=n(44939);const T=e=>String(e).padStart(2,"0"),D=e=>(e=new Date(e)).getUTCFullYear().toString()+T(e.getUTCMonth()+1)+T(e.getUTCDate())+"T"+T(e.getUTCHours())+T(e.getUTCMinutes())+T(e.getUTCSeconds())+"Z",I=function(e){return void 0===e&&(e=""),String(e).replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/,/g,"\\,").replace(/;/g,"\\;")},S=()=>l.createElement("div",{className:"h-px w-full bg-slate-200"}),O=l.forwardRef(function(e,t){let{icon:n,label:a,onClick:r}=e;return l.createElement("button",{ref:t,role:"menuitem",onClick:r,className:"save-to-calendar-option"},n,l.createElement("span",null,a))});var R=e=>{let{title:t,description:n="",location:a="",label:r,start:o,end:c,timezone:i}=e;const d=(0,l.useId)(),s=(0,l.useId)(),{0:u,1:m}=(0,l.useState)(!1),f=(0,l.useRef)(null),p=(0,l.useRef)(null);(0,l.useEffect)(()=>{const e=e=>{f.current&&!f.current.contains(e.target)&&m(!1)},t=e=>{"Escape"===e.key&&m(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[]),(0,l.useEffect)(()=>{u&&p.current&&p.current.focus()},[u]);const v=(e=>{let{title:t,description:n,location:l,start:a,end:r}=e;const o=D(a),c=D(r),i=o+"/"+c,d=encodeURIComponent(t),s=encodeURIComponent(n),u=encodeURIComponent(l);return{google:"https://calendar.google.com/calendar/render?action=TEMPLATE&text="+d+"&details="+s+"&location="+u+"&dates="+i,outlook:"https://outlook.live.com/calendar/0/deeplink/compose?path=/calendar/action/compose&rru=addevent&subject="+d+"&body="+s+"&location="+u+"&startdt="+encodeURIComponent(o)+"&enddt="+encodeURIComponent(c)}})({title:t,description:n,location:a,start:o,end:c});return l.createElement("div",{ref:f,className:"save-to-calendar"},l.createElement("button",{id:d,type:"button","aria-haspopup":"menu","aria-expanded":u,"aria-controls":s,onClick:()=>m(!u),className:"save-to-calendar-btn"},l.createElement(_.h,{className:"size-5"}),r),u&&l.createElement("div",{id:s,role:"menu","aria-labelledby":d,className:"save-to-calendar-body"},l.createElement(O,{ref:p,onClick:()=>{window.open(v.google,"_blank","noopener"),m(!1)},icon:l.createElement(N,{className:"size-5"}),label:"Google Calendar"}),l.createElement(S,null),l.createElement(O,{onClick:function(){const e=(e=>{let{title:t,description:n,location:l,start:a,end:r,timezone:o}=e;const c=Date.now()+"-"+Math.random().toString(36).slice(2)+"@add-to-calendar",i=D(new Date),d=D(a),s=D(r);return"BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//AddToCalendar//EN\nCALSCALE:GREGORIAN"+(o?"\nX-WR-TIMEZONE:"+I(o):"")+"\nMETHOD:PUBLISH\nBEGIN:VEVENT\nUID:"+c+"\nDTSTAMP:"+i+"\nDTSTART:"+d+"\nDTEND:"+s+"\nSUMMARY:"+I(t)+"\
1n"+(n?"DESCRIPTION:"+I(n)+"\n":"")+(l?"LOCATION:"+I(l)+"\n":"")+"END:VEVENT\nEND:VCALENDAR\n"})({title:t,description:n,location:a,start:o,end:c,timezone:i}),l=new Blob([e],{type:"text/calendar;charset=utf-8"}),r=URL.createObjectURL(l),d=document.createElement("a");d.href=r,d.download=(t||"event"||"event").replace(/[^a-z0-9\-_. ]/gi,"_")+".ics",document.body.appendChild(d),d.click(),d.remove(),URL.revokeObjectURL(r),m(!1)},icon:l.createElement(k,{className:"size-5"}),label:"Apple Calendar"}),l.createElement(S,null),l.createElement(O,{onClick:()=>{window.open(v.outlook,"_blank","noopener"),m(!1)},icon:l.createElement(y,{className:"size-5"}),label:"Outlook.com"})))},L=n(84525),M=n(32292),j=n(70928);var U=()=>{var e,t,n,a,o,c,d,s,u;const{translation:m,langCode:f}=(0,i.S)(),{nextBillingDate:g,chargeOffsetDays:E,isActive:h,shippingAddress:b,deliveryDate:w}=(0,r.d4)(e=>e.account.subscription),{latestSubOrder:y,defaultAddress:x}=(0,r.d4)(e=>e.account.profile),A=(0,l.useRef)(null);if(!h)return l.createElement(l.Fragment,null);const{date:N,isDispatched:C,isTrackable:k}=(0,L.A)(g,E,y,w),_=()=>{var e,t;C?p.oR.error((null===(t=m.subscription)||void 0===t?void 0:t.order_in_transit)||"This order is already in transit and cannot be changed."):null===(e=A.current)||void 0===e||e.call(A)},T=()=>{const e=(0,M.Ay)(N,f,{year:"numeric",month:"short",day:"numeric"}),[t,n,a]=e.split(" "),r=(0,M.AD)(N,f)+", "+n+" "+t.replace(".","")+" "+a,o=(null==b?void 0:b.countryCode)||(null==x?void 0:x.country);return C||!o?r:l.createElement("button",{className:"text-h3-xs md:text-h3 underline",onClick:_},r)};return l.createElement("div",{className:"flex md:flex-row flex-col w-full justify-between md:p-10 px-4 pt-4 pb-8 md:p4 lg:w-90 mx-auto"},l.createElement("div",{className:"flex flex-col"},l.createElement("div",{className:"w-full"},l.createElement("h3",{className:"flex items-center flex-wrap gap-[10px]"},null===(e=m.subscription)||void 0===e?void 0:e.upcoming_delivery," ",l.createElement("span",{className:"date-edit-group"},l.createElement(T,null),l.createElement("button",{className:"edit-button shrink-0",onClick:_},null===(t=m.account)||void 0===t?void 0:t.edit)))),l.createElement("p",{className:"text-secondary pt-2"},C?null===(n=m.subscription)||void 0===n?void 0:n.dispatched_order:l.createElement(l.Fragment,null,(D=null===(a=m.subscription)||void 0===a?void 0:a.undispatched_order,D.split(/{([^}]*)}/g).map((e,t)=>t%2==1?l.createElement("span",{key:t,className:"text-green-discount"},e):e)).map((e,t)=>l.createElement(l.Fragment,{key:t},e," ")),(()=>{const e=1===new Date(N).getDay()?(0,M.bT)(N,-4):(0,M.bT)(g,-1);return(0,M.AD)(e,f)+", "+(0,M.Ay)(e,f)})()))),l.createElement("div",{className:"cursor-pointer my-2 md:my-0"},k&&(null==y||null===(o=y.fulfillments)||void 0===o?void 0:o.length)>0&&l.createElement("a",{target:"_BLANK",className:"header-icon order-icon",href:null==y||null===(c=y.fulfillments[0])||void 0===c||null===(d=c.trackingInfo[0])||void 0===d?void 0:d.url,rel:"noreferrer","aria-label":(null===(s=m.subscription)||void 0===s?void 0:s.track_delivery)+" (opens in new tab)"},l.createElement(v.h,null)," ",null===(u=m.subscription)||void 0===u?void 0:u.track_delivery)),(null==x?void 0:x.address1)&&l.createElement(R,{title:m.account.save_to_calendar_title,label:m.account.save_to_calendar_label,start:new Date(N).setHours(9,0,0,0),location:x.address1+", "+(null==x?void 0:x.country),end:new Date(N).setHours(18,0,0,0)}),l.createElement(j.A,{renderTrigger:e=>{let{openModal:t}=e;return A.current=t,null},hideTrigger:!0,flow:"edit"}));var D},B=n(556),F=n(48900),z=n(82028),P=n(7572),V=n(10519),H=n(88231),G=n(20967);var K=e=>{var t,n;let{products:a,modules:c,cancelledModules:d}=e;const s=(0,r.wA)(),{subscriptionId:u,isFetched:m,isActive:p,isCancelled:v}=(0,r.d4)(e=>e.account.subscription),{firstName:g,displayName:E}=(0,r.d4)(e=>e.account.profile),{translation:h}=(0,i.S)();return(0,l.useEffect)(()=>{v&&(null==d?void 0:d.length)>0&&((0,H.kP)(u),console.log("Track landing page for cancelled subscription"))},[v,d,u]),(0,l.useEffect)(()=>{m&&s((0,G.Kp)())},[s,m]),!u&&m?l.createElement(f,null):l.createElement("section",{className:(0,F.A)("w-full mx-auto mb-10 px-2 md:px-4 lg:px-0","hd-screen-max-width justify-evenly items-start flex flex-col lg:flex-row")},v&&(null==d?void 0:d.length)>0?l.createElement("div",{className:"w-full md:my-10"},l.createElement("h2",{className:"text-center text-h2-md md:text-h2"},null===(t=h.account.welcome_back)||void 0===t?void 0:t.replace("{firstname}",g||E)),l.createElement(B.A,{className:"lg:w-90 mx-auto !my-0",modules:d,allProducts:a})):l.createElement("div",{className:"w-full px-1.5 md:px-0 m-auto flex flex-col"},l.createElement(U,null),l.createElement("div",{className:"flex flex-col mb-5"},l.createElement(z.A,{allProducts:a}),p&&l.createElement("div",{className:"w-full flex justify-center md:mt-5 pb-2.5"},l.createElement(o.A,{to:V.oP,className:"manage-products-link"},l.createElement(P.h,{className:"mr-2.5"}),null===(n=h.subscription)||void 0===n?void 0:n.edit_products)),l.createElement("div",null,l.createElement(B.A,{className:"lg:w-90 mx-auto",modules:c,allProducts:a})))))},Y=n(18507);const W=e=>null!=e&&""!==e;var Z=n(44590),Q=n(59285);var X=e=>{var t,n,o,c,i,d,s,u,m,f;let{pageContext:p,location:v}=e;const{modules:g,cancelledModules:E,header:h,footer:b,products:w,_type:y,headerImage:x,pageSettings:A}=p,{isFetched:N,status:C}=(0,r.d4)(e=>e.account.subscription),{id:k,emailAddress:_,orders:T}=(0,r.d4)(e=>e.account.profile),D=null!==(t=(0,Z.A)(k))&&void 0!==t?t:null,I=null!==(n=null!==(o=T.data.find(e=>e.isSubscription))&&void 0!==o?o:T.data[0])&&void 0!==n?n:null,S=null!==(c=(0,Z.A)(null==I?void 0:I.id))&&void 0!==c?c:null,O=null!==(i=null==I||null===(d=I.name)||void 0===d?void 0:d.replace(/^#/,""))&&void 0!==i?i:null,R=Array.isArray(w)?w.filter(e=>{var t;return null==e||null===(t=e.variant)||void 0===t?void 0:t.id}):[];return function(e){let{apiKey:t,customerId:n,customerEmail:a=null,orderCount:r=null,orderId:o=null,orderNumber:c=null,orderCreatedAt:i=null,enabled:d=!0}=e;(0,l.useEffect)(()=>
1{if(!d)return;if(!t||!n)return;const e=window.setTimeout(()=>{if(document.getElementById("fairing-sdk"))return;const e=document.createElement("script");e.src="https://sdk.fairing.co/sdk/1/fairing.js?t="+Date.now(),e.id="fairing-sdk",e.type="module",e.defer=!0,e.onload=()=>{const e={config:{dismissible:"always",test_mode:!V.p8}},l={};W(a)&&(l.email=a),W(r)&&(l.order_count=String(r)),Object.keys(l).length&&(e.customer=l);const d={};W(o)&&(d.id=String(o)),W(c)&&(d.number=String(c)),W(i)&&(d.created_at=i),Object.keys(d).length&&(e.conversion=d),window.Fairing=window.Fairing(t,n,e),window.Fairing.nextQuestion()},e.onerror=()=>{console.error("Failed to load Fairing SDK")},document.head.appendChild(e)},1e4);return()=>{window.clearTimeout(e);const t=document.getElementById("fairing-sdk");t&&t.remove()}},[d,t,n,a,r,o,c,i])}({apiKey:V.kK,customerId:D,customerEmail:null!==(s=null==_?void 0:_.emailAddress)&&void 0!==s?s:null,orderCount:null!==(u=T.numberOfOrders)&&void 0!==u?u:null,orderId:S,orderNumber:O,orderCreatedAt:null!==(m=null!==(f=null==I?void 0:I.processedAt)&&void 0!==f?f:null==I?void 0:I.createdAt)&&void 0!==m?m:null,enabled:"de"===V.T4&&Boolean(D&&S)}),l.createElement(Y.A,{_type:y,path:v.pathname,header:h,footer:b,headerImage:"CANCELLED"!==C&&x,pageSettings:A},l.createElement(a.A,{path:v.pathname,component:K,products:R,modules:g,cancelledModules:E,showLoader:!N}))}},55397:function(e,t,n){var l=n(98587),a=n(96540),r=n(55015),o=n(13561),c=n(86462),i=n(2269),d=n(90969),s=n(10519),u=n(66057),m=n(22653);const f=["component","showLoader"];t.A=e=>{let{component:t,showLoader:n}=e,p=(0,l.A)(e,f);const{language:v}=(0,u.S)(),{customerState:g}=(0,o.d4)(e=>e.account.profile),{isFetched:E}=(0,o.d4)(e=>e.account.subscription),h=(0,c.useLocation)(),b=(0,i.A)("code",h.search),w=(0,o.wA)();return(0,a.useEffect)(()=>{b&&w((0,d.a2)())},[]),(0,a.useEffect)(()=>{g&&!b&&g===s.Dm.Logged_out&&(0,r.A)("/account/login")},[g,v]),g===s.Dm.Logged_in&&E?a.createElement(t,p):n?a.createElement("div",{className:"w-11/12 mx-auto md:w-5/6 hd-screen-max-width my-8 py-4"},a.createElement(m.A,{amount:22})):null}}}]);
2//# sourceMappingURL=component---src-templates-account-profile-subscription-js-030ef7834f2e1859bd89.js.map

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.