PageSourceSearch

https://case-mate.com/cdn/shopifycloud/checkout-web/assets/c1/adeb5fdb.Bl-M2ErE.js

js case-mate.com collected 2026-10-01 10:36:38 UTC 51,627 bytes, 1 lines download raw bytes

1import{R as e,a4 as t,A as n,h as o,E as i,j as s,u as r,S as c,k as a,q as l,y as d,m as h,T as u,a8 as g,ad as f}from"./2c1ab0fe.D_oO1jU7.js";import{a as p}from"./fd38863f.yQuOHFYV.js";import{aQ as m,ce as v,O as b,a7 as y,bm as w,gw as k,aM as S,gx as E,aT as R,gy as M}from"./4c290a1e.D9lE9kmU.js";import{L as I,g as x,h as B,f as O}from"./27f09e31.D80YTEU6.js";import{e as C,h as P,a2 as z,a3 as T,gf as F,dZ as L,gg as A,gh as j,f4 as W}from"./164ad2e3.DgUUtBtV.js";import{receiptForUI as D}from"./8498e76b.CeD2ihdU.js";import{b as N,d as $}from"./bb728e1c.BObJOhlA.js";import"./app.bDJ3v-8C.js";import"./66338e00.DAXMdGUl.js";import"./65f3d4da.8ZfwXSRH.js";import"./60a453ce.BIyixFcg.js";import"./0a7dffce.BMM606kb.js";import"./2255f8fa.DZJKRP_r.js";import"./05a2a9c8.DmM9tTSM.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 Q(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&&Q(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 Q(e){return"nodeType"in e}var Y=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 Y(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 i of e){const{target:e}=i;n=i,null!=(o=this.#m.get(e))&&n.target===o.target&&n.isIntersecting===o.isIntersecting&&q.equals(n.boundingClientRect,o.boundingClientRect)&&q.equals(n.intersectionRect,o.intersectionRect)||(this.#m.set(e,i),t.push(i))}var n,o;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}};const ee="data-inspector-id",te=new Set(["header","orderSummary","footer"]);function ne(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(ee))return{element:t,managed:!1}}return{element:null,managed:!1}}function oe(e){return e.width>0&&e.height>0}function ie(e){if(!e)return null;for(const t of document.querySelectorAll(`[${ee}="${e}"]`))if(oe(t.getBoundingClientRect()))return t;return null}function se({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();oe(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||!oe(t.boundingClientRect))return void g();r(t.target,t.boundingClientRect)}})),d=new MutationObserver((()=>{n?.isConnected&&oe(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=ie(i.value)??ie(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}=ne(t);!o&&n&&n!==s.current&&(s.current=n,e.hovered.value=n.getAttribute(ee)??"",h(n))}function p(t){const{element:n}=ne(t);if(!n||n!==s.current)return;const o=t.relatedTarget;o instanceof Node&&n.contains(o)||o instanceof HTMLElement&&o.closest(`[${ee}]`)||(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}=ne(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(ee)??"";m=!0;try{te.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=ie(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 re={id:"605cb290c423e2035b0d3038d56ed6c5a828a81829a22e6422a54a1974fc7b81",type:"query",name:"SimulatedReceipt",source:""},ce=m((({checkout:e,graphql:{coreGraphql:t}},{journey:n})=>{const o=i((()=>"thankYou"===n.value.currentDetour?.type)),r=t.query(re,{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 ae(){const e=C();return v(ce,{journey:e}),null}function le(){return r(c,{children:r(ae,{})})}const de="mixed_signals_v1",he=["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 ue(e){return function(e){if("mixed_signals"===e||e===de)return e}(e.get("editor_bridge"))}const ge="@R";function fe(e){if(""===e)return;const t=Number(e);return Number.isInteger(t)?t:void 0}function pe(e,t){return JSON.parse(e?`[${e}]`:"[]",t)}function me(e=[]){return JSON.stringify(e).slice(1,-1)}function ve(e,t){return`E${e}:${JSON.stringify(t)}`}const be=Symbol("mixed-signals.refreshModel"),ye=Symbol("mixed-signals.getModelSignals"),we=new Set(["then","catch","finally","toJSON","toString","valueOf","inspect","constructor","prototype","__proto__"]);function ke(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 Se(e){return""!==e&&!we.has(e)}function Ee(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0})}function Re(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 Me(e){const t=new Set;for(const n of e)void 0!==n&&t.add(n);return Array.from(t)}function Ie(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 Be="undefined"!=typeof WeakRef;function Oe(e){return Be?new WeakRef(e):new xe(e)}var Ce=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},Be&&"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=Me(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,Oe(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,Oe(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=Me(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=Me(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(Ie(e)&&Ie(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[ye]?.();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=>Oe(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[be]?.(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=ke(t),s={},r={ctx:e,wireId:o,fallbackId:d(o),signalSources:new Map,methods:new Map};Ee(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),Ee(s,t,i((()=>e.value.value)))}},a=e=>{const t=ke(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?.[be]&&Ee(s,n,i)};a(t);for(const i of n.methods??[])Se(i)&&!Object.hasOwn(s,i)&&Ee(s,i,Re(r,i));return new Proxy(s,{get:(e,t,o)=>t===be?a:t===ye?()=>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):Se(t)?Re(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 Pe(e){return!!e&&"object"==typeof e&&"string"==typeof e.connectionId&&"string"==typeof e.processId&&"boolean"==typeof e.resumed}var ze=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 Ce(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=fe(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=fe(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===ge){const e=pe(o.payload);this.prepareForRootSnapshot(e)}let s;if(o.method===ge){this.reflection.beginRootSnapshot();try{s=pe(o.payload,i)}finally{this.reflection.endRootSnapshot()}}else s=pe(o.payload,i);this.handleNotification(t,o.method,s)}))}prepareForRootSnapshot(e){const[,t]=e,n=Pe(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)=>e?.[t]),l)):this.localRoot;var l;const d=a?.[c];if("function"!=typeof d)return void this.sendOnTransport(e,t,ve(n,{code:-1,message:`Method not found: ${o}`}));let h;try{h=pe(i,s)}catch(u){return void this.sendOnTransport(e,t,ve(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,ve(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}:${me(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}:${me(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{}
1finally{this.reflection.finishModelRefresh(t,n),e===this.transportGeneration&&this.reflection.replayActiveSignals(i)}}handleNotification(e,t,n){if(t===ge){const[t,o]=n,i=void 0!==this.root;Pe(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 Te=class extends Error{constructor(){super(...arguments),this.name="CheckoutEditorBridgeTimeoutError"}};function Fe(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 Te("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&&he.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===de}(t)?"protocol"in e&&e.protocol===de:!("protocol"in e)||e.protocol===de)}(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:de},"*")}));return{cancel:t,connection:n}}const Le=1e4;class Ae extends Error{constructor(){super(...arguments),this.name="CheckoutEditorBridgeTimeoutError"}}class je extends Error{constructor(){super(...arguments),this.name="MixedSignalsCheckoutEditorBridgeNotEnabledError"}}class We extends Error{constructor(){super(...arguments),this.name="MixedSignalsCheckoutEditorBridgeClosedError"}}class De extends Error{constructor(){super(...arguments),this.name="UnknownMixedSignalsCheckoutEditorBridgeError"}}function Ne(e){return{initial:e.peek(),subscribe(t){let n=!1;return[e.subscribe((e=>{n?t(e):n=!0})),e.peek()]}}}function $e(){}function _e(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 qe(){let e,t,n,o,i,s,r;const c=ue(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 De("Unknown Mixed Signals checkout editor bridge error"),a(),s}function d(){if(!c)return Promise.reject(new je("Mixed Signals checkout editor bridge is not enabled"));if(s)return Promise.reject(s);if(o)return o;const a=Fe(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 ze(l,{}));var l;return t=a,e&&a.expose(e),await _e(a.ready,Le,"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 _e(n.call(e,t),Le,`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:Ne((t=await _e(e.call("initialize",[]),Le,"Checkout editor bridge initialize timed out after 10000ms")).checkoutProfile.addressAutocompleteEnabled),hasOverrides:Ne(t.checkoutProfile.hasOverrides)},activeInspector:(n=t.activeInspector,{enabled:Ne(n.enabled),hover:{hoveredExtension:Ne(n.hover.hoveredExtension),setHoveredExtension:$e},select:{selectedBlock:Ne(n.select.selectedBlock),setSelectedBlock:$e,selectedExtension:Ne(n.select.selectedExtension),setSelectedExtension:$e},actions:{canMoveDown:Ne(n.actions.canMoveDown),canMoveUp:Ne(n.actions.canMoveUp),lastDirection:Ne(n.actions.lastDirection),moveExtension:$e,removeExtension:$e}}
1)}}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 We("Checkout editor bridge endpoint is closed"),a()},notifyError(){i&&function(e){window.parent.postMessage({type:"shopify:checkout-editor:mixed-signals:error",protocol:de},e)}(i)},notifyInitialized(){i&&function(e){window.parent.postMessage({type:"shopify:checkout-editor:mixed-signals:initialized",protocol:de},e)}(i)}}}const Ue={"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"},Ve={"customizations.header.logo.maxWidth":{section:"logo",key:"maxWidth"},"components.header.logo.maxWidth":{section:"logo",key:"maxWidth"}},Ge={"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"}},Je={"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"}},He={COLOR1:"base",COLOR2:"base",TRANSPARENT:"transparent"},Ke={"designSystem.typography.primary.name":"typographyPrimary","designSystem.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`]))],Ye=["designSystem.typography.secondary.name","designSystem.typography.primary.name","designTokens.typography.secondary.name","designTokens.typography.primary.name"],Xe=["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"],Ze=["customizations.header.logo.maxWidth","components.header.logo.maxWidth"],et=["customizations.header.position","customizations.header.alignment","surfaces.checkout.components.header.position","surfaces.checkout.components.header.alignment"],tt=["customizations.footer.position","customizations.footer.alignment","surfaces.checkout.components.footer.position","surfaces.checkout.components.footer.alignment"],nt=["customizations.orderSummary.defaultState","surfaces.checkout.components.orderSummary.defaultState"],ot=["customizations.control.color","components.c
1ontrol.color"],it=["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"],st=["surfaces.checkout.components.header.colorScheme","surfaces.checkout.components.footer.colorScheme","surfaces.checkout.components.main.colorScheme","surfaces.checkout.components.orderSummary.colorScheme"],rt=["HIDDEN","VISIBLE"],ct=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,at=({id:e,value:t})=>{const n=z(),i=(()=>{const e=T();return l(((t,n)=>{const{url:o}=t??{},[i]=Ue[n].split("."),s=N(e.configuration,Ue[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?w(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}=b(),t=T(),n=e.hasFlagEnabled(k);return l((e=>{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 Xe.includes(e)}(e))i(t,e);else if(function(e){return Ze.includes(e)}(e)){const{section:n}=Ve[e];c(t,n)}else if(function(e){return et.includes(e)}(e)){const{key:n,section:o}=Ge[e];s(t,n,o)}else if(function(e){return tt.includes(e)}(e)&&t){const{key:n,section:o}=Je[e];s(t,n,o)}else if(function(e){return ot.includes(e)}(e)){const e=(e=>{const t="string"==typeof e?e.toUpperCase():String(e);return(e=>e in He)(t)?He[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 He)&&ct.test(e)})(t)?r(t,"designTokens.colors.global.control"):"base"===e&&r("#FFFFFF","designTokens.colors.global.control")}else if(function(e){return Ye.includes(e)}(e)){const n=Ke[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 it.includes(e)})(e)&&function(e){return rt.includes(e)}(t)?d(t,e):function(e){return nt.includes(e)}(e)?h(t):function(e){return st.includes(e)}(e)&&u(t,e)}),[e,t,r,i,c,s,a,n,g,d,h,u])};function lt(){return S(A)}const dt={BrandingSettings:function({children:e,hydrated:t,onBrandingLoaded:n}){return u((()=>{t&&n()}),[t,n]),r(c,{children:e})},BrandingSetting:function(e){return at(e),null},Extension:function({index:e,children:t,...n}){const i=S(F),s=b().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((()=>
1{if(a)return;const t=E({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(A.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=b().checkout.extensibility.ui,{activatedExtensionId:n}=lt();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=b().checkout.extensibility.ui,{activatedExtensionId:n}=lt();return o((()=>{const o=t.search().peek().find((e=>"persisted"===e.type&&e.publicIdentifier===n));o&&(o.configuration.value=e)}),[n,e,t]),null}},ht=new Set(["RemoteFunctionRevokedError","RemoteFunctionReleasedError"]);function ut(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&&ht.has(e.name)}(s))throw s}}})),i}const gt="undefined"!=typeof window&&null!=ue(new URLSearchParams(window.location.search));class ft extends Error{constructor(){super(...arguments),this.name="UnknownCheckoutEditorBridgeError"}}function pt(e,t,n){const o=t instanceof Error?t:new ft("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 mt(e,t,n){return Promise.resolve(t).catch((t=>{pt(e,t,n)}))}function vt(){return g(f(),{callable:["initialize","navigate","setLoading","updateSections","userInteractionEvent","setShopPay","redirectTo"]})}const bt="undefined"==typeof window||gt?void 0:vt();function yt({setContext:t}){const{currentPage:n,currentDetour:i}=C().value,{navigate:s}=function(){const e=y(),[t,n]=a({}),{checkout:i,router:s}=b(),{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}=b(),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}=R(),f=h.value,[m,v]=a(!1),{router:w,observability:k,shop:S,checkout:{configuration:E}}=b(),z=w.currentUrl.value,T=j(),F=W(),L=gt&&S.hasFlagEnabled(M),A=u((()=>
1{if("undefined"!=typeof window)return L?qe():bt??vt()}),[L]),D=!L&&null==bt,N=u((()=>new I),[]),$=u((()=>p(N.connection)),[N]);o((()=>{let n;async function o(){if(!A)return;k.leaveErrorBreadcrumb("CheckoutEditorBridge: Initializing");const o=await A.call.initialize($);if(k.leaveErrorBreadcrumb("CheckoutEditorBridge: Initialization complete - context "+(o?"present":"missing")),L||e(o),o?.checkoutProfile.addressAutocompleteEnabled&&(i=o.checkoutProfile.addressAutocompleteEnabled,(s=e=>{E.update({addressSettings:{autocompleteEnabled:e}})})(i.initial),n=_(i).subscribe(s)),o){const e=o.activeInspector.inspectorTarget,n={...o,activeInspector:{enabled:ut(o.activeInspector.enabled),selectedBlock:ut(o.activeInspector.select.selectedBlock,o.activeInspector.select.setSelectedBlock,(e=>{k.leaveErrorBreadcrumb("CheckoutEditorBridge: setSelectedBlock called",{value:e})})),hoveredExtension:ut(o.activeInspector.hover.hoveredExtension,o.activeInspector.hover.setHoveredExtension,(e=>{k.leaveErrorBreadcrumb("CheckoutEditorBridge: setHoveredExtension called",{value:e})})),selectedExtension:ut(o.activeInspector.select.selectedExtension,o.activeInspector.select.setSelectedExtension,(e=>{k.leaveErrorBreadcrumb("CheckoutEditorBridge: setSelectedExtension called",{value:e})})),inspectorTarget:e?{hovered:ut(e.hovered,e.setHovered),rect:ut(e.rect,e.setRect),viewport:ut(e.viewport,e.setViewport)}:void 0,actions:{canMoveUp:ut(o.activeInspector.actions.canMoveUp),canMoveDown:ut(o.activeInspector.actions.canMoveDown),lastDirection:ut(o.activeInspector.actions.lastDirection),moveExtension:(...e)=>(k.leaveErrorBreadcrumb("CheckoutEditorBridge: moveExtension called",{args:JSON.stringify(e)}),o.activeInspector.actions.moveExtension(...e)),removeExtension:(...e)=>(k.leaveErrorBreadcrumb("CheckoutEditorBridge: removeExtension called",{args:JSON.stringify(e)}),o.activeInspector.actions.removeExtension(...e))}},checkoutProfile:{addressAutocompleteEnabled:o.checkoutProfile.addressAutocompleteEnabled,hasOverrides:ut(o.checkoutProfile.hasOverrides)}};t(n)}var i,s;g.value={setShopPay:e=>{k.leaveErrorBreadcrumb("CheckoutEditorBridge: setshopPay called",{value:e}),mt("setShopPay",A.call.setShopPay(e),k)}},v(!0),L&&A.notifyInitialized?.()}return L?o().catch((e=>{pt("initialize",e,k),A?.notifyError?.()})):o(),()=>{n?.()}}),[$,t,g,k,E,L,A]),o((()=>{if(!m||!A)return;const{searchParams:e}=z,t=e.get("ce_redirect");t&&T.includes(t)&&(k.leaveErrorBreadcrumb("CheckoutEditorBridge: redirectTo called",{redirectTo:t}),mt("redirectTo",A.call.redirectTo(t),k),w.navigate((e=>{const t=new URL(e.href);return t.searchParams.delete("ce_redirect"),t}),{replace:!0}))}),[z,m,k,T,w,A]),o((()=>{A&&(k.leaveErrorBreadcrumb("CheckoutEditorBridge: Navigate exposed"),A.expose({navigateToStep:s}))}),[s,k,n,A]),o((()=>{const e=i?.type??n?.id;e&&m&&A&&(k.leaveErrorBreadcrumb(`CheckoutEditorBridge: navigate called with checkout:${e}`),mt("navigate",A.call.navigate(`checkout:${e}`),k))}),[n,i,m,k,A]),o((()=>{m&&A&&(k.leaveErrorBreadcrumb(`CheckoutEditorBridge: setLoading called with ${d}`),mt("setLoading",A.call.setLoading(d),k))}),[d,m,k,A]),o((()=>{m&&A&&f&&(k.leaveErrorBreadcrumb("CheckoutEditorBridge: updateSections called with the following sections",{sections:JSON.stringify(f)}),mt("updateSections",A.call.updateSections(f),k))}),[m,f,k,A]),o((()=>{if(!m||!A)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=>mt("userInteractionEvent",A.call.userInteractionEvent(e),k)),k);return window.addEventListener("click",e),window.addEventListener("keydown",e),()=>{window.removeEventListener("click",e),window.removeEventListener("keydown",e)}}),[m,k,A]);const q=u((()=>new Map([...Object.entries(dt).map((([e,t])=>[e,B(t)])),["remote-fragment",x]])),[]);return o((()=>()=>{k.leaveErrorBreadcrumb("CheckoutEditorBridge: Unmounting"),A?.close?.(),D&&A?.terminate?.()}),[k,A,D]),r(c,{children:[r(le,{}),r(O,{receiver:N,components:q}),m&&F?.activeInspector.inspectorTarget?r(se,{inspectorTarget:F.activeInspector.inspectorTarget,selectedBlock:F.activeInspector.selectedBlock,selectedExtension:F.activeInspector.selectedExtension}):null]})}export{yt 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.