1"use strict";(globalThis.webpackChunkwoo_commerce_com=globalThis.webpackChunkwoo_commerce_com||[]).push([[4258],{2950(e,t,r){var c=r(5556),o=r.n(c),i=r(1386),n=r(4164),s=r(7562),a=r(2470),d=r(8221),l=r.n(d),u=r(6030),m=r(6452),p=r(8569),_=r(7153),w=r(3871),h=r(3709),b=r(2425),v=r(4460),g=r(1971),P=r(3713),f=r(1047);function S(e){const{postType:t}=e,r=(0,s.useSelect)((e=>e(v.M).getFreemiumTypeSelected()),[]),c=(0,s.useSelect)((e=>{if("free"===r){const t=e(v.M).getLinkedProduct();if(t)return t}return e(v.M).getProduct()}),[r]),o=(0,s.useSelect)((e=>e(v.M).getSubscriptionPlan()),[]),d=(0,s.useSelect)((e=>e(v.M).getSubscriptionPlans()),[]),{regularPrice:g,currentPrice:S,currencySymbol:y,currencyCode:x,currencyPosition:k,isInStock:T,isOnSale:E,isTheme:j,locale:A,buyNowText:N,labelTextOverride:I,productUrl:L,productType:D,billingPeriod:F,billingPeriodInterval:O,trialLength:U,trialPeriod:C,isShippable:M,isSaaSProduct:R,icon:B,productId:$,productName:q,productSlug:Y,vendorId:V,vendorName:z,vendorUrl:H,isBusinessService:G,isEstimatedPrice:Q,productPageUrl:J}=c,[K,W]=(0,i.useState)("hidden"),X=(0,w.iT)(L),{width:Z}=(0,h.A)(),ee=1024<=Z,te=(0,i.useRef)(null);let re;S&&0!==Number(S)||(re=!0);const ce=(0,i.useCallback)((()=>{if(ee)return void W("hidden");const e=_.A.elementInView(".wccom-product-box-main-cta__actions .wccom-product-add-to-cart-button .wccom-button");W(e?"hidden":null)}),[ee]);(0,i.useEffect)((()=>{if("documentation"===t){W(null);const e=document.querySelector(".wccom-documentation-categories"),t=new MutationObserver((t=>{t.forEach((t=>{if("attributes"===t.type){const t=e.classList.contains("wccom-documentation-categories-mobile");W(t?"hidden":null)}}))}));return t.observe(e,{attributes:!0}),()=>{t.disconnect()}}if("product"===t){const e=l()(ce,50);return window.addEventListener("scroll",e,{passive:!0}),()=>{window.removeEventListener("scroll",e)}}}),[t,ee,ce]),(0,i.useEffect)((()=>{const e=new f("wccom-product-sticky-bottom-bar-toggle",{detail:{isStickyBarVisible:"hidden"!==K}});document.dispatchEvent(e)}),[K]),(0,i.useEffect)((()=>{if(K)document.body.style.removeProperty("padding-bottom");else{const e=te.current.offsetHeight;document.body.style.setProperty("padding-bottom",`${e}px`)}}),[K,Z]),(0,b.A)({isElementVisible:"hidden"!==K,elementSelector:".wccom-product-sticky-bottom-bar"});const oe="external"===D,ie=d?.[o],ne=ie?.isTrial?(0,a.sprintf)((0,a.__)("Start %d-day free trial","wccom"),ie.trialLengthDays||U||14):N,se=(0,n.A)({"wccom-product-sticky-bottom-bar":!0,"wccom-product-sticky-bottom-bar--is-external":oe,"wccom-product-sticky-bottom-bar--is-free":!S});return(0,P.jsx)("div",{className:(0,n.A)(se,K),ref:te,children:(0,P.jsxs)("div",{className:"wccom-product-sticky-bottom-bar__container",children:[(0,P.jsxs)("div",{className:"wccom-product-sticky-bottom-bar__left",children:[B&&(0,P.jsx)("img",{className:"wccom-product-sticky-bottom-bar__icon",src:B,alt:"",loading:"lazy"}),(0,P.jsx)(m.A,{isShippable:M,productId:$,productName:q,productSlug:Y,vendorId:V,vendorName:z,vendorUrl:H,productPageUrl:J,titleAsLink:"documentation"===t})]}),(0,P.jsx)("div",{className:(0,n.A)("wccom-product-sticky-bottom-bar__right",E&&"is-on-sale"),children:null!=g&&(0,P.jsx)(u.A,{currentPrice:S,regularPrice:g,currencySymbol:y,currencyCode:x,currencyPosition:k,isInStock:T,isOnSale:E,isTheme:j,isFree:re,showFree:!0,isSubscription:"subscription"===e.productType,billingPeriod:F,billingPeriodInterval:O,trialLength:U,trialPeriod:C,labelTextOverride:I,isShippable:M,isSaaSProduct:R,isExternal:oe,isBusinessService:G,isEstimatedPrice:Q})}),(0,P.jsx)(p.A,{className:"wccom-product-sticky-bottom-bar__button",href:X,text:ne,isDisabled:!1===T,isExternal:oe,isSaaSProduct:R,locale:A,position:"sticky_bottom",buttonSize:"medium",source:"product_sticky_bottom_bar",pageType:t})]})})}S.propTypes={postType:o().oneOf(["product","documentation"])},g.y.add("product-sticky-bottom-bar",S)},4460(e,t,r){r.d(t,{M:()=>i});var c=r(7562);const o={currentProduct:JSON.parse(wccomCurrentProduct),linkedProduct:"undefined"!=typeof wccomLinkedProduct?JSON.parse(wccomLinkedProduct):void 0,wccomSubscriptionPlan:"undefined"!=typeof wccomSubscriptionPlan?JSON.parse(wccomSubscriptionPlan):{}},i=(0,c.createReduxStore)("wccom/product",{reducer(e=o,t){switch(t.type){case"UPDATE_PRODUCT_FIELD":return{...e,currentProduct:{...e.currentProduct,[t.field]:t.value}};case"UPDATE_PRODUCT_FIELDS":return{...e,currentProduct:{...e.currentProduct,...t.fields}};case"UPDATE_REVIEWS_DATA":return{...e,currentProduct:{...e.currentProduct,reviewsData:{...e.currentProduct.reviewsData,...t.reviewsData}}};case"UPDATE_LINKED_PRODUCT_FIELD":return{...e,linkedProduct:{...e.linkedProduct,[t.field]:t.value}};case"SET_FREEMIUM_TYPE_SELECTED":return{...e,freemiumTypeSelected:t.freemiumType};default:return e}},actions:{setProductField:(e,t)=>({type:"UPDATE_PRODUCT_FIELD",field:e,value:t}),setProductFields:e=>({type:"UPDATE_PRODUCT_FIELDS",fields:e}),updateReviewsData:e=>({type:"UPDATE_REVIEWS_DATA",reviewsData:e}),setLinkedProductField:(e,t)=>({type:"UPDATE_LINKED_PRODUCT_FIELD",field:e,value:t}),setFreemiumTypeSelected:e=>({type:"SET_FREEMIUM_TYPE_SELECTED",freemiumType:e})},selectors:{getProduct(e){const{currentProduct:t}=e;return t},getLinkedProduct(e){const{linkedProduct:t}=e;return t},getFreemiumTypeSelected:e=>e.freemiumTypeSelected,shouldShowMonthlyPricing(e,t,r){const{currentProduct:c}=e,{isInStock:o,isShippable:i,currentPrice:n,billingPeriod:s,billingPeriodInterval:a}=c,d=!n||0===Number(n);return!(!1===o||d&&t||r||i||s&&"year"!==s||a&&1!==a)},isPaid(e){const{currentProduct:t}=e,r=t.currentPrice;return Boolean(r)&&0<Number(r)},isFreemium(e){const{currentProduct:t}=e;return t.isFreemium},getSubscriptionPlans(e){var t;return null!==(t=e.wccomSubscriptionPlan)&&void 0!==t?t:{}},getSubscriptionPlan(e){var t;const{currentProduct:r}=e;return null!==(t=r?.subscriptionPlan)&&void 0!==t?t:wccomSubscriptionDefaultPlan}},resolvers:{}});(0,c.register)(i)},4535(e,t,r){r.d(t,{$k:()=>s,Dq:()=>d,F:()=>n,hT:()=>i,rd:()=>a});var c=r(5889),o=r(963);function i(){return(0,o.Ri)(c.st)}function n(){return(0,o.Ri)(c.IS)}function s(e){c.Iy===e&&((0,o.Yj)("gaUserTypeShort"),(0,o.Yj)("gaUserTypeLong"),(0,o.Yj)("tk_ai"),(0,o.Yj)("woo_tk_ai")),(0,o.TV)(c.st,e,c.Yj)}function a(e){(0,o.TV)(c.IS,e,c.Yj)}function d(e){if(!["analytics","advertising"].includes(e))throw new Error("Unrecognised cookie consent type "+e);const t=(0,o.Ri)(`wccom_cookie_consent_${e}`);if(c.Iy===t)return!1;if("advertising"===e&&c.aI!==t){if(document.body.classList.contains("gdpr"))return!1;if(document.body.classList.contains("us"))return!1;if(navigator?.globalPrivacyControl)return!1}return!0}const l={canTrackUser:d};window.wccom=window.wccom||{},window.wccom=Object.assign(window.wccom,l)},4811(e,t,r){r.d(t,{G:()=>i});var c=r(1386),o=r(3709);const i=({shouldScrollOnDesktop:e=!0}={})=>{const[t,r]=(0,c.useState)(!1),{width:i}=(0,o.A)(),n=1024<=i;return(0,c.useEffect)((()=>
1{if(!e||!n)return;const t=()=>r(!0),c=()=>r(!1);return document.addEventListener("keydown",t),document.addEventListener("mousedown",c),()=>{document.removeEventListener("keydown",t),document.removeEventListener("mousedown",c)}}),[e,n]),{handleFocus:(0,c.useCallback)((()=>{e&&t&&n&&window.scrollTo({top:0,behavior:"smooth"})}),[e,t,n]),isUsingKeyboard:t}}},5889(e,t,r){r.d(t,{IS:()=>o,Iy:()=>s,Yj:()=>i,aI:()=>n,st:()=>c});const c="wccom_cookie_consent_analytics",o="wccom_cookie_consent_advertising",i=365,n="granted",s="denied"},6030(e,t,r){r.d(t,{A:()=>_});var c=r(5556),o=r.n(c),i=r(2470),n=r(7562),s=r(2414),a=r(7153),d=r(4460),l=r(8402),u=r(4222),m=r(3713);function p(e){const{currentPrice:t=0,regularPrice:r,currencySymbol:c="$",currencyCode:o,currencyPosition:p,isInStock:_,isOnSale:w,isTheme:h,isFree:b,isSubscription:v=!1,billingPeriod:g="year",billingPeriodInterval:P=1,showFree:f=!1,yearlyPriceOnly:S=!1,position:y,trialPeriod:x,trialLength:k,labelTextOverride:T="",isShippable:E=!1,isExternal:j,isSaaSProduct:A,isBusinessService:N,isEstimatedPrice:I=!1}=e,L=(0,n.useSelect)((e=>e(d.M).shouldShowMonthlyPricing(f,S)),[]),D=(0,n.useSelect)((e=>e(d.M).getSubscriptionPlans()),[]),F=(0,n.useSelect)((e=>e(d.M).getSubscriptionPlan()),[]),O=(0,n.useSelect)((e=>e(d.M).isFreemium()),[]),U=wccomSubscriptionDefaultPlan===F,C=T&&(j||A),M=!C&&!j&&!A&&U;if(!1===_&&!C)return(0,m.jsx)("div",{className:"wccom-product-price wccom-product-price--is-out-of-stock",children:(0,m.jsx)("span",{className:"wccom-product-price__current",children:(0,i.__)("Unavailable","wccom")})});if(b&&!C&&!N){if(f){const e=O?(0,i.__)("Free to install","wccom"):(0,i.__)("No payment details required ⢠Set up in minutes","wccom");return(0,m.jsx)("div",{className:"wccom-product-price",children:(0,m.jsx)("span",{className:"wccom-product-price__current",children:e})})}return null}const R=(0,u.AQ)(t,c,o,p),B=(0,u.AQ)(r,c,o,p),$=(0,u.AQ)(a.A.roundedMonthlyPrice(t),c,o,p),q=(0,u.AQ)(a.A.roundedMonthlyPrice(r,(()=>{const e=D[F]?.period||"year",t=D[F]?.interval||1;let r=t;return"year"===e&&(r=12*t),r})()),c,o,p),Y=L?$:R,V=L?q:B,z=!(w&&L||E),H=D?.[F],G=H&&!H.isTrial&&1>H.priceFactor,Q=(()=>{const e=(0,u.BR)(g,P,R);return H?.isTrial&&x&&k?(0,i.sprintf)((0,i.__)("%1$d-day free trial, then %2$s.","wccom"),Number(k),e):e})();return(0,m.jsxs)("div",{className:"wccom-product-price",children:[C&&(0,m.jsx)("div",{className:"wccom-product-price__label-text-override",children:T}),!U&&(0,m.jsxs)("div",{className:"wccom-product-price__subs-plan",children:[G&&(0,m.jsx)(l.A,{content:(0,i.sprintf)((0,i.__)("Save %1$d%%","wccom"),(0,u._P)(H)),size:"small",color:"dark-green",variant:"square"}),(0,m.jsxs)("span",{children:[(0,m.jsx)("span",{className:"screen-reader-text",children:` ${Q}`}),(0,m.jsx)("span",{"aria-hidden":!0,children:` ${Q}`})]})]}),M&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("span",{className:"wccom-product-price__current-previous",children:[w&&(0,m.jsx)(l.A,{content:(0,i.__)("Sale","wccom"),size:"small",color:"dark-green",variant:"square"}),(0,m.jsx)("span",{className:"screen-reader-text",children:(0,i.sprintf)(I?w?(0,i.__)("Estimated Sale Price %s","wccom"):(0,i.__)("Estimated Price %s","wccom"):w?(0,i.__)("Sale Price %s","wccom"):(0,i.__)("Price %s","wccom"),Y)}),(0,m.jsx)("span",{"aria-hidden":"true",className:"wccom-product-price__current",children:w?`${Y} `:Y}),w&&B&&(0,m.jsxs)("span",{className:"wccom-product-price__previous",children:[(0,m.jsx)("span",{className:"screen-reader-text",children:(0,i.sprintf)((0,i.__)("Regular Price %s","wccom"),V)}),(0,m.jsx)("span",{"aria-hidden":"true",children:V})]}),L&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("span",{className:"screen-reader-text",children:(0,i.__)("Per month","wccom")}),(0,m.jsx)("span",{className:"wccom-product-price__monthly-text","aria-hidden":"true",children:` ${(0,i.__)("monthly","wccom")}`})]}),z&&(0,m.jsx)("span",{className:"wccom-product-price__regular-billing-period",children:` ${(0,u.BR)(g,P,L?B:void 0)}`})]}),(0<parseInt(r)||h)&&(0,m.jsx)(s.A,{currentPriceToDisplay:R,monthlyPricing:L,billingPeriod:g,isOnSale:w,isSubscription:v,billingPeriodInterval:P,regularPriceToDisplay:B,trialPeriod:x,trialLength:k,position:y,isShippable:E,tooltipArrowPosition:"right",showBillingPeriod:v&&!z})]}),I&&M&&(0,m.jsx)("p",{className:"wccom-price-estimate-footnote",children:(0,i.__)("Prices vary by billing country. Confirmed at checkout.","wccom")})]})}p.propTypes={currentPrice:o().oneOfType([o().number,o().string]),regularPrice:o().oneOfType([o().number,o().string]).isRequired,currencySymbol:o().string,currencyCode:o().string,currencyPosition:o().oneOf(["left","right","left_space","right_space"]),isInStock:o().bool,isOnSale:o().bool,isTheme:o().bool,isFree:o().bool,yearlyPriceOnly:o().bool,isSubscription:o().bool,billingPeriod:o().string,billingPeriodInterval:o().number,showFree:o().bool,position:o().string,labelTextOverride:o().string,isSaaSProduct:o().bool,isShippable:o().bool,isExternal:o().bool,trialLength:o().number,trialPeriod:o().string,isBusinessService:o().bool,isEstimatedPrice:o().bool};const _=p},6452(e,t,r){r.d(t,{A:()=>d});var c=r(4164),o=r(2470),i=r(1386),n=r(3871),s=r(8402),a=r(3713);const d=function(e){const{className:t,isMainPageHeader:r,isShippable:d,productId:l,productName:u,productPageUrl:m="https://wordpress.org/",productSlug:p,titleAsLink:_=!1,vendorId:w,vendorName:h,vendorUrl:b,isTrending:v=!1}=e;let g;const P=r?"h1":"div";
1return g=!0===_?(0,a.jsx)(P,{className:"wccom-product-title__product-name",children:(0,a.jsx)("a",{className:"wccom-product-title__product-name_link",href:m,children:(0,n.iT)(u)})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(P,{className:"wccom-product-title__product-name",children:(0,n.iT)(u)}),v&&(0,a.jsx)(s.A,{content:(0,o.__)("Trending","wccom"),icon:"arrow-trend-up",color:"light-green",size:"medium"})]}),(0,a.jsxs)("div",{className:(0,c.A)("wccom-product-title",t),children:[g,h&&!d&&(0,a.jsx)("div",{className:"wccom-product-title__vendor",children:(0,i.createInterpolateElement)((0,o.sprintf)((0,o.__)("by <a>%s</a>","wccom"),(0,n.iT)(h)),{a:b?(0,a.jsx)("a",{href:b,"data-tracks":"product_page_vendor_link","data-tracks-vendor_name":h,"data-tracks-vendor_id":w,"data-tracks-product_id":l,"data-tracks-product_slug":p,target:"_blank",rel:"noreferrer"}):(0,a.jsx)("span",{className:"wccom-product-title__vendor_without-url"})})})]})}},6518(e,t,r){r.d(t,{bE:()=>i,dt:()=>n,je:()=>s});var c=r(2842),o=r.n(c);function i(e,t=1,r){return o()({path:"/wc/store/v1/cart/add-item",method:"POST",data:(()=>{const c={id:e,quantity:t};return r&&wccomSubscriptionDefaultPlan!==r&&(c["_wccom-subscription-plan"]=r),c})(),cache:"no-store",headers:{Nonce:wccom.storeAPI.nonce,Accept:"application/json"}})}function n(e){return o()({path:"/wc/store/v1/cart/remove-item?key="+e,method:"POST",cache:"no-store",headers:{Nonce:wccom.storeAPI.nonce,Accept:"application/json"}})}function s(){return o()({path:"/wc/store/v1/cart/items",method:"GET",cache:"no-store",headers:{Nonce:wccom.storeAPI.nonce,Accept:"application/json"}})}},7712(e,t,r){r.d(t,{A:()=>h});var c=r(2470),o=r(1386),i=r(4164),n=r(4708),s=r.n(n),a=r(7562),d=r(6448),l=r(6736),u=r(4763),m=r(5336),p=r(1213),_=r.n(p),w=r(3713);const h=e=>{const{popoverId:t,className:r,triggerButtonFaIcon:n="",triggerButtonIconColor:p=_().grey80,triggerButtonAriaLabel:h,triggerButtonText:b,triggerButtonContent:v,popoverTitle:g="",children:P,footerLink:f="",footerTitle:S="",hiddenTitle:y=!1,position:x="top",anchorPosition:k="center",trigger:T,isOpen:E,onClose:j,disableHover:A}=e,[N,I]=(0,o.useState)(!1),L=(0,a.select)(d.store).isViewportMatch("< medium"),D=(0,o.useRef)(void 0),F=(0,o.useRef)(null),O="wccom-popover--hover",U=Boolean(T),C=U?Boolean(E):N;(0,o.useEffect)((()=>()=>clearTimeout(D.current)),[]);const M=(0,o.useCallback)((()=>{U&&j?j():U||I(!1)}),[U,j]);return(0,o.useEffect)((()=>((0,u.on)("popover_link_button_click",M),()=>(0,u.T)("popover_link_button_click",M))),[M]),(0,o.useEffect)((()=>{if(!C||L)return;let e;const t=requestAnimationFrame((()=>{window.addEventListener("scroll",M,{passive:!0}),e=()=>window.removeEventListener("scroll",M)}));return()=>{cancelAnimationFrame(t),e?.()}}),[C,L]),(0,w.jsxs)("div",{className:(0,i.A)("wccom-popover",r,L&&"is-mobile"),onMouseEnter:function(){A||(D.current&&clearTimeout(D.current),F.current?.classList.add(O))},onMouseLeave:function(){A||(D.current=setTimeout((()=>{F.current?.classList.remove(O)}),200))},ref:F,children:[U&&T?(0,o.cloneElement)(T,{"aria-expanded":C?"true":"false","aria-controls":t}):(0,w.jsxs)(l.A,{isLink:!0,id:`${t}--open-button`,"aria-label":h,"aria-expanded":C?"true":"false",className:(0,i.A)("wccom-popover__button",b&&"wccom-popover__button--has-text"),onClick:()=>{U||I(!0)},children:[b&&b,n&&(0,w.jsx)(m.A,{icon:n,size:"small",color:p,className:"wccom-popover__button--icon"}),v&&v]}),(0,w.jsx)("div",{className:(0,i.A)(L&&C&&"wccom-popover__mobile-overlay"),children:(0,w.jsx)(s(),{active:C,focusTrapOptions:{clickOutsideDeactivates:!0,onPostDeactivate:M},children:(0,w.jsxs)("dialog",{id:t,"aria-labelledby":`${t}--title`,className:(0,i.A)("wccom-popover__dialog","bottom"===x&&"wccom-popover__dialog--bottom","left"===k&&"wccom-popover__dialog--left"),open:C,children:[(0,w.jsxs)("div",{className:"wccom-popover__header",children:[(0,w.jsx)(l.A,{isLink:!0,id:`${t}--close-button`,className:"wccom-popover__close","aria-label":(0,c.__)("Close dialog","wccom"),onClick:M,children:(0,w.jsx)(m.A,{icon:"xmark",color:"#000"})}),(0,w.jsx)("h2",{id:`${t}--title`,className:(0,i.A)("wccom-popover__title",y&&"screen-reader-text"),children:g})]}),(0,w.jsxs)("div",{className:"wccom-popover__content",role:"document",children:[P,f&&S&&(0,w.jsx)(w.Fragment,{children:(0,w.jsx)("a",{href:f,target:"_blank",rel:"noreferrer",className:"wccom-popover__footer-link",children:S})})]})]})})})]})}},8569(e,t,r){r.d(t,{A:()=>x});var c=r(2470),o=r(1386),i=r(7562),n=r(4164),s=r(5556),a=r.n(s);const d=wp.hooks;var l=r(2842),u=r.n(l),m=r(6736),p=r(4460),_=r(4811),w=r(5336),h=r(6518),b=r(4763),v=r(7712),g=r(5685),P=r(4535),f=r(963);var S=r(3713);const y=e=>{const{className:t,text:r=(0,c.__)("Buy now","wccom"),href:s,locale:a,position:l,source:y,isTrending:x,isDisabled:k,isExternal:T,tracksEvent:E,isSaaSProduct:j,isBusinessService:A,buttonSize:N="large",async:I=!0,productId:L,isPrimary:D=!0,isCartButton:F=!1,pageType:O="product"}=e,[U,C]=(0,o.useState)(!1),[M,R]=(0,o.useState)(r),[B,$]=(0,o.useState)(s),[q,Y]=(0,o.useState)(!1),V=(0,o.useRef)(null),z=(0,i.useSelect)((e=>e(p.M).getProduct()),[]),H=(0,i.useSelect)((e=>e(p.M).getSubscriptionPlan()),[]),G=(0,i.useSelect)((e=>e(p.M).getFreemiumTypeSelected()),[]),Q=(0,i.useSelect)((e=>e(p.M).getSubscriptionPlans()),[]),J=(0,i.useSelect)((e=>e(p.M).isFreemium()),[]),K=(0,i.useSelect)((e=>e(p.M).isPaid()),[]),W=(0,i.useSelect)((e=>e(g.M).getDefaultCurrency()),[])||"USD",X="product_main_cta"===l&&D&&!F&&!J&&0===Object.keys(Q).length,{handleFocus:Z}=(0,_.G)({shouldScrollOnDesktop:X});(0,o.useEffect)((()=>{R(r)}),[r,G]),(0,o.useEffect)((()=>{$(function({href:e,isBusinessService:t,isExternal:r,isSaaSProduct:c,subscriptionPlan:o,defaultSubscriptionPlan:i,currentLocationHref:n}){let s=e;if(t&&r){const t=new URL(e);if(t.searchParams.get("wccom"))if((0,P.Dq)("analytics")){const e=(0,f.Ri)("woo_tk_ai");e&&(t.searchParams.set("wccom-tk-id",e),s=t.toString())}else t.searchParams.delete("wccom"),s=t.toString()}if(r||c)return s;const a=null!=n?n:"undefined"!=typeof window?window.location.href:null;if(!a)return s;const d=new URL(s,a);return o&&i!==o?d.searchParams.set("_wccom-subscription-plan",o):d.searchParams.delete("_wccom-subscription-plan"),d.toString()}({href:s,isBusinessService:A,isExternal:T,isSaaSProduct:j,subscriptionPlan:H,defaultSubscriptionPlan:wccomSubscriptionDefaultPlan}))}),[s,A,T,j,H]);const ee=!F&&J&&"free"===G;(0,o.useEffect)((()=>{R(F||K||J||T||j?ee?(0,c.__)("Add to store","wccom"):r:(0,c.__)("Install for free","wccom"))}),[r,G,J,ee,R,F,K,T,j]);const te=ee||!K&&D&&!T&&!j,re=I&&L,ce=e=>{if(U||C(!0),T||j);else if(!K&&D){e.preventDefault();const t=new URL(document.location.toString()).searchParams.get("wccom-site");!function(e,t,r,c=null){e?window.location.assign(r):u()({path:"helper/1.0/create-order",method:"POST",data:{product_id:t}}
1).then((e=>{const t=e.data.order;dataLayer.push({event:"visitor interaction",interaction_name:"transaction confirmation",net_revenue:t.netRevenue,ecommerce:{currencyCode:wccomGTMEE.currencyCode,purchase:{actionField:{id:t.number,affiliation:t.methodOfPayment,revenue:t.total,tax:t.tax,shipping:t.shippingTotal,coupon:t.coupon},products:t.products}}}),r=new URL(e.data.install_url),c&&r.searchParams.set("wccom-site",c),window.location.assign(r)})).catch((()=>{const e=new URL(window.location.href);e.searchParams.set("add-to-cart",t.toString()),e.searchParams.set("redirect-to-checkout","1"),window.location.assign(e.search)}))}(z.hasAvailableSubscriptions,z.productId,z.installUrl,t)}else re&&(e.preventDefault(),(0,h.bE)(L,void 0,H).then((()=>{C(!0),R((0,c.__)("Added to cart","wccom")),(0,b.h)("wccom_product_added_to_cart",{productId:L,source:y,position:l,isPaid:K,isInApp:Boolean(z.isInApp),cartMethod:"ajax"}),Y(!0),setTimeout((()=>{R((0,c.__)("Add another","wccom"))}),1e4)})).catch((()=>{const e=new URL(window.location.href);e.searchParams.set("add-to-cart",L),H&&wccomSubscriptionDefaultPlan!==H&&e.searchParams.set("_wccom-subscription-plan",H),window.location.assign(e.search)})).finally((()=>{C(!1)})));!function(e){let t,r,c=!1;function o(){c||(c=!0,void 0!==t&&(window.cancelAnimationFrame(t),t=void 0),void 0!==r&&(window.cancelAnimationFrame(r),r=void 0),document.removeEventListener("visibilitychange",i),window.removeEventListener("pagehide",o),e())}function i(){document.hidden&&o()}document.addEventListener("visibilitychange",i),window.addEventListener("pagehide",o),document.hidden?o():t=window.requestAnimationFrame((()=>{t=void 0,r=window.requestAnimationFrame(o)}))}((()=>{(0,d.doAction)("wccom_buy_now_button_clicked",s),te&&(0,d.doAction)("wccom_add_to_store_button_clicked",s,z)}))};(0,o.useEffect)((()=>{q&&V.current&&setTimeout((()=>{V.current?.focus()}),100)}),[q]);const oe={locale:a,position:l,source:y},ie=()=>(0,S.jsx)(m.A,{className:"single_add_to_cart_button",isPrimary:D,text:M,href:B,tracksEvent:E,tracksProperties:oe,spinner:!0,onClick:ce,onFocus:Z,isBusy:U,isDisabled:k,isLarge:"large"===N||void 0,isMedium:"large"!==N||void 0,"data-tracks-locale":a,"data-tracks-position":l,"data-tracks-is_paid":K?"1":"0","data-tracks-source":y,"data-tracks-is_trending":x?"1":"0","data-tracks-is_freemium":J?"1":"0","data-tracks-used_currency":W,"data-tracks-subscription_plan":H,...J?{"data-tracks-freemium_type":"free"===G?"dependency":"primary"}:{},"data-tracks-product-id":L||z.productId,"data-tracks-is-business-service":z.isBusinessService?"1":"0","data-tracks-page_type":O,"data-wccom-cart-method":F&&re?"ajax":void 0,children:(T||j)&&(0,S.jsx)(w.A,{className:"wccom-product-add-to-cart-button__external-icon",icon:"arrow-up-right-from-square",color:"inherit"})});return(0,S.jsx)("div",{className:(0,n.A)("wccom-product-add-to-cart-button",t),children:re?(0,S.jsx)(v.A,{popoverId:"cart-added-popover",popoverTitle:(0,c.__)("Item added to cart","wccom"),hiddenTitle:!0,isOpen:q,onClose:()=>{Y(!1)},trigger:ie(),position:"bottom",anchorPosition:"center",disableHover:!0,children:(0,S.jsxs)("div",{children:[(0,S.jsx)("p",{children:(0,c.__)("Your item has been added to the cart.","wccom")}),(0,S.jsxs)("a",{ref:V,href:"/cart",className:"wccom-button is-style-secondary","data-tracks":"view_cart_clicked","data-tracks-placement":"cart-added-popover",children:[(0,S.jsx)("span",{className:"screen-reader-text",children:(0,c.__)("Your item has been added to the cart.","wccom")}),(0,c.__)("View cart","wccom")]})]})}):ie()})};y.propTypes={className:a().string,text:a().string,labelTextOverride:a().string,href:a().string.isRequired,isDisabled:a().bool,isExternal:a().bool,locale:a().string,position:a().string,isSaaSProduct:a().bool,isBusinessService:a().bool,buttonSize:a().oneOf(["large","medium"]),isTrending:a().bool,async:a().bool,source:a().string,productId:a().number,isPrimary:a().bool,isCartButton:a().bool,pageType:a().oneOf(["product","documentation"])};const x=y}},e=>{e.O(0,[2397],(()=>e(e.s=2950))),e.O()}]);
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.