File "woo-product-usage-notice.js"

Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/woocommerce/assets/client/admin/wp-admin-scripts/woo-product-usage-notice.js
File size: 10.93 KB
MIME-type: text/plain
Charset: utf-8

(()=>{"use strict";var e={n:M=>{var c=M&&M.__esModule?()=>M.default:()=>M;return e.d(c,{a:c}),c},d:(M,c)=>{for(var t in c)e.o(c,t)&&!e.o(M,t)&&Object.defineProperty(M,t,{enumerable:!0,get:c[t]})},o:(e,M)=>Object.prototype.hasOwnProperty.call(e,M),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},M={};e.r(M);const c=window.wp.element,t=window.wp.i18n,i=window.wp.components,o=window.wp.primitives,N=(0,c.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(o.Path,{d:"M7 7.2h8.2L13.5 9l1.1 1.1 3.6-3.6-3.5-4-1.1 1 1.9 2.3H7c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.2-.5zm13.8 4V11h-1.5v.3c0 1.1 0 3.5-1 4.5-.3.3-.7.5-1.3.5H8.8l1.7-1.7-1.1-1.1L5.9 17l3.5 4 1.1-1-1.9-2.3H17c.9 0 1.7-.3 2.3-.9 1.5-1.4 1.5-4.2 1.5-5.6z"})),I=(0,c.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(o.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"})),j=(0,c.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(o.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})),r=window.wc.experimental,n=window.wc.tracks,u=window.wp.url,D=window.wc.wcSettings,g=window.wp.apiFetch;var s=e.n(g);const a=({action:e,productId:M,nonce:c},t)=>{const i=(0,u.addQueryArgs)(new URL("admin-ajax.php",(0,D.getSetting)("adminUrl")).toString(),{action:e,product_id:M,_ajax_nonce:c});s()({url:i,method:"GET",headers:{"Content-Type":"application/json"}}).then((e=>{t&&t(e)}))},{renewUrl:d,subscribeUrl:y,productId:T,productName:z,productRegularPrice:E,dismissAction:x,dismissNonce:m,remindLaterAction:A,remindLaterNonce:w,colorScheme:l,subscriptionState:L,screenId:O}=window.wooProductUsageNotice,p=document.createElement("div");p.setAttribute("id","woo-product-usage-notice"),(0,c.createRoot)(document.body.appendChild(p)).render((0,c.createElement)((function({renewUrl:e,subscribeUrl:M,productId:o,productName:u,productRegularPrice:D,dismissAction:g,dismissNonce:s,remindLaterAction:d,remindLaterNonce:y,subscriptionState:T,screenId:z}){const[E,x]=(0,c.useState)(!0);(0,c.useEffect)((()=>{E&&(0,n.recordEvent)("product_usage_notice_opened",{product_id:o,screen_id:z})}),[E,o,z]);const m=T.expired,A=()=>{(({remindLaterAction:e,productId:M,remindLaterNonce:c},t)=>{a({action:e,productId:M,nonce:c},t)})({remindLaterAction:d,productId:o,remindLaterNonce:y},(()=>{x(!1),(0,n.recordEvent)("product_usage_notice_maybe_later_clicked",{product_id:o,screen_id:z})}))};return E?(0,c.createElement)(i.Modal,{style:{borderRadius:"2px"},onRequestClose:()=>{(({dismissAction:e,productId:M,dismissNonce:c},t)=>{a({action:e,productId:M,nonce:c},t)})({dismissAction:g,productId:o,dismissNonce:s},(()=>{x(!1),(0,n.recordEvent)("product_usage_notice_dismissed",{product_id:o,screen_id:z})}))},className:"woocommerce-product-usage-notice"},(0,c.createElement)(i.Flex,{gap:0,align:"stretch",direction:["column-reverse","row"]},(0,c.createElement)(i.FlexItem,null,(()=>{const g=m?(0,t.__)("Expired","woocommerce"):(0,t.__)("Unregistered","woocommerce"),s=m?(0,t.sprintf)((0,t.__)("Renew %s","woocommerce"),u):(0,t.sprintf)((0,t.__)("Subscribe to %s","woocommerce"),u),a=m?(0,t.sprintf)((0,t.__)("Renew for $%s","woocommerce"),D):(0,t.sprintf)((0,t.__)("Subscribe for $%s","woocommerce"),D);return(0,c.createElement)(i.Card,{className:"primary"},(0,c.createElement)(i.CardHeader,null,(0,c.createElement)("div",null,(0,c.createElement)(r.Text,{className:"subscription-status subscription-status__expired"},g)),(0,c.createElement)("h2",null,s)),(0,c.createElement)(i.CardBody,null,(()=>{const e=m?(0,t.__)("Reactivate your subscription and benefit from:","woocommerce"):(0,t.__)("Purchase a subscription to benefit from:","woocommerce"),M=[{key:"get-updates",icon:N,title:(0,t.__)("Improvements and security updates","woocommerce"),content:(0,t.__)("Access the latest features and product updates.","woocommerce")},{key:"get-supports",icon:I,title:(0,t.__)("Help when you need it","woocommerce"),content:(0,t.__)("Get streamlined support from our global support team.","woocommerce")},{key:"supporting-ecosystem",icon:j,title:(0,t.__)("Supporting the ecosystem","woocommerce"),content:(0,t.__)("A subscription helps us to continuously improve your extensions, themes, and WooCommerce experience.","woocommerce")}];return(0,c.createElement)("div",{className:"woocommerce-subscription-benefits"},(0,c.createElement)("h3",null,e),M.map((({key:e,icon:M,title:t,content:o})=>(0,c.createElement)("div",{className:"woocommerce-subscription-benefits__item",key:e},(0,c.createElement)("div",{className:"woocommerce-subscription-benefits__icon"},(0,c.createElement)(i.Icon,{icon:M})),(0,c.createElement)("div",{className:"woocommerce-subscription-benefits__content"},(0,c.createElement)(r.Text,{as:"h4",lineHeight:"20px"},t),(0,c.createElement)(r.Text,{as:"p"},o))))))})()),(0,c.createElement)(i.CardFooter,null,(0,c.createElement)(i.Button,{onClick:A,variant:"secondary"},(0,t.__)("Maybe later","woocommerce")),(0,c.createElement)(i.Button,{isPrimary:!0,target:"_blank",href:m?e:M,onClick:()=>m?(x(!1),void(0,n.recordEvent)("product_usage_notice_renew_clicked",{product_id:o,screen_id:z})):(x(!1),void(0,n.recordEvent)("product_usage_notice_subscribe_clicked",{product_id:o,screen_id:z}))},a)))})()),(0,c.createElement)(i.FlexItem,null,(0,c.createElement)(i.Card,{className:"secondary"},(0,c.createElement)(i.CardMedia,null,(0,c.createElement)(i.ResponsiveWrapper,{naturalWidth:240,naturalHeight:240},(0,c.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjYwIiBoZWlnaHQ9IjI2MCIgdmlld0JveD0iMCAwIDI2MCAyNjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF82OTRfMzExKSI+CjxwYXRoIGQ9Ik0xNDUuMDI5IDE0My4xQzIwMS40MzcgMTEzLjY5OCAyMzIuMjkxIDY1LjUwNDIgMjEzLjkzOCAzNS40NjI3QzE5NS41ODUgNS40MjExOCAxMzQuOTc0IDQuODkxNzkgNzguNTU2MyAzNC4yOTU1QzIyLjE0ODMgNjMuNjk3NyAtOC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g+CjwvZGVmcz4KPC9zdmc+Cg==",alt:""}))))))):null}),{renewUrl:d,subscribeUrl:y,productId:T,productName:z,productRegularPrice:E,dismissAction:x,dismissNonce:m,remindLaterAction:A,remindLaterNonce:w,colorScheme:l,subscriptionState:L,screenId:O})),(window.wc=window.wc||{}).wooProductUsageNotice=M})();