Submit
Path:
~
/
home
/
getwphos
/
public_html
/
almajd
/
wp-content
/
plugins
/
woocommerce
/
assets
/
client
/
blocks
/
woocommerce
/
File Content:
add-to-cart-with-options.js
import*as t from"@woocommerce/stores/woocommerce/cart";import*as e from"@wordpress/interactivity";import*as r from"@woocommerce/stores/woocommerce/product-data";var n={7908:t=>{t.exports=import("@woocommerce/stores/store-notices")},1401:e=>{e.exports=t}},a={};function o(t){var e=a[t];if(void 0!==e)return e.exports;var r=a[t]={exports:{}};return n[t](r,r.exports,o),r.exports}o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const i=(s={getContext:()=>e.getContext,store:()=>e.store},c={},o.d(c,s),c);var s,c;o.d({},{});const u=(t,e)=>Array.isArray(t)&&Array.isArray(e)&&0!==t.length&&0!==e.length&&t.find((t=>Object.entries(t.attributes).every((([t,r])=>e.some((e=>!(e.attribute!==t)&&(e.value===r||e.value&&""===r)))))))||null,l="I acknowledge that using a private store means my plugin will inevitably break on the next store release.",{state:d}=(0,i.store)("woocommerce",{},{lock:l}),m=(t,e)=>({min:"grouped"===t&&e?0:1,step:1,max:null}),p=t=>{var e;const r=(t=>{let e=null;return t.target instanceof HTMLButtonElement&&(e=t.target.parentElement?.querySelector(".qty")),t.target instanceof HTMLInputElement&&(e=t.target),e})(t);if(!r)return;const n=parseInt(r.value,10),{productType:a,productId:o,quantityConstraints:s}=(0,i.getContext)(),c=parseInt(null!==(e=r.name.match(/\[(\d+)\]/)?.[1])&&void 0!==e?e:"0",10),u=c||o,l=s?.[u]||m(a,c),d=l.min,p=l.max,v=l.step;return{currentValue:isNaN(n)?0:n,minValue:d,maxValue:p,step:v,childProductId:c,inputElement:r}},v=(t,e,r)=>{const n=d.cart?.items.find((e=>{return"variation"===e.type?!(e.id!==t||!e.variation||!r||e.variation.length!==r.length)&&(n=e,a=r,!(!Array.isArray(n.variation)||!Array.isArray(a))&&n.variation.length===a.length&&n.variation.every((({raw_attribute:t,value:e})=>a.some((r=>r.attribute===t&&(r.value.toLowerCase()===e.toLowerCase()||r.value&&""===e)))))):e.id===t;var n,a}));return(n?.quantity||0)+e},y=t=>{const e=new Event("change",{bubbles:!0});t.dispatchEvent(e)},g=(0,i.store)("woocommerce/add-to-cart-with-options",{state:{get isFormValid(){const t=(0,i.getContext)();if(!t)return!0;const{availableVariations:e,selectedAttributes:r,productType:n,quantity:a}=t;if("variable"===n){const t=u(e,r);return Boolean(t?.is_in_stock&&t?.variation_id)}return"grouped"!==n||Object.values(a).some((t=>t>0))},get variationId(){const t=(0,i.getContext)();if(!t)return null;const{availableVariations:e,selectedAttributes:r}=t,n=u(e,r);return n?.variation_id||null},get selectedAttributes(){const t=(0,i.getContext)();return t?t.selectedAttributes:[]},get allowsDecrease(){const{quantity:t,childProductId:e,productType:r,quantityConstraints:n,productId:a,availableVariations:o,selectedAttributes:s}=(0,i.getContext)(),c=u(o,s),l=c?.variation_id||e||a,d=t[l]||0,p=n?.[l]||m(r,e),v=p.min;return d-p.step>=v},get allowsIncrease(){const{quantity:t,childProductId:e,productType:r,quantityConstraints:n,productId:a,availableVariations:o,selectedAttributes:s}=(0,i.getContext)(),c=u(o,s),l=c?.variation_id||e||a,d=t[l]||0,p=n?.[l]||m(r,e),v=p.max,y=p.step;return null===v||d+y<=v}},actions:{setQuantity(t,e){const r=(0,i.getContext)();if("variable"===r.productType)r.availableVariations.map((t=>t.variation_id)).forEach((e=>{r.quantity[e]=t}));else{const n=e||r.productId;r.quantity={...r.quantity,[n]:t}}},setAttribute(t,e){const{selectedAttributes:r}=(0,i.getContext)(),n=r.findIndex((e=>e.attribute===t));n>=0?r[n]={attribute:t,value:e}:r.push({attribute:t,value:e})},removeAttribute(t){const{selectedAttributes:e}=(0,i.getContext)(),r=e.findIndex((e=>e.attribute===t));r>=0&&e.splice(r,1)},increaseQuantity:t=>{const e=p(t);if(!e)return;const{currentValue:r,maxValue:n,minValue:a,step:o,childProductId:i,inputElement:s}=e,c=r+o;if(null===n||c<=n){const t=Math.max(a,c);g.actions.setQuantity(t,i),s.value=t.toString(),y(s)}},decreaseQuantity:t=>{const e=p(t);if(!e)return;const{currentValue:r,maxValue:n,minValue:a,step:o,childProductId:i,inputElement:s}=e,c=r-o;if(c>=a){const t=Math.min(null!=n?n:1/0,c);g.actions.setQuantity(t,i),s.value=t.toString(),y(s)}},handleQuantityInput:t=>{const e=p(t);if(!e)return;const{childProductId:r,currentValue:n}=e;g.actions.setQuantity(n,r)},handleQuantityChange:t=>{const e=p(t);if(!e)return;const{childProductId:r,maxValue:n,minValue:a,currentValue:o}=e,i=Math.min(null!=n?n:1/0,Math.max(a,o));t.target.value!==i.toString()&&(g.actions.setQuantity(i,r),t.target.value=i.toString(),y(t.target))},handleQuantityCheckboxChange:t=>{const e=p(t);if(!e)return;const{inputElement:r,childProductId:n}=e;g.actions.setQuantity(r.checked?1:0,n)},*handleSubmit(t){t.preventDefault(),yield Promise.resolve().then(o.bind(o,1401));const{productId:e,quantity:r,selectedAttributes:n,productType:a,groupedProductIds:s}=(0,i.getContext)();if("grouped"===a&&s.length>0){const t=[];for(const e of s){if(0===r[e])continue;const o=v(e,r[e]);t.push({id:e,quantity:o,variation:n,type:a})}if(0===t.length){yield Promise.resolve().then(o.bind(o,7908));const{actions:t}=(0,i.store)("woocommerce/store-notices",{},{lock:"I acknowledge that using a private store means my plugin will inevitably break on the next store release."}),e=d?.errorMessages?.groupedProductAddToCartMissingItems;return void(e&&t.addNotice({notice:e,type:"error",dismissible:!0}))}const{actions:e}=(0,i.store)("woocommerce",{},{lock:l});yield e.batchAddCartItems(t)}else{const{variationId:t}=g.state,o=t||e,s=v(o,r[o],n),{actions:c}=(0,i.store)("woocommerce",{},{lock:l});yield c.addCartItem({id:o,quantity:s,variation:n,type:a})}}},callbacks:{setSelectedVariationId:()=>{const{availableVariations:t,selectedAttributes:e}=(0,i.getContext)(),r=u(t,e),{actions:n}=(0,i.store)("woocommerce/product-data",{},{lock:l}),a=r?.variation_id;n.setVariationId(null!=a?a:null)}}},{lock:!0});
Submit
FILE
FOLDER
Name
Size
Permission
Action
accordion-group-style-rtl.css
1793 bytes
0644
accordion-group-style.css
1792 bytes
0644
accordion-group.js
679 bytes
0644
add-to-cart-form-editor-rtl.css
856 bytes
0644
add-to-cart-form-editor.css
857 bytes
0644
add-to-cart-form-style-rtl.css
7150 bytes
0644
add-to-cart-form-style.css
7153 bytes
0644
add-to-cart-form.js
1016 bytes
0644
add-to-cart-with-options-editor-rtl.css
949 bytes
0644
add-to-cart-with-options-editor.css
949 bytes
0644
add-to-cart-with-options-grouped-product-item-selector-style-rtl.css
2528 bytes
0644
add-to-cart-with-options-grouped-product-item-selector-style.css
2528 bytes
0644
add-to-cart-with-options-grouped-product-item-style-rtl.css
112 bytes
0644
add-to-cart-with-options-grouped-product-item-style.css
112 bytes
0644
add-to-cart-with-options-quantity-selector-style-rtl.css
2427 bytes
0644
add-to-cart-with-options-quantity-selector-style.css
2427 bytes
0644
add-to-cart-with-options-style-rtl.css
2858 bytes
0644
add-to-cart-with-options-style.css
2860 bytes
0644
add-to-cart-with-options-variation-selector-attribute-name-style-rtl.css
186 bytes
0644
add-to-cart-with-options-variation-selector-attribute-name-style.css
186 bytes
0644
add-to-cart-with-options-variation-selector-attribute-options-style-rtl.css
2141 bytes
0644
add-to-cart-with-options-variation-selector-attribute-options-style.css
2141 bytes
0644
add-to-cart-with-options-variation-selector-attribute-options.js
3154 bytes
0644
add-to-cart-with-options.js
5827 bytes
0644
mini-cart-footer-block-editor-rtl.css
90 bytes
0644
mini-cart-footer-block-editor.css
90 bytes
0644
mini-cart.js
20673 bytes
0644
product-button-style-rtl.css
3868 bytes
0644
product-button-style.css
3867 bytes
0644
product-button.js
3107 bytes
0644
product-collection-editor-rtl.css
6962 bytes
0644
product-collection-editor.css
6960 bytes
0644
product-collection-rtl.css
232 bytes
0644
product-collection-style-rtl.css
232 bytes
0644
product-collection-style.css
232 bytes
0644
product-collection.css
232 bytes
0644
product-collection.js
2136 bytes
0644
product-elements.js
23224 bytes
0644
product-filter-active.js
838 bytes
0644
product-filter-attribute-style-rtl.css
231 bytes
0644
product-filter-attribute-style.css
232 bytes
0644
product-filter-checkbox-list-editor-rtl.css
1311 bytes
0644
product-filter-checkbox-list-editor.css
1310 bytes
0644
product-filter-checkbox-list-style-rtl.css
2253 bytes
0644
product-filter-checkbox-list-style.css
2251 bytes
0644
product-filter-checkbox-list.js
393 bytes
0644
product-filter-chips-editor-rtl.css
1063 bytes
0644
product-filter-chips-editor.css
1062 bytes
0644
product-filter-chips-style-rtl.css
1743 bytes
0644
product-filter-chips-style.css
1743 bytes
0644
product-filter-chips.js
1233 bytes
0644
product-filter-clear-button-style-rtl.css
93 bytes
0644
product-filter-clear-button-style.css
93 bytes
0644
product-filter-price-slider-style-rtl.css
6303 bytes
0644
product-filter-price-slider-style.css
6290 bytes
0644
product-filter-price-slider.js
997 bytes
0644
product-filter-price.js
2819 bytes
0644
product-filter-removable-chips-style-rtl.css
1832 bytes
0644
product-filter-removable-chips-style.css
1832 bytes
0644
product-filter-status-style-rtl.css
306 bytes
0644
product-filter-status-style.css
306 bytes
0644
product-filters-editor-rtl.css
793 bytes
0644
product-filters-editor.css
794 bytes
0644
product-filters-style-rtl.css
4896 bytes
0644
product-filters-style.css
4896 bytes
0644
product-filters.js
2963 bytes
0644
product-gallery-large-image-editor-rtl.css
224 bytes
0644
product-gallery-large-image-editor.css
224 bytes
0644
product-gallery-large-image-next-previous-editor-rtl.css
81 bytes
0644
product-gallery-large-image-next-previous-editor.css
81 bytes
0644
product-gallery-large-image.js
986 bytes
0644
product-gallery-style-rtl.css
29104 bytes
0644
product-gallery-style.css
29104 bytes
0644
product-gallery-thumbnails-editor-rtl.css
134 bytes
0644
product-gallery-thumbnails-editor.css
134 bytes
0644
product-gallery.js
6144 bytes
0644
product-reviews.js
950 bytes
0644
product-stock-indicator-style-rtl.css
110 bytes
0644
product-stock-indicator-style.css
110 bytes
0644
product-template-editor-rtl.css
180 bytes
0644
product-template-editor.css
178 bytes
0644
product-template-style-rtl.css
2117 bytes
0644
product-template-style.css
2117 bytes
0644
N4ST4R_ID | Naxtarrr