PageSourceSearch

https://static.fantasyfootballhub.co.uk/_next/static/immutable/chunks/2hl9o54ekgte8.js

js fantasyfootballhub.co.uk collected 2026-09-24 19:07:36 UTC 69,462 bytes, 5 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,74070,e=>{"use strict";var t=e.i(8092);let r=50,n=async e=>{let{data:r,error:n}=await (0,t.ffhClient)().GET("/fpl/entries/{id}/leagues",{params:{path:{id:e}}});if(n||!r)throw Error(n?.error?.message??"Failed to load your mini-leagues");return r.data},a=async(e,n=r)=>{let{data:a,error:i,response:s}=await (0,t.ffhClient)().GET("/fpl/entries",{params:{query:{...e,limit:n}}});if(i||!a){let e=i?.error?.message??"Failed to search for FPL teams";if(s?.status===400)throw Error(`Invalid search: ${e}`);throw Error(e)}return a.data};e.s(["buildEntrySearchParams",0,e=>{let t=e.trim();if(!t)return null;if(/^\d+$/.test(t)){let e=parseInt(t,10);return e>0?{fplId:e}:null}return t.length<3?null:{teamName:t}},"fetchEntryLeagues",0,n,"searchFplEntries",0,a])},14670,e=>{"use strict";var t=e.i(91398);e.s(["default",0,({customClasses:e})=>(0,t.jsx)("div",{"data-testid":"loading-spinner",className:`${e} loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-6 w-6`})])},87882,e=>{"use strict";var t=e.i(91398),r=e.i(41158),n=e.i(72043),a=e.i(14670);e.s(["default",0,({onClick:e,href:i,isLink:s,prefetch:o,target:l,rel:c,variant:u,loading:d,disabled:p,children:m,dataState:h,dataCy:f,"data-cy":y,size:g,className:b,id:x})=>{let v=`inline-flex outline-0 justify-center text-center rounded-lg transition-colors font-body font-bold text-base ${(0,n.default)("primary"===u?"border-2 border-transparent py-[7px] px-3 text-white bg-primary-600 hover:bg-primary-800 active:bg-neutral-800":"secondary"===u?"py-[7px] px-3 text-primary-600 bg-transparent border-primary border-2 hover:text-primary-800 hover:border-primary-800 active:border-neutral-800 active:text-neutral-800":"secondary-danger"===u?"py-[7px] px-3 text-danger-600 bg-transparent border-danger-600 border-2 hover:text-danger-800 hover:border-danger-800 active:border-neutral-800 active:text-neutral-800":"tertiary"===u?"my-[9px] mx-3 rounded-none px-0 text-primary-600 bg-transparent border-b-2 border-primary-600 hover:text-primary-800 hover:border-primary-800 active:border-neutral-800 active:text-neutral-800":"danger"===u?"py-[7px] px-3 text-white bg-danger-600 hover:bg-danger-800 active:bg-neutral-800":"greenfriday"===u?"border-2 border-transparent py-[7px] px-3 text-white bg-greenfriday hover:bg-greenfriday active:bg-greenfriday":"")} ${p||d?"cursor-not-allowed bg-opacity-50 bg-neutral-400 text-opacity-50 border-opacity-50 pointer-events-none hover:bg-opacity-50 hover:bg-neutral-400 active:bg-opacity-50 active:bg-neutral-400 ":"cursor-pointer"} ${"small"===g?"text-xs p-1":""} ${b??""}`;if(i){let n=p||d,a=c??("_blank"===l?"noopener noreferrer":void 0);return s&&!n?(0,t.jsx)(r.default,{href:i,prefetch:o,target:l,rel:a,onClick:e,className:v,"data-state":h,"data-cy":f??y,id:x,children:m}):(0,t.jsx)("a",{href:n?void 0:i,target:l,rel:a,onClick:n?void 0:e,"aria-disabled":n||void 0,className:v,"data-state":h,"data-cy":f??y,id:x,children:m})}return(0,t.jsxs)("button",{type:"submit",onClick:e,disabled:d||p,className:v,"data-state":h,"data-cy":f??y,id:x,children:[d&&(0,t.jsx)(a.default,{customClasses:"inline-block mr-2 align-middle"}),d?"":m]})}])},43674,51581,e=>{"use strict";var t=e.i(64034),r=e.i(8092),n=e.i(89436);let a=async e=>{let{data:t,error:a,response:i}=await (0,r.ffhClient)().GET("/users/me",{headers:(0,n.authHeader)(e)});if(i?.status===404)return null;if(a)throw Error("Failed to load user profile");return t?.data??null},i=async(e,t)=>{let{data:i,error:s,response:o}=await (0,r.ffhClient)().POST("/users/me",{headers:(0,n.authHeader)(e),body:{email:t.email}});if(o?.status===409){let t=await a(e);if(t)return t}if(s||!i?.data)throw Error("Failed to create user profile");return i.data},s=async(e,t,r)=>{let n=await a(e);if(n)return n;let s=e;if(r)try{s=await r()??e}catch(e){console.error("Token refresh before profile create failed:",e)}return i(s,t)},o=async(e,t,a)=>{let{data:i,error:s,response:o}=await (0,r.ffhClient)().PUT("/users/me",{headers:(0,n.authHeader)(e),body:t,signal:a});return s||!i?.data?{ok:!1,status:o?.status??0,message:"Failed to update profile"}:{ok:!0,profile:i.data}},l=async(e,t,r)=>o(e,{fplTeamId:t},r);e.s(["getOrCreateProfile",0,s,"updateFplTeamId",0,l,"updateProfileFields",0,o],51581);var c=e.i(27235),u=e.i(5987),d=e.i(66773),p=e.i(95960);let m=["users-me"],h=async()=>{try{let e=await (0,d.withAccessTokenLock)(()=>fetch(p.ACCESS_TOKEN_ROUTE,{method:"POST"}));if(!e.ok)return null;return(await e.json()).token??null}catch(e){return console.error("Failed to refresh access token before profile create:",e),null}};e.s(["USERS_ME_QUERY_KEY",0,m,"useProfile",0,()=>{let{accessToken:e}=(0,c.useAccessToken)(),{user:r}=(0,u.useAuth0User)(),{data:n,isLoading:a,isError:i,refetch:o}=(0,t.useQuery)({queryKey:[...m,e],queryFn:()=>s(e,{email:r?.email},h),enabled:!!e&&!!r,staleTime:3e5,refetchOnWindowFocus:!1});return{profile:n??null,isLoading:a&&!!e&&!!r,isError:i&&!!e&&!!r,refetch:o}}],43674)},11078,e=>{"use strict";e.i(17585);var t=e.i(81481),r=e.i(65245),n=e.i(47990);let a={FREE:"free",STARTER:"starter",PRO:"pro",ULTRA:"ultra"},i=n.ROLE_LEVELS,s=e=>a[(e?.[r.FFH_ROLES]??[]).reduce((e,t)=>
1(i[t]??-1)>(i[e]??-1)?t:e,"FREE")]??"free";e.s(["getAnalyticsMembershipTier",0,s,"registerSharedSuperProperties",0,e=>{t.posthog.register((({user:e,profile:t,leagueContext:r})=>({platform:"web",membership_tier:s(e),is_logged_in:(0,n.isUserAuthenticated)(e),has_fpl_id:t?.fplTeamId!=null,gameweek:r?.currentGameweek?.number??null}))(e))}])},21430,e=>{"use strict";let t="2026-09-04T17:30:00Z";e.s(["DEADLINE_DISPLAY_FORMAT",0,"dddd D MMMM, h:mma","resolveChangeDeadlineAt",0,e=>{if(!e)return t;if(e.currentGameweek?.number===3)return e.currentGameweek.deadlineAt;if(e.nextGameweek?.number===3)return e.nextGameweek.deadlineAt;let r=e.currentGameweek?.number??null,n=e.nextGameweek?.number??null;return null!==r&&r<3||null!==n&&n<3||"PRE_SEASON"===e.seasonStatus?t:null}])},84178,e=>{"use strict";var t=e.i(65245);let r=["❌ AI Transfers and paid features not included","Get your team rated by our AI","Access to Discord","Live rank","Mini-league analyser","Access to Ben Crellin’s calendar sheet","Price change predictor"];t.MEMBERSHIPS.STARTER_YEARLY_ID,t.MEMBERSHIPS.STARTER_MONTHLY_ID,t.MEMBERSHIPS.PRO_YEARLY_ID,t.MEMBERSHIPS.PRO_YEARLY_ID,t.MEMBERSHIPS.ULTRA_YEARLY_ID,t.MEMBERSHIPS.ULTRA_MONTHLY_ID,t.MEMBERSHIPS.FREE_ID,t.MEMBERSHIPS.FREE_ID;let n={tableHeaders:[{header:""},{header:t.PLAN_NAMES.STARTER,subHeader:"Start getting an edge",yearlyId:t.MEMBERSHIPS.STARTER_YEARLY_ID,discountedAnnualPerMonthPrice:"£2.49",fullAnnualPerMonthPrice:"£4.98",lookup_key:"starter_yearly"},{header:t.PLAN_NAMES.PRO,subHeader:"Everything you need to Win",yearlyId:t.MEMBERSHIPS.PRO_YEARLY_ID,discountedAnnualPerMonthPrice:"£3.99",fullAnnualPerMonthPrice:"£7.98",lookup_key:"pro_yearly"},{header:t.PLAN_NAMES.ULTRA,subHeader:"Personalised Expert Insights",yearlyId:t.MEMBERSHIPS.ULTRA_YEARLY_ID,discountedAnnualPerMonthPrice:"£14.99",fullAnnualPerMonthPrice:"£29.98",lookup_key:"ultra_yearly"}],rows:[{type:"divider",text:"My Team & Hub AI"},{type:"feature",text:"Recommended AI transfers",starter:!0,pro:!0,ultra:!0,backgroundColor:!0},{type:"feature",text:"Team Rated by AI",starter:!0,pro:!0,ultra:!0},{type:"feature",text:"My Team Predicted Points",starter:!0,pro:!0,ultra:!0,backgroundColor:!0},{type:"feature",text:"Team and Chip planning",starter:!0,pro:!0,ultra:!0},{type:"feature",text:"My Team Live Rank",starter:!0,pro:!0,ultra:!0,backgroundColor:!0},{type:"feature",text:"AI Teams of the week",starter:!1,pro:!0,ultra:!0},{type:"divider",text:"Community features"},{type:"feature",text:"Discord",starter:!0,pro:!0,ultra:!0,backgroundColor:!0},{type:"feature",text:"Access to Whatsapp communities",starter:!1,pro:!0,ultra:!0},{type:"feature",text:" Ben Crellin’s planning sheet",starter:!1,pro:!0,ultra:!0,backgroundColor:!0},{type:"divider",text:"Stats tools"},{type:"feature",text:"OPTA Stats Package",starter:!1,pro:!0,ultra:!0,backgroundColor:!0},{type:"feature",text:"Predicted Points Tool",starter:!1,pro:!0,ultra:!0},{type:"feature",text:"Player comparison tool",starter:!1,pro:!0,ultra:!0,backgroundColor:!0},{type:"feature",text:" Fixture analyser",starter:!1,pro:!0,ultra:!0},{type:"feature",text:"Player profiler",starter:!1,pro:!0,ultra:!0,backgroundColor:!0},{type:"divider",text:"Articles & Team Reveals"},{type:"feature",text:"Expert Team Reveals",starter:!1,pro:!0,ultra:!0,backgroundColor:!0},{type:"feature",text:"300+ exclusive ‘Pro’ articles a year ",starter:!1,pro:!0,ultra:!0},{type:"feature",text:"Team news",starter:!1,pro:!0,ultra:!0,backgroundColor:!0},{type:"divider",text:"Extra"},{type:"feature",text:"1 Personalised expert team review per month",starter:!1,pro:!1,ultra:!0},{type:"feature",text:"Ultra Club Secret Whatsapp community with Hub Founder, Will Thomas and Ultra expert, Rich Clarke ",starter:!1,pro:!1,ultra:!0,backgroundColor:!0},{type:"feature",text:"Invite to our end of year meet up",starter:!1,pro:!1,ultra:!0},{type:"feature",text:"Monthly group Zoom calls with Ultra expert, Rich Clarke",starter:!1,pro:!1,ultra:!0,backgroundColor:!0}]},a={starter:["AI transfers tailored to your team","Predict your points every gameweek","Live mini-leagues, price changes & rank"],pro:["Expert & AI team reveals","10+ Pro tools to help you win","Exclusive WhatsApp community membership"],ultra:["Monthly personalised expert team review","Secret Ultra WhatsApp group with Elite managers","Monthly Zoom masterminds"],free:[...r.slice(0,3)]},i={starter:["AI transfers tailored to your team","AI team rating","Predict your points each gameweek","Plan chips & future gameweeks","Real‑time rank, mini‑leagues & prices","Members-only Discord community"],pro:["Full access to My Team","Expert & AI team reveals","Predicted points tool","Fixture analyser","Player profiler","Team & chip planning","Live rank & price tracker","
1Exclusive WhatsApp community","Ben Crellin planning sheet","300+ Pro-only articles a year","Team news updates"],ultra:["Monthly personalised expert team review","Secret Ultra WhatsApp group with Elite managers","Monthly Zoom masterminds","Invite to end-of-year party"],free:[...r.slice(0,3)]},s={aed:"د.إ",aud:"A$",bam:"KM",bdt:"৳",bgn:"лв",bmd:"$",bnd:"B$",cad:"C$",chf:"CHF",cny:"¥",czk:"Kč",dkk:"kr",egp:"E£",eur:"€",gbp:"£",hkd:"HK$",huf:"Ft",ils:"₪",inr:"₹",isk:"kr",jmd:"J$",jpy:"¥",kes:"KSh",kzt:"₸",mad:"د.م.",mur:"₨",mvr:"Rf",mxn:"$",myr:"RM",ngn:"₦",nok:"kr",nzd:"NZ$",pen:"S/",pkr:"₨",pln:"zł",qar:"ر.ق",ron:"lei",rsd:"дин.",sar:"ر.س",sek:"kr",sgd:"S$",thb:"฿",try:"₺",ttd:"TT$",uah:"₴",usd:"$",vnd:"₫",zar:"R"},o=e=>{let t=e.toLowerCase();try{let r=new Intl.NumberFormat("en",{style:"currency",currency:e.toUpperCase(),minimumFractionDigits:0,maximumFractionDigits:0}).format(0).replace(/[\d\s.,]/g,"").trim();if(!r||r===e.toUpperCase()||r.length>4)return s[t]||e.toUpperCase();return r}catch(r){return s[t]||e.toUpperCase()}},l=(e,t)=>{let r=o(t),n=["czk","dkk","nok","sek","isk","huf","pln","ron"].includes(t.toLowerCase()),a=new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e);return n?`${a} ${r}`:`${r}${a}`};e.s(["JOIN_PAGE_REVIEWS",0,[{userName:"iceb0y69",reviewText:"This app is the perfect companion to those that are new to FPL and those that want to improve their rank and defeat their mini league rivals. All the resources you need in one simple app!"},{userName:"SimmoJon",reviewText:"The app has transformed both my understanding and enjoyment of playing Fantasy Football as the analysis and conclusions are extremely well presented and the community is great."},{userName:"Nemo55555",reviewText:"The app has been a game changer. I's been amazing to be able to access such a wealth of data. This is the most useful resource for me as an FPL manager and I'd highly recommend a Hub membership."},{userName:"Mjb500xyz",reviewText:"This is so useful and user-friendly, you can access all the content in one place and it’s easy to navigate. There is so much content on here, thanks to a great community, and I can't recommend it highly enough."}],"JoinTableInfo",0,n,"MOBILE_COLLAPSED_LIST_ITEMS",0,a,"MOBILE_EXPANDED_LIST_ITEMS",0,i,"formatPriceWithSymbol",0,l,"getCurrencySymbol",0,o,"getPriceForCurrency",0,(e,t,r="gbp",n={})=>{let a;if(!e||!e.data)return null;let i=e.data.find(e=>e.lookup_key===t);if(!i)return null;let s=r.toLowerCase(),c=s;"gbp"===s?a=i.unit_amount:i.currency_options&&i.currency_options[s]?a=i.currency_options[s].unit_amount:(a=i.unit_amount,c="gbp");let{includeFormatted:u=!0,includeSymbol:d=!0,discountPercent:p=0}=n,m=a/12/100,h=m*(1-p/100),f={amount:h,currency:c};return u&&(f.formattedPriceWithSymbol=l(h,c),f.comparisonFormattedPriceWithSymbol=l(m,c)),d&&(f.symbol=o(c)),f}])},76746,(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0});var a,i="dahlia",s="https://js.stripe.com",o="".concat(s,"/").concat(i,"/stripe.js"),l=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,c=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,u="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",d=function(){for(var e=document.querySelectorAll('script[src^="'.concat(s,'"]')),t=0;t<e.length;t++){var r,n=e[t];if(r=n.src,l.test(r)||c.test(r))return n}return null},p=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(o).concat(t);var n=document.head||document.body;if(!n)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r},m=function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"9.7.0",startTime:t})},h=null,f=null,y=null,g=function(e,t,r){if(null===e)return null;var a,s=t[0];if("string"!=typeof s)throw Error("Expected publishable key to be of type string, got type ".concat(n(s)," instead."));var o=s.match(/^pk_test/),l=3===(a=e.version)?"v3":a;o&&l!==i&&console.warn("Stripe.js@".concat(l," was loaded on the page, but @stripe/stripe-js@").concat("9.7.0"," expected Stripe.js@").concat(i,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var c=e.apply(void 0,t);return m(c,r),c},b=function(e){var t="invalid load parameters; expected object of shape\n\n    {advancedFraudSignals: boolean}\n\nbut received\n\n    ".concat(JSON.stringify(e),"\n");if(null===e||"object"!==n(e))throw Error(t);if(1===Object.keys(e).length&&"boolean"==typeof e.advancedFraudSignals)return e;throw Error(t)},x=!1,v=function(){for(var e,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];x=!0;var i=Date.now();return(e=a,null!==h?h:(h=new Promise(function(t,r){if("u"<typeof window||"u"<typeof document)return void t(null);if(window.Stripe&&e&&console.warn(u),window.Stripe)return void t(window.Stripe);try{var n,a=d();a&&e?console.warn(u):a?a&&null!==y&&null!==f&&(a.removeEventListener("load",y),a.removeEventListener("error",f),null==(n=a.parentNode)||n.removeChild(a),a=p(e)):a=p(e),y=function(){window.Stripe?t(window.Stripe):r(Error("Stripe.js not available"))},f=function(e){r(Error("Failed to load Stripe.js",{cause:e}))},a.addEventListener("load",y),a.addEventListener("error",f)}catch(e){r(e);return}})).catch(function(e){return h=null,Promise.reject(e)})).then(function(e){return g(e,r,i)})};v.setLoadParameters=function(e){if(!(x&&a&&Object.keys(b(e)).reduce(function(t,r){var n;return t&&e[r]===(null==(n=a)?void 0:n[r])},!0))){if(x)throw Error("You cannot change load parameters after calling loadStripe");a=b(e)}},r.loadStripe=v},55941,(e,t,r)=>{t.exports=e.r(76746)},89966,75745,e=>{"use strict";var t=e.i(91788),r=e.i(91567);function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?n(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=e&&("u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=a){var i=[],s=!0,o=!1;try{for(a=a.call(e);!(s=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(e){o=!0,n=e}finally{try{s||null==a.return||a.return()}finally{if(o)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var c=function(e,r,n){var a=!!n,i=t.default.useRef(n);t.default.useEffect(function(){i.current=n},[n]),t.default.useEffect(function(){if(!a||!e)return function(){};var t=function(){if(i.current)return i.current.apply(i,arguments)};return e.on(r,t),function(){e.off(r,t)}},[a,r,e,i])},u=function(e){var r=t.default.useRef(e);return t.default.useEffect(function(){r.current=e},[e]),r.current},d=function(e){return null!==e&&"object"===i(e)},p="[object Object]",m=function e(t,r){if(!d(t)||!d(r))return t===r;var n=Array.isArray(t);if(n!==Array.isArray(r))return!1;var a=Object.prototype.toString.call(t)===p;if(a!==(Object.prototype.toString.call(r)===p))return!1;if(!a&&!n)return t===r;var i=Object.keys(t),s=Object.keys(r);if(i.length!==s.length)return!1;for(var o={},l=0;l<i.length;l+=1)o[i[l]]=!0;for(var c=0;c<s.length;c+=1)o[s[c]]=!0;var u=Object.keys(o);return u.length===i.length&&u.every(function(n){return e(t[n],r[n])})},h="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;if(null===e||d(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment)return e;throw Error(t)},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;if(d(e)&&"function"==typeof e.then)return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return f(e,t)})};var r=f(e,t);return null===r?{tag:"empty"}:{tag:"sync",stripe:r}},g=function(e){e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"6.6.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.6.0",url:"https://stripe.com/docs/stripe-js/react"}))},b=t.default.createContext(null);b.displayName="ElementsContext";var x=function(e,t){if(!e)throw Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e};r.default.any,r.default.object,r.default.func.isRequired;var v=t.default.createContext(null);v.displayName="CheckoutContext";var j=function(e){var r=t.default.useContext(v),n=t.default.useContext(b);if(!r)return x(n,e);if(!n)return r;throw Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."))},S=["mode"],w=function(e,n,i){var l="".concat(e.charAt(0).toUpperCase()+e.slice(1),"Element"),p=n?function(e){j("mounts <".concat(l,">"));var r=e.id,n=e.className;return t.default.createElement("div",{id:r,className:n})}:function(r){var n,i=r.id,p=r.className,h=r.options,f=void 0===h?{}:h,y=r.onBlur,g=r.onFocus,b=r.onReady,x=r.onChange,v=r.onEscape,w=r.onClick,E=r.onLoadError,C=r.onLoaderStart,P=r.onNetworksChange,k=r.onConfirm,R=r.onCancel,A=r.onShippingAddressChange,N=r.onShippingRateChange,_=r.onSavedPaymentMethodRemove,O=r.onSavedPaymentMethodUpdate,I=r.onAvailablePaymentMethodsChange,T=j("mou
1nts <".concat(l,">")),M="elements"in T?T.elements:null,L="checkoutState"in T?T.checkoutState:null,D=(null==L?void 0:L.type)==="success"||(null==L?void 0:L.type)==="loading"?L.sdk:null,F=o(t.default.useState(null),2),U=F[0],$=F[1],H=t.default.useRef(null),Y=t.default.useRef(null);c(U,"blur",y),c(U,"focus",g),c(U,"escape",v),c(U,"click",w),c(U,"loaderror",E),c(U,"loaderstart",C),c(U,"networkschange",P),c(U,"confirm",k),c(U,"cancel",R),c(U,"shippingaddresschange",A),c(U,"shippingratechange",N),c(U,"savedpaymentmethodremove",_),c(U,"savedpaymentmethodupdate",O),c(U,"availablepaymentmethodschange",I),c(U,"change",x),b&&(n="expressCheckout"===e?b:function(){b(U)}),c(U,"ready",n),t.default.useLayoutEffect(function(){if(null===H.current&&null!==Y.current&&(M||D)){var t=null;if(D)switch(e){case"paymentForm":t=D.createForm(f);break;case"payment":t=D.createPaymentElement(f);break;case"address":if("mode"in f){var r=f.mode,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(f,S);if("shipping"===r)t=D.createShippingAddressElement(n);else if("billing"===r)t=D.createBillingAddressElement(n);else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":t=D.createExpressCheckoutElement(f);break;case"currencySelector":t=D.createCurrencySelectorElement();break;case"taxId":t=D.createTaxIdElement(f);break;case"contactDetails":t=D.createContactDetailsElement();break;default:throw Error("<".concat(l,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}else M&&(t=M.create(e,f));H.current=t,$(t),t&&t.mount(Y.current)}},[M,D,f]);var B=u(f);return t.default.useEffect(function(){if(H.current){var e,t,r,n=(e=f,t=B,r=["paymentRequest"],d(e)?Object.keys(e).reduce(function(n,i){var o=!d(t)||!m(e[i],t[i]);return r.includes(i)?(o&&console.warn("Unsupported prop change: options.".concat(i," is not a mutable property.")),n):o?a(a({},n||{}),{},s({},i,e[i])):n},null):null);n&&"update"in H.current&&H.current.update(n)}},[f,B]),t.default.useLayoutEffect(function(){return function(){if(H.current&&"function"==typeof H.current.destroy)try{H.current.destroy(),H.current=null}catch(e){}}},[]),t.default.createElement("div",{id:i,className:p,ref:Y})};return p.propTypes={id:r.default.string,className:r.default.string,onChange:r.default.func,onBlur:r.default.func,onFocus:r.default.func,onReady:r.default.func,onEscape:r.default.func,onClick:r.default.func,onLoadError:r.default.func,onLoaderStart:r.default.func,onNetworksChange:r.default.func,onConfirm:r.default.func,onCancel:r.default.func,onShippingAddressChange:r.default.func,onShippingRateChange:r.default.func,onSavedPaymentMethodRemove:r.default.func,onSavedPaymentMethodUpdate:r.default.func,onAvailablePaymentMethodsChange:r.default.func,options:r.default.object},p.displayName=l,p.__elementType=e,p},E="u"<typeof window,C=t.default.createContext(null);C.displayName="EmbeddedCheckoutProviderContext";var P=function(){var e=t.default.useContext(C);if(!e)throw Error("<EmbeddedCheckout> must be used within <EmbeddedCheckoutProvider>");return e},k=E?function(e){var r=e.id,n=e.className;return P(),t.default.createElement("div",{id:r,className:n})}:function(e){var r=e.id,n=e.className,a=P().embeddedCheckout,i=t.default.useRef(!1),s=t.default.useRef(null);return t.default.useLayoutEffect(function(){return!i.current&&a&&null!==s.current&&(a.mount(s.current),i.current=!0),function(){if(i.current&&a)try{a.unmount(),i.current=!1}catch(e){}}},[a]),t.default.createElement("div",{ref:s,id:r,className:n})};w("auBankAccount",E),w("card",E),w("cardNumber",E),w("cardExpiry",E),w("cardCvc",E),w("currencySelector",E),w("iban",E),w("payment",E),w("expressCheckout",E),w("paymentRequestButton",E),w("linkAuthentication",E),w("contactDetails",E),w("address",E),w("shippingAddress",E),w("paymentMethodMessaging",E),w("taxId",E),w("issuingCardNumberDis
1play",E),w("issuingCardCvcDisplay",E),w("issuingCardExpiryDisplay",E),w("issuingCardPinDisplay",E),w("issuingCardCopyButton",E),e.s(["EmbeddedCheckout",0,k,"EmbeddedCheckoutProvider",0,function(e){var r=e.stripe,n=e.options,a=e.children,i=t.default.useMemo(function(){return y(r,"Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},[r]),s=t.default.useRef(null),l=t.default.useRef(null),c=o(t.default.useState({embeddedCheckout:null}),2),d=c[0],p=c[1];t.default.useEffect(function(){if(!l.current&&!s.current){var e=function(e){l.current||s.current||(l.current=e,s.current=l.current.createEmbeddedCheckoutPage(n).then(function(e){p({embeddedCheckout:e})}))};"async"===i.tag&&!l.current&&(n.clientSecret||n.fetchClientSecret)?i.stripePromise.then(function(t){t&&e(t)}):"sync"===i.tag&&!l.current&&(n.clientSecret||n.fetchClientSecret)&&e(i.stripe)}},[i,n,d,l]),t.default.useEffect(function(){return function(){d.embeddedCheckout?(s.current=null,d.embeddedCheckout.destroy()):s.current&&s.current.then(function(){s.current=null,d.embeddedCheckout&&d.embeddedCheckout.destroy()})}},[d.embeddedCheckout]),t.default.useEffect(function(){g(l)},[l]);var m=u(r);t.default.useEffect(function(){null!==m&&m!==r&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.")},[m,r]);var h=u(n);return t.default.useEffect(function(){if(null!=h){if(null==n)return void console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.");void 0===n.clientSecret&&void 0===n.fetchClientSecret&&console.warn("Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`."),null!=h.clientSecret&&n.clientSecret!==h.clientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),null!=h.fetchClientSecret&&n.fetchClientSecret!==h.fetchClientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),null!=h.onComplete&&n.onComplete!==h.onComplete&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it."),null!=h.onShippingDetailsChange&&n.onShippingDetailsChange!==h.onShippingDetailsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it."),null!=h.onLineItemsChange&&n.onLineItemsChange!==h.onLineItemsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.")}},[h,n]),t.default.createElement(C.Provider,{value:d},a)}],89966);var R=e.i(55941);let A=null;e.s(["getStripe",0,()=>(A||(A=(0,R.loadStripe)("pk_live_DIJ2ezRkA9yxYliIkbV6EGxU")),A)],75745)},86043,94269,62280,41641,e=>{"use strict";var t=e.i(91788),r=e.i(95184);let n=console;e.s(["defaultLogger",0,n],94269);var a=e.i(51075);class i{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,r.isValidTimeout)(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,null!=e?e:r.isServer?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}e.s(["Removable",0,i],62280);var s=e.i(2435);function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}e.s(["Mutation",0,class extends i{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||n,this.observers=[],this.state=e.state||o(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(t=>t!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,t;return null!=(e=null==(t=this.retryer)?void 0:t.continue())?e:this.execute()}async execute(){var e,t,r,n,a,i,o,l,c,u,d,p,m,h,f,y,g,b,x,v;let j=()=>{var e;return this.retryer=(0,s.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},S="loading"===this.state.status;try{if(!S){this.dispatch({type:"loading",variables:this.options.variables}),await (null==(c=(u=this.mutationCache.config).onMutate)?void 0:c.call(u,this.state.variables,this));let e=await (null==(d=(p=this.options).onMutate)?void 0:d.call(p,this.state.variables));e!==this.state.context&&this.dispatch({type:"loading",context:e,variables:this.state.variables})}let s=await j();return await (null==(e=(t=this.mutationCache.config).onSuccess)?void 0:e.call(t,s,this.state.variables,this.state.context,this)),await (null==(r=(n=this.options).onSuccess)?void 0:r.call(n,s,this.state.variables,this.state.context)),await (null==(a=(i=this.mutationCache.config).onSettled)?void 0:a.call(i,s,null,this.state.variables,this.state.context,this)),await (null==(o=(l=this.options).onSettled)?void 0:o.call(l,s,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:s}),s}catch(e){try{throw await (null==(m=(h=this.mutationCache.config).onError)?void 0:m.call(h,e,this.state.variables,this.state.context,this)),await (null==(f=(y=this.options).onError)?void 0:f.call(y,e,this.state.variables,this.state.context)),await (null==(g=(b=this.mutationCache.config).onSettled)?void 0:g.call(b,void 0,e,this.state.variables,this.state.context,this)),await (null==(x=(v=this.options).onSettled)?void 0:x.call(v,void 0,e,this.state.variables,this.state.context)),e}finally{this.dispatch({type:"error",error:e})}}}dispatch(e){let t=t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"loading":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!(0,s.canFetch)(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPau
1sed:!1,status:"error"};case"setState":return{...t,...e.state}}};this.state=t(this.state),a.notifyManager.batch(()=>{this.observers.forEach(t=>{t.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}},"getDefaultState",0,o],41641);var l=e.i(86253);class c extends l.Subscribable{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;let n=this.options;this.options=this.client.defaultMutationOptions(e),(0,r.shallowEqualObjects)(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(t=this.currentMutation)||t.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.currentMutation)||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();let t={listeners:!0};"success"===e.type?t.onSuccess=!0:"error"===e.type&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==e?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let e=this.currentMutation?this.currentMutation.state:o(),t="loading"===e.status,r={...e,isLoading:t,isPending:t,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(e){a.notifyManager.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var t,r,n,a,i,s,o,l;e.onSuccess?(null==(t=(r=this.mutateOptions).onSuccess)||t.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(n=(a=this.mutateOptions).onSettled)||n.call(a,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):e.onError&&(null==(i=(s=this.mutateOptions).onError)||i.call(s,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(o=(l=this.mutateOptions).onSettled)||o.call(l,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)})})}}var u=e.i(50241),d=e.i(62027),p=e.i(29558);function m(){}e.s(["useMutation",0,function(e,n,i){let s=(0,r.parseMutationArgs)(e,n,i),o=(0,d.useQueryClient)({context:s.context}),[l]=t.useState(()=>new c(o,s));t.useEffect(()=>{l.setOptions(s)},[l,s]);let h=(0,u.useSyncExternalStore)(t.useCallback(e=>l.subscribe(a.notifyManager.batchCalls(e)),[l]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),f=t.useCallback((e,t)=>{l.mutate(e,t).catch(m)},[l]);if(h.error&&(0,p.shouldThrowError)(l.options.useErrorBoundary,[h.error]))throw h.error;return{...h,mutate:f,mutateAsync:h.mutate}}],86043)},35588,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return R}});let n=e.r(41705),a=e.r(52456),i=e.r(91398),s=a._(e.r(91788)),o=a._(e.r(30943)),l=n._(e.r(80963)),c=e.r(15125),u=e.r(71914),d=e.r(13521),p=e.r(94470),m=e.r(70090),h=e.r(68816),f=e.r(20262);function y(e){return"/"===e[0]?e.slice(1):e}let g="function"==typeof o.preload,b={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1},x=new Set,v="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let j=new Map([["default",function({config:e,src:t,width:r,quality:n}){if(!e.dangerouslyAllowSVG&&t.split("?",1)[0].endsWith(".svg"))return t;let a=(0,f.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//"))if(t.includes("/_next/static/immutable")&&!(0,f.getAssetToken)())a=void 0;else{let e=t.indexOf("?");if(-1!==e){let r=new URLSearchParams(t.slice(e+1)),n=r.get("dpl");if(n){a=n,r.delete("dpl");let i=r.toString();t=t.slice(0,e)+(i?"?"+i:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
2Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,
2configurable:!0});let i=(0,h.findClosestQuality)(n,e);return`${(0,m.normalizePathTrailingSlash)(e.path)}?url=${encodeURIComponent(t)}&w=${r}&q=${i}${t.startsWith("/")&&a?`&dpl=${a}`:""}`}],["imgix",function({config:e,src:t,width:r,quality:n}){let a=new URL(`${e.path}${y(t)}`),i=a.searchParams;return i.set("auto",i.getAll("auto").join(",")||"format"),i.set("fit",i.get("fit")||"max"),i.set("w",i.get("w")||r.toString()),n&&i.set("q",n.toString()),a.href}],["cloudinary",function({config:e,src:t,width:r,quality:n}){let a=["f_auto","c_limit","w_"+r,"q_"+(n||"auto")].join(",")+"/";return`${e.path}${a}${y(t)}`}],["akamai",function({config:e,src:t,width:r}){return`${e.path}${y(t)}?imwidth=${r}`}],["custom",function({src:e}){throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
3Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}]]);function S(e){return void 0!==e.default}function w({config:e,src:t,unoptimized:r,layout:n,width:a,quality:i,sizes:s,loader:o}){if(r){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,f.getDeploymentId)();if(t.includes("/_next/static/immutable")&&!(0,f.getAssetToken)())e=void 0;else if(e){let r=t.indexOf("?");if(-1!==r){let n=new URLSearchParams(t.slice(r+1));n.get("dpl")||(n.append("dpl",e),t=t.slice(0,r)+"?"+n.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:l,kind:c}=function({deviceSizes:e,allSizes:t},r,n,a){if(a&&("fill"===n||"responsive"===n)){let r=/(^|\s)(1?\d?\d)vw/g,n=[];for(let e;e=r.exec(a);)n.push(parseInt(e[2]));if(n.length){let r=.01*Math.min(...n);return{widths:t.filter(t=>t>=e[0]*r),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof r||"fill"===n||"responsive"===n?{widths:e,kind:"w"}:{widths:[...new Set([r,2*r].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,a,n,s),u=l.length-1;return{sizes:s||"w"!==c?s:"100vw",srcSet:l.map((r,n)=>`${o({config:e,src:t,quality:i,width:r})} ${"w"===c?r:n+1}${c}`).join(", "),src:o({config:e,src:t,quality:i,width:l[u]})}}function E(e){return"number"==typeof e?e:"string"==typeof e?parseInt(e,10):void 0}function C(e){let t=e.config?.loader||"default",r=j.get(t);if(r)return r(e);throw Object.defineProperty(Error(`Unknown "loader" found in "next.config.js". Expected: ${c.VALID_LOADERS.join(", ")}. Received: ${t}`),"__NEXT_ERROR_CODE",{value:"E1026",enumerable:!1,configurable:!0})}function P(e,t,r,n,a,i){e&&e.src!==v&&e["data-loaded-src"]!==t&&(e["data-loaded-src"]=t,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentNode&&(x.add(t),"blur"===n&&i(!0),a?.current)){let{naturalWidth:t,naturalHeight:r}=e;a.current({naturalWidth:t,naturalHeight:r})}}))}let k=({imgAttributes:e,heightInt:t,widthInt:r,qualityInt:n,layout:a,className:o,imgStyle:l,blurStyle:c,isLazy:u,placeholder:d,loading:p,srcString:m,config:h,unoptimized:f,loader:y,onLoadingCompleteRef:g,setBlurComplete:b,setIntersection:x,onLoad:v,onError:j,isVisible:S,noscriptSizes:E,...C})=>(p=u?"lazy":p,(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("img",{...C,...e,decoding:"async","data-nimg":a,className:o,style:{...l,...c},ref:(0,s.useCallback)(e=>{x(e),e?.complete&&P(e,m,a,d,g,b)},[x,m,a,d,g,b]),onLoad:e=>{P(e.currentTarget,m,a,d,g,b),v&&v(e)},onError:e=>{"blur"===d&&b(!0),j&&j(e)}}),(u||"blur"===d)&&(0,i.jsx)("noscript",{children:(0,i.jsx)("img",{...C,loading:p,decoding:"async","data-nimg":a,style:l,className:o,...w({config:h,src:m,unoptimized:f,layout:a,width:r,quality:n,sizes:E,loader:y})})})]}));function R({src:e,sizes:t,unoptimized:r=!1,priority:n=!1,loading:a,lazyRoot:o=null,lazyBoundary:m,className:h,quality:f,width:y,height:j,style:P,objectFit:A,objectPosition:N,onLoadingComplete:_,placeholder:O="empty",blurDataURL:I,...T}){var M;let L,D=(0,s.useContext)(d.ImageConfigContext),F=(0,s.useMemo)(()=>{let e=b||D||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t),n=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r,qualities:n,localPatterns:"u"<typeof window?D?.localPatterns:e.localPatterns}
3},[D]),U=t?"responsive":"intrinsic";"layout"in T&&(T.layout&&(U=T.layout),delete T.layout);let $=C;if("loader"in T){if(T.loader){let e=T.loader;$=t=>{let{config:r,...n}=t;return e(n)}}delete T.loader}let H="";if("object"==typeof(M=e)&&(S(M)||void 0!==M.src)){let t=S(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(I=I||t.blurDataURL,H=t.src,(!U||"fill"!==U)&&(j=j||t.height,y=y||t.width,!t.height||!t.width))throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0})}e="string"==typeof e?e:H,(0,p.warnOnce)(`Image with src "${e}" is using next/legacy/image which is deprecated and will be removed in a future version of Next.js.`);let Y=!n&&("lazy"===a||void 0===a);(e.startsWith("data:")||e.startsWith("blob:"))&&(r=!0,Y=!1),"u">typeof window&&x.has(e)&&(Y=!1),F.unoptimized&&(r=!0);let[B,W]=(0,s.useState)(!1),[z,G,q]=(0,u.useIntersection)({rootRef:o,rootMargin:m||"200px",disabled:!Y}),K=!Y||G,X={boxSizing:"border-box",display:"block",overflow:"hidden",width:"initial",height:"initial",background:"none",opacity:1,border:0,margin:0,padding:0},Q={boxSizing:"border-box",display:"block",width:"initial",height:"initial",background:"none",opacity:1,border:0,margin:0,padding:0},V=!1,J=E(y),Z=E(j),ee=E(f),et=Object.assign({},P,{position:"absolute",top:0,left:0,bottom:0,right:0,boxSizing:"border-box",padding:0,border:"none",margin:"auto",display:"block",width:0,height:0,minWidth:"100%",maxWidth:"100%",minHeight:"100%",maxHeight:"100%",objectFit:A,objectPosition:N}),er="blur"!==O||B?{}:{backgroundSize:A||"cover",backgroundPosition:N||"0% 0%",filter:"blur(20px)",backgroundImage:`url("${I}")`};if("fill"===U)X.display="block",X.position="absolute",X.top=0,X.left=0,X.bottom=0,X.right=0;else if(void 0!==J&&void 0!==Z){let e=Z/J,t=isNaN(e)?"100%":`${100*e}%`;"responsive"===U?(X.display="block",X.position="relative",V=!0,Q.paddingTop=t):"intrinsic"===U?(X.display="inline-block",X.position="relative",X.maxWidth="100%",V=!0,Q.maxWidth="100%",L=`data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%27${J}%27%20height=%27${Z}%27/%3e`):"fixed"===U&&(X.display="inline-block",X.position="relative",X.width=J,X.height=Z)}let en={src:v,srcSet:void 0,sizes:void 0};K&&(en=w({config:F,src:e,unoptimized:r,layout:U,width:J,quality:ee,sizes:t,loader:$}));let ea=e,ei=g?void 0:{imageSrcSet:en.srcSet,imageSizes:en.sizes,crossOrigin:T.crossOrigin,referrerPolicy:T.referrerPolicy},es="u"<typeof window?s.default.useEffect:s.default.useLayoutEffect,eo=(0,s.useRef)(_),el=(0,s.useRef)(e);(0,s.useEffect)(()=>{eo.current=_},[_]),es(()=>{el.current!==e&&(q(),el.current=e)},[q,e]);let ec={isLazy:Y,imgAttributes:en,heightInt:Z,widthInt:J,qualityInt:ee,layout:U,className:h,imgStyle:et,blurStyle:er,loading:a,config:F,unoptimized:r,placeholder:O,loader:$,srcString:ea,onLoadingCompleteRef:eo,setBlurComplete:W,setIntersection:z,isVisible:K,noscriptSizes:t,...T};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("span",{style:X,children:[V?(0,i.jsx)("span",{style:Q,children:L?(0,i.jsx)("img",{style:{display:"block",maxWidth:"100%",width:"initial",height:"initial",background:"none",opacity:1,border:0,margin:0,padding:0},alt:"","aria-hidden":!0,src:L}):null}):null,(0,i.jsx)(k,{...ec})]}),!g&&n?(0,i.jsx)(l.default,{children:(0,i.jsx)("link",{rel:"preload",as:"image",href:en.srcSet?void 0:en.src,...ei},"__nimg-"+en.src+en.srcSet+en.sizes)}):null]})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},80897,(e,t,r)=>{t.exports=e.r(35588)},68816,(e,t,r)=>{"use strict";function n(e,t){let r=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>
3Math.abs(t-r)<Math.abs(e-r)?t:e,t.qualities[0]):r}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"findClosestQuality",{enumerable:!0,get:function(){return n}})},13521,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageConfigContext",{enumerable:!0,get:function(){return i}});let n=e.r(41705)._(e.r(91788)),a=e.r(15125),i=n.default.createContext(a.imageConfigDefault)},15125,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={VALID_LOADERS:function(){return i},imageConfigDefault:function(){return s}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=["default","imgix","cloudinary","akamai","custom"],s={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},94470,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},17176,(e,t,r)=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},10432,(e,t,r)=>{"use strict";var n=e.r(17176);function a(){}function i(){}i.resetWarningCache=a,t.exports=function(){function e(e,t,r,a,i,s){if(s!==n){var o=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:a};return r.PropTypes=r,r}},91567,(e,t,r)=>{t.exports=e.r(10432)()},69335,e=>{"use strict";var t=e.i(91398),r=e.i(91788),n=e.i(58678),a=e.i(3828),i=e.i(5987),s=e.i(40892),o=e.i(94834),l=e.i(53157),c=e.i(8092),u=e.i(89436);o.default.extend(l.default);let d=e=>e?o.default.utc(e).format("MMMM D, YYYY"):null,p=async({accessToken:e})=>{let{data:t,error:r,response:n}=await (0,c.ffhClient)().GET("/users/me/subscription",{headers:(0,u.authHeader)(e)});if(404===n.status)return{hasSubscription:!1};if(r||!t?.data)throw Error("Failed to load subscription details");let a=t.data;return{hasSubscription:!0,subscription:{...a,invoice:a.invoice?{...a.invoice,nextPaymentDate:d(a.invoice.nextPaymentDate),subscriptionExpiresOn:d(a.invoice.subscriptionExpiresOn)}:null}}},m=async({accessToken:e})=>{let{data:t,error:r}=await (0,c.ffhClient)().POST("/users/me/subscription/billing",{headers:(0,u.authHeader)(e)});return r||!t?.data?{error:!0}:t.data},h=async({accessToken:e,sessionId:t})=>{let{error:r}=await (0,c.ffhClient)().POST("/users/me/subscription/billing/confirm",{headers:(0,u.authHeader)(e),body:{sessionId:t}});return{isSuccess:!r}};var f=e.i(47990),y=e.i(4772),g=e.i(11078);let b=e=>e?.toLowerCase();var x=e.i(65245),v=e.i(87882),j=e.i(53795),S=e.i(84533);let w=()=>(0,t.jsxs)("div",{className:"shadow-md rounded-lg p-4 my-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(S.H3,{children:"Managing your PayPal subscription"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(S.BodyRegular,{children:"Your renewal date, price and payment details are held by PayPal. Sign in to PayPal and open your automatic payments to view or change them."})})]}),(0,t.jsx)("div",{className:"mt-5 sm:mt-6 sm:grid sm:grid-cols-2 sm:gap-3 sm:grid-flow-row-dense",children:(0,t.jsx)(v.default,{href:x.PAYPAL_AUTOPAY_URL,target:"_blank",rel:"noopener noreferrer",variant:"tertiary",children:"Manage on PayPal"})})]});var E=e.i(86043),C=e.i(64034),P=e.i(62027),k=e.i(51581),R=e.i(74070),A=e.i(21430),N=e.i(27235),_=e.i(48843),O=e.i(43674);o.default.extend(l.default);let I=/^\d+$/,T=(e,t=Number.MAX_SAFE_INTEGER)=>{if(!I.test(e.trim()))return null;let r=parseInt(e.trim(),10);return r>0&&r<=t?r:null},M="w-full rounded-lg border border-neutral-300 px-4 py-3 font-open-sans text-base text-neutral-900 focus:border-primary-500 focus:outline-none",L="mb-1 block font-open-sans text-sm font-bold text-neutral-800",D=()=>{let{profile:e}=(0,O.useProfile)(),{accessToken:n}=(0,N.useAccessToken)(),{context:a}=(0,_.useLeagueContext)(),i=(0,P.useQueryClient)(),[s,l]=(0,r.useState)(!1),[c,u]=(0,r.useState)(""),[d,p]=(0,r.useState)(null),[m,h]=(0,r.useState)(""),[f,y]=(0,r.useState)(""),g=e?.fplTeamId??null,b=e?.miniLeagueId??null,
3j=a?.isFplUpdating===!0;(0,r.useEffect)(()=>{h(""),y("")},[d]);let w=(0,C.useQuery)({queryKey:["fpl-entry-leagues",g],queryFn:()=>(0,R.fetchEntryLeagues)(g),enabled:!j&&null!==g&&null!==b,retry:!1,refetchOnWindowFocus:!1}),I=(0,C.useQuery)({queryKey:["fpl-entry-leagues",d],queryFn:()=>(0,R.fetchEntryLeagues)(d),enabled:s&&null!==d,retry:!1,refetchOnWindowFocus:!1}),D=(0,E.useMutation)({mutationFn:async e=>{if(!n)throw Error("No access token available");let t=await (0,k.updateProfileFields)(n,e);if(!t.ok)throw Error(t.message);return t.profile},onSuccess:()=>{i.invalidateQueries({queryKey:O.USERS_ME_QUERY_KEY})},onSettled:()=>{l(!1)}});if(null===b)return null;let F=(0,A.resolveChangeDeadlineAt)(a),U=null!==F&&Date.now()<Date.parse(F),$=null!==F?(0,o.default)(F).format(A.DEADLINE_DISPLAY_FORMAT):null,H=w.data??[],Y=H.find(e=>e.leagueId===b)?.name??null,B=e?.miniLeagueCapturedAt?o.default.utc(e.miniLeagueCapturedAt).format("D MMMM YYYY"):null,W=T(c,x.MAX_FPL_TEAM_ID),z=null!==d&&d===W,G=null!==W&&d!==W,q=I.data??[],K=I.isError||I.isSuccess&&0===q.length,X=d===g&&q.some(e=>e.leagueId===b),Q=m||(X?String(b):""),V=K?T(f):T(Q),J=U&&null!==W&&null!==V&&z&&!!n&&!D.isLoading;return(0,t.jsxs)("section",{className:"mt-10 mb-10 border-t border-neutral-200 pt-10 md:mb-0","data-cy":"account-mini-league-section",children:[(0,t.jsx)(S.H1,{children:"Your mini league"}),(0,t.jsx)("p",{className:"mt-2 max-w-[620px] font-open-sans text-sm leading-5 text-neutral-600",children:U?`The mini league we'll hold you to for the Mini-League Promise. You can change your league or FPL ID until the Gameweek 3 deadline${$?` (${$})`:""}.`:"The mini league we'll hold you to for the Mini-League Promise."}),s?(0,t.jsxs)("div",{className:"mt-5 flex max-w-[520px] flex-col gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"account-mini-league-fpl-id",className:L,children:"Your FPL ID"}),(0,t.jsx)("input",{id:"account-mini-league-fpl-id","data-cy":"account-mini-league-fpl-id",type:"text",inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 1234567",className:M,value:c,onChange:e=>u(e.target.value.replace(/\D/g,""))})]}),(0,t.jsx)(v.default,{variant:"secondary",onClick:()=>null!==W&&p(W),disabled:!G,dataCy:"account-mini-league-find",children:"Find my mini leagues"}),I.isFetching&&(0,t.jsx)("p",{className:"animate-pulse font-open-sans text-sm text-neutral-600",children:"Looking up your mini leagues…"}),!I.isFetching&&z&&q.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"account-mini-league-select",className:L,children:"Choose your mini league"}),(0,t.jsxs)("select",{id:"account-mini-league-select","data-cy":"account-mini-league-select",className:M,value:Q,onChange:e=>h(e.target.value),children:[(0,t.jsx)("option",{value:"",disabled:!0,children:"Select a mini league"}),q.map(e=>(0,t.jsx)("option",{value:e.leagueId,children:`${e.name} (${e.leagueId})`},e.leagueId))]})]}),!I.isFetching&&z&&K&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"account-mini-league-manual",className:L,children:"Your mini league ID"}),(0,t.jsx)("input",{id:"account-mini-league-manual","data-cy":"account-mini-league-manual",type:"text",inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 987654",className:M,value:f,onChange:e=>y(e.target.value.replace(/\D/g,""))}),(0,t.jsx)("p",{className:"mt-1 font-open-sans text-xs text-neutral-500",children:"We couldn’t list your leagues yet. Paste the ID from your league’s URL on the FPL site instead."})]}),!z&&null!==W&&(0,t.jsx)("p",{className:"font-open-sans text-sm text-amber-600",children:"You changed your FPL ID. Search again to update your mini leagues."}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(v.default,{variant:"primary",onClick:()=>{U&&null!==W&&null!==V&&z&&D.mutate({fplTeamId:W,miniLeagueId:V})},disabled:!J,dataCy:"account-mini-league-save",children:D.isLoading?"Saving…":"Save changes"}),(0,t.jsx)(v.default,{variant:"tertiary",onClick:()=>l(!1),dataCy:"account-mini-league-cancel",children:"Cancel"})]})]}):(0,t.jsxs)("div",{className:"mt-5",children:[(0,t.jsxs)("div",{className:"grid max-w-[900px] grid-cols-2 gap-2 p-1 md:grid-cols-4",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(S.H4,{className:"pb-1",children:"League"}),(0,t.jsx)(S.BodyRegular,{"data-cy":"account-mini-league-name",children:Y??`Mini league #${b}`})]}),null!==Y&&(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(S.H4,{className:"pb-1",children:"League ID"}),(0,t.jsx)(S.BodyRegular,{"data-cy":"account-mini-league-id",children:b})]}),null!==g&&(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(S.H4,{className:"pb-1",children:"FPL ID"}),(0,t.jsx)(S.BodyRegular,{children:g})]}),null!==B&&(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(S.H4,{className:"pb-1",children:"Submitted"}),(0,t.jsx)(S.BodyRegular,{children:B})]})]}),(0,t.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-4",children:[U&&null!==g&&(0,t.jsx)(v.default,{variant:"secondary",onClick:()=>{D.reset(),h(""),y(""),u(String(g)),p(g),l(!0)},dataCy:"account-mini-league-change",children:"Change details"}),!U&&(0,t.jsx)("p",{"data-cy":"account-mini-league-locked",className:"font-open-sans text-sm text-neutral-600",children:"Locked for the 2026/27 season. League changes closed at the Gameweek 3 deadline."}),D.isSuccess&&(0,t.jsx)("p",{className:"font-open-sans text-sm font-bold text-success-700",children:"Mini league updated."}),D.isError&&(0,t.jsx)("p",{className:"font-open-sans text-sm font-bold text-danger-600",children:"Something went wrong saving your mini league. Please try again."})]})]})]})},F=({isAppSubscription:e,isStripeMember:r,setIsCancelPlanOpen:n,initChurnkey:a})=>e||!r?null:(0,t.jsx)("a",{className:"flex justify-center mt-6 sm:my-0 cursor-pointer text-red-500",onClick:()=>r?a():n(!0),children:"Cancel"});var U=e.i(80897);let $=({setIsCancelPlanOpen:e,user:r})=>{let n=(0,f.getUserSubscriptionInfo)(r);return(0,t.jsxs)("div",{className:"p-6 min-w-80 md:min-w-60 xl:min-w-50 md:min-
3h-20 max-h-screen",children:[(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)(U.default,{className:"w-full lg:rounded-lg",src:"/images/pep2.png",height:380,width:305,priority:!0,alt:"fantasy football hub"})}),(0,t.jsxs)("div",{className:"flex flex-col justify-center p-6",children:[(0,t.jsxs)(S.BodyRegular,{children:["Since you signed up via"," ",n?.source?.provider==="paypal"?"Paypal":"the app",", please cancel your subscription there."]}),(0,t.jsx)("div",{className:"flex justify-evenly my-6",children:(0,t.jsx)("div",{children:(0,t.jsx)(v.default,{onClick:()=>{e(!1)},variant:"danger",children:"Got it"})})})]})]})},H=({isAppSubscription:e})=>e?(0,t.jsx)("div",{className:"font-semibold",children:"Please manage your subscription via the mobile app."}):(0,t.jsx)(v.default,{href:"/member-upgrade",isLink:!0,variant:"primary",children:"Change Plan"}),Y=({hasPaidSubscription:e,isAppSubscription:r,hasRecurringSubscription:n,nextPaymentDate:a,nextPaymentAmount:i,setIsCancelPlanOpen:s,initChurnkey:o,isCancelPlanOpen:l,isStripeMember:c,user:u})=>e?(0,t.jsxs)("div",{className:"p-6 min-w-90 md:min-w-60 xl:min-w-50 md:min-h-20 max-h-screen",children:[(0,t.jsx)("div",{className:"flex justify-between",children:(0,t.jsx)(S.H1,{children:"Subscription"})}),(0,t.jsx)("div",{className:"max-h-80vh overflow-y-auto mt-6",children:l?(0,t.jsx)($,{setIsCancelPlanOpen:e=>s(e),user:u}):n?(0,t.jsxs)("div",{className:"px-8 leading-relaxed",children:[(0,t.jsxs)("div",{className:"sm:flex sm:justify-between my-1",children:[(0,t.jsx)("span",{className:"hidden sm:block",children:"Plan"}),(0,t.jsx)("span",{className:"font-semibold flex justify-center sm:block my-1 sm:my-0",children:u?.["https://fantasyfootballhub.co.uk/roles"]?.[0]})]}),(0,t.jsxs)("div",{className:"flex justify-center sm:justify-between my-1",children:[(0,t.jsx)("span",{children:"Next Billing Date"}),(0,t.jsx)("span",{className:"sm:hidden",children:":"}),(0,t.jsx)("span",{className:"font-semibold ml-1 sm:ml-0",children:a})]}),(0,t.jsxs)("div",{className:"flex justify-center sm:justify-between my-1",children:[(0,t.jsx)("span",{children:"Payment Amount"}),(0,t.jsx)("span",{className:"sm:hidden",children:":"}),i&&(0,t.jsxs)("span",{className:"font-semibold ml-1 sm:ml-0",children:["£",i]})]}),(0,t.jsxs)("div",{className:"flex items-center flex-col-reverse sm:flex-row sm:justify-between my-6",children:[(0,t.jsx)(F,{isAppSubscription:r,isStripeMember:c,setIsCancelPlanOpen:e=>s(e),initChurnkey:()=>o&&o()}),(0,t.jsx)("div",{children:(0,t.jsx)(H,{isAppSubscription:r})})]})]}):(0,t.jsxs)("div",{className:"px-8 leading-relaxed",children:[(0,t.jsxs)("div",{className:"sm:flex sm:justify-between my-1",children:[(0,t.jsx)("span",{className:"hidden sm:block",children:"Plan"}),(0,t.jsx)("span",{className:"font-semibold flex justify-center sm:block my-1 sm:my-0",children:u?.["https://fantasyfootballhub.co.uk/roles"]?.[0]})]}),(0,t.jsxs)("div",{className:"flex justify-center sm:justify-between my-1",children:[(0,t.jsx)("span",{children:"Next Billing Date"}),(0,t.jsx)("span",{className:"sm:hidden",children:":"}),(0,t.jsx)("span",{className:"font-semibold ml-1 sm:ml-0",children:"Cancelled"})]}),(0,t.jsx)("div",{className:"flex items-center flex-col-reverse sm:flex-row sm:justify-between my-6",children:(0,t.jsx)("div",{children:(0,t.jsx)(H,{isAppSubscription:r})})})]})})]}):(0,t.jsxs)("div",{className:"p-6 min-w-90 md:min-w-60 xl:min-w-50 md:min-h-20 max-h-screen",children:[(0,t.jsx)("div",{className:"flex justify-between",children:(0,t.jsx)(S.H1,{children:"Subscription"})}),(0,t.jsx)("div",{className:"max-h-80vh overflow-y-auto mt-6",children:(0,t.jsxs)("div",{className:"px-8 leading-relaxed",children:[(0,t.jsxs)("div",{className:"sm:flex sm:justify-between my-1",children:[(0,t.jsx)("span",{className:"hidden sm:block",children:"Sign Up (Free)"}),(0,t.jsx)("span",{className:"font-semibold flex justify-center sm:block my-1 sm:my-0",children:"Sign Up (Free)"})]}),(0,t.jsxs)("div",{className:"flex items-center flex-col-reverse sm:flex-row sm:justify-between my-6",children:[(0,t.jsx)(F,{isAppSubscription:r,isStripeMember:c,setIsCancelPlanOpen:e=>s(e),initChurnkey:()=>o&&o()}),(0,t.jsx)("div",{children:(0,t.jsx)(H,{isAppSubscription:r})})]})]})})]});var B=e.i(90297);let W=({value:e,classNames:r})=>(0,t.jsx)("span",{"data-testid":"pill",className:`rounded-lg items-center text-sm py-0.5 px-2 font-bold self-start ${r}`,children:e});var z=e.i(84178);
3let G=({setIsChangePlanOpen:e,nextPaymentDate:r,nextPaymentAmount:n,subscriptionExpiresOn:a,isChangePlanOpen:i,userSubInfo:s,setIsCancelPlanOpen:o,initChurnkey:l,isCancelPlanOpen:c,stripeCustomerId:u,user:d,isCancelled:p,currencyCode:m,billingProvider:h})=>{let y=(0,f.hasSufficientPrivileges)(d,1),g="stripe"===b(h),j=(({provider:e,claimStatus:t,invoiceIsCancelled:r})=>"stripe"===b(e)?r:!!t&&"active"!==b(t))({provider:h,claimStatus:s?.status,invoiceIsCancelled:p}),w="revenuecat"===b(h);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"membership-row grid grid-cols-2 md:grid-cols-4 p-1 gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(S.H4,{className:"pb-1",children:"Type"}),(0,t.jsx)(S.BodyRegular,{className:"capitalize",children:d?.[x.FFH_ROLES]?.[0]??"FREE"})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(S.H4,{className:"pb-1",children:"Status"}),void 0===j?(0,t.jsx)(W,{value:"Loading...",classNames:"text-gray-500 bg-gray-100"}):j?(0,t.jsx)(W,{value:"Cancelled",classNames:"text-danger-700 bg-danger-100"}):(0,t.jsx)(W,{value:"Active",classNames:"text-success-700 bg-success-100"})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)(S.H4,{className:"pb-1",children:[j?"Expires":"Renews"," on"]}),(0,t.jsx)(S.BodyRegular,{children:g&&(j?a:r)})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(S.H4,{className:"pb-1",children:"Price"}),(0,t.jsxs)(S.BodyRegular,{children:[g&&j?"-":"",g&&n?`${(0,z.getCurrencySymbol)(m||"gbp")}${n}`:""]})]})]}),(0,t.jsxs)("div",{className:"flex mt-5",children:[(0,t.jsx)(v.default,{variant:"secondary",onClick:()=>e(!0),children:"Manage Subscription"}),(0,t.jsx)(B.default,{open:i,handleClose:()=>e(!1),children:(0,t.jsx)(Y,{isAppSubscription:w,nextPaymentDate:r,nextPaymentAmount:n,setIsCancelPlanOpen:o,initChurnkey:l,isCancelPlanOpen:c,isStripeMember:!!u,hasPaidSubscription:y,hasRecurringSubscription:!j&&s&&s?.status==="active",user:d})})]})]})};var q=e.i(89966),K=e.i(48625),X=e.i(75745);let Q=({isOpen:e,accessToken:n,onClose:a,onCardUpdated:i})=>{let[s,o]=(0,r.useState)(null),l=(0,r.useMemo)(()=>(0,X.getStripe)(),[]);(0,r.useEffect)(()=>{e&&n&&!s&&(async()=>{let e;try{e=await m({accessToken:n}),"error"in e&&K.datadogRumService.addError(Error("Update card billing session creation failed"),{context:"update-card-modal",stage:"create_session"})}catch(t){e={error:!0},K.datadogRumService.addError(t,{context:"update-card-modal",stage:"create_session"})}if("error"in e){(0,j.triggerToast)({title:"Error",subTitle:"Failed to start the card update. Please contact support",variant:"error"}),a();return}o(e)})()},[e,n,s]);let c=()=>{o(null),a()},u=async()=>{if(!n||!s)return;let e=!1;try{(e=(await h({accessToken:n,sessionId:s.sessionId})).isSuccess)||K.datadogRumService.addError(Error("Update card confirmation failed"),{context:"update-card-modal",stage:"confirm_session",sessionId:s.sessionId})}catch(e){K.datadogRumService.addError(e,{context:"update-card-modal",stage:"confirm_session",sessionId:s.sessionId})}(0,j.triggerToast)(e?{title:"Success",subTitle:"Payment details successfully updated",variant:"success"}:{title:"Error",subTitle:"Payment details not updated",variant:"error"}),e&&i(),c()};return(0,t.jsx)(B.default,{open:e,handleClose:c,title:"Update card",children:(0,t.jsx)("div",{className:"p-6 pt-10 w-[92vw] max-w-[480px]",children:s?(0,t.jsx)(q.EmbeddedCheckoutProvider,{stripe:l,options:{clientSecret:s.clientSecret,onComplete:u},children:(0,t.jsx)(q.EmbeddedCheckout,{})}):(0,t.jsx)(S.BodyRegular,{className:"text-center py-10",children:"Loading..."})})})},V=({children:e})=>(0,t.jsxs)("div",{children:[(0,t.jsx)(n.default,{children:(0,t.jsx)("title",{children:x.WEBSITE_NAME})}),(0,t.jsx)("div",{className:"container mx-auto px-3",children:(0,t.jsx)("div",{className:"relative px-2 pt-10 pb-20 bg-white sm:px-6 lg:px-8",children:(0,t.jsxs)("div",{className:"relative mx-auto max-w-7xl",children:[(0,t.jsx)(S.H1,{className:"mb-3",children:"Account information"}),e]})})})]});e.s(["default",0,()=>{let e=(0,a.useRouter)(),{user:o,isLoading:l}=(0,i.useAuth0User)(),c=(0,s.useLoginHref)("/account");(0,r.useEffect)(()=>
3{if(!window.churnkey||!window.churnkey.created){window.churnkey={created:!0};let e=document.createElement("script");e.src="https://assets.churnkey.co/js/app.js?appId=dlzgr15j6",e.async=!0,e.dataset.cookieyes="cookieyes-functional",document.head.appendChild(e)}},[]);let[u,d]=(0,r.useState)(""),[m,h]=(0,r.useState)(""),[E,C]=(0,r.useState)(""),[P,k]=(0,r.useState)(""),[R,A]=(0,r.useState)(void 0),[_,O]=(0,r.useState)(""),[I,T]=(0,r.useState)(""),[M,L]=(0,r.useState)(!1),[F,U]=(0,r.useState)(!1),[$,H]=(0,r.useState)(!1),[Y,B]=(0,r.useState)(void 0),[W,z]=(0,r.useState)(!1),{accessToken:q}=(0,N.useAccessToken)(),K=(0,f.getUserSubscriptionInfo)(o),X=b(Y)??b(K?.source?.provider);(0,r.useEffect)(()=>{(0,f.isUserAuthenticated)(o)&&q&&J()},[o,q]);let J=async()=>{if(q)try{let e=await p({accessToken:q});if(!e.hasSubscription)return void H(!1);let{invoice:t,customerId:r,userHash:n,provider:a}=e.subscription;A(t?.isCancelled),C(t?.nextPaymentAmount??""),d(t?.nextPaymentDate??void 0),h(t?.subscriptionExpiresOn??void 0),O(r??""),k(t?.currency??""),T(n??""),B(a??void 0),H("stripe"===b(a))}catch(e){console.error("Error fetching user data:",e)}};return l?(0,t.jsx)(V,{children:(0,t.jsx)(S.BodyRegular,{children:"Loading your account details..."})}):(0,f.isUserAuthenticated)(o)?(0,t.jsxs)("div",{children:[(0,t.jsx)(n.default,{children:(0,t.jsx)("title",{children:x.WEBSITE_NAME})}),(0,t.jsx)("div",{className:"container mx-auto px-3",children:(0,t.jsx)("div",{className:"flex flex-col lg:grid 'lg:grid-cols-[minmax(0,1fr)_350px] xl:grid-cols-[minmax(0,1fr)_350px] gap-2 md:gap-8",children:(0,t.jsx)("div",{className:"relative px-2 pt-10 mb-0 md:pb-20 bg-white sm:px-6 lg:pb-10 lg:px-8",children:(0,t.jsxs)("div",{className:"relative mx-auto max-w-7xl",children:[(0,t.jsx)(S.H1,{children:"Account information"}),"paypal"===b(X)&&(0,t.jsx)(w,{}),(0,t.jsx)("div",{className:"mb-5 md:mb-12",children:(0,t.jsx)("div",{className:"flex gap-4 mb-4",children:(0,t.jsxs)("div",{className:"mb-4 min-w-[300px]",children:[(0,t.jsx)(S.H4,{className:"mt-1",children:"Email"}),(0,t.jsx)(S.BodyRegular,{className:"mt-1",children:o?.email})]})})}),(0,t.jsx)(S.H1,{children:"Your plan"}),(0,t.jsx)("div",{className:"mb-5 md:mb-12",children:(0,t.jsx)(G,{setIsChangePlanOpen:L,nextPaymentDate:u,nextPaymentAmount:E,subscriptionExpiresOn:m,isChangePlanOpen:M,setIsCancelPlanOpen:U,initChurnkey:()=>{L(!1),_&&I&&((0,y.captureAnalyticsEvent)(y.AnalyticsEvents.subscriptionCancelStarted,{tier:(0,g.getAnalyticsMembershipTier)(o),tenure_days:null}),window.churnkey?.init("show",{subscriptionId:K?.source?.id,customerId:_,authHash:I,appId:"dlzgr15j6",mode:"live",provider:"stripe",handleSupportRequest:()=>{e.push("/contact"),window.churnkey.hide()},onCancel:async()=>{if(window.churnkey.hide(),(0,j.triggerToast)({title:"Subscription cancelled",subTitle:"Subscription has been cancelled successfully.",variant:"success"}),q)try{let e=await p({accessToken:q});if(!e.hasSubscription)return;let{invoice:t}=e.subscription;A(t?.isCancelled),h(t?.subscriptionExpiresOn??void 0)}catch(e){console.error("Error refreshing subscription after cancellation:",e)}}}))},isCancelPlanOpen:F,stripeCustomerId:_,userSubInfo:K,user:o,isCancelled:R,currencyCode:P,billingProvider:X})}),$&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S.H2,{children:"Manage billing"}),(0,t.jsx)("div",{className:"flex mt-5",children:(0,t.jsx)(v.default,{variant:"secondary",onClick:()=>z(!0),children:"Update card"})}),(0,t.jsx)(Q,{isOpen:W,accessToken:q,onClose:()=>z(!1),onCardUpdated:J})]}),(0,t.jsx)(D,{})]})})})})]}):(0,t.jsxs)(V,{children:[(0,t.jsx)(S.BodyRegular,{className:"mb-5",children:"Sign in to see your membership and subscription details."}),(0,t.jsx)(v.default,{href:c,variant:"primary",children:"Sign in"})]})}],69335)},95467,(e,t,r)=>{let n="/account";(window.__NEXT_P=window.__NEXT_P||[]).push([n,()=>e.r(69335)]),t.hot&&t.hot.dispose(function(){window.__NEXT_P.push([n])})}]);
4
5//# sourceMappingURL=1ynqc6m4fofry.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.