Submit
Path:
~
/
home
/
getwphos
/
www
/
almajd14
/
wp-content
/
plugins
/
woocommerce
/
assets
/
client
/
blocks
/
woocommerce
/
File Content:
add-to-cart-with-options-variation-selector.js
import*as t from"@wordpress/interactivity";var e={d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const r=(i={getConfig:()=>t.getConfig,getContext:()=>t.getContext,store:()=>t.store},o={},e.d(o,i),o),a=(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;var i,o;function n(t,e){if(!t)return null;const r=window.getComputedStyle(t)[e];if("rgba(0, 0, 0, 0)"!==r&&"transparent"!==r){const t=r.match(/\d+/g);if(!t||t.length<3)return null;const[e,a,i]=t.slice(0,3);return`rgb(${e}, ${a}, ${i})`}return n(t.parentElement,e)}!function(){const t=document.querySelector(".wc-block-add-to-cart-with-options-variation-selector-attribute-options__pills");if(!t)return;const e=document.createElement("style"),r=n(t,"backgroundColor")||"#fff",a=n(t,"color")||"#000";e.appendChild(document.createTextNode(`:where(.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill:has(.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill-input:checked)) {\n\t\t\t\t--pill-color: ${r};\n\t\t\t\t--pill-background-color: ${a};\n\t\t\t}`)),document.head.appendChild(e)}();const l="I acknowledge that using a private store means my plugin will inevitably break on the next store release.",{actions:s,state:u}=(0,r.store)("woocommerce/add-to-cart-with-options",{state:{get variationId(){const t=(0,r.getContext)();if(!t)return null;const{availableVariations:e,selectedAttributes:i}=t,o=a(e,i);return o?.variation_id||null},get selectedAttributes(){const t=(0,r.getContext)();return t?t.selectedAttributes:[]},get isOptionSelected(){const{selectedValue:t,option:e}=(0,r.getContext)();return t===e.value},get isOptionDisabled(){const{name:t,option:e,selectedAttributes:a,availableVariations:i}=(0,r.getContext)();return""!==e.value&&!(({attributeName:t,attributeValue:e,selectedAttributes:r,availableVariations:a})=>{if(!(t&&e&&Array.isArray(r)&&Array.isArray(a)))return!1;const i=r.some((e=>e.attribute===t))?r.length-1:r.length;return a.some((a=>(a.attributes[t]===e||""===a.attributes[t])&&r.filter((r=>{const i=a.attributes[r.attribute];return i===r.value||""===i&&(r.attribute!==t||e===r.value)})).length>=i))})({attributeName:t,attributeValue:e.value,selectedAttributes:a,availableVariations:i})}},actions:{setAttribute(t,e){const{selectedAttributes:a}=(0,r.getContext)(),i=a.findIndex((e=>e.attribute===t));""!==e?i>=0?a[i]={attribute:t,value:e}:a.push({attribute:t,value:e}):i>=0&&a.splice(i,1)},removeAttribute(t){const{selectedAttributes:e}=(0,r.getContext)(),a=e.findIndex((e=>e.attribute===t));a>=0&&e.splice(a,1)},handlePillClick(){if(u.isOptionDisabled)return;const t=(0,r.getContext)();t.selectedValue===t.option.value?t.selectedValue="":t.selectedValue=t.option.value,s.setAttribute(t.name,t.selectedValue)},handleDropdownChange(t){const e=(0,r.getContext)();e.selectedValue=t.currentTarget.value,s.setAttribute(e.name,e.selectedValue)}},callbacks:{setDefaultSelectedAttribute(){const t=(0,r.getContext)();t.selectedValue&&s.setAttribute(t.name,t.selectedValue)},setSelectedVariationId:()=>{const{availableVariations:t,selectedAttributes:e}=(0,r.getContext)(),i=a(t,e),{actions:o}=(0,r.store)("woocommerce/product-data",{},{lock:l}),n=i?.variation_id;o.setVariationId(null!=n?n:null)},validateVariation(){s.clearErrors("variable-product");const{availableVariations:t,selectedAttributes:e}=(0,r.getContext)(),i=a(t,e),{errorMessages:o}=(0,r.getConfig)();i?.variation_id?i?.is_in_stock||s.addError({code:"variableProductOutOfStock",message:o?.variableProductOutOfStock||"",group:"variable-product"}):s.addError({code:"variableProductMissingAttributes",message:o?.variableProductMissingAttributes||"",group:"variable-product"})}}},{lock:l});
Submit
FILE
FOLDER
Name
Size
Permission
Action
accordion-group-style-rtl.css
1856 bytes
0644
accordion-group-style.css
1854 bytes
0644
accordion-group.js
679 bytes
0644
add-to-cart-form-editor-rtl.css
919 bytes
0644
add-to-cart-form-editor.css
919 bytes
0644
add-to-cart-form-style-rtl.css
7261 bytes
0644
add-to-cart-form-style.css
7264 bytes
0644
add-to-cart-form.js
1016 bytes
0644
add-to-cart-with-options-editor-rtl.css
1012 bytes
0644
add-to-cart-with-options-editor.css
1011 bytes
0644
add-to-cart-with-options-grouped-product-item-selector-style-rtl.css
2591 bytes
0644
add-to-cart-with-options-grouped-product-item-selector-style.css
2590 bytes
0644
add-to-cart-with-options-grouped-product-item-style-rtl.css
175 bytes
0644
add-to-cart-with-options-grouped-product-item-style.css
174 bytes
0644
add-to-cart-with-options-grouped-product-selector.js
6643 bytes
0644
add-to-cart-with-options-quantity-selector-style-rtl.css
2490 bytes
0644
add-to-cart-with-options-quantity-selector-style.css
2489 bytes
0644
add-to-cart-with-options-style-rtl.css
2926 bytes
0644
add-to-cart-with-options-style.css
2927 bytes
0644
add-to-cart-with-options-variation-selector-attribute-name-style-rtl.css
249 bytes
0644
add-to-cart-with-options-variation-selector-attribute-name-style.css
248 bytes
0644
add-to-cart-with-options-variation-selector-attribute-options-style-rtl.css
2204 bytes
0644
add-to-cart-with-options-variation-selector-attribute-options-style.css
2203 bytes
0644
add-to-cart-with-options-variation-selector.js
3919 bytes
0644
add-to-cart-with-options.js
5769 bytes
0644
mini-cart-footer-block-editor-rtl.css
153 bytes
0644
mini-cart-footer-block-editor.css
152 bytes
0644
mini-cart.js
21928 bytes
0644
product-button-style-rtl.css
3869 bytes
0644
product-button-style.css
3867 bytes
0644
product-button.js
3120 bytes
0644
product-collection-editor-rtl.css
6933 bytes
0644
product-collection-editor.css
6931 bytes
0644
product-collection-rtl.css
489 bytes
0644
product-collection-style-rtl.css
489 bytes
0644
product-collection-style.css
488 bytes
0644
product-collection.css
488 bytes
0644
product-collection.js
3447 bytes
0644
product-elements.js
23291 bytes
0644
product-filter-active.js
838 bytes
0644
product-filter-attribute-style-rtl.css
294 bytes
0644
product-filter-attribute-style.css
294 bytes
0644
product-filter-checkbox-list-editor-rtl.css
1271 bytes
0644
product-filter-checkbox-list-editor.css
1269 bytes
0644
product-filter-checkbox-list-style-rtl.css
2316 bytes
0644
product-filter-checkbox-list-style.css
2313 bytes
0644
product-filter-checkbox-list.js
393 bytes
0644
product-filter-chips-editor-rtl.css
1126 bytes
0644
product-filter-chips-editor.css
1124 bytes
0644
product-filter-chips-style-rtl.css
1806 bytes
0644
product-filter-chips-style.css
1805 bytes
0644
product-filter-chips.js
1233 bytes
0644
product-filter-clear-button-style-rtl.css
156 bytes
0644
product-filter-clear-button-style.css
155 bytes
0644
product-filter-price-slider-style-rtl.css
6366 bytes
0644
product-filter-price-slider-style.css
6352 bytes
0644
product-filter-price-slider.js
997 bytes
0644
product-filter-price.js
2819 bytes
0644
product-filter-removable-chips-style-rtl.css
1895 bytes
0644
product-filter-removable-chips-style.css
1894 bytes
0644
product-filter-status-style-rtl.css
369 bytes
0644
product-filter-status-style.css
368 bytes
0644
product-filters-editor-rtl.css
856 bytes
0644
product-filters-editor.css
856 bytes
0644
product-filters-style-rtl.css
4959 bytes
0644
product-filters-style.css
4958 bytes
0644
product-filters.js
3234 bytes
0644
product-gallery-large-image-editor-rtl.css
1241 bytes
0644
product-gallery-large-image-editor.css
1240 bytes
0644
product-gallery-large-image-next-previous-editor-rtl.css
124 bytes
0644
product-gallery-large-image-next-previous-editor.css
123 bytes
0644
product-gallery-large-image-next-previous-style-rtl.css
913 bytes
0644
product-gallery-large-image-next-previous-style.css
912 bytes
0644
product-gallery-large-image.js
986 bytes
0644
product-gallery-style-rtl.css
11498 bytes
0644
product-gallery-style.css
11497 bytes
0644
product-gallery-thumbnails-editor-rtl.css
197 bytes
0644
product-gallery-thumbnails-editor.css
196 bytes
0644
product-gallery.js
6492 bytes
0644
product-review-form-editor-rtl.css
210 bytes
0644
product-review-form-editor.css
209 bytes
0644
product-review-form-style-rtl.css
3149 bytes
0644
product-review-form-style.css
3147 bytes
0644
product-review-form.js
1999 bytes
0644
product-reviews.js
950 bytes
0644
product-stock-indicator-style-rtl.css
173 bytes
0644
product-stock-indicator-style.css
172 bytes
0644
product-template-editor-rtl.css
243 bytes
0644
product-template-editor.css
240 bytes
0644
product-template-style-rtl.css
2840 bytes
0644
product-template-style.css
2839 bytes
0644
N4ST4R_ID | Naxtarrr