芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/woocommerce/assets/client/admin/chunks/profile-wizard.js
"use strict";(self.webpackChunk_wcAdmin_webpackJsonp=self.webpackChunk_wcAdmin_webpackJsonp||[]).push([[7708],{10314:function(e,t,o){var s=o(69307),r=o(70444);const n=(0,s.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(r.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));t.Z=n},37942:function(e,t,o){var s=o(69307),r=o(70444);const n=(0,s.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(r.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"}));t.Z=n},9426:function(e,t,o){o.r(t),o.d(t,{default:function(){return Ae}});var s=o(69307),r=o(65736),n=o(92694),i=o(94333),a=o(92819),l=o(9818),c=o(10431),m=o(67221),u=o(14599),p=o(74617),d=o(5267),h=o(55609),_=o(86020),g=o(83849),w=o.n(g),C=o(54071),f=o(37657);const y=[{key:"shopify",label:(0,r.__)("Shopify","woocommerce")},{key:"bigcommerce",label:(0,r.__)("BigCommerce","woocommerce")},{key:"magento",label:(0,r.__)("Magento","woocommerce")},{key:"wix",label:(0,r.__)("Wix","woocommerce")},{key:"amazon",label:(0,r.__)("Amazon","woocommerce")},{key:"ebay",label:(0,r.__)("eBay","woocommerce")},{key:"etsy",label:(0,r.__)("Etsy","woocommerce")},{key:"squarespace",label:(0,r.__)("Squarespace","woocommerce")},{key:"wish",label:(0,r.__)("Wish","woocommerce")},{key:"walmart",label:(0,r.__)("Walmart","woocommerce")},{key:"other",label:(0,r.__)("Other","woocommerce")}],v=[{key:"1",label:(0,r.__)("It's just me","woocommerce")},{key:"<10",label:(0,r.__)("< 10","woocommerce")},{key:"10-50",label:"10 - 50"},{key:"50-250",label:"50 - 250"},{key:"+250",label:(0,r.__)("+250","woocommerce")},{key:"not specified",label:(0,r.__)("I'd rather not say","woocommerce")}],E=[{key:"no",label:(0,r.__)("No","woocommerce")},{key:"other",label:(0,r.__)("Yes, on another platform","woocommerce")},{key:"other-woocommerce",label:(0,r.__)("Yes, I own a different store powered by WooCommerce","woocommerce")},{key:"brick-mortar",label:(0,r.__)("Yes, in person at physical stores and/or events","woocommerce")},{key:"brick-mortar-other",label:(0,r.__)("Yes, on another platform and in person at physical stores and/or events","woocommerce")}];var b=o(2969),S=o(81595);const k=(e,t)=>(0,S.formatValue)(e,"number",t),N=function(e,t){let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k;return o?(0,r.sprintf)((0,r._x)("%1$s - %2$s","store product count or revenue range","woocommerce"),s(e,t),s(e,o)):(0,r.sprintf)((0,r._x)("%s+","store product count or revenue","woocommerce"),s(e,t))},x={US:1,EU:.9,IN:71.24,GB:.76,BR:4.19,VN:23172.5,ID:14031,BD:84.87,PK:154.8,RU:63.74,TR:5.75,MX:19.37,CA:1.32},T=(e,t)=>{const o=(0,b.w)(t);if("US"===o)return e;const s=x[o]||x.US,r=s.toString().split(".")[0].length,n=Math.pow(10,2+r);return Math.round(e*s/n)*n},P=(e,t,o)=>[{key:"none",label:(0,r.sprintf)((0,r.__)("%s (I'm just getting started)","woocommerce"),o(0))},{key:"up-to-2500",label:(0,r.sprintf)((0,r.__)("Up to %s","woocommerce"),o(T(2500,t)))},{key:"2500-10000",label:N(e,T(2500,t),T(1e4,t),((e,t)=>o(t)))},{key:"10000-50000",label:N(e,T(1e4,t),T(5e4,t),((e,t)=>o(t)))},{key:"50000-250000",label:N(e,T(5e4,t),T(25e4,t),((e,t)=>o(t)))},{key:"more-than-250000",label:(0,r.sprintf)((0,r.__)("More than %s","woocommerce"),o(T(25e4,t)))},{key:"rather-not-say",label:(0,r.__)("I'd rather not say","woocommerce")}];var O=o(14812),I=o(62907),V=o(37942),F=o(10314),M=o(78674);const A=()=>(0,s.createElement)("svg",{width:"200",height:"148",viewBox:"0 0 200 148",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)("g",{clipPath:"url(#clip0)"},(0,s.createElement)("path",{d:"M197.563 2.53875e-09H62.909C62.3961 0.000450584 61.9043 0.205742 61.5416 0.570805C61.179 0.935868 60.975 1.43087 60.9746 1.94714V50.9404H93.5623C94.4445 50.9415 95.2902 51.2947 95.9141 51.9226C96.5379 52.5505 96.8888 53.4019 96.8899 54.2899V95.7402H197.563C197.843 95.7402 198.119 95.6791 198.373 95.5612C198.627 95.4432 198.853 95.2712 199.034 95.0569C199.05 95.0402 199.064 95.0222 199.076 95.0033C199.192 94.8612 199.285 94.7024 199.354 94.5322C199.451 94.2981 199.501 94.0468 199.5 93.7931V1.94714C199.499 1.43051 199.295 0.935241 198.932 0.57014C198.569 0.20504 198.077 -2.63458e-05 197.563 2.53875e-09Z",fill:"#F2F2F2"}),(0,s.createElement)("path",{d:"M199.222 7.80469H61.25V8.36132H199.222V7.80469Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M65.95 5.84371C66.8662 5.84371 67.609 5.09607 67.609 4.17381C67.609 3.25155 66.8662 2.50391 65.95 2.50391C65.0338 2.50391 64.291 3.25155 64.291 4.17381C64.291 5.09607 65.0338 5.84371 65.95 5.84371Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M70.72 5.84371C71.6363 5.84371 72.379 5.09607 72.379 4.17381C72.379 3.25155 71.6363 2.50391 70.72 2.50391C69.8038 2.50391 69.061 3.25155 69.061 4.17381C69.061 5.09607 69.8038 5.84371 70.72 5.84371Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M75.4896 5.84371C76.4058 5.84371 77.1486 5.09607 77.1486 4.17381C77.1486 3.25155 76.4058 2.50391 75.4896 2.50391C74.5733 2.50391 73.8306 3.25155 73.8306 4.17381C73.8306 5.09607 74.5733 5.84371 75.4896 5.84371Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M164.842 19.957H95.6295C94.8646 19.957 94.1311 20.2629 93.5903 20.8073C93.0494 21.3516 92.7456 22.09 92.7456 22.8599C92.7456 23.6298 93.0494 24.3681 93.5903 24.9125C94.1311 25.4569 94.8646 25.7627 95.6295 25.7627H164.842C165.607 25.7627 166.341 25.4569 166.882 24.9125C167.422 24.3681 167.726 23.6298 167.726 22.8599C167.726 22.09 167.422 21.3516 166.882 20.8073C166.341 20.2629 165.607 19.957 164.842 19.957ZM164.842 25.3161H95.6295C94.9823 25.3161 94.3616 25.0573 93.904 24.5967C93.4464 24.1361 93.1893 23.5113 93.1893 22.8599C93.1893 22.2084 93.4464 21.5837 93.904 21.123C94.3616 20.6624 94.9823 20.4036 95.6295 20.4036H164.842C165.489 20.4036 166.11 20.6624 166.568 21.123C167.025 21.5837 167.283 22.2084 167.283 22.8599C167.283 23.5113 167.025 24.1361 166.568 24.5967C166.11 25.0573 165.489 25.3161 164.842 25.3161Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M186.022 43.0859H116.809C116.044 43.0859 115.31 43.3918 114.769 43.9362C114.229 44.4806 113.925 45.2189 113.925 45.9888C113.925 46.7587 114.229 47.497 114.769 48.0414C115.31 48.5858 116.044 48.8916 116.809 48.8916H186.022C186.786 48.8916 187.52 48.5858 188.061 48.0414C188.602 47.497 188.905 46.7587 188.905 45.9888C188.905 45.2189 188.602 44.4806 188.061 43.9362C187.52 43.3918 186.786 43.0859 186.022 43.0859Z",fill:"white"}),(0,s.createElement)("path",{d:"M186.022 53.8047H116.809C116.044 53.8047 115.31 54.1105 114.769 54.6549C114.229 55.1993 113.925 55.9376 113.925 56.7075C113.925 57.4774 114.229 58.2158 114.769 58.7601C115.31 59.3045 116.044 59.6104 116.809 59.6104H186.022C186.786 59.6104 187.52 59.3045 188.061 58.7601C188.602 58.2158 188.905 57.4774 188.905 56.7075C188.905 55.9376 188.602 55.1993 188.061 54.6549C187.52 54.1105 186.786 53.8047 186.022 53.8047Z",fill:"white"}),(0,s.createElement)("path",{d:"M186.022 64.5195H116.809C116.044 64.5195 115.31 64.8254 114.769 65.3698C114.229 65.9141 113.925 66.6525 113.925 67.4224C113.925 68.1923 114.229 68.9306 114.769 69.475C115.31 70.0194 116.044 70.3252 116.809 70.3252H186.022C186.786 70.3252 187.52 70.0194 188.061 69.475C188.602 68.9306 188.905 68.1923 188.905 67.4224C188.905 66.6525 188.602 65.9141 188.061 65.3698C187.52 64.8254 186.786 64.5195 186.022 64.5195Z",fill:"white"}),(0,s.createElement)("path",{d:"M105.623 38.2852H74.1183C73.4425 38.286 72.7947 38.5565 72.3168 39.0375C71.839 39.5185 71.5702 40.1706 71.5693 40.8508V50.9416H72.013V40.8508C72.0139 40.2891 72.2359 39.7506 72.6306 39.3533C73.0252 38.9561 73.5602 38.7326 74.1183 38.7317H105.623C106.182 38.7322 106.717 38.9556 107.112 39.3529C107.506 39.7502 107.728 40.289 107.729 40.8508V72.5633C107.728 73.1251 107.506 73.6638 107.112 74.0611C106.717 74.4585 106.182 74.6819 105.623 74.6824H96.8897V75.1289H105.623C106.299 75.1285 106.947 74.858 107.425 74.377C107.903 73.8959 108.172 73.2436 108.172 72.5633V40.8508C108.172 40.1705 107.903 39.5182 107.425 39.0371C106.947 38.556 106.299 38.2856 105.623 38.2852Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M23.9309 70.9116C23.8195 70.9162 19.0705 70.5847 18.9492 70.5806L19.3758 66.294L22.0808 66.212L27.2495 56.5756C26.5327 55.1996 27.4148 53.3739 28.9355 53.0925C32 52.3914 33.0526 57.2443 29.9789 57.8901L25.7036 69.6652C25.5695 70.03 25.3278 70.3449 25.011 70.5676C24.6942 70.7904 24.3174 70.9104 23.9309 70.9116Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M11.4107 73.118C6.89154 73.1291 6.49482 66.2544 11.024 65.7699C23.0006 65.0415 21.485 62.0137 22.3945 70.9448C22.4224 71.2097 22.3448 71.475 22.1787 71.6824C22.0126 71.8898 21.7715 72.0223 21.5084 72.051L11.803 73.0968C11.6727 73.1109 11.5417 73.1179 11.4107 73.118Z",className:"fill-theme-color"}),(0,s.createElement)("path",{d:"M10.3793 51.3852C16.605 54.9512 11.494 64.3601 5.15222 61.0097C-1.0733 57.4438 4.03771 48.0349 10.3793 51.3852Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M16.0395 132.376L18.759 132.376L20.053 121.816L16.0391 121.817L16.0395 132.376Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M15.4567 134.915L24.0042 134.915C23.9716 130.476 18.2546 131.755 15.4565 131.591L15.4567 134.915Z",fill:"#2F2E41"}),(0,s.createElement)("path",{d:"M4.28218 132.376L7.00167 132.376L8.29564 121.816L4.28174 121.817L4.28218 132.376Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M3.69937 134.915L12.2469 134.915C12.2142 130.476 6.49728 131.755 3.69922 131.591L3.69937 134.915Z",fill:"#2F2E41"}),(0,s.createElement)("path",{d:"M7.37266 128.688C6.71536 128.507 3.14362 129.056 2.72209 128.335C1.24999 113.483 1.57722 98.9486 4.845 90.9619L16.0806 90.2695C18.5931 94.8863 24.3684 125.522 20.8847 127.385L16.4048 127.546C16.1493 127.554 15.8988 127.474 15.6952 127.318C15.4916 127.163 15.3475 126.941 15.2869 126.691L11.539 105.229C10.6057 103.916 8.77111 127.832 8.46815 127.742C8.42864 128.006 8.29626 128.247 8.09515 128.42C7.89404 128.594 7.63762 128.689 7.37266 128.688Z",fill:"#2F2E41"}),(0,s.createElement)("path",{d:"M4.48843 92.8373C-1.18427 86.8634 2.43414 70.8475 2.25101 71.1881C2.26655 70.7958 3.55141 64.7536 6.87506 63.762C9.51196 62.886 12.4305 65.5063 12.7906 68.1566L16.7406 91.6368C16.7611 91.7646 16.7514 91.8955 16.7123 92.0188C16.6733 92.1422 16.6059 92.2546 16.5158 92.3469C16.71 92.9556 4.76613 92.7153 4.48843 92.8373Z",className:"fill-theme-color"}),(0,s.createElement)("path",{d:"M6.32941 55.5845C6.82759 55.2675 7.07312 54.7238 7.36309 54.2285C8.89053 53.3522 10.6464 55.472 12.262 54.6809C16.8302 50.2665 12.1346 48.9642 7.92721 48.7314C6.9333 48.6081 6.08781 48.963 5.33637 49.5492C-3.06805 48.9031 0.962591 60.1519 6.26679 61.6376C7.2033 62.0505 7.90582 61.2148 7.07994 60.4551C5.93728 59.2493 4.52181 56.8221 6.32941 55.5845Z",fill:"#2F2E41"}),(0,s.createElement)("path",{d:"M93.5621 50.4922H32.779C31.7793 50.4936 30.8209 50.894 30.1139 51.6056C29.407 52.3172 29.0092 53.2819 29.0078 54.2882V131.548C29.0092 132.555 29.407 133.52 30.1139 134.231C30.8209 134.943 31.7793 135.343 32.779 135.345H93.5621C94.5619 135.343 95.5202 134.943 96.2272 134.231C96.9341 133.52 97.3319 132.555 97.3333 131.548V54.2882C97.3319 53.2819 96.9341 52.3172 96.2272 51.6056C95.5202 50.894 94.5619 50.4936 93.5621 50.4922ZM96.8896 131.548C96.8886 132.436 96.5376 133.288 95.9138 133.916C95.29 134.544 94.4443 134.897 93.5621 134.898H32.779C31.8968 134.897 31.0511 134.544 30.4273 133.916C29.8035 133.288 29.4526 132.436 29.4515 131.548V54.2882C29.4526 53.4002 29.8035 52.5489 30.4273 51.921C31.0511 51.2931 31.8968 50.9399 32.779 50.9388H93.5621C94.4443 50.9399 95.29 51.2931 95.9138 51.921C96.5376 52.5489 96.8886 53.4002 96.8896 54.2882V131.548Z",fill:"#3F3D56"}),(0,s.createElement)("path",{d:"M15.6527 83.0043C13.6494 83.2327 12.7698 78.5402 12.0039 77.3445L15.9936 75.7852L17.2918 78.1751L28.168 78.4472C28.2326 78.3591 28.3032 78.2755 28.3793 78.1971C30.5362 75.9238 34.0488 79.33 31.9 81.5984C31.663 81.8519 31.3752 82.0521 31.0557 82.1855C30.7362 82.319 30.3923 82.3828 30.0465 82.3727C29.7007 82.3627 29.361 82.2789 29.0497 82.1271C28.7384 81.9753 28.4626 81.7588 28.2405 81.4918C27.9719 81.5111 15.9153 83.0114 15.6527 83.0043Z",fill:"#FFB8B8"}),(0,s.createElement)("path",{d:"M12.6985 80.7664C12.0314 81.4133 6.91061 72.3318 6.5365 72.0751C3.94893 68.0267 10.0405 64.0298 12.6727 68.0562L17.9961 76.2911C18.1402 76.5145 18.1904 76.7864 18.1356 77.047C18.0808 77.3076 17.9255 77.5357 17.7039 77.6812C17.4613 77.7956 12.8697 81.0123 12.6985 80.7664Z",className:"fill-theme-color"}),(0,s.createElement)("path",{d:"M81.583 103.974H44.7583C40.9966 103.955 40.9809 98.1877 44.7584 98.168H81.583C85.3421 98.1857 85.3624 103.954 81.583 103.974Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M81.583 114.692H44.7583C40.9966 114.674 40.9809 108.906 44.7584 108.887H81.583C85.3421 108.904 85.3624 114.673 81.583 114.692Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M81.583 125.411H44.7583C40.9966 125.393 40.9809 119.625 44.7584 119.605H81.583C85.3421 119.623 85.3624 125.391 81.583 125.411Z",fill:"#CCCCCC"}),(0,s.createElement)("path",{d:"M95.3371 57.6387C94.1963 57.6387 93.0812 57.2982 92.1327 56.6603C91.1842 56.0223 90.4449 55.1156 90.0084 54.0548C89.5718 52.9939 89.4576 51.8266 89.6802 50.7004C89.9027 49.5742 90.452 48.5397 91.2587 47.7278C92.0653 46.9159 93.093 46.3629 94.2118 46.1389C95.3307 45.9149 96.4904 46.0299 97.5443 46.4693C98.5982 46.9087 99.499 47.6528 100.133 48.6076C100.767 49.5623 101.105 50.6848 101.105 51.833C101.103 53.3723 100.495 54.8479 99.4136 55.9363C98.3323 57.0247 96.8662 57.637 95.3371 57.6387Z",className:"fill-theme-color"}),(0,s.createElement)("path",{d:"M97.999 51.6121H95.5588V48.821C95.5588 48.7617 95.5355 48.7049 95.4939 48.6631C95.4523 48.6212 95.3958 48.5977 95.337 48.5977C95.2782 48.5977 95.2217 48.6212 95.1801 48.6631C95.1385 48.7049 95.1152 48.7617 95.1152 48.821V51.6121H92.675C92.6161 51.6121 92.5597 51.6357 92.5181 51.6775C92.4765 51.7194 92.4531 51.7762 92.4531 51.8354C92.4531 51.8947 92.4765 51.9515 92.5181 51.9933C92.5597 52.0352 92.6161 52.0587 92.675 52.0587H95.1152V54.8499C95.1152 54.9091 95.1385 54.9659 95.1801 55.0078C95.2217 55.0497 95.2782 55.0732 95.337 55.0732C95.3958 55.0732 95.4523 55.0497 95.4939 55.0078C95.5355 54.9659 95.5588 54.9091 95.5588 54.8499V52.0587H97.999C98.0579 52.0587 98.1143 52.0352 98.1559 51.9933C98.1975 51.9515 98.2209 51.8947 98.2209 51.8354C98.2209 51.7762 98.1975 51.7194 98.1559 51.6775C98.1143 51.6357 98.0579 51.6121 97.999 51.6121Z",fill:"white"}),(0,s.createElement)("path",{d:"M80.9177 91.2002H45.424C44.4535 91.1991 43.5232 90.8105 42.837 90.1198C42.1508 89.4291 41.7648 88.4926 41.7637 87.5158V67.5086C41.7648 66.5318 42.1508 65.5953 42.837 64.9046C43.5232 64.2139 44.4535 63.8253 45.424 63.8242H80.9177C81.8882 63.8253 82.8185 64.2139 83.5047 64.9046C84.1909 65.5953 84.5769 66.5318 84.578 67.5086V87.5158C84.5769 88.4926 84.1909 89.4291 83.5047 90.1198C82.8185 90.8105 81.8882 91.1991 80.9177 91.2002Z",className:"fill-theme-color"})),(0,s.createElement)("defs",null,(0,s.createElement)("clipPath",{id:"clip0"},(0,s.createElement)("rect",{width:"199",height:"148",fill:"white",transform:"translate(0.5)"}))));var B=o(32490);const z=["obw/basics","obw/grow"],R=e=>(0,s.createElement)("div",{className:"woocommerce-admin__business-details__free-badge"},e.isFreeTrial?(0,r.__)("Free Trial","woocommerce"):(0,r.__)("Free","woocommerce")),L=e=>{let{onChange:t,description:o,isChecked:r,extensionKey:n}=e;const i="codistoconnect"===n;return(0,s.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle__extension"},(0,s.createElement)(h.CheckboxControl,{id:"woocommerce-business-extensions__checkbox",checked:r,onChange:t}),(0,s.createElement)("p",{className:"woocommerce-admin__business-details__selective-extensions-bundle__description",dangerouslySetInnerHTML:(0,B.ZP)(o),onClick:e=>{const t=e.target.closest("a");t&&e.currentTarget.contains(t)&&t.href.startsWith("https://woocommerce.com/products/")&&(0,u.recordEvent)("storeprofiler_store_business_features_link_click",{extension_name:t.href.split("https://woocommerce.com/products/")[1]})}}),(0,s.createElement)(R,{isFreeTrial:i,extensionKey:n}))},D=e=>{let{isResolving:t,title:o,extensions:r,installExtensionOptions:n,onCheckboxChange:i}=e;return t?(0,s.createElement)("div",null,(0,s.createElement)(h.Spinner,null)):0===r.length?null:(0,s.createElement)("div",null,(0,s.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle__category"},o),r.map((e=>{let{description:t,key:o}=e;return(0,s.createElement)(L,{key:o,extensionKey:o,description:t,isChecked:n[o],onChange:i(o)})})))},U=e=>{let{isInstallingActivating:t,onSubmit:o,setInstallExtensionOptions:n,installableExtensions:i,installExtensionOptions:a={install_extensions:!0}}=e;const[l,c]=(0,s.useState)(!1);(0,s.useEffect)((()=>{t||0===i.length||n(((e,t)=>e.reduce(((e,t)=>{const o=t.plugins.reduce(((t,o)=>e.hasOwnProperty(o.key)?t:{...t,[o.key]:!0}),{});return{...e,...o}}),t))(i,a))}),[i]);const p=e=>t=>{const o={...a,[e]:t},s=1===Object.entries(o).filter((e=>{let[,t]=e;return t})).length&&o.install_extensions;n(s?{...o,install_extensions:!1}:{...a,[e]:t,install_extensions:!0})};return(0,s.createElement)("div",{className:"woocommerce-profile-wizard__business-details__free-features"},(0,s.createElement)(h.Card,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__business-details__free-features__illustration"},(0,s.createElement)(A,null)),(0,s.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle"},(0,s.createElement)("div",{className:"woocommerce-admin__business-details__selective-extensions-bundle__extension"},(0,s.createElement)(h.CheckboxControl,{checked:a.install_extensions,onChange:e=>{var t,o;n((t=a,o=e,Object.entries(t).reduce(((e,t)=>{let[s]=t;return{...e,[s]:o}}),{})))}}),(0,s.createElement)("p",{className:"woocommerce-admin__business-details__selective-extensions-bundle__description"},(0,r.__)("Add recommended business features to my site","woocommerce")),(0,s.createElement)(h.Button,{className:"woocommerce-admin__business-details__selective-extensions-bundle__expand",disabled:!i||0===i.length,onClick:()=>{c(!l),l||(0,u.recordEvent)("storeprofiler_store_business_features_accordion_click")}},(0,s.createElement)(I.Z,{icon:l?V.Z:F.Z}))),l&&i.map((e=>{let{plugins:t,key:o,title:r}=e;return(0,s.createElement)(D,{key:o,title:r,extensions:t,installExtensionOptions:a,onCheckboxChange:p})}))),(0,s.createElement)("div",{className:"woocommerce-profile-wizard__business-details__free-features__action"},(0,s.createElement)(h.Button,{onClick:()=>{o(a,i)},isBusy:t,disabled:t,isPrimary:!0},(0,r.__)("Continue","woocommerce")))),((e,t)=>{const o=Object.keys(e).filter((t=>e[t]&&"install_extensions"!==t));if(0===o.length)return null;const n=o.reduce(((e,t)=>{const o=m.pluginNames[t];return e.includes(o)?e:[...e,o]}),[]).join(", ");if(t)return(0,s.createElement)("div",{className:"woocommerce-profile-wizard__footnote"},(0,s.createElement)(O.Text,{variant:"caption",as:"p",size:"12",lineHeight:"16px"},(0,r.sprintf)((0,r._n)("Installing the following plugin: %s","Installing the following plugins: %s",o.length,"woocommerce"),n)));const i=(0,r.__)("User accounts are required to use these features.","woocommerce"),a=o.filter((e=>"jetpack"===e||e.includes("woocommerce-services"))),l=a.includes("jetpack")&&(a.includes("woocommerce-services:shipping")||a.includes("woocommerce-services:tax"))?"Jetpack and WooCommerce Shipping & Tax":m.pluginNames[a[0]],c=(0,r.sprintf)((0,r._n)("By installing %s plugin for free you agree to our {{link}}Terms of Service{{/link}}.","By installing %s plugins for free you agree to our {{link}}Terms of Service{{/link}}.",a.length,"woocommerce"),l);return(0,s.createElement)("div",{className:"woocommerce-profile-wizard__footnote"},(0,s.createElement)(O.Text,{variant:"caption",as:"p",size:"12",lineHeight:"16px"},(0,r.sprintf)((0,r._n)("The following plugin will be installed for free: %1$s. %2$s","The following plugins will be installed for free: %1$s. %2$s",o.length,"woocommerce"),n,i)),a.length>0&&(0,s.createElement)(O.Text,{variant:"caption",as:"p",size:"12",lineHeight:"16px"},(0,M.Z)({mixedString:c,components:{link:(0,s.createElement)(_.Link,{href:"https://wordpress.com/tos/",target:"_blank",type:"external"})}})))})(a,t))};var Z=o(15635);const j="business-details",H="business-features",q=e=>["other","brick-mortar","brick-mortar-other","other-woocommerce"].includes(e),G=e=>["other","brick-mortar-other"].includes(e),W="wc-admin-free-features-tab-values";class $ extends s.Component{constructor(e){super(),this.state={isPopoverVisible:!1,isValid:!1,currentTab:"business-details",savedValues:e.initialValues},this.onContinue=this.onContinue.bind(this),this.validate=this.validate.bind(this),this.persistValues=this.persistValues.bind(this),this.persistProfileItems.bind(this),e.trackStepValueChanges(e.step.key,e.initialValues,this.state.savedValues,this.persistValues),e.invalidateResolutionForStoreSelector("getFreeExtensions")}async onContinue(e,t){const{createNotice:o,goToNextStep:s,installAndActivatePlugins:n}=this.props,i=t.reduce(((e,t)=>[...e,...t.plugins.filter((e=>e.is_activated)).map((e=>e.key))]),[]),a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.keys(e).filter((o=>e[o]&&"install_extensions"!==o&&!t.includes(o))).map(Z.V7).filter(((e,t,o)=>o.indexOf(e)===t))}(e,i),l=(e=>{const t={};for(let[o,s]of Object.entries(e)){o=(0,Z.V7)(o);const e=(0,Z.br)(o);"install_extensions"===o||t[`install_${e}`]||(t[`install_${e}`]=s)}return t})(e);(0,u.recordEvent)("storeprofiler_store_business_features_continue",{all_extensions_installed:Object.values(e).every((e=>e)),...l});const c=[this.persistProfileItems({business_extensions:[...a,...i]})];if(a.length){const t=window.performance.now();c.push(n(a).then((o=>{const s=window.performance.now()-t,r=((e,t)=>{const o=[],s={};for(let[r]of Object.entries(e)){r=(0,Z.V7)(r);const e=(0,Z.br)(r);t&&t.data&&t.data.install_time&&t.data.install_time[r]&&(o.push(e),s[`install_time_${e}`]=(0,Z.Jm)(t.data.install_time[r]))}return s.installed_extensions=o,s.activated_extensions=t&&t.data&&t.data.activated?t.data.activated:[],s})(e,o);(0,u.recordEvent)("storeprofiler_store_business_features_installed_and_activated",{success:!0,total_time:(0,Z.Jm)(s),...r}),(0,f.a)(o)})).catch((e=>{throw(0,u.recordEvent)("storeprofiler_store_business_features_installed_and_activated",{success:!1,failed_extensions:Object.keys(e.data||{}).map((e=>(0,Z.br)(e)))}),(0,f.a)(e),new Error})))}Promise.all(c).then((()=>{s({step:H})})).catch((()=>{o("error",(0,r.__)("There was a problem updating your business details","woocommerce"))}))}async persistValues(){await this.persistProfileItems();try{window.localStorage.setItem(W,JSON.stringify(this.state.savedValues.freeFeaturesTab))}catch(e){this.props.createNotice("error",(0,r.__)("There was a problem saving free features state","woocommerce"))}}async persistProfileItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{updateProfileItems:t,createNotice:o}=this.props,{businessDetailsTab:s={}}=this.state.savedValues,{number_employees:n,other_platform:i,other_platform_name:a,product_count:l,revenue:c,selling_venues:m,setup_client:u}=s,p={number_employees:n,other_platform:i,other_platform_name:"other"===i?a:"",product_count:l,revenue:c,selling_venues:m,setup_client:u,...e};return t(Object.entries(p).reduce(((e,t)=>{let[o,s]=t;return""!==s&&(e[o]=s),e}),{})).catch((()=>{o("error",(0,r.__)("There was a problem updating your business details","woocommerce"))}))}validate(e){const t={};return e.product_count.length||(t.product_count=(0,r.__)("This field is required","woocommerce")),e.selling_venues.length||(t.selling_venues=(0,r.__)("This field is required","woocommerce")),!e.other_platform.length&&G(e.selling_venues)&&(t.other_platform=(0,r.__)("This field is required","woocommerce")),!e.other_platform_name.trim().length&&"other"===e.other_platform&&G(e.selling_venues)&&(t.other_platform_name=(0,r.__)("This field is required","woocommerce")),!e.number_employees.length&&q(e.selling_venues)&&(t.number_employees=(0,r.__)("This field is required","woocommerce")),!e.revenue.length&&q(e.selling_venues)&&(t.revenue=(0,r.__)("This field is required","woocommerce")),0===Object.keys(t).length&&this.setState({isValid:!0}),t}trackBusinessDetailsStep(e){let{number_employees:t,other_platform:o,other_platform_name:s,product_count:r,selling_venues:n,revenue:i,setup_client:a}=e;const{getCurrencyConfig:l}=this.context;(0,u.recordEvent)("storeprofiler_store_business_details_continue_variant",{number_employees:t,already_selling:n,currency:l().code,product_number:r,revenue:i,used_platform:o,used_platform_name:s,setup_client:a,wp_version:(0,p.getSetting)("wpVersion")}),(0,u.recordEvent)("storeprofiler_step_complete",{step:j,wc_version:(0,p.getSetting)("wcVersion")})}getSelectControlProps(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const{className:o,...s}=e(t);return{...s,className:w()(`woocommerce-profile-wizard__${t.replace(/\_/g,"-")}`,o)}}renderBusinessDetailsStep(){const{goToNextStep:e,isInstallingActivating:t,hasInstallActivateError:o}=this.props,{formatAmount:n,getCurrencyConfig:i}=this.context,a=(l=i(),[{key:"0",label:(0,r.__)("I don't have any products yet.","woocommerce")},{key:"1-10",label:N(l,1,10)},{key:"11-100",label:N(l,11,100)},{key:"101-1000",label:N(l,101,1e3)},{key:"1000+",label:N(l,1e3)}]);var l;return(0,s.createElement)(_.Form,{initialValues:this.state.savedValues.businessDetailsTab,onSubmit:t=>{this.props.hasInstallableExtensions?this.setState({savedValues:{...this.state.savedValues,businessDetailsTab:t},currentTab:H}):e({step:H}),this.trackBusinessDetailsStep(t),(0,u.recordEvent)("storeprofiler_step_view",{step:H,wc_version:(0,p.getSetting)("wcVersion")})},onChange:(e,t,o)=>{const s={...this.state.savedValues,businessDetailsTab:t};this.setState({savedValues:s,isValid:o}),this.props.updateCurrentStepValues(this.props.step.key,s)},validate:this.validate},(l=>{let{getInputProps:c,handleSubmit:m,values:u,isValidForm:p}=l;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(h.__experimentalText,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("Tell us about your business","woocommerce")),(0,s.createElement)(h.__experimentalText,{variant:"body",as:"p"},(0,r.__)("We'd love to know if you are just getting started or you already have a business in place.","woocommerce"))),(0,s.createElement)(h.Card,null,(0,s.createElement)(h.CardBody,null,(0,s.createElement)(_.SelectControl,(0,d.Z)({excludeSelectedOptions:!1,label:(0,r.__)("How many products do you plan to display?","woocommerce"),options:a,required:!0},this.getSelectControlProps(c,"product_count"))),(0,s.createElement)(_.SelectControl,(0,d.Z)({excludeSelectedOptions:!1,label:(0,r.__)("Currently selling elsewhere?","woocommerce"),options:E,required:!0},this.getSelectControlProps(c,"selling_venues"))),q(u.selling_venues)&&(0,s.createElement)(_.SelectControl,(0,d.Z)({excludeSelectedOptions:!1,label:(0,r.__)("How many employees do you have?","woocommerce"),options:v,required:!0},this.getSelectControlProps(c,"number_employees"))),q(u.selling_venues)&&(0,s.createElement)(_.SelectControl,(0,d.Z)({excludeSelectedOptions:!1,label:(0,r.__)("What's your current annual revenue?","woocommerce"),options:P(i(),this.props.settings.woocommerce_default_country,n),required:!0},this.getSelectControlProps(c,"revenue"))),G(u.selling_venues)&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"business-competitors"},(0,s.createElement)(_.SelectControl,(0,d.Z)({excludeSelectedOptions:!1,label:(0,r.__)("Which platform is the store using?","woocommerce"),options:y,required:!0},this.getSelectControlProps(c,"other_platform"))),"other"===u.other_platform&&(0,s.createElement)(_.TextControl,(0,d.Z)({label:(0,r.__)("What is the platform name?","woocommerce"),required:!0},this.getSelectControlProps(c,"other_platform_name")))))),(0,s.createElement)(h.CardFooter,{isBorderless:!0},(0,s.createElement)(h.FlexItem,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__client"},(0,s.createElement)(h.CheckboxControl,(0,d.Z)({label:(0,r.__)("I'm setting up a store for a client","woocommerce")},c("setup_client")))))),(0,s.createElement)(h.CardFooter,{justify:"center"},(0,s.createElement)(h.Button,{isPrimary:!0,onClick:async()=>{await m(),this.persistProfileItems()},disabled:!p,"aria-disabled":!p,isBusy:t},o?(0,r.__)("Retry","woocommerce"):(0,r.__)("Continue","woocommerce")),o&&(0,s.createElement)(h.Button,{onClick:()=>{this.persistProfileItems(),e({step:H})}},(0,r.__)("Continue without installing","woocommerce")))))}))}renderFreeFeaturesStep(){const{isInstallingActivating:e}=this.props,{savedValues:{freeFeaturesTab:t}}=this.state;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(h.__experimentalText,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("Included business features","woocommerce")),(0,s.createElement)(h.__experimentalText,{variant:"body",as:"p"},(0,r.__)("We recommend enhancing your store with these free extensions","woocommerce")),(0,s.createElement)(h.__experimentalText,{variant:"body",as:"p"},(0,r.__)("No commitment required - you can remove them at any time.","woocommerce"))),(0,s.createElement)(U,{isInstallingActivating:e,onSubmit:this.onContinue,installableExtensions:this.props.installableExtensions,installExtensionOptions:t.installExtensionOptions,setInstallExtensionOptions:e=>{const o={...this.state.savedValues,freeFeaturesTab:{...t,installExtensionOptions:e}};this.setState({savedValues:o}),this.state.savedValues.freeFeaturesTab.installExtensionOptions&&this.props.updateCurrentStepValues(this.props.step.key,o)}}))}render(){const e=[];return this.props.hasFinishedGetFreeExtensionsResolution?(e.push({name:this.state.currentTab===j?"current-tab":j,id:j,title:(0,r.__)("Business details","woocommerce")}),this.props.hasInstallableExtensions&&e.push({name:this.state.currentTab===H?"current-tab":H,id:H,title:(0,r.__)("Free features","woocommerce"),className:this.state.isValid?"":"is-disabled"}),(0,s.createElement)(h.TabPanel,{activeClass:"is-active",initialTabName:"current-tab",onSelect:e=>{this.state.currentTab!==e&&"current-tab"!==e&&(this.setState({currentTab:e,savedValues:this.state.savedValues||this.props.initialValues}),(0,u.recordEvent)("storeprofiler_step_view",{step:e,wc_version:(0,p.getSetting)("wcVersion")}))},tabs:e},(e=>(0,s.createElement)(s.Fragment,null,this.getTab(e.id))))):(0,s.createElement)("div",{className:"woocommerce-admin__business-details__spinner"},(0,s.createElement)(h.Spinner,null))}getTab(e){return e===j?this.renderBusinessDetailsStep():this.renderFreeFeaturesStep()}}$.contextType=C.$;const J=(0,i.compose)((0,l.withSelect)((e=>{const{getSettings:t,getSettingsError:o}=e(m.SETTINGS_STORE_NAME),{getProfileItems:s,getOnboardingError:r,getFreeExtensions:n,hasFinishedResolution:i}=e(m.ONBOARDING_STORE_NAME),{getPluginsError:a,isPluginsRequesting:l}=e(m.PLUGINS_STORE_NAME),{general:c={}}=t("general"),u=n(),p=s(),d=c.woocommerce_default_country?c.woocommerce_default_country:null,h=u?(e=>{let{freeExtensionBundleByCategory:t,country:o,productTypes:s}=e;return t.filter((e=>(window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===(0,b.so)(o)&&s.includes("subscriptions")&&(e.plugins=e.plugins.filter((e=>"woocommerce-payments"!==e.key||"woocommerce-payments"===e.key&&!e.is_activated))),z.includes(e.key))))})({freeExtensionBundleByCategory:u,country:d,productTypes:p.product_types||[]}):[],_=h.some((e=>{let{plugins:t}=e;return t.length>0}));return{hasInstallActivateError:a("installPlugins")||a("activatePlugins"),hasInstallableExtensions:_,hasFinishedGetFreeExtensionsResolution:i("getFreeExtensions"),installableExtensions:h,isError:Boolean(r("updateProfileItems")),isSettingsError:Boolean(o("general")),isInstallingActivating:l("installPlugins")||l("activatePlugins")||l("getJetpackConnectUrl"),profileItems:p,settings:c}})),(0,l.withDispatch)((e=>{const{updateProfileItems:t,invalidateResolutionForStoreSelector:o}=e(m.ONBOARDING_STORE_NAME),{installAndActivatePlugins:s}=e(m.PLUGINS_STORE_NAME),{createNotice:r}=e("core/notices");return{createNotice:r,installAndActivatePlugins:s,updateProfileItems:t,invalidateResolutionForStoreSelector:o}})))($),K=e=>{const{profileItems:t,isLoading:o}=(0,l.useSelect)((e=>({isLoading:!e(m.ONBOARDING_STORE_NAME).hasFinishedResolution("getProfileItems")||!e(m.SETTINGS_STORE_NAME).hasFinishedResolution("getSettings",["general"]),profileItems:e(m.ONBOARDING_STORE_NAME).getProfileItems()}))),r=(0,s.useMemo)((()=>{try{const e=JSON.parse(window.localStorage.getItem(W));if(e)return e}catch(e){}return{install_extensions:!0}}),[]);if(o)return(0,s.createElement)("div",{className:"woocommerce-admin__business-details__spinner"},(0,s.createElement)(h.Spinner,null));const n={businessDetailsTab:{number_employees:t.number_employees||"",other_platform:t.other_platform||"",other_platform_name:t.other_platform_name||"",product_count:t.product_count||"",selling_venues:t.selling_venues||"",revenue:t.revenue||"",setup_client:t.setup_client||!1},freeFeaturesTab:r};return(0,s.createElement)(J,(0,d.Z)({},e,{initialValues:n}))};var Y=o(79205);const Q=(0,Y.O3)("onboarding",{});class X extends s.Component{constructor(e){const t=(0,a.get)(e,"profileItems",{});let o=Array.isArray(t.industry)?[...t.industry]:[];const{locationSettings:s}=e;if("US"!==(0,b.w)(s.woocommerce_default_country)){const e="cbd-other-hemp-derived-products";o=o.filter((t=>e!==t&&e!==t.slug))}super(),this.state={error:null,selected:o,textInputListContent:{}},this.onContinue=this.onContinue.bind(this),this.onIndustryChange=this.onIndustryChange.bind(this),this.onDetailChange=this.onDetailChange.bind(this);const r=this.getSelectedSlugs();e.trackStepValueChanges(e.step.key,r,r,this.onContinue)}getSelectedSlugs(){return this.state.selected.map((e=>e.slug))}componentDidUpdate(){this.props.updateCurrentStepValues(this.props.step.key,this.getSelectedSlugs())}async onContinue(){if(await this.validateField(),this.state.error)return;const{createNotice:e,isError:t,updateProfileItems:o}=this.props,s=this.state.selected.map((e=>e.slug)),n=this.state.selected.map((e=>e.detail)).filter((e=>e)).join(",");return(0,u.recordEvent)("storeprofiler_store_industry_continue",{store_industry:s,industries_with_detail:n}),await o({industry:this.state.selected}),!t||(e("error",(0,r.__)("There was a problem updating your industries","woocommerce")),Promise.reject())}async validateField(){const e=this.state.selected.length?null:(0,r.__)("Please select at least one industry","woocommerce");this.setState({error:e})}onIndustryChange(e){this.setState((t=>{const o=t.selected,s=(0,a.find)(o,{slug:e});if(s){const o=t.textInputListContent;return o[e]=s.detail,{selected:(0,a.filter)(t.selected,(t=>t.slug!==e))||[],textInputListContent:o}}return o.push({slug:e,detail:t.textInputListContent[e]}),{selected:o}}),(()=>this.validateField()))}onDetailChange(e,t){this.setState((o=>{const s=o.selected,r=o.textInputListContent;return s[(0,a.findIndex)(s,{slug:t})].detail=e,r[t]=e,{selected:s,textInputListContent:r}}))}renderIndustryLabel(e,t,o){const{textInputListContent:r}=this.state;return(0,s.createElement)(s.Fragment,null,t.label,t.use_description&&o&&(0,s.createElement)(_.TextControl,{key:`text-control-${e}`,label:t.description_label,value:o.detail||r[e]||"",onChange:t=>this.onDetailChange(t,e),className:"woocommerce-profile-wizard__text"}))}render(){const{industries:e}=Q,{error:t,selected:o}=this.state,{locationSettings:n,isProfileItemsRequesting:i}=this.props,l=(0,b.w)(n.woocommerce_default_country),c=Object.keys(e),m="US"===l?c:c.filter((e=>"cbd-other-hemp-derived-products"!==e));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(O.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("In which industry does the store operate?","woocommerce")),(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Choose any that apply","woocommerce"))),(0,s.createElement)(h.Card,null,(0,s.createElement)(h.CardBody,{size:null},(0,s.createElement)("div",{className:"woocommerce-profile-wizard__checkbox-group"},m.map((t=>{const r=(0,a.find)(o,{slug:t});return(0,s.createElement)(h.CheckboxControl,{key:`checkbox-control-${t}`,label:this.renderIndustryLabel(t,e[t],r),onChange:()=>this.onIndustryChange(t),checked:r||!1,className:"woocommerce-profile-wizard__checkbox"})})),t&&(0,s.createElement)("span",{className:"woocommerce-profile-wizard__error"},t))),(0,s.createElement)(h.CardFooter,{isBorderless:!0,justify:"center"},(0,s.createElement)(h.Button,{isPrimary:!0,onClick:()=>{this.onContinue().then(this.props.goToNextStep)},isBusy:i,disabled:!o.length||i,"aria-disabled":!o.length||i},(0,r.__)("Continue","woocommerce")))))}}var ee=(0,i.compose)((0,l.withSelect)((e=>{const{getProfileItems:t,getOnboardingError:o,isOnboardingRequesting:s,hasFinishedResolution:r}=e(m.ONBOARDING_STORE_NAME),{getSettings:n,hasFinishedResolution:i}=e(m.SETTINGS_STORE_NAME),{general:a={}}=n("general");return{isError:Boolean(o("updateProfileItems")),profileItems:t(),locationSettings:a,isProfileItemsRequesting:s("updateProfileItems"),isLoading:!r("getProfileItems",[])||!i("getSettings",["general"])}})),(0,l.withDispatch)((e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{createNotice:o}=e("core/notices");return{createNotice:o,updateProfileItems:t}})))((e=>e.isLoading?(0,s.createElement)("div",{className:"woocommerce-admin__industry__spinner",style:{textAlign:"center"}},(0,s.createElement)(h.Spinner,null)):(0,s.createElement)(X,e))),te=o(70444),oe=(0,s.createElement)(te.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(te.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));function se(e){let{annualPrice:t,description:o,isMonthlyPricing:n,label:i,moreUrl:a,slug:l}=e;const[c,m]=(0,s.useState)("");if(!t)return i;const p=(0,r.__)("This product type requires a paid extension.\nWe'll add this to a cart so that\nyou can purchase and install it later.","woocommerce");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{className:"woocommerce-product-wizard__product-types-label"},i),(0,s.createElement)(h.Button,{isTertiary:!0,label:(0,r.__)("Learn more about recommended free business features","woocommerce"),onClick:()=>{m(!0)}},(0,s.createElement)(I.Z,{icon:oe})),c&&(0,s.createElement)(h.Popover,{focusOnMount:"container",position:"top center",onClose:()=>m(!1)},(0,M.Z)({mixedString:o+(a?" {{moreLink/}}":""),components:{moreLink:a?(0,s.createElement)(_.Link,{href:a,target:"_blank",type:"external",onClick:()=>(0,u.recordEvent)("storeprofiler_store_product_type_learn_more",{product_type:l})},(0,r.__)("Learn more","woocommerce")):""}})),(0,s.createElement)(h.Tooltip,{text:p,position:"bottom center"},(0,s.createElement)(_.Pill,null,(0,s.createElement)("span",{className:"screen-reader-text"},p),n?(0,r.sprintf)((0,r.__)("$%f per month","woocommerce"),(t/12).toFixed(2)):(0,r.sprintf)((0,r.__)("$%f per year","woocommerce"),t))))}class re extends s.Component{constructor(){super(),this.state={error:null,isMonthlyPricing:!0,selected:[],isWCPayInstalled:null},this.onContinue=this.onContinue.bind(this),this.onChange=this.onChange.bind(this)}componentDidMount(){const{installedPlugins:e,invalidateResolution:t}=this.props,{isWCPayInstalled:o}=this.state;t("getProductTypes",[]),null===o&&e&&this.setState({isWCPayInstalled:e.includes("woocommerce-payments")})}componentDidUpdate(e,t){const{profileItems:o,productTypes:s}=this.props;if(this.state.selected!==t.selected&&this.props.updateCurrentStepValues(this.props.step.key,this.state.selected),e.productTypes!==s){const e=Object.keys(s).filter((e=>!!s[e].default));this.setState({selected:Array.isArray(o.product_types)?[...o.product_types]:e},(()=>{this.props.trackStepValueChanges(this.props.step.key,[...this.state.selected],this.state.selected,this.onContinue)}))}}validateField(){const e=this.state.selected.length?null:(0,r.__)("Please select at least one product type","woocommerce");return this.setState({error:e}),!e}onContinue(e){const{selected:t}=this.state,{installedPlugins:o=[]}=this.props;if(!this.validateField())return;const{countryCode:s,createNotice:n,installAndActivatePlugins:i,updateProfileItems:a,productTypes:l}=this.props,c={product_type:t,wcpay_installed:!1},m=[a({product_types:t})];window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===s&&l.subscriptions&&!l.subscriptions.yearly_price&&!o.includes("woocommerce-payments")&&t.includes("subscriptions")&&m.push(i(["woocommerce-payments"]).then((e=>{c.wcpay_installed=!0,e.data&&e.data.install_time&&e.data.install_time["woocommerce-payments"]&&(c.install_time_wcpay=e.data.install_time["woocommerce-payments"]),(0,f.a)(e)})).catch((e=>{throw(0,f.a)(e),new Error}))),Promise.all(m).then((()=>{(0,u.recordEvent)("storeprofiler_store_product_type_continue",c),"function"==typeof e&&e()})).catch((()=>n("error",(0,r.__)("There was a problem updating your product types","woocommerce"))))}onChange(e){this.setState((t=>{if((0,a.includes)(t.selected,e))return{selected:(0,a.filter)(t.selected,(t=>t!==e))||[]};const o=t.selected;return o.push(e),{selected:o}}),(()=>this.validateField()))}render(){const{productTypes:e=[]}=this.props,{error:t,isMonthlyPricing:o,isWCPayInstalled:n,selected:i}=this.state,{countryCode:a,isInstallingActivating:l,isProductTypesRequesting:c,isProfileItemsRequesting:m}=this.props;return c?(0,s.createElement)("div",{className:"woocommerce-profile-wizard__product-types__spinner"},(0,s.createElement)(h.Spinner,null)):(0,s.createElement)("div",{className:"woocommerce-profile-wizard__product-types"},(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(O.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("What type of products will be listed?","woocommerce")),(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Choose any that apply","woocommerce"))),(0,s.createElement)(h.Card,null,(0,s.createElement)(h.CardBody,{size:null},Object.keys(e).map((t=>(0,s.createElement)(h.CheckboxControl,{key:t,label:(0,s.createElement)(se,{description:e[t].description,label:e[t].label,annualPrice:e[t].yearly_price,isMonthlyPricing:o,moreUrl:e[t].more_url,slug:t}),onChange:()=>this.onChange(t),checked:i.includes(t),className:"woocommerce-profile-wizard__checkbox"}))),t&&(0,s.createElement)("span",{className:"woocommerce-profile-wizard__error"},t)),(0,s.createElement)(h.CardFooter,{isBorderless:!0,justify:"center"},(0,s.createElement)(h.Button,{isPrimary:!0,onClick:()=>{this.onContinue(this.props.goToNextStep)},isBusy:m||l,disabled:!i.length||m||l,"aria-disabled":!i.length||m||l},(0,r.__)("Continue","woocommerce")))),(0,s.createElement)("div",{className:"woocommerce-profile-wizard__card-help-footnote"},(0,s.createElement)("div",{className:"woocommerce-profile-wizard__product-types-pricing-toggle woocommerce-profile-wizard__checkbox"},(0,s.createElement)("label",{htmlFor:"woocommerce-product-types__pricing-toggle"},(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Display monthly prices","woocommerce")),(0,s.createElement)(h.FormToggle,{id:"woocommerce-product-types__pricing-toggle",checked:o,onChange:()=>this.setState({isMonthlyPricing:!o})}))),(0,s.createElement)(O.Text,{variant:"caption",size:"12",lineHeight:"16px"},(0,r.__)("Billing is annual. All purchases are covered by our 30 day money back guarantee and include access to support and updates. Extensions will be added to a cart for you to purchase later.","woocommerce")),window.wcAdminFeatures&&window.wcAdminFeatures.subscriptions&&"US"===a&&!n&&e.subscriptions&&!e.subscriptions.yearly_price&&i.includes("subscriptions")&&(0,s.createElement)(O.Text,{variant:"body",size:"12",lineHeight:"16px",as:"p"},(0,r.__)("The following extensions will be added to your site for free: WooCommerce Payments. An account is required to use this feature.","woocommerce"))))}}var ne=(0,i.compose)((0,l.withSelect)((e=>{const{getProfileItems:t,getProductTypes:o,getOnboardingError:s,hasFinishedResolution:r,isOnboardingRequesting:n}=e(m.ONBOARDING_STORE_NAME),{getSettings:i}=e(m.SETTINGS_STORE_NAME),{getInstalledPlugins:a,isPluginsRequesting:l}=e(m.PLUGINS_STORE_NAME),{general:c={}}=i("general");return{isError:Boolean(s("updateProfileItems")),profileItems:t(),isProfileItemsRequesting:n("updateProfileItems"),installedPlugins:a(),isInstallingActivating:l("installPlugins")||l("activatePlugins"),countryCode:(0,b.so)(c.woocommerce_default_country),productTypes:o(),isProductTypesRequesting:!r("getProductTypes")}})),(0,l.withDispatch)((e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{createNotice:o}=e("core/notices"),{installAndActivatePlugins:s}=e(m.PLUGINS_STORE_NAME),{invalidateResolution:r}=e(m.ONBOARDING_STORE_NAME);return{createNotice:o,installAndActivatePlugins:s,invalidateResolution:r,updateProfileItems:t}})))(re),ie=e=>{let{onClose:t,onSave:o}=e;const n=(0,r.__)("Save changes?","woocommerce"),i=(0,r.__)("You're about to go to a different step. Do you want to save the changes you've made here so far?","woocommerce"),a=(0,r.__)("Discard","woocommerce"),l=(0,r.__)("Save","woocommerce");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(h.Modal,{title:n,className:"woocommerce-obw-unsaved-changes",onRequestClose:t},(0,s.createElement)("div",{className:"woocommerce-obw-unsaved-changes-modal__wrapper"},(0,s.createElement)("div",{className:"woocommerce-usage-modal__message"},i),(0,s.createElement)("div",{className:"woocommerce-usage-modal__actions"},(0,s.createElement)(h.Button,{onClick:()=>t()},a),(0,s.createElement)(h.Button,{isPrimary:!0,onClick:o},l)))))};class ae extends s.Component{constructor(e){super(e),this.state={showUnsavedChangesModal:!1},this.lastClickedStepKey=null,this.onStepClick=this.onStepClick.bind(this)}shouldWarnForUnsavedChanges(e){if(void 0!==this.props.stepValueChanges[e]){const t=this.props.stepValueChanges[e].initialValues,o=this.props.stepValueChanges[e].currentValues;return Array.isArray(t)&&Array.isArray(o)&&(t.sort(),o.sort()),!(0,a.isEqual)(t,o)}return!1}findCurrentStep(){return this.props.steps.find((e=>e.key===this.props.currentStep))}moveToLastClickedStep(){this.lastClickedStepKey&&((0,c.updateQueryString)({step:this.lastClickedStepKey}),this.lastClickedStepKey=null)}saveCurrentStepChanges(){const e=this.findCurrentStep();if(!e)return null;const t=this.props.stepValueChanges[e.key];"function"==typeof t.onSave&&t.onSave()}renderStepper(){const{currentStep:e,steps:t}=this.props,o=(0,a.filter)(t,(e=>!!e.label)),r=o.findIndex((t=>t.key===e));return o.forEach(((e,t)=>{const s=o[t-1];e.isComplete=e.isComplete||t
{this.setState({showUnsavedChangesModal:!1}),this.moveToLastClickedStep()},onSave:()=>{this.saveCurrentStepChanges(),this.setState({showUnsavedChangesModal:!1}),this.moveToLastClickedStep()}}),this.renderStepper()):null}}var le=o(96483),ce=o(68987),me=o(45350);const ue=h.FlexItem||(e=>{let{children:t,align:o}=e;const r={display:"flex","justify-content":o?"center":"flex-start"};return(0,s.createElement)("div",{style:r},t)}),pe=()=>(0,s.createElement)("div",{className:"woocommerce-admin__store-details__spinner"},(0,s.createElement)(h.Spinner,null));class de extends s.Component{constructor(e){super(e),this.state={showUsageModal:!1,skipping:!1,isSkipSetupPopoverVisible:!1},this.onContinue=this.onContinue.bind(this),this.onSubmit=this.onSubmit.bind(this),this.validateStoreDetails=this.validateStoreDetails.bind(this),this.onFormValueChange=this.onFormValueChange.bind(this),this.changedFormValues={}}componentDidUpdate(){!1===this.props.isLoading&&0===Object.keys(this.changedFormValues).length&&(this.changedFormValues={...this.props.initialValues},this.props.trackStepValueChanges(this.props.step.key,this.props.initialValues,this.changedFormValues,(()=>{this.onContinue(this.changedFormValues)})))}deriveCurrencySettings(e){if(!e)return null;const t=this.context,o=(0,b.so)(e),{currencySymbols:s={},localeInfo:r={}}=(0,Y.O3)("onboarding",{});return t.getDataForCountry(o,r,s)}onSubmit(){this.setState({showUsageModal:!0,skipping:!1})}onFormValueChange(e){this.changedFormValues[e.name]=e.value}async onContinue(e){const{createNotice:t,updateProfileItems:o,updateAndPersistSettingsForGroup:s,profileItems:n,settings:i,errorsRef:a}=this.props,l=this.deriveCurrencySettings(e.countryState);this.context.setCurrency(l),(0,u.recordEvent)("storeprofiler_store_details_continue",{store_country:(0,b.so)(e.countryState),derived_currency:l.code,email_signup:e.isAgreeMarketing}),await s("general",{general:{...i,woocommerce_store_address:e.addressLine1,woocommerce_store_address_2:e.addressLine2,woocommerce_default_country:e.countryState,woocommerce_store_city:e.city,woocommerce_store_postcode:e.postCode,woocommerce_currency:l.code,woocommerce_currency_pos:l.symbolPosition,woocommerce_price_thousand_sep:l.thousandSeparator,woocommerce_price_decimal_sep:l.decimalSeparator,woocommerce_price_num_decimals:l.precision}});const c={is_agree_marketing:e.isAgreeMarketing,store_email:e.storeEmail,is_store_country_set:"string"==typeof e.countryState&&""!==e.countryState};if("US"!==(0,b.w)(e.countryState)&&n.industry&&n.industry.length){const e="cbd-other-hemp-derived-products",t=n.industry.filter((t=>e!==t&&e!==t.slug));c.industry=t}let m=[];try{await o(c)}catch(e){var p;null!=e&&null!==(p=e.data)&&void 0!==p&&p.params&&(m=Object.values(e.data.params))}if(!Boolean(a.current.settings)&&!m.length)return!0;t("error",(0,r.__)("There was a problem saving your store details","woocommerce")),m.forEach((e=>t("error",e)))}validateStoreDetails(e){const{getLocale:t}=this.props,o=t(e.countryState),s=(0,ce.Yt)(o)(e);return e.storeEmail&&!(0,le.isEmail)(e.storeEmail)&&(s.storeEmail=(0,r.__)("Invalid email address","woocommerce")),!e.isAgreeMarketing||e.storeEmail&&e.storeEmail.trim().length||(s.storeEmail=(0,r.__)("Please enter your email address to subscribe","woocommerce")),s}render(){const{showUsageModal:e,skipping:t,isSkipSetupPopoverVisible:o}=this.state,{skipProfiler:n,isLoading:i,isBusy:a,initialValues:l,invalidateResolutionForStoreSelector:c}=this.props,m=(0,r.__)("Manual setup is only recommended for\n experienced WooCommerce users or developers.","woocommerce");return i?(0,s.createElement)("div",{className:"woocommerce-profile-wizard__store-details"},(0,s.createElement)(pe,null)):(0,s.createElement)("div",{className:"woocommerce-profile-wizard__store-details"},(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(O.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("Welcome to WooCommerce","woocommerce")),(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Tell us where you run your business to help us configure currency, shipping, taxes, and more in a fully automated way.","woocommerce"))),(0,s.createElement)(_.Form,{initialValues:l,onSubmit:this.onSubmit,validate:this.validateStoreDetails,onChange:this.onFormValueChange},(o=>{let{getInputProps:i,handleSubmit:l,values:c,isValidForm:m,setValue:u}=o;return(0,s.createElement)(h.Card,null,e&&(0,s.createElement)(me.Z,{onContinue:()=>{t?n():this.onContinue(c).then((()=>this.props.goToNextStep()))},onClose:()=>this.setState({showUsageModal:!1,skipping:!1})}),(0,s.createElement)(h.CardBody,null,(0,s.createElement)(ce.IO,{getInputProps:i,setValue:u}),(0,s.createElement)(_.TextControl,(0,d.Z)({label:(c.isAgreeMarketing,(0,r.__)("Email address","woocommerce")),required:c.isAgreeMarketing,autoComplete:"email"},i("storeEmail"))),(0,s.createElement)(ue,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__newsletter-signup"},(0,s.createElement)(h.CheckboxControl,(0,d.Z)({label:(0,s.createElement)(s.Fragment,null,(0,r.__)("Get tips, product updates and inspiration straight to your mailbox.","woocommerce")," ",(0,s.createElement)("span",{className:"woocommerce-profile-wizard__powered-by-mailchimp"},(0,r.__)("Powered by Mailchimp","woocommerce")))},i("isAgreeMarketing")))))),(0,s.createElement)(h.CardFooter,{justify:"center"},(0,s.createElement)(h.Button,{isPrimary:!0,onClick:l,isBusy:a,disabled:!m||a,"aria-disabled":!m||a},(0,r.__)("Continue","woocommerce"))))})),(0,s.createElement)("div",{className:"woocommerce-profile-wizard__footer"},(0,s.createElement)(h.Button,{isLink:!0,className:"woocommerce-profile-wizard__footer-link",onClick:()=>(c("getTaskLists"),this.setState({showUsageModal:!0,skipping:!0}),!1)},(0,r.__)("Skip setup store details","woocommerce")),(0,s.createElement)(h.Button,{isTertiary:!0,label:m,onClick:()=>this.setState({isSkipSetupPopoverVisible:!0})},(0,s.createElement)(I.Z,{icon:oe})),o&&(0,s.createElement)(h.Popover,{focusOnMount:"container",position:"top center",onClose:()=>this.setState({isSkipSetupPopoverVisible:!1})},m)))}}de.contextType=C.$;var he=(0,i.compose)((0,l.withSelect)((e=>{const{getSettings:t,getSettingsError:o,isUpdateSettingsRequesting:r}=e(m.SETTINGS_STORE_NAME),{getProfileItems:n,isOnboardingRequesting:i,getEmailPrefill:a,hasFinishedResolution:l}=e(m.ONBOARDING_STORE_NAME),{getLocale:c,getLocales:u,getCountries:p,hasFinishedResolution:d}=e(m.COUNTRIES_STORE_NAME),{isResolving:h}=e(m.OPTIONS_STORE_NAME),_=n(),g=a(),{general:w={}}=t("general"),C=i("updateProfileItems")||r("general")||h("getOption",["woocommerce_allow_tracking"]),f=!(l("getProfileItems")&&l("getEmailPrefill")&&d("getLocales")&&d("getCountries")),y=(0,s.useRef)({settings:null});y.current={settings:o("general")};const v=_.is_store_country_set?w.woocommerce_default_country:"";return p(),u(),{getLocale:c,initialValues:{addressLine1:w.woocommerce_store_address||"",addressLine2:w.woocommerce_store_address_2||"",city:w.woocommerce_store_city||"",countryState:v,postCode:w.woocommerce_store_postcode||"",isAgreeMarketing:"boolean"==typeof _.is_agree_marketing&&_.is_agree_marketing,storeEmail:"string"==typeof _.store_email?_.store_email:g},isLoading:f,profileItems:_,isBusy:C,settings:w,errorsRef:y}})),(0,l.withDispatch)((e=>{const{createNotice:t}=e("core/notices"),{invalidateResolutionForStoreSelector:o,updateProfileItems:s}=e(m.ONBOARDING_STORE_NAME),{updateAndPersistSettingsForGroup:r}=e(m.SETTINGS_STORE_NAME);return{createNotice:t,invalidateResolutionForStoreSelector:o,updateProfileItems:s,updateAndPersistSettingsForGroup:r}})))(de),_e=o(86989),ge=o.n(_e),we=o(22629),Ce=o(5833),fe=o(15244),ye=o(7862),ve=o.n(ye);const Ee=e=>{let{children:t,className:o}=e;return(0,p.isWpVersion)("5.8",">=")?(0,s.createElement)("div",{className:o},t):(0,s.createElement)(h.DropZoneProvider,null,(0,s.createElement)("div",{className:o},t))};class be extends s.Component{constructor(){super(),this.state={isUploading:!1},this.handleFilesUpload=this.handleFilesUpload.bind(this),this.handleFilesDrop=this.handleFilesDrop.bind(this)}handleFilesDrop(e){const t=e[0];this.uploadTheme(t)}handleFilesUpload(e){const t=e.target.files[0];this.uploadTheme(t)}uploadTheme(e){const{createNotice:t,onUploadComplete:o}=this.props;this.setState({isUploading:!0});const s=new window.FormData;return s.append("pluginzip",e),ge()({path:"/wc-admin/themes",method:"POST",body:s}).then((e=>{o(e),this.setState({isUploading:!1}),t(e.status,e.message)})).catch((e=>{this.setState({isUploading:!1}),e&&e.message&&t("error",e.message)}))}render(){const{className:e}=this.props,{isUploading:t}=this.state,o=w()("woocommerce-theme-uploader",e,{"is-uploading":t});return(0,s.createElement)(h.Card,{className:o},(0,s.createElement)(Ee,{className:"woocommerce-theme-uploader__dropzone-wrapper"},t?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_.Spinner,null),(0,s.createElement)(_.H,{className:"woocommerce-theme-uploader__title"},(0,r.__)("Uploading theme","woocommerce")),(0,s.createElement)("p",null,(0,r.__)("Your theme is being uploaded","woocommerce"))):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(h.FormFileUpload,{accept:".zip",onChange:this.handleFilesUpload},(0,s.createElement)(fe.Z,null),(0,s.createElement)(_.H,{className:"woocommerce-theme-uploader__title"},(0,r.__)("Upload a theme","woocommerce")),(0,s.createElement)("p",null,(0,r.__)("Drop a theme zip file here to upload","woocommerce"))),(0,s.createElement)(h.DropZone,{label:(0,r.__)("Drop your theme zip file here","woocommerce"),onFilesDrop:this.handleFilesDrop}))))}}be.propTypes={className:ve().string,onUploadComplete:ve().func},be.defaultProps={onUploadComplete:a.noop};var Se=(0,i.compose)((0,l.withDispatch)((e=>{const{createNotice:t}=e("core/notices");return{createNotice:t}})))(be),ke=o(60298),Ne=o(52260),xe=o(52384),Te=o(24929);const Pe=[{key:"mobile",icon:Ne.Z},{key:"tablet",icon:xe.Z},{key:"desktop",icon:Te.Z}];class Oe extends s.Component{constructor(){super(...arguments),this.state={device:"desktop"},this.handleDeviceClick=this.handleDeviceClick.bind(this)}handleDeviceClick(e){const{theme:t}=this.props;(0,u.recordEvent)("storeprofiler_store_theme_demo_device",{device:e,theme:t.slug}),this.setState({device:e})}render(){const{isBusy:e,onChoose:t,onClose:o,theme:n}=this.props,{demo_url:i,slug:a,title:l}=n,{device:c}=this.state;return(0,s.createElement)("div",{className:"woocommerce-theme-preview"},(0,s.createElement)("div",{className:"woocommerce-theme-preview__toolbar"},(0,s.createElement)(h.Button,{className:"woocommerce-theme-preview__close",onClick:o},(0,s.createElement)(I.Z,{icon:ke.Z})),(0,s.createElement)("div",{className:"woocommerce-theme-preview__theme-name"},(0,M.Z)({mixedString:(0,r.sprintf)((0,r.__)("{{strong}}%s{{/strong}} developed by WooCommerce","woocommerce"),l),components:{strong:(0,s.createElement)("strong",null)}})),(0,s.createElement)("div",{className:"woocommerce-theme-preview__devices"},Pe.map((e=>{const t=e.icon;return(0,s.createElement)(h.Button,{key:e.key,className:w()("woocommerce-theme-preview__device",{"is-selected":e.key===c}),onClick:()=>this.handleDeviceClick(e.key)},(0,s.createElement)(t,null))}))),(0,s.createElement)(h.Button,{isPrimary:!0,onClick:()=>t(a,"preview"),isBusy:e},(0,r.__)("Choose","woocommerce"))),(0,s.createElement)(_.WebPreview,{src:i,title:l,className:`is-${c}`}))}}var Ie=Oe;class Ve extends s.Component{constructor(){super(...arguments),this.state={activeTab:"all",chosen:null,demo:null,uploadedThemes:[]},this.handleUploadComplete=this.handleUploadComplete.bind(this),this.onChoose=this.onChoose.bind(this),this.onClosePreview=this.onClosePreview.bind(this),this.onSelectTab=this.onSelectTab.bind(this),this.openDemo=this.openDemo.bind(this),this.skipStep=this.skipStep.bind(this)}componentDidUpdate(e){const{isError:t,isUpdatingProfileItems:o,createNotice:s}=this.props,{chosen:n}=this.state,i=!o&&e.isUpdatingProfileItems&&!t&&n,a=!o&&e.isRequesting&&t;i&&(this.setState({chosen:null}),this.props.goToNextStep()),a&&(this.setState({chosen:null}),s("error",(0,r.__)("There was a problem selecting your store theme","woocommerce")))}skipStep(){const{activeTheme:e=""}=(0,Y.O3)("onboarding",{});(0,u.recordEvent)("storeprofiler_store_theme_skip_step",{activeTheme:e}),this.props.goToNextStep()}onChoose(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const{updateProfileItems:o}=this.props,{is_installed:s,price:r,slug:n}=e,{activeTheme:i=""}=(0,Y.O3)("onboarding",{});this.setState({chosen:n}),(0,u.recordEvent)("storeprofiler_store_theme_choose",{theme:n,location:t}),n!==i&&s?this.activateTheme(n):n!==i&&(0,b.wB)(r)<=0?this.installTheme(n):o({theme:n})}installTheme(e){const{createNotice:t}=this.props;ge()({path:"/wc-admin/onboarding/themes/install?theme="+e,method:"POST"}).then((()=>{this.activateTheme(e)})).catch((e=>{this.setState({chosen:null}),t("error",e.message)}))}activateTheme(e){const{createNotice:t,updateProfileItems:o}=this.props;ge()({path:"/wc-admin/onboarding/themes/activate?theme="+e,method:"POST"}).then((s=>{t("success",(0,r.sprintf)((0,r.__)("%s was installed and activated on your site","woocommerce"),s.name)),(0,Y.K7)("onboarding",{...(0,Y.O3)("onboarding",{}),activeTheme:s.slug}),o({theme:e})})).catch((e=>{this.setState({chosen:null}),t("error",e.message)}))}onClosePreview(){const{demo:e}=this.state;(0,u.recordEvent)("storeprofiler_store_theme_demo_close",{theme:e.slug}),document.body.classList.remove("woocommerce-theme-preview-active"),this.setState({demo:null})}openDemo(e){(0,u.recordEvent)("storeprofiler_store_theme_live_demo",{theme:e.slug}),document.body.classList.add("woocommerce-theme-preview-active"),this.setState({demo:e})}renderTheme(e){const{demo_url:t,has_woocommerce_support:o,image:n,slug:i,title:a}=e,{chosen:l}=this.state,{activeTheme:c=""}=(0,Y.O3)("onboarding",{});return(0,s.createElement)(h.Card,{className:"woocommerce-profile-wizard__theme",key:i},(0,s.createElement)(h.CardBody,{size:null},n&&(0,s.createElement)("div",{className:"woocommerce-profile-wizard__theme-image",style:{backgroundImage:`url(${n})`},role:"img","aria-label":a})),(0,s.createElement)(h.CardBody,{className:"woocommerce-profile-wizard__theme-details"},(0,s.createElement)(_.H,{className:"woocommerce-profile-wizard__theme-name"},a,!o&&(0,s.createElement)(h.Tooltip,{text:(0,r.__)("This theme does not support WooCommerce.","woocommerce")},(0,s.createElement)("span",null,(0,s.createElement)(Ce.Z,{role:"img","aria-hidden":"true",focusable:"false"})))),(0,s.createElement)("p",{className:"woocommerce-profile-wizard__theme-status"},this.getThemeStatus(e))),(0,s.createElement)(h.CardFooter,null,i===c?(0,s.createElement)(h.Button,{isPrimary:!0,onClick:()=>this.onChoose(e,"card"),isBusy:l===i,disabled:l===i},(0,r.__)("Continue with my active theme","woocommerce")):(0,s.createElement)(h.Button,{isSecondary:!0,onClick:()=>this.onChoose(e,"card"),isBusy:l===i,disabled:l===i},(0,r.__)("Choose","woocommerce")),t&&(0,s.createElement)(h.Button,{isTertiary:!0,onClick:()=>this.openDemo(e)},(0,r.__)("Live demo","woocommerce"))))}getThemeStatus(e){const{is_installed:t,price:o,slug:s}=e,{activeTheme:n=""}=(0,Y.O3)("onboarding",{});return n===s?(0,r.__)("Currently active theme","woocommerce"):t?(0,r.__)("Installed","woocommerce"):(0,b.wB)(o)<=0?(0,r.__)("Free","woocommerce"):(0,r.sprintf)((0,r.__)("%s per year","woocommerce"),(0,we.decodeEntities)(o))}doesActiveThemeSupportWooCommerce(){const{activeTheme:e=""}=(0,Y.O3)("onboarding",{}),t=this.getThemes().find((t=>t.slug===e));return t&&t.has_woocommerce_support}onSelectTab(e){(0,u.recordEvent)("storeprofiler_store_theme_navigate",{navigation:e}),this.setState({activeTab:e})}getPriceValue(e){return Number((0,we.decodeEntities)(e).replace(/[^0-9.-]+/g,""))}getThemes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";const{uploadedThemes:t}=this.state,{activeTheme:o="",themes:s=[]}=(0,Y.O3)("onboarding",{}),r=[...s.filter((e=>e&&(e.has_woocommerce_support||e.slug===o))),...t];switch(e){case"paid":return r.filter((e=>(0,b.wB)(e.price)>0));case"free":return r.filter((e=>(0,b.wB)(e.price)<=0));default:return r}}handleUploadComplete(e){"success"===e.status&&e.theme_data&&(this.setState({uploadedThemes:[...this.state.uploadedThemes,e.theme_data]}),(0,u.recordEvent)("storeprofiler_store_theme_upload",{theme:e.theme_data.slug}))}render(){const{activeTab:e,chosen:t,demo:o}=this.state,n=this.getThemes(e),i=this.doesActiveThemeSupportWooCommerce();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"woocommerce-profile-wizard__step-header"},(0,s.createElement)(O.Text,{variant:"title.small",as:"h2",size:"20",lineHeight:"28px"},(0,r.__)("Choose a theme","woocommerce")),(0,s.createElement)(O.Text,{variant:"body",as:"p"},(0,r.__)("Choose how your store appears to customers. And don't worry, you can always switch themes and edit them later.","woocommerce"))),(0,s.createElement)(h.TabPanel,{className:"woocommerce-profile-wizard__themes-tab-panel",activeClass:"is-active",onSelect:this.onSelectTab,tabs:[{name:"all",title:(0,r.__)("All themes","woocommerce")},{name:"paid",title:(0,r.__)("Paid themes","woocommerce")},{name:"free",title:(0,r.__)("Free themes","woocommerce")}]},(()=>(0,s.createElement)("div",{className:"woocommerce-profile-wizard__themes"},n&&n.map((e=>this.renderTheme(e))),(0,s.createElement)(Se,{onUploadComplete:this.handleUploadComplete})))),o&&(0,s.createElement)(Ie,{theme:o,onChoose:()=>this.onChoose(o,"card"),onClose:this.onClosePreview,isBusy:t===o.slug}),i&&(0,s.createElement)("p",{className:"woocommerce-profile-wizard__themes-skip-this-step"},(0,s.createElement)(h.Button,{isLink:!0,className:"woocommerce-profile-wizard__skip",onClick:()=>this.skipStep()},(0,r.__)("Skip this step","woocommerce"))))}}var Fe=(0,i.compose)((0,l.withSelect)((e=>{const{getProfileItems:t,getOnboardingError:o,isOnboardingRequesting:s}=e(m.ONBOARDING_STORE_NAME);return{isError:Boolean(o("updateProfileItems")),isUpdatingProfileItems:s("updateProfileItems"),profileItems:t()}})),(0,l.withDispatch)((e=>{const{updateProfileItems:t}=e(m.ONBOARDING_STORE_NAME),{createNotice:o}=e("core/notices");return{createNotice:o,updateProfileItems:t}})))(Ve);class Me extends s.Component{constructor(e){super(e),this.cachedActivePlugins=e.activePlugins,this.goToNextStep=this.goToNextStep.bind(this),this.trackStepValueChanges=this.trackStepValueChanges.bind(this),this.updateCurrentStepValues=this.updateCurrentStepValues.bind(this),this.stepValueChanges={}}componentDidUpdate(e){const{step:t}=e.query,{step:o}=this.props.query,{isError:s,isGetProfileItemsRequesting:n,createNotice:i}=this.props;!n&&e.isRequesting&&s&&i("error",(0,r.__)("There was a problem finishing the setup wizard","woocommerce")),t!==o&&(window.document.documentElement.scrollTop=0,(0,u.recordEvent)("storeprofiler_step_view",{step:this.getCurrentStep().key,wc_version:(0,p.getSetting)("wcVersion")}))}componentDidMount(){document.body.classList.remove("woocommerce-admin-is-loading"),document.body.classList.add("woocommerce-profile-wizard__body"),document.body.classList.add("woocommerce-admin-full-screen"),document.body.classList.add("is-wp-toolbar-disabled"),(0,u.recordEvent)("storeprofiler_step_view",{step:this.getCurrentStep().key,wc_version:(0,p.getSetting)("wcVersion")})}componentWillUnmount(){document.body.classList.remove("woocommerce-profile-wizard__body"),document.body.classList.remove("woocommerce-admin-full-screen"),document.body.classList.remove("is-wp-toolbar-disabled")}trackStepValueChanges(e,t,o,s){this.stepValueChanges[e]={initialValues:t,currentValues:o,onSave:s}}updateCurrentStepValues(e,t){this.stepValueChanges[e]&&(this.stepValueChanges[e].currentValues=t)}getSteps(){const{profileItems:e}=this.props,t=[];return t.push({key:"store-details",container:he,label:(0,r.__)("Store Details","woocommerce"),isComplete:e.hasOwnProperty("setup_client")&&null!==e.setup_client}),t.push({key:"industry",container:ee,label:(0,r.__)("Industry","woocommerce"),isComplete:e.hasOwnProperty("industry")&&null!==e.industry}),t.push({key:"product-types",container:ne,label:(0,r.__)("Product Types","woocommerce"),isComplete:e.hasOwnProperty("product_types")&&null!==e.product_types}),t.push({key:"business-details",container:K,label:(0,r.__)("Business Details","woocommerce"),isComplete:e.hasOwnProperty("product_count")&&null!==e.product_count}),t.push({key:"theme",container:Fe,label:(0,r.__)("Theme","woocommerce"),isComplete:e.hasOwnProperty("theme")&&null!==e.theme}),(0,n.applyFilters)("woocommerce_admin_profile_wizard_steps",t)}getCurrentStep(){const{step:e}=this.props.query;return this.getSteps().find((t=>t.key===e))||this.getSteps()[0]}async goToNextStep(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{activePlugins:t}=this.props,o=this.getCurrentStep(),s=this.getSteps().findIndex((e=>e.key===o.key));(0,u.recordEvent)("storeprofiler_step_complete",{step:o.key,wc_version:(0,p.getSetting)("wcVersion"),...e}),this.cachedActivePlugins=t;const r=this.getSteps()[s+1];if(void 0!==r)return(0,c.updateQueryString)({step:r.key});this.completeProfiler()}completeProfiler(){const{activePlugins:e,isJetpackConnected:t,notes:o,updateNote:s,updateProfileItems:r,connectToJetpack:n}=this.props;(0,u.recordEvent)("storeprofiler_complete");const i=e.includes("jetpack")&&!t,a=o.find((e=>"wc-admin-onboarding-profiler-reminder"===e.name));a&&s(a.id,{status:"actioned"}),r({completed:!0}).then((()=>{const e=new URL((0,c.getNewPath)({},"/",{}),window.location.href).href;i?(document.body.classList.add("woocommerce-admin-is-loading"),n((()=>e))):window.location.href=e}))}skipProfiler(){const{createNotice:e,updateProfileItems:t}=this.props;t({skipped:!0}).then((()=>{(0,u.recordEvent)("storeprofiler_store_details_skip"),(0,c.getHistory)().push((0,c.getNewPath)({},"/",{}))})).catch((()=>{e("error",(0,r.__)("There was a problem skipping the setup wizard","woocommerce"))}))}render(){const{query:e}=this.props,t=this.getCurrentStep(),o=t.key,r=(0,s.createElement)(t.container,{query:e,step:t,goToNextStep:this.goToNextStep,skipProfiler:()=>{this.skipProfiler()},trackStepValueChanges:this.trackStepValueChanges,updateCurrentStepValues:this.updateCurrentStepValues}),n=this.getSteps().map((e=>(0,a.pick)(e,["key","label","isComplete"]))),i=`woocommerce-profile-wizard__container ${o}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ae,{currentStep:o,steps:n,stepValueChanges:this.stepValueChanges}),(0,s.createElement)("div",{className:i},r))}}var Ae=(0,i.compose)((0,l.withSelect)((e=>{const{getNotes:t}=e(m.NOTES_STORE_NAME),{getProfileItems:o,getOnboardingError:s}=e(m.ONBOARDING_STORE_NAME),{getActivePlugins:r,getPluginsError:n,isJetpackConnected:i}=e(m.PLUGINS_STORE_NAME),a=o(),l=t({page:1,per_page:m.QUERY_DEFAULTS.pageSize,type:"update",status:"unactioned"}),c=r();return{getPluginsError:n,isError:Boolean(s("updateProfileItems")),isJetpackConnected:i(),notes:l,profileItems:a,activePlugins:c}})),(0,l.withDispatch)((e=>{const{connectToJetpackWithFailureRedirect:t,createErrorNotice:o}=e(m.PLUGINS_STORE_NAME),{updateNote:s}=e(m.NOTES_STORE_NAME),{updateOptions:r}=e(m.OPTIONS_STORE_NAME),{updateProfileItems:n}=e(m.ONBOARDING_STORE_NAME),{createNotice:i}=e("core/notices");return{connectToJetpack:e=>{t(e,o,p.getAdminLink)},createNotice:i,updateNote:s,updateOptions:r,updateProfileItems:n}})),(0,Y.O3)("plugins")?(0,m.withPluginsHydration)({...(0,Y.O3)("plugins"),jetpackStatus:(0,Y.O3)("dataEndpoints",{}).jetpackStatus}):a.identity)(Me)},29230:function(e,t,o){o.r(t);var s=o(69307);t.default=e=>{let{}=e;return(0,s.createElement)("div",null,"Settings page")}},15244:function(e,t,o){t.Z=function(e){var t=e.size,o=void 0===t?24:t,s=e.onClick,a=(e.icon,e.className),l=function(e,t){if(null==e)return{};var o,s,r=function(e,t){if(null==e)return{};var o,s,r={},n=Object.keys(e);for(s=0;s