import{a as X}from"https://cdn.shopify.com/oxygen-v2/26431/10783/22349/1653411/build/_shared/chunk-ZQ5CXEJV.js";import{a as ue,b as pt,c as S,d as K,e as B,f as $,g as ht,h as Y,i as I,j as Ie,k as Ve,l as G,m as re,n as Rt,o as Ee,p as ne,q as Q,r as je,s as ae}from"https://cdn.shopify.com/oxygen-v2/26431/10783/22349/1653411/build/_shared/chunk-65IJ64Z3.js";import{a as mt,d as W}from"https://cdn.shopify.com/oxygen-v2/26431/10783/22349/1653411/build/_shared/chunk-ISGSLAJR.js";function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var t=1;tu.pathnameBase)),i=f.useRef(!1);return gt(()=>{i.current=!0}),f.useCallback(function(u,d){if(d===void 0&&(d={}),!i.current)return;if(typeof u=="number"){r.go(u);return}let l=Ve(u,JSON.parse(o),n,d.relative==="path");e==null&&t!=="/"&&(l.pathname=l.pathname==="/"?t:G([t,l.pathname])),(d.replace?r.replace:r.push)(l,d.state,d)},[t,r,o,n,e])}function _t(){return f.useContext(wt)}function He(e){let t=f.useContext(k).outlet;return t&&f.createElement(wt.Provider,{value:e},t)}function xt(){let{matches:e}=f.useContext(k),t=e[e.length-1];return t?t.params:{}}function J(e,t){let{relative:r}=t===void 0?{}:t,{matches:a}=f.useContext(k),{pathname:n}=L(),o=JSON.stringify(Ie(a).map(i=>i.pathnameBase));return f.useMemo(()=>Ve(e,JSON.parse(o),n,r==="path"),[e,o,n,r])}function Nt(e,t,r){oe()||S(!1);let{navigator:a}=f.useContext(F),{matches:n}=f.useContext(k),o=n[n.length-1],i=o?o.params:{},s=o?o.pathname:"/",u=o?o.pathnameBase:"/",d=o&&o.route,l=L(),c;if(t){var h;let E=typeof t=="string"?B(t):t;u==="/"||(h=E.pathname)!=null&&h.startsWith(u)||S(!1),c=E}else c=l;let y=c.pathname||"/",R=u==="/"?y:y.slice(u.length)||"/",_=$(e,{pathname:R}),x=Sr(_&&_.map(E=>Object.assign({},E,{params:Object.assign({},i,E.params),pathname:G([u,a.encodeLocation?a.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?u:G([u,a.encodeLocation?a.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),n,r);return t&&x?f.createElement(ce.Provider,{value:{location:ye({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:ue.Pop}},x):x}function _r(){let e=fe(),t=Q(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:n},r):null,null)}function Nr(e){let{routeContext:t,match:r,children:a}=e,n=f.useContext(V);return n&&n.static&&n.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=r.route.id),f.createElement(k.Provider,{value:t},a)}function Sr(e,t,r){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),e==null){var n;if((n=r)!=null&&n.errors)e=r.matches;else return null}let o=e,i=(a=r)==null?void 0:a.errors;if(i!=null){let s=o.findIndex(u=>u.route.id&&i?.[u.route.id]);s>=0||S(!1),o=o.slice(0,Math.min(o.length,s+1))}return o.reduceRight((s,u,d)=>{let l=u.route.id?i?.[u.route.id]:null,c=null;r&&(c=u.route.errorElement||xr);let h=t.concat(o.slice(0,d+1)),y=()=>{let R;return l?R=c:u.route.Component?R=f.createElement(u.route.Component,null):u.route.element?R=u.route.element:R=s,f.createElement(Nr,{match:u,routeContext:{outlet:s,matches:h,isDataRoute:r!=null},children:R})};return r&&(u.route.ErrorBoundary||u.route.errorElement||d===0)?f.createElement(Be,{location:r.location,revalidation:r.revalidation,component:c,error:l,children:y(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):y()},null)}function St(e){let t=f.useContext(V);return t||S(!1),t}function q(e){let t=f.useContext(H);return t||S(!1),t}function br(e){let t=f.useContext(k);return t||S(!1),t}function we(e){let t=br(e),r=t.matches[t.matches.length-1];return r.route.id||S(!1),r.route.id}function ze(){return we(U.UseRouteId)}function ie(){return q(U.UseNavigation).navigation}function bt(){let e=St(Je.UseRevalidator),t=q(U.UseRevalidator);return f.useMemo(()=>({revalidate:e.router.revalidate,state:t.revalidation}),[e.router.revalidate,t.revalidation])}function ee(){let{matches:e,loaderData:t}=q(U.UseMatches);return f.useMemo(()=>e.map(r=>ht(r,t)),[e,t])}function We(){let e=q(U.UseLoaderData),t=we(U.UseLoaderData);if(e.errors&&e.errors[t]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")");return}return e.loaderData[t]}function Xe(e){return q(U.UseRouteLoaderData).loaderData[e]}function Ke(){let e=q(U.UseActionData);return f.useContext(k)||S(!1),Object.values(e?.actionData||{})[0]}function fe(){var e;let t=f.useContext(yt),r=q(U.UseRouteError),a=we(U.UseRouteError);return t||((e=r.errors)==null?void 0:e[a])}function Ye(){let e=f.useContext(ge);return e?._data}function _e(){let e=f.useContext(ge);return e?._error}function Cr(){let{router:e}=St(Je.UseNavigateStable),t=we(U.UseNavigateStable),r=f.useRef(!1);return gt(()=>{r.current=!0}),f.useCallback(function(n,o){o===void 0&&(o={}),r.current&&(typeof n=="number"?e.navigate(n):e.navigate(n,ye({fromRouteId:t},o)))},[e,t])}function Ct(e){return He(e.context)}function Ge(e){let{basename:t="/",children:r=null,location:a,navigationType:n=ue.Pop,navigator:o,static:i=!1}=e;oe()&&S(!1);let s=t.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:s,navigator:o,static:i}),[s,o,i]);typeof a=="string"&&(a=B(a));let{pathname:d="/",search:l="",hash:c="",state:h=null,key:y="default"}=a,R=f.useMemo(()=>{let _=I(d,s);return _==null?null:{location:{pathname:_,search:l,hash:c,state:h,key:y},navigationType:n}},[s,d,l,c,h,y,n]);return R==null?null:f.createElement(F.Provider,{value:u},f.createElement(ce.Provider,{children:r,value:R}))}function Qe(e){let{children:t,errorElement:r,resolve:a}=e;return f.createElement($e,{resolve:a,errorElement:r},f.createElement(Lr,null,t))}function Lr(e){let{children:t}=e,r=Ye(),a=typeof t=="function"?t(r):t;return f.createElement(f.Fragment,null,a)}function Dt(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:f.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}var f,V,H,ge,F,ce,k,yt,wt,xr,Be,Je,U,Dr,jn,A,Or,$e,Ze=mt(()=>{f=W(X());ae();ae();V=f.createContext(null),H=f.createContext(null),ge=f.createContext(null),F=f.createContext(null),ce=f.createContext(null),k=f.createContext({outlet:null,matches:[],isDataRoute:!1}),yt=f.createContext(null);wt=f.createContext(null);xr=f.createElement(_r,null),Be=class extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error?f.createElement(k.Provider,{value:this.props.routeContext},f.createElement(yt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};Je=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Je||{}),U=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(U||{});Dr="startTransition",jn=f[Dr];A=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(A||{}),Or=new Promise(()=>{}),$e=class extends f.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,r){console.error(" caught the following error during render",t,r)}render(){let{children:t,errorElement:r,resolve:a}=this.props,n=null,o=A.pending;if(!(a instanceof Promise))o=A.success,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>a});else if(this.state.error){o=A.error;let i=this.state.error;n=Promise.reject().catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>i})}else a._tracked?(n=a,o=n._error!==void 0?A.error:n._data!==void 0?A.success:A.pending):(o=A.pending,Object.defineProperty(a,"_tracked",{get:()=>!0}),n=a.then(i=>Object.defineProperty(a,"_data",{get:()=>i}),i=>Object.defineProperty(a,"_error",{get:()=>i})));if(o===A.error&&n._error instanceof re)throw Or;if(o===A.error&&!r)throw n._error;if(o===A.error)return f.createElement(ge.Provider,{value:n,children:r});if(o===A.success)return f.createElement(ge.Provider,{value:n,children:t});throw n}}});function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[n]=e[n]);return r}function Ce(e){return e!=null&&typeof e.tagName=="string"}function Ar(e){return Ce(e)&&e.tagName.toLowerCase()==="button"}function Ur(e){return Ce(e)&&e.tagName.toLowerCase()==="form"}function Mr(e){return Ce(e)&&e.tagName.toLowerCase()==="input"}function Tr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ir(e,t){return e.button===0&&(!t||t==="_self")&&!Tr(e)}function tt(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function Vr(e,t){let r=tt(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}function jr(){if(xe===null)try{new FormData(document.createElement("form"),0),xe=!1}catch{xe=!0}return xe}function et(e){return e!=null&&!Br.has(e)?null:e}function kt(e,t){let r,a,n,o,i;if(Ur(e)){let s=e.getAttribute("action");a=s?I(s,t):null,r=e.getAttribute("method")||Se,n=et(e.getAttribute("enctype"))||qe,o=new FormData(e)}else if(Ar(e)||Mr(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a