PageSourceSearch

https://www.clinique.com/cdn/shop/t/104/assets/core-automatic-price.C6Y96N2B.min.js

js clinique.com collected 2026-10-01 10:32:07 UTC 3,063 bytes, 1 lines download raw bytes

1import{a as t}from"./BaseElement.wji90fuE.min.js";import{W as n}from"./WithApiClient.B8AOHZZP.min.js";import{n as e,t as r,h as o,s as i,x as s}from"./vendor-lit.2u3dzq2T.min.js";import"./fetchWithCache.BJ12kVQ7.min.js";import"./vendor.D2HIaoTS.min.js";var a=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=(t,n,e,r)=>{for(var o,i=r>1?void 0:r?c(n,e):n,s=t.length-1;s>=0;s--)(o=t[s])&&(i=(r?o(n,e,i):o(i))||i);return r&&i&&a(n,e,i),i};const l=new Map;let d=class extends(n(t)){constructor(){super(...arguments),this.hideWhileLoading=!1,this.fetchPriceTask=new o(this,{task:async([t])=>{const n=l.get(t);if(n)return n;const{data:e}=await this.$api.client.storefront({body:{query:"\n  mutation cartCreate($input: CartInput!) {\n    cartCreate(input: $input) {\n      cart {\n        lines(first: 1) {\n          nodes {\n            id\n          }\n        }\n\n        cost {\n          subtotalAmount {\n            amount\n            currencyCode\n          }\n\n          totalAmount {\n            amount\n            currencyCode\n          }\n        }\n\n        discountAllocations {\n          discountedAmount {\n            amount\n            currencyCode\n          }\n\n          targetType\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }\n",variables:{input:{lines:[{quantity:1,merchandiseId:`gid://shopify/ProductVariant/${t}`,...this.sellingPlanId&&{sellingPlanId:`gid://shopify/SellingPlan/${this.sellingPlanId}`}}]}}}});if(e.cartCreate.userErrors.length)throw new Error(e.cartCreate.userErrors[0].message);const r=e.cartCreate.cart;if(0===r.discountAllocations.length)throw new Error("No discount allocations found");const o={subtotalAmount:100*Number(r.cost.subtotalAmount.amount),totalAmount:100*Number(r.cost.totalAmount.amount),discountAllocations:r.discountAllocations,currencyCode:r.cost.totalAmount.currencyCode};return l.set(t,o),o},args:()=>[this.variantId]})}get hasAutomaticDiscount(){if(this.fetchPriceTask.status!=i.COMPLETE||!this.fetchPriceTask.value)return!1;const{totalAmount:t,subtotalAmount:n}=this.fetchPriceTask.value,e=this.currentPrice;return t<n||t<e}get updatedPriceHTML(){if(this.fetchPriceTask.status!=i.COMPLETE||!this.fetchPriceTask.value)return s`<slot></slot>`;const{totalAmount:t,currencyCode:n}=this.fetchPriceTask.value,e=new Intl.NumberFormat("en-US",{style:"currency",currency:n});return s` <span>${e.format(t/100)}</span> `}render(){return this.fetchPriceTask.render({initial:()=>s`<slot></slot>`,pending:()=>this.hideWhileLoading?s`<span class="animate-pulse">----.--</span>`:s`<slot></slot>`,complete:()=>this.hasAutomaticDiscount?this.updatedPriceHTML:s`<slot></slot>`,error:()=>s`<slot></slot>`})}};u([e({type:String,attribute:"variant-id"})],d.prototype,"variantId",2),u([e({type:String,attribute:"selling-plan-id"})],d.prototype,"sellingPlanId",2),u([e({type:Number})],d.prototype,"currentPrice",2),u([e({type:Boolean,attribute:"hide-while-loading"})],d.prototype,"hideWhileLoading",2),d=u([r("automatic-price")],d);export{d as AutomaticPrice};

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.