2 lines
76 KiB
JavaScript
2 lines
76 KiB
JavaScript
/*! For license information please see index.js.LICENSE.txt */
|
|
this.wc=this.wc||{},this.wc.data=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=462)}({0:function(t,e){t.exports=window.wp.element},10:function(t,e){t.exports=window.wp.dataControls},12:function(t,e){t.exports=window.wc.navigation},14:function(t,e){t.exports=window.wp.compose},15:function(t,e){t.exports=window.wp.url},17:function(t,e){t.exports=window.wp.apiFetch},19:function(t,e){t.exports=window.wc.date},2:function(t,e){t.exports=window.wp.i18n},250:function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},267:function(t,e,r){var n,o,s,i,a;n=r(448),o=r(250).utf8,s=r(449),i=r(250).bin,(a=function(t,e){t.constructor==String?t=e&&"binary"===e.encoding?i.stringToBytes(t):o.stringToBytes(t):s(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var r=n.bytesToWords(t),c=8*t.length,u=1732584193,d=-271733879,E=-1732584194,S=271733878,l=0;l<r.length;l++)r[l]=16711935&(r[l]<<8|r[l]>>>24)|4278255360&(r[l]<<24|r[l]>>>8);r[c>>>5]|=128<<c%32,r[14+(c+64>>>9<<4)]=c;var T=a._ff,_=a._gg,p=a._hh,g=a._ii;for(l=0;l<r.length;l+=16){var f=u,y=d,R=E,m=S;u=T(u,d,E,S,r[l+0],7,-680876936),S=T(S,u,d,E,r[l+1],12,-389564586),E=T(E,S,u,d,r[l+2],17,606105819),d=T(d,E,S,u,r[l+3],22,-1044525330),u=T(u,d,E,S,r[l+4],7,-176418897),S=T(S,u,d,E,r[l+5],12,1200080426),E=T(E,S,u,d,r[l+6],17,-1473231341),d=T(d,E,S,u,r[l+7],22,-45705983),u=T(u,d,E,S,r[l+8],7,1770035416),S=T(S,u,d,E,r[l+9],12,-1958414417),E=T(E,S,u,d,r[l+10],17,-42063),d=T(d,E,S,u,r[l+11],22,-1990404162),u=T(u,d,E,S,r[l+12],7,1804603682),S=T(S,u,d,E,r[l+13],12,-40341101),E=T(E,S,u,d,r[l+14],17,-1502002290),u=_(u,d=T(d,E,S,u,r[l+15],22,1236535329),E,S,r[l+1],5,-165796510),S=_(S,u,d,E,r[l+6],9,-1069501632),E=_(E,S,u,d,r[l+11],14,643717713),d=_(d,E,S,u,r[l+0],20,-373897302),u=_(u,d,E,S,r[l+5],5,-701558691),S=_(S,u,d,E,r[l+10],9,38016083),E=_(E,S,u,d,r[l+15],14,-660478335),d=_(d,E,S,u,r[l+4],20,-405537848),u=_(u,d,E,S,r[l+9],5,568446438),S=_(S,u,d,E,r[l+14],9,-1019803690),E=_(E,S,u,d,r[l+3],14,-187363961),d=_(d,E,S,u,r[l+8],20,1163531501),u=_(u,d,E,S,r[l+13],5,-1444681467),S=_(S,u,d,E,r[l+2],9,-51403784),E=_(E,S,u,d,r[l+7],14,1735328473),u=p(u,d=_(d,E,S,u,r[l+12],20,-1926607734),E,S,r[l+5],4,-378558),S=p(S,u,d,E,r[l+8],11,-2022574463),E=p(E,S,u,d,r[l+11],16,1839030562),d=p(d,E,S,u,r[l+14],23,-35309556),u=p(u,d,E,S,r[l+1],4,-1530992060),S=p(S,u,d,E,r[l+4],11,1272893353),E=p(E,S,u,d,r[l+7],16,-155497632),d=p(d,E,S,u,r[l+10],23,-1094730640),u=p(u,d,E,S,r[l+13],4,681279174),S=p(S,u,d,E,r[l+0],11,-358537222),E=p(E,S,u,d,r[l+3],16,-722521979),d=p(d,E,S,u,r[l+6],23,76029189),u=p(u,d,E,S,r[l+9],4,-640364487),S=p(S,u,d,E,r[l+12],11,-421815835),E=p(E,S,u,d,r[l+15],16,530742520),u=g(u,d=p(d,E,S,u,r[l+2],23,-995338651),E,S,r[l+0],6,-198630844),S=g(S,u,d,E,r[l+7],10,1126891415),E=g(E,S,u,d,r[l+14],15,-1416354905),d=g(d,E,S,u,r[l+5],21,-57434055),u=g(u,d,E,S,r[l+12],6,1700485571),S=g(S,u,d,E,r[l+3],10,-1894986606),E=g(E,S,u,d,r[l+10],15,-1051523),d=g(d,E,S,u,r[l+1],21,-2054922799),u=g(u,d,E,S,r[l+8],6,1873313359),S=g(S,u,d,E,r[l+15],10,-30611744),E=g(E,S,u,d,r[l+6],15,-1560198380),d=g(d,E,S,u,r[l+13],21,1309151649),u=g(u,d,E,S,r[l+4],6,-145523070),S=g(S,u,d,E,r[l+11],10,-1120210379),E=g(E,S,u,d,r[l+2],15,718787259),d=g(d,E,S,u,r[l+9],21,-343485551),u=u+f>>>0,d=d+y>>>0,E=E+R>>>0,S=S+m>>>0}return n.endian([u,d,E,S])})._ff=function(t,e,r,n,o,s,i){var a=t+(e&r|~e&n)+(o>>>0)+i;return(a<<s|a>>>32-s)+e},a._gg=function(t,e,r,n,o,s,i){var a=t+(e&n|r&~n)+(o>>>0)+i;return(a<<s|a>>>32-s)+e},a._hh=function(t,e,r,n,o,s,i){var a=t+(e^r^n)+(o>>>0)+i;return(a<<s|a>>>32-s)+e},a._ii=function(t,e,r,n,o,s,i){var a=t+(r^(e|~n))+(o>>>0)+i;return(a<<s|a>>>32-s)+e},a._blocksize=16,a._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);var r=n.wordsToBytes(a(t,e));return e&&e.asBytes?r:e&&e.asString?i.bytesToString(r):n.bytesToHex(r)}},30:function(t,e){t.exports=window.wp.hooks},4:function(t,e){t.exports=window.lodash},43:function(t,e){t.exports=window.wp.deprecated},447:function(t,e){t.exports=window.wp.coreData},448:function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],s=0;s<4;s++)8*n+6*s<=8*t.length?e.push(r.charAt(o>>>6*(3-s)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},449:function(t,e){function r(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){return null!=t&&(r(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}(t)||!!t._isBuffer)}},462:function(t,e,r){"use strict";r.r(e),r.d(e,"SETTINGS_STORE_NAME",(function(){return ht})),r.d(e,"withSettingsHydration",(function(){return Ut})),r.d(e,"useSettings",(function(){return wt})),r.d(e,"PLUGINS_STORE_NAME",(function(){return ke})),r.d(e,"pluginNames",(function(){return Nt})),r.d(e,"withPluginsHydration",(function(){return Me})),r.d(e,"ONBOARDING_STORE_NAME",(function(){return Fr})),r.d(e,"withOnboardingHydration",(function(){return Lr})),r.d(e,"USER_STORE_NAME",(function(){return qr})),r.d(e,"withCurrentUserHydration",(function(){return Yr})),r.d(e,"useUser",(function(){return Qr})),r.d(e,"useUserPreferences",(function(){return Kr})),r.d(e,"OPTIONS_STORE_NAME",(function(){return Ae})),r.d(e,"withOptionsHydration",(function(){return Vr})),r.d(e,"useOptionsHydration",(function(){return Wr})),r.d(e,"REVIEWS_STORE_NAME",(function(){return un})),r.d(e,"NOTES_STORE_NAME",(function(){return Dn})),r.d(e,"REPORTS_STORE_NAME",(function(){return Hn})),r.d(e,"ITEMS_STORE_NAME",(function(){return To})),r.d(e,"getLeaderboard",(function(){return $n})),r.d(e,"searchItemsByString",(function(){return Bn})),r.d(e,"NAVIGATION_STORE_NAME",(function(){return Lo})),r.d(e,"withNavigationHydration",(function(){return qo})),r.d(e,"PAYMENT_GATEWAYS_STORE_NAME",(function(){return cs})),r.d(e,"getFilterQuery",(function(){return ls})),r.d(e,"getSummaryNumbers",(function(){return ps})),r.d(e,"getReportTableData",(function(){return hs})),r.d(e,"getReportTableQuery",(function(){return As})),r.d(e,"getReportChartData",(function(){return Os})),r.d(e,"getTooltipValueFormat",(function(){return Is})),r.d(e,"MAX_PER_PAGE",(function(){return nt})),r.d(e,"QUERY_DEFAULTS",(function(){return dt})),r.d(e,"NAMESPACE",(function(){return tt})),r.d(e,"WC_ADMIN_NAMESPACE",(function(){return et})),r.d(e,"WCS_NAMESPACE",(function(){return rt})),r.d(e,"SECOND",(function(){return ot})),r.d(e,"MINUTE",(function(){return st})),r.d(e,"HOUR",(function(){return it})),r.d(e,"DAY",(function(){return at})),r.d(e,"WEEK",(function(){return ct})),r.d(e,"MONTH",(function(){return ut})),r.d(e,"EXPORT_STORE_NAME",(function(){return Fs})),r.d(e,"IMPORT_STORE_NAME",(function(){return ei})),r.d(e,"getFreeExtensions",(function(){return je})),r.d(e,"getProfileItems",(function(){return Fe})),r.d(e,"getTasksStatus",(function(){return Le})),r.d(e,"getTaskLists",(function(){return Qe})),r.d(e,"getPaymentGatewaySuggestions",(function(){return xe})),r.d(e,"getOnboardingError",(function(){return Ke})),r.d(e,"isOnboardingRequesting",(function(){return We})),r.d(e,"getEmailPrefill",(function(){return Ve})),r.d(e,"getProductTypes",(function(){return He}));var n={};r.r(n),r.d(n,"getSettingsGroupNames",(function(){return x})),r.d(n,"getSettings",(function(){return K})),r.d(n,"getDirtyKeys",(function(){return W})),r.d(n,"getIsDirty",(function(){return V})),r.d(n,"getSettingsForGroup",(function(){return H})),r.d(n,"isUpdateSettingsRequesting",(function(){return J})),r.d(n,"getSetting",(function(){return $})),r.d(n,"getLastSettingsErrorForGroup",(function(){return B})),r.d(n,"getSettingsError",(function(){return z}));var o={};r.r(o),r.d(o,"updateSettingsForGroup",(function(){return lt})),r.d(o,"updateErrorForGroup",(function(){return Tt})),r.d(o,"setIsRequesting",(function(){return _t})),r.d(o,"clearIsDirty",(function(){return pt})),r.d(o,"updateAndPersistSettingsForGroup",(function(){return gt})),r.d(o,"persistSettingsForGroup",(function(){return ft})),r.d(o,"clearSettings",(function(){return yt}));var s={};r.r(s),r.d(s,"getSettings",(function(){return mt})),r.d(s,"getSettingsForGroup",(function(){return Ot}));var i={};r.r(i),r.d(i,"getActivePlugins",(function(){return bt})),r.d(i,"getInstalledPlugins",(function(){return Ct})),r.d(i,"isPluginsRequesting",(function(){return Dt})),r.d(i,"getPluginsError",(function(){return Gt})),r.d(i,"isJetpackConnected",(function(){return kt})),r.d(i,"getJetpackConnectUrl",(function(){return Mt})),r.d(i,"getPluginInstallState",(function(){return jt})),r.d(i,"getPaypalOnboardingStatus",(function(){return Ft})),r.d(i,"getRecommendedPlugins",(function(){return Lt}));var a={};r.r(a),r.d(a,"formatErrors",(function(){return xt})),r.d(a,"updateActivePlugins",(function(){return Wt})),r.d(a,"updateInstalledPlugins",(function(){return Vt})),r.d(a,"setIsRequesting",(function(){return Ht})),r.d(a,"setError",(function(){return Jt})),r.d(a,"updateIsJetpackConnected",(function(){return $t})),r.d(a,"updateJetpackConnectUrl",(function(){return Bt})),r.d(a,"installPlugins",(function(){return zt})),r.d(a,"activatePlugins",(function(){return Zt})),r.d(a,"installAndActivatePlugins",(function(){return Xt})),r.d(a,"createErrorNotice",(function(){return te})),r.d(a,"connectToJetpack",(function(){return ee})),r.d(a,"installJetpackAndConnect",(function(){return re})),r.d(a,"connectToJetpackWithFailureRedirect",(function(){return ne})),r.d(a,"setPaypalOnboardingStatus",(function(){return oe})),r.d(a,"setRecommendedPlugins",(function(){return se}));var c={};r.r(c),r.d(c,"getOption",(function(){return ae})),r.d(c,"getOptionsRequestingError",(function(){return ce})),r.d(c,"isOptionsUpdating",(function(){return ue})),r.d(c,"getOptionsUpdatingError",(function(){return de}));var u={};r.r(u),r.d(u,"receiveOptions",(function(){return Se})),r.d(u,"setRequestingError",(function(){return le})),r.d(u,"setUpdatingError",(function(){return Te})),r.d(u,"setIsUpdating",(function(){return _e})),r.d(u,"updateOptions",(function(){return pe}));var d={};r.r(d),r.d(d,"getOption",(function(){return Oe}));var E={};r.r(E),r.d(E,"getActivePlugins",(function(){return Pe})),r.d(E,"getInstalledPlugins",(function(){return ve})),r.d(E,"isJetpackConnected",(function(){return Ue})),r.d(E,"getJetpackConnectUrl",(function(){return we})),r.d(E,"getPaypalOnboardingStatus",(function(){return be})),r.d(E,"getRecommendedPlugins",(function(){return De}));var S={};r.r(S),r.d(S,"getFreeExtensions",(function(){return je})),r.d(S,"getProfileItems",(function(){return Fe})),r.d(S,"getTasksStatus",(function(){return Le})),r.d(S,"getTaskLists",(function(){return Qe})),r.d(S,"getPaymentGatewaySuggestions",(function(){return xe})),r.d(S,"getOnboardingError",(function(){return Ke})),r.d(S,"isOnboardingRequesting",(function(){return We})),r.d(S,"getEmailPrefill",(function(){return Ve})),r.d(S,"getProductTypes",(function(){return He}));var l={};r.r(l),r.d(l,"getFreeExtensionsError",(function(){return $e})),r.d(l,"getFreeExtensionsSuccess",(function(){return Be})),r.d(l,"setError",(function(){return ze})),r.d(l,"setIsRequesting",(function(){return Ze})),r.d(l,"setProfileItems",(function(){return Xe})),r.d(l,"getTaskListsError",(function(){return tr})),r.d(l,"getTaskListsSuccess",(function(){return er})),r.d(l,"snoozeTaskError",(function(){return rr})),r.d(l,"snoozeTaskRequest",(function(){return nr})),r.d(l,"snoozeTaskSuccess",(function(){return or})),r.d(l,"undoSnoozeTaskError",(function(){return sr})),r.d(l,"undoSnoozeTaskRequest",(function(){return ir})),r.d(l,"undoSnoozeTaskSuccess",(function(){return ar})),r.d(l,"dismissTaskError",(function(){return cr})),r.d(l,"dismissTaskRequest",(function(){return ur})),r.d(l,"dismissTaskSuccess",(function(){return dr})),r.d(l,"undoDismissTaskError",(function(){return Er})),r.d(l,"undoDismissTaskRequest",(function(){return Sr})),r.d(l,"undoDismissTaskSuccess",(function(){return lr})),r.d(l,"hideTaskListError",(function(){return Tr})),r.d(l,"hideTaskListRequest",(function(){return _r})),r.d(l,"hideTaskListSuccess",(function(){return pr})),r.d(l,"setTasksStatus",(function(){return gr})),r.d(l,"setPaymentMethods",(function(){return fr})),r.d(l,"setEmailPrefill",(function(){return yr})),r.d(l,"getProductTypesSuccess",(function(){return Rr})),r.d(l,"getProductTypesError",(function(){return mr})),r.d(l,"updateProfileItems",(function(){return Or})),r.d(l,"snoozeTask",(function(){return Ir})),r.d(l,"undoSnoozeTask",(function(){return Ar})),r.d(l,"dismissTask",(function(){return hr})),r.d(l,"undoDismissTask",(function(){return Pr})),r.d(l,"hideTaskList",(function(){return vr}));var T={};r.r(T),r.d(T,"getProfileItems",(function(){return Ur})),r.d(T,"getEmailPrefill",(function(){return wr})),r.d(T,"getTasksStatus",(function(){return Nr})),r.d(T,"getTaskLists",(function(){return br})),r.d(T,"getPaymentGatewaySuggestions",(function(){return Cr})),r.d(T,"getFreeExtensions",(function(){return Dr})),r.d(T,"getProductTypes",(function(){return Gr}));var _={};r.r(_),r.d(_,"getReviews",(function(){return Hr})),r.d(_,"getReviewsTotalCount",(function(){return Jr})),r.d(_,"getReviewsError",(function(){return $r}));var p={};r.r(p),r.d(p,"updateReviews",(function(){return zr})),r.d(p,"updateReview",(function(){return Zr})),r.d(p,"deleteReview",(function(){return Xr})),r.d(p,"setReviewIsUpdating",(function(){return tn})),r.d(p,"setReview",(function(){return en})),r.d(p,"setError",(function(){return rn}));var g={};r.r(g),r.d(g,"getReviews",(function(){return sn})),r.d(g,"getReviewsTotalCount",(function(){return an}));var f={};r.r(f),r.d(f,"getNotes",(function(){return pn})),r.d(f,"getNotesError",(function(){return gn})),r.d(f,"isNotesRequesting",(function(){return fn}));var y={};r.r(y),r.d(y,"triggerNoteAction",(function(){return Rn})),r.d(y,"removeNote",(function(){return mn})),r.d(y,"removeAllNotes",(function(){return On})),r.d(y,"batchUpdateNotes",(function(){return In})),r.d(y,"updateNote",(function(){return An})),r.d(y,"setNote",(function(){return hn})),r.d(y,"setNoteIsUpdating",(function(){return Pn})),r.d(y,"setNotes",(function(){return vn})),r.d(y,"setNotesQuery",(function(){return Un})),r.d(y,"setError",(function(){return wn})),r.d(y,"setIsRequesting",(function(){return Nn}));var R={};r.r(R),r.d(R,"getNotes",(function(){return bn}));var m={};r.r(m),r.d(m,"getReportItemsError",(function(){return kn})),r.d(m,"getReportItems",(function(){return Mn})),r.d(m,"getReportStats",(function(){return jn})),r.d(m,"getReportStatsError",(function(){return Fn}));var O={};r.r(O),r.d(O,"setReportItemsError",(function(){return qn})),r.d(O,"setReportItems",(function(){return Yn})),r.d(O,"setReportStats",(function(){return Qn})),r.d(O,"setReportStatsError",(function(){return xn}));var I={};r.r(I),r.d(I,"getReportItems",(function(){return Kn})),r.d(I,"getReportStats",(function(){return Wn}));var A={};r.r(A),r.d(A,"getItems",(function(){return Zn})),r.d(A,"getItemsTotalCount",(function(){return Xn})),r.d(A,"getItemsError",(function(){return to}));var h={};r.r(h),r.d(h,"setItem",(function(){return ro})),r.d(h,"setItems",(function(){return no})),r.d(h,"setItemsTotalCount",(function(){return oo})),r.d(h,"setError",(function(){return so})),r.d(h,"updateProductStock",(function(){return io})),r.d(h,"createProductFromTemplate",(function(){return ao}));var P={};r.r(P),r.d(P,"getItems",(function(){return uo})),r.d(P,"getReviewsTotalCount",(function(){return Eo})),r.d(P,"getItemsTotalCount",(function(){return So}));var v={};r.r(v),r.d(v,"getMenuItems",(function(){return po})),r.d(v,"getFavorites",(function(){return go})),r.d(v,"isNavigationRequesting",(function(){return fo})),r.d(v,"getPersistedQuery",(function(){return yo}));var U={};r.r(U),r.d(U,"setMenuItems",(function(){return Oo})),r.d(U,"addMenuItems",(function(){return Io})),r.d(U,"getFavoritesFailure",(function(){return Ao})),r.d(U,"getFavoritesRequest",(function(){return ho})),r.d(U,"getFavoritesSuccess",(function(){return Po})),r.d(U,"addFavoriteRequest",(function(){return vo})),r.d(U,"addFavoriteFailure",(function(){return Uo})),r.d(U,"addFavoriteSuccess",(function(){return wo})),r.d(U,"removeFavoriteRequest",(function(){return No})),r.d(U,"removeFavoriteFailure",(function(){return bo})),r.d(U,"removeFavoriteSuccess",(function(){return Co})),r.d(U,"onLoad",(function(){return Do})),r.d(U,"onHistoryChange",(function(){return Go})),r.d(U,"addFavorite",(function(){return ko})),r.d(U,"removeFavorite",(function(){return Mo}));var w={};r.r(w),r.d(w,"getFavorites",(function(){return Fo}));var N={};r.r(N),r.d(N,"getPaymentGatewaysRequest",(function(){return xo})),r.d(N,"getPaymentGatewaysSuccess",(function(){return Ko})),r.d(N,"getPaymentGatewaysError",(function(){return Wo})),r.d(N,"getPaymentGatewayRequest",(function(){return Vo})),r.d(N,"getPaymentGatewayError",(function(){return Ho})),r.d(N,"getPaymentGatewaySuccess",(function(){return Jo})),r.d(N,"updatePaymentGatewaySuccess",(function(){return $o})),r.d(N,"updatePaymentGatewayRequest",(function(){return Bo})),r.d(N,"updatePaymentGatewayError",(function(){return zo})),r.d(N,"updatePaymentGateway",(function(){return Zo}));var b={};r.r(b),r.d(b,"getPaymentGateways",(function(){return ts})),r.d(b,"getPaymentGateway",(function(){return es}));var C={};r.r(C),r.d(C,"getPaymentGateway",(function(){return rs})),r.d(C,"getPaymentGateways",(function(){return ns})),r.d(C,"getPaymentGatewayError",(function(){return os})),r.d(C,"isPaymentGatewayUpdating",(function(){return ss}));var D={};r.r(D),r.d(D,"isExportRequesting",(function(){return ws})),r.d(D,"getExportId",(function(){return Ns})),r.d(D,"getError",(function(){return bs}));var G={};r.r(G),r.d(G,"setExportId",(function(){return Ds})),r.d(G,"setIsRequesting",(function(){return Gs})),r.d(G,"setError",(function(){return ks})),r.d(G,"startExport",(function(){return Ms}));var k={};r.r(k),r.d(k,"getImportStarted",(function(){return Ls})),r.d(k,"getFormSettings",(function(){return qs})),r.d(k,"getImportStatus",(function(){return Ys})),r.d(k,"getImportTotals",(function(){return Qs})),r.d(k,"getImportError",(function(){return xs}));var M={};r.r(M),r.d(M,"setImportStarted",(function(){return Ws})),r.d(M,"setImportPeriod",(function(){return Vs})),r.d(M,"setSkipPrevious",(function(){return Hs})),r.d(M,"setImportStatus",(function(){return Js})),r.d(M,"setImportTotals",(function(){return $s})),r.d(M,"setImportError",(function(){return Bs})),r.d(M,"updateImportation",(function(){return zs}));var j={};r.r(j),r.d(j,"getImportStatus",(function(){return Zs})),r.d(j,"getImportTotals",(function(){return Xs}));r(447);var F=r(7),L=r(10);const q="wc/admin/settings";function Y(t,e){return`${t}:${JSON.stringify(e,Object.keys(e).sort())}`}function Q(t){const e=t.indexOf(":");return e<0?t:t.substring(0,e)}const x=t=>[...new Set(Object.keys(t).map(t=>Q(t)))],K=(t,e)=>{const r={},n=t[e]&&t[e].data||[];return 0===n.length||n.forEach(n=>{r[n]=t[Y(e,n)].data}),r},W=(t,e)=>t[e].dirty||[],V=(t,e,r=[])=>{const n=W(t,e);return 0!==n.length&&r.some(t=>n.includes(t))},H=(t,e,r)=>{const n=K(t,e);return r.reduce((t,e)=>(t[e]=n[e]||{},t),{})},J=(t,e)=>t[e]&&Boolean(t[e].isRequesting);function $(t,e,r,n=!1,o=(t=>t)){const s=Y(e,r);return o(t[s]&&t[s].data||n,n)}const B=(t,e)=>{const r=t[e].data;return 0===r.length?t[e].error:[...r].pop().error},z=(t,e,r)=>r?t[Y(e,r)].error||!1:t[e]&&t[e].error||!1;var Z=r(2),X=r(4);const tt="/wc-analytics",et="/wc-admin",rt="/wc/v1",nt=100,ot=1e3,st=60*ot,it=60*st,at=24*it,ct=7*at,ut=365*at/12,dt={pageSize:25,period:"month",compare:"previous_year",noteTypes:["info","marketing","survey","warning"]};var Et={UPDATE_SETTINGS_FOR_GROUP:"UPDATE_SETTINGS_FOR_GROUP",UPDATE_ERROR_FOR_GROUP:"UPDATE_ERROR_FOR_GROUP",CLEAR_SETTINGS:"CLEAR_SETTINGS",SET_IS_REQUESTING:"SET_IS_REQUESTING",CLEAR_IS_DIRTY:"CLEAR_IS_DIRTY"};const St=F.controls&&F.controls.resolveSelect?F.controls.resolveSelect:L.select;function lt(t,e,r=new Date){return{type:Et.UPDATE_SETTINGS_FOR_GROUP,group:t,data:e,time:r}}function Tt(t,e,r,n=new Date){return{type:Et.UPDATE_ERROR_FOR_GROUP,group:t,data:e,error:r,time:n}}function _t(t,e){return{type:Et.SET_IS_REQUESTING,group:t,isRequesting:e}}function pt(t){return{type:Et.CLEAR_IS_DIRTY,group:t}}function*gt(t,e){yield lt(t,e),yield*ft(t)}function*ft(t){yield _t(t,!0);const e=yield St(q,"getDirtyKeys",t);if(0===e.length)return void(yield _t(t,!1));const r=yield St(q,"getSettingsForGroup",t,e),n=`${tt}/settings/${t}/batch`,o=e.reduce((t,e)=>{const n=Object.keys(r[e]).map(t=>({id:t,value:r[e][t]}));return Object(X.concat)(t,n)},[]);try{const e=yield Object(L.apiFetch)({path:n,method:"POST",data:{update:o}});if(yield _t(t,!1),!e)throw new Error(Object(Z.__)("There was a problem updating your settings.",'woocommerce'));yield pt(t)}catch(e){throw yield Tt(t,null,e),yield _t(t,!1),e}}function yt(){return{type:Et.CLEAR_SETTINGS}}const Rt=F.controls&&F.controls.dispatch?F.controls.dispatch:L.dispatch;function*mt(t){yield Rt(q,"setIsRequesting",t,!0);try{const e=tt+"/settings/"+t,r=yield Object(L.apiFetch)({path:e,method:"GET"});return lt(t,{[t]:r.reduce((t,e)=>(t[e.id]=e.value,t),{})})}catch(e){return Tt(t,null,e.message)}}function*Ot(t){return mt(t)}const It=(t,{group:e,groupIds:r,data:n,time:o,error:s})=>(r.forEach(r=>{t[Y(e,r)]={data:n[r],lastReceived:o,error:s}}),t);var At=(t={},{type:e,group:r,data:n,error:o,time:s,isRequesting:i})=>{const a={};switch(e){case Et.SET_IS_REQUESTING:t={...t,[r]:{...t[r],isRequesting:i}};break;case Et.CLEAR_IS_DIRTY:t={...t,[r]:{...t[r],dirty:[]}};break;case Et.UPDATE_SETTINGS_FOR_GROUP:case Et.UPDATE_ERROR_FOR_GROUP:const e=n?Object.keys(n):[];t=null===n?{...t,[r]:{data:t[r]?t[r].data:[],error:o,lastReceived:s}}:{...t,[r]:{data:t[r]&&t[r].data?[...t[r].data,...e]:e,error:o,lastReceived:s,isRequesting:!1,dirty:t[r]&&t[r].dirty?Object(X.union)(t[r].dirty,e):e},...It(a,{group:r,groupIds:e,data:n,time:s,error:o})};break;case Et.CLEAR_SETTINGS:t={}}return t};Object(F.registerStore)(q,{reducer:At,actions:o,controls:L.controls,selectors:n,resolvers:s});const ht=q;var Pt=r(14),vt=r(0);const Ut=(t,e)=>Object(Pt.createHigherOrderComponent)(r=>n=>{const o=Object(vt.useRef)(e);return Object(F.useSelect)((e,r)=>{if(!o.current)return;const{isResolving:n,hasFinishedResolution:s}=e(q),{startResolution:i,finishResolution:a,updateSettingsForGroup:c,clearIsDirty:u}=r.dispatch(q);n("getSettings",[t])||s("getSettings",[t])||(i("getSettings",[t]),c(t,o.current),u(t),a("getSettings",[t]))},[]),Object(vt.createElement)(r,Object.assign({},n))},"withSettingsHydration"),wt=(t,e=[])=>{const{requestedSettings:r,settingsError:n,isRequesting:o,isDirty:s}=Object(F.useSelect)(r=>{const{getLastSettingsErrorForGroup:n,getSettingsForGroup:o,getIsDirty:s,isUpdateSettingsRequesting:i}=r(q);return{requestedSettings:o(t,e),settingsError:Boolean(n(t)),isRequesting:i(t),isDirty:s(t,e)}},[t,...e.sort()]),{persistSettingsForGroup:i,updateAndPersistSettingsForGroup:a,updateSettingsForGroup:c}=Object(F.useDispatch)(q),u=Object(vt.useCallback)((e,r)=>{c(t,{[e]:r})},[t]);return{settingsError:n,isRequesting:o,isDirty:s,...r,persistSettings:Object(vt.useCallback)(()=>{i(t)},[t]),updateAndPersistSettings:Object(vt.useCallback)((e,r)=>{a(t,{[e]:r})},[t]),updateSettings:u}},Nt={"facebook-for-woocommerce":Object(Z.__)("Facebook for WooCommerce",'woocommerce'),jetpack:Object(Z.__)("Jetpack",'woocommerce'),"klarna-checkout-for-woocommerce":Object(Z.__)("Klarna Checkout for WooCommerce",'woocommerce'),"klarna-payments-for-woocommerce":Object(Z.__)("Klarna Payments for WooCommerce",'woocommerce'),"mailchimp-for-woocommerce":Object(Z.__)("Mailchimp for WooCommerce",'woocommerce'),"creative-mail-by-constant-contact":Object(Z.__)("Creative Mail for WooCommerce",'woocommerce'),"woocommerce-gateway-paypal-express-checkout":Object(Z.__)("WooCommerce PayPal",'woocommerce'),"woocommerce-gateway-stripe":Object(Z.__)("WooCommerce Stripe",'woocommerce'),"woocommerce-payfast-gateway":Object(Z.__)("WooCommerce PayFast",'woocommerce'),"woocommerce-payments":Object(Z.__)("WooCommerce Payments",'woocommerce'),"woocommerce-services":Object(Z.__)("WooCommerce Shipping & Tax",'woocommerce'),"woocommerce-services:shipping":Object(Z.__)("WooCommerce Shipping & Tax",'woocommerce'),"woocommerce-services:tax":Object(Z.__)("WooCommerce Shipping & Tax",'woocommerce'),"woocommerce-shipstation-integration":Object(Z.__)("WooCommerce ShipStation Gateway",'woocommerce'),"woocommerce-mercadopago":Object(Z.__)("Mercado Pago payments for WooCommerce",'woocommerce'),"google-listings-and-ads":Object(Z.__)("Google Listings and Ads",'woocommerce'),"woo-razorpay":Object(Z.__)("Razorpay",'woocommerce'),mailpoet:Object(Z.__)("MailPoet",'woocommerce')},bt=t=>t.active||[],Ct=t=>t.installed||[],Dt=(t,e)=>t.requesting[e]||!1,Gt=(t,e)=>t.errors[e]||!1,kt=t=>t.jetpackConnection,Mt=(t,e)=>t.jetpackConnectUrls[e.redirect_url],jt=(t,e)=>t.active.includes(e)?"activated":t.installed.includes(e)?"installed":"unavailable",Ft=t=>t.paypalOnboardingStatus,Lt=(t,e)=>t.recommended[e];var qt;!function(t){t.UPDATE_ACTIVE_PLUGINS="UPDATE_ACTIVE_PLUGINS",t.UPDATE_INSTALLED_PLUGINS="UPDATE_INSTALLED_PLUGINS",t.SET_IS_REQUESTING="SET_IS_REQUESTING",t.SET_ERROR="SET_ERROR",t.UPDATE_JETPACK_CONNECTION="UPDATE_JETPACK_CONNECTION",t.UPDATE_JETPACK_CONNECT_URL="UPDATE_JETPACK_CONNECT_URL",t.SET_PAYPAL_ONBOARDING_STATUS="SET_PAYPAL_ONBOARDING_STATUS",t.SET_RECOMMENDED_PLUGINS="SET_RECOMMENDED_PLUGINS"}(qt||(qt={}));const Yt=F.controls&&F.controls.dispatch?F.controls.dispatch:L.dispatch,Qt=F.controls&&F.controls.resolveSelect?F.controls.resolveSelect:L.select;function xt(t){return void 0===t.errors?"string"==typeof t?t:t.message:(Object.keys(t.errors).forEach(e=>{t.errors[e]=t.errors[e].map(t=>Nt[e]?t.replace(`\`${e}\``,Nt[e]):t)}),"")}const Kt=(t,e="install")=>Object(Z.sprintf)(Object(Z._n)("Could not %(actionType)s %(pluginName)s plugin, %(error)s","Could not %(actionType)s the following plugins: %(pluginName)s with these Errors: %(error)s",Object.keys(t).length||1,'woocommerce'),{actionType:e,pluginName:Object.keys(t).join(", "),error:Object.values(t).join(", \n")});function Wt(t,e=!1){return{type:qt.UPDATE_ACTIVE_PLUGINS,active:t,replace:e}}function Vt(t,e=!1){return{type:qt.UPDATE_INSTALLED_PLUGINS,installed:t,replace:e}}function Ht(t,e){return{type:qt.SET_IS_REQUESTING,selector:t,isRequesting:e}}function Jt(t,e){return{type:qt.SET_ERROR,selector:t,error:e}}function $t(t){return{type:qt.UPDATE_JETPACK_CONNECTION,jetpackConnection:t}}function Bt(t,e){return{type:qt.UPDATE_JETPACK_CONNECT_URL,jetpackConnectUrl:e,redirectUrl:t}}function*zt(t){yield Ht("installPlugins",!0);try{const e=yield Object(L.apiFetch)({path:et+"/plugins/install",method:"POST",data:{plugins:t.join(",")}});if(e.data.installed.length&&(yield Vt(e.data.installed)),Object.keys(e.errors.errors).length)throw e.errors.errors;return yield Ht("installPlugins",!1),e}catch(e){throw 1!==t.length||e[t[0]]||(e={[t[0]]:e.message}),yield Jt("installPlugins",e),new Error(Kt(e))}}function*Zt(t){yield Ht("activatePlugins",!0);try{const e=yield Object(L.apiFetch)({path:et+"/plugins/activate",method:"POST",data:{plugins:t.join(",")}});if(e.data.activated.length&&(yield Wt(e.data.activated)),Object.keys(e.errors.errors).length)throw e.errors.errors;return yield Ht("activatePlugins",!1),e}catch(e){throw 1!==t.length||e[t[0]]||(e={[t[0]]:e.message}),yield Jt("activatePlugins",e),new Error(Kt(e,"activate"))}}function*Xt(t){try{yield Yt("wc/admin/plugins","installPlugins",t);return yield Yt("wc/admin/plugins","activatePlugins",t)}catch(t){throw t}}const te=t=>Yt("core/notices","createNotice","error",t);function*ee(t){const e=yield Qt("wc/admin/plugins","getJetpackConnectUrl",{redirect_url:t("admin.php?page=wc-admin")}),r=yield Qt("wc/admin/plugins","getPluginsError","getJetpackConnectUrl");if(r)throw new Error(r);return e}function*re(t,e){try{yield Yt("wc/admin/plugins","installPlugins",["jetpack"]),yield Yt("wc/admin/plugins","activatePlugins",["jetpack"]);const t=yield Yt("wc/admin/plugins","connectToJetpack",e);window.location.href=t}catch(e){yield t(e.message)}}function*ne(t,e,r){try{const t=yield Yt("wc/admin/plugins","connectToJetpack",r);window.location.href=t}catch(r){yield e(r.message),window.location.href=t}}function oe(t){return{type:qt.SET_PAYPAL_ONBOARDING_STATUS,paypalOnboardingStatus:t}}function se(t,e){return{type:qt.SET_RECOMMENDED_PLUGINS,recommendedType:t,plugins:e}}var ie=r(15);const ae=(t,e)=>t[e],ce=(t,e)=>t.requestingErrors[e]||!1,ue=t=>t.isUpdating||!1,de=t=>t.updatingError||!1;var Ee={RECEIVE_OPTIONS:"RECEIVE_OPTIONS",SET_IS_REQUESTING:"SET_IS_REQUESTING",SET_IS_UPDATING:"SET_IS_UPDATING",SET_REQUESTING_ERROR:"SET_REQUESTING_ERROR",SET_UPDATING_ERROR:"SET_UPDATING_ERROR"};function Se(t){return{type:Ee.RECEIVE_OPTIONS,options:t}}function le(t,e){return{type:Ee.SET_REQUESTING_ERROR,error:t,name:e}}function Te(t){return{type:Ee.SET_UPDATING_ERROR,error:t}}function _e(t){return{type:Ee.SET_IS_UPDATING,isUpdating:t}}function*pe(t){yield _e(!0),yield Se(t);try{const e=yield Object(L.apiFetch)({path:et+"/options",method:"POST",data:t});return yield _e(!1),{success:!0,...e}}catch(t){return yield Te(t),{success:!1,...t}}}var ge=r(17),fe=r.n(ge);let ye=[];const Re={},me={...L.controls,BATCH_FETCH:({optionName:t})=>(ye.push(t),new Promise(t=>{setTimeout((function(){const e=ye.join(",");if(Re[e])return Re[e].then(e=>{t(e)});const r=et+"/options?options="+e;Re[e]=fe()({path:r}),Re[e].then(e=>t(e)),setTimeout(()=>{ye=[],delete Re[e]},1)}),1)}))};function*Oe(t){try{const r=yield(e=t,{type:"BATCH_FETCH",optionName:e});yield Se(r)}catch(e){yield le(e,t)}var e}var Ie=(t={isUpdating:!1,requestingErrors:{}},{type:e,options:r,error:n,isUpdating:o,name:s})=>{switch(e){case Ee.RECEIVE_OPTIONS:t={...t,...r};break;case Ee.SET_IS_UPDATING:t={...t,isUpdating:o};break;case Ee.SET_REQUESTING_ERROR:t={...t,requestingErrors:{[s]:n}};break;case Ee.SET_UPDATING_ERROR:t={...t,error:n,updatingError:n,isUpdating:!1}}return t};Object(F.registerStore)("wc/admin/options",{reducer:Ie,actions:u,controls:me,selectors:c,resolvers:d});const Ae="wc/admin/options",he=F.controls&&F.controls.resolveSelect?F.controls.resolveSelect:L.select;function*Pe(){yield Ht("getActivePlugins",!0);try{const t=et+"/plugins/active",e=yield Object(L.apiFetch)({path:t,method:"GET"});yield Wt(e.plugins,!0)}catch(t){yield Jt("getActivePlugins",t)}}function*ve(){yield Ht("getInstalledPlugins",!0);try{const t=et+"/plugins/installed",e=yield Object(L.apiFetch)({path:t,method:"GET"});yield Vt(e.plugins,!0)}catch(t){yield Jt("getInstalledPlugins",t)}}function*Ue(){yield Ht("isJetpackConnected",!0);try{const t="/jetpack/v4/connection",e=yield Object(L.apiFetch)({path:t,method:"GET"});yield $t(e.isActive)}catch(t){yield Jt("isJetpackConnected",t)}yield Ht("isJetpackConnected",!1)}function*we(t){yield Ht("getJetpackConnectUrl",!0);try{const e=Object(ie.addQueryArgs)(et+"/plugins/connect-jetpack",t),r=yield Object(L.apiFetch)({path:e,method:"GET"});yield Bt(t.redirect_url,r.connectAction)}catch(t){yield Jt("getJetpackConnectUrl",t)}yield Ht("getJetpackConnectUrl",!1)}function*Ne(){const t=yield he(Ae,"getOption","woocommerce-ppcp-settings"),e=t.merchant_email_production&&t.merchant_id_production&&t.client_id_production&&t.client_secret_production;yield oe({production:{state:e?"onboarded":"unknown",onboarded:!!e}})}function*be(){yield Ht("getPaypalOnboardingStatus",!0);const t=yield he("wc/admin/plugins","getPluginsError","getPaypalOnboardingStatus");if(t&&t.data&&404===t.data.status)yield Ne();else try{const t="/wc-paypal/v1/onboarding/get-status",e=yield Object(L.apiFetch)({path:t,method:"GET"});yield oe(e)}catch(t){yield Ne(),yield Jt("getPaypalOnboardingStatus",t)}yield Ht("getPaypalOnboardingStatus",!1)}const Ce=["payments"];function*De(t){if(!Ce.includes(t))return[];yield Ht("getRecommendedPlugins",!0);try{const e=et+"/plugins/recommended-payment-plugins",r=yield Object(L.apiFetch)({path:e,method:"GET"});yield se(t,r)}catch(t){yield Jt("getRecommendedPlugins",t)}yield Ht("getRecommendedPlugins",!1)}var Ge=(t={active:[],installed:[],requesting:{},errors:{},jetpackConnectUrls:{},recommended:{}},e)=>{if(e&&"type"in e)switch(e.type){case qt.UPDATE_ACTIVE_PLUGINS:t={...t,active:e.replace?e.active:Object(X.concat)(t.active,e.active),requesting:{...t.requesting,getActivePlugins:!1,activatePlugins:!1},errors:{...t.errors,getActivePlugins:!1,activatePlugins:!1}};break;case qt.UPDATE_INSTALLED_PLUGINS:t={...t,installed:e.replace?e.installed:Object(X.concat)(t.installed,e.installed),requesting:{...t.requesting,getInstalledPlugins:!1,installPlugins:!1},errors:{...t.errors,getInstalledPlugins:!1,installPlugin:!1}};break;case qt.SET_IS_REQUESTING:t={...t,requesting:{...t.requesting,[e.selector]:e.isRequesting}};break;case qt.SET_ERROR:t={...t,requesting:{...t.requesting,[e.selector]:!1},errors:{...t.errors,[e.selector]:e.error}};break;case qt.UPDATE_JETPACK_CONNECTION:t={...t,jetpackConnection:e.jetpackConnection};break;case qt.UPDATE_JETPACK_CONNECT_URL:t={...t,jetpackConnectUrls:{...t.jetpackConnectUrls,[e.redirectUrl]:e.jetpackConnectUrl}};break;case qt.SET_PAYPAL_ONBOARDING_STATUS:t={...t,paypalOnboardingStatus:e.paypalOnboardingStatus};break;case qt.SET_RECOMMENDED_PLUGINS:t={...t,recommended:{...t.recommended,[e.recommendedType]:e.plugins}}}return t};Object(F.registerStore)("wc/admin/plugins",{reducer:Ge,actions:a,controls:L.controls,selectors:i,resolvers:E});const ke="wc/admin/plugins",Me=t=>Object(Pt.createHigherOrderComponent)(e=>r=>{const n=Object(vt.useRef)(t);return Object(F.useSelect)((t,e)=>{if(!n.current)return;const{isResolving:r,hasFinishedResolution:o}=t("wc/admin/plugins"),{startResolution:s,finishResolution:i,updateActivePlugins:a,updateInstalledPlugins:c,updateIsJetpackConnected:u}=e.dispatch("wc/admin/plugins");r("getActivePlugins",[])||o("getActivePlugins",[])||(s("getActivePlugins",[]),s("getInstalledPlugins",[]),s("isJetpackConnected",[]),a(n.current.activePlugins,!0),c(n.current.installedPlugins,!0),u(!(!n.current.jetpackStatus||!n.current.jetpackStatus.isActive)),i("getActivePlugins",[]),i("getInstalledPlugins",[]),i("isJetpackConnected",[]))},[]),Object(vt.createElement)(e,Object.assign({},r))},"withPluginsHydration"),je=t=>t.freeExtensions||[],Fe=t=>t.profileItems||{},Le=t=>t.tasksStatus||{},qe=[],Ye=[],Qe=t=>t.taskLists||qe,xe=t=>t.paymentMethods||[],Ke=(t,e)=>t.errors[e]||!1,We=(t,e)=>t.requesting[e]||!1,Ve=t=>t.emailPrefill||"",He=t=>t.productTypes||Ye;var Je={SET_ERROR:"SET_ERROR",SET_IS_REQUESTING:"SET_IS_REQUESTING",SET_PROFILE_ITEMS:"SET_PROFILE_ITEMS",SET_EMAIL_PREFILL:"SET_EMAIL_PREFILL",SET_TASKS_STATUS:"SET_TASKS_STATUS",GET_PAYMENT_METHODS_SUCCESS:"GET_PAYMENT_METHODS_SUCCESS",GET_PRODUCT_TYPES_SUCCESS:"GET_PRODUCT_TYPES_SUCCESS",GET_PRODUCT_TYPES_ERROR:"GET_PRODUCT_TYPES_ERROR",GET_FREE_EXTENSIONS_ERROR:"GET_FREE_EXTENSIONS_ERROR",GET_FREE_EXTENSIONS_SUCCESS:"GET_FREE_EXTENSIONS_SUCCESS",GET_TASK_LISTS_ERROR:"GET_TASK_LISTS_ERROR",GET_TASK_LISTS_SUCCESS:"GET_TASK_LISTS_SUCCESS",DISMISS_TASK_ERROR:"DISMISS_TASK_ERROR",DISMISS_TASK_REQUEST:"DISMISS_TASK_REQUEST",DISMISS_TASK_SUCCESS:"DISMISS_TASK_SUCCESS",UNDO_DISMISS_TASK_ERROR:"UNDO_DISMISS_TASK_ERROR",UNDO_DISMISS_TASK_REQUEST:"UNDO_DISMISS_TASK_REQUEST",UNDO_DISMISS_TASK_SUCCESS:"UNDO_DISMISS_TASK_SUCCESS",SNOOZE_TASK_ERROR:"SNOOZE_TASK_ERROR",SNOOZE_TASK_REQUEST:"SNOOZE_TASK_REQUEST",SNOOZE_TASK_SUCCESS:"SNOOZE_TASK_SUCCESS",UNDO_SNOOZE_TASK_ERROR:"UNDO_SNOOZE_TASK_ERROR",UNDO_SNOOZE_TASK_REQUEST:"UNDO_SNOOZE_TASK_REQUEST",UNDO_SNOOZE_TASK_SUCCESS:"UNDO_SNOOZE_TASK_SUCCESS",HIDE_TASK_LIST_ERROR:"HIDE_TASK_LIST_ERROR",HIDE_TASK_LIST_REQUEST:"HIDE_TASK_LIST_REQUEST",HIDE_TASK_LIST_SUCCESS:"HIDE_TASK_LIST_SUCCESS"};function $e(t){return{type:Je.GET_FREE_EXTENSIONS_ERROR,error:t}}function Be(t){return{type:Je.GET_FREE_EXTENSIONS_SUCCESS,freeExtensions:t}}function ze(t,e){return{type:Je.SET_ERROR,selector:t,error:e}}function Ze(t,e){return{type:Je.SET_IS_REQUESTING,selector:t,isRequesting:e}}function Xe(t,e=!1){return{type:Je.SET_PROFILE_ITEMS,profileItems:t,replace:e}}function tr(t){return{type:Je.GET_TASK_LISTS_ERROR,error:t}}function er(t){return{type:Je.GET_TASK_LISTS_SUCCESS,taskLists:t}}function rr(t,e){return{type:Je.SNOOZE_TASK_ERROR,taskId:t,error:e}}function nr(t){return{type:Je.SNOOZE_TASK_REQUEST,taskId:t}}function or(t){return{type:Je.SNOOZE_TASK_SUCCESS,task:t}}function sr(t,e){return{type:Je.UNDO_SNOOZE_TASK_ERROR,taskId:t,error:e}}function ir(t){return{type:Je.UNDO_SNOOZE_TASK_REQUEST,taskId:t}}function ar(t){return{type:Je.UNDO_SNOOZE_TASK_SUCCESS,task:t}}function cr(t,e){return{type:Je.DISMISS_TASK_ERROR,taskId:t,error:e}}function ur(t){return{type:Je.DISMISS_TASK_REQUEST,taskId:t}}function dr(t){return{type:Je.DISMISS_TASK_SUCCESS,task:t}}function Er(t,e){return{type:Je.UNDO_DISMISS_TASK_ERROR,taskId:t,error:e}}function Sr(t){return{type:Je.UNDO_DISMISS_TASK_REQUEST,taskId:t}}function lr(t){return{type:Je.UNDO_DISMISS_TASK_SUCCESS,task:t}}function Tr(t,e){return{type:Je.HIDE_TASK_LIST_ERROR,taskListId:t,error:e}}function _r(t){return{type:Je.HIDE_TASK_LIST_REQUEST,taskListId:t}}function pr(t){return{type:Je.HIDE_TASK_LIST_SUCCESS,taskList:t}}function gr(t){return{type:Je.SET_TASKS_STATUS,tasksStatus:t}}function fr(t){return{type:Je.GET_PAYMENT_METHODS_SUCCESS,paymentMethods:t}}function yr(t){return{type:Je.SET_EMAIL_PREFILL,emailPrefill:t}}function Rr(t){return{type:Je.GET_PRODUCT_TYPES_SUCCESS,productTypes:t}}function mr(t){return{type:Je.GET_PRODUCT_TYPES_ERROR,error:t}}function*Or(t){yield Ze("updateProfileItems",!0),yield ze("updateProfileItems",null);try{const e=yield Object(L.apiFetch)({path:et+"/onboarding/profile",method:"POST",data:t});if(e&&"success"===e.status)return yield Xe(t),yield Ze("updateProfileItems",!1),e;throw new Error}catch(t){throw yield ze("updateProfileItems",t),yield Ze("updateProfileItems",!1),t}}function*Ir(t){yield nr(t);try{const e=yield Object(L.apiFetch)({path:`${et}/onboarding/tasks/${t}/snooze`,method:"POST"});yield or(e)}catch(e){throw yield rr(t,e),new Error}}function*Ar(t){yield ir(t);try{const e=yield Object(L.apiFetch)({path:`${et}/onboarding/tasks/${t}/undo_snooze`,method:"POST"});yield ar(e)}catch(e){throw yield sr(t,e),new Error}}function*hr(t){yield ur(t);try{const e=yield Object(L.apiFetch)({path:`${et}/onboarding/tasks/${t}/dismiss`,method:"POST"});yield dr(e)}catch(e){throw yield cr(t,e),new Error}}function*Pr(t){yield Sr(t);try{const e=yield Object(L.apiFetch)({path:`${et}/onboarding/tasks/${t}/undo_dismiss`,method:"POST"});yield lr(e)}catch(e){throw yield Er(t,e),new Error}}function*vr(t){yield _r(t);try{const e=yield Object(L.apiFetch)({path:`${et}/onboarding/tasks/${t}/hide`,method:"POST"});yield pr(e)}catch(e){throw yield Tr(t,e),new Error}}function*Ur(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/profile",method:"GET"});yield Xe(t,!0)}catch(t){yield ze("getProfileItems",t)}}function*wr(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/profile/experimental_get_email_prefill",method:"GET"});yield yr(t.email)}catch(t){yield ze("getEmailPrefill",t)}}function*Nr(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/tasks/status",method:"GET"});yield gr(t)}catch(t){yield ze("getTasksStatus",t)}}function*br(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/tasks",method:"GET"});yield er(t)}catch(t){yield tr(t)}}function*Cr(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/payments",method:"GET"});yield fr(t)}catch(t){yield ze("getPaymentGatewaySuggestions",t)}}function*Dr(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/free-extensions",method:"GET"});yield Be(t)}catch(t){yield $e(t)}}function*Gr(){try{const t=yield Object(L.apiFetch)({path:et+"/onboarding/product-types",method:"GET"});yield Rr(t)}catch(t){yield mr(t)}}const kr={errors:{},freeExtensions:[],profileItems:{business_extensions:null,completed:null,industry:null,other_platform:null,other_platform_name:null,product_count:null,product_types:null,revenue:null,selling_venues:null,setup_client:null,skipped:null,theme:null,wccom_connected:null,is_agree_marketing:null,store_email:null},emailPrefill:"",paymentMethods:[],productTypes:[],requesting:{},taskLists:[],tasksStatus:{}},Mr=(t,e)=>t.map(t=>({...t,tasks:t.tasks.map(t=>e.id===t.id?{...t,...e}:t)}));var jr=(t=kr,{freeExtensions:e,type:r,profileItems:n,emailPrefill:o,paymentMethods:s,productTypes:i,replace:a,error:c,isRequesting:u,selector:d,task:E,taskId:S,taskListId:l,taskList:T,taskLists:_,tasksStatus:p})=>{switch(r){case Je.SET_PROFILE_ITEMS:return{...t,profileItems:a?n:{...t.profileItems,...n}};case Je.SET_EMAIL_PREFILL:return{...t,emailPrefill:o};case Je.SET_TASKS_STATUS:return{...t,tasksStatus:{...t.tasksStatus,...p}};case Je.SET_ERROR:return{...t,errors:{...t.errors,[d]:c}};case Je.SET_IS_REQUESTING:return{...t,requesting:{...t.requesting,[d]:u}};case Je.GET_PAYMENT_METHODS_SUCCESS:return{...t,paymentMethods:s};case Je.GET_PRODUCT_TYPES_SUCCESS:return{...t,productTypes:i};case Je.GET_PRODUCT_TYPES_ERROR:return{...t,errors:{...t.errors,productTypes:c}};case Je.GET_FREE_EXTENSIONS_ERROR:return{...t,errors:{...t.errors,getFreeExtensions:c}};case Je.GET_FREE_EXTENSIONS_SUCCESS:return{...t,freeExtensions:e};case Je.GET_TASK_LISTS_ERROR:return{...t,errors:{...t.errors,getTaskLists:c}};case Je.GET_TASK_LISTS_SUCCESS:return{...t,taskLists:_};case Je.DISMISS_TASK_ERROR:return{...t,errors:{...t.errors,dismissTask:c},taskLists:Mr(t.taskLists,{id:S,isDismissed:!1})};case Je.DISMISS_TASK_REQUEST:return{...t,requesting:{...t.requesting,dismissTask:!0},taskLists:Mr(t.taskLists,{id:S,isDismissed:!0})};case Je.DISMISS_TASK_SUCCESS:return{...t,requesting:{...t.requesting,dismissTask:!1},taskLists:Mr(t.taskLists,E)};case Je.UNDO_DISMISS_TASK_ERROR:return{...t,errors:{...t.errors,undoDismissTask:c},taskLists:Mr(t.taskLists,{id:S,isDismissed:!0})};case Je.UNDO_DISMISS_TASK_REQUEST:return{...t,requesting:{...t.requesting,undoDismissTask:!0},taskLists:Mr(t.taskLists,{id:S,isDismissed:!1})};case Je.UNDO_DISMISS_TASK_SUCCESS:return{...t,requesting:{...t.requesting,undoDismissTask:!1},taskLists:Mr(t.taskLists,E)};case Je.SNOOZE_TASK_ERROR:return{...t,errors:{...t.errors,snoozeTask:c},taskLists:Mr(t.taskLists,{id:S,isSnoozed:!1})};case Je.SNOOZE_TASK_REQUEST:return{...t,requesting:{...t.requesting,snoozeTask:!0},taskLists:Mr(t.taskLists,{id:S,isSnoozed:!0})};case Je.SNOOZE_TASK_SUCCESS:return{...t,requesting:{...t.requesting,snoozeTask:!1},taskLists:Mr(t.taskLists,E)};case Je.UNDO_SNOOZE_TASK_ERROR:return{...t,errors:{...t.errors,undoSnoozeTask:c},taskLists:Mr(t.taskLists,{id:S,isSnoozed:!0})};case Je.UNDO_SNOOZE_TASK_REQUEST:return{...t,requesting:{...t.requesting,undoSnoozeTask:!0},taskLists:Mr(t.taskLists,{id:S,isSnoozed:!1})};case Je.UNDO_SNOOZE_TASK_SUCCESS:return{...t,requesting:{...t.requesting,undoSnoozeTask:!1},taskLists:Mr(t.taskLists,E)};case Je.HIDE_TASK_LIST_ERROR:return{...t,errors:{...t.errors,hideTaskList:c},taskLists:t.taskLists.map(t=>l===t.id?{...t,isHidden:!1}:t)};case Je.HIDE_TASK_LIST_REQUEST:return{...t,requesting:{...t.requesting,hideTaskList:!0},taskLists:t.taskLists.map(t=>l===t.id?{...t,isHidden:!0}:t)};case Je.HIDE_TASK_LIST_SUCCESS:return{...t,requesting:{...t.requesting,hideTaskList:!1},taskLists:t.taskLists.map(t=>l===t.id?T:t)};default:return t}};Object(F.registerStore)("wc/admin/onboarding",{reducer:jr,actions:l,controls:L.controls,selectors:S,resolvers:T});const Fr="wc/admin/onboarding",Lr=t=>{let e=!1,r=!1;return Object(Pt.createHigherOrderComponent)(n=>o=>{const s=Object(vt.useRef)(t);return Object(F.useSelect)((t,n)=>{if(!s.current)return;const{isResolving:o,hasFinishedResolution:i}=t("wc/admin/onboarding"),{startResolution:a,finishResolution:c,setProfileItems:u,setTasksStatus:d}=n.dispatch("wc/admin/onboarding"),{profileItems:E,tasksStatus:S}=s.current;!E||e||o("getProfileItems",[])||i("getProfileItems",[])||(a("getProfileItems",[]),u(E,!0),c("getProfileItems",[]),e=!0),!S||r||o("getTasksStatus",[])||i("getTasksStatus",[])||(a("getTasksStatus",[]),d(S,!0),c("getTasksStatus",[]),r=!0)},[]),Object(vt.createElement)(n,Object.assign({},o))},"withOnboardingHydration")},qr="core",Yr=t=>Object(Pt.createHigherOrderComponent)(e=>r=>{const n=Object(vt.useRef)(t);return Object(F.useSelect)((t,e)=>{if(!n.current)return;const{isResolving:r,hasFinishedResolution:o}=t("core"),{startResolution:s,finishResolution:i,receiveCurrentUser:a}=e.dispatch("core");r("getCurrentUser")||o("getCurrentUser")||(s("getCurrentUser",[]),a(n.current),i("getCurrentUser",[]))}),Object(vt.createElement)(e,Object.assign({},r))},"withCurrentUserHydration"),Qr=()=>{const t=Object(F.useSelect)(t=>{const{getCurrentUser:e,hasStartedResolution:r,hasFinishedResolution:n}=t("core");return{isRequesting:r("getCurrentUser")&&!n("getCurrentUser"),user:e(),getCurrentUser:e}});return{currentUserCan:e=>!(!t.user||!t.user.is_super_admin)||!(!t.user||!t.user.capabilities[e]),user:t.user,isRequesting:t.isRequesting}},xr=t=>{const e=t.woocommerce_meta||{};return Object(X.mapValues)(e,(t,e)=>{if(!t||0===t.length)return"";try{return JSON.parse(t)}catch(r){return console.error(`Error parsing value '${t}' for ${e}`,r.message),""}})};const Kr=()=>{const t=Object(F.useDispatch)("core"),{addEntities:e,receiveCurrentUser:r,saveEntityRecord:n}=t;let{saveUser:o}=t;const s=Object(F.useSelect)(t=>{const{getCurrentUser:e,getEntity:r,getEntityRecord:n,getLastEntitySaveError:o,hasStartedResolution:s,hasFinishedResolution:i}=t("core");return{isRequesting:s("getCurrentUser")&&!i("getCurrentUser"),user:e(),getCurrentUser:e,getEntity:r,getEntityRecord:n,getLastEntitySaveError:o}}),i=s.user?xr(s.user):{};return{isRequesting:s.isRequesting,...i,updateUserPreferences:t=>{"function"!=typeof o&&(o=async t=>(Boolean(s.getEntity("root","user"))||await e([{name:"user",kind:"root",baseURL:"/wp/v2/users",plural:"users"}]),await n("root","user",t),s.getEntityRecord("root","user",t.id)));const i=s.getCurrentUser();return async function(t,e,r,n,o){const s=Object(X.mapValues)(o,JSON.stringify);if(0===Object.keys(s).length)return{error:new Error("Invalid woocommerce_meta data for update."),updatedUser:void 0};t({...e,woocommerce_meta:{...e.woocommerce_meta,...s}});const i=await r({id:e.id,woocommerce_meta:s});if(void 0===i){return{error:n("root","user",e.id),updatedUser:i}}return{updatedUser:{...i,woocommerce_meta:xr(i)}}}(r,i,o,s.getLastEntitySaveError,t)}}},Wr=t=>{const e=Object(vt.useRef)(t);Object(F.useSelect)((t,r)=>{if(!e.current)return;const{isResolving:n,hasFinishedResolution:o}=t("wc/admin/options"),{startResolution:s,finishResolution:i,receiveOptions:a}=r.dispatch("wc/admin/options");Object.keys(e.current).forEach(t=>{n("getOption",[t])||o("getOption",[t])||(s("getOption",[t]),a({[t]:e.current[t]}),i("getOption",[t]))})},[])},Vr=t=>Object(Pt.createHigherOrderComponent)(e=>r=>(Wr(t),Object(vt.createElement)(e,Object.assign({},r))),"withOptionsHydration"),Hr=(t,e)=>{const r=JSON.stringify(e);return(t.reviews[r]&&t.reviews[r].data||[]).map(e=>t.data[e])},Jr=(t,e)=>{const r=JSON.stringify(e);return t.reviews[r]&&t.reviews[r].totalCount},$r=(t,e)=>{const r=JSON.stringify(e);return t.errors[r]};var Br={UPDATE_REVIEWS:"UPDATE_REVIEWS",SET_REVIEW:"SET_REVIEW",SET_ERROR:"SET_ERROR",SET_REVIEW_IS_UPDATING:"SET_REVIEW_IS_UPDATING"};function zr(t,e,r){return{type:Br.UPDATE_REVIEWS,reviews:e,query:t,totalCount:r}}function*Zr(t,e,r){yield tn(t,!0);try{const n=Object(ie.addQueryArgs)(`${tt}/products/reviews/${t}`,r||{}),o=yield Object(L.apiFetch)({path:n,method:"PUT",data:e});yield en(t,o),yield tn(t,!1)}catch(e){throw yield rn("updateReview",e),yield tn(t,!1),new Error}}function*Xr(t){yield tn(t,!0);try{const e=`${tt}/products/reviews/${t}`,r=yield Object(L.apiFetch)({path:e,method:"DELETE"});return yield en(t,r),yield tn(t,!1),r}catch(e){throw yield rn("deleteReview",e),yield tn(t,!1),new Error}}function tn(t,e){return{type:Br.SET_REVIEW_IS_UPDATING,reviewId:t,isUpdating:e}}function en(t,e){return{type:Br.SET_REVIEW,reviewId:t,reviewData:e}}function rn(t,e){return{type:Br.SET_ERROR,query:t,error:e}}const nn=t=>({type:"FETCH_WITH_HEADERS",options:t});var on={...L.controls,FETCH_WITH_HEADERS:({options:t})=>fe()({...t,parse:!1}).then(t=>Promise.all([t.headers,t.status,t.json()])).then(([t,e,r])=>({headers:t,status:e,data:r}))};function*sn(t){try{const e=Object(ie.addQueryArgs)(tt+"/products/reviews",t),r=yield nn({path:e,method:"GET"}),n=parseInt(r.headers.get("x-wp-total"),10);yield zr(t,r.data,n)}catch(e){yield rn(t,e)}}function*an(t){yield sn(t)}var cn=(t={reviews:{},errors:{},data:{}},{type:e,query:r,reviews:n,reviewId:o,reviewData:s,totalCount:i,error:a,isUpdating:c})=>{switch(e){case Br.UPDATE_REVIEWS:const e=[],u=n.reduce((r,n)=>(e.push(n.id),r[n.id]={...t.data[n.id]||{},...n},r),{});return{...t,reviews:{...t.reviews,[JSON.stringify(r)]:{data:e,totalCount:i}},data:{...t.data,...u}};case Br.SET_REVIEW:return{...t,data:{...t.data,[o]:s}};case Br.SET_ERROR:return{...t,errors:{...t.errors,[JSON.stringify(r)]:a}};case Br.SET_REVIEW_IS_UPDATING:return{...t,data:{...t.data,[o]:{...t.data[o],isUpdating:c}}};default:return t}};Object(F.registerStore)("wc/admin/reviews",{reducer:cn,actions:p,controls:on,selectors:_,resolvers:g});const un="wc/admin/reviews";var dn,En;function Sn(t){return[t]}function ln(){var t={clear:function(){t.head=null}};return t}function Tn(t,e,r){var n;if(t.length!==e.length)return!1;for(n=r;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}dn={},En="undefined"!=typeof WeakMap;var _n=function(t,e){var r,n;function o(){r=En?new WeakMap:ln()}function s(){var r,o,s,i,a,c=arguments.length;for(i=new Array(c),s=0;s<c;s++)i[s]=arguments[s];for(a=e.apply(null,i),(r=n(a)).isUniqueByDependants||(r.lastDependants&&!Tn(a,r.lastDependants,0)&&r.clear(),r.lastDependants=a),o=r.head;o;){if(Tn(o.args,i,1))return o!==r.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=r.head,o.prev=null,r.head.prev=o,r.head=o),o.val;o=o.next}return o={val:t.apply(null,i)},i[0]=null,o.args=i,r.head&&(r.head.prev=o,o.next=r.head),r.head=o,o.val}return e||(e=Sn),n=En?function(t){var e,n,o,s,i,a=r,c=!0;for(e=0;e<t.length;e++){if(n=t[e],!(i=n)||"object"!=typeof i){c=!1;break}a.has(n)?a=a.get(n):(o=new WeakMap,a.set(n,o),a=o)}return a.has(dn)||((s=ln()).isUniqueByDependants=c,a.set(dn,s)),a.get(dn)}:function(){return r},s.getDependants=e,s.clear=o,o(),s};const pn=_n((t,e)=>(t.noteQueries[JSON.stringify(e)]||[]).map(e=>t.notes[e]),(t,e)=>[t.noteQueries[JSON.stringify(e)],t.notes]),gn=(t,e)=>t.errors[e]||!1,fn=(t,e)=>t.requesting[e]||!1;var yn={SET_ERROR:"SET_ERROR",SET_NOTE:"SET_NOTE",SET_NOTE_IS_UPDATING:"SET_NOTE_IS_UPDATING",SET_NOTES:"SET_NOTES",SET_NOTES_QUERY:"SET_NOTES_QUERY",SET_IS_REQUESTING:"SET_IS_REQUESTING"};function*Rn(t,e){yield Nn("triggerNoteAction",!0);const r=`${tt}/admin/notes/${t}/action/${e}`;try{const e=yield Object(L.apiFetch)({path:r,method:"POST"});yield An(t,e),yield Nn("triggerNoteAction",!1)}catch(t){throw yield wn("triggerNoteAction",t),yield Nn("triggerNoteAction",!1),new Error}}function*mn(t){yield Nn("removeNote",!0),yield Pn(t,!0);try{const e=`${tt}/admin/notes/delete/${t}`,r=yield Object(L.apiFetch)({path:e,method:"DELETE"});return yield hn(t,r),yield Nn("removeNote",!1),r}catch(e){throw yield wn("removeNote",e),yield Nn("removeNote",!1),yield Pn(t,!1),new Error}}function*On(t={}){yield Nn("removeAllNotes",!0);try{const e=Object(ie.addQueryArgs)(tt+"/admin/notes/delete/all",t),r=yield Object(L.apiFetch)({path:e,method:"DELETE"});return yield vn(r),yield Nn("removeAllNotes",!1),r}catch(t){throw yield wn("removeAllNotes",t),yield Nn("removeAllNotes",!1),new Error}}function*In(t,e){yield Nn("batchUpdateNotes",!0);try{const r=tt+"/admin/notes/update",n=yield Object(L.apiFetch)({path:r,method:"PUT",data:{noteIds:t,...e}});yield vn(n),yield Nn("batchUpdateNotes",!1)}catch(t){throw yield wn("updateNote",t),yield Nn("batchUpdateNotes",!1),new Error}}function*An(t,e){yield Nn("updateNote",!0),yield Pn(t,!0);try{const r=`${tt}/admin/notes/${t}`,n=yield Object(L.apiFetch)({path:r,method:"PUT",data:e});yield hn(t,n),yield Nn("updateNote",!1),yield Pn(t,!1)}catch(e){throw yield wn("updateNote",e),yield Nn("updateNote",!1),yield Pn(t,!1),new Error}}function hn(t,e){return{type:yn.SET_NOTE,noteId:t,noteFields:e}}function Pn(t,e){return{type:yn.SET_NOTE_IS_UPDATING,noteId:t,isUpdating:e}}function vn(t){return{type:yn.SET_NOTES,notes:t}}function Un(t,e){return{type:yn.SET_NOTES_QUERY,query:t,noteIds:e}}function wn(t,e){return{type:yn.SET_ERROR,error:e,selector:t}}function Nn(t,e){return{type:yn.SET_IS_REQUESTING,selector:t,isRequesting:e}}function*bn(t={}){const e=Object(ie.addQueryArgs)(tt+"/admin/notes",t);try{const r=yield Object(L.apiFetch)({path:e});yield vn(r),yield Un(t,r.map(t=>t.id))}catch(t){yield wn("getNotes",t)}}var Cn=(t={errors:{},noteQueries:{},notes:{},requesting:{}},{error:e,isRequesting:r,isUpdating:n,noteFields:o,noteId:s,noteIds:i,notes:a,query:c,selector:u,type:d})=>{switch(d){case yn.SET_NOTES:t={...t,notes:{...t.notes,...a.reduce((t,e)=>(t[e.id]=e,t),{})}};break;case yn.SET_NOTES_QUERY:t={...t,noteQueries:{...t.noteQueries,[JSON.stringify(c)]:i}};break;case yn.SET_ERROR:t={...t,errors:{...t.errors,[u]:e}};break;case yn.SET_NOTE:t={...t,notes:{...t.notes,[s]:o}};break;case yn.SET_NOTE_IS_UPDATING:t={...t,notes:{...t.notes,[s]:{...t.notes[s],isUpdating:n}}};break;case yn.SET_IS_REQUESTING:t={...t,requesting:{...t.requesting,[u]:r}}}return t};Object(F.registerStore)("wc/admin/notes",{reducer:Cn,actions:y,controls:L.controls,selectors:f,resolvers:R});const Dn="wc/admin/notes",Gn={},kn=(t,e,r)=>{const n=Y(e,r);return t.itemErrors[n]||!1},Mn=(t,e,r)=>{const n=Y(e,r);return t.items[n]||Gn},jn=(t,e,r)=>{const n=Y(e,r);return t.stats[n]||Gn},Fn=(t,e,r)=>{const n=Y(e,r);return t.statErrors[n]||!1};var Ln={SET_ITEM_ERROR:"SET_ITEM_ERROR",SET_STAT_ERROR:"SET_STAT_ERROR",SET_REPORT_ITEMS:"SET_REPORT_ITEMS",SET_REPORT_STATS:"SET_REPORT_STATS"};function qn(t,e,r){const n=Y(t,e);return{type:Ln.SET_ITEM_ERROR,resourceName:n,error:r}}function Yn(t,e,r){const n=Y(t,e);return{type:Ln.SET_REPORT_ITEMS,resourceName:n,items:r}}function Qn(t,e,r){const n=Y(t,e);return{type:Ln.SET_REPORT_STATS,resourceName:n,stats:r}}function xn(t,e,r){const n=Y(t,e);return{type:Ln.SET_STAT_ERROR,resourceName:n,error:r}}function*Kn(t,e){const r={parse:!1,path:Object(ie.addQueryArgs)(`${tt}/reports/${t}`,e)};try{const n=yield nn(r),o=n.data,s=parseInt(n.headers.get("x-wp-total"),10),i=parseInt(n.headers.get("x-wp-totalpages"),10);yield Yn(t,e,{data:o,totalResults:s,totalPages:i})}catch(r){yield qn(t,e,r)}}function*Wn(t,e){const r={parse:!1,path:Object(ie.addQueryArgs)(`${tt}/reports/${t}/stats`,e)};try{const n=yield nn(r),o=n.data,s=parseInt(n.headers.get("x-wp-total"),10),i=parseInt(n.headers.get("x-wp-totalpages"),10);yield Qn(t,e,{data:o,totalResults:s,totalPages:i})}catch(r){yield xn(t,e,r)}}var Vn=(t={itemErrors:{},items:{},statErrors:{},stats:{}},{type:e,items:r,stats:n,error:o,resourceName:s})=>{switch(e){case Ln.SET_REPORT_ITEMS:return{...t,items:{...t.items,[s]:r}};case Ln.SET_REPORT_STATS:return{...t,stats:{...t.stats,[s]:n}};case Ln.SET_ITEM_ERROR:return{...t,itemErrors:{...t.itemErrors,[s]:o}};case Ln.SET_STAT_ERROR:return{...t,statErrors:{...t.statErrors,[s]:o}};default:return t}};Object(F.registerStore)("wc/admin/reports",{reducer:Vn,actions:O,controls:on,selectors:m,resolvers:I});const Hn="wc/admin/reports";var Jn=r(19);function $n(t){const{per_page:e,persisted_query:r,query:n,select:o,filterQuery:s}=t,{getItems:i,getItemsError:a,isResolving:c}=o("wc/admin/items"),u={isRequesting:!1,isError:!1,rows:[]},d=Object(Jn.getCurrentDates)(n,t.defaultDateRange),E={...s,after:Object(Jn.appendTimestamp)(d.primary.after,"start"),before:Object(Jn.appendTimestamp)(d.primary.before,"end"),per_page:e,persisted_query:JSON.stringify(r)},S=i("leaderboards",E);if(c("getItems",["leaderboards",E]))return{...u,isRequesting:!0};if(a("leaderboards",E))return{...u,isError:!0};const l=S.get(t.id);return{...u,rows:null==l?void 0:l.rows}}function Bn(t,e,r,n={}){const{getItems:o,getItemsError:s,isResolving:i}=t,a={};let c=!1,u=!1;return r.forEach(t=>{const r={search:t,per_page:10,...n};o(e,r).forEach((t,e)=>{a[e]=t}),i("getItems",[e,r])&&(c=!0),s(e,r)&&(u=!0)}),{items:a,isRequesting:c,isError:u}}function zn(t,e){const{_fields:r,page:n,per_page:o,...s}=e;return Y("total-"+t,s)}const Zn=_n((t,e,r,n=new Map)=>{const o=Y(e,r),s=t.items[o]&&t.items[o].data;return s?s.reduce((r,n)=>(r.set(n,t.data[e][n]),r),new Map):n},(t,e,r)=>{const n=Y(e,r);return[t.items[n]]}),Xn=(t,e,r,n=0)=>{const o=zn(e,r);return t.items.hasOwnProperty(o)?t.items[o]:n},to=(t,e,r)=>{const n=Y(e,r);return t.errors[n]};var eo={SET_ITEM:"SET_ITEM",SET_ITEMS:"SET_ITEMS",SET_ITEMS_TOTAL_COUNT:"SET_ITEMS_TOTAL_COUNT",SET_ERROR:"SET_ERROR"};function ro(t,e,r){return{type:eo.SET_ITEM,id:e,item:r,itemType:t}}function no(t,e,r,n){return{type:eo.SET_ITEMS,items:r,itemType:t,query:e,totalCount:n}}function oo(t,e,r){return{type:eo.SET_ITEMS_TOTAL_COUNT,itemType:t,query:e,totalCount:r}}function so(t,e,r){return{type:eo.SET_ERROR,itemType:t,query:e,error:r}}function*io(t,e){const r={...t,stock_quantity:e},{id:n,parent_id:o,type:s}=r;yield ro("products",n,r);let i=tt;switch(s){case"variation":i+=`/products/${o}/variations/${n}`;break;case"variable":case"simple":default:i+="/products/"+n}try{return yield Object(L.apiFetch)({path:i,method:"PUT",data:r}),!0}catch(e){return yield ro("products",n,t),yield so("products",n,e),!1}}function*ao(t,e){try{const r=Object(ie.addQueryArgs)(et+"/onboarding/tasks/create_product_from_template",e||{}),n=yield Object(L.apiFetch)({path:r,method:"POST",data:t});return yield ro("products",n.id,n),n}catch(t){throw yield so("createProductFromTemplate",e,t),t}}function*co(t,e){const r="categories"===t?"products/categories":t,n=Object(ie.addQueryArgs)(`${tt}/${r}`,e),o=-1===e.per_page,s=o?L.apiFetch:nn,i=yield s({path:n,method:"GET"});if(o)return{items:i,totalCount:i.length};const a=parseInt(i.headers.get("x-wp-total"),10);return{items:i.data,totalCount:a}}function*uo(t,e){try{const{items:r,totalCount:n}=yield co(t,e);yield oo(t,e,n),yield no(t,e,r)}catch(r){yield so(t,e,r)}}function*Eo(t,e){yield So(t,e)}function*So(t,e){try{const r={...e,page:1,per_page:1},{totalCount:n}=yield co(t,r);yield oo(t,e,n)}catch(r){yield so(t,e,r)}}var lo=(t={items:{},errors:{},data:{}},{type:e,id:r,itemType:n,query:o,item:s,items:i,totalCount:a,error:c})=>{switch(e){case eo.SET_ITEM:const e=t.data[n]||{};return{...t,data:{...t.data,[n]:{...e,[r]:{...e[r]||{},...s}}}};case eo.SET_ITEMS:const u=[],d=i.reduce((t,e)=>(u.push(e.id),t[e.id]=e,t),{}),E=Y(n,o);return{...t,items:{...t.items,[E]:{data:u}},data:{...t.data,[n]:{...t.data[n],...d}}};case eo.SET_ITEMS_TOTAL_COUNT:const S=zn(n,o);return{...t,items:{...t.items,[S]:a}};case eo.SET_ERROR:return{...t,errors:{...t.errors,[Y(n,o)]:c}};default:return t}};Object(F.registerStore)("wc/admin/items",{reducer:lo,actions:h,controls:on,selectors:A,resolvers:P});const To="wc/admin/items";var _o=r(30);const po=t=>Object(_o.applyFilters)("woocommerce_navigation_menu_items",t.menuItems),go=t=>t.favorites||[],fo=(t,e)=>t.requesting[e]||!1,yo=t=>t.persistedQuery||{};var Ro=r(12);var mo={ADD_MENU_ITEMS:"ADD_MENU_ITEMS",SET_MENU_ITEMS:"SET_MENU_ITEMS",ON_HISTORY_CHANGE:"ON_HISTORY_CHANGE",ADD_FAVORITE_FAILURE:"ADD_FAVORITE_FAILURE",ADD_FAVORITE_REQUEST:"ADD_FAVORITE_REQUEST",ADD_FAVORITE_SUCCESS:"ADD_FAVORITE_SUCCESS",GET_FAVORITES_FAILURE:"GET_FAVORITES_FAILURE",GET_FAVORITES_REQUEST:"GET_FAVORITES_REQUEST",GET_FAVORITES_SUCCESS:"GET_FAVORITES_SUCCESS",REMOVE_FAVORITE_FAILURE:"REMOVE_FAVORITE_FAILURE",REMOVE_FAVORITE_REQUEST:"REMOVE_FAVORITE_REQUEST",REMOVE_FAVORITE_SUCCESS:"REMOVE_FAVORITE_SUCCESS"};function Oo(t){return{type:mo.SET_MENU_ITEMS,menuItems:t}}function Io(t){return{type:mo.ADD_MENU_ITEMS,menuItems:t}}function Ao(t){return{type:mo.GET_FAVORITES_FAILURE,error:t}}function ho(t){return{type:mo.GET_FAVORITES_REQUEST,favorites:t}}function Po(t){return{type:mo.GET_FAVORITES_SUCCESS,favorites:t}}function vo(t){return{type:mo.ADD_FAVORITE_REQUEST,favorite:t}}function Uo(t,e){return{type:mo.ADD_FAVORITE_FAILURE,favorite:t,error:e}}function wo(t){return{type:mo.ADD_FAVORITE_SUCCESS,favorite:t}}function No(t){return{type:mo.REMOVE_FAVORITE_REQUEST,favorite:t}}function bo(t,e){return{type:mo.REMOVE_FAVORITE_FAILURE,favorite:t,error:e}}function Co(t,e){return{type:mo.REMOVE_FAVORITE_SUCCESS,favorite:t,error:e}}function*Do(){yield Go()}function*Go(){const t=Object(Ro.getPersistedQuery)();if(!Object.keys(t).length)return null;yield{type:mo.ON_HISTORY_CHANGE,persistedQuery:t}}function*ko(t){yield vo(t);try{const e=yield fe()({path:et+"/navigation/favorites/me",method:"POST",data:{item_id:t}});if(e)return yield wo(t),e;throw new Error}catch(e){throw yield Uo(t,e),new Error}}function*Mo(t){yield No(t);try{const e=yield fe()({path:et+"/navigation/favorites/me",method:"DELETE",data:{item_id:t}});if(e)return yield Co(t),e;throw new Error}catch(e){throw yield bo(t,e),new Error}}var jo=(t={error:null,menuItems:[],favorites:[],requesting:{},persistedQuery:{}},{type:e,error:r,favorite:n,favorites:o,menuItems:s,persistedQuery:i})=>{switch(e){case mo.SET_MENU_ITEMS:t={...t,menuItems:s};break;case mo.ADD_MENU_ITEMS:t={...t,menuItems:[...t.menuItems,...s]};break;case mo.ON_HISTORY_CHANGE:t={...t,persistedQuery:i};break;case mo.GET_FAVORITES_FAILURE:t={...t,requesting:{...t.requesting,getFavorites:!1}};break;case mo.GET_FAVORITES_REQUEST:t={...t,requesting:{...t.requesting,getFavorites:!0}};break;case mo.GET_FAVORITES_SUCCESS:t={...t,favorites:o,requesting:{...t.requesting,getFavorites:!1}};break;case mo.ADD_FAVORITE_FAILURE:t={...t,error:r,requesting:{...t.requesting,addFavorite:!1}};break;case mo.ADD_FAVORITE_REQUEST:t={...t,requesting:{...t.requesting,addFavorite:!0}};break;case mo.ADD_FAVORITE_SUCCESS:const e=t.favorites.includes(n)?t.favorites:[...t.favorites,n];t={...t,favorites:e,menuItems:t.menuItems.map(t=>t.id===n?{...t,menuId:"favorites"}:t),requesting:{...t.requesting,addFavorite:!1}};break;case mo.REMOVE_FAVORITE_FAILURE:t={...t,requesting:{...t.requesting,error:r,removeFavorite:!1}};break;case mo.REMOVE_FAVORITE_REQUEST:t={...t,requesting:{...t.requesting,removeFavorite:!0}};break;case mo.REMOVE_FAVORITE_SUCCESS:const a=t.favorites.filter(t=>t!==n);t={...t,favorites:a,menuItems:t.menuItems.map(t=>t.id===n?{...t,menuId:"plugins"}:t),requesting:{...t.requesting,removeFavorite:!1}}}return t};function*Fo(){yield ho();try{const t=yield Object(L.apiFetch)({path:et+"/navigation/favorites/me"});if(t)return void(yield Po(t));throw new Error}catch(t){throw yield Ao(t),new Error}}Object(F.registerStore)("woocommerce-navigation",{reducer:jo,actions:U,controls:L.controls,resolvers:w,selectors:v}),(async()=>{const{onLoad:t,onHistoryChange:e}=Object(F.dispatch)("woocommerce-navigation");await t(),Object(Ro.addHistoryListener)(async()=>{setTimeout(async()=>{await e()},0)})})();const Lo="woocommerce-navigation",qo=t=>Object(Pt.createHigherOrderComponent)(e=>r=>{const n=Object(vt.useRef)(t);return Object(F.useSelect)((t,e)=>{if(!n.current)return;const{isResolving:r,hasFinishedResolution:o}=t("woocommerce-navigation"),{startResolution:s,finishResolution:i,setMenuItems:a}=e.dispatch("woocommerce-navigation");r("getMenuItems")||o("getMenuItems")||(s("getMenuItems",[]),a(n.current.menuItems),i("getMenuItems",[]))}),Object(vt.createElement)(e,Object.assign({},r))},"withNavigationHydration");var Yo;!function(t){t.GET_PAYMENT_GATEWAYS_REQUEST="GET_PAYMENT_GATEWAYS_REQUEST",t.GET_PAYMENT_GATEWAYS_SUCCESS="GET_PAYMENT_GATEWAYS_SUCCESS",t.GET_PAYMENT_GATEWAYS_ERROR="GET_PAYMENT_GATEWAYS_ERROR",t.UPDATE_PAYMENT_GATEWAY_REQUEST="UPDATE_PAYMENT_GATEWAY_REQUEST",t.UPDATE_PAYMENT_GATEWAY_SUCCESS="UPDATE_PAYMENT_GATEWAY_SUCCESS",t.UPDATE_PAYMENT_GATEWAY_ERROR="UPDATE_PAYMENT_GATEWAY_ERROR",t.GET_PAYMENT_GATEWAY_REQUEST="GET_PAYMENT_GATEWAY_REQUEST",t.GET_PAYMENT_GATEWAY_SUCCESS="GET_PAYMENT_GATEWAY_SUCCESS",t.GET_PAYMENT_GATEWAY_ERROR="GET_PAYMENT_GATEWAY_ERROR"}(Yo||(Yo={}));const Qo="wc/payment-gateways";function xo(){return{type:Yo.GET_PAYMENT_GATEWAYS_REQUEST}}function Ko(t){return{type:Yo.GET_PAYMENT_GATEWAYS_SUCCESS,paymentGateways:t}}function Wo(t){return{type:Yo.GET_PAYMENT_GATEWAYS_ERROR,error:t}}function Vo(){return{type:Yo.GET_PAYMENT_GATEWAY_REQUEST}}function Ho(t){return{type:Yo.GET_PAYMENT_GATEWAY_ERROR,error:t}}function Jo(t){return{type:Yo.GET_PAYMENT_GATEWAY_SUCCESS,paymentGateway:t}}function $o(t){return{type:Yo.UPDATE_PAYMENT_GATEWAY_SUCCESS,paymentGateway:t}}function Bo(){return{type:Yo.UPDATE_PAYMENT_GATEWAY_REQUEST}}function zo(t){return{type:Yo.UPDATE_PAYMENT_GATEWAY_ERROR,error:t}}function*Zo(t,e){try{yield Bo();const r=yield Object(L.apiFetch)({method:"PUT",path:"wc/v3/payment_gateways/"+t,body:JSON.stringify(e)});if(r&&r.id===t)return yield $o(r),r}catch(t){throw yield zo(t),t}}const Xo=F.controls&&F.controls.dispatch?F.controls.dispatch:L.dispatch;function*ts(){yield xo();try{const t=yield Object(L.apiFetch)({path:"wc/v3/payment_gateways"});yield Ko(t);for(let e=0;e<t.length;e++)yield Xo(Qo,"finishResolution","getPaymentGateway",[t[e].id])}catch(t){yield Wo(t)}}function*es(t){yield Vo();try{const e=yield Object(L.apiFetch)({path:"wc/v3/payment_gateways/"+t});if(e&&e.id)return yield Jo(e),e}catch(t){yield Ho(t)}}function rs(t,e){return t.paymentGateways.find(t=>t.id===e)}function ns(t){return t.paymentGateways}function os(t,e){return t.errors[e]||null}function ss(t){return t.isUpdating||!1}function is(t,e){const r=t.paymentGateways.findIndex(t=>t.id===e.id);return-1===r?{...t,paymentGateways:[...t.paymentGateways,e],isUpdating:!1}:{...t,paymentGateways:[...t.paymentGateways.slice(0,r),e,...t.paymentGateways.slice(r+1)],isUpdating:!1}}var as=(t={paymentGateways:[],isUpdating:!1,errors:{}},e)=>{if(e&&"type"in e)switch(e.type){case Yo.GET_PAYMENT_GATEWAYS_REQUEST:case Yo.GET_PAYMENT_GATEWAY_REQUEST:return t;case Yo.GET_PAYMENT_GATEWAYS_SUCCESS:return{...t,paymentGateways:e.paymentGateways};case Yo.GET_PAYMENT_GATEWAYS_ERROR:return{...t,errors:{...t.errors,getPaymentGateways:e.error}};case Yo.GET_PAYMENT_GATEWAY_ERROR:return{...t,errors:{...t.errors,getPaymentGateway:e.error}};case Yo.UPDATE_PAYMENT_GATEWAY_REQUEST:return{...t,isUpdating:!0};case Yo.UPDATE_PAYMENT_GATEWAY_SUCCESS:case Yo.GET_PAYMENT_GATEWAY_SUCCESS:return is(t,e.paymentGateway);case Yo.UPDATE_PAYMENT_GATEWAY_ERROR:return{...t,errors:{...t.errors,updatePaymentGateway:e.error},isUpdating:!1}}return t};const cs=Qo;Object(F.registerStore)(Qo,{actions:N,selectors:C,resolvers:b,controls:L.controls,reducer:as});var us=r(9),ds=r.n(us),Es=r(43),Ss=r.n(Es);function ls(t){const{endpoint:e,query:r,limitBy:n,filters:o=[],advancedFilters:s={}}=t;if(r.search){return(n||[e]).reduce((t,e)=>(t[e]=r[e],t),{})}return o.map(t=>function(t,e,r){const n=r[t.param];if(!n)return{};if("advanced"===n){const t=Object(Ro.getActiveFiltersFromQuery)(r,e.filters);if(0===t.length)return{};const n=Object(Ro.getQueryFromActiveFilters)(t.map(t=>function(t,e){const r=t.filters[e.key];if("Date"!==Object(X.get)(r,["input","component"]))return e;const{rule:n,value:o}=e,s={after:"start",before:"end"};if(Array.isArray(o)){const[t,r]=o;return Object.assign({},e,{value:[Object(Jn.appendTimestamp)(ds()(t),s.after),Object(Jn.appendTimestamp)(ds()(r),s.before)]})}return Object.assign({},e,{value:Object(Jn.appendTimestamp)(ds()(o),s[n])})}(e,t)),{},e.filters);return{match:r.match||"all",...n}}const o=Object(X.find)(Object(Ro.flattenFilters)(t.filters),{value:n});if(!o)return{};if(o.settings&&o.settings.param){const{param:t}=o.settings;return r[t]?{[t]:r[t]}:{}}return{[t.param]:n}}(t,s,r)).reduce((t,e)=>Object.assign(t,e),{})}const Ts=["stock","customers"];function _s(t){const{endpoint:e,dataType:r,query:n,fields:o}=t,s=Object(Jn.getCurrentDates)(n,t.defaultDateRange),i=Object(Jn.getIntervalForQuery)(n),a=ls(t),c=s[r].before;return Object(X.includes)(Ts,e)?{...a,fields:o}:{order:"asc",interval:i,per_page:nt,after:Object(Jn.appendTimestamp)(s[r].after,"start"),before:Object(Jn.appendTimestamp)(c,"end"),segmentby:n.segmentby,fields:o,...a}}function ps(t){const{endpoint:e,select:r}=t,{getReportStats:n,getReportStatsError:o,isResolving:s}=r("wc/admin/reports"),i={isRequesting:!1,isError:!1,totals:{primary:null,secondary:null}},a=_s({...t,dataType:"primary"}),c=n(e,a);if(s("getReportStats",[e,a]))return{...i,isRequesting:!0};if(o(e,a))return{...i,isError:!0};const u=c&&c.data&&c.data.totals||null,d=_s({...t,dataType:"secondary"}),E=n(e,d);if(s("getReportStats",[e,d]))return{...i,isRequesting:!0};if(o(e,d))return{...i,isError:!0};const S=E&&E.data&&E.data.totals||null;return{...i,totals:{primary:u,secondary:S}}}const gs={isEmpty:!1,isError:!1,isRequesting:!0,data:{totals:{},intervals:[]}},fs={isEmpty:!1,isError:!0,isRequesting:!1,data:{totals:{},intervals:[]}},ys={isEmpty:!0,isError:!1,isRequesting:!1,data:{totals:{},intervals:[]}},Rs=[],ms=Object(X.memoize)((t,e,r)=>({isEmpty:!1,isError:!1,isRequesting:!1,data:{totals:e,intervals:r}}),(t,e,r)=>[t,e.length,r.length].join(":"));function Os(t){const{endpoint:e}=t;let r=t.selector;t.select&&!t.selector&&(Ss()("option.select",{version:"1.7.0",hint:"You can pass the report selectors through option.selector now."}),r=t.select("wc/admin/reports"));const{getReportStats:n,getReportStatsError:o,isResolving:s}=r,i=_s(t),a=n(e,i);if(s("getReportStats",[e,i]))return gs;if(o(e,i))return fs;if(function(t,e){return!t||(!t.data||(!(t.data.totals&&!Object(X.isNull)(t.data.totals))||!(Object(X.includes)(Ts,e)||t.data.intervals&&0!==t.data.intervals.length)))}(a,e))return ys;const c=a&&a.data&&a.data.totals||null;let u=a&&a.data&&a.data.intervals||Rs;if(a.totalResults>nt){let t=!0,r=!1;const c=[],d=Math.ceil(a.totalResults/nt);let E=1;for(let a=2;a<=d;a++){const u={...i,page:a},S=n(e,u);if(!s("getReportStats",[e,u])){if(o(e,u)){r=!0,t=!1;break}if(c.push(S),E++,E===d){t=!1;break}}}if(t)return gs;if(r)return fs;Object(X.forEach)(c,(function(t){t.data&&t.data.intervals&&Array.isArray(t.data.intervals)&&(u=u.concat(t.data.intervals))}))}return ms(Y(e,i),c,u)}function Is(t,e){switch(t){case"currency":return e;case"percent":return".0%";case"number":return",";case"average":return",.2r";default:return","}}function As(t){const{query:e,tableQuery:r={}}=t,n=ls(t),o=Object(Jn.getCurrentDates)(e,t.defaultDateRange),s=Object(X.includes)(Ts,t.endpoint);return{orderby:e.orderby||"date",order:e.order||"desc",after:s?void 0:Object(Jn.appendTimestamp)(o.primary.after,"start"),before:s?void 0:Object(Jn.appendTimestamp)(o.primary.before,"end"),page:e.paged||1,per_page:e.per_page||dt.pageSize,...n,...r}}function hs(t){const{endpoint:e}=t;let r=t.selector;t.select&&!t.selector&&(Ss()("option.select",{version:"1.7.0",hint:"You can pass the report selectors through option.selector now."}),r=t.select("wc/admin/reports"));const{getReportItems:n,getReportItemsError:o,hasFinishedResolution:s}=r,i=As(t),a={query:i,isRequesting:!1,isError:!1,items:{data:[],totalResults:0}},c=n(e,i);return s("getReportItems",[e,i])?o(e,i)?{...a,isError:!0}:{...a,items:c}:{...a,isRequesting:!0}}var Ps=r(267),vs=r.n(Ps);const Us=t=>vs()(Y("export",t)),ws=(t,e,r)=>Boolean(t.requesting[e]&&t.requesting[e][Us(r)]),Ns=(t,e,r)=>t.exportIds[e]&&t.exportIds[e][Us(r)],bs=(t,e,r)=>t.errors[e]&&t.errors[e][Us(r)];var Cs={START_EXPORT:"START_EXPORT",SET_EXPORT_ID:"SET_EXPORT_ID",SET_ERROR:"SET_ERROR",SET_IS_REQUESTING:"SET_IS_REQUESTING"};function Ds(t,e,r){return{type:Cs.SET_EXPORT_ID,exportType:t,exportArgs:e,exportId:r}}function Gs(t,e,r){return{type:Cs.SET_IS_REQUESTING,selector:t,selectorArgs:e,isRequesting:r}}function ks(t,e,r){return{type:Cs.SET_ERROR,selector:t,selectorArgs:e,error:r}}function*Ms(t,e){yield Gs("startExport",{type:t,args:e},!0);try{const r=yield nn({path:`${tt}/reports/${t}/export`,method:"POST",data:{report_args:e,email:!0}});yield Gs("startExport",{type:t,args:e},!1);const{export_id:n,message:o}=r.data;if(!n)throw new Error(o);return yield Ds(t,e,n),r.data}catch(r){throw yield ks("startExport",{type:t,args:e},r.message),yield Gs("startExport",{type:t,args:e},!1),r}}var js=(t={errors:{},requesting:{},exportMeta:{},exportIds:{}},{error:e,exportArgs:r,exportId:n,exportType:o,isRequesting:s,selector:i,selectorArgs:a,type:c})=>{switch(c){case Cs.SET_IS_REQUESTING:return{...t,requesting:{...t.requesting,[i]:{...t.requesting[i],[Us(a)]:s}}};case Cs.SET_EXPORT_ID:return{...t,exportMeta:{...t.exportMeta,[n]:{exportType:o,exportArgs:r}},exportIds:{...t.exportIds,[o]:{...t.exportIds[o],[Us({type:o,args:r})]:n}}};case Cs.SET_ERROR:return{...t,errors:{...t.errors,[i]:{...t.errors[i],[Us(a)]:e}}};default:return t}};Object(F.registerStore)("wc/admin/export",{reducer:js,actions:G,controls:on,selectors:D});const Fs="wc/admin/export",Ls=t=>{const{activeImport:e,lastImportStartTimestamp:r}=t;return{activeImport:e,lastImportStartTimestamp:r}||{}},qs=t=>{const{period:e,skipPrevious:r}=t;return{period:e,skipPrevious:r}||{}},Ys=(t,e)=>{const r=JSON.stringify(e);return t.importStatus[r]||{}},Qs=(t,e)=>{const{importTotals:r,lastImportStartTimestamp:n}=t;return{...r[JSON.stringify(e)],lastImportStartTimestamp:n}||{}},xs=(t,e)=>{const r=JSON.stringify(e);return t.errors[r]||!1};var Ks={SET_IMPORT_DATE:"SET_IMPORT_DATE",SET_IMPORT_ERROR:"SET_IMPORT_ERROR",SET_IMPORT_PERIOD:"SET_IMPORT_PERIOD",SET_IMPORT_STARTED:"SET_IMPORT_STARTED",SET_IMPORT_STATUS:"SET_IMPORT_STATUS",SET_IMPORT_TOTALS:"SET_IMPORT_TOTALS",SET_SKIP_IMPORTED:"SET_SKIP_IMPORTED"};function Ws(t){return{type:Ks.SET_IMPORT_STARTED,activeImport:t}}function Vs(t,e){return e?{type:Ks.SET_IMPORT_DATE,date:t}:{type:Ks.SET_IMPORT_PERIOD,date:t}}function Hs(t){return{type:Ks.SET_SKIP_IMPORTED,skipPrevious:t}}function Js(t,e){return{type:Ks.SET_IMPORT_STATUS,importStatus:e,query:t}}function $s(t,e){return{type:Ks.SET_IMPORT_TOTALS,importTotals:e,query:t}}function Bs(t,e){return{type:Ks.SET_IMPORT_ERROR,error:e,query:t}}function*zs(t,e=!1){yield Ws(e);try{return yield Object(L.apiFetch)({path:t,method:"POST"})}catch(e){throw yield Bs(t,e),e}}function*Zs(t){try{const e=Object(ie.addQueryArgs)(tt+"/reports/import/status",Object(X.omit)(t,["timestamp"])),r=yield Object(L.apiFetch)({path:e});yield Js(t,r)}catch(e){yield Bs(t,e)}}function*Xs(t){try{const e=Object(ie.addQueryArgs)(tt+"/reports/import/totals",t),r=yield Object(L.apiFetch)({path:e});yield $s(t,r)}catch(e){yield Bs(t,e)}}var ti=(t={activeImport:!1,importStatus:{},importTotals:{},errors:{},lastImportStartTimestamp:0,period:{date:ds()().format(Object(Z.__)("MM/DD/YYYY",'woocommerce')),label:"all"},skipPrevious:!0},{type:e,query:r,importStatus:n,importTotals:o,activeImport:s,date:i,error:a,skipPrevious:c})=>{switch(e){case Ks.SET_IMPORT_STARTED:t={...t,activeImport:s,lastImportStartTimestamp:s?Date.now():t.lastImportStartTimestamp};break;case Ks.SET_IMPORT_PERIOD:t={...t,period:{...t.period,label:i},activeImport:!1};break;case Ks.SET_IMPORT_DATE:t={...t,period:{date:i,label:"custom"},activeImport:!1};break;case Ks.SET_SKIP_IMPORTED:t={...t,skipPrevious:c,activeImport:!1};break;case Ks.SET_IMPORT_STATUS:t={...t,importStatus:{...t.importStatus,[JSON.stringify(r)]:n},errors:{...t.errors,[JSON.stringify(r)]:!1}};break;case Ks.SET_IMPORT_TOTALS:t={...t,importTotals:{...t.importTotals,[JSON.stringify(r)]:o}};break;case Ks.SET_IMPORT_ERROR:t={...t,errors:{...t.errors,[JSON.stringify(r)]:a}}}return t};Object(F.registerStore)("wc/admin/import",{reducer:ti,actions:M,controls:L.controls,selectors:k,resolvers:j});const ei="wc/admin/import"},7:function(t,e){t.exports=window.wp.data},9:function(t,e){t.exports=window.moment}}); |