PageSourceSearch

https://www.digitalbread.com/_next/static/chunks/0.b~~yjuobwdr.js?dpl=dpl_DummGoxr2DUn8W6W1461oiRZFMN3

js digitalbread.com collected 2026-10-04 01:42:41 UTC 65,268 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,35305,(e,t,r)=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},405968,(e,t,r)=>{"use strict";var n=e.r(35305);function a(){}function s(){}s.resetWarningCache=a,t.exports=function(){function e(e,t,r,a,s,i){if(i!==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:s,resetWarningCache:a};return r.PropTypes=r,r}},304153,(e,t,r)=>{t.exports=e.r(405968)()},714568,e=>{"use strict";var t,r,n,a,s,i,o,l=e.i(176350),c=e.i(273576);function d(e){return(d="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)}var u="dahlia",p="https://js.stripe.com",m="".concat(p,"/").concat(u,"/stripe.js"),f=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,h=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,g=function(){for(var e=document.querySelectorAll('script[src^="'.concat(p,'"]')),t=0;t<e.length;t++){var r,n=e[t];if(r=n.src,f.test(r)||h.test(r))return n}return null},y=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(m).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},x=function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"9.8.0",startTime:t})},b=null,v=null,j=null,N=function(e,t,r){if(null===e)return null;var n,a=t[0];if("string"!=typeof a)throw Error("Expected publishable key to be of type string, got type ".concat(d(a)," instead."));var s=a.match(/^pk_test/),i=3===(n=e.version)?"v3":n;s&&i!==u&&console.warn("Stripe.js@".concat(i," was loaded on the page, but @stripe/stripe-js@").concat("9.8.0"," expected Stripe.js@").concat(u,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var o=e.apply(void 0,t);return x(o,r),o},_=!1,S=function(){return a||(a=(null!==b?b:(b=new Promise(function(e,t){if("u"<typeof window||"u"<typeof document)return void e(null);if(window.Stripe,window.Stripe)return void e(window.Stripe);try{var r,n=g();n?n&&null!==j&&null!==v&&(n.removeEventListener("load",j),n.removeEventListener("error",v),null==(r=n.parentNode)||r.removeChild(n),n=y(null)):n=y(null),j=function(){window.Stripe?e(window.Stripe):t(Error("Stripe.js not available"))},v=function(e){t(Error("Failed to load Stripe.js",{cause:e}))},n.addEventListener("load",j),n.addEventListener("error",v)}catch(e){t(e);return}})).catch(function(e){return b=null,Promise.reject(e)})).catch(function(e){return a=null,Promise.reject(e)}))};Promise.resolve().then(function(){return S()}).catch(function(e){_||console.warn(e)});var w=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];_=!0;var n=Date.now();return S().then(function(e){return N(e,t,n)})},C=e.i(304153);function E(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 P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach(function(t){I(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function k(e){return(k="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 I(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 s=[],i=!0,o=!1;try{for(a=a.call(e);!(i=(r=a.next()).done)&&(s.push(r.value),!t||s.length!==t);i=!0);}catch(e){o=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(o)throw n}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return A(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 A(e,t)}}
1(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 A(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 T=function(e,t,r){var n=!!r,a=c.default.useRef(r);c.default.useEffect(function(){a.current=r},[r]),c.default.useEffect(function(){if(!n||!e)return function(){};var r=function(){if(a.current)return a.current.apply(a,arguments)};return e.on(t,r),function(){e.off(t,r)}},[n,t,e,a])},L=function(e){var t=c.default.useRef(e);return c.default.useEffect(function(){t.current=e},[e]),t.current},R=function(e){return null!==e&&"object"===k(e)},D="[object Object]",F=function e(t,r){if(!R(t)||!R(r))return t===r;var n=Array.isArray(t);if(n!==Array.isArray(r))return!1;var a=Object.prototype.toString.call(t)===D;if(a!==(Object.prototype.toString.call(r)===D))return!1;if(!a&&!n)return t===r;var s=Object.keys(t),i=Object.keys(r);if(s.length!==i.length)return!1;for(var o={},l=0;l<s.length;l+=1)o[s[l]]=!0;for(var c=0;c<i.length;c+=1)o[i[c]]=!0;var d=Object.keys(o);return d.length===s.length&&d.every(function(n){return e(t[n],r[n])})},U=function(e,t,r){return R(e)?Object.keys(e).reduce(function(n,a){var s=!R(t)||!F(e[a],t[a]);return r.includes(a)?(s&&console.warn("Unsupported prop change: options.".concat(a," is not a mutable property.")),n):s?P(P({},n||{}),{},I({},a,e[a])):n},null):null},z="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.",M=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z;if(null===e||R(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment)return e;throw Error(t)},B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z;if(R(e)&&"function"==typeof e.then)return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return M(e,t)})};var r=M(e,t);return null===r?{tag:"empty"}:{tag:"sync",stripe:r}},q=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"}))},G=c.default.createContext(null);G.displayName="ElementsContext";var V=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},$=function(e){var t=e.stripe,r=e.options,n=e.children,a=c.default.useMemo(function(){return B(t)},[t]),s=O(c.default.useState(function(){return{stripe:"sync"===a.tag?a.stripe:null,elements:"sync"===a.tag?a.stripe.elements(r):null}}),2),i=s[0],o=s[1];c.default.useEffect(function(){var e=!0,t=function(e){o(function(t){return t.stripe?t:{stripe:e,elements:e.elements(r)}})};return"async"!==a.tag||i.stripe?"sync"!==a.tag||i.stripe||t(a.stripe):a.stripePromise.then(function(r){r&&e&&t(r)}),function(){e=!1}},[a,i,r]);var l=L(t);c.default.useEffect(function(){null!==l&&l!==t&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[l,t]);var d=L(r);return c.default.useEffect(function(){if(i.elements){var e=U(r,d,["clientSecret","fonts"]);e&&i.elements.update(e)}},[r,d,i.elements]),c.default.useEffect(function(){q(i.stripe)},[i.stripe]),c.default.createElement(G.Provider,{value:i},n)};$.propTypes={stripe:C.default.any,options:C.default.object};C.default.func.isRequired;var K=c.default.createContext(null);K.displayName="CheckoutContext";var J=function(e){var t=c.default.useContext(K),r=c.default.useContext(G);if(!t)return V(r,e);if(!r)return t;throw Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."))},Z=["mode"],Y=function(e,t,r){var n="".concat(e.charAt(0).toUpperCase()+e.slice(1),"Element"),a=t?function(e){J("mounts <".concat(n,">"));var t=e.id,r=e.className;return c.default.createElement("div",{id:t,className:r})}:function(t){var r,a=t.id,s=t.className,i=t.options,o=void 0===i?{}:i,l=t.onBlur,d=t.onFocus,u=t.onReady,p=t.onChange,m=t.onEscape,f=t.onClick,h=t.onLoadError,g=t.onLoaderStart,y=t.onNetworksChange,x=t.onConfirm,b=t.onCancel,v=t.onShippingAddressChange,j=t.onShippingRateChange,N=t.onSavedPaymentMethodRemove,_=t.onSavedPaymentMethodUpdate,S=t.onAvailablePaymentMethodsChange,w=J("mounts <".concat(n,">")),C="elements"in w?w.elements:null,E="checkoutState"in w?w.checkoutState:null,P=(null==E?void 0:E.type)==="success"||(null==E?void 0:E.type)==="loading"?E.sdk:null,k=O(c.default.useState(null),2),I=k[0],A=k[1],R=c.default.useRef(null),D=c.default.useRef(null);T(I,"blur",l),T(I,"focus",d),T(I,"escape",m),T(I,"click",f),T(I,"loaderror",h),T(I,"loaderstart",g),T(I,"networksch
1ange",y),T(I,"confirm",x),T(I,"cancel",b),T(I,"shippingaddresschange",v),T(I,"shippingratechange",j),T(I,"savedpaymentmethodremove",N),T(I,"savedpaymentmethodupdate",_),T(I,"availablepaymentmethodschange",S),T(I,"change",p),u&&(r="expressCheckout"===e?u:function(){u(I)}),T(I,"ready",r),c.default.useLayoutEffect(function(){if(null===R.current&&null!==D.current&&(C||P)){var t=null;if(P)switch(e){case"paymentForm":t=P.createForm(o);break;case"payment":t=P.createPaymentElement(o);break;case"address":if("mode"in o){var r=o.mode,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(o,Z);if("shipping"===r)t=P.createShippingAddressElement(a);else if("billing"===r)t=P.createBillingAddressElement(a);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=P.createExpressCheckoutElement(o);break;case"currencySelector":t=P.createCurrencySelectorElement();break;case"taxId":t=P.createTaxIdElement(o);break;case"contactDetails":t=P.createContactDetailsElement();break;default:throw Error("<".concat(n,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}else C&&(t=C.create(e,o));R.current=t,A(t),t&&t.mount(D.current)}},[C,P,o]);var F=L(o);return c.default.useEffect(function(){if(R.current){var e=U(o,F,["paymentRequest"]);e&&"update"in R.current&&R.current.update(e)}},[o,F]),c.default.useLayoutEffect(function(){return function(){if(R.current&&"function"==typeof R.current.destroy)try{R.current.destroy(),R.current=null}catch(e){}}},[]),c.default.createElement("div",{id:a,className:s,ref:D})};return a.propTypes={id:C.default.string,className:C.default.string,onChange:C.default.func,onBlur:C.default.func,onFocus:C.default.func,onReady:C.default.func,onEscape:C.default.func,onClick:C.default.func,onLoadError:C.default.func,onLoaderStart:C.default.func,onNetworksChange:C.default.func,onConfirm:C.default.func,onCancel:C.default.func,onShippingAddressChange:C.default.func,onShippingRateChange:C.default.func,onSavedPaymentMethodRemove:C.default.func,onSavedPaymentMethodUpdate:C.default.func,onAvailablePaymentMethodsChange:C.default.func,options:C.default.object},a.displayName=n,a.__elementType=e,a},W="u"<typeof window;c.default.createContext(null).displayName="EmbeddedCheckoutProviderContext",Y("auBankAccount",W),Y("card",W),Y("cardNumber",W),Y("cardExpiry",W),Y("cardCvc",W),Y("currencySelector",W),Y("iban",W);var H=Y("payment",W);Y("expressCheckout",W),Y("paymentRequestButton",W),Y("linkAuthentication",W),Y("contactDetails",W),Y("address",W),Y("shippingAddress",W),Y("paymentMethodMessaging",W),Y("taxId",W),Y("issuingCardNumberDisplay",W),Y("issuingCardCvcDisplay",W),Y("issuingCardExpiryDisplay",W),Y("issuingCardPinDisplay",W),Y("issuingCardCopyButton",W);var X=e.i(795262),Q=e.i(886453),ee=e.i(635612),et=e.i(469042),er=e.i(122349),en=e.i(271182),ea=e.i(728869),es=e.i(817422),ei=e.i(983761),eo=e.i(6913),el=e.i(539775);(t=s||(s={})).INITIAL="initial",t.PENDING="pending",t.REJECTED="rejected",t.RESOLVED="resolved",(r=i||(i={})).LOADING_STATUS="setLoadingStatus",r.RESET_OPTIONS="resetOptions",r.SET_BRAINTREE_INSTANCE="braintreeInstance",(n=o||(o={})).NUMBER="number",n.CVV="cvv",n.EXPIRATION_DATE="expirationDate",n.EXPIRATION_MONTH="expirationMonth",n.EXPIRATION_YEAR="expirationYear",n.POSTAL_CODE="postalCode";var ec=function(e,t){return(ec=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},ed=function(){return(ed=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function eu(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>t.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function ep(e,t,r){if(r||2==arguments.length)for(var n,a=0,s=t.length;a<s;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var em="data-react-paypal-script-id",ef="react-paypal-js",eh="dataNamespace",eg="dataSdkIntegrationSource",ey="paypal";function ex(e){return void 0===e&&(e=ey),window[e]}function eb(e){var t=e.reactComponentName,r=e.sdkComponentKey,n=e.sdkRequestedComponents,a=void 0===n?"":n,s=e.sdkDataNamespace,i=r.charAt(0).toUpperCase().concat(r.substring(1)),o="Unable to render <".concat(t," /> because window.").concat(void 0===s?ey:s,".").concat(i," is undefined."),l="string"==typeof a?a:a.join(",");
1if(!l.includes(r)){var c=[l,r].filter(Boolean).join();o+="\nTo fix the issue, add '".concat(r,"' to the list of components passed to the parent PayPalScriptProvider:")+"\n`<PayPalScriptProvider options={{ components: '".concat(c,"'}}>`.")}return o}function ev(e){e[em];var t=eu(e,[em+""]);return"react-paypal-js-".concat(function(e){for(var t="",r=0;r<e.length;r++){var n=e[r].charCodeAt(0)*r;e[r+1]&&(n+=e[r+1].charCodeAt(0)*(r-1)),t+=String.fromCharCode(97+Math.abs(n)%26)}return t}(JSON.stringify(t)))}function ej(e,t){var r,n,a,o;switch(t.type){case i.LOADING_STATUS:if("object"==typeof t.value)return ed(ed({},e),{loadingStatus:t.value.state,loadingStatusErrorMessage:t.value.message});return ed(ed({},e),{loadingStatus:t.value});case i.RESET_OPTIONS:return a=e.options[em],(null==(o=self.document.querySelector("script[".concat(em,'="').concat(a,'"]')))?void 0:o.parentNode)&&o.parentNode.removeChild(o),ed(ed({},e),{loadingStatus:s.PENDING,options:ed(ed(((r={})[eg]=ef,r),t.value),((n={})[em]="".concat(ev(t.value)),n))});case i.SET_BRAINTREE_INSTANCE:return ed(ed({},e),{braintreePayPalCheckoutInstance:t.value});default:return e}}var eN=(0,c.createContext)(null);function e_(){var e=function(e){if("function"==typeof(null==e?void 0:e.dispatch)&&0!==e.dispatch.length)return e;throw Error("usePayPalScriptReducer must be used within a PayPalScriptProvider")}((0,c.useContext)(eN));return[ed(ed({},e),{isInitial:e.loadingStatus===s.INITIAL,isPending:e.loadingStatus===s.PENDING,isResolved:e.loadingStatus===s.RESOLVED,isRejected:e.loadingStatus===s.REJECTED}),e.dispatch]}(0,c.createContext)({});var eS=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=r}function r(t){var r=e.call(this,t)||this;return r.state={hasError:!1},r}return ec(r,e),r.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t),r.getDerivedStateFromError=function(){return{hasError:!0}},r.prototype.componentDidCatch=function(e,t){console.error("Error in PayPalButtons component:",e,t),"function"==typeof this.props.onError&&this.props.onError({message:e.message,name:e.name,stack:e.stack,componentStack:t.componentStack})},r.prototype.render=function(){return this.state.hasError?null:this.props.children},r}(c.Component),ew=function(e){var t,r,n=e.className,a=e.disabled,s=void 0!==a&&a,i=e.children,o=e.forceReRender,l=eu(e,["className","disabled","children","forceReRender"]),d="".concat(void 0===n?"":n," ").concat(s?"paypal-buttons-disabled":"").trim(),u=(0,c.useRef)(null),p=(0,c.useRef)(null),m=((t=(0,c.useRef)(new Proxy({},{get:function(e,t,r){return"function"==typeof e[t]?function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e[t].apply(e,r)}:Reflect.get(e,t,r)}}))).current=Object.assign(t.current,l),t.current),f=e_()[0],h=f.isResolved,g=f.options,y=(0,c.useState)(null),x=y[0],b=y[1],v=(0,c.useState)(!0),j=v[0],N=v[1],_=(0,c.useState)(null)[1];function S(){null!==p.current&&p.current.close().catch(function(){})}return(null==(r=p.current)?void 0:r.updateProps)&&p.current.updateProps({message:l.message}),(0,c.useEffect)(function(){if(!1===h)return S;var e=ex(g.dataNamespace);if(void 0===e||void 0===e.Buttons)return _(function(){throw Error(eb({reactComponentName:eC.displayName,sdkComponentKey:"buttons",sdkRequestedComponents:g.components,sdkDataNamespace:g[eh]}))}),S;try{p.current=e.Buttons(ed(ed({},m),{onInit:function(e,t){b(t),"function"==typeof l.onInit&&l.onInit(e,t)}}))}catch(e){return _(function(){throw Error("Failed to render <PayPalButtons /> component. Failed to initialize:  ".concat(e))})}return!1===p.current.isEligible()?N(!1):u.current&&p.current.render(u.current).catch(function(e){null!==u.current&&0!==u.current.children.length&&_(function(){throw Error("Failed to render <PayPalButtons /> component. ".concat(e))})}),S},ep(ep([h],void 0===o?[]:o,!0),[l.fundingSource],!1)),(0,c.useEffect)(function(){null!==x&&(!0===s?x.disable().catch(function(){}):x.enable().catch(function(){}))},[s,x]),c.default.createElement(c.default.Fragment,null,j?c.default.createElement("div",{ref:u,style:s?{opacity:.38}:{},className:d}):i)};ew.displayName="PayPalButtons";var eC=function(e){return c.default.createElement(eS,{onError:e.onError},c.default.createElement(ew,ed({},e)))};function eE(e,t){void 0===t&&(t={});var r=document.createElement("script");return r.src=e,Object.keys(t).forEach(function(e){r.setAttribute(e,t[e]),"data-csp-nonce"===e&&r.setAttribute("nonce",t["data-csp-nonce"])}),r}eC.displayName="PayPalButtons","function"==typeof SuppressedError&&SuppressedError;function eP(e,t){if("object"!=typeof e||null===e)throw Error("Expected an options object.");var r=e.environment;if(r&&"production"!==r&&"sandbox"!==r)throw Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==t&&"function"!=typeof t)throw Error("Expected PromisePonyfill to be a function.")}
1var ek=function(e){var t=e.className,r=e.children,n=eu(e,["className","children"]),a=e_()[0],s=a.isResolved,i=a.options,o=(0,c.useRef)(null),l=(0,c.useState)(!0),d=l[0],u=l[1],p=(0,c.useState)(null)[1],m=function(e){var t=o.current;if(!t||!e.isEligible())return u(!1);t.firstChild&&t.removeChild(t.firstChild),e.render(t).catch(function(e){null!==t&&0!==t.children.length&&p(function(){throw Error("Failed to render <PayPalMarks /> component. ".concat(e))})})};return(0,c.useEffect)(function(){if(!1!==s){var e=ex(i[eh]);if(void 0===e||void 0===e.Marks)return p(function(){throw Error(eb({reactComponentName:ek.displayName,sdkComponentKey:"marks",sdkRequestedComponents:i.components,sdkDataNamespace:i[eh]}))});m(e.Marks(ed({},n)))}},[s,n.fundingSource]),c.default.createElement(c.default.Fragment,null,d?c.default.createElement("div",{ref:o,className:void 0===t?"":t}):r)};ek.displayName="PayPalMarks";var eI=function(e){var t=e.className,r=e.forceReRender,n=eu(e,["className","forceReRender"]),a=e_()[0],s=a.isResolved,i=a.options,o=(0,c.useRef)(null),l=(0,c.useRef)(null),d=(0,c.useState)(null)[1];return(0,c.useEffect)(function(){if(!1!==s){var e=ex(i[eh]);if(void 0===e||void 0===e.Messages)return d(function(){throw Error(eb({reactComponentName:eI.displayName,sdkComponentKey:"messages",sdkRequestedComponents:i.components,sdkDataNamespace:i[eh]}
1))});l.current=e.Messages(ed({},n)),l.current.render(o.current).catch(function(e){null!==o.current&&0!==o.current.children.length&&d(function(){throw Error("Failed to render <PayPalMessages /> component. ".concat(e))})})}},ep([s],void 0===r?[]:r,!0)),c.default.createElement("div",{ref:o,className:void 0===t?"":t})};eI.displayName="PayPalMessages";var eO=function(e){var t,r=e.options,n=void 0===r?{clientId:"test"}:r,a=e.children,o=e.deferLoading,l=void 0!==o&&o,d=(0,c.useReducer)(ej,{options:ed(ed({},n),((t={}).dataJsSdkLibrary=ef,t[eg]=ef,t[em]="".concat(ev(n)),t)),loadingStatus:l?s.INITIAL:s.PENDING}),u=d[0],p=d[1];return(0,c.useEffect)(function(){if(!1===l&&u.loadingStatus===s.INITIAL)return p({type:i.LOADING_STATUS,value:s.PENDING});if(u.loadingStatus===s.PENDING){var e=!0;return(function(e,t){if(void 0===t&&(t=Promise),eP(e,t),"u"<typeof document)return t.resolve(null);var r,n,a,s,i,o,l,c,d,u,p=(s=Object.prototype.hasOwnProperty.call(e,"sdkBaseUrl")?e.sdkBaseUrl:void 0,i=e.environment,e.sdkBaseUrl,o=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>t.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}(e,["environment","sdkBaseUrl"]),l=s||("sandbox"===i?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"),d=(c=Object.keys(o).filter(function(e){return void 0!==o[e]&&null!==o[e]&&""!==o[e]}).reduce(function(e,t){var r=o[t].toString();return"data"===(t=t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,function(e,t){return(t?"-":"")+e.toLowerCase()})).substring(0,4)||"crossorigin"===t?e.attributes[t]=r:e.queryParams[t]=r,e},{queryParams:{},attributes:{}})).queryParams,u=c.attributes,d["merchant-id"]&&-1!==d["merchant-id"].indexOf(",")&&(u["data-merchant-id"]=d["merchant-id"],d["merchant-id"]="*"),{url:"".concat(l,"?").concat((n="",Object.keys(r=d).forEach(function(e){0!==n.length&&(n+="&"),n+=e+"="+r[e]}),n)),attributes:u}),m=p.url,f=p.attributes,h=f["data-namespace"]||"paypal",g=(a=h,window[a]);return(f["data-js-sdk-library"]||(f["data-js-sdk-library"]="paypal-js"),function(e,t){var r=document.querySelector('script[src="'.concat(e,'"]'));if(null===r)return null;var n=eE(e,t),a=r.cloneNode();if(delete a.dataset.uidAuto,Object.keys(a.dataset).length!==Object.keys(n.dataset).length)return null;var s=!0;return Object.keys(a.dataset).forEach(function(e){a.dataset[e]!==n.dataset[e]&&(s=!1)}),s?r:null}(m,f)&&g)?t.resolve(g):(function(e,t){void 0===t&&(t=Promise),eP(e,t);var r=e.url,n=e.attributes;if("string"!=typeof r||0===r.length)throw Error("Invalid url.");if(void 0!==n&&"object"!=typeof n)throw Error("Expected attributes to be an object.");return new t(function(e,t){var a,s,i,o,l,c;if("u"<typeof document)return e();s=(a={url:r,attributes:n,onSuccess:function(){return e()},onError:function(){return t(Error('The script "'.concat(r,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.')))}}).url,i=a.attributes,o=a.onSuccess,l=a.onError,(c=eE(s,i)).onerror=l,c.onload=o,document.head.insertBefore(c,document.head.firstElementChild)})})({url:m,attributes:f},t).then(function(){var e,t=(e=h,window[e]);if(t)return t;throw Error("The window.".concat(h," global variable is not available."))})})(u.options).then(function(){e&&p({type:i.LOADING_STATUS,value:s.RESOLVED})}).catch(function(t){console.error("".concat("Failed to load the PayPal JS SDK script."," ").concat(t)),e&&p({type:i.LOADING_STATUS,value:{state:s.REJECTED,message:String(t)}})}),function(){e=!1}}},[u.options,l,u.loadingStatus]),c.default.createElement(eN.Provider,{value:ed(ed({},u),{dispatch:p})},a)};function eA(){}(0,c.createContext)({cardFieldsForm:null,fields:{},registerField:eA,unregisterField:eA});let eT=["paypal","paylater","card"];function eL({clientId:e,testMode:t,disabled:r,amountKey:n,buildPayload:a,onError:s}){let[i,o]=(0,c.useState)(!1),d=(0,c.useRef)(null),u=(0,c.useMemo)(()=>({clientId:e,currency:"USD",intent:"capture",components:"buttons",enableFunding:"paylater,card",disableFunding:"venmo"}),[e]);async function p(){s("");let e=await a();if(!e){let e="Complete all required fields above before paying with PayPal";throw s(e),Error(e)}o(!0);try{let t=await fetch("/api/checkout/paypal/order",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),r=await t.json().catch(()=>({}));if(!t.ok||!r.paypal_order_id){let e=r.error??"Could not start PayPal checkout";throw s(e),Error(e)}
1return d.current=r.order_id,r.paypal_order_id}catch(e){if(o(!1),e instanceof Error&&e.message)throw e;throw Error("Could not start PayPal checkout")}}async function m(e){let t=d.current;if(!t||!e.orderID){o(!1),s("Order session expired — please try again");return}try{let r=await fetch("/api/checkout/paypal/capture",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paypal_order_id:e.orderID,order_id:t})}),n=await r.json().catch(()=>({}));if(!r.ok){s(n.error??"PayPal capture failed"),o(!1);return}window.location.href=`/checkout/success?order_id=${t}`}catch{s("PayPal capture failed"),o(!1)}}function f(){o(!1),d.current=null}function h(e){let t;o(!1),console.error("[PayPal]",e),s((t="string"==typeof e.message?e.message:null,t?.trim()?t.trim():"PayPal encountered an error. Try again or pay with card."))}let g={shape:"rect",label:"pay",height:45,tagline:!1};return(0,l.jsx)(eO,{options:u,children:(0,l.jsxs)("div",{className:r||i?"pointer-events-none opacity-50":void 0,children:[i?(0,l.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground",children:[(0,l.jsx)(et.Loader2,{className:"size-4 animate-spin"}),"Processing PayPal…"]}):null,(0,l.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-3 [&_.paypal-buttons]:!w-full [&_iframe]:!w-full",children:eT.map(e=>(0,l.jsx)("div",{className:"min-w-0 w-full",children:(0,l.jsx)(eC,{fundingSource:e,style:{...g,layout:"horizontal",color:"paypal"===e?"gold":"paylater"===e?"blue":"black"},disabled:r||i,createOrder:p,onApprove:m,onCancel:f,onError:h})},e))},`paypal-${n}`),t?(0,l.jsx)("p",{className:"mt-2 text-center text-[11px] text-muted-foreground",children:"PayPal sandbox — sign in with a sandbox buyer account. If the window closes immediately, allow popups for this site and check the browser console."}):null]})})}var eR=e.i(667439),eD=e.i(519455),eF=e.i(975157),eU=e.i(792321),ez=e.i(272532);function eM({url:e,alt:t,fallbackLabel:r,className:n,sizes:a="(max-width: 640px) 100vw, 144px"}){return(0,l.jsx)("div",{className:(0,eF.cn)("relative aspect-video shrink-0 overflow-hidden rounded-md bg-muted",n??"w-full sm:w-36"),children:e?(0,l.jsx)(eU.default,{src:e,alt:t,fill:!0,className:"object-cover",sizes:a}):(0,l.jsx)("div",{className:"flex size-full items-center justify-center px-2 text-center text-xs font-medium text-muted-foreground",children:r?.slice(0,2).toUpperCase()??"—"})})}function eB({amountCents:e,compareAtCents:t,priceInterval:r="one_time",className:n}){let a=null!=t&&t>e,s=(0,ez.formatProductPriceDisplay)({unit_amount:e,interval:r});return(0,l.jsx)("p",{className:(0,eF.cn)("text-sm",n),children:a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"mr-1.5 text-muted-foreground line-through",children:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(t/100)}),(0,l.jsx)("span",{className:"font-semibold text-foreground",children:s})]}):(0,l.jsx)("span",{className:"font-semibold text-foreground",children:s})})}function eq({offer:e,selected:t,onToggle:r}){let[n,a]=(0,c.useState)(!1),s=e.description?.trim()??"",i=s.length>100,o=i&&!n?`${function(e){if(e.length<=100)return e;let t=e.slice(0,100),r=t.lastIndexOf(" ");return(r>60?t.slice(0,r):t).trim()}(s)}…`:s;return(0,l.jsxs)("div",{className:(0,eF.cn)("flex flex-col gap-3 border-b border-border/70 py-5 last:border-b-0 sm:flex-row sm:items-start sm:gap-4",t&&"rounded-lg border border-teal-600/30 bg-teal-50/30 px-3 sm:px-4"),children:[(0,l.jsx)(eM,{url:e.imageUrl,alt:e.imageAlt??e.productTitle,fallbackLabel:e.productTitle,className:"w-full sm:w-40"}),(0,l.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,l.jsx)("p",{className:"text-sm font-semibold leading-snug",children:e.headline}),s?(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:o}),i?(0,l.jsxs)("button",{type:"button",className:"inline-flex items-center gap-0.5 text-sm font-medium text-teal-700 hover:underline",onClick:()=>a(e=>!e),children:[n?"View less":"View more",(0,l.jsx)(eR.ChevronDown,{className:(0,eF.cn)("size-3 transition-transform",n&&"rotate-180")}
1)]}):null]}):null,(0,l.jsx)(eB,{amountCents:e.unitAmount,compareAtCents:e.compareAtAmount})]}),(0,l.jsx)("div",{className:"flex shrink-0 sm:pt-1",children:(0,l.jsx)(eD.Button,{type:"button",variant:"outline",className:(0,eF.cn)("min-w-20 border-teal-600 bg-teal-50 text-teal-800 hover:bg-teal-100",t&&"border-destructive/40 bg-background text-destructive hover:bg-destructive/5"),onClick:r,children:t?"Remove":"Add"})})]})}function eG({title:e,subtitle:t,imageUrl:r,imageAlt:n,amountCents:a,compareAtCents:s,priceInterval:i,onRemove:o,removeLabel:c}){return(0,l.jsxs)("div",{className:"flex gap-3 border-b border-border/70 py-4 last:border-b-0",children:[(0,l.jsx)(eM,{url:r,alt:n??e,fallbackLabel:e,className:"w-28 sm:w-32",sizes:"128px"}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsx)("p",{className:"font-medium leading-snug",children:e}),t?(0,l.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:t}):null,(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(eB,{amountCents:a,compareAtCents:s,priceInterval:i})})]}),(0,l.jsx)("div",{className:"flex shrink-0 flex-col items-end gap-1",children:o?(0,l.jsx)(eD.Button,{type:"button",variant:"ghost",size:"icon",className:"size-7 text-muted-foreground hover:text-destructive","aria-label":c??`Remove ${e}`,onClick:o,children:(0,l.jsx)(ea.X,{className:"size-3.5"})}):null})]})}let eV="h-11 border-2 border-border/80 bg-background shadow-sm focus-visible:border-teal-600 focus-visible:ring-teal-600/20",e$="mt-0.5 size-5 shrink-0 rounded-[5px] border-2 border-border/80 shadow-sm data-[state=checked]:border-teal-600 data-[state=checked]:bg-teal-600",eK="flex cursor-pointer items-start gap-3 rounded-lg border-2 border-border/60 bg-muted/15 p-3 text-sm leading-snug";var eJ=e.i(929592),eZ=e.i(59497),eY=e.i(793479),eW=e.i(110204),eH=e.i(629288),eX=e.i(967489),eQ=e.i(525995),e0=e.i(857362),e1=e.i(337890);let e2=es.z.object({firstName:es.z.string().min(1).max(60),lastName:es.z.string().min(1).max(60),email:es.z.string().email(),postalCode:es.z.string().min(3).max(16),buyerState:es.z.string().max(2).optional(),shippingName:es.z.string().max(120).optional(),shippingLine1:es.z.string().max(180).optional(),shippingLine2:es.z.string().max(180).optional(),shippingCity:es.z.string().max(100).optional(),shippingState:es.z.string().max(2).optional(),shippingPostalCode:es.z.string().max(10).optional(),createAccount:es.z.boolean(),password:es.z.string().optional(),marketingOptIn:es.z.boolean(),isGift:es.z.boolean(),giftFirstName:es.z.string().optional(),giftLastName:es.z.string().optional(),giftEmail:es.z.string().optional(),giftMessage:es.z.string().max(500).optional()}).superRefine((e,t)=>{e.createAccount&&(!e.password||e.password.length<8?t.addIssue({code:"custom",message:"Password required (8+ characters)",path:["password"]}):(0,e0.scorePassword)(e.password,[e.email,e.firstName,e.lastName]).score<2&&t.addIssue({code:"custom",message:"Password is too weak",path:["password"]})),e.isGift&&(e.giftFirstName?.trim()||t.addIssue({code:"custom",message:"Recipient first name required",path:["giftFirstName"]}),e.giftLastName?.trim()||t.addIssue({code:"custom",message:"Recipient last name required",path:["giftLastName"]}),e.giftEmail?.trim()&&es.z.string().email().safeParse(e.giftEmail).success||t.addIssue({code:"custom",message:"Recipient email required",path:["giftEmail"]}))});function e5(){return"text-primary underline"}function e4({orgName:e}){let t=e5();return(0,l.jsxs)(l.Fragment,{children:[e,"'s"," ",(0,l.jsx)("a",{href:"/privacy",target:"_blank",rel:"noopener noreferrer",className:t,children:"Privacy"})," ","and"," ",(0,l.jsx)("a",{href:"/terms",target:"_blank",rel:"noopener noreferrer",className:t,children:"Terms"})]})}function e3(){let e=e5();return(0,l.jsxs)(l.Fragment,{children:["Stripe's"," ",(0,l.jsx)("a",{href:"https://stripe.com/privacy",target:"_blank",rel:"noopener noreferrer",className:e,children:"Privacy"})," ","and"," ",(0,l.jsx)("a",{href:"https://stripe.com/legal/consumer",target:"_blank",rel:"noopener noreferrer",className:e,children:"Terms"})]})}function e6(){let e=e5();return(0,l.jsxs)(l.Fragment,{children:["PayPal's"," ",(0,l.jsx)("a",{href:"https://www.paypal.com/us/legalhub/privacy-full",target:"_blank",rel:"noopener noreferrer",className:e,children:"Privacy"})," ","and"," ",(0,l.jsx)("a",{href:"https://www.paypal.com/us/legalhub/useragreement-full",target:"_blank",rel:"noopener noreferrer",className:e,children:"Terms"})]})}function e8({orgName:e,spamDisclaimer:t,hasStripe:r,paypalEligible:n}){return(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:["By completing this purchase, you agree to re
1ceive communications related to your order",t?` (${t})`:""," and accept the"," ",(0,l.jsx)(e4,{orgName:e}),r&&n?(0,l.jsxs)(l.Fragment,{children:[", ",(0,l.jsx)(e3,{}),", and ",(0,l.jsx)(e6,{})]}):r?(0,l.jsxs)(l.Fragment,{children:[", and ",(0,l.jsx)(e3,{})]}):n?(0,l.jsxs)(l.Fragment,{children:[", and ",(0,l.jsx)(e6,{})]}):null,"."]})}function e7(e){return`stk_abandoned_checkout_${e}`}function e9({stripePublishableKey:e,...t}){let r=(0,c.useMemo)(()=>w(e),[e]),n=t.product.prices.find(e=>e.is_default)??t.product.prices[0],a=n?.unit_amount??100,[s,i]=(0,c.useState)(a),o=(0,c.useMemo)(()=>({mode:"payment",amount:Math.max(s,100),currency:"usd",appearance:{theme:"stripe",variables:{colorPrimary:"#0d9488",borderRadius:"6px",fontFamily:"Inter, sans-serif"}},paymentMethodCreation:"manual"}),[s]);return(0,l.jsx)($,{stripe:r,options:o,children:(0,l.jsx)(te,{...t,stripePublishableKey:e,onAmountChange:i})})}function te({product:e,bonusOffers:t,comms:r,stripePublishableKey:n,loggedInEmail:a,loggedInName:s,initialCartToken:i,initialAffiliateRef:o,initialOtoGrantToken:d,onAmountChange:u}){var p;let m=J("calls useStripe()").stripe,f=(p="calls useElements()",V(c.default.useContext(G),p)).elements,h=!!n,g=e.prices.find(e=>e.is_default)??e.prices[0],y=e.client_facing_title?.trim()||e.internal_name,x=(0,eQ.getProductThumbnail)(e.media),b=!!a,v=(0,c.useRef)(null),j=(0,c.useRef)(!1),[N,_]=(0,c.useState)(null);(0,c.useEffect)(()=>{let e=o?.trim().toUpperCase()||null;if(e){sessionStorage.setItem("stk_affiliate_ref",e),_(e);return}let t=sessionStorage.getItem("stk_affiliate_ref")?.trim().toUpperCase();t&&_(t)},[o]);let[S,w]=(0,c.useState)([]),[C,E]=(0,c.useState)(!1),[P,k]=(0,c.useState)(null),[I,O]=(0,c.useState)(null),[A,T]=(0,c.useState)(!1),[L,R]=(0,c.useState)([]),[D,F]=(0,c.useState)(null),[U,z]=(0,c.useState)(null),[M,B]=(0,c.useState)(!1),[q,$]=(0,c.useState)(null),[K,Z]=(0,c.useState)(""),[Y,W]=(0,c.useState)(null),[ec,ed]=(0,c.useState)(null),[eu,ep]=(0,c.useState)(!1),[em,ef]=(0,c.useState)(0),[eh,eg]=(0,c.useState)(null),[ey,ex]=(0,c.useState)(!1),[eb,ev]=(0,c.useState)(null),ej=(0,Q.useForm)({resolver:(0,X.zodResolver)(e2),defaultValues:{firstName:s?.firstName??"",lastName:s?.lastName??"",email:a??"",postalCode:"",buyerState:"",shippingName:[s?.firstName,s?.lastName].filter(Boolean).join(" "),shippingLine1:"",shippingLine2:"",shippingCity:"",shippingState:"",shippingPostalCode:"",createAccount:!1,password:"",marketingOptIn:!1,isGift:!1,giftFirstName:"",giftLastName:"",giftEmail:"",giftMessage:""}}),eN=ej.watch("createAccount"),e_=ej.watch("password"),eS=ej.watch("isGift"),ew=ej.watch("postalCode"),eC=ej.watch("buyerState"),eE=ej.watch("email"),eP=ej.watch("firstName"),ek=ej.watch("lastName"),eI=ej.watch("marketingOptIn"),eO=ej.watch("shippingName"),eA=ej.watch("shippingLine1"),eT=ej.watch("shippingLine2"),eR=ej.watch("shippingCity"),eF=ej.watch("shippingState"),eU=ej.watch("shippingPostalCode");(0,c.useEffect)(()=>{let t=localStorage.getItem(e7(e.id)),r=i||t||("u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID().replace(/-/g,"")+crypto.randomUUID().replace(/-/g,"").slice(0,8):`${Date.now().toString(36)}${Math.random().toString(36).slice(2,12)}`);v.current=r,t||localStorage.setItem(e7(e.id),r)},[e.id,i]),(0,c.useEffect)(()=>{let t=i||v.current;if(!t||j.current)return;let r=!1;return(async()=>{try{let n=await fetch(`/api/checkout/abandoned?token=${encodeURIComponent(t)}`);if(!n.ok||r)return;let a=await n.json();if(a.product_id!==e.id)return;j.current=!0,v.current=a.session_token,localStorage.setItem(e7(e.id),a.session_token),Array.isArray(a.bonus_price_ids)&&w(a.bonus_price_ids),"string"==typeof a.coupon_code&&a.coupon_code&&Z(a.coupon_code),"string"==typeof a.attach_to_license_id&&a.attach_to_license_id?(O(a.attach_to_license_id),T(!1)):!0===a.create_new_license&&(T(!0),O(null)),"string"==typeof a.postal_code&&a.postal_code&&ej.setValue("postalCode",a.postal_code),!0===a.marketing_opt_in&&ej.setValue("marketingOptIn",!0),!ej.getValues("email")&&a.buyer?.email&&(ej.setValue("email",a.buyer.email),a.buyer.first_name&&ej.setValue("firstName",a.buyer.first_name),a.buyer.last_name&&ej.setValue("lastName",a.buyer.last_name))}catch{}})(),()=>{r=!0}},[i,e.id,ej]);let eM=t.filter(e=>S.includes(e.priceId)).reduce((e,t)=>
1e+t.unitAmount,0),eB=(g?.unit_amount??0)+eM,e0=("physical"===e.kind||"physical"===e.fulfillment_type)&&e.requires_shipping||t.some(e=>S.includes(e.priceId)&&e.requiresShipping),e5=g?.interval==="lead_magnet",e4=g?.interval!=="one_time"&&g?.interval!=="lead_magnet",e3=t.some(e=>S.includes(e.priceId)&&"one_time"!==e.interval),e6=r.paypalEnabled&&!!r.paypalClientId&&!e4&&!e3&&!eS&&!e5,e9=Y?.discountCents??0,tt=eh?.options.find(e=>e.id===eh.selectedRateId)??null,tr=e0?tt?.shippingCents??0:0,tn=e5?0:Math.max(eB-e9+em+tr,100);async function ta(){if(g&&K.trim()){ep(!0),ed(null);try{let t=await fetch("/api/checkout/coupon/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:K.trim(),product_id:e.id,subtotal_cents:eB,postal_code:ew?.trim()||void 0,buyer_state:eC?.trim()||void 0})}),r=await t.json().catch(()=>({}));if(!t.ok){W(null),ed(r.error??"Coupon could not be applied");return}W({code:r.code,discountCents:Number(r.discount_cents??0)}),ef(Number(r.tax_estimate_cents??0))}finally{ep(!1)}}}function ts(e){return{coupon_code:Y?.code,affiliate_referral_code:N??void 0,oto_grant_token:d??void 0,shipping_quote_id:e0?eh?.quoteId:void 0,shipping_rate_id:e0?eh?.selectedRateId:void 0,is_gift:e.isGift,gift_message:e.isGift?e.giftMessage:void 0,gift_recipient:e.isGift?{first_name:e.giftFirstName??"",last_name:e.giftLastName??"",email:e.giftEmail??""}:void 0}}function ti(e){if(e0)return{name:e.shippingName?.trim()??"",line1:e.shippingLine1?.trim()??"",line2:e.shippingLine2?.trim()||void 0,city:e.shippingCity?.trim()??"",state:e.shippingState?.trim().toUpperCase()??"",postal_code:e.shippingPostalCode?.trim()??"",country:"US"}}function to(){return v.current??void 0}async function tl(){if(!await ej.trigger()||!g||e0&&!eh)return null;let t=ej.getValues();return{product_id:e.id,price_id:g.id,bonus_price_ids:S,buyer:{first_name:t.firstName,last_name:t.lastName,email:t.email},...I?{attach_to_license_id:I}:{},...A?{create_new_license:!0}:{},marketing_opt_in:t.marketingOptIn,postal_code:t.postalCode,buyer_state:t.buyerState?.trim()||void 0,shipping_address:ti(t),create_account:!b&&t.createAccount,password:t.createAccount?t.password:void 0,checkout_session_token:to(),...ts(t)}}async function tc(t){if(!g||C||!e5)return;E(!0),k(null);let r=await fetch("/api/checkout/product",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({product_id:e.id,price_id:g.id,bonus_price_ids:[],buyer:{first_name:t.firstName,last_name:t.lastName,email:t.email},marketing_opt_in:t.marketingOptIn,postal_code:t.postalCode,buyer_state:t.buyerState?.trim()||void 0,shipping_address:ti(t),create_account:!b&&t.createAccount,password:t.createAccount?t.password:void 0,checkout_session_token:to(),...ts(t)})}),n=await r.json().catch(()=>({}));if(!r.ok){k(n.error??"Could not claim product"),E(!1);return}window.location.href=`/checkout/success?order_id=${n.order_id??""}`}async function td(t){if(!h||!m||!f||!g||C||e0&&!eh)return;E(!0),k(null);let{error:r}=await f.submit();if(r){k(r.message??"Check payment details"),E(!1);return}let n=await fetch("/api/checkout/product",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({product_id:e.id,price_id:g.id,bonus_price_ids:S,buyer:{first_name:t.firstName,last_name:t.lastName,email:t.email},marketing_opt_in:t.marketingOptIn,postal_code:t.postalCode,buyer_state:t.buyerState?.trim()||void 0,shipping_address:ti(t),create_account:!b&&t.createAccount,password:t.createAccount?t.password:void 0,checkout_session_token:to(),...I?{attach_to_license_id:I}:{},...A?{create_new_license:!0}:{},...ts(t)})}),a=await n.json().catch(()=>({}));if(!n.ok){"license_attach_ambiguous"===a.code||"create_new_license_required"===a.code?(F(a.code),R(Array.isArray(a.candidates)?a.candidates.map(e=>({licenseId:String(e.licenseId??""),licenseKeySuffix:String(e.licenseKeySuffix??""),siteLimit:"number"==typeof e.siteLimit?e.siteLimit:null,proProductTitle:String(e.proProductTitle??"Pro license")})):[]),k(a.error??"Choose a license to continue")):k(a.error??"Could not start checkout"),E(!1);return}if("free"===a.type&&a.order_id){window.location.href=`/checkout/success?order_id=${a.order_id}`;return}if("checkout_session"===a.type&&a.url){window.location.href=a.url;return}if(!a.client_secret){k("Unexpected checkout response"),E(!1);return}$(a.order_id??null);let{error:s,paymentMethod:i}=await m.createPaymentMethod({elements:f,params:{billing_details:{address:{postal_code:t.postalCode?.trim()||void 0}}}});if(s||!i){k(s?.message??"Could not create payment method"),E(!1);return}let o=window.location.origin,{error:l}=await m.confirmPayment({clientSecret:a.client_secret,confirmParams:{return_url:`${o}/checkout/success?order_id=${a.order_id??""}`,payment_method:i.id},redirect:"if_required"});if(l){k(l.message??"Payment failed"),E(!1);return}window.location.href=`/checkout/success?order_id=${a.order_id??q??""}`}if((0,c.useEffect)(()=>{u(tn)},[tn,u]),(0,c.useEffect)(()=>
1{if(!e0){eg(null),ev(null),ex(!1);return}if(ej.setValue("postalCode",eU?.trim()??""),ej.setValue("buyerState",eF?.trim().toUpperCase()??""),eg(null),!(eO?.trim()&&eA?.trim()&&eR?.trim()&&/^[A-Za-z]{2}$/.test(eF?.trim()??"")&&/^\d{5}(?:-\d{4})?$/.test(eU?.trim()??""))||!g){ev(null),ex(!1);return}let t=new AbortController;ex(!0),ev(null);let r=setTimeout(()=>{fetch("/api/checkout/shipping-estimate",{method:"POST",headers:{"Content-Type":"application/json"},signal:t.signal,body:JSON.stringify({product_id:e.id,price_id:g.id,bonus_price_ids:S,coupon_code:Y?.code,shipping_address:{name:eO?.trim(),line1:eA?.trim(),line2:eT?.trim()||void 0,city:eR?.trim(),state:eF?.trim().toUpperCase(),postal_code:eU?.trim(),country:"US"}})}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error??"Shipping could not be estimated");let r=Array.isArray(t.options)?t.options.map(e=>({id:String(e.id??""),label:String(e.label??""),carrier:String(e.carrier??""),service:String(e.service??""),shippingCents:Number(e.shipping_cents),deliveryDays:"number"==typeof e.delivery_days?e.delivery_days:void 0,deliveryDate:"string"==typeof e.delivery_date?e.delivery_date:void 0})).filter(e=>e.id&&Number.isFinite(e.shippingCents)):[];if(!t.quote_id||0===r.length)throw Error("No shipping services are available");eg({quoteId:String(t.quote_id),expiresAt:String(t.expires_at??""),options:r,selectedRateId:r[0].id})}).catch(e=>{t.signal.aborted||ev(e instanceof Error?e.message:"Shipping could not be estimated")}).finally(()=>{t.signal.aborted||ex(!1)})},500);return()=>{clearTimeout(r),t.abort()}},[Y?.code,g,ej,e.id,e0,S,eR,eA,eT,eO,eU,eF]),(0,c.useEffect)(()=>{e0&&eS&&ej.setValue("isGift",!1)},[ej,eS,e0]),(0,c.useEffect)(()=>{let e=!1;return async function(){let t=r.taxRequiresBuyerState,n=r.taxUsesZipLookup||r.taxEnabled||h;if(t&&!eC?.trim()||n&&(!ew||ew.trim().length<5)){e||ef(0);return}try{let t=await fetch("/api/checkout/tax-estimate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subtotal_cents:eB,discount_cents:e9,postal_code:ew?.trim()||void 0,buyer_state:eC?.trim()||void 0})}),r=await t.json().catch(()=>({}));e||ef(t.ok?Number(r.tax_estimate_cents??0):0)}catch{e||ef(0)}}(),()=>{e=!0}},[eB,e9,ew,eC,r.taxRequiresBuyerState,r.taxUsesZipLookup,r.taxEnabled,h]),(0,c.useEffect)(()=>{if(eS||!es.z.string().email().safeParse(eE).success||!g||!v.current)return;let t=setTimeout(()=>{fetch("/api/checkout/abandoned",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_token:v.current,product_id:e.id,price_id:g.id,buyer:{email:eE,first_name:eP,last_name:ek},bonus_price_ids:S,coupon_code:Y?.code,attach_to_license_id:A?null:I,create_new_license:A,postal_code:ew?.trim()||void 0,marketing_opt_in:eI,subtotal_cents:eB,discount_cents:e9,tax_estimate_cents:em,total_cents:tn})}).then(e=>e.json()).then(t=>{"string"==typeof t.session_token&&(v.current=t.session_token,localStorage.setItem(e7(e.id),t.session_token))}).catch(()=>void 0)},1500);return()=>clearTimeout(t)},[Y?.code,I,A,e9,eE,eP,eS,ek,eI,ew,e.id,g,S,eB,em,tn]),(0,c.useEffect)(()=>{if(!h||!f||tn<100)return void B(!1);let e=!1;return B(!1),Promise.resolve(f.update({amount:tn,currency:"usd"})).catch(()=>void 0).finally(()=>{e||B(!0)}),()=>{e=!0}},[f,h,tn]),!g)return(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"This product is not available for purchase."});if(!h&&!e6)return(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Checkout is not configured yet. Please contact support."});let tu=P??U,tp=L.length>0?(0,l.jsxs)("div",{className:"rounded-md border border-border p-4 space-y-3",children:[(0,l.jsx)("p",{className:"text-sm font-medium",children:"create_new_license_required"===D?"You already own this Pro product":"Choose which license to use"}),(0,l.jsx)(eH.RadioGroup,{value:I??"",onValueChange:e=>{O(e),T(!1)},children:L.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(eH.RadioGroupItem,{value:e.licenseId,id:e.licenseId}),(0,l.jsxs)(eW.Label,{htmlFor:e.licenseId,className:"text-sm font-normal",children:["…",e.licenseKeySuffix," — ",e.proProductTitle,null!=e.siteLimit?` (${e.siteLimit} sites)`:" (unlimited)"]})]},e.licenseId))}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,l.jsx)(eZ.Checkbox,{id:"create-new-license",checked:A,onCheckedChange:e=>{let t=!0===e;T(t),t&&O(null)}}),(0,l.jsx)(eW.Label,{htmlFor:"create-new-license",className:"text-sm font-normal",children:"Create a separate license key instead"})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"The
1n submit checkout again with your choice."})]}):null;return(0,l.jsxs)("div",{className:"checkout-page grid gap-8 lg:grid-cols-[minmax(0,1fr)_minmax(280px,360px)] lg:items-start",children:[(0,l.jsxs)("form",{onSubmit:e5?ej.handleSubmit(tc):h?ej.handleSubmit(td):e=>e.preventDefault(),className:"space-y-8",children:[tp,(0,l.jsxs)("section",{className:"space-y-4",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:"Get started"}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Use this account to access your purchase."}),(0,l.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"firstName",children:"First name"}),(0,l.jsx)(eY.Input,{className:eV,id:"firstName",...ej.register("firstName")})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"lastName",children:"Last name"}),(0,l.jsx)(eY.Input,{className:eV,id:"lastName",...ej.register("lastName")})]})]}),e0?null:(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("h3",{className:"text-base font-semibold",children:"Billing"}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"postalCode",children:"ZIP / postal code"}),(0,l.jsx)(eY.Input,{className:eV,id:"postalCode",placeholder:r.taxUsesZipLookup?"Enter your ZIP for tax estimate":"Billing ZIP",autoComplete:"postal-code",...ej.register("postalCode")}),r.taxUsesZipLookup&&r.taxHomeState?(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Estimated tax applies to matching ",(0,e1.stateLabel)(r.taxHomeState)," ZIP codes only."]}):null]}),r.taxEnabled&&r.taxRequiresBuyerState?(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"buyerState",children:"Billing state"}),(0,l.jsx)(Q.Controller,{control:ej.control,name:"buyerState",render:({field:e})=>(0,l.jsxs)(eX.Select,{value:e.value||"",onValueChange:e.onChange,children:[(0,l.jsx)(eX.SelectTrigger,{id:"buyerState",children:(0,l.jsx)(eX.SelectValue,{placeholder:"Select state for tax estimate"})}),(0,l.jsx)(eX.SelectContent,{position:"popper",className:"z-50",children:e1.US_STATE_OPTIONS.map(e=>(0,l.jsx)(eX.SelectItem,{value:e.value,children:e.label},e.value))})]})}),r.taxHomeState?(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Estimated tax applies to ",(0,e1.stateLabel)(r.taxHomeState)," billing addresses only."]}):null]}):null]}),e0?(0,l.jsxs)("div",{className:"space-y-4 rounded-lg border bg-muted/20 p-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-base font-semibold",children:"Shipping address"}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"Phase 1 ships to US addresses only. Shipping updates after you enter the address."})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"shippingName",children:"Full name"}),(0,l.jsx)(eY.Input,{className:eV,id:"shippingName",autoComplete:"shipping name",...ej.register("shippingName")})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"shippingLine1",children:"Address"}),(0,l.jsx)(eY.Input,{className:eV,id:"shippingLine1",autoComplete:"shipping address-line1",...ej.register("shippingLine1")})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"shippingLine2",children:"Apartment, suite, etc. (optional)"}),(0,l.jsx)(eY.Input,{className:eV,id:"shippingLine2",autoComplete:"shipping address-line2",...ej.register("shippingLine2")})]}),(0,l.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"shippingCity",children:"City"}),(0,l.jsx)(eY.Input,{className:eV,id:"shippingCity",autoComplete:"shipping address-level2",...ej.register("shippingCity")})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"shippingState",children:"State"}),(0,l.jsx)(Q.Controller,{control:ej.control,name:"shippingState",render:({field:e})=>(0,l.jsxs)(eX.Select,{value:e.value||"",onValueChange:e.onChange,children:[(0,l.jsx)(eX.SelectTrigger,{id:"shippingState",children:(0,l.jsx)(eX.SelectValue,{placeholder:"Select state"})}),(0,l.jsx)(eX.SelectContent,{position:"popper",className:"z-50",children:e1.US_STATE_OPTIONS.map(e=>(0,l.jsx)(eX.SelectItem,{value:e.value,children:e.label},e.value))})]})})]})]}),(0,l.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"shippingPostalCode",children:"ZIP code"}),(0,l.jsx)(eY.Input,{className:eV,id:"shippingPostalCode",inputMode:"numeric",autoComplete:"shipping postal-code",...ej.register("shippingPostalCode")})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{children:"Country"}),(0,l.jsx)(eY.Input,{value:"United States",disabled:!0})]})]}),ey?(0,l.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,l.jsx)(et.Loader2,{className:"size-4 animate-spin"})," Updating shipping…"]}):null,eb?(0,l.jsx)(eJ.Alert,{variant:"destructive",children:(0,l.jsx)(eJ.AlertDescription,{children:eb})}):null,eh&&eh.options.length>0?(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{children:"Shipping service"}),(0,l.jsx)(eH.RadioGroup,{value:eh.selectedRateId,onValueChange:e=>eg(t=>t?{...t,selectedRateId:e}
1:t),className:"gap-2",children:eh.options.map(e=>(0,l.jsxs)("label",{className:"flex cursor-pointer items-center justify-between gap-3 rounded-md border bg-background p-3",children:[(0,l.jsxs)("span",{className:"flex items-center gap-3",children:[(0,l.jsx)(eH.RadioGroupItem,{value:e.id}),(0,l.jsxs)("span",{children:[(0,l.jsx)("span",{className:"block text-sm font-medium",children:e.label}),null!=e.deliveryDays?(0,l.jsxs)("span",{className:"block text-xs text-muted-foreground",children:["Estimated ",e.deliveryDays," business day",1===e.deliveryDays?"":"s"]}):null]})]}),(0,l.jsx)("span",{className:"text-sm font-medium",children:(0,ez.formatProductCents)(e.shippingCents)})]},e.id))})]}):null]}):null,(0,l.jsxs)("div",{className:b?"space-y-2":"grid gap-4 sm:grid-cols-2 sm:items-end",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"email",children:"Email"}),(0,l.jsx)(eY.Input,{className:eV,id:"email",type:"email",disabled:b,...ej.register("email")})]}),b||eN?null:(0,l.jsxs)("label",{className:`${eK} min-h-11`,children:[(0,l.jsx)(Q.Controller,{control:ej.control,name:"createAccount",render:({field:e})=>(0,l.jsx)(eZ.Checkbox,{className:e$,checked:e.value,onCheckedChange:t=>e.onChange(!0===t)})}),(0,l.jsx)("span",{children:"Create an account to access your purchases anytime"})]}),!b&&eN?(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"password",children:"Password"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(ei.PasswordInput,{id:"password",autoComplete:"new-password",className:`${eV} flex-1`,...ej.register("password")}),(0,l.jsx)(eD.Button,{type:"button",variant:"outline",size:"icon",className:"size-11 shrink-0","aria-label":"Cancel account creation",onClick:function(){ej.setValue("createAccount",!1),ej.setValue("password","")},children:(0,l.jsx)(ea.X,{className:"size-4"})})]})]}):null]}),!b&&eN?(0,l.jsx)(eo.PasswordStrengthMeter,{password:e_??"",userInputs:[ej.watch("email"),ej.watch("firstName"),ej.watch("lastName")]}):null,!b&&eN&&r.requireEmailConfirmation?(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"You will receive a confirmation email before you can sign in to your account. Your purchase and download access are available right away."}):null,e0?null:(0,l.jsxs)("label",{className:eK,children:[(0,l.jsx)(Q.Controller,{control:ej.control,name:"isGift",render:({field:e})=>(0,l.jsx)(eZ.Checkbox,{className:e$,checked:e.value,onCheckedChange:t=>e.onChange(!0===t)})}),(0,l.jsx)("span",{children:"This is a gift — send access to someone else"})]}),eS?(0,l.jsxs)("div",{className:"space-y-4 rounded-lg border bg-muted/20 p-4",children:[(0,l.jsx)("p",{className:"text-sm font-medium",children:"Gift recipient"}),(0,l.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"giftFirstName",children:"Recipient first name"}),(0,l.jsx)(eY.Input,{className:eV,id:"giftFirstName",...ej.register("giftFirstName")})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"giftLastName",children:"Recipient last name"}),(0,l.jsx)(eY.Input,{className:eV,id:"giftLastName",...ej.register("giftLastName")})]})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"giftEmail",children:"Recipient email"}),(0,l.jsx)(eY.Input,{className:eV,id:"giftEmail",type:"email",...ej.register("giftEmail")})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(eW.Label,{htmlFor:"giftMessage",children:"Gift message (optional)"}),(0,l.jsx)(eY.Input,{className:eV,id:"giftMessage",placeholder:"A note included in the delivery email",...ej.register("giftMessage")})]})]}):null]}),t.length>0?(0,l.jsxs)("section",{className:"space-y-1",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:"Bonus offer"}),(0,l.jsx)("div",{className:"divide-y divide-border/70",children:t.map(e=>(0,l.jsx)(eq,{offer:e,selected:S.includes(e.priceId),onToggle:()=>{var t;return t=e.priceId,void w(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}},e.id))})]}):null,(0,l.jsxs)("section",{className:"space-y-3",children:[(0,l.jsx)(Q.Controller,{c
1ontrol:ej.control,name:"marketingOptIn",render:({field:e})=>(0,l.jsx)(el.CommunicationsOptInFields,{optInLabel:r.optInLabel,spamDisclaimer:r.spamDisclaimer,checked:e.value,onCheckedChange:e.onChange,hiddenInputName:"",checkboxClassName:e$,labelClassName:eK,showSpamDisclaimer:!1})}),eI?(0,l.jsx)(e8,{orgName:r.orgName,spamDisclaimer:r.spamDisclaimer,hasStripe:h,paypalEligible:e6}):(0,l.jsxs)("div",{role:"status",className:"flex items-start gap-3 rounded-lg border-2 border-amber-500/50 bg-amber-50 px-4 py-3 text-sm font-medium text-amber-950 shadow-sm",children:[(0,l.jsx)(ee.ChevronUp,{className:"mt-0.5 size-5 shrink-0 text-amber-600","aria-hidden":!0}),(0,l.jsxs)("p",{children:["Check the box above to continue",e5?"":" to payment","."]})]})]}),eI?(0,l.jsxs)("section",{className:"space-y-6",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:e5?"Claim your free gift":"Payment"}),tu?(0,l.jsx)(eJ.Alert,{variant:"destructive",children:(0,l.jsx)(eJ.AlertDescription,{children:tu})}):null,e5?(0,l.jsxs)("div",{className:"space-y-4 rounded-xl border-2 border-teal-600/25 bg-card p-4 shadow-sm",children:[(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"No payment required. We will add this to your member area after you claim it."}),(0,l.jsxs)(eD.Button,{type:"submit",size:"lg",className:"w-full bg-teal-600 hover:bg-teal-700",disabled:C,children:[C?(0,l.jsx)(et.Loader2,{className:"mr-2 size-4 animate-spin"}):null,"Claim for FREE"]})]}):h?(0,l.jsxs)("div",{className:"space-y-4 rounded-xl border-2 border-teal-600/25 bg-card p-4 shadow-sm",children:[(0,l.jsx)("p",{className:"text-sm font-medium",children:"Pay with card"}),tn>=100&&M?(0,l.jsx)(H,{options:{layout:"tabs",fields:{billingDetails:{address:{postalCode:"never"}}},wallets:{applePay:"auto",googlePay:"auto",link:"auto"},paymentMethodOrder:["card","apple_pay","google_pay","link"]}}):(0,l.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,l.jsx)(et.Loader2,{className:"size-4 animate-spin"}),"Loading payment options…"]}),(0,l.jsxs)(eD.Button,{type:"submit",size:"lg",className:"w-full bg-teal-600 hover:bg-teal-700",disabled:C||!m||!f||!M||e0&&(!eh||ey),children:[C?(0,l.jsx)(et.Loader2,{className:"mr-2 size-4 animate-spin"}):(0,l.jsx)(er.Lock,{className:"mr-2 size-4"}),"Buy now — ",(0,ez.formatProductCents)(tn)]})]}):null,e5||h||!e6?null:(0,l.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:"Complete checkout with PayPal below."}),(0,l.jsxs)("p",{className:"flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[(0,l.jsx)(en.Shield,{className:"size-3.5 shrink-0"}),"All transactions are secure and encrypted"]}),e6&&r.paypalClientId&&!e5?(0,l.jsxs)("div",{className:"space-y-3 rounded-xl border bg-muted/20 p-4",children:[(0,l.jsx)("p",{className:"text-center text-sm font-medium text-muted-foreground",children:h?"Or pay with PayPal":"Pay with PayPal"}),(0,l.jsx)(eL,{clientId:r.paypalClientId,testMode:r.paypalTestMode,disabled:C||e0&&(!eh||ey),amountKey:tn,buildPayload:tl,onError:e=>{z(e||null),e&&k(null)}})]}):null,e4&&r.paypalEnabled?(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"Subscriptions are billed with card via Stripe. PayPal is available for one-time purchases only."}):null]}):null]}),(0,l.jsx)("aside",{className:"lg:sticky lg:top-8",children:(0,l.jsxs)("div",{className:"rounded-xl border bg-card p-5 shadow-sm",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold",children:"Order summary"}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)(eG,{title:y,subtitle:"physical"===e.kind||"physical"===e.fulfillment_type?"Ships to you":"Digital product",imageUrl:x.url,imageAlt:x.alt,amountCents:g.unit_amount,compareAtCents:g.compare_at_amount,priceInterval:g.interval}),t.filter(e=>S.includes(e.priceId)).map(e=>(0,l.jsx)(eG,{title:e.headline,subtitle:e.productTitle,imageUrl:e.imageUrl,imageAlt:e.imageAlt,amountCents:e.unitAmount,compareAtCents:e.compareAtAmount,onRemove:()=>{var t;return t=e.priceId,void w(e=>e.filter(e=>e!==t))},removeLabel:`Remove ${e.productTitle}`},e.id))]}),(0,l.jsxs)("div",{className:"space-y-3 border-t pt-4",children:[(0,l.jsx)(eW.Label,{htmlFor:"couponCode",className:"text-sm",children:"Coupon code"}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(eY.Input,{id:"couponCode",value:K,onChange:e=>Z(e.target.value.toUpperCase()),placeholder:"Enter code"}),(0,l.jsx)(eD.Button,{type:"button",variant:"outline",onClick:()=>void ta(),disabled:eu||!K.trim(),children:eu?(0,l.jsx)(et.Loader2,{className:"size-4 animate-spin"}):"Apply"})]}),Y?(0,l.jsxs)("p",{className:"text-xs text-teal-700",children:[Y.code," applied (−",(0,ez.formatProductCents)(Y.discountCents),")"]}):null,ec?(0,l.jsx)("p",{className:"text-xs text-destructive",children:ec}):null]}),(0,l.jsxs)("div",{className:"space-y-2 border-t pt-4 text-sm",children:[(0,l.jsxs)("div",{className:"flex justify-between",children:[(0,l.jsx)("span",{className:"text-muted-foreground",children:"Subtotal"}),(0,l.jsx)("span",{children:(0,ez.formatProductPriceDisplay)({unit_amount:eB,interval:g.interval})})]}),e9>0?(0,l.jsxs)("div",{className:"flex justify-between text-teal-700",children:[(0,l.jsx)("span",{children:"Discount"}),(0,l.jsxs)("span",{children:["−",(0,ez.formatProductCents)(e9)]})]}):null,e0?(0,l.jsxs)("div",{className:"flex justify-between",children:[(0,l.jsx)("span",{className:"text-muted-foreground",children:"Shipping"}),(0,l.jsx)("span",{children:ey?"Updating…":eh?(0,ez.formatProductCents)(tr):"Enter address"})]}):null,em>0?(0,l.jsxs)("div",{className:"flex justify-between",children:[(0,l.jsx)("span",{className:"text-muted-foreground",children:"Estimated tax"}),(0,l.jsx)("span",{children:(0,ez.formatProductCents)(em)})]}):r.taxRequiresBuyerState&&eC?.trim()?(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:["No estimated tax for ",(0,e1.stateLabel)(eC)," orders."]}):r.taxUsesZipLookup&&ew?.trim()?.length>=5?(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"No estimated tax for this ZIP."}):ew?.trim()?(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"Estimated tax: $0.00"}):null]}),(0,l.jsxs)("div",{className:"flex items-center justify-between pt-2 text-base font-semibold",children:[(0,l.jsx)("span",{children:"Total"}),(0,l.jsx)("span",{children:(0,ez.formatProductPriceDisplay)({unit_amount:tn,interval:g.interval})})]})]})})]})}e.s(["CatalogCheckoutForm",0,function(e){return e.stripePublishableKey?(0,l.jsx)(e9,{...e,stripePublishableKey:e.stripePublishableKey}):(0,l.jsx)(te,{...e,stripePublishableKey:null,onAmountChange:()=>{}})}],714568)}]);

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.