PageSourceSearch

https://www.aliceandolivia.com/cdn/shop/t/292/assets/core-main-product.DJvS4LKV.min.js

js aliceandolivia.com collected 2026-09-24 09:01:49 UTC 5,443 bytes, 9 lines download raw bytes

1import{a as t,B as e}from"./BaseElement.DADCq26n.min.js";import{W as r}from"./WithShopifyCart.9FllDnKL.min.js";import{f as i,g as a,x as n,T as o,a as s,t as l,n as d}from"./vendor-lit.Dzz78LSH.min.js";import"./quantity-input.CLwxaBvt.min.js";import{H as c}from"./HTMLUpdateUtility.BxXf4G1-.min.js";import"./WithApiClient.D8EqDb9L.min.js";import"./vendor.Cv8cRPQo.min.js";import"./cart-sections.BRfnt2Jk.min.js";import"./FormElement.Cf9Awtyq.min.js";import"./debounce.Bo8Joqkw.min.js";import"./LiveRegionUtility.Hp9s8h0e.min.js";import"./aria-live-region-context.DDahWXfJ.min.js";import"./vendor-floating-ui.ZL8VzMa-.min.js";import"./firstFocusableElement.CXP_yyKj.min.js";var h=Object.defineProperty,p=Object.getOwnPropertyDescriptor,u=(t,e,r,i)=>{for(var a,n=i>1?void 0:i?p(e,r):e,o=t.length-1;o>=0;o--)(a=t[o])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&h(e,r,n),n};let m=class extends(r(t)){constructor(){super(...arguments),this.error=null,this.$errorMessage=i()}async _handleFormSubmit(t){var e;try{this.error=null,t.preventDefault();const e=t.target;e&&await this.addItemToWithForm(new FormData(e)),this.openCartDrawer()}catch(r){this.error=r.errors||r.message||"An error occurred",await this.updateComplete,null==(e=this.$errorMessage.value)||e.scrollIntoView({behavior:"smooth",block:"center"})}}get errorHTML(){return this.error?n`<p
2        class="body mt-sm p-2xs text-u-error ring-u-error ring-1"
3        ${a(this.$errorMessage)}
4      >
5        ${this.error}
6      </p>`:o}render(){return n`
7      <slot @submit=${this._handleFormSubmit}></slot>
8      ${this.errorHTML}
9    `}};u([s()],m.prototype,"error",2),m=u([l("product-form")],m);Object.getOwnPropertyDescriptor;const g="variant-picker:change";let v=class extends e{connectedCallback(){super.connectedCallback(),this._handleOptionChange=this._handleOptionChange.bind(this),this.addEventListener("change",this._handleOptionChange)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",this._handleOptionChange)}getValueFromTarget(t){var e;switch(t.tagName){case"SELECT":return t.selectedOptions[0];case"CUSTOM-SELECT":return null==(e=t.getSelectedOptionByValue(t.value))?void 0:e.el;default:return t}}getVariantIdFromCustomSelect(t){const e=t.getSelectedOptionByValue(t.value);if(e)return e.el.dataset.variantId}getProductUrlFromCustomSelect(t){const e=t.getSelectedOptionByValue(t.value);if(e)return e.el.dataset.productUrl}_handleOptionChange(t){t.stopPropagation();const e=t.target,r=this.getValueFromTarget(e)||e,i="CUSTOM-SELECT"===e.tagName?this.getVariantIdFromCustomSelect(e):r.dataset.variantId,a="CUSTOM-SELECT"===e.tagName?this.getProductUrlFromCustomSelect(e):r.dataset.productUrl;e&&this.$emit(g,{event:t,target:r,variantId:i,productUrl:a,selectedOptionValues:this.selectedOptionValues})}get selectedOptionValues(){return Array.from(this.querySelectorAll("select, fieldset input:checked")).map(({dataset:t})=>t.optionValueId).filter(Boolean)}};v=((t,e)=>{for(var r,i=e,a=t.length-1;a>=0;a--)(r=t[a])&&(i=r(i)||i);return i})([l("variant-picker")],v);var C=Object.defineProperty,y=Object.getOwnPropertyDescriptor,U=(t,e,r,i)=>{for(var a,n=i>1?void 0:i?y(e,r):e,o=t.length-1;o>=0;o--)(a=t[o])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&C(e,r,n),n};let b=class extends e{constructor(){super(...arguments),this.$htmlUpdateUtility=new c(this),this.reactiveToCart=!1}connectedCallback(){super.connectedCallback(),this.handleVariantPickerChange=this.handleVariantPickerChange.bind(this),this.handleCartUpdated=this.handleCartUpdated.bind(this),this.addEventListener(g,this.handleVariantPickerChange),this.$htmlUpdateUtility.addPostProcessCallback(()=>{var t,e;null==(e=null==(t=null==window?void 0:window.Shopify)?void 0:t.PaymentButton)||e.init()}),this.reactiveToCart&&document.addEventListener("cart:updated",this.handleCartUpdated)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(g,this.handleVariantPickerChange),this.reactiveToCart&&document.removeEventListener("cart:updated",this.handleCartUpdated)}updateURL(t){this.shouldUpdateUrl&&t&&window.history.replaceState({},"",t)}handleVariantPickerChange(t){const e=t.detail.productUrl,r=t.detail.variantId,i=t.detail.sellingPlan;r&&""!==r.trim()&&(this.updateURL(e??""),e&&""!==e&&e!==this.productUrl&&(this.productUrl=e),this.updateSection(!0,e||this.productUrl,r,i))}updateSection(t=!0,e,r,i){return this.$htmlUpdateUtility.fetchAndReplaceSectionId({renderRoot:this,sectionId:this.sectionId,baseUrl:e,params:{...r&&""!==r?{variant:r}:{},...i&&""!==i?{selling_plan:i}:{},...this.view?{view:this.view}:{},...this._cacheKey?{_cache:this._cacheKey}:{}},withCache:t,filterHTML:t=>this.replaceUid?t.replace(/###uid###/g,this.replaceUid):t}).catch(t=>{if(t instanceof Error)throw t})}handleCartUpdated(){this.$htmlUpdateUtility.flushCache(),this._cacheKey=(new Date).getTime().toString(),this.updateSection(!1,this.productUrl)}};U([d({type:String,attribute:"section-id"})],b.prototype,"sectionId",2),U([d({type:String,attribute:"product-url"})],b.prototype,"productUrl",2),U([d({type:String,attribute:"view"})],b.prototype,"view",2),U([d({type:String,attribute:"update-url",converter:t=>"true"===t})],b.prototype,"shouldUpdateUrl",2),U([d({type:Boolean,attribute:"reactive-to-cart",converter:t=>"true"===t})],b.prototype,"reactiveToCart",2),U([d({type:String,attribute:"replace-uid"})],b.prototype,"replaceUid",2),b=U([l("main-product")],b);export{b as MainProduct};

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.