PageSourceSearch

https://obermeyer.com/cdn/shopifycloud/checkout-web/assets/c1/adeb5fdb.DrALAaZG.js

js obermeyer.com collected 2026-10-02 11:36:12 UTC 51,452 bytes, 1 lines download raw bytes

1import{r as e,a4 as t,l as n,m as o,G as i,j as s,u as r,S as c,x as a,s as l,y as d,B as h,T as u,a8 as g,ad as f}from"./2c1ab0fe.GMbxnz74.js";import{L as p,a as m,b as v,c as b,R as y}from"./27f09e31.DMLD1D1f.js";import{aW as w,cj as k,S,aa as E,bs as R,gJ as M,aS as I,gK as B,aZ as x,gL as O}from"./4c290a1e.C6TDJ9Fn.js";import{e as C,i as P,a7 as z,a8 as T,gi as F,d$ as L,gj as j,gk as A,f7 as W}from"./164ad2e3.BbIvMjRY.js";import{receiptForUI as D}from"./8498e76b.QkOh7Vlw.js";import{b as N,d as $}from"./bb728e1c.iawBHR84.js";import"./66338e00.Df-ivAxs.js";import"./app.CepNJbvh.js";import"./9f047e05.CCJUgz_L.js";import"./0a7dffce.DfUtZWCu.js";import"./5fda1420.KYpufQ--.js";import"./60a453ce.CkhHeRBc.js";import"./21cc90a2.DAzJmttM.js";import"./2255f8fa.BCU-NIF_.js";import"./05a2a9c8.BOU7FMWw.js";function _(n){e(n);let o=n.initial,i=!0,s=!1;const r=new Set,c=Promise.resolve(n.subscribe(a)).then(e=>(s||a(e[1]),e));return{get current(){return o},subscribe:e=>(r.add(e),()=>{r.delete(e)}),async destroy(){i=!1,r.clear();const[e]=await c;e(),t(n)}};function a(e){if(s=!0,i&&o!==e){o=e;for(const e of r)e(o)}}}var q=class{static intersect(e,t){const n=Math.max(e.left,t.left),o=Math.min(e.right,t.right),i=Math.max(e.top,t.top),s=Math.min(e.bottom,t.bottom),r=Math.max(0,o-n),c=Math.max(0,s-i);return new DOMRect(n,i,r,c)}static clip(e,t){const n={...e.toJSON(),top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right};return n.width=n.right-n.left,n.height=n.bottom-n.top,new DOMRect(n.left,n.top,n.width,n.height)}static clipOffsets(e,t){return{top:t.top-e.top,left:t.left-e.left,bottom:e.bottom-t.bottom,right:e.right-t.right}}static equals(e,t){return null==e||null==t?e===t:e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}static sizeEqual(e,t){return Math.round(e.width)===Math.round(t.width)&&Math.round(e.height)===Math.round(t.height)}};function U(e,t){const n=Math.max(e.width,3),o=Math.max(e.height,3),i=e.top-t.top- -1,s=e.left-t.left- -1,r=t.right-e.left-n- -1,c=t.bottom-e.top-o- -1;return`${-Math.round(i)}px ${-Math.round(r)}px ${-Math.round(c)}px ${-Math.round(s)}px`}var V=[...Array.from({length:1e3},(e,t)=>t/1e3),1],G=class{constructor(e,t,n){this.#e=t,this.#t=n,this.#n=n.clientRect,this.#o(e)}#e;#i=void 0;#t;#n;#s=void 0;get visibleRect(){const e=this.#t.clip;return e?q.clip(this.#n,e):this.#n}get isIntersecting(){const{width:e,height:t}=this.visibleRect;return e>0&&t>0}#o(e){const{root:t,rootBounds:n}=this.#t,{visibleRect:o}=this;this.#i?.disconnect(),this.#i=new IntersectionObserver(this.#r,{root:t,rootMargin:U(o,n),threshold:V}),this.#i.observe(e)}#r=e=>{if(!this.#i)return;const t=e[e.length-1];if(t){const{intersectionRatio:e,boundingClientRect:n}=t,o=this.#n;this.#n=n;const i=this.#s,s=!q.equals(n,o);if(e!==this.#s||s){const o=this.#t.rootBounds,r=q.intersect(n,o),c=r.width>0&&r.height>0;if(!c)return;this.#s=e,(null!=i||s)&&(this.#e(new J(t.target,n,t.intersectionRect,c,o),this),this.#o(t.target))}}};disconnect(){this.#i?.disconnect()}},J=class{constructor(e,t,n,o,i){this.target=e,this.boundingClientRect=t,this.intersectionRect=n,this.isIntersecting=o,this.rootBounds=i}},H=class{constructor(e,t){const n=function(e){return!e||function(e){return e.nodeType===Node.DOCUMENT_NODE}(e)?e?.defaultView??window:e}(e);if(function(e){return Y(e)&&e.nodeType===Node.ELEMENT_NODE}(n)){const e=n.ownerDocument??document;this.rootBounds=n.getBoundingClientRect(),this.#c=new ResizeObserver(e=>{for(const n of e){const[{inlineSize:e,blockSize:o}]=n.borderBoxSize;if(q.sizeEqual(this.rootBounds,{width:e,height:o}))continue;const i=n.target.getBoundingClientRect();this.rootBounds=i,t(i,this)}}),this.#c.observe(n),e.addEventListener("scroll",e=>{e.target&&e.target!==n&&Y(e.target)&&e.target.contains(n)&&(this.rootBounds=n.getBoundingClientRect(),t(this.rootBounds,this))},{capture:!0,passive:!0,signal:this.#a.signal})}else{const e=n.visualViewport??n;this.rootBounds=K(n);const o=()=>{const e=K(n);q.equals(this.rootBounds,e)||(this.rootBounds=e,t(e,this))};e.addEventListener("resize",o,{signal:this.#a.signal})}}#c;#a=new AbortController;rootBounds;disconnect(){this.#c?.disconnect(),this.#a.abort()}};
1function K(e){const t=e.visualViewport?.width??e.innerWidth,n=e.visualViewport?.height??e.innerHeight;return new DOMRect(0,0,t,n)}function Y(e){return"nodeType"in e}var Q=class{constructor(e,t){this.#t=t,this.#e=t=>{const n=[];for(const e of t){const t=this.intersections.get(e.target);this.intersections.set(e.target,e),t?.isIntersecting===e.isIntersecting&&q.equals(t?.intersectionRect,e.intersectionRect)||n.push(e)}n.length>0&&e(n,this)}}#e;#l=new Map;#t;intersections=new WeakMap;observe(e){const t=e.ownerDocument;if(!t)return;let n=this.#l.get(t);n||(n=new IntersectionObserver(this.#e,{...this.#t,threshold:V}),this.#l.set(t,n)),n.observe(e)}unobserve(e){const t=e.ownerDocument;if(!t)return;const n=this.#l.get(t);n&&(n.unobserve(e),this.intersections.delete(e))}disconnect(){for(const e of this.#l.values())e.disconnect();this.#l.clear()}},X=class{constructor(e,t){this.#e=e,this.#t=t,this.#d=new H(t?.root,this.#h),this.#u=new Q(this.#g,t),this.#c=new ResizeObserver(this.#f)}#e;#t;#p=new Map;#c;#m=new WeakMap;#d;#u;observe(e){this.#u.observe(e)}unobserve(e){e?(this.#p.get(e)?.disconnect(),this.#u.unobserve(e),this.#m.delete(e)):this.disconnect()}disconnect(){for(const e of this.#p.values())e.disconnect();this.#p.clear(),this.#c.disconnect(),this.#d.disconnect(),this.#u.disconnect()}#v(e){const t=[];for(const n of e){const{target:e}=n;ee(n,this.#m.get(e))||(this.#m.set(e,n),t.push(n))}t.length>0&&this.#e(t)}#h=e=>{const t=[];for(const[n]of this.#p){const o=n.getBoundingClientRect(),i=this.#b(n,o);t.push(new Z(n,o,i.visibleRect,i.isIntersecting,e))}this.#v(t)};#b(e,t){const n=this.#u;this.#p.get(e)?.disconnect();const o=new G(e,this.#y,{clientRect:t,root:this.#t?.root,rootBounds:this.#d.rootBounds,get clip(){const t=n.intersections.get(e);if(!t)return;const{intersectionRect:o,boundingClientRect:i}=t;return q.clipOffsets(i,o)}});return this.#p.set(e,o),o}#g=e=>{const t=[];for(const n of e){const{target:e,isIntersecting:o,boundingClientRect:i}=n;o?(this.#b(e,i),this.#c.observe(e)):(this.#p.get(e)?.disconnect(),this.#p.delete(e),this.#c.unobserve(e));const s=this.#p.get(e);t.push(new Z(e,i,s?.visibleRect??n.intersectionRect,o,this.#d.rootBounds))}this.#v(t)};#y=(e,t)=>{this.#v([new Z(e.target,e.boundingClientRect,t.visibleRect,e.isIntersecting,this.#d.rootBounds)])};#f=e=>{const t=[];for(const n of e){const{target:e,borderBoxSize:o}=n,i=this.#m.get(e);if(i){const[{inlineSize:e,blockSize:t}]=o;if(q.sizeEqual(i.boundingClientRect,{width:e,height:t}))continue}const s=e.getBoundingClientRect(),r=this.#b(e,s);t.push(new Z(e,s,r.visibleRect,this.#u.intersections.get(e)?.isIntersecting??!1,this.#d.rootBounds))}this.#v(t)}},Z=class{constructor(e,t,n,o,i){this.target=e,this.boundingClientRect=t,this.intersectionRect=n,this.isIntersecting=o,this.rootBounds=i}};function ee(e,t){return null!=t&&e.target===t.target&&e.isIntersecting===t.isIntersecting&&q.equals(e.boundingClientRect,t.boundingClientRect)&&q.equals(e.intersectionRect,t.intersectionRect)}const te="data-inspector-id",ne=new Set(["header","orderSummary","footer"]);function oe(e){for(const t of e.composedPath())if(t instanceof HTMLElement){if(t.hasAttribute("data-inspector-managed"))return{element:null,managed:!0};if(t.hasAttribute(te))return{element:t,managed:!1}}return{element:null,managed:!1}}function ie(e){return e.width>0&&e.height>0}function se(e){if(!e)return null;for(const t of document.querySelectorAll(`[${te}="${e}"]`))if(ie(t.getBoundingClientRect()))return t;return null}function re({inspectorTarget:e,selectedBlock:t,selectedExtension:i}){const s=n(null);return o(()=>{let n=null,o=0;function r(t,n){e.rect.value=function(e,t){const n=function(e){return{top:e.top,left:e.left,width:e.width,height:e.height}}(t);if("content"!==e.getAttribute("data-inspector-box"))return n;const o=getComputedStyle(e),i=parseFloat(o.paddingTop)||0,s=parseFloat(o.paddingRight)||0,r=parseFloat(o.paddingBottom)||0,c=parseFloat(o.paddingLeft)||0;return{top:n.top+i,left:n.left+c,width:Math.max(0,n.width-c-s),height:Math.max(0,n.height-i-r)}}(t,n),e.viewport.value={width:innerWidth,height:innerHeight}}function c(){if(!n?.isConnected)return void g();const e=n.getBoundingClientRect();ie(e)?r(n,e):g()}function a(){cancelAnimationFrame(o),o=requestAnimationFrame(c)}const l=new X(e=>{for(const t of e)if(t.target===n){if(!t.target.isConnected||!ie(t.boundingClientRect))return void g();r(t.target,t.boundingClientRect)}}),d=new MutationObserver(()=>{n?.isConnected&&ie(n.getBoundingClientRect())||g()});function h(e){n&&n!==e&&l.unobserve(n),n=e,l.observe(e),r(e,e.getBoundingClientRect())}function u(){n&&l.unobserve(n),n=null,e.rect.value=null}function g({scroll:e=!1,preserveObserved:n=!1}={}){const o=se(i.value)??se(t.value);var s;o?(e&&(s=o,s.scrollIntoView?.({behavior:"smooth",block:"center",inline:"nearest"})),n||h(o)):n||u()}function f(t){const{element:n,managed:o}=oe(t);!o&&n&&n!==s.current&&(s.current=n,e.hovered.value=n.getAttribute(te)??"",h(n))}function p(t){const{element:n}=oe(t);if(!n||n!==s.current)return;const o=t.relatedTarget;o instanceof Node&&n.contains(o)||o instanceof HTMLElement&&o.closest(`[${te}]`)||(s.current=null,e.hovered.value=void 0,g())}d.observe(document.body,{childList:!0,subtree:!0});let m=!1;function v(n){const{element:o,managed:r}=oe(n);if(r)return;if(!o){s.current=null,e.hovered.value=void 0,m=!0;try{t.value=null,i.value=void 0}finally{m=!1}return void g()}const c=o.getAttribute(te)??"";m=!0;try{ne.has(c)?(t.value=c,i.value=void 0):(i.value=c,t.value=void 0)}finally{m=!1}h(o)}let b=!1;const y=e=>{if(!b)return;if(!e)return s.current=null,void g();const t=se(e);s.current=t,t?h(t):u()};let w=!1;const k=()=>{w&&g({scroll:!m,preserveObserved:Boolean(s.current)})},S=e.hovered.subscribe(y),E=t.subscribe(k),R=i.subscribe(k);return g(),b=!0,w=!0,y(e.hovered.value),document.addEventListener("mouseover",f,!0),document.addEventListener("mouseout",p,!0),document.addEventListener("click",v,!0),document.addEventListener("scroll",a,!0),window.addEventListener("resize",a),window.visualVie
1wport?.addEventListener("scroll",a),window.visualViewport?.addEventListener("resize",a),()=>{cancelAnimationFrame(o),document.removeEventListener("mouseover",f,!0),document.removeEventListener("mouseout",p,!0),document.removeEventListener("click",v,!0),document.removeEventListener("scroll",a,!0),window.removeEventListener("resize",a),window.visualViewport?.removeEventListener("scroll",a),window.visualViewport?.removeEventListener("resize",a),S(),E(),R(),l.disconnect(),d.disconnect()}},[e,t,i]),null}const ce={id:"eafff472f499a6d4264654f05244ce0aac77399811198e4de3aa1871c7a2f566",type:"query",name:"SimulatedReceipt",source:""},ae=w(({checkout:e,graphql:{coreGraphql:t}},{journey:n})=>{const o=i(()=>"thankYou"===n.value.currentDetour?.type),r=t.query(ce,{skip:()=>!o.value});return s(()=>{const t=r.data.value?.simulatedReceipt;!r.loading.value&&t&&o.value&&e.unstable_overwriteLatestReceipt(D(t))}),{error:r.error,loading:r.loading}});function le(){const e=C();return k(ae,{journey:e}),null}function de(){return r(c,{children:r(le,{})})}const he="mixed_signals_v1",ue=["shell.shopify.com","*.preview.shell.shopify.com","admin.shopify.com","*.preview.admin.shopify.com",...Array.from({length:10},(e,t)=>`shell-staging-${t+1}.shopify.com`),...Array.from({length:10},(e,t)=>`*.preview.shell-staging-${t+1}.shopify.com`),"shell.shop.dev"];function ge(e){return function(e){if("mixed_signals"===e||e===he)return e}(e.get("editor_bridge"))}const fe="@R";function pe(e){if(""===e)return;const t=Number(e);return Number.isInteger(t)?t:void 0}function me(e,t){return JSON.parse(e?`[${e}]`:"[]",t)}function ve(e=[]){return JSON.stringify(e).slice(1,-1)}function be(e,t){return`E${e}:${JSON.stringify(t)}`}const ye=Symbol("mixed-signals.refreshModel"),we=Symbol("mixed-signals.getModelSignals"),ke=new Set(["then","catch","finally","toJSON","toString","valueOf","inspect","constructor","prototype","__proto__"]);function Se(e){if(void 0!==e["@wireId"])return String(e["@wireId"]);const t=e["@M"];if("string"==typeof t){const e=t.lastIndexOf("#");return-1===e?t:t.slice(e+1)}return""}function Ee(e){return""!==e&&!ke.has(e)}function Re(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0})}function Me(e,t){let n=e.methods.get(t);return n||(n=(...n)=>e.ctx.rpc.call(`${e.wireId}#${t}`,n),Object.defineProperty(n,"name",{value:t,configurable:!0}),e.methods.set(t,n)),n}function Ie(e){const t=new Set;for(const n of e)void 0!==n&&t.add(n);return Array.from(t)}function Be(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}var xe=class{constructor(e){this.value=e}deref(){return this.value}};const Oe="undefined"!=typeof WeakRef;function Ce(e){return Oe?new WeakRef(e):new xe(e)}var Pe=class e{signals=new Map;signalIds=new WeakMap;signalFinalizerTokens=new WeakMap;signalFinalizer;activeSignals=new Set;models=new Map;modelFinalizerTokens=new WeakMap;modelFinalizer;modelSignals=new Map;refreshedRootModelMarkers=new Set;staleModelMarkers=new Set;refreshingModelMarkers=new Set;modelRefreshGeneration=0;collectingRootModels=!1;modelRegistry=new Map;rpc;ctx;static queuedWatchFlushes=new Set;static watchFlushTimer=null;watchedSignals=new Set;watchBatch=new Set;unwatchBatch=new Set;constructor(e,t){this.rpc=e,this.ctx=t&&t.rpc===e?t:{rpc:e},Oe&&"undefined"!=typeof FinalizationRegistry&&(this.signalFinalizer=new FinalizationRegistry(e=>{this.signals.get(e)?.deref()||this.signals.delete(e)}),this.modelFinalizer=new FinalizationRegistry(e=>{this.models.get(e)?.deref()||this.forgetModel(e)}))}reset(){this.clearPendingWatchTraffic(),this.signals.clear(),this.signalIds=new WeakMap,this.activeSignals.clear(),this.models.clear(),this.modelSignals.clear(),this.refreshedRootModelMarkers.clear(),this.staleModelMarkers.clear(),this.refreshingModelMarkers.clear(),this.modelRefreshGeneration++,this.collectingRootModels=!1,this.watchedSignals.clear()}prepareReconnect(){this.clearPendingWatchTraffic(),this.watchedSignals.clear(),this.refreshingModelMarkers.clear(),this.modelRefreshGeneration++}prepareProcessChange(){this.prepareReconnect(),this.signals.clear(),this.signalIds=new WeakMap,this.sweepCollectedEntries(),this.staleModelMarkers=new Set(this.models.keys())}replayActiveSignals(e){return this.clearPendingWatchTraffic(),this.sendActiveSignalWatches(e)}sendActiveSignalWatches(e){const t=e?new Set(e):void 0,n=Array.from(this.activeSignals).filter(e=>{const n=this.signalIds.get(e);return void 0!==n&&!t?.has(n)}),o=Ie(n.map(e=>this.signalIds.get(e)));if(o.length>0){for(const e of n)this.watchedSignals.add(e);this.rpc.notify("@W",o)}return o}registerModel(e,t){t&&this.modelRegistry.set(e,t)}beginRootSnapshot(){this.refreshedRootModelMarkers=new Set,this.collectingRootModels=!0}endRootSnapshot(){this.collectingRootModels=!1}getActiveHeldModelMarkers(){return this.sweepCollectedEntries(),Array.from(this.models.keys()).filter(e=>!this.refreshedRootModelMarkers.has(e)&&!this.refreshingModelMarkers.has(e)&&this.isModelMarkerActive(e))}beginModelRefresh(e){const t=this.modelRefreshGeneration;for(const n of e)this.refreshingModelMarkers.add(n);return t}finishModelRefresh(e,t){if(t!==this.modelRefreshGeneration)return!1;for(const n of e)this.refreshingModelMarkers.delete(n);return!0}clearPendingWatchTraffic(){e.queuedWatchFlushes.delete(this),0===e.queuedWatchFlushes.size&&e.watchFlushTimer&&(clearTimeout(e.watchFlushTimer),e.watchFlushTimer=null),this.watchBatch.clear(),this.unwatchBatch.clear()}getSignalById(e){const t=this.signals.get(e);if(!t)return;const n=t.deref();if(n)return n;this.signals.delete(e)}rememberSignal(e,t){const n=this.signalIds.get(t);
1void 0!==n&&n!==e&&this.getSignalById(n)===t&&this.signals.delete(n),this.signals.set(e,Ce(t)),this.signalIds.set(t,e),this.registerSignalFinalizer(e,t)}registerSignalFinalizer(e,t){if(!this.signalFinalizer)return;const n=this.signalFinalizerTokens.get(t);n&&this.signalFinalizer.unregister(n);const o={};this.signalFinalizerTokens.set(t,o),this.signalFinalizer.register(t,e,o)}getModel(e){const t=this.models.get(e);if(!t)return;const n=t.deref();if(n)return n;this.forgetModel(e)}rememberModel(e,t){this.models.set(e,Ce(t)),this.registerModelFinalizer(e,t)}registerModelFinalizer(e,t){if(!this.modelFinalizer||null===t||"object"!=typeof t&&"function"!=typeof t)return;const n=this.modelFinalizerTokens.get(t);n&&this.modelFinalizer.unregister(n);const o={};this.modelFinalizerTokens.set(t,o),this.modelFinalizer.register(t,e,o)}forgetModel(e){this.models.delete(e),this.modelSignals.delete(e),this.refreshedRootModelMarkers.delete(e),this.staleModelMarkers.delete(e),this.refreshingModelMarkers.delete(e)}liveModelSignals(e){const t=this.modelSignals.get(e);if(!t)return[];const n=[];for(const o of t){const e=o.deref();e?n.push(e):t.delete(o)}return n}sweepCollectedEntries(){for(const e of this.signals.keys())this.getSignalById(e);for(const e of this.models.keys())this.getModel(e);for(const e of this.modelSignals.keys())this.models.has(e)?this.liveModelSignals(e):this.modelSignals.delete(e)}static queueGlobalWatchFlush(){e.watchFlushTimer||(e.watchFlushTimer=setTimeout(()=>{e.watchFlushTimer=null,e.flushQueuedWatches()},10))}static flushQueuedWatches(){const t=Array.from(e.queuedWatchFlushes);e.queuedWatchFlushes.clear();for(const e of t)e.flushWatches()}queueWatchFlush(){e.queuedWatchFlushes.add(this),e.queueGlobalWatchFlush()}scheduleWatch(e){this.unwatchBatch.delete(e),this.watchedSignals.has(e)||(this.watchBatch.add(e),this.queueWatchFlush())}scheduleUnwatch(e){this.watchBatch.delete(e),this.watchedSignals.has(e)&&(this.unwatchBatch.add(e),this.queueWatchFlush())}flushWatches(){const e=Array.from(this.watchBatch).filter(e=>this.activeSignals.has(e)&&!this.watchedSignals.has(e)&&void 0!==this.signalIds.get(e)),t=Array.from(this.unwatchBatch).filter(e=>!this.activeSignals.has(e)&&this.watchedSignals.has(e)&&void 0!==this.signalIds.get(e));this.watchBatch.clear(),this.unwatchBatch.clear();const n=Ie(e.map(e=>this.signalIds.get(e)));if(n.length>0){for(const t of e)this.watchedSignals.add(t);this.rpc.notify("@W",n)}const o=Ie(t.map(e=>this.signalIds.get(e)));if(o.length>0){for(const e of t)this.watchedSignals.delete(e);this.rpc.notify("@U",o)}}getOrCreateSignal(e,t){const n=this.getSignalById(e);if(n)return n;let o;return o=d(t,{watched:()=>{this.activeSignals.add(o),this.refreshStaleModelsForSignal(o),this.scheduleWatch(o)},unwatched:()=>{this.activeSignals.delete(o),this.scheduleUnwatch(o)}}),this.rememberSignal(e,o),o}syncSignalSnapshot(e,t){const n=this.getOrCreateSignal(e,t);return n.value=t,n}reconcileRoot(e,t){if(Be(e)&&Be(t)){for(const n of Object.keys(e))n in t||delete e[n];for(const[n,o]of Object.entries(t))e[n]=this.reconcileIdentifiedValue(e[n],o);return e}return this.reconcileIdentifiedValue(e,t)}syncSignalIdentity(e,t){return this.rebindSignal(e,t,!0)}reconcileIdentifiedValue(e,t){return e===t?e:e instanceof h&&t instanceof h?this.rebindSignal(e,t):t}isModelMarkerActive(e){for(const t of this.liveModelSignals(e))if(this.activeSignals.has(t))return!0;return!1}collectModelSignals(e){const t=new Set;for(const n of Object.values(e))n instanceof h&&t.add(n);return t}rememberModelSignals(e,t,n,o=!0){const i=t[we]?.();i?this.modelSignals.set(e,this.createSignalRefs(i)):o&&this.modelSignals.set(e,this.createSignalRefs(this.collectModelSignals(n)))}createSignalRefs(e){return new Set(Array.from(e,e=>Ce(e)))}modelHasLiveSignal(e,t){const n=this.modelSignals.get(e);if(!n)return!1;let o=!1;for(const i of n){const e=i.deref();e?e===t&&(o=!0):n.delete(i)}return o}refreshStaleModelsForSignal(e){const t=[];for(const o of this.staleModelMarkers)!this.refreshingModelMarkers.has(o)&&this.getModel(o)&&this.modelHasLiveSignal(o,e)&&t.push(o);if(0===t.length)return;const n=this.beginModelRefresh(t);this.rpc.call("@M",t).catch(()=>{}).finally(()=>
1{this.finishModelRefresh(t,n)&&this.sendActiveSignalWatches()})}markModelFresh(e){this.staleModelMarkers.delete(e)}rebindSignal(e,t,n=!1){const o=this.signalIds.get(t);if(void 0!==o){const i=this.getSignalById(o);if(n&&i&&i!==e)return this.transferSignalState(e,i),this.transferSignalState(t,i),e.value=i.peek(),i;this.rememberSignal(o,e)}return this.transferSignalState(t,e),e.value=t.peek(),e}transferSignalState(e,t){e!==t&&(this.activeSignals.has(e)&&(this.activeSignals.delete(e),this.activeSignals.add(t)),this.watchedSignals.has(e)&&(this.watchedSignals.delete(e),this.watchedSignals.add(t)),this.watchBatch.delete(e)&&this.watchBatch.add(t),this.unwatchBatch.delete(e)&&this.unwatchBatch.add(t))}createModelFacade(e){const t=e["@M"];if(!t)throw new Error("Model missing @M field");const n=t.lastIndexOf("#"),o=-1!==n?t.slice(0,n):t,s=-1!==n?t.slice(n+1):void 0,r={...e,"@wireId":s},c=Object.keys(e).some(e=>"@M"!==e);this.collectingRootModels&&c&&this.refreshedRootModelMarkers.add(t);const a=this.getModel(t);if(a)return a[ye]?.(r),this.rememberModelSignals(t,a,r,c),c&&this.markModelFresh(t),a;const l=this.modelRegistry.get(o),u=l?new l(this.ctx,r):function(e,t,n={}){const o=Se(t),s={},r={ctx:e,wireId:o,fallbackId:d(o),signalSources:new Map,methods:new Map};Re(s,"id",r.fallbackId);const c=(t,n)=>{const o=r.signalSources.get(t);if(o)o.value=e.rpc.syncSignalIdentity(o.peek(),n);else{const e=d(n);r.signalSources.set(t,e),Re(s,t,i(()=>e.value.value))}},a=e=>{const t=Se(e);r.wireId!==t&&(r.wireId=t,r.signalSources.has("id")||(r.fallbackId.value=t));const o=n.signalProps?n.signalProps.map(t=>[t,e[t]]):Object.entries(e);for(const[n,i]of o)i instanceof h?c(n,i):i?.[ye]&&Re(s,n,i)};a(t);for(const i of n.methods??[])Ee(i)&&!Object.hasOwn(s,i)&&Re(s,i,Me(r,i));return new Proxy(s,{get:(e,t,o)=>
1t===ye?a:t===we?()=>Array.from(r.signalSources.values(),e=>e.peek()):t===Symbol.toStringTag?n.typeName??"ReflectedModel":"symbol"==typeof t||Reflect.has(e,t)?Reflect.get(e,t,o):Ee(t)?Me(r,t):void 0})}(this.ctx,r,{typeName:o});return this.rememberModel(t,u),this.rememberModelSignals(t,u,r,c),c&&this.markModelFresh(t),u}handleUpdate(e,t,n){const o=this.getSignalById(e);if(!o)return;if(!n)return void(o.value=t);const i=o.value;switch(n){case"append":Array.isArray(i)?o.value=[...i,...t]:"string"==typeof i&&(o.value=i+t);break;case"merge":i&&"object"==typeof i&&(o.value={...i,...t});break;case"splice":if(Array.isArray(i)){const{start:e,deleteCount:n,items:s}=t,r=[...i];r.splice(e,n,...s),o.value=r}break;default:o.value=t}}};function ze(e){return!!e&&"object"==typeof e&&"string"==typeof e.connectionId&&"string"==typeof e.processId&&"boolean"==typeof e.resumed}var Te=class{transport;transportGeneration=0;nextId=1;pending=new Map;notificationListeners=new Set;localRoot;reflection;transportReady;disconnectPromise;_rejectDisconnect;closed=!1;disconnectError;reconnectable=!1;readyResolved=!1;replaySubscriptionsOnRoot=!1;root=void 0;connectionId;connectionInfo;ready;_resolveReady;_rejectReady;constructor(e,t){this.transport=e,this.transportReady=e.ready,this.reconnectable=!!e.onOpen,this.resetDisconnectPromise(),this.ready=this.createReadyPromise(),this.reflection=new Pe(this,t),this.wireTransport(e,this.transportGeneration)}reconnect(e){const t=new Error("Transport reconnected");for(const{reject:n}of this.pending.values())n(t);this.pending.clear(),this._rejectDisconnect(t),this.transportGeneration++,this.transport=e,this.transportReady=e.ready,this.reconnectable=!!e.onOpen,this.closed=!1,this.disconnectError=void 0,this.resetDisconnectPromise(),this.reflection.prepareReconnect(),this.replaySubscriptionsOnRoot=void 0!==this.root,this.ready=this.createReadyPromise(),this.wireTransport(e,this.transportGeneration)}createReadyPromise(){return this.readyResolved=!1,new Promise((e,t)=>{this._resolveReady=e,this._rejectReady=t})}resetDisconnectPromise(){this.disconnectPromise=new Promise((e,t)=>{this._rejectDisconnect=t}),this.disconnectPromise.catch(()=>{})}wireTransport(e,t){e.ready?.then(()=>this.handleOpen(t),e=>this.handleDisconnect(t,e)),e.onOpen?.(()=>this.handleOpen(t)),e.onClose?.(e=>this.handleDisconnect(t,e)),e.onMessage(n=>{if(t!==this.transportGeneration||e!==this.transport)return;const o=function(e){if(e.length<2)return null;const t=e[0];if("R"===t||"E"===t){const n=e.indexOf(":");if(-1===n)return null;const o=pe(e.slice(1,n));return void 0===o?null:{type:"R"===t?"result":"error",id:o,payload:e.slice(n+1)}}if("M"!==t&&"N"!==t)return null;const n=e.indexOf(":",1);if(-1===n)return null;const o=e.indexOf(":",n+1);if(-1===o)return null;const i=e.slice(1,n),s=e.slice(n+1,o),r=e.slice(o+1);if(!s)return null;if("M"===t){const e=pe(i);return void 0===e?null:{type:"call",id:e,method:s,payload:r}}return""!==i?null:{type:"notification",method:s,payload:r}}(n.toString());if(!o)return;const i=(e,t)=>{if("object"==typeof t&&t){if("@S"in t)return Object.hasOwn(t,"v")?this.reflection.syncSignalSnapshot(t["@S"],t.v):this.reflection.getOrCreateSignal(t["@S"],void 0);if("@M"in t)return this.reflection.createModelFacade(t)}return t};if("result"===o.type||"error"===o.type){const e=function(e,t){return JSON.parse(e,t)}(o.payload,i),t=this.pending.get(o.id);if(!t)return;if(this.pending.delete(o.id),"result"===o.type)return void t.resolve(e);const{message:n,...s}=e??{};return void t.reject(Object.assign(new Error(n),s))}if("call"===o.type)return void this.handleCall(t,e,o.id,o.method,o.payload,i);if(o.method===fe){const e=me(o.payload);this.prepareForRootSnapshot(e)}let s;if(o.method===fe){this.reflection.beginRootSnapshot();try{s=me(o.payload,i)}finally{this.reflection.endRootSnapshot()}}else s=me(o.payload,i);this.handleNotification(t,o.method,s)})}prepareForRootSnapshot(e){const[,t]=e,n=ze(t)?t:void 0;void 0===this.root||n&&this.connectionInfo&&n.processId===this.connectionInfo.processId||this.reflection.prepareProcessChange()}registerModel(e,t){this.reflection.registerModel(e,t)}syncSignalIdentity(e,t){return this.reflection.syncSignalIdentity(e,t)}expose(e){this.localRoot=e}sendOnTransport(e,t,n){e!==this.transportGeneration||t!==this.transport||this.closed||t.send(n)}handleCall(e,t,n,o,i,s){const r=o.split("."),c=r.pop(),a=r.length>0?(l=this.localRoot,r.join(".").split(".").reduce((e,t)=>
1e?.[t],l)):this.localRoot;var l;const d=a?.[c];if("function"!=typeof d)return void this.sendOnTransport(e,t,be(n,{code:-1,message:`Method not found: ${o}`}));let h;try{h=me(i,s)}catch(u){return void this.sendOnTransport(e,t,be(n,{code:-1,message:u?.message??String(u)}))}Promise.resolve().then(()=>d.apply(a,h)).then(o=>this.sendOnTransport(e,t,function(e,t){return`R${e}:${JSON.stringify(t)}`}(n,o)),o=>this.sendOnTransport(e,t,be(n,{code:-1,message:o?.message??String(o)})))}async call(e,t){if(this.closed)throw this.getDisconnectError();const n=this.transportGeneration,o=this.transport,i=this.transportReady;if(i&&await Promise.race([i,this.disconnectPromise]),n!==this.transportGeneration||o!==this.transport)throw new Error("Transport reconnected");if(this.closed)throw this.getDisconnectError();return new Promise((i,s)=>{this.sendCall(n,o,e,t,i,s)})}notify(e,t){const n=function(e,t=[]){return`N:${e}:${ve(t)}`}(e,t),o=this.transportGeneration,i=this.transport,s=this.transportReady,r=()=>this.sendOnTransport(o,i,n);s?s.then(r,()=>{}):r()}sendCall(e,t,n,o,i,s){if(this.closed||e!==this.transportGeneration||t!==this.transport)return void s(this.closed?this.getDisconnectError():new Error("Transport reconnected"));const r=this.nextId++;this.pending.set(r,{resolve:i,reject:s}),t.send(function(e,t,n=[]){return`M${e}:${t}:${ve(n)}`}(r,n,o||[]))}handleOpen(e){if(e!==this.transportGeneration)return;const t=this.closed;this.closed=!1,this.disconnectError=void 0,this.transportReady=void 0,t&&this.resetDisconnectPromise()}handleDisconnect(e,t){if(e===this.transportGeneration&&!this.closed){this.closed=!0,this.disconnectError=t instanceof Error?t:new Error("Transport disconnected"),this.readyResolved&&(this.replaySubscriptionsOnRoot=!0),this._rejectDisconnect(this.disconnectError),this.readyResolved||this.reconnectable||this._rejectReady(this.disconnectError);for(const{reject:e}of this.pending.values())e(this.disconnectError);this.pending.clear()}}getDisconnectError(){return this.disconnectError??new Error("Transport disconnected")}onNotification(e){return this.notificationListeners.add(e),()=>{this.notificationListeners.delete(e)}}async refreshHeldModelsAndReplay(e){const t=this.reflection.getActiveHeldModelMarkers();if(0===t.length)return void this.reflection.replayActiveSignals();const n=this.reflection.beginModelRefresh(t),o=this.call("@M",t),i=this.reflection.replayActiveSignals();try{await o}catch{}finally{this.reflection.finishModelRefresh(t,n),e===this.transportGeneration&&this.reflection.replayActiveSignals(i)}}handleNotification(e,t,n){if(t===fe){const[t,o]=n,i=void 0!==this.root;ze(o)?(this.connectionInfo=o,this.connectionId=o.connectionId):(this.connectionInfo=void 0,this.connectionId=void 0),this.root=i?this.reflection.reconcileRoot(this.root,t):t,this.readyResolved||(this.readyResolved=!0,this._resolveReady()),this.replaySubscriptionsOnRoot&&(this.replaySubscriptionsOnRoot=!1,this.refreshHeldModelsAndReplay(e))}else if("@S"===t){const[e,t,o]=n;this.reflection.handleUpdate(e,t,o)}else for(const o of this.notificationListeners)o(t,n)}};let Fe=class extends Error{constructor(){super(...arguments),this.name="CheckoutEditorBridgeTimeoutError"}};function Le(e){let t=e=>{};const n=new Promise((n,o)=>{function i(){window.clearTimeout(s),window.removeEventListener("message",r)}t=e=>{i(),o(e)};const s=window.setTimeout(()=>{i(),o(new Fe("Checkout editor bridge timed out after 10000ms"))},1e4);function r(t){const[o]=t.ports;o&&(t.source===window.parent&&function(e){try{const t=new URL(e);return"https:"===t.protocol&&t.origin===e&&""===t.port&&ue.some(e=>function(e,t){if(!t.startsWith("*."))return e===t;const n=t.slice(1);return e.length>n.length&&e.endsWith(n)}(t.hostname,e))}catch{return!1}}(t.origin)&&function(e,t){return"object"==typeof e&&null!==e&&"type"in e&&"shopify:checkout-editor:mixed-signals:port"===e.type&&(function(e){return e===he}(t)?"protocol"in e&&e.protocol===he:!("protocol"in e)||e.protocol===he)}(t.data,e)?(i(),n({parentOrigin:t.origin,port:o})):o.close())}window.addEventListener("message",r),window.parent.postMessage({type:"shopify:checkout-editor:mixed-signals:ready",protocol:he},"*")});return{cancel:t,connection:n}}const je=1e4;
1class Ae extends Error{constructor(){super(...arguments),this.name="CheckoutEditorBridgeTimeoutError"}}class We extends Error{constructor(){super(...arguments),this.name="MixedSignalsCheckoutEditorBridgeNotEnabledError"}}class De extends Error{constructor(){super(...arguments),this.name="MixedSignalsCheckoutEditorBridgeClosedError"}}class Ne extends Error{constructor(){super(...arguments),this.name="UnknownMixedSignalsCheckoutEditorBridgeError"}}function $e(e){return{initial:e.peek(),subscribe(t){let n=!1;return[e.subscribe(e=>{n?t(e):n=!0}),e.peek()]}}}function _e(){}function qe(e,t,n){return new Promise((o,i)=>{const s=window.setTimeout(()=>{i(new Ae(n))},t);e.then(e=>{window.clearTimeout(s),o(e)}).catch(e=>{window.clearTimeout(s),i(e)})})}function Ue(){let e,t,n,o,i,s,r;const c=ge(new URLSearchParams(window.location.search));function a(){s&&r?.(s),r=void 0,n?.close(),n=void 0,t=void 0}function l(e){return s??=e instanceof Error?e:new Ne("Unknown Mixed Signals checkout editor bridge error"),a(),s}function d(){if(!c)return Promise.reject(new We("Mixed Signals checkout editor bridge is not enabled"));if(s)return Promise.reject(s);if(o)return o;const a=Le(c);return r=a.cancel,o=a.connection.then(async o=>{r=void 0;const{port:c}=o;if(s)throw c.close(),s;i=o.parentOrigin,n=c;const a=(l=function(e){return{send(t){e.postMessage(t)},onMessage(t){e.addEventListener("message",e=>t(e.data)),e.start()},ready:Promise.resolve()}}(c),new Te(l,{}));var l;return t=a,e&&a.expose(e),await qe(a.ready,je,"Checkout editor bridge did not become ready after 10000ms"),a}).catch(e=>{throw l(e)}),o}async function h(e,t=[]){try{const n=await d();return await qe(n.call(e,t),je,`Checkout editor bridge ${e} timed out after 10000ms`)}catch(n){throw l(n)}}return{call:{initialize:async e=>async function(){const e=await d();try{return{checkoutProfile:{addressAutocompleteEnabled:$e((t=await qe(e.call("initialize",[]),je,"Checkout editor bridge initialize timed out after 10000ms")).checkoutProfile.addressAutocompleteEnabled),hasOverrides:$e(t.checkoutProfile.hasOverrides)},activeInspector:(n=t.activeInspector,{enabled:$e(n.enabled),hover:{hoveredExtension:$e(n.hover.hoveredExtension),setHoveredExtension:_e},select:{selectedBlock:$e(n.select.selectedBlock),setSelectedBlock:_e,selectedExtension:$e(n.select.selectedExtension),setSelectedExtension:_e},actions:{canMoveDown:$e(n.actions.canMoveDown),canMoveUp:$e(n.actions.canMoveUp),lastDirection:$e(n.actions.lastDirection),moveExtension:_e,removeExtension:_e}})}}catch(o){throw l(o)}var t,n}(),navigate:e=>h("navigate",[e]),setLoading:e=>h("setLoading",[e]),updateSections:e=>h("updateSections",[e]),userInteractionEvent:e=>h("userInteractionEvent",[e]),setShopPay:e=>h("setShopPay",[e]),redirectTo:e=>h("redirectTo",[e])},expose(n){e=n,t?.expose(n)},close(){s??=new De("Checkout editor bridge endpoint is closed"),a()},notifyError(){i&&function(e){window.parent.postMessage({type:"shopify:checkout-editor:mixed-signals:error",protocol:he},e)}(i)},notifyInitialized(){i&&function(e){window.parent.postMessage({type:"shopify:checkout-editor:mixed-signals:initialized",protocol:he},e)}(i)}}}const Ve={"customizations.header.banner.image":"header.banner.image","customizations.header.logo.image":"header.logo.image","customizations.main.backgroundImage.image":"main.backgroundImage","customizations.orderSummary.backgroundImage.image":"orderSummary.backgroundImage","components.header.logo.image":"header.logo.image","surfaces.checkout.components.header.backgroundImage.image":"header.banner.image","surfaces.checkout.components.main.backgroundImage.image":"main.backgroundImage","surfaces.checkout.components.orderSummary.backgroundImage.image":"orderSummary.backgroundImage"},Ge={"customizations.header.logo.maxWidth":{section:"logo",key:"maxWidth"},"components.header.logo.maxWidth":{section:"logo",key:"maxWidth"}},Je={"customizations.header.position":{key:"position",section:"header"},"customizations.header.alignment":{key:"alignment",section:"header"},"surfaces.checkout.components.header.position":{key:"position",section:"header"},"surfaces.checkout.components.header.alignment":{key:"alignment",section:"header"}},He={"customizations.footer.position":{key:"position",section:"footer"},"customizations.footer.alignment":{key:"alignment",section:"footer"},"surfaces.checkout.components.footer.position":{key:"position",section:"footer"},"surfaces.checkout.components.footer.alignment":{key:"alignment",section:"footer"}},Ke={COLOR1:"base",COLOR2:"base",TRANSPARENT:"transparent"},Ye={"designSystem.typography.primary.name":"typographyPrimary","de
1signSystem.typography.secondary.name":"typographySecondary","designTokens.typography.primary.name":"typographyPrimary","designTokens.typography.secondary.name":"typographySecondary"},Qe=["designSystem.colors.global.accent","designSystem.colors.global.brand","designSystem.colors.global.critical","designSystem.colors.global.control","designSystem.colors.schemes.scheme1.base.background","designSystem.colors.schemes.scheme2.base.background","designTokens.colors.global.accent","designTokens.colors.global.brand","designTokens.colors.global.critical","designTokens.colors.global.control",...["scheme1","scheme2","scheme3","scheme4","scheme5","scheme6","scheme7","scheme8"].flatMap(e=>[`designTokens.colors.schemes.${e}.base.background`,`designTokens.colors.schemes.${e}.base.accent`,`designTokens.colors.schemes.${e}.base.text`,`designTokens.colors.schemes.${e}.primaryButton.background`,`designTokens.colors.schemes.${e}.secondaryButton.text`,`designTokens.colors.schemes.${e}.control.accent`])],Xe=["designSystem.typography.secondary.name","designSystem.typography.primary.name","designTokens.typography.secondary.name","designTokens.typography.primary.name"],Ze=["customizations.header.banner.image","customizations.header.logo.image","customizations.main.backgroundImage.image","customizations.orderSummary.backgroundImage.image","components.header.logo.image","surfaces.checkout.components.header.backgroundImage.image","surfaces.checkout.components.main.backgroundImage.image","surfaces.checkout.components.orderSummary.backgroundImage.image"],et=["customizations.header.logo.maxWidth","components.header.logo.maxWidth"],tt=["customizations.header.position","customizations.header.alignment","surfaces.checkout.components.header.position","surfaces.checkout.components.header.alignment"],nt=["customizations.footer.position","customizations.footer.alignment","surfaces.checkout.components.footer.position","surfaces.checkout.components.footer.alignment"],ot=["customizations.orderSummary.defaultState","surfaces.checkout.components.orderSummary.defaultState"],it=["customizations.control.color","components.control.color"],st=["customizations.header.logo.visibility","customizations.cartLink.visibility","customizations.buyerJourney.visibility","customizations.footer.content.visibility","surfaces.checkout.components.header.logo.visibility","surfaces.checkout.components.cartLink.visibility","surfaces.checkout.components.buyerJourney.visibility","surfaces.checkout.components.footer.content.visibility"],rt=["surfaces.checkout.components.header.colorScheme","surfaces.checkout.components.footer.colorScheme","surfaces.checkout.components.main.colorScheme","surfaces.checkout.components.orderSummary.colorScheme"],ct=["HIDDEN","VISIBLE"],at=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,lt=({id:e,value:t})=>{const n=z(),i=(()=>{const e=T();return l((t,n)=>{const{url:o}=t??{},[i]=Ve[n].split("."),s=N(e.configuration,Ve[n],o);"customizations.main.backgroundImage.image"===n?e.set("main",{...e.configuration.main,backgroundImage:s.main?.backgroundImage}):e.set(i,s[i])},[e])})(),s=(()=>{const e=T();return l((t,n,o)=>{((e,t,n,o)=>{if(t){const i=(e=>"INLINE_SECONDARY"===e?"inlineSecondary":e.toLowerCase())(t);"alignment"===n?(e.set(o,{...e.configuration[o],alignment:i}),"header"===o&&e.set("buyerJourney",{...e.configuration.buyerJourney,alignment:"inline"===e.configuration.header.position?i:"start"})):"position"===n&&(e.set(o,{...e.configuration[o],position:i}),"header"===o&&e.set("buyerJourney",{...e.configuration.buyerJourney,alignment:"inline"===i?e.configuration.header.alignment:"start"}))}else e.set(o,{...e.configuration[o],[n]:void 0})})(e,t,n,o)},[e])})(),r=(()=>{const e=z();return l((t,n)=>{const[o,i,...s]=n.split("."),r=((e,t)=>e.reverse().reduce((e,t)=>({[t]:e}),t))(s,(e=>e?R(e):void 0)(t));e.preview($({...e?.configuration?.colors},r))},[e])})(),c=(()=>{const e=T();return l((t,n)=>{const o={...e.configuration.header},i=o[n]?.image;o[n]=t&&i?{...o[n],image:i,maxWidth:t}:i?{...o[n],image:i,maxWidth:void 0}:{...o[n],image:"",maxWidth:void 0},e.set("header",o)},[e])})(),a=function(){const e=z();return l((t,n)=>{e.set(t,{...e.configuration[t],...n})},[e])}(),d=function(){const e=T();return l((t,n)=>{const o=t.toLowerCase(),i=n.startsWith("surfaces")?n.split(".")[3]:n.split(".")[1];let s={};switch(i){case"cartLink":case"buyerJourney":s={visibility:o};break;case"header":s={logo:{...e.configuration.header.logo,visibility:o}};break;case"footer":s={content:{...e.configuration.footer.content,visibility:o}}}e.set(i,{...e.configuration[i],...s})},[e])}(),h=function(){const{shop:e}=S(),t=T(),n=e.hasFlagEnabled(M);return l(e=>
1{const o=Boolean(t.configuration.environment?.isOnePageCheckout);t.set("reductions",{...t.configuration.reductions,position:o&&n&&"EXPANDED"===e?"base":"inside_order_summary"}),t.set("orderSummary",{...t.configuration.orderSummary,defaultState:o?void 0:e})},[t,n])}(),u=(()=>{const e=T();return l((t,n)=>{switch(n){case"surfaces.checkout.components.footer.colorScheme":e.set("footer",{...e.configuration.footer,colorScheme:t});break;case"surfaces.checkout.components.header.colorScheme":e.set("header",{...e.configuration.header,colorScheme:t});break;case"surfaces.checkout.components.main.colorScheme":e.set("main",{...e.configuration.main,colorScheme:t});break;case"surfaces.checkout.components.orderSummary.colorScheme":e.set("orderSummary",{...e.configuration.orderSummary,colorScheme:t})}},[e])})(),g=T();o(()=>{if(function(e){return Qe.includes(e)}(e))r(t,e);else if(function(e){return Ze.includes(e)}(e))i(t,e);else if(function(e){return et.includes(e)}(e)){const{section:n}=Ge[e];c(t,n)}else if(function(e){return tt.includes(e)}(e)){const{key:n,section:o}=Je[e];s(t,n,o)}else if(function(e){return nt.includes(e)}(e)&&t){const{key:n,section:o}=He[e];s(t,n,o)}else if(function(e){return it.includes(e)}(e)){const e=(e=>{const t="string"==typeof e?e.toUpperCase():String(e);return(e=>e in Ke)(t)?Ke[t]:"base"})(t);"transparent"===e?r("#00000000","designTokens.colors.global.control"):(e=>{if("string"!=typeof e||""===e)return!1;const t=e.toUpperCase();return"DEFAULT"!==t&&!(t in Ke)&&at.test(e)})(t)?r(t,"designTokens.colors.global.control"):"base"===e&&r("#FFFFFF","designTokens.colors.global.control")}else if(function(e){return Xe.includes(e)}(e)){const n=Ye[e],o=t,i=o?.bolderVariant?o.bolderVariant:o?.defaultVariant;a(n,{fonts:o?.name??void 0,sourceBase:o?.defaultVariant?.sources||void 0,weightBase:o?.defaultVariant?.variation?.weight?.toString()??void 0,sourceBold:i?.sources||void 0,weightBold:i?.variation?.weight?.toString()??void 0})}else(function(e){return st.includes(e)})(e)&&function(e){return ct.includes(e)}(t)?d(t,e):function(e){return ot.includes(e)}(e)?h(t):function(e){return rt.includes(e)}(e)&&u(t,e)},[e,t,r,i,c,s,a,n,g,d,h,u])};function dt(){return I(j)}const ht={BrandingSettings:function({children:e,hydrated:t,onBrandingLoaded:n}){return u(()=>{t&&n()},[t,n]),r(c,{children:e})},BrandingSetting:function(e){return lt(e),null},Extension:function({index:e,children:t,...n}){const i=I(F),s=S().checkout.extensibility.ui,c=L(),a=s.search().value.find(e=>"persisted"===e.type&&e.publicIdentifier===n.activatedExtensionId&&e.extensionPoint.target===i.extensionPoint&&e.placementReference===i.placementReference);return o(()=>{if(a)return;const t=B({extension:n,extensionPoint:i.extensionPoint}),o=c.findAll({id:n.targetPublicIdentifier,target:i.extensionPoint})[0];return o?s.add({...o.extension,placementReference:i.placementReference}):s.add({id:n.targetPublicIdentifier,publicIdentifier:n.publicIdentifier,targetPublicIdentifier:n.targetPublicIdentifier,extensionId:n.id,registrationId:n.id,extensionPoint:{target:i.extensionPoint,metafields:[],preloads:t},placementReference:i.placementReference,scriptUrl:n.scriptUrl,appId:n.app.id,appApiKey:null,apiVersion:n.apiVersion,version:n.version,translations:JSON.parse(n.translations),approvalScopes:new Set(n.approvalScopes.map(({handle:e})=>e)),capabilities:n.capabilities,extensionLocale:n.extensionLocale,name:n.name,type:"persisted",behaviors:d({alwaysReveal:!1,blockProgress:!1,showInExpressCheckout:!0}),configuration:d({}),position:d(e)}),()=>{s.remove([n.targetPublicIdentifier],{keepAlive:!0,reason:"checkout_editor"})}},[i.extensionPoint,i.placementReference]),o(()=>{a&&a.position.value!==e&&(a.position.value=e)},[e,s,n.activatedExtensionId,a]),r(j.Provider,{value:n,children:a&&t})},ExtensionPoint:function({children:e,extensionPoint:t,placementReference:n}){const o=u(()=>({extensionPoint:t,placementReference:n}),[t,n]);return r(F.Provider,{value:o,children:e})},ExtensionBehaviors:function({...e}){const t=S().checkout.extensibility.ui,{activatedExtensionId:n}=dt();return o(()=>{const o=t.search().peek().find(e=>"persisted"===e.type&&e.publicIdentifier===n);if(!o)return;const i=o.behaviors.value;(i.alwaysReveal!==e.alwaysReveal||i.blockProgress!==e.blockProgress||o.behaviors.value.showInExpressCheckout!==e.showInExpressCheckout)&&(o.behaviors.value=e)},[e,n,t]),null},ExtensionConfiguration:function({...e}){const t=S().checkout.extensibility.ui,{activatedExtensionId:n}=dt();return o(()=>{const o=t.search().peek().find(e=>"persisted"===e.type&&e.publicIdentifier===n);o&&(o.configuration.value=e)},[n,e,t]),null}},ut=new Set(["RemoteFunctionRevokedError","RemoteFunctionReleasedError"]);function gt(e,t,n){const o=_(e),i=d(o.current);return o.subscribe(e=>{i.value=e}),t&&i.subscribe(e=>{if(i.peek()!==o.current){n?.(e);try{t(e)}catch(s){if(!function(e){return e instanceof Error&&ut.has(e.name)}(s))throw s}}}),i}const ft="undefined"!=typeof window&&null!=ge(new URLSearchParams(window.location.search));
1class pt extends Error{constructor(){super(...arguments),this.name="UnknownCheckoutEditorBridgeError"}}function mt(e,t,n){const o=t instanceof Error?t:new pt("Unknown checkout editor bridge error");n.leaveErrorBreadcrumb(`CheckoutEditorBridge: ${e} call failed`,{error:o.message}),n.error(o,{severity:"warning",metadata:{checkoutEditorBridge:{method:e}}}),"You attempted to call a function on a terminated web worker."===o.message&&n.counter({name:"editor_bridge_called_terminated_worker",value:1,attributes:{terminatedFunctionName:e}})}function vt(e,t,n){return Promise.resolve(t).catch(t=>{mt(e,t,n)})}function bt(){return g(f(),{callable:["initialize","navigate","setLoading","updateSections","userInteractionEvent","setShopPay","redirectTo"]})}const yt="undefined"==typeof window||ft?void 0:bt();function wt({setContext:t}){const{currentPage:n,currentDetour:i}=C().value,{navigate:s}=function(){const e=E(),[t,n]=a({}),{checkout:i,router:s}=S(),{currentDetour:r,plan:{greenPath:c,detours:d}}=C().value,{detour:h}=P(),u=l(()=>{const t=e.current.value;n(t)},[e]),g=l(()=>{e.current.value=t,i.unstable_overwriteLatestReceipt(void 0)},[i,t,e]);return o(()=>{u()},[u]),{navigate:l(e=>{const t=Boolean(r?.type),n=r?.type!==e,o=d.find(({type:t})=>t===e)?.type;if(t&&n?g():o&&u(),o)return void h(o);const i=c?.find(({id:t})=>t===e)?.route??"/information";s.navigate(i)},[r?.type,h,d,c,s,u,g])}}(),d=function(){const{checkout:e,client:t}=S(),n=t.unstable_legacyNavigationPerformance?.initialLoading.value??!1,i=e.latestReceipt.value,{currentDetour:s}=C().value,[r,c]=a(!0),[l,d]=a(Boolean(i));return o(()=>{n||c(!1)},[n]),o(()=>{i&&d(!0)},[i]),o(()=>{"thankYou"===s?.type&&c(!l)},[s?.type,l]),r}(),{allRenderedSections:h,editorSetShopPaySignal:g}=x(),f=h.value,[w,k]=a(!1),{router:R,observability:M,shop:I,checkout:{configuration:B}}=S(),z=R.currentUrl.value,T=A(),F=W(),L=ft&&I.hasFlagEnabled(O),j=u(()=>{if("undefined"!=typeof window)return L?Ue():yt??bt()},[L]),D=!L&&null==yt,N=u(()=>new p,[]),$=u(()=>m(N.connection),[N]);o(()=>{let n;async function o(){if(!j)return;M.leaveErrorBreadcrumb("CheckoutEditorBridge: Initializing");const o=await j.call.initialize($);if(M.leaveErrorBreadcrumb("CheckoutEditorBridge: Initialization complete - context "+(o?"present":"missing")),L||e(o),o?.checkoutProfile.addressAutocompleteEnabled&&(i=o.checkoutProfile.addressAutocompleteEnabled,(s=e=>{B.update({addressSettings:{autocompleteEnabled:e}})})(i.initial),n=_(i).subscribe(s)),o){const e=o.activeInspector.inspectorTarget,n={...o,activeInspector:{enabled:gt(o.activeInspector.enabled),selectedBlock:gt(o.activeInspector.select.selectedBlock,o.activeInspector.select.setSelectedBlock,e=>{M.leaveErrorBreadcrumb("CheckoutEditorBridge: setSelectedBlock called",{value:e})}),hoveredExtension:gt(o.activeInspector.hover.hoveredExtension,o.activeInspector.hover.setHoveredExtension,e=>{M.leaveErrorBreadcrumb("CheckoutEditorBridge: setHoveredExtension called",{value:e})}),selectedExtension:gt(o.activeInspector.select.selectedExtension,o.activeInspector.select.setSelectedExtension,e=>{M.leaveErrorBreadcrumb("CheckoutEditorBridge: setSelectedExtension called",{value:e})}),inspectorTarget:e?{hovered:gt(e.hovered,e.setHovered),rect:gt(e.rect,e.setRect),viewport:gt(e.viewport,e.setViewport)}:void 0,actions:{canMoveUp:gt(o.activeInspector.actions.canMoveUp),canMoveDown:gt(o.activeInspector.actions.canMoveDown),lastDirection:gt(o.activeInspector.actions.lastDirection),moveExtension:(...e)=>(M.leaveErrorBreadcrumb("CheckoutEditorBridge: moveExtension called",{args:JSON.stringify(e)}),o.activeInspector.actions.moveExtension(...e)),removeExtension:(...e)=>(M.leaveErrorBreadcrumb("CheckoutEditorBridge: removeExtension called",{args:JSON.stringify(e)}),o.activeInspector.actions.removeExtension(...e))}},checkoutProfile:{addressAutocompleteEnabled:o.checkoutProfile.addressAutocompleteEnabled,hasOverrides:gt(o.checkoutProfile.hasOverrides)}};t(n)}var i,s;g.value={setShopPay:e=>{M.leaveErrorBreadcrumb("CheckoutEditorBridge: setshopPay called",{value:e}),vt("setShopPay",j.call.setShopPay(e),M)}},k(!0),L&&j.notifyInitialized?.()}return L?o().catch(e=>{mt("initialize",e,M),j?.notifyError?.()}):o(),()=>{n?.()}},[$,t,g,M,B,L,j]),o(()=>
1{if(!w||!j)return;const{searchParams:e}=z,t=e.get("ce_redirect");t&&T.includes(t)&&(M.leaveErrorBreadcrumb("CheckoutEditorBridge: redirectTo called",{redirectTo:t}),vt("redirectTo",j.call.redirectTo(t),M),R.navigate(e=>{const t=new URL(e.href);return t.searchParams.delete("ce_redirect"),t},{replace:!0}))},[z,w,M,T,R,j]),o(()=>{j&&(M.leaveErrorBreadcrumb("CheckoutEditorBridge: Navigate exposed"),j.expose({navigateToStep:s}))},[s,M,n,j]),o(()=>{const e=i?.type??n?.id;e&&w&&j&&(M.leaveErrorBreadcrumb(`CheckoutEditorBridge: navigate called with checkout:${e}`),vt("navigate",j.call.navigate(`checkout:${e}`),M))},[n,i,w,M,j]),o(()=>{w&&j&&(M.leaveErrorBreadcrumb(`CheckoutEditorBridge: setLoading called with ${d}`),vt("setLoading",j.call.setLoading(d),M))},[d,w,M,j]),o(()=>{w&&j&&f&&(M.leaveErrorBreadcrumb("CheckoutEditorBridge: updateSections called with the following sections",{sections:JSON.stringify(f)}),vt("updateSections",j.call.updateSections(f),M))},[w,f,M,j]),o(()=>{if(!w||!j)return;const e=function(e,t){return n=>{n.isTrusted&&(function(e){return"click"===e.type}(n)&&(t.leaveErrorBreadcrumb("CheckoutEditorBridge: Click event"),e({type:"click",event:{cancelable:n.cancelable,bubbles:n.bubbles}})),function(e){return"keydown"===e.type}(n)&&("s"!==n.key&&"y"!==n.key||!n.metaKey&&!n.ctrlKey||n.preventDefault(),t.leaveErrorBreadcrumb("CheckoutEditorBridge: Keydown event"),e({type:"keydown",event:{altKey:n.altKey,charCode:n.charCode,code:n.code,ctrlKey:n.ctrlKey,isComposing:n.isComposing,key:n.key,keyCode:n.keyCode,shiftKey:n.shiftKey,metaKey:n.metaKey,cancelable:n.cancelable,bubbles:n.bubbles,defaultPrevented:n.defaultPrevented}})))}}(e=>vt("userInteractionEvent",j.call.userInteractionEvent(e),M),M);return window.addEventListener("click",e),window.addEventListener("keydown",e),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",e)}},[w,M,j]);const q=u(()=>new Map([...Object.entries(ht).map(([e,t])=>[e,b(t)]),["remote-fragment",v]]),[]);return o(()=>()=>{M.leaveErrorBreadcrumb("CheckoutEditorBridge: Unmounting"),j?.close?.(),D&&j?.terminate?.()},[M,j,D]),r(c,{children:[r(de,{}),r(y,{receiver:N,components:q}),w&&F?.activeInspector.inspectorTarget?r(re,{inspectorTarget:F.activeInspector.inspectorTarget,selectedBlock:F.activeInspector.selectedBlock,selectedExtension:F.activeInspector.selectedExtension}):null]})}export{wt as default};

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.