woocommerce/packages/woocommerce-admin/dist/chunks/profile-wizard.js

1 line
75 KiB
JavaScript
Raw Normal View History

2021-12-10 12:03:04 +00:00
(window.__wcAdmin_webpackJsonp=window.__wcAdmin_webpackJsonp||[]).push([[47],{277:function(e,t,o){"use strict";var r=o(0),s=o(8),n=Object(r.createElement)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(s.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));t.a=n},278:function(e,t,o){"use strict";var r=o(0),s=o(8),n=Object(r.createElement)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(r.createElement)(s.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));t.a=n},501:function(e,t,o){"use strict";o.d(t,"b",(function(){return l})),o.d(t,"a",(function(){return m}));var r=o(0),s=o(30),n=o(89),c=o.n(n),i=o(13);const a=c()(i.a),l=e=>{const t=a.getCurrencyConfig(),o=Object(s.applyFilters)("woocommerce_admin_report_currency",t,e);return c()(o)},m=Object(r.createContext)(a)},507:function(e,t,o){"use strict";o.d(t,"a",(function(){return s}));var r=o(7);function s(e){const{createNotice:t}=Object(r.dispatch)("core/notices");e.error_data&&e.errors&&Object.keys(e.errors).length?Object.keys(e.errors).forEach(o=>{t("error",e.errors[o].join(" "))}):e.message&&t(e.code?"error":"success",e.message)}},509:function(e,t,o){"use strict";var r=o(53);const s=["a","b","em","i","strong","p","br"],n=["target","href","rel","name","download"];t.a=e=>({__html:Object(r.sanitize)(e,{ALLOWED_TAGS:s,ALLOWED_ATTR:n})})},514:function(e,t,o){"use strict";var r=o(0),s=o(2),n=o(14),c=o(7),i=o(18),a=o.n(i),l=o(3),m=o(21),d=o(11),u=o(122);class p extends r.Component{constructor(e){super(e),this.state={isLoadingScripts:!1,isRequestStarted:!1}}async componentDidUpdate(e,t){const{hasErrors:o,isRequesting:r,onClose:n,onContinue:c,createNotice:i}=this.props,{isLoadingScripts:a,isRequestStarted:l}=this.state;if(!l)return;const m=!r&&!a&&(e.isRequesting||t.isLoadingScripts)&&!o,d=!r&&e.isRequesting&&o;m&&(n(),c()),d&&(i("error",Object(s.__)("There was a problem updating your preferences",'woocommerce')),n())}updateTracking({allowTracking:e}){const{updateOptions:t}=this.props;e&&"function"==typeof window.wcTracks.enable?(this.setState({isLoadingScripts:!0}),window.wcTracks.enable(()=>{this._isMounted&&(Object(u.initializeExPlat)(),this.setState({isLoadingScripts:!1}))})):e||(window.wcTracks.isEnabled=!1);const o=e?"yes":"no";this.setState({isRequestStarted:!0}),t({woocommerce_allow_tracking:o})}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}render(){const{allowTracking:e,isResolving:t,onClose:o,onContinue:n}=this.props;if(t)return null;if(e)return o(),n(),null;const{isRequesting:c,title:i=Object(s.__)("Build a better WooCommerce",'woocommerce'),message:d=a()({mixedString:Object(s.__)("Get improved features and faster fixes by sharing non-sensitive data via {{link}}usage tracking{{/link}} that shows us how WooCommerce is used. No personal data is tracked or stored.",'woocommerce'),components:{link:Object(r.createElement)(m.Link,{href:"https://woocommerce.com/usage-tracking?utm_medium=product",target:"_blank",type:"external"})}}),dismissActionText:u=Object(s.__)("No thanks",'woocommerce'),acceptActionText:p=Object(s.__)("Yes, count me in!",'woocommerce')}=this.props,{isRequestStarted:b}=this.state,h=b&&c;return Object(r.createElement)(l.Modal,{title:i,isDismissible:this.props.isDismissible,onRequestClose:()=>this.props.onClose(),className:"woocommerce-usage-modal"},Object(r.createElement)("div",{className:"woocommerce-usage-modal__wrapper"},Object(r.createElement)("div",{className:"woocommerce-usage-modal__message"},d),Object(r.createElement)("div",{className:"woocommerce-usage-modal__actions"},Object(r.createElement)(l.Button,{isSecondary:!0,isBusy:h,onClick:()=>this.updateTracking({allowTracking:!1})},u),Object(r.createElement)(l.Button,{isPrimary:!0,isBusy:h,onClick:()=>this.updateTracking({allowTracking:!0})},p))))}}t.a=Object(n.compose)(Object(c.withSelect)(e=>{const{getOption:t,getOptionsUpdatingError:o,isOptionsUpdating:r,hasFinishedResolution:s}=e(d.OPTIONS_STORE_NAME);return{allowTracking:"yes"===t("woocommerce_allow_tracking"),isRequesting:Bo