PageSourceSearch

https://shop.netgate.com/cdn/shopifycloud/checkout-web/assets/c1/s…g-methods-consolidated-included.CmQthVU7.js

js netgate.com collected 2026-09-24 08:29:40 UTC 3,399 bytes, 1 lines download raw bytes

1import{f as S}from"./esnext-vendor.D7ldIee_.js";import{n as C,N as I,$ as T,aA as k,aW as G,aG as x,aX as D,aY as B,aZ as $,a_ as w,a$ as c}from"./addresses-is-address-empty.-MuOhIyI.js";import{aD as A,ag as E}from"./hydrate.ByRIsqvd.js";function N(t){if(t===void 0)return;if(typeof t=="number")return{lower:t,upper:t};const{lower:n,upper:e}=t;if(!(n===void 0||e===void 0))return{lower:n,upper:e}}function P(t){let n,e;for(const{estimatedTimeInTransit:o}of t){const i=N(o);if(!i)return;n=n===void 0?i.lower:Math.min(n,i.lower),e=e===void 0?i.upper:Math.max(e,i.upper)}if(!(n===void 0||e===void 0))return n===e?n:{lower:n,upper:e}}function F(t,n){if(!t)return`unresolved:${n}`;const e=t.deliveryPresentationGroupToken;return e?`token:${e}`:`no-token:${n}:${t.handle}`}function g(t){const n=new Map;return t.forEach(({line:e,method:o},i)=>{const s=F(o,e.id??`index-${i}`);let r=n.get(s);r||(r={key:s,methods:[],merchandiseLines:[],mergedTimeInTransit:void 0,availableOn:e.availableOn},n.set(s,r)),o&&r.methods.push(o),e.targetMerchandiseLines&&r.merchandiseLines.push(...e.targetMerchandiseLines)}),[...n.values()].map(e=>({...e,merchandiseLines:A(e.merchandiseLines),mergedTimeInTransit:P(e.methods)}))}function V(t){const n=t.map(o=>({line:o,method:C(o)})),e=n.filter(v);return{groups:g(e),nonShippableCount:n.length-e.length}}function v({line:t,method:n}){return n?n.methodType==="SHIPPING"||n.methodType==="LOCAL":t.methods.length===0||t.methods.some(({methodType:e})=>e==="SHIPPING"||e==="LOCAL")}function X(t){return{...t,included:!0}}function Y(t,n){return[...t.filter(e=>!n(e)),...t.filter(n)]}function O({line:t,method:n,localShopId:e,marketDrivenShippingEnabled:o,remoteShopsConfigMap:i,remoteMerchandiseDetails:s}){const r=c(n);if(!r)return;const a=L(t,s,e);if(H({lineShopId:a,localShopId:e,marketDrivenShippingEnabled:o,remoteShopsConfigMap:i,method:n}))return`${a}:${r}`}function R({line:t,localShopId:n,marketDrivenShippingEnabled:e,remoteShopsConfigMap:o,remoteMerchandiseDetails:i}){const s=L(t,i,n);if(s===n)return e;const r=o?.get(s);return r?r.marketDrivenShippingEnabled:t.methods.some(a=>!!c(a))}function Z(){const{shop:{id:t,marketDrivenShippingEnabled:n,remoteShopsConfigMap:e}}=I(),{deliveryNext:o,remoteMerchandiseDetails:i}=T(),{parts:s}=k();return S(()=>{const r={includedMethods:new Set,total:void 0,presentsConsolidatedShipping:!1,groups:[]},a=o.value;if(!a||a.status!=="filled")return r;const{oneTimePurchaseLines:d}=E(G(a).filter(x));if(d.length<2)return r;const h=(u,l)=>O({line:u,method:l,localShopId:t,marketDrivenShippingEnabled:n,remoteShopsConfigMap:e,remoteMerchandiseDetails:i.value}),f=d.some(u=>R({line:u,localShopId:t,marketDrivenShippingEnabled:n,remoteShopsConfigMap:e,remoteMerchandiseDetails:i.value}));if(!f)return r;const M=D(s.deliveryLines.value),p=B(d,M),m=p.filter(u=>!!u.method),b=m.length===d.length?$(m.map(({line:u,method:l})=>({...l,amountCombinabilityToken:h(u,l)}))):void 0,y=g(p.filter(v));return{includedMethods:w(d,p,h),total:b,presentsConsolidatedShipping:f,groups:y}})}function L(t,n,e){const o=t.targetMerchandiseLines?.[0]?.stableId;return o&&n?.stableIdToShopId.get(o)||e}function H({lineShopId:t,localShopId:n,marketDrivenShippingEnabled:e,remoteShopsConfigMap:o,method:i}){if(t===n)return e;const s=o?.get(t);return s?s.marketDrivenShippingEnabled:i?!!c(i):!1}export{X as a,V as b,g as c,v as i,P as m,Y as o,O as r,F as s,Z as u};

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.