1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="539caf24-f5ea-44c3-ab47-e4ef19194999",e._sentryDebugIdIdentifier="sentry-dbid-539caf24-f5ea-44c3-ab47-e4ef19194999")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2244],{1694:(e,t,n)=>{n.d(t,{u:()=>a});function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD";return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e/100)}},4966:(e,t,n)=>{n.d(t,{Ai:()=>m,B1:()=>x,B5:()=>u,Op:()=>h,cX:()=>y,hz:()=>i,jb:()=>b,qz:()=>d,sX:()=>p,vU:()=>f});let a="mtg:cart-changed";function l(e){return"mtg_cart_".concat("v1",":").concat(e)}function s(e,t){return"".concat(e,":").concat(null!=t?t:"")}function i(e){try{let t=window.localStorage.getItem(l(e));if(!t)return[];let n=JSON.parse(t);if(!Array.isArray(n))return[];return n.filter(o)}catch(e){return[]}}function r(e,t){try{window.localStorage.setItem(l(e),JSON.stringify(t))}catch(e){}try{window.dispatchEvent(new CustomEvent(a,{detail:{websiteId:e}}))}catch(e){}}function o(e){return!!e&&"object"==typeof e&&"string"==typeof e.product_id&&"number"==typeof e.quantity&&e.quantity>0&&"string"==typeof e.name}function c(e){return Math.max(1,Math.min(99,Math.floor(e)||1))}function u(e,t){let n=i(e),a=s(t.product_id,t.variant_id),l=n.find(e=>s(e.product_id,e.variant_id)===a)?n.map(e=>s(e.product_id,e.variant_id)===a?{...e,...t,quantity:c(e.quantity+t.quantity)}:e):[...n,{...t,quantity:c(t.quantity)}];return r(e,l),l}function d(e,t,n,a){let l=s(t,n),o=i(e).map(e=>s(e.product_id,e.variant_id)===l?{...e,quantity:c(a)}:e);return r(e,o),o}function m(e,t,n){let a=s(t,n),l=i(e).filter(e=>s(e.product_id,e.variant_id)!==a);return r(e,l),l}function p(e){r(e,[])}function h(e){return e.reduce((e,t)=>e+t.quantity,0)}function f(e){return e.reduce((e,t)=>e+t.unit_cents*t.quantity,0)}function b(e){return e.some(e=>!!e.shipping_class&&"no_ship"!==e.shipping_class)}function y(e){return e.map(e=>({product_id:e.product_id,variant_id:e.variant_id,quantity:e.quantity}))}function x(e,t){let n=l(e),s=n=>{let a=n.detail;(null==a?void 0:a.websiteId)&&a.websiteId!==e||t()},i=e=>{(null===e.key||e.key===n)&&t()};return window.addEventListener(a,s),window.addEventListener("storage",i),()=>{window.removeEventListener(a,s),window.removeEventListener("storage",i)}}},6160:(e,t,n)=>{n.d(t,{N:()=>u});var a=n(5155),l=n(2115),s=n(1694),i=n(4966);let r=[["AL","Alabama"],["AZ","Arizona"],["AR","Arkansas"],["CA","California"],["CO","Colorado"],["CT","Connecticut"],["DE","Delaware"],["DC","District of Columbia"],["FL","Florida"],["GA","Georgia"],["ID","Idaho"],["IL","Illinois"],["IN","Indiana"],["IA","Iowa"],["KS","Kansas"],["KY","Kentucky"],["LA","Louisiana"],["ME","Maine"],["MD","Maryland"],["MA","Massachusetts"],["MI","Michigan"],["MN","Minnesota"],["MS","Mississippi"],["MO","Missouri"],["MT","Montana"],["NE","Nebraska"],["NV","Nevada"],["NH","New Hampshire"],["NJ","New Jersey"],["NM","New Mexico"],["NY","New York"],["NC","North Carolina"],["ND","North Dakota"],["OH","Ohio"],["OK","Oklahoma"],["OR","Oregon"],["PA","Pennsylvania"],["RI","Rhode Island"],["SC","South Carolina"],["SD","South Dakota"],["TN","Tennessee"],["TX","Texas"],["UT","Utah"],["VT","Vermont"],["VA","Virginia"],["WA","Washington"],["WV","West Virginia"],["WI","Wisconsin"],["WY","Wyoming"]],o={out_of_stock:"Sorry, one of these items is out of stock.",variant_required:"Please select an option.",variant_not_found:"One of these options is no longer available. Please remove it and try again.",product_not_found:"One of these items is no longer available. Please remove it and try again.",address_required:"Please fill in your shipping address.",incomplete_address:"Please fill in your shipping address.",us_only:"We currently ship within the continental United States only.",continental_us_only:"We currently ship within the continental United States only.",invalid_zip:"Please enter a valid 5-digit ZIP code.",shipping_unavailable:"We canât calculate shipping right now. Please try again later or call us to order.",rate_failed:"We couldnât calculate shipping. Please check your address and try again.",mixed_currency:"These items canât be bought together. Please check out separately.",too_many_items:"Thatâs more items than we can check out at once. Please split the order.",stripe_failed:"Could not start checkout. Please try again or c
1ontact us.",payment_init_failed:"Could not start checkout. Please try again or contact us.",payments_not_configured:"Online payment isnât set up yet. Please contact us to order.",payments_not_enabled:"Online payment isnât available right now. Please contact us to order."},c="w-full rounded-md border border-neutral-300 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-brand focus:border-brand";function u(e){var t,n;let{websiteId:u,items:d,provider:m,currency:p,disabled:h,submitLabel:f,onBeforeRedirect:b}=e,[y,x]=(0,l.useState)(""),[g,v]=(0,l.useState)(""),[_,N]=(0,l.useState)(""),[j,w]=(0,l.useState)(""),[k,C]=(0,l.useState)(""),[S,I]=(0,l.useState)(""),[P,M]=(0,l.useState)(""),[O,T]=(0,l.useState)(null),[A,q]=(0,l.useState)(!1),[E,D]=(0,l.useState)(!1),[W,L]=(0,l.useState)(null),[U,J]=(0,l.useState)(null),V=(0,i.vU)(d),X=0===V,z=(0,i.jb)(d),K=(0,l.useMemo)(()=>d.map(e=>{var t;return"".concat(e.product_id,":").concat(null!=(t=e.variant_id)?t:"",":").concat(e.quantity)}).join("|"),[d]);(0,l.useEffect)(()=>{T(null)},[K]),(0,l.useEffect)(()=>{if(!z)return void J({available:!0,contact_phone:null});let e=!1;return fetch("/api/checkout/rates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({website_id:u,items:(0,i.cX)(d),probe:!0})}).then(e=>e.json()).then(t=>{var n;e||J({available:!1!==t.available,contact_phone:null!=(n=t.contact_phone)?n:null})}).catch(()=>{e||J({available:!0,contact_phone:null})}),()=>{e=!0}},[u,K,z]);let R=z&&!X,Y=!!(_.trim()&&k.trim()&&S&&/^\d{5}(-\d{4})?$/.test(P.trim())),B=V+(null!=(t=null==O?void 0:O.shipping_cents)?t:0),F=!R||null!==O;function $(){return{street1:_.trim(),street2:j.trim()||null,city:k.trim(),state:S,postal_code:P.trim()}}function G(e){return t=>{e(t),T(null)}}async function H(){q(!0),L(null);try{let t=await fetch("/api/checkout/rates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({website_id:u,items:(0,i.cX)(d),address:$()})}),n=await t.json();if(!t.ok){var e;L(null!=(e=n.error)?e:"rate_failed"),T(null);return}T({shipping_cents:n.shipping_cents,label:n.label})}catch(e){L("rate_failed"),T(null)}finally{q(!1)}}async function Z(){D(!0),L(null);try{var e,t;let n=await fetch("/api/checkout/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({website_id:u,items:(0,i.cX)(d),provider:m,customer_email:y||void 0,customer_name:g||void 0,...R?{shipping_address:$()}:{}})}),a=await n.json();if(!n.ok){L(null!=(e=a.error)?e:"unknown"),D(!1);return}let l=null!=(t=a.checkout_url)?t:a.success_url;if(l){null==b||b(),window.location.href=l;return}L("unknown")}catch(e){L("network")}finally{D(!1)}}return d.length?U&&!U.available?(0,a.jsxs)("div",{className:"rounded-md border border-neutral-200 bg-neutral-50 p-5",children:[(0,a.jsx)("p",{className:"font-medium text-neutral-800",children:"Call to order"}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-neutral-600",children:["Online shipping is temporarily unavailable.",U.contact_phone?" Give us a call and weâll take your order over the phone.":" Please contact us to place your order."]}),U.contact_phone?(0,a.jsxs)("a",{href:"tel:".concat(U.contact_phone),className:"mt-4 inline-block rounded-md bg-brand text-brand-fg px-5 py-2.5 font-medium transition hover:opacity-90",children:["Call ",U.contact_phone.replace(/^\+1/,"").replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")]}):null]}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-neutral-800 mb-1.5",children:"Your name"}),(0,a.jsx)("input",{type:"text",autoComplete:"name",value:g,onChange:e=>v(e.target.value),className:c})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-neutral-800 mb-1.5",children:"Email"}),(0,a.jsx)("input",{type:"email",autoComplete:"email",value:y,onChange:e=>x(e.target.value),className:c})]})]}),R?(0,a.jsxs)("fieldset",{className:"space-y-4 rounded-md border border-neutral-200 p-4",children:[(0,a.jsx)("legend",{className:"text-sm font-medium text-neutral-800 px-1",children:"Shipping address"}),(0,a.jsx)("p",{className:"text-xs text-neutral-500 -mt-2",children:"We ship within the continental United States."}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"sm:col-span-2",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-neutral-800 mb-1.5",children:"Street address"}),(0,a.jsx)("input",{type:"text",autoComplete:"address-line1",value:_,onCh
1ange:e=>G(N)(e.target.value),className:c})]}),(0,a.jsxs)("div",{className:"sm:col-span-2",children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-neutral-800 mb-1.5",children:["Apt, suite, etc. ",(0,a.jsx)("span",{className:"text-neutral-400 font-normal",children:"(optional)"})]}),(0,a.jsx)("input",{type:"text",autoComplete:"address-line2",value:j,onChange:e=>G(w)(e.target.value),className:c})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-neutral-800 mb-1.5",children:"City"}),(0,a.jsx)("input",{type:"text",autoComplete:"address-level2",value:k,onChange:e=>G(C)(e.target.value),className:c})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-neutral-800 mb-1.5",children:"State"}),(0,a.jsxs)("select",{autoComplete:"address-level1",value:S,onChange:e=>G(I)(e.target.value),className:c,children:[(0,a.jsx)("option",{value:"",children:"Selectâ¦"}),r.map(e=>{let[t,n]=e;return(0,a.jsx)("option",{value:t,children:n},t)})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-neutral-800 mb-1.5",children:"ZIP"}),(0,a.jsx)("input",{type:"text",inputMode:"numeric",autoComplete:"postal-code",value:P,onChange:e=>G(M)(e.target.value),className:c})]})]})]}),null===O?(0,a.jsx)("button",{type:"button",disabled:A||!Y,onClick:H,className:"inline-flex items-center justify-center rounded-md border border-brand text-brand px-5 py-2 text-sm font-semibold hover:bg-brand-muted transition disabled:opacity-50 disabled:cursor-not-allowed",children:A?"Calculatingâ¦":"Calculate shipping"}):(0,a.jsxs)("p",{className:"text-sm text-neutral-700",children:[(0,a.jsxs)("span",{className:"font-medium",children:[O.label,":"]})," ",(0,s.u)(O.shipping_cents,p)]})]}):null,(0,a.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-4 pt-2",children:[(0,a.jsxs)("div",{className:"space-y-0.5",children:[null!==O&&O.shipping_cents>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{className:"text-sm text-neutral-500",children:["Subtotal ",(0,s.u)(V,p)," + shipping ",(0,s.u)(O.shipping_cents,p)]}),(0,a.jsx)("p",{className:"text-sm text-neutral-500",children:"Total"})]}):(0,a.jsx)("p",{className:"text-sm text-neutral-500",children:"Total"}),(0,a.jsxs)("p",{className:"font-display text-3xl font-semibold text-neutral-900",children:[F?(0,s.u)(B,p):(0,s.u)(V,p),F?null:(0,a.jsx)("span",{className:"text-base font-normal text-neutral-500",children:" + shipping"})]})]}),(0,a.jsx)("button",{type:"button",disabled:E||h||!F,onClick:Z,className:"inline-flex items-center justify-center rounded-md bg-brand px-7 py-3 font-semibold text-brand-fg hover:opacity-90 transition disabled:opacity-50 disabled:cursor-not-allowed",children:E?"Processingâ¦":X?"Register":null!=f?f:"Continue to checkout"})]}),W?(0,a.jsx)("p",{className:"text-sm text-red-700 bg-red-50 border border-red-200 rounded px-4 py-2",role:"alert",children:null!=(n=o[W])?n:"Something went wrong. Please try again."}):null]}):null}},6395:(e,t,n)=>{n.d(t,{_:()=>s});var a=n(2115),l=n(4966);function s(e){let[t,n]=(0,a.useState)([]),[s,i]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let t=()=>n((0,l.hz)(e));return t(),i(!0),(0,l.B1)(e,t)},[e]);let r=(0,a.useCallback)(t=>n((0,l.B5)(e,t)),[e]),o=(0,a.useCallback)((t,a,s)=>n((0,l.qz)(e,t,a,s)),[e]);return{items:t,ready:s,add:r,setQuantity:o,remove:(0,a.useCallback)((t,a)=>n((0,l.Ai)(e,t,a)),[e]),clear:(0,a.useCallback)(()=>{(0,l.sX)(e),n([])},[e])}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.