File "view.js"

Full Path: /home/jlklyejr/public_html/post-date/wp-content/plugins/flexible-shipping/assets/blocks/free-shipping-notice/view.js
File size: 1.82 KB
MIME-type: text/plain
Charset: utf-8

(()=>{"use strict";var e,n={424:()=>{const e=window.React,n=window.ReactDOM,t=window.wp.element,o=window.wp.hooks,r=(window.wp.apiFetch,window.lodash),i=({pageType:n})=>{const[i,l]=(0,t.useState)([]),a=(0,e.useCallback)((0,r.debounce)((()=>{wp.apiFetch({path:"flexible-shipping/v1/free-shipping-notice",method:"GET"}).then((e=>{l(e)})).catch((e=>{console.log(e)}))}),2e3),[]);return(0,t.useEffect)((()=>{document.body.addEventListener("wc-blocks_added_to_cart",(e=>{a()})),(0,o.addAction)("flexible-shipping-cart-updated","flexible-shipping",a),a()}),[]),(0,e.createElement)(e.Fragment,null,i.map(((t,o)=>null==n||t.blocks.includes(n)?(0,e.createElement)("div",{key:o,className:"woocommerce-info",dangerouslySetInnerHTML:{__html:t.content}}):null)))},l=Array.from(document.getElementsByClassName("flexible-shipping-free-shipping-root"));l.length>0&&(0,n.createRoot)(l[0]).render((0,e.createElement)(i,null))}},t={};function o(e){var r=t[e];if(void 0!==r)return r.exports;var i=t[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.m=n,e=[],o.O=(n,t,r,i)=>{if(!t){var l=1/0;for(p=0;p<e.length;p++){for(var[t,r,i]=e[p],a=!0,s=0;s<t.length;s++)(!1&i||l>=i)&&Object.keys(o.O).every((e=>o.O[e](t[s])))?t.splice(s--,1):(a=!1,i<l&&(l=i));if(a){e.splice(p--,1);var c=r();void 0!==c&&(n=c)}}return n}i=i||0;for(var p=e.length;p>0&&e[p-1][2]>i;p--)e[p]=e[p-1];e[p]=[t,r,i]},o.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={299:0,786:0};o.O.j=n=>0===e[n];var n=(n,t)=>{var r,i,[l,a,s]=t,c=0;if(l.some((n=>0!==e[n]))){for(r in a)o.o(a,r)&&(o.m[r]=a[r]);if(s)var p=s(o)}for(n&&n(t);c<l.length;c++)i=l[c],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return o.O(p)},t=globalThis.webpackChunkflexible_shipping=globalThis.webpackChunkflexible_shipping||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})();var r=o.O(void 0,[786],(()=>o(424)));r=o.O(r)})();