PageSourceSearch

https://www.asiabooks.com/en/14.3dc234b15664030c1955.js

js asiabooks.com collected 2026-10-02 07:58:26 UTC 20,830 bytes, 76 lines download raw bytes

1/*! @version pwa-studio: 0.0.1, @magento/venia-ui: ~11.7.0, @magento/upward-security-headers: ~1.1.18, @magento/pwa-theme-venia: ~2.4.0, @magento/pwa-buildpack: ~11.5.3, @magento/peregrine: ~15.5.2, @magento/pagebuilder: ~9.3.5, @magento/eslint-config: ~1.5.0, @magento/babel-preset-peregrine: ~1.3.3, @apollo/client: ~3.5.0 */
2(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{"92/c":function(e,t,n){"use strict"
3var a=n("pVnL"),r=n.n(a),i=n("q1tI"),l=n.n(i),o=n("X5qW"),c=n("17x9"),s=n("dDsW"),u=n("kriW"),d=n("i8i4"),m=n("t+/2")
4const p=e=>{let{onPress:t,label:n}=e
5return l.a.createElement("button",{type:"button",onClick:t,className:"flex size-9 shrink-0 items-center justify-center rounded-[18px] border-[1.5px] border-solid border-[#cdead8] bg-white p-2 text-black","aria-label":n},l.a.createElement("span",{className:"relative block size-5"},l.a.createElement("span",{className:"absolute left-1/2 top-1/2 block h-[1.5px] w-[18px] -translate-x-1/2 -translate-y-1/2 rotate-45 rounded-[5px] bg-black"}),l.a.createElement("span",{className:"absolute left-1/2 top-1/2 block h-[1.5px] w-[18px] -translate-x-1/2 -translate-y-1/2 -rotate-45 rounded-[5px] bg-black"})))},g=e=>{let{confirmLoading:t=!1,isOpen:n,onClose:a,onConfirm:r,oosItems:o=[]}=e
6const c=Object(s.a)(),g=Object(i.useCallback)(e=>{e&&(e.preventDefault(),e.stopPropagation()),a()},[a]),b=Object(i.useCallback)(e=>{e&&(e.preventDefault(),e.stopPropagation()),r()},[r]),f=Object(i.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),e.target===e.currentTarget&&g()},[g])
7if(Object(i.useEffect)(()=>{const e=e=>{"Escape"===e.key&&n&&(e.stopPropagation(),g())}
8if(n)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n,g]),!n||!o.length)return null
9const y=l.a.createElement("div",{className:"fixed inset-0 z-[1001] flex items-center justify-center",role:"presentation","aria-hidden":"true"},l.a.createElement("div",{className:"absolute inset-0 bg-black/70",onClick:f,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),g())},role:"button",tabIndex:0,"aria-label":"Close modal by clicking background"}),l.a.createElement("div",{className:"relative z-10 mx-4 w-full max-w-[390px] rounded-2xl bg-white shadow-[0px_4px_10px_rgba(0,0,0,0.1)]",role:"dialog","aria-labelledby":"remove-oos-modal-title","aria-modal":"true"},l.a.createElement("div",{className:"relative flex h-[60px] items-center border-b border-solid border-[#e4e7e5] px-4"},l.a.createElement("h2",{id:"remove-oos-modal-title",className:"absolute left-1/2 top-1/2 w-[calc(100%-120px)] -translate-x-1/2 -translate-y-1/2 text-center text-[25px] font-medium leading-normal text-[#22b25a]"},l.a.createElement(u.a,{id:"removeOOSModal.title",defaultMessage:"Update your cart to proceed"})),l.a.createElement("div",{className:"ml-auto flex justify-end"},l.a.createElement(p,{onPress:g,label:c.formatMessage({id:"removeOOSModal.close",defaultMessage:"Close"})}))),l.a.createElement("div",{className:"flex flex-col gap-5 px-[21px] py-5"},l.a.createElement("p",{className:"text-center text-xls text-black"},l.a.createElement(u.a,{id:"removeOOSModal.body",defaultMessage:"Please review the unavailable items below. They will be removed from your cart so you can complete your order for the rest."})),l.a.createElement("div",{className:"flex flex-col gap-5"},o.map(e=>{var t,n,a
10const r=null===(t=e.errors)||void 0===t?void 0:null===(n=t[0])||void 0===n?void 0:n.message
11return l.a.createElement("div",{key:e.uid||e.id,className:"flex w-full flex-col gap-3 rounded-xl"},l.a.createElement("div",{className:"flex w-full gap-2.5"},l.a.createElement("div",{className:"h-[82px] w-[58px] shrink-0 overflow-hidden rounded"},l.a.createElement(m.a,{alt:e.product.name,width:58,height:82,resource:null===(a=e.product.thumbnail)||void 0===a?void 0:a.url,classes:{image:"size-full object-cover rounded h-[82px] w-[58px]"}})),l.a.createElement("div",{className:"flex min-w-0 flex-1 flex-col gap-[5px]"},l.a.createElement("p",{className:"text-xls font-medium text-black line-clamp-2"},e.product.name),e.product.isbn?l.a.createElement("p",{className:"whitespace-nowrap text-base font-medium text-[#136732]"},l.a.createElement(u.a,{id:"removeOOSModal.isbnLabel",defaultMessage:"ISBN : {isbn}",values:{isbn:e.product.isbn}})):null,l.a.createElement("div",{className:"flex w-full gap-2.5 rounded px-2 text-red bg-red-superlight"},l.a.createElement("img",{src:"/venia-static/images/warning.png",alt:"warning",width:16,height:16,className:"h-4 w-4 mt-1"}),l.a.createElement("p",{className:"text-lg font-medium"},r||l.a.createElement(u.a,{id:"miniCart.outOfStock",defaultMessage:"Out of Stock"}))))))})),l.a.createElement("div",{className:"flex flex-col gap-2.5"},l.a.createElement("button",{type:"button",disabled:t,onClick:b,className:"flex h-12 w-full items-center justify-center rounded-[60px] bg-[#22b25a] px-[30px] py-2 text-2xls font-medium text-white disabled:opacity-60"},t?l.a.createElement(u.a,{id:"removeOOSModal.removing",defaultMessage:"Removing…"}):l.a.createElement(u.a,{id:"removeOOSModal.confirm",defaultMessage:"Remove & Continue"})),l.a.createElement("button",{type:"button",onClick:g,className:"flex h-12 w-full items-center justify-center rounded-[60px] border-[1.5px] border-solid border-black bg-white px-[30px] py-2 text-2xls font-medium text-black"},l.a.createElement(u.a,{id:"removeOOSModal.backToCart",defaultMessage:"Back to Cart"}))))))
12return Object(d.createPortal)(y,document.body)}
13p.propTypes={onPress:c.func.isRequired,label:c.string.isRequired}
13,g.propTypes={confirmLoading:c.bool,isOpen:c.bool.isRequired,onClose:c.func.isRequired,onConfirm:c.func.isRequired,oosItems:Object(c.arrayOf)(Object(c.shape)({uid:c.string,id:c.string,errors:Object(c.arrayOf)(Object(c.shape)({code:c.string,message:c.string})),product:Object(c.shape)({name:c.string,isbn:c.string,thumbnail:Object(c.shape)({url:c.string}),url_key:c.string}),quantity:c.number,prices:Object(c.shape)({price:Object(c.shape)({value:c.number,currency:c.string})})}))}
14var b,f,y=g,h=n("QAw3"),v=n("+TN3"),x=n("pZLH"),O=n("Ty5D"),_=n("VkAN"),S=n.n(_),w=n("UYTu"),C=n("JXKe"),j=n("cFZP")
15var k={checkoutButtonQuery:Object(w.a)(b||(b=S()(["\n  query CartQueryForCheckoutButton($cartId: String!) {\n    cart(cart_id: $cartId) {\n      id\n      items {\n        uid\n        quantity\n        errors {\n          code\n          message\n        }\n        prices {\n          price {\n            currency\n            value\n          }\n        }\n        product {\n          uid\n          sku\n          name\n          stock_status\n          isbn\n          thumbnail {\n            url\n          }\n        }\n      }\n    }\n  }\n"]))),purgeCartMutation:Object(w.a)(f||(f=S()(["\n  mutation PurgeCart($cartId: String!) {\n    purgeCart(input: { cart_id: $cartId }) {\n      removed_skus\n      cart {\n        id\n        ...MiniCartFragment\n        ...CartPageFragment\n      }\n    }\n  }\n  ","\n  ","\n"])),j.a,C.a)},E=n("j4gh"),L=n("Cess"),I=n("9872"),q=n("FITH"),N=n("y1Xp"),M=n("+sVj")
16var P=n("Ps06")
17t.a=(e=>{let{disabled:t,buttonProps:n,children:a,onSuccess:c}=e
18const{confirmLoading:s,handleAuthenticatedAfterCheckoutModal:u,handleCloseSignInModal:d,handleProceedToCheckout:m,handleRemoveOOSCancel:p,handleRemoveOOSConfirm:g,isRemoveOOSModalOpen:b,isSignInModalOpen:f,oosItems:_,loading:S}=(e=>{let{onSuccess:t}=e
19const[n,a]=Object(i.useState)(!1),[r,l]=Object(i.useState)(!1),o=Object(O.g)(),[,{dispatch:c}]=Object(L.b)(),[{cartId:s}]=Object(I.b)(),[{isSignedIn:u}]=Object(q.b)(),d=Object(N.a)(k,E.a),{purgeCartMutation:m,checkoutButtonQuery:p}=d,{data:g,loading:b}=Object(v.a)(p,{fetchPolicy:"cache-only",variables:{cartId:s}}),[f,{loading:y,error:h}]=Object(x.a)(m),_=Object(i.useMemo)(()=>{if(!b)return g&&g.cart&&g.cart.items},[g,b]),S=Object(i.useMemo)(()=>_&&0!==_.length?_.filter(e=>"OUT_OF_STOCK"===(e.product&&e.product.stock_status||"IN_STOCK")):[],[_]),w=Object(i.useCallback)(()=>{t?t():o.push("/checkout")},[o,t]),C=Object(i.useCallback)(()=>{u?w():l(!0)},[u,w]),j=Object(i.useCallback)(()=>{w()},[w]),P=Object(i.useCallback)(()=>{S.length>0?a(!0):C()},[C,S.length]),D=Object(i.useCallback)(async()=>{if(s&&0!==S.length)try{await f({variables:{cartId:s}}),S.forEach(e=>{const t=e.configurable_options,n=t?t.map(e=>{let{option_label:t,value_label:n}=e
20return{attribute:t,value:n}}):null,a=e.prices.total_item_discount,r=a&&null!=a.value?a.value:0
21c({type:"CART_REMOVE_ITEM",payload:{cartId:s,sku:e.product.sku,name:e.product.name,priceTotal:e.prices.price.value,currencyCode:e.prices.price.currency,discountAmount:r,selectedOptions:n,quantity:e.quantity}})}),a(!1),C()}catch(e){a(!1)}},[C,s,c,S,f]),T=Object(i.useCallback)(()=>{a(!1)},[]),A=Object(i.useMemo)(()=>Object(M.a)([h]),[h])
22return{isRemoveOOSModalOpen:n,oosItems:S,handleRemoveOOSConfirm:D,handleRemoveOOSCancel:T,handleProceedToCheckout:P,confirmLoading:y,loading:y||b,derivedErrorMessage:A,isSignInModalOpen:r,handleCloseSignInModal:()=>l(!1),handleAuthenticatedAfterCheckoutModal:j}})({onSuccess:c})
23return l.a.createElement(l.a.Fragment,null,l.a.createElement(o.a,r()({onClick:m,disabled:t||S,icon:l.a.createElement(P.a,null)},n),a),_.length>0&&l.a.createElement(y,{confirmLoading:s,isOpen:b,onClose:p,onConfirm:g,oosItems:_}),l.a.createElement(h.a,{isOpen:f,onClose:d,onAuthenticated:u}))})},BCpZ:function(e,t,n){"use strict"
24var a=n("q1tI"),r=n.n(a),i=n("+vrd"),l=n("y1Xp"),o=n("LboF"),c=n.n(o),s=n("BfqG"),u={injectType:"singletonStyleTag",insert:"head",singleton:!0},d=(c()(s.a,u),s.a.locals||{}),m=n("k5y7")
25t.a=(e=>{const t=Object(l.a)(d,e.classes),{totalDiscount:n,discountData:a}=Object(m.a)(e)
26return n.value?r.a.createElement("ul",{className:t.individualDiscountsList},a.map(e=>{if("Gift Cards"!=e.label)return r.a.createElement("li",{className:"".concat(t.individualDiscountsListLineItem," ").concat("!text-primary-darker"),key:e.label},r.a.createElement("span",{className:t.lineItemLabel},r.a.createElement("span",null,e.label)),r.a.createElement("span",{className:t.price},e.amount&&0!==e.amount.value?r.a.createElement(r.a.Fragment,null,"-",r.a.createElement(i.a,{value:e.amount.value,currencyCode:e.amount.currency})):null))})):null})},BfqG:function(e,t,n){"use strict"
27var a=n("JPst"),r=n.n(a),i=n("DKSc"),l=r()(function(e){return e[1]})
28l.i(i.a,"",!0),l.push([e.i,".discountSummary-root-efm {\n}\n\n.discountSummary-discountsButton-RNH {\n}\n\n.discountSummary-discountLineItems-ApF {\n}\n\n.discountSummary-discountLineItemLabel-QAb {\n}\n\n.discountSummary-individualDiscountSeparator-2qm {\n\n  color: rgb(var(--venia-global-color-gray-300));\n}\n.discountSummary-individualDiscountsList-PKI {\n  display: flex;\n  flex-direction: column;\n  row-gap: 10px;\n}\n\n.discountSummary-individualDiscountsListLineItem-4Di {\n}\n",""]),l.locals={root:"discountSummary-root-efm",discountsButton:"discountSummary-discountsButton-RNH grid items-center ml-2",discountLineItems:"discountSummary-discountLineItems-ApF "+i.a.locals.lineItems+" items-center",discountLineItemLabel:"discountSummary-discountLineItemLabel-QAb "+i.a.locals.lineItemLabel+" grid grid-flow-col items-center",individualDiscountSeparator:"discountSummary-individualDiscountSeparator-2qm mx-0 my-4",individualDiscountsList:"discountSummary-individualDiscountsList-PKI "+i.a.locals.lineItemLabel,individualDiscountsListLineItem:"discountSummary-individualDiscountsListLineItem-4Di "+i.a.locals.lineItems},t.a=l},DKSc:function(e,t,n){"use strict"
29var a=n("JPst"),r=n.n(a)()(function(e){return e[1]})
30r.push([e.i,".priceSummary-root-f-7 {\n}\n\n.priceSummary-errorText-V3L {\n}\n\n.priceSummary-lineItems-Mqu {\n    font-size: 21px;\n    line-height: 25px;\n    --tw-text-opacity: 1;\n    color: rgb(108 108 108 / var(--tw-text-opacity, 1));\n}\n\n.priceSummary-lineItemLabel-EXG {\n}\n\n.priceSummary-price-LvH {\n}\n\n.priceSummary-totalLabel-d7K {\n    font-size: 24px;\n    line-height: 25px;\n    font-weight: 500;\n    --tw-text-opacity: 1;\n    color: rgb(0 0 0 / var(--tw-text-opacity, 1));\n}\n\n.priceSummary-totalPrice-FXi {\n    font-size: 24px;\n    line-height: 25px;\n    font-weight: 500;\n    --tw-text-opacity: 1;\n    color: rgb(0 0 0 / var(--tw-text-opacity, 1));\n}\n\n.priceSummary-priceUpdating-SfU {\n}\n\n.priceSummary-checkoutButton_container-63g {\n    margin-top: 15px;\n}\n\n@media (min-width: 960px) {\n\n    .priceSummary-checkoutButton_container-63g {\n        margin-top: 1.25rem;\n    }\n}\n\n.priceSummary-lineItemsTotal-QqA {\n    margin-top: 5px;\n}\n\n@media (min-width: 960px) {\n\n    .priceSummary-lineItemsTotal-QqA {\n        margin-top: 10px;\n    }\n}",""]),r.locals={root:"priceSummary-root-f-7",errorText:"priceSummary-errorText-V3L leading-normal text-error",lineItems:"priceSummary-lineItems-Mqu gap-4 grid grid-cols-autoLast leading-normal",lineItemLabel:"priceSummary-lineItemLabel-EXG justify-self-start",price:"priceSummary-price-LvH justify-self-end",totalLabel:"priceSummary-totalLabel-d7K",totalPrice:"priceSummary-totalPrice-FXi priceSummary-price-LvH justify-self-end",priceUpdating:"priceSummary-priceUpdating-SfU priceSummary-price-LvH justify-self-end opacity-0",checkoutButton_container:"priceSummary-checkoutButton_container-63g items-center inline-flex justify-center w-full",lineItemsTotal:"priceSummary-lineItemsTotal-QqA priceSummary-lineItems-Mqu gap-4 grid grid-cols-autoLast leading-normal"},t.a=r},L6NH:function(e,t,n){"use strict"
31n.d(t,"c",function(){return a}),n.d(t,"b",function(){return r}),n.d(t,"a",function(){return i})
32const a=e=>{if(!e)return""
33const t="string"==typeof e?e:"object"==typeof e&&"string"==typeof e.html?e.html:""
34if(!t)return""
35const n=t.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/#html-body\s*\[[^\]]*\]\s*\{[^}]*\}/g,"").replace(/<br\s*\/?>/gi,"\n").replace(/<\/(p|div|li|h[1-6])>/gi,"\n")
36try{if("undefined"!=typeof DOMParser){const e=new DOMParser
37let t=n
38for(let n=0;n<3;n++){const n=e.parseFromString(t,"text/html")
39n.querySelectorAll("style, script").forEach(e=>e.remove())
40const a=n.body.textContent||""
41if(a===t||!/<[^>]+>/.test(a))return a.replace(/#html-body\s*\[[^\]]*\]\s*\{[^}]*\}/g,"").replace(/\n{3,}/g,"\n\n").trim()
42t=a}return t.replace(/#html-body\s*\[[^\]]*\]\s*\{[^}]*\}/g,"").replace(/\n{3,}/g,"\n\n").trim()}}catch(e){}return n.replace(/<[^>]*>/g,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/\n{3,}/g,"\n\n").trim()},r=e=>{if(!e)return null
43const t=[...e.discounts||[],...e.evoucher_discounts||[]]
44return t.length?t:null},i=e=>{var t
45if(null==e||null===(t=e.cart)||void 0===t||!t.prices)return{}
46const n=e.cart.prices
47return{subtotal:n.subtotal_including_tax,total:n.grand_total,discounts:r(n),taxes:n.applied_taxes,shipping:e.cart.shipping_addresses,hasGiftWrap:e.cart.has_gift_wrap,deliveryCharge:e.cart.delivery_charge}}},Ps06:function(e,t,n){"use strict"
48var a=n("q1tI"),r=n.n(a),i=n("17x9")
49const l=e=>{let{className:t,width:n,height:a,fill:i}=e
50return r.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:a,viewBox:"0 0 20 20",fill:i,className:t},r.a.createElement("path",{d:"M6.5904 13.0085L12.4131 7.1858L7.38499 7.26967C7.07261 7.27488 6.82437 7.02664 6.82958 6.71427C6.83489 6.40179 7.09155 6.14513 7.40393 6.13992L13.7954 6.03293C13.8694 6.03198 13.9426 6.046 14.0112 6.07323C14.1481 6.12808 14.2565 6.2365 14.3114 6.37342C14.3386 6.44198 14.3525 6.51517 14.3517 6.58918L14.2447 12.9807C14.2422 13.1365 14.1766 13.279 14.0726 13.383C13.9687 13.4869 13.8262 13.5524 13.6703 13.555C13.358 13.5602 13.1097 13.312 13.1149 12.9995L13.1988 7.97153L7.37613 13.7942C7.15193 14.0184 6.79392 14.0244 6.57707 13.8075C6.36023 13.5907 6.3662 13.2327 6.5904 13.0085Z",fill:i}))}
51l.propTypes={className:i.string,width:i.number,height:i.number,fill:i.string},l.defaultProps={className:"",width:20,height:20,fill:"currentColor"},t.a=l},cFZP:function(e,t,n){"use strict"
52n.d(t,"a",function(){return u})
53var a,r=n("VkAN"),i=n.n(r),l=n("UYTu")
54const o=Object(l.a)(a||(a=i()(["\n  fragment ProductListFragment on Cart {\n    id\n    # eslint-disable-next-line @graphql-eslint/require-id-when-available\n    items {\n      uid\n      errors {\n        message\n        code\n      }\n      # eslint-disable-next-line @graphql-eslint/require-id-when-available\n      product {\n        uid\n        name\n        sku\n        url_key\n        isbn\n        thumbnail {\n          url\n        }\n        small_image {\n          url\n        }\n        stock_status\n        quantity\n        price_range {\n          minimum_price {\n            final_price {\n              currency\n              value\n            }\n            regular_price {\n              currency\n              value\n            }\n          }\n        }\n        # eslint-disable-next-line @graphql-eslint/require-id-when-available\n        ... on ConfigurableProduct {\n          variants {\n            attributes {\n              uid\n            }\n            # eslint-disable-next-line @graphql-eslint/require-id-when-available\n            product {\n              uid\n              thumbnail {\n                url\n              }\n            }\n          }\n        }\n      }\n      prices {\n        price {\n          currency\n          value\n        }\n        total_item_discount {\n          value\n        }
54\n        price_including_tax {\n          value\n          currency\n        }\n      }\n      quantity\n      is_free_gift\n      free_gift_rule_id\n      free_gift_type\n      promo_label\n      qualifying_rule_id\n      # eslint-disable-next-line @graphql-eslint/require-id-when-available\n      ... on ConfigurableCartItem {\n        # eslint-disable-next-line @graphql-eslint/require-id-when-available\n        configurable_options {\n          configurable_product_option_uid\n          option_label\n          configurable_product_option_value_uid\n          value_label\n        }\n        # eslint-disable-next-line @graphql-eslint/require-id-when-available\n        configured_variant {\n          uid\n          stock_status\n          thumbnail {\n            url\n          }\n          price_range {\n            minimum_price {\n              final_price {\n                currency\n                value\n              }\n              regular_price {\n                currency\n                value\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n"])))
55var c,s=n("WwUj")
56const u=Object(l.a)(c||(c=i()(["\n  fragment MiniCartFragment on Cart {\n    id\n    total_quantity\n    percent_freeshipping\n    has_gift_wrap\n    delivery_charge {\n      has_shipping_rate\n      shipping_amount {\n        value\n        currency\n      }\n    }\n    prices {\n      subtotal_excluding_tax {\n        currency\n        value\n      }\n      subtotal_including_tax {\n        currency\n        value\n      }\n      grand_total {\n        currency\n        value\n      }\n      ...DiscountSummaryFragment\n    }\n    ...ProductListFragment\n  }\n  ","\n  ","\n"])),o,s.a)},j4gh:function(e,t,n){"use strict"
57t.a={}},t93Y:function(e,t,n){"use strict"
58n.d(t,"a",function(){return attachAmpromoGiftsToCartItems})
59var a=n("lSNA"),r=n.n(a)
60function ownKeys(e,t){var n=Object.keys(e)
61if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
62t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
63t%2?ownKeys(Object(n),!0).forEach(function(t){r()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const i="ampromo_items",l=e=>null==e?null:String(e),o=e=>{if(null==e)return[]
64if(Array.isArray(e))return e.map(l).filter(e=>null!==e)
65const t=l(e)
66return null===t?[]:[t]}
67function attachAmpromoGiftsToCartItems(e){if(null==e||!e.length)return[]
68const t=new Map
69for(const n of e){if((null==n?void 0:n.free_gift_type)!==i)continue
70const e=l(null==n?void 0:n.free_gift_rule_id)
71null!==e&&(t.has(e)||t.set(e,[]),t.get(e).push(_objectSpread({},n)))}const n=new Set,a=[]
72for(const r of e){if((null==r?void 0:r.free_gift_type)===i)continue
73const e=o(null==r?void 0:r.qualifying_rule_id),l=[],c=new Set
74for(const n of e)if(t.has(n)){for(const e of t.get(n)){const t=_objectSpread({},e)
75c.has(t.uid)||(c.add(t.uid),l.push(t))}t.delete(n)}l.length?(l.forEach(e=>n.add(e.uid)),a.push(_objectSpread(_objectSpread({},r),{},{gift_items:l}))):a.push(r)}for(const t of e)(null==t?void 0:t.free_gift_type)!==i||n.has(t.uid)||a.push(t)
76return a}}}])

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.