1function W(){const{registerCheckoutFilters:c}=wc.blocksCheckout,{select:l}=wp.data;c("advanced-coupons-extension",{coupons:a=>{const n=l("wc/store/cart").getCartData(),{acfwp_block:t}=n.extensions;return a.map(o=>{let s=t.coupons.find(i=>i.code===o.code);return{...o,label:s.label?s.label:o.label}})}})}function Y(){const{subscribe:c,select:l}=wp.data;c(()=>{const a=l("wc/store/cart"),p=a.getCartData(),{acfwp_block:n}=p.extensions;if(a.isApplyingCoupon()){const o=a.getCouponBeingApplied();n.coupons.find(i=>i.code===o&&i.force_apply)&&jQuery(".wc-block-components-notices").hide()}})}const C={ACFWP_NOTICE_ONE_CLICK_APPLY:"ACFWP_NOTICE_ONE_CLICK_APPLY",ACFWP_NOTICE_NON_QUALIFYING:"ACFWP_NOTICE_NON_QUALIFYING"},{dispatch:E,useSelect:O}=wp.data,{Fragment:P,useEffect:F,useState:g}=wp.element;var y,b;const w=(b=(y=wp.htmlEntities)==null?void 0:y.decodeEntities)!=null?b:c=>c,x=()=>{var f;const c="acfw/notices",{StoreNotice:l,StoreNoticesContainer:a}=wc.blocksCheckout,[p,n]=g([]),[t,o]=g(""),s=O(e=>{var u,_,N;const r=e("wc/store/cart").getCartData();return(N=(_=(u=r==null?void 0:r.extensions)==null?void 0:u.acfwp_block)==null?void 0:_.one_click_apply)!=null?N:null}),i=(f=s==null?void 0:s.notices)!=null?f:[],d=i.map(e=>e.code),k=d.join("|");F(()=>{n(e=>{const r=e.filter(u=>d.includes(u));return r.length===e.length?e:r})},[k]);const h=e=>{o(e),E("wc/store/cart").applyCoupon(e).then(()=>{E("core/notices").createNotice("success",s.on_apply_success.replace("{coupon_code}",e),{type:"snackbar",context:c,id:C.ACFWP_NOTICE_ONE_CLICK_APPLY})}).finally(()=>o(""))};return React.createElement(P,null,i.filter(e=>!p.includes(e.code)).map(e=>{const r=w(e.message),u=w(e.button_text);return React.createElement(l,{key:e.code,status:e.type,spokenMessage:"".concat(r," ").concat(u),onRemove:()=>n(_=>[..._,e.code])},r," ",React.createElement("button",{type:"button",className:"acfw_apply_notification button",value:e.code,disabled:t===e.code,onClick:()=>h(e.code)},u))}),React.createElement(a,{context:c}))},{dispatch:m,useSelect:L}=wp.data,{useEffect:R,useRef:$}=wp.element;var I,A;const T=(A=(I=wp.htmlEntities)==null?void 0:I.decodeEntities)!=null?A:c=>c,S=()=>{const c="acfw/non-qualifying-notices",{StoreNoticesContainer:l}=wc.blocksCheckout,a=$([]),p=L(n=>{var o,s,i,d;const t=n("wc/store/cart").getCartData();return(d=(i=(s=(o=t==null?void 0:t.extensions)==null?void 0:o.acfwp_block)==null?void 0:s.non_qualifying)==null?void 0:i.notices)!=null?d:[]});return R(()=>{const n=p.map(t=>"".concat(C.ACFWP_NOTICE_NON_QUALIFYING,"_").concat(t.id));a.current.forEach(t=>{n.includes(t)||m("core/notices").removeNotice(t,c)}),p.forEach(t=>{m("core/notices").createNotice(t.type,T(t.message),{context:c,id:"".concat(C.ACFWP_NOTICE_NON_QUALIFYING,"_").concat(t.id)})}),a.current=n},[JSON.stringify(p)]),React.createElement(l,{context:c})};function D(){const{registerPlugin:c}=wp.plugins,{ExperimentalOrderMeta:l}=wc.blocksCheckout;c("acfw-notices",{render:()=>React.createElement(l,null,React.createElement(x,null),React.createElement(S,null)),scope:"woocommerce-checkout"})}export{W as C,Y as a,D as r};
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.