Ubuntu
(()=>{"use strict";var e,t,n={314:e=>{e.exports=window.wc.data},399:(e,t,n)=>{n.d(t,{A:()=>s});const a=new Map;function s(e){if(a.has(e))return a.get(e);throw new Error(`The given \`kind\` of character counter is an unknown kind: ${e}`)}a.set("google-ads",function(){const e=[/[\u0000-\u04F9]/,/[\u1E00-\u20BF]/,/[\uFF61-\uFFDC]/,/[\u0E00-\u0E7F]/,/[\u2100-\u213A]/,/[\u0600-\u06FF]/,/[\u0750-\u077F]/,/[\uFB50-\uFDFF]/,/[\uFE70-\uFEFF]/,/[\u05D0-\u05EA]/,/\u05BE|\u05F3|\u05F4/],t=new Set(["ऀ","ँ","ं","ऺ","़","ु","ू","ृ","ॄ","ॅ","ॆ","े","ै","्","॑","॒","॓","॔","ॕ","ॖ","ॗ","ॢ","ॣ"]);return function(n){return n.split("").reduce((n,a)=>n+function(n){return e.some(e=>e.test(n))?1:/[\u0900-\u0D7F]/.test(n)?t.has(n)?0:1:2}(a),0)}}())},1020:(e,t,n)=>{var a=n(1609),s=Symbol.for("react.element"),i=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(e,t,n){var a,i={},d=null,l=null;for(a in void 0!==n&&(d=""+n),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(l=t.ref),t)r.call(t,a)&&!c.hasOwnProperty(a)&&(i[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps)void 0===i[a]&&(i[a]=t[a]);return{$$typeof:s,type:e,key:d,ref:l,props:i,_owner:o.current}}t.Fragment=i,t.jsx=d,t.jsxs=d},1233:e=>{e.exports=window.wp.preferences},1455:e=>{e.exports=window.wp.apiFetch},1609:e=>{e.exports=window.React},2434:(e,t,n)=>{n.d(t,{U:()=>g.Ui,j:()=>In});var a={};n.r(a),n.d(a,{completeOnboarding:()=>v,createAdsCampaign:()=>ae,createAdsWithAssetsCampaign:()=>se,createCampaignAssetGroup:()=>de,createMappingRule:()=>Re,deleteAdsCampaign:()=>ce,deleteMappingRule:()=>ye,deleteShippingRates:()=>G,deleteShippingTimes:()=>M,disconnectAllAccounts:()=>W,disconnectGoogleAccount:()=>j,disconnectGoogleAdsAccount:()=>q,fetchAdsIncentiveCredits:()=>ne,fetchExistingGoogleAdsAccounts:()=>Q,fetchExistingGoogleMCAccounts:()=>B,fetchGoogleAccount:()=>x,fetchGoogleAdsAccount:()=>H,fetchGoogleAdsAccountBillingStatus:()=>z,fetchGoogleAdsAccountStatus:()=>we,fetchGoogleMCAccount:()=>$,fetchJetpackAccount:()=>L,fetchMCSetup:()=>_e,fetchSettings:()=>D,fetchShippingRates:()=>O,fetchShippingTimes:()=>w,fetchTargetAudience:()=>J,fetchWPComAppAuthorizationUrl:()=>F,hydratePrefetchedData:()=>N,receiveAdsAccount:()=>ee,receiveAdsRecommendations:()=>Me,receiveEnhancedConversionsStatus:()=>re,receiveGoogleAccountAccess:()=>k,receiveGoogleAdsAccountBillingStatus:()=>K,receiveGoogleMCContactInformation:()=>Y,receiveGtinMigrationStatus:()=>Ge,receiveMCAccount:()=>Z,receiveMCIssues:()=>he,receiveMCProductFeed:()=>me,receiveMCProductStatistics:()=>Ee,receiveMCReviewRequest:()=>pe,receiveMCSetup:()=>ue,receiveMappingAttributes:()=>Se,receiveMappingRules:()=>Te,receiveMappingSources:()=>Ie,receivePriceBenchmarkSuggestionsProductPrice:()=>be,receiveReport:()=>ge,receiveStoreCategories:()=>Ne,receiveTours:()=>Oe,saveSettings:()=>U,saveTargetAudience:()=>te,sendMCReviewRequest:()=>Ae,syncSettings:()=>V,updateAdsCampaign:()=>ie,updateCampaignAssetGroup:()=>le,updateEnhancedConversionsStatus:()=>oe,updateGoogleMCContactInformation:()=>X,updateMCProductVisibility:()=>Ce,updateMappingRule:()=>fe,upsertShippingRates:()=>P,upsertShippingTimes:()=>b,upsertTour:()=>Pe});var s={};n.r(s),n.d(s,{getAdsBudgetMetrics:()=>St,getAdsBudgetRecommendations:()=>At,getAdsCampaigns:()=>nt,getAdsRecommendations:()=>yt,getCampaignAssetGroups:()=>st,getDashboardPerformance:()=>ut,getEnableEnhancedConversions:()=>at,getExistingGoogleAdsAccounts:()=>Je,getExistingGoogleMCAccounts:()=>Qe,getGeneral:()=>$e,getGoogleAccount:()=>We,getGoogleAccountAccess:()=>Ke,getGoogleAdsAccount:()=>Ye,getGoogleAdsAccountBillingStatus:()=>Xe,getGoogleAdsAccountStatus:()=>Ct,getGoogleMCAccount:()=>ze,getGoogleMCContactInformation:()=>Ze,getGtinMigrationStatus:()=>It,getJetpackAccount:()=>qe,getMCCountriesAndContinents:()=>et,getMCIssues:()=>ct,getMCProductFeed:()=>dt,getMCProductStatistics:()=>rt,getMCReviewRequest:()=>ot,getMCSetup:()=>it,getMappingAttributes:()=>_t,getMappingRules:()=>pt,getMappingSources:()=>Et,getPriceBenchmarkSuggestion:()=>ft,getPriceBenchmarkSuggestions:()=>Rt,getPriceBenchmarkSummary:()=>Tt,getReport:()=>gt,getReportByApiQuery:()=>lt,getSettings:()=>je,getShippingRates:()=>Be,getShippingTimes:()=>He,getStoreCategories:()=>ht,getTargetAudience:()=>tt,getTours:()=>mt});var i={};n.r(i),n.d(i,{getAdsBudgetMetrics:()=>dn,getAdsBudgetRecommendations:()=>cn,getAdsCampaigns:()=>Wt,getAdsRecommendations:()=>pn,getCampaignAssetGroups:()=>Kt,getEnableEnhancedConversions:()=>gn,getExistingGoogleAdsAccounts:()=>Bt,getExistingGoogleMCAccounts:()=>Ft,getGoogleAccount:()=>vt,getGoogleAccountAccess:()=>Lt,getGoogleAdsAccount:()=>kt,getGoogleAdsAccountBillingStatus:()=>$t,getGoogleAdsAccountStatus:()=>on,getGoogleMCAccount:()=>xt,getGoogleMCContactInformation:()=>Ht,getGtinMigrationStatus:()=>ln,getJetpackAccount:()=>Vt,getMCCountriesAndContinents:()=>jt,getMCIssues:()=>Xt,getMCProductFeed:()=>Jt,getMCProductStatistics:()=>Qt,getMCReviewRequest:()=>Yt,getMCSetup:()=>zt,getMappingAttributes:()=>tn,getMappingRules:()=>an,getMappingSources:()=>nn,getPriceBenchmarkSuggestions:()=>En,getPriceBenchmarkSummary:()=>un,getReportByApiQuery:()=>en,getSettings:()=>Ut,getShippingRates:()=>Mt,getShippingTimes:()=>Dt,getStoreCategories:()=>sn,getTargetAudience:()=>qt,getTours:()=>rn});var r=n(7143),o=n(1455),c=n.n(o),d=n(6476),l=n(3905),g=n(6520);const u=window.wp.dataControls;var _=n(3832),E=n(7723);const p={RECEIVE_SHIPPING_RATES:"RECEIVE_SHIPPING_RATES",UPSERT_SHIPPING_RATES:"UPSERT_SHIPPING_RATES",DELETE_SHIPPING_RATES:"DELETE_SHIPPING_RATES",RECEIVE_SHIPPING_TIMES:"RECEIVE_SHIPPING_TIMES",UPSERT_SHIPPING_TIMES:"UPSERT_SHIPPING_TIMES",DELETE_SHIPPING_TIMES:"DELETE_SHIPPING_TIMES",RECEIVE_SETTINGS:"RECEIVE_SETTINGS",SAVE_SETTINGS:"SAVE_SETTINGS",RECEIVE_ACCOUNTS_JETPACK:"RECEIVE_ACCOUNTS_JETPACK",RECEIVE_ACCOUNTS_GOOGLE:"RECEIVE_ACCOUNTS_GOOGLE",RECEIVE_ACCOUNTS_GOOGLE_ACCESS:"RECEIVE_ACCOUNTS_GOOGLE_ACCESS",RECEIVE_ACCOUNTS_GOOGLE_MC:"RECEIVE_ACCOUNTS_GOOGLE_MC",RECEIVE_ACCOUNTS_GOOGLE_MC_EXISTING:"RECEIVE_ACCOUNTS_GOOGLE_MC_EXISTING",RECEIVE_ACCOUNTS_GOOGLE_ADS:"RECEIVE_ACCOUNTS_GOOGLE_ADS",DISCONNECT_ACCOUNTS_GOOGLE:"DISCONNECT_ACCOUNTS_GOOGLE",DISCONNECT_ACCOUNTS_GOOGLE_ADS:"DISCONNECT_ACCOUNTS_GOOGLE_ADS",DISCONNECT_ACCOUNTS_ALL:"DISCONNECT_ACCOUNTS_ALL",RECEIVE_ACCOUNTS_GOOGLE_ADS_BILLING_STATUS:"RECEIVE_ACCOUNTS_GOOGLE_ADS_BILLING_STATUS",RECEIVE_ACCOUNTS_GOOGLE_ADS_EXISTING:"RECEIVE_ACCOUNTS_GOOGLE_ADS_EXISTING",RECEIVE_MC_CONTACT_INFORMATION:"RECEIVE_MC_CONTACT_INFORMATION",RECEIVE_MC_COUNTRIES_AND_CONTINENTS:"RECEIVE_MC_COUNTRIES_AND_CONTINENTS",RECEIVE_TARGET_AUDIENCE:"RECEIVE_TARGET_AUDIENCE",SAVE_TARGET_AUDIENCE:"SAVE_TARGET_AUDIENCE",RECEIVE_ADS_CAMPAIGNS:"RECEIVE_ADS_CAMPAIGNS",CREATE_ADS_CAMPAIGN:"CREATE_ADS_CAMPAIGN",UPDATE_ADS_CAMPAIGN:"UPDATE_ADS_CAMPAIGN",DELETE_ADS_CAMPAIGN:"DELETE_ADS_CAMPAIGN",RECEIVE_ADS_ENHANCED_CONVERSIONS:"RECEIVE_ADS_ENHANCED_CONVERSIONS",RECEIVE_CAMPAIGN_ASSET_GROUPS:"RECEIVE_CAMPAIGN_ASSET_GROUPS",CREATE_CAMPAIGN_ASSET_GROUP:"CREATE_CAMPAIGN_ASSET_GROUP",UPDATE_CAMPAIGN_ASSET_GROUP:"UPDATE_CAMPAIGN_ASSET_GROUP",RECEIVE_MC_SETUP:"RECEIVE_MC_SETUP",RECEIVE_REPORT:"RECEIVE_REPORT",RECEIVE_MC_PRODUCT_STATISTICS:"RECEIVE_MC_PRODUCT_STATISTICS",RECEIVE_MC_REVIEW_REQUEST:"RECEIVE_MC_REVIEW_REQUEST",RECEIVE_MC_ISSUES:"RECEIVE_MC_ISSUES",RECEIVE_MC_PRODUCT_FEED:"RECEIVE_MC_PRODUCT_FEED",UPDATE_MC_PRODUCTS_VISIBILITY:"UPDATE_MC_PRODUCTS_VISIBILITY",RECEIVE_MAPPING_ATTRIBUTES:"RECEIVE_MAPPING_ATTRIBUTES",RECEIVE_MAPPING_SOURCES:"RECEIVE_MAPPING_SOURCES",RECEIVE_MAPPING_RULES:"RECEIVE_MAPPING_RULES",UPSERT_MAPPING_RULE:"UPSERT_MAPPING_RULE",DELETE_MAPPING_RULE:"DELETE_MAPPING_RULE",RECEIVE_STORE_CATEGORIES:"RECEIVE_STORE_CATEGORIES",RECEIVE_TOURS:"RECEIVE_TOURS",UPSERT_TOUR:"UPSERT_TOUR",HYDRATE_PREFETCHED_DATA:"HYDRATE_PREFETCHED_DATA",RECEIVE_GOOGLE_ADS_ACCOUNT_STATUS:"RECEIVE_GOOGLE_ADS_ACCOUNT_STATUS",RECEIVE_ADS_BUDGET_RECOMMENDATIONS:"RECEIVE_ADS_BUDGET_RECOMMENDATIONS",RECEIVE_ADS_BUDGET_METRICS:"RECEIVE_ADS_BUDGET_METRICS",RECEIVE_GTIN_MIGRATION_STATUS:"RECEIVE_GTIN_MIGRATION_STATUS",RECEIVE_PRICE_BENCHMARK_SUMMARY:"RECEIVE_PRICE_BENCHMARK_SUMMARY",RECEIVE_PRICE_BENCHMARK_SUGGESTIONS:"RECEIVE_PRICE_BENCHMARK_SUGGESTIONS",RECEIVE_PRICE_BENCHMARK_SUGGESTIONS_PRODUCT_PRICE:"RECEIVE_PRICE_BENCHMARK_SUGGESTIONS_PRODUCT_PRICE",RECEIVE_ADS_RECOMMENDATIONS:"RECEIVE_ADS_RECOMMENDATIONS"};var h=n(6876),m=n(6023),C=n(399),A=n(7692);function S(e){const t=["recommended","high","low","current"],n={},a=[];return function(e){const t=e.filter(e=>e.metrics);if(t.length<=1)return e;let n=t[0];for(let a=1;a{const{level:s,...i}=e,r=s.toLowerCase();t.includes(r)&&(a.push(i.metrics),n[r]=i)}),{adaptedData:n,availabilities:a}}function I(e){const{budget:t,...n}=e;return n.dailyBudget=t,(0,A.xG)(n)}function T(e){const t=e.targeted_locations.length>0,n=t?e.targeted_locations:[e.country];return{...e,allowMultiple:t,displayCountries:n}}function R(e){const t=new Map;m.E1.forEach(e=>{const{maxCharacterCounts:n}=e;if(Array.isArray(n)){const[a,s]=n;a{const s=a[t];if(s&&!(s.length<2)&&n(s[0].content)>e){const i=s.findIndex(({content:t})=>n(t)<=e);i>0&&(s.unshift(...s.splice(i,1)),a[t]=s)}}),{...e,assets:a}}const f=()=>window.navigator.userAgent.toLowerCase().includes("wc-ios"),y=()=>window.navigator.userAgent.toLowerCase().includes("wc-android");function N(e){return{type:p.HYDRATE_PREFETCHED_DATA,data:e}}function*O(){try{const e=(yield(0,u.apiFetch)({path:`${g.RV}/mc/shipping/rates`})).map(e=>({...e,rate:Number(e.rate)}));return{type:p.RECEIVE_SHIPPING_RATES,shippingRates:e}}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading shipping rates.","google-listings-and-ads"))}}function*P(e){const t=(yield(0,u.apiFetch)({path:`${g.RV}/mc/shipping/rates/batch`,method:"POST",data:{rates:e}})).success.map(e=>({...e.rate,rate:Number(e.rate.rate)}));return{type:p.UPSERT_SHIPPING_RATES,shippingRates:t}}function*G(e){return yield(0,u.apiFetch)({path:`${g.RV}/mc/shipping/rates/batch`,method:"DELETE",data:{ids:e}}),{type:p.DELETE_SHIPPING_RATES,ids:e}}function*w(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/mc/shipping/times`}),t=Object.values(e).map(e=>({countryCode:e.country_code,time:Number(e.time),maxTime:Number(e.max_time)}));return{type:p.RECEIVE_SHIPPING_TIMES,shippingTimes:t}}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading shipping times.","google-listings-and-ads"))}}function*b(e){const{countries:t,time:n,maxTime:a}=e;return yield(0,u.apiFetch)({path:`${g.RV}/mc/shipping/times/batch`,method:"POST",data:{country_codes:t,time:n,max_time:a}}),{type:p.UPSERT_SHIPPING_TIMES,shippingTime:e}}function*M(e){return yield(0,u.apiFetch)({path:`${g.RV}/mc/shipping/times/batch`,method:"DELETE",data:{country_codes:e}}),{type:p.DELETE_SHIPPING_TIMES,countryCodes:e}}function*D(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/mc/settings`});return{type:p.RECEIVE_SETTINGS,settings:e}}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading merchant center settings.","google-listings-and-ads"))}}function*U(e){return yield(0,u.apiFetch)({path:`${g.RV}/mc/settings`,method:"POST",data:e}),{type:p.SAVE_SETTINGS,settings:e}}function*V(){yield(0,u.apiFetch)({path:`${g.RV}/mc/settings/sync`,method:"POST"})}function*v(){try{yield(0,u.apiFetch)({path:`${g.RV}/google/onboarding/complete`,method:"POST"})}catch(e){(0,h.h)(e,(0,E.__)("There was an error completing onboarding.","google-listings-and-ads"))}}function*L(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/jetpack/connected`});return{type:p.RECEIVE_ACCOUNTS_JETPACK,account:e}}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading Jetpack account info.","google-listings-and-ads"))}}function*x(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/google/connected`});return{type:p.RECEIVE_ACCOUNTS_GOOGLE,account:e}}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading Google account info.","google-listings-and-ads"))}}function*F(e){const t={next_page_name:e},n=(0,_.addQueryArgs)(`${g.RV}/rest-api/authorize`,t);return(yield(0,u.apiFetch)({path:n})).auth_url}function k(e){return{type:p.RECEIVE_ACCOUNTS_GOOGLE_ACCESS,data:e}}function*$(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/mc/connection`}),t=e.id||null;return yield N({mcId:t}),{type:p.RECEIVE_ACCOUNTS_GOOGLE_MC,account:e}}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading Google Merchant Center account info.","google-listings-and-ads"))}}function*B(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/mc/accounts`});return{type:p.RECEIVE_ACCOUNTS_GOOGLE_MC_EXISTING,accounts:e}}catch(e){(0,h.h)(e,(0,E.__)("There was an error getting your Google Merchant Center accounts.","google-listings-and-ads"))}}function*H(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/ads/connection`}),t=e.id||null;return yield N({adsId:t}),{type:p.RECEIVE_ACCOUNTS_GOOGLE_ADS,account:e}}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading Google Ads account info.","google-listings-and-ads"))}}function*j(){try{return yield(0,u.apiFetch)({path:`${g.RV}/google/connect`,method:"DELETE"}),{type:p.DISCONNECT_ACCOUNTS_GOOGLE}}catch(e){throw(0,h.h)(e,(0,E.__)("Unable to disconnect your Google account.","google-listings-and-ads")),e}}function*q(e=!1){try{return yield(0,u.apiFetch)({path:`${g.RV}/ads/connection`,method:"DELETE"}),{type:p.DISCONNECT_ACCOUNTS_GOOGLE_ADS,invalidateRelatedState:e}}catch(e){throw(0,h.h)(e,(0,E.__)("Unable to disconnect your Google Ads account.","google-listings-and-ads")),e}}function*W(){try{return yield(0,u.apiFetch)({path:`${g.RV}/connections`,method:"DELETE"}),{type:p.DISCONNECT_ACCOUNTS_ALL}}catch(e){if(e.errors[`${g.RV}/rest-api/authorize`])return{type:p.DISCONNECT_ACCOUNTS_ALL};throw(0,h.h)(e,(0,E.__)("Unable to disconnect all your accounts.","google-listings-and-ads")),e}}function K(e){return{type:p.RECEIVE_ACCOUNTS_GOOGLE_ADS_BILLING_STATUS,billingStatus:e}}function*z(){try{return K(yield(0,u.apiFetch)({path:`${g.RV}/ads/billing-status`}))}catch(e){(0,h.h)(e,(0,E.__)("There was an error getting the billing status of your Google Ads account.","google-listings-and-ads"))}}function*Q(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/ads/accounts`});return{type:p.RECEIVE_ACCOUNTS_GOOGLE_ADS_EXISTING,accounts:e}}catch(e){(0,h.h)(e,(0,E.__)("There was an error getting your Google Ads accounts.","google-listings-and-ads"))}}function Y(e){return{type:p.RECEIVE_MC_CONTACT_INFORMATION,data:e}}function*X(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/mc/contact-information`,method:"POST"});yield Y(e)}catch(e){throw(0,h.h)(e,(0,E.__)("Unable to update your Google Merchant Center contact information.","google-listings-and-ads")),e}}function*J(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/mc/target_audience`});return{type:p.RECEIVE_TARGET_AUDIENCE,target_audience:e}}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading target audience.","google-listings-and-ads"))}}function Z(e){return{type:p.RECEIVE_ACCOUNTS_GOOGLE_MC,account:e}}function ee(e){return{type:p.RECEIVE_ACCOUNTS_GOOGLE_ADS,account:e}}function*te(e){return yield(0,u.apiFetch)({path:`${g.RV}/mc/target_audience`,method:"POST",data:e}),{type:p.SAVE_TARGET_AUDIENCE,target_audience:e}}function*ne(){const e=`${g.RV}/ads/incentive-credits`,t=yield(0,u.apiFetch)({path:e});return(0,A.xG)(t)}function*ae(e,t,n=!1){let a="wc-web";f()?a="wc-ios":y()&&(a="wc-android");try{const s=yield(0,u.apiFetch)({path:`${g.RV}/ads/campaigns`,method:"POST",data:{amount:e,targeted_locations:t,eu_political_advertising_confirmation:n,label:a}});return{type:p.CREATE_ADS_CAMPAIGN,createdCampaign:T(s)}}catch(e){throw(0,h.h)(e),e}}function*se(e,t,n,a=!1){let s="wc-web";f()?s="wc-ios":y()&&(s="wc-android");try{const i=yield(0,u.apiFetch)({path:`${g.RV}/ads/campaigns`,method:"POST",data:{amount:e,targeted_locations:t,eu_political_advertising_confirmation:a,label:s,final_url:n.final_url,assets:n.assets,path1:n.path1,path2:n.path2}});return{type:p.CREATE_ADS_CAMPAIGN,createdCampaign:T(i)}}catch(e){throw(0,h.h)(e),e}}function*ie(e,t){try{return yield(0,u.apiFetch)({path:`${g.RV}/ads/campaigns/${e}`,method:"PATCH",data:t}),{type:p.UPDATE_ADS_CAMPAIGN,id:e,data:t}}catch(e){throw(0,h.h)(e),e}}function re(e){return{type:p.RECEIVE_ADS_ENHANCED_CONVERSIONS,status:e}}function*oe(e){try{return yield(0,u.apiFetch)({path:`${g.RV}/ads/settings`,method:"POST",data:{enhanced_conversions_enabled:e}}),re(e)}catch(e){throw(0,h.h)(e,(0,E.__)("There was an error updating the enhanced conversions status.","google-listings-and-ads")),e}}function*ce(e){try{return yield(0,u.apiFetch)({path:`${g.RV}/ads/campaigns/${e}`,method:"DELETE"}),{type:p.DELETE_ADS_CAMPAIGN,id:e}}catch(e){throw(0,h.h)(e),e}}function*de(e){try{const t=yield(0,u.apiFetch)({path:`${g.RV}/ads/campaigns/asset-groups`,method:"POST",data:{campaign_id:e}});return{type:p.CREATE_CAMPAIGN_ASSET_GROUP,campaignId:e,assetGroup:{...g.fP,id:t.id}}}catch(e){const t=(0,E.__)("There was an error creating the assets of the campaign.","google-listings-and-ads");throw(0,h.h)(e,null,t),e}}function*le(e,t){try{return yield(0,u.apiFetch)({path:`${g.RV}/ads/campaigns/asset-groups/${e}`,method:"PUT",data:t}),{type:p.UPDATE_CAMPAIGN_ASSET_GROUP,assetGroupId:e}}catch(e){const t=(0,E.__)("There was an error updating the assets of the campaign.","google-listings-and-ads");throw(0,h.h)(e,null,t),e}}function ge(e,t){return{type:p.RECEIVE_REPORT,reportKey:e,data:t}}function*ue(e){return{type:p.RECEIVE_MC_SETUP,mcSetup:e}}function*_e(){try{return ue(yield(0,u.apiFetch)({path:`${g.RV}/mc/setup`}))}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading your merchant center setup status.","google-listings-and-ads"))}}function*Ee(e){return{type:p.RECEIVE_MC_PRODUCT_STATISTICS,mcProductStatistics:e}}function*pe(e){return{type:p.RECEIVE_MC_REVIEW_REQUEST,mcReviewRequest:e}}function*he(e,t){return{type:p.RECEIVE_MC_ISSUES,query:e,data:t}}function*me(e,t){return{type:p.RECEIVE_MC_PRODUCT_FEED,query:e,data:t}}function*Ce(e,t){try{return yield(0,u.apiFetch)({path:`${g.RV}/mc/product-visibility`,method:"POST",data:{ids:e,visible:t}}),{type:p.UPDATE_MC_PRODUCTS_VISIBILITY}}catch(e){throw(0,h.h)(e,(0,E.__)("Unable to update the channel visibility of products.","google-listings-and-ads")),e}}function*Ae(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/mc/review`,method:"POST"});return yield pe(e)}catch(e){throw(0,h.h)(e),e}}function*Se(e){return{type:p.RECEIVE_MAPPING_ATTRIBUTES,attributes:e}}function*Ie(e,t){return{type:p.RECEIVE_MAPPING_SOURCES,sources:e,attributeKey:t}}function*Te(e,t){return{type:p.RECEIVE_MAPPING_RULES,rules:e,pagination:t}}function*Re(e){try{const t=yield(0,u.apiFetch)({path:`${g.RV}/mc/mapping/rules`,method:"POST",data:e});return{type:p.UPSERT_MAPPING_RULE,rule:t}}catch(e){throw(0,h.h)(e,(0,E.__)("There was an error creating the rule.","google-listings-and-ads")),e}}function*fe(e){try{const t=yield(0,u.apiFetch)({path:`${g.RV}/mc/mapping/rules/${e.id}`,method:g.W1.POST,data:e});return{type:p.UPSERT_MAPPING_RULE,rule:t}}catch(e){throw(0,h.h)(e,(0,E.__)("There was an error updating the rule.","google-listings-and-ads")),e}}function*ye(e){try{const t=yield(0,u.apiFetch)({path:`${g.RV}/mc/mapping/rules/${e.id}`,method:g.W1.DELETE,data:e});return{type:p.DELETE_MAPPING_RULE,rule:t}}catch(e){throw(0,h.h)(e,(0,E.__)("There was an error deleting the rule.","google-listings-and-ads")),e}}function*Ne(e){return{type:p.RECEIVE_STORE_CATEGORIES,storeCategories:e}}function*Oe(e){return{type:p.RECEIVE_TOURS,tours:e}}function*Pe(e,t=!1){const n=[(0,u.apiFetch)({path:`${g.RV}/tours`,method:g.W1.POST,data:e})],a={type:p.UPSERT_TOUR,tour:e};!0===t?n.unshift(a):n.push(a);try{for(const e of n)yield e}catch(e){(0,h.h)(e,(0,E.__)("There was an error updating the tour.","google-listings-and-ads"))}}function*Ge(e){return{type:p.RECEIVE_GTIN_MIGRATION_STATUS,data:e}}function*we(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/ads/account-status`});return{type:p.RECEIVE_GOOGLE_ADS_ACCOUNT_STATUS,data:e}}catch(e){(0,h.h)(e,(0,E.__)("There was an error getting the status of your Google Ads account.","google-listings-and-ads"))}}function*be(e,t){return{type:p.RECEIVE_PRICE_BENCHMARK_SUGGESTIONS_PRODUCT_PRICE,data:{productId:e,productPrice:t}}}function*Me(e,t){return{type:p.RECEIVE_ADS_RECOMMENDATIONS,recommendations:e,recommendationTypes:t}}var De={};function Ue(e){return[e]}function Ve(e){return!!e&&"object"==typeof e}function ve(e,t,n){var a;if(e.length!==t.length)return!1;for(a=n;ae);return(0,xe.flatMap)(n,([e,n])=>{const a=t?`${t}.${e}`:e;return(0,xe.isArray)(n)?[a,...(0,xe.map)(n,String)]:(0,xe.isPlainObject)(n)?Fe(n,a):[a,String(n)]})}function ke(e){if(!e||0===Object.keys(e).length)return"empty";const t=Fe(e);return(0,xe.join)((0,xe.filter)(t,e=>""!==e),"-")}const $e=e=>e.general,Be=e=>e.mc.shipping.rates,He=e=>e.mc.shipping.times,je=e=>e.mc.settings,qe=e=>e.mc.accounts.jetpack,We=e=>e.mc.accounts.google,Ke=e=>e.mc.accounts.google_access,ze=e=>e.mc.accounts.mc,Qe=e=>e.mc.accounts.existing_mc,Ye=e=>e.mc.accounts.ads,Xe=e=>e.mc.accounts.ads_billing_status,Je=e=>e.mc.accounts.existing_ads,Ze=e=>e.mc.contact,et=Le(e=>{const{countries:t,continents:n}=e.mc;return{countries:t,continents:n}},e=>[e.mc.countries,e.mc.continents]),tt=e=>e.mc.target_audience,nt=(e,t)=>!1===t?.exclude_removed?e.all_ads_campaigns:e.ads_campaigns,at=e=>e.ads.enable_enhanced_conversions,st=(e,t)=>e.campaign_asset_groups[t]||null,it=e=>e.mc_setup,rt=e=>e.mc_product_statistics,ot=e=>e.mc_review_request,ct=Le((e,t)=>{const n=e.mc_issues[t.issue_type];if(!n)return n;const a=(t.page-1)*t.per_page,s=a+t.per_page;return{issues:n.issues.slice(a,s),total:n.total}},e=>[e.mc_issues]),dt=(e,t)=>e.mc_product_feed?{products:e.mc_product_feed.pages[t.page],total:e.mc_product_feed.total}:e.mc_product_feed,lt=(e,t,n,a)=>{const s=(0,A.kj)(t,n,a);return e.report[s]||null},gt=(0,r.createRegistrySelector)(e=>(t,n,a,s,i)=>{const r=e(g.Ui),o=(0,A.dh)(n,a,s,i),c=[n,a,o];return{reportQuery:o,loaded:r.hasFinishedResolution("getReportByApiQuery",c),data:r.getReportByApiQuery(...c)}}),ut=(0,r.createRegistrySelector)(e=>(t,n,a,s)=>{const i=e(g.Ui),r=["programs",n,(0,A.N2)(n,a,s)],o=i.getReportByApiQuery(...r);return{data:o?o.totals:null,loaded:i.hasFinishedResolution("getReportByApiQuery",r)}}),_t=e=>e.mc.mapping.attributes,Et=(e,t)=>e.mc.mapping.sources[t],pt=Le((e,t)=>{const n={...e.mc.mapping.rules},{page:a,perPage:s}=t,i=(a-1)*s,r=i+s;return{rules:n?.items.slice(i,r)||[],total:n.total,pages:n.pages}},e=>[e.mc.mapping.rules]),ht=e=>e.store_categories,mt=e=>e.tours||null,Ct=e=>e.ads.accountStatus,At=(e,t=[])=>{const n=(0,A.eT)(t);return e.ads.budgetRecommendations[n]||null},St=(e,t,n)=>{const a=(0,A.Gj)(t,n);return e.ads.budgetMetrics[a]||null},It=e=>e.gtinMigrationStatus,Tt=e=>e.price_benchmark.summary,Rt=Le((e,t)=>{if(t.product_id)return e.price_benchmark.suggestions.items[t.product_id];const n=ke(t),a=e.price_benchmark.suggestions.items;return{items:(e.price_benchmark.suggestions.queries[n]?.items||[]).map(e=>a[e]).filter(Boolean),meta:e.price_benchmark.suggestions.queries[n]?.meta}},(e,t)=>[e.price_benchmark.suggestions,ke(t)]),ft=(e,t)=>e.price_benchmark.suggestions.items[t],yt=(e,t,n=null)=>{const a=n?[n,...t]:t,s=(0,A.UO)(a);return e.ads.recommendations[s]||null};var Nt=n(6473);const Ot=e=>({type:"FETCH_WITH_HEADERS",options:e}),Pt=e=>({type:"GLA_AWAIT_PROMISE",promise:e}),Gt=(e,t)=>{const n=t instanceof Response;return{type:"GLA_RECORD_DATA_EVENT",actionType:e,data:n?null:t,response:n?t.clone():null}},wt={...u.controls,FETCH_WITH_HEADERS:({options:e})=>c()({...e,parse:!1}).then(e=>Promise.all([e.headers,e.status,e.json()])).then(([e,t,n])=>({headers:e,status:t,data:n})),GLA_AWAIT_PROMISE:({promise:e})=>e,GLA_RECORD_DATA_EVENT:function({actionType:e,data:t,response:n}){switch(e){case p.RECEIVE_ADS_BUDGET_RECOMMENDATIONS:(0,Nt.ce)("gla_ads_budget_recommendations_received",t.eventProps);break;case p.RECEIVE_ADS_BUDGET_METRICS:Promise.resolve(t||n.json()).then(({budget:e,currency:t,country:n,country_codes:a,metrics:s})=>{(0,Nt.ce)("gla_ads_budget_metrics_received",{budget:e,currency:t,country:n||a.at(0),available:Boolean(s)})})}}};function*bt(e,t){const n=e?.json()||e?.text(),a=yield Pt(n);(0,h.h)(a,t)}function*Mt(){yield O()}function*Dt(){yield w()}function*Ut(){yield D()}function*Vt(){yield L()}function*vt(){yield x()}function*Lt(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/google/reconnected`});yield k(e)}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading Google account access info.","google-listings-and-ads"))}}function*xt(){yield $()}function*Ft(){yield B()}function*kt(){yield H()}function*$t(){yield z()}function*Bt(){yield Q()}function*Ht(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/mc/contact-information`});yield Y(e)}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading Google Merchant Center contact information.","google-listings-and-ads"))}}function*jt(){try{const e={continents:!0},t=(0,_.addQueryArgs)(`${g.RV}/mc/countries`,e),n=yield(0,u.apiFetch)({path:t});return{type:p.RECEIVE_MC_COUNTRIES_AND_CONTINENTS,data:n}}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading supported country details.","google-listings-and-ads"))}}function*qt(){yield J()}function*Wt(e){try{const t=yield(0,u.apiFetch)({path:(0,_.addQueryArgs)(`${g.RV}/ads/campaigns`,e)});return{type:p.RECEIVE_ADS_CAMPAIGNS,query:e,adsCampaigns:t.map(T)}}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading ads campaigns.","google-listings-and-ads"))}}function*Kt(e){const t=`${g.RV}/ads/campaigns/asset-groups`,n={campaign_id:e},a=(0,_.addQueryArgs)(t,n);try{const t=yield(0,u.apiFetch)({path:a});return{type:p.RECEIVE_CAMPAIGN_ASSET_GROUPS,campaignId:e,assetGroups:t.map(R)}}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading the assets of the campaign.","google-listings-and-ads"))}}function*zt(){yield _e()}function*Qt(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/mc/product-statistics`});yield Ee(e)}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading your merchant center product statistics.","google-listings-and-ads"))}}function*Yt(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/mc/review`});yield pe(e)}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading your merchant center product review request status.","google-listings-and-ads"))}}function*Xt(e){try{const{issue_type:t,...n}=e,a=yield(0,u.apiFetch)({path:(0,_.addQueryArgs)(`${g.RV}/mc/issues/${t||l.Tj}`,n)});yield he(e,a)}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading issues to resolve.","google-listings-and-ads"))}}function*Jt(e){try{const t=yield(0,u.apiFetch)({path:(0,_.addQueryArgs)(`${g.RV}/mc/product-feed`,e)});yield me(e,t)}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading product feed.","google-listings-and-ads"))}}vt.shouldInvalidate=e=>e.type===p.DISCONNECT_ACCOUNTS_GOOGLE,Lt.shouldInvalidate=e=>e.type===p.DISCONNECT_ACCOUNTS_GOOGLE,kt.shouldInvalidate=e=>e.type===p.DISCONNECT_ACCOUNTS_GOOGLE_ADS&&e.invalidateRelatedState,$t.shouldInvalidate=e=>e.type===p.RECEIVE_ACCOUNTS_GOOGLE_ADS,Bt.shouldInvalidate=kt.shouldInvalidate,Wt.shouldInvalidate=(e,t)=>(e.type===p.UPDATE_ADS_CAMPAIGN||e.type===p.DELETE_ADS_CAMPAIGN||e.type===p.CREATE_ADS_CAMPAIGN)&&!1===t?.exclude_removed,Xt.shouldInvalidate=e=>e.type===p.UPDATE_MC_PRODUCTS_VISIBILITY,Jt.shouldInvalidate=(e,t)=>e.type===p.UPDATE_MC_PRODUCTS_VISIBILITY||e.type===p.RECEIVE_MC_PRODUCT_FEED&&(e.query.per_page!==t.per_page||e.query.orderby!==t.orderby||e.query.order!==t.order);const Zt=new Map([[l.k1,"mc"],[l.Mx,"ads"]]);function*en(e,t,n){const a=Zt.get(t),s=`${g.RV}/${a}/reports/${e}`,i=(0,_.addQueryArgs)(s,n);try{const a=yield(0,u.apiFetch)({path:i}),s=(0,A.kj)(e,t,n);yield ge(s,a)}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading report.","google-listings-and-ads"))}}function*tn(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/mc/mapping/attributes`});yield Se(e.data)}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading the mapping attributes.","google-listings-and-ads"))}}function*nn(e){try{if(!e)return;const t=yield(0,u.apiFetch)({path:(0,_.addQueryArgs)(`${g.RV}/mc/mapping/sources`,{attribute:e})});yield Ie(t.data,e)}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading the mapping sources for the selected attribute.","google-listings-and-ads"))}}function*an(e){try{const t=yield Ot({path:(0,_.addQueryArgs)(`${g.RV}/mc/mapping/rules`,{page:e.page,per_page:e.perPage})}),n=parseInt(t.headers.get("x-wp-total"),10),a=parseInt(t.headers.get("x-wp-totalpages"),10),s=t.data;yield Te(s,{...e,total:n,pages:a})}catch(e){(0,h.h)(e,(0,E.__)("There was an error loading the mapping rules.","google-listings-and-ads"))}}function*sn(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/mc/mapping/categories`});yield Ne(e)}catch(e){(0,h.h)(e,(0,E.__)("There was an error getting the store categories.","google-listings-and-ads"))}}function*rn(){try{const{data:e}=yield Ot({path:`${g.RV}/tours`});yield Oe(e)}catch(e){yield bt(e,(0,E.__)("There was an error getting the tours.","google-listings-and-ads"))}}function*on(){yield we()}function*cn(e){if(!e||!e.length)return;const t=(0,A.eT)(e),n=`${g.RV}/ads/campaigns/budget-recommendation`,a={country_codes:e},s=(0,_.addQueryArgs)(n,a);try{let{data:e}=yield Ot({path:s});return e=function(e){const{currency:t,source:n,recommendations:a,...s}=(0,A.xG)(e),{adaptedData:i,availabilities:r}=S(a);return Object.keys(i).forEach(e=>{i[e].currency=t}),Object.assign(s,i),s.recommendedDailyBudget=s.recommended.dailyBudget,s.eventProps={source:n,recommended_budget:s.recommendedDailyBudget,metrics_availability:"all"},0===r.filter(Boolean).length?s.eventProps.metrics_availability="none":r.every(Boolean)||(s.eventProps.metrics_availability="partial"),s}(e),yield Gt(p.RECEIVE_ADS_BUDGET_RECOMMENDATIONS,e),{type:p.RECEIVE_ADS_BUDGET_RECOMMENDATIONS,countryCodesKey:t,data:e}}catch(e){if(404===e.status)return;yield bt(e,(0,E.__)("There was an error getting the budget recommendation.","google-listings-and-ads"))}}function*dn(e,t){try{const{data:n}=yield Ot({path:(0,_.addQueryArgs)(`${g.RV}/ads/campaigns/budget-metrics`,{country_codes:e,budget:t})});return yield Gt(p.RECEIVE_ADS_BUDGET_METRICS,n),{type:p.RECEIVE_ADS_BUDGET_METRICS,key:(0,A.Gj)(e,t),data:I(n)}}catch(e){if(404===e.status)return void(yield Gt(p.RECEIVE_ADS_BUDGET_METRICS,e));yield bt(e,(0,E.__)("There was an error getting the budget metrics.","google-listings-and-ads"))}}function*ln(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/gtin-migration`});yield Ge(e)}catch(e){(0,h.h)(e,(0,E.__)("There was an error getting the GTIN Migration Status.","google-listings-and-ads"))}}function*gn(){try{const e=yield(0,u.apiFetch)({path:`${g.RV}/ads/settings`});yield re(Boolean(e.enhanced_conversions_enabled))}catch(e){(0,h.h)(e,(0,E.__)("There was an error getting the enhanced conversions status.","google-listings-and-ads"))}}function*un(){try{const{data:e}=yield Ot({path:`${g.RV}/mc/price-benchmarks/summary`});return{type:p.RECEIVE_PRICE_BENCHMARK_SUMMARY,data:e}}catch(e){if(403===e.status)return{type:p.RECEIVE_PRICE_BENCHMARK_SUMMARY,data:[]};const t=e?.json()||e?.text(),n=yield Pt(t);(0,h.h)(n,(0,E.__)("There was an error getting the price benchmark summary.","google-listings-and-ads"))}}function*En(e){try{let t=`${g.RV}/mc/price-benchmarks`;t=e.product_id?`${t}/${e.product_id}`:(0,_.addQueryArgs)(t,e);const{data:n}=yield Ot({path:t});return{type:p.RECEIVE_PRICE_BENCHMARK_SUGGESTIONS,data:n,args:e}}catch(e){if(403===e.status)return{type:p.RECEIVE_PRICE_BENCHMARK_SUGGESTIONS,data:[]};const t=e?.json()||e?.text(),n=yield Pt(t);(0,h.h)(n,(0,E.__)("There was an error getting the price benchmark suggestions.","google-listings-and-ads"))}}function*pn(e,t=null){try{const n={types:e};t&&(n.campaign_id=t);const a=yield(0,u.apiFetch)({path:(0,_.addQueryArgs)(`${g.RV}/ads/recommendations`,n)}),s=[t,...e].filter(Boolean),i=(0,A.UO)(s),r=t?function(e){if(!Array.isArray(e)||0===e.length)return[];const t=[];return e.forEach(e=>{const n=(0,A.xG)(e),a=n?.details?.campaignBudgetRecommendation?.budgetOptions;if(!Array.isArray(a)||0===a.length)return;const{adaptedData:s}=S(a);Object.keys(s).forEach(e=>{s[e].dailyBudget=s[e].budgetAmount});const{source:i,details:r,...o}=n;Object.assign(o,s),o.recommendedDailyBudget=o.recommended.dailyBudget,t.push(o)}),t}(a):a;yield Me(r,i)}catch(e){(0,h.h)(e,(0,E.__)("There was an error getting the Ads recommendations.","google-listings-and-ads"))}}an.shouldInvalidate=e=>e.type===p.UPSERT_MAPPING_RULE||e.type===p.DELETE_MAPPING_RULE,on.shouldInvalidate=e=>e.type===p.DISCONNECT_ACCOUNTS_GOOGLE_ADS,cn.shouldInvalidate=e=>e.type===p.DISCONNECT_ACCOUNTS_GOOGLE_ADS,dn.shouldInvalidate=e=>e.type===p.DISCONNECT_ACCOUNTS_GOOGLE_ADS;const hn={general:{version:null,mcId:null,adsId:null},mc:{target_audience:null,countries:null,continents:null,shipping:{rates:[],times:[]},settings:null,accounts:{jetpack:null,google:null,mc:null,ads:null,existing_mc:null,existing_ads:null,ads_billing_status:null,google_access:null},contact:null,mapping:{attributes:[],sources:{},rules:{items:[],total:null,pages:null}}},ads_campaigns:null,all_ads_campaigns:null,campaign_asset_groups:{},mc_setup:null,mc_product_statistics:null,mc_issues:{account:null,product:null},mc_review_request:{status:null,cooldown:null,issues:null,reviewEligibleRegions:[]},mc_product_feed:null,report:{},store_categories:[],tours:{},ads:{accountStatus:{hasAccess:null,inviteLink:null,step:null},budgetRecommendations:{},recommendations:{},enable_enhanced_conversions:!1,budgetMetrics:{}},gtinMigrationStatus:null,price_benchmark:{suggestions:{items:{},queries:{}},summary:{}}};function mn(e,t=""){const n=Object.assign(e.constructor(),e),a=e=>null==e?{}:(0,xe.clone)(e);return{setIn(e,s){const i=(e=>t?Array.isArray(t)||Array.isArray(e)?[].concat(t,e):`${t}.${e}`:e)(e);return(0,xe.setWith)(n,i,s,a),this},end:()=>n}}function Cn(e,t,n){return mn(e).setIn(t,n).end()}function An(e,t){return t?e.json?e.json():Promise.reject(e):e}var Sn=n(3666);(0,r.registerStore)(g.Ui,{actions:a,selectors:s,resolvers:i,controls:wt,reducer:(e=hn,t)=>{switch(t.type){case p.RECEIVE_SHIPPING_RATES:return Cn(e,"mc.shipping.rates",t.shippingRates);case p.UPSERT_SHIPPING_RATES:{const{shippingRates:n}=t,a=[...e.mc.shipping.rates];return n.forEach(e=>{const t=a.findIndex(t=>t.id===e.id);t>=0?a[t]=e:a.push(e)}),Cn(e,"mc.shipping.rates",a)}case p.DELETE_SHIPPING_RATES:{const{ids:n}=t,a=e.mc.shipping.rates.filter(e=>!n.includes(e.id));return Cn(e,"mc.shipping.rates",a)}case p.RECEIVE_SHIPPING_TIMES:return Cn(e,"mc.shipping.times",t.shippingTimes);case p.UPSERT_SHIPPING_TIMES:{const{countries:n,time:a,maxTime:s}=t.shippingTime,i=[...e.mc.shipping.times];return n.forEach(e=>{const t={countryCode:e,time:a,maxTime:s},n=i.findIndex(t=>t.countryCode===e);n>=0?i[n]=t:i.push(t)}),Cn(e,"mc.shipping.times",i)}case p.DELETE_SHIPPING_TIMES:{const n=new Set(t.countryCodes),a=e.mc.shipping.times.filter(e=>!n.has(e.countryCode));return Cn(e,"mc.shipping.times",a)}case p.RECEIVE_SETTINGS:return Cn(e,"mc.settings",t.settings);case p.SAVE_SETTINGS:return Cn(e,"mc.settings",{...e.mc.settings,...t.settings});case p.RECEIVE_ACCOUNTS_JETPACK:return Cn(e,"mc.accounts.jetpack",t.account);case p.RECEIVE_ACCOUNTS_GOOGLE:return Cn(e,"mc.accounts.google",t.account);case p.RECEIVE_ACCOUNTS_GOOGLE_ACCESS:return Cn(e,"mc.accounts.google_access",t.data);case p.RECEIVE_ACCOUNTS_GOOGLE_MC:return Cn(e,"mc.accounts.mc",t.account);case p.RECEIVE_ACCOUNTS_GOOGLE_MC_EXISTING:return Cn(e,"mc.accounts.existing_mc",t.accounts);case p.RECEIVE_ACCOUNTS_GOOGLE_ADS:return Cn(e,"mc.accounts.ads",t.account);case p.DISCONNECT_ACCOUNTS_GOOGLE_ADS:return Cn(e,"mc.accounts.ads",hn.mc.accounts.ads);case p.RECEIVE_ACCOUNTS_GOOGLE_ADS_BILLING_STATUS:return Cn(e,"mc.accounts.ads_billing_status",t.billingStatus);case p.RECEIVE_ACCOUNTS_GOOGLE_ADS_EXISTING:return Cn(e,"mc.accounts.existing_ads",t.accounts);case p.RECEIVE_MC_CONTACT_INFORMATION:return Cn(e,"mc.contact",t.data);case p.RECEIVE_MC_COUNTRIES_AND_CONTINENTS:{const{data:n}=t;return mn(e,"mc").setIn("countries",n.countries).setIn("continents",n.continents).end()}case p.RECEIVE_TARGET_AUDIENCE:case p.SAVE_TARGET_AUDIENCE:return Cn(e,"mc.target_audience",t.target_audience);case p.RECEIVE_ADS_CAMPAIGNS:return!1===t.query?.exclude_removed?Cn(e,"all_ads_campaigns",t.adsCampaigns):Cn(e,"ads_campaigns",t.adsCampaigns);case p.CREATE_ADS_CAMPAIGN:return Cn(e,"ads_campaigns",[...e.ads_campaigns||[],t.createdCampaign]);case p.UPDATE_ADS_CAMPAIGN:{const{id:n,data:a}=t,s=e.ads_campaigns.findIndex(e=>e.id===n),i={...e.ads_campaigns[s],...a},r=[...e.ads_campaigns];return r[s]=i,Cn(e,"ads_campaigns",r)}case p.DELETE_ADS_CAMPAIGN:{const{id:n}=t,a=e.ads_campaigns.filter(e=>e.id!==n);return Cn(e,"ads_campaigns",a)}case p.RECEIVE_CAMPAIGN_ASSET_GROUPS:return Cn(e,["campaign_asset_groups",t.campaignId],t.assetGroups);case p.CREATE_CAMPAIGN_ASSET_GROUP:{const{campaignId:n,assetGroup:a}=t;return Cn(e,["campaign_asset_groups",n],[...e.campaign_asset_groups[n]||[],a])}case p.RECEIVE_MC_SETUP:return Cn(e,"mc_setup",t.mcSetup);case p.RECEIVE_MC_PRODUCT_STATISTICS:return Cn(e,"mc_product_statistics",t.mcProductStatistics);case p.RECEIVE_MC_REVIEW_REQUEST:return Cn(e,"mc_review_request",t.mcReviewRequest);case p.RECEIVE_MC_ISSUES:{const{query:n,data:a}=t,s=e.mc_issues[n.issue_type]?.issues.slice()||[];return s.splice((n.page-1)*n.per_page,n.per_page,...a.issues),mn(e,`mc_issues.${n.issue_type}`).setIn("issues",s).setIn("total",a.total).end()}case p.RECEIVE_MC_PRODUCT_FEED:{const{query:n,data:a}=t,s=e.mc_product_feed||{},i=mn(e,"mc_product_feed");return s.per_page===n.per_page&&s.order===n.order&&s.orderby===n.orderby||i.setIn("pages",{}),i.setIn(["pages",n.page],a.products).setIn("per_page",n.per_page).setIn("order",n.order).setIn("orderby",n.orderby).setIn("total",a.total).end()}case p.RECEIVE_REPORT:{const{reportKey:n,data:a}=t;return Cn(e,["report",n],a)}case p.RECEIVE_MAPPING_ATTRIBUTES:return Cn(e,"mc.mapping.attributes",t.attributes);case p.RECEIVE_MAPPING_SOURCES:{const{attributeKey:n,sources:a}=t;return Cn(e,["mc","mapping","sources",n],a)}case p.RECEIVE_MAPPING_RULES:{const{rules:n,pagination:a}=t,s=[...e.mc.mapping.rules.items],i=(a.page-1)*a.perPage,r=a.perPage;return s.splice(i,r,...n),mn(e,"mc.mapping.rules").setIn("items",s).setIn("total",a.total).setIn("pages",a.pages).end()}case p.UPSERT_MAPPING_RULE:{const{rule:n}=t,a=[...e.mc.mapping.rules.items],s=a.findIndex(e=>e.id===n.id);return s>=0?a[s]=n:a.push(n),Cn(e,"mc.mapping.rules.items",a)}case p.DELETE_MAPPING_RULE:{const n=e.mc.mapping.rules.items.filter(e=>e.id!==t.rule.id);return Cn(e,"mc.mapping.rules.items",n)}case p.RECEIVE_STORE_CATEGORIES:{const{storeCategories:n}=t;return Cn(e,"store_categories",n)}case p.UPSERT_TOUR:{const{tour:n}=t;return Cn(e,["tours",n.id],n)}case p.RECEIVE_TOURS:{const{tours:n}=t;return Cn(e,"tours",n)}case p.HYDRATE_PREFETCHED_DATA:{const n=mn(e,"general");return["version","mcId","adsId"].forEach(e=>{t.data.hasOwnProperty(e)&&n.setIn(e,t.data[e])}),n.end()}case p.RECEIVE_GOOGLE_ADS_ACCOUNT_STATUS:{const{data:{has_access:n,invite_link:a,step:s}}=t;return mn(e,"ads.accountStatus").setIn("hasAccess",n).setIn("inviteLink",a).setIn("step",s).end()}case p.RECEIVE_ADS_BUDGET_RECOMMENDATIONS:{const{countryCodesKey:n,data:a}=t;return Cn(e,["ads","budgetRecommendations",n],a)}case p.RECEIVE_ADS_BUDGET_METRICS:{const{key:n,data:a}=t;return Cn(e,["ads","budgetMetrics",n],a)}case p.RECEIVE_GTIN_MIGRATION_STATUS:{const{data:n}=t;return Cn(e,"gtinMigrationStatus",n?.status)}case p.RECEIVE_ADS_ENHANCED_CONVERSIONS:{const{status:n}=t;return Cn(e,"ads.enable_enhanced_conversions",n)}case p.RECEIVE_PRICE_BENCHMARK_SUMMARY:{const{data:n}=t;return Cn(e,"price_benchmark.summary",n)}case p.RECEIVE_PRICE_BENCHMARK_SUGGESTIONS:{const{data:n,args:a={}}=t,s=ke(a);if(!n&&!n.results)return a.product_id?e:mn(e,["price_benchmark","suggestions"]).setIn(["queries",[s],"items"],[]).setIn(["queries",[s],"meta","totalItems"],0).end();if(a.product_id)return Cn(e,["price_benchmark","suggestions","items",[a.product_id]],n);const i=(0,xe.keyBy)(n.results,e=>e.product.id);return mn(e,["price_benchmark","suggestions"]).setIn(["queries",[s],"items"],n.results.map(e=>e.product.id)).setIn(["queries",[s],"meta","totalItems"],n.total).setIn("items",{...e.price_benchmark.suggestions.items,...i}).end()}case p.RECEIVE_PRICE_BENCHMARK_SUGGESTIONS_PRODUCT_PRICE:{const{data:{productId:n,productPrice:a}}=t;return Cn(e,"price_benchmark.suggestions.items",{...e.price_benchmark.suggestions.items,[n]:{...e.price_benchmark.suggestions.items[n],product_price:a}})}case p.RECEIVE_ADS_RECOMMENDATIONS:{const{recommendations:n,recommendationTypes:a}=t;return Cn(e,["ads","recommendations",a],n)}case p.DISCONNECT_ACCOUNTS_ALL:default:return e}}}),(0,r.dispatch)(g.Ui).hydratePrefetchedData(l.Th.initialWpData),c().use(function(e){const t=new RegExp(`^${g.RV}/`);return function(n,a){if(!t.test(n.path))return a(n);const{parse:s=!0}=n;return a({...n,parse:!1}).catch(e).catch(async e=>Promise.reject(await An(e,s))).then(e=>s&&204===e.status?null:An(e,s))}}(e=>{if(l.Th.mcSetupComplete&&401===e.status)return(e.json||e.text).call(e).then(e=>"string"==typeof e?{message:e}:e).then(e=>{const t=(0,Sn.Ke)(e.code);return t&&(0,d.getHistory)().replace(t),e}).then(t=>Promise.reject({...t,statusCode:e.status}));throw e}));const In=()=>(0,r.useDispatch)(g.Ui)},2619:e=>{e.exports=window.wp.hooks},3577:e=>{e.exports=window.wc.number},3666:(e,t,n)=>{n.d(t,{$K:()=>i,FN:()=>E,Ke:()=>m,Q4:()=>c,Qk:()=>p,XG:()=>l,Xb:()=>h,hP:()=>_,uB:()=>d,uZ:()=>u,xP:()=>g});var a=n(6476),s=n(3905);const i={editCampaign:"/campaigns/edit",createCampaign:"/campaigns/create",editStoreAddress:"/edit-store-address",reconnectWPComAccount:"/reconnect-wpcom-account",reconnectGoogleAccount:"/reconnect-google-account"},r="/google/dashboard",o="/google/settings",c=(e,t)=>(0,a.getNewPath)({subpath:i.editCampaign,programId:e,step:t},r),d=()=>(0,a.getNewPath)({subpath:i.createCampaign},r),l=()=>(0,a.getNewPath)(null,"/google/start",null),g=()=>(0,a.getNewPath)(null,"/google/setup-mc",null),u=(e=null)=>(0,a.getNewPath)(e,r,null),_=(e=null)=>(0,a.getNewPath)(e,"/google/product-feed",null),E=()=>(0,a.getNewPath)(null,o,null),p=()=>(0,a.getNewPath)(null,"/google/shipping",null),h=()=>(0,a.getNewPath)({subpath:i.editStoreAddress},o,null),m=e=>{let t;switch(e){case s.iH.WPCOM_DISCONNECTED:t=i.reconnectWPComAccount;break;case s.iH.GOOGLE_DISCONNECTED:t=i.reconnectGoogleAccount;break;default:return}return(0,a.getNewPath)({subpath:t},o,null)}},3832:e=>{e.exports=window.wp.url},3905:(e,t,n)=>{n.d(t,{$g:()=>N,Ab:()=>v,CX:()=>R,DA:()=>i,K4:()=>g,K7:()=>V,Ms:()=>G,Mx:()=>r,Q:()=>s,Th:()=>a,Tj:()=>C,WR:()=>T,Wn:()=>I,X4:()=>S,Z3:()=>h,Z7:()=>D,ZD:()=>O,aL:()=>f,ac:()=>w,ds:()=>m,h4:()=>U,iH:()=>_,k1:()=>o,km:()=>p,ll:()=>P,m9:()=>M,mQ:()=>b,r6:()=>c,rS:()=>u,s_:()=>d,tt:()=>l,vL:()=>y,zU:()=>A});const a=window.glaData,s=(window.glaProductData,0),i="report-source",r="paid",o="free",c=r,d="programs",l=86400,g={SUBMISSION_SUCCESS:"submission-success",CAMPAIGN_CREATION_SUCCESS:"campaign-creation-success"},u={CAN_ONBOARDING_SETUP_CES_PROMPT_OPEN:"gla-can-onboarding-setup-ces-prompt-open",RAISE_BUDGET_RECOMMENDATIONS_ACTIONED_CAMPAIGNS:"gla-raise-budget-recommendations-actioned-campaigns"},_={WPCOM_DISCONNECTED:"JETPACK_DISCONNECTED",GOOGLE_DISCONNECTED:"GOOGLE_DISCONNECTED"},E=[["CAMPAIGN","campaign"],["ASSET_GROUP","asset-group"]],p=Object.fromEntries(E),h=E.reduce((e,t,n)=>{const a=(n+1).toString();return e[t[1]]=a,e},{}),m="product",C="account",A="request-review",S=5,I={CONNECTED:"connected",DISCONNECTED:"disconnected",INCOMPLETE:"incomplete"},T={CONNECTED:"connected",DISCONNECTED:"disconnected",INCOMPLETE:"incomplete"},R={UNKNOWN:"unknown",PENDING:"pending",APPROVED:"approved",CANCELLED:"cancelled"},f={ALL:"ALL",EXCEPT:"EXCEPT",ONLY:"ONLY"},y=5,N="performance_max",O={BUSINESS_NAME:"business_name",MARKETING_IMAGE:"marketing_image",SQUARE_MARKETING_IMAGE:"square_marketing_image",PORTRAIT_MARKETING_IMAGE:"portrait_marketing_image",LOGO:"logo",HEADLINE:"headline",LONG_HEADLINE:"long_headline",DESCRIPTION:"description",CALL_TO_ACTION_SELECTION:"call_to_action_selection",YOUTUBE_VIDEO:"youtube_video"},P={FINAL_URL:"final_url",DISPLAY_URL_PATH:"display_url_path"},G={...O,...P},w={APPROVED:"approved",DISAPPROVED:"disapproved",ERROR:"error",DISABLED:"disabled"},b="app_ratings_banner",M={LOWER:"#42b1af",SIMILAR:"#6d89d3",HIGHER:"#caa76f",UNKNOWN:"#e0e0e0"},D="woocommerce/google-listings-and-ads",U="CAMPAIGN_BUDGET",V="MARGINAL_ROI_CAMPAIGN_BUDGET",v="IMPROVE_PERFORMANCE_MAX_AD_STRENGTH"},4111:e=>{e.exports=window.wc.currency},4848:(e,t,n)=>{e.exports=n(1020)},5573:e=>{e.exports=window.wp.primitives},5703:e=>{e.exports=window.wc.wcSettings},5795:e=>{e.exports=window.ReactDOM},5854:(e,t,n)=>{function a(e,t=2){const n=Math.pow(10,t);return Math.round(e*n)/n}n.d(t,{A:()=>a})},6023:(e,t,n)=>{n.d(t,{E1:()=>E,om:()=>_,tY:()=>d});var a=n(7723),s=n(6427),i=n(6087),r=n(3905),o=n(4848);const c=Symbol("sharedMax"),d=[{maxCharacterCount:15,capitalizedName:(0,a._x)("The first display URL path","Capitalized asset field name as the start of an error message","google-listings-and-ads")},{maxCharacterCount:15,capitalizedName:(0,a._x)("The second display URL path","Capitalized asset field name as the start of an error message","google-listings-and-ads")}],l=[{key:r.Ms.MARKETING_IMAGE,min:1,imageConfig:{minWidth:600,minHeight:314,suggestedWidth:1200,suggestedHeight:628},heading:(0,a._x)("Landscape images","Plural asset field name as the heading","google-listings-and-ads"),subheading:(0,a.__)("We recommend adding at least 4 landscape images. A single image is required.","google-listings-and-ads"),helpSubheading:(0,a._x)("Landscape image (1.91:1)","Asset field name with its aspect ratio as the subheading within a help tip","google-listings-and-ads"),lowercaseName:(0,a._x)("landscape","Lowercase asset field name","google-listings-and-ads")},{key:r.Ms.SQUARE_MARKETING_IMAGE,min:1,imageConfig:{minWidth:300,minHeight:300,suggestedWidth:1200,suggestedHeight:1200},heading:(0,a._x)("Square images","Plural asset field name as the heading","google-listings-and-ads"),subheading:(0,a.__)("We recommend adding at least 4 square images. A single image is required.","google-listings-and-ads"),helpSubheading:(0,a._x)("Square image (1:1)","Asset field name with its aspect ratio as the subheading within a help tip","google-listings-and-ads"),lowercaseName:(0,a._x)("square","Lowercase asset field name","google-listings-and-ads")},{key:r.Ms.PORTRAIT_MARKETING_IMAGE,min:0,imageConfig:{minWidth:480,minHeight:600,suggestedWidth:960,suggestedHeight:1200},heading:(0,a._x)("Portrait images","Plural asset field name as the heading","google-listings-and-ads"),subheading:(0,a.__)("Improve campaign performance with at least 2 portrait images.","google-listings-and-ads"),helpSubheading:(0,a._x)("Portrait image (4:5)","Asset field name with its aspect ratio as the subheading within a help tip","google-listings-and-ads"),lowercaseName:(0,a._x)("portrait","Lowercase asset field name","google-listings-and-ads")}],g=[{key:r.Ms.LOGO,min:1,imageConfig:{minWidth:128,minHeight:128,suggestedWidth:1200,suggestedHeight:1200},heading:(0,a._x)("Logo","Plural asset field name as the heading","google-listings-and-ads"),subheading:(0,a.__)("At least 1 version of your logo is required.","google-listings-and-ads"),helpSubheading:(0,a._x)("Logo (1:1)","Asset field name with its aspect ratio as the subheading within a help tip","google-listings-and-ads"),lowercaseName:(0,a._x)("logo","Lowercase asset field name","google-listings-and-ads")}];l[c]=20,g[c]=5;const u=[l,g],_=u.flat(),E=[{key:r.Ms.BUSINESS_NAME,min:1,max:1,maxCharacterCounts:25,heading:(0,a._x)("Business name","Plural asset field name as the heading","google-listings-and-ads"),capitalizedName:(0,a._x)("Business name","Capitalized asset field name as the placeholder or the start of an error message","google-listings-and-ads"),lowercaseSingularName:(0,a._x)("business name","Singular and lowercase asset field name","google-listings-and-ads"),help:(0,a.__)("The business name is the name of your business or brand. In certain layouts, it may appear in the text of your ad.","google-listings-and-ads")},{key:r.Ms.HEADLINE,min:3,max:5,maxCharacterCounts:[15,30,30,30,30],heading:(0,a._x)("Headlines","Plural asset field name as the heading","google-listings-and-ads"),subheading:(0,a.__)("For the best results, add at least 5 headlines. A minimum of 3 are required.","google-listings-and-ads"),extraSubheading:(0,o.jsx)(s.ExternalLink,{href:"https://support.google.com/google-ads/answer/6167101",children:(0,a.__)("Learn how to write effective ads","google-listings-and-ads")}),addButtonText:(0,a.__)("Add headline","google-listings-and-ads"),capitalizedName:(0,a._x)("Headline","Capitalized asset field name as the placeholder or the start of an error message","google-listings-and-ads"),lowercaseSingularName:(0,a._x)("headline","Singular and lowercase asset field name","google-listings-and-ads"),lowercasePluralName:(0,a._x)("headlines","Plural and lowercase asset field name","google-listings-and-ads"),help:(0,a.__)("The headline is the first line of your ad and is most likely the first thing people notice, so consider including words that people may have entered in their Google search.","google-listings-and-ads")},{key:r.Ms.LONG_HEADLINE,min:1,max:5,maxCharacterCounts:90,heading:(0,a._x)("Long headlines","Plural asset field name as the heading","google-listings-and-ads"),subheading:(0,a.__)("We recommend using 5 long headlines. A single long headline is required.","google-listings-and-ads"),addButtonText:(0,a.__)("Add long headline","google-listings-and-ads"),capitalizedName:(0,a._x)("Long headline","Capitalized asset field name as the placeholder or the start of an error message","google-listings-and-ads"),lowercaseSingularName:(0,a._x)("long headline","Singular and lowercase asset field name","google-listings-and-ads"),lowercasePluralName:(0,a._x)("long headlines","Plural and lowercase asset field name","google-listings-and-ads"),help:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{children:(0,a.__)("The long headline is the first line of your ad, and appears instead of your short headline in larger ads. Long headlines can be up to 90 characters, and may appear with or without your description.","google-listings-and-ads")}),(0,o.jsx)("div",{children:(0,a.__)("The length of the rendered headline will depend on the site it appears on. If shortened, it will end with an ellipsis(…).","google-listings-and-ads")})]})},{key:r.Ms.DESCRIPTION,min:2,max:5,maxCharacterCounts:[60,90,90,90,90],heading:(0,a._x)("Descriptions","Plural asset field name as the heading","google-listings-and-ads"),subheading:(0,a.__)("We recommend adding at least 5 different descriptions. At least 2 are required.","google-listings-and-ads"),addButtonText:(0,a.__)("Add description","google-listings-and-ads"),capitalizedName:(0,a._x)("Description","Capitalized asset field name as the placeholder or the start of an error message","google-listings-and-ads"),lowercaseSingularName:(0,a._x)("description","Singular and lowercase asset field name","google-listings-and-ads"),lowercasePluralName:(0,a._x)("descriptions","Plural and lowercase asset field name","google-listings-and-ads"),help:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{children:(0,a.__)("The description adds to the headline and provides additional context or details. It can be up to 90 characters, and may appear after the headline.","google-listings-and-ads")}),(0,o.jsx)("div",{children:(0,a.__)("The length of the rendered description will depend on the site it appears on. If it's shortened, it will end with an ellipsis(…). The description doesn't show in all sizes and formats.","google-listings-and-ads")})]})}];{function p(e){const t=(0,a._x)(", ","The separator for concatenating the types of assets","google-listings-and-ads");return(0,a.sprintf)(
// translators: 1: Concatenated text for the types of assets except for the last one. 2: The last type of assets.
// translators: 1: Concatenated text for the types of assets except for the last one. 2: The last type of assets.
(0,a.__)("%1$s and %2$s","google-listings-and-ads"),e.slice(0,-1).join(t),e.at(-1))}function h(e,t){const{helpSubheading:n,imageConfig:s}=e,r=(0,o.jsx)("ul",{children:(0,i.createInterpolateElement)((0,a.sprintf)(
// translators: 1: Recommended width. 2: Recommended height. 3: Minimal width. 4: Minimal height.
// translators: 1: Recommended width. 2: Recommended height. 3: Minimal width. 4: Minimal height.
(0,a.__)("Recommended size: %1$d x %2$dMin. size: %3$d x %4$d","google-listings-and-ads"),s.suggestedWidth,s.suggestedHeight,s.minWidth,s.minHeight),{listItem:(0,o.jsx)("li",{})})});return(0,o.jsxs)(i.Fragment,{children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("strong",{children:n}),t&&r]}),!t&&r]},e.key)}function m(e){const t=e.map(e=>e.lowercaseName),n=(0,a.sprintf)(
// translators: 1: The maximum number of this image assets. 2: Text for the types of image assets.
// translators: 1: The maximum number of this image assets. 2: Text for the types of image assets.
(0,a.__)("You can add up to a maximum of %1$d image assets, which can be a combination of %2$s images.","google-listings-and-ads"),e[c],p(t));return(0,o.jsx)("div",{children:n})}function C(e,t){const n=e.map(e=>h(e,t));return(0,o.jsxs)(o.Fragment,{children:[t&&m(e),(0,o.jsx)("div",{children:(0,a.__)("Add images that meet or can be cropped to the recommended sizes. Note: The maximum file size for any image is 5120 KB.","google-listings-and-ads")}),n]})}function A(e,t,n){return t.reduce((e,t)=>t.key===this.key?e:e-Math.max(t.min,n[t.key].length),e)}function S(e,t,n){if(t.reduce((e,t)=>e+n[t.key].length,0)===e)return(0,a.sprintf)(
// translators: The shared maximum number of the grouped types of image assets.
// translators: The shared maximum number of the grouped types of image assets.
(0,a.__)("The maximum number of images that can be uploaded is %d.","google-listings-and-ads"),e);const s=t.filter(e=>e.min>0).map(e=>(0,a.sprintf)(
// translators: 1: The minimum number of this asset field. 2: Asset field name.
// translators: 1: The minimum number of this asset field. 2: Asset field name.
(0,a.__)("%1$d %2$s","google-listings-and-ads"),e.min,e.lowercaseName));return(0,a.sprintf)(
// translators: 1: The shared maximum number of the grouped types of image assets. 2: Text for the minimum number and type of each image asset.
// translators: 1: The shared maximum number of the grouped types of image assets. 2: Text for the minimum number and type of each image asset.
(0,a.__)("Maximum %1$d images can be uploaded, with a minimum of %2$s image.","google-listings-and-ads"),e,p(s))}u.forEach(e=>{const t=e.length>1,n=e[c],a=C(e,t);e.forEach(s=>{!t&&Number.isInteger(n)&&(s.max=n),s.help=a,s.getMax=A.bind(s,n,e),s.getMaxNumberTip=t?S.bind(null,n,e):()=>null})}),E.forEach(e=>{e.requiredSingleValue=1===e.min&&1===e.max})}},6087:e=>{e.exports=window.wp.element},6427:e=>{e.exports=window.wp.components},6473:(e,t,n)=>{n.d(t,{lr:()=>E,gd:()=>p,GH:()=>_,eB:()=>g,T1:()=>l,CU:()=>d,qX:()=>h,E$:()=>u,JL:()=>c,Ff:()=>C,ce:()=>m,dQ:()=>I,T:()=>S,Xh:()=>A});const a=window.wc.tracks;var s=n(7143),i=n(2619),r=n(3905),o=n(2434);const c=(0,i.createHooks)(),d="tracking",l="FILTER_ONBOARDING",g="FILTER_BUDGET_RECOMMENDATIONS",u=new Map;u.set(l,["context","step"]),u.set(g,["source","recommended_budget"]);const _="setup-mc",E="setup-ads",p="setup-ads-only";function h(e){const{slug:t}=r.Th,{version:n,adsId:a,mcId:i}=(0,s.select)(o.U).getGeneral(),c={...e,[`${t}_version`]:n};return i&&(c[`${t}_mc_id`]=i),a&&(c[`${t}_ads_id`]=a),c}function m(e,t){(0,a.recordEvent)(e,h(t))}function C(e,t){(0,a.queueRecordEvent)(e,h(t))}const A=(e,t,n)=>{const a={context:e};let s;"goto"===n?(s="gla_table_go_to_page",a.page=t):(s="gla_table_page_click",a.direction=n),m(s,a)};function S(e,t,n){m(e,{triggered_by:`stepper-step${t}-button`,action:`go-to-step${t}`,context:n})}function I(e,t,n,a){m(e,{triggered_by:`step${t}-continue-button`,action:`go-to-step${n}`,context:a})}},6476:e=>{e.exports=window.wc.navigation},6520:(e,t,n)=>{n.d(t,{RV:()=>i,Ui:()=>s,W1:()=>o,fP:()=>c,mY:()=>r});var a=n(3905);const s="wc/gla",i="/wc/gla",r="core/notices",o={DELETE:"DELETE",POST:"POST"},c={assets:{},[a.ll.FINAL_URL]:"",[a.ll.DISPLAY_URL_PATH]:[]}},6873:e=>{e.exports=window.wp.viewport},6876:(e,t,n)=>{n.d(t,{h:()=>r});var a=n(7143),s=n(7723),i=n(6520);function r(e,t,n){if(401!==e?.statusCode){const r=function(e,t,n){const a=[],i=e?.message;return t&&a.push(t),i&&"string"==typeof i?a.push(i):n&&a.push(n),0===a.length&&a.push((0,s.__)("Unknown error occurred.","google-listings-and-ads")),a.join((0,s._x)(" ","The spacing between sentences. It's a space in English. Please use an empty string if no spacing is needed in that language.","google-listings-and-ads"))}(e,t,n);(0,a.dispatch)(i.mY).createNotice("error",r)}!function(...e){console.error(...e)}(e)}},7143:e=>{e.exports=window.wp.data},7374:e=>{e.exports=window.wc.date},7692:(e,t,n)=>{n.d(t,{Gj:()=>C,N2:()=>d,UO:()=>h,XQ:()=>c,YK:()=>o,bM:()=>p,dh:()=>l,eT:()=>m,jr:()=>E,kj:()=>u,xG:()=>A});var a=n(8443),s=n(7374),i=n(5854);const r=["clicks","impressions"],o=["sales","conversions","spend",...r],c=Object.freeze({NONE:0,FOR_METRIC:1,FOR_REQUEST:2});function d(e,t,n){const i=(0,s.getCurrentDates)(t);return{after:(0,a.format)("Y-m-d",i[n].after),before:(0,a.format)("Y-m-d",i[n].before),fields:"free"===e?r:o}}function l(e,t,n,a){const s=d(t,n,a),{order:i="desc"}=n;let{orderby:r}=n;r&&s.fields.includes(r)||(r=s.fields[0]);const o={...s,interval:"day",orderby:r,order:i};return"programs"===e&&n.programs?o.ids=n.programs:"products"===e&&n.products&&(o.ids=n.products.replace(/\d+/g,"gla_$&")),o}function g(e,t){if(t){if(Array.isArray(t))return[...t].sort();if("object"==typeof t)return Object.fromEntries(Object.entries(t).sort())}return t}function u(e,t,n){return`${e}:${t}:${JSON.stringify(n,g)}`}function _(e,t){let n=null;if("number"==typeof e&&"number"==typeof t&&(n=0,e!==t)){const a=(e-t)/t*100;n=Number.isFinite(a)?(0,i.A)(a):null}return n}const E=(e,t,n)=>({value:e,delta:_(e,t),prevValue:t,missingFreeListingsData:n});function p(e={},t={},n){return(n||Object.keys(e)).reduce((n,a)=>({...n,[a]:E(e[a],t[a],e[a]&&t[a]?c.NONE:c.FOR_REQUEST)}),{})}const h=(e=[])=>e.map(e=>String(e).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").trim().toLowerCase().replace(/[^a-z0-9_ ]/g,"").replace(/\s+/g,"_").replace(/_+/g,"_")).join("_");function m(e=[]){return h(e)}function C(e,t){return`${m(e)}::${t.toString().replace(".","#")}`}function A(e){return Array.isArray(e)?e.map(A):"[object Object]"!==Object.prototype.toString.call(e)?e:Object.entries(e).reduce((e,[t,n])=>(e[t.replace(/(?<=[a-z\d])_([a-z])/g,(e,t)=>t.toUpperCase())]=A(n),e),{})}},7723:e=>{e.exports=window.wp.i18n},7752:e=>{e.exports=window.wc.customerEffortScore},8107:e=>{e.exports=window.wp.dom},8443:e=>{e.exports=window.wp.date},8468:e=>{e.exports=window.lodash},8537:e=>{e.exports=window.wp.htmlEntities},8846:e=>{e.exports=window.wc.components},9491:e=>{e.exports=window.wp.compose}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return n[e](i,i.exports,s),i.exports}s.m=n,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,n)=>(s.f[n](e,t),t),[])),s.u=e=>({61:"product-feed",96:"vendors",207:"get-started-page",223:"commons",352:"onboarding",456:"attribute-mapping",472:"settings",528:"reports",553:"shipping",663:"ads-onboarding",844:"price-benchmark",945:"dashboard"}[e]+".js?ver="+{61:"ea705907a0f839e4ca6f",96:"00decd99dd1d962e893e",207:"5d044a608798cf6eb177",223:"fbb706cc3d6a7aa00161",352:"45cfc63eed6eb9d548f3",456:"43e21b34fcdb90f514d7",472:"a92b38b9381f61f1bbe3",528:"ff66ccb64617197cb17d",553:"aa34e5af41333cf1a3b5",663:"1d943fcff3721325c268",844:"9345056ec6301acdea60",945:"a378599493481ce4610c"}[e]),s.miniCssF=e=>({61:"product-feed",96:"vendors",207:"get-started-page",352:"onboarding",456:"attribute-mapping",472:"settings",528:"reports",553:"shipping",663:"ads-onboarding",844:"price-benchmark",945:"dashboard"}[e]+".css?ver="+{61:"ea705907a0f839e4ca6f",96:"00decd99dd1d962e893e",207:"5d044a608798cf6eb177",352:"45cfc63eed6eb9d548f3",456:"43e21b34fcdb90f514d7",472:"a92b38b9381f61f1bbe3",528:"ff66ccb64617197cb17d",553:"aa34e5af41333cf1a3b5",663:"1d943fcff3721325c268",844:"9345056ec6301acdea60",945:"a378599493481ce4610c"}[e]),s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="google-listings-and-ads:",s.l=(n,a,i,r)=>{if(e[n])e[n].push(a);else{var o,c;if(void 0!==i)for(var d=document.getElementsByTagName("script"),l=0;l{o.onerror=o.onload=null,clearTimeout(_);var s=e[n];if(delete e[n],o.parentNode&&o.parentNode.removeChild(o),s&&s.forEach(e=>e(a)),t)return t(a)},_=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),c&&document.head.appendChild(o)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var a=n.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=n[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{if("undefined"!=typeof document){var e={57:0};s.f.miniCss=(t,n)=>{e[t]?n.push(e[t]):0!==e[t]&&{61:1,96:1,207:1,352:1,456:1,472:1,528:1,553:1,663:1,844:1,945:1}[t]&&n.push(e[t]=(e=>new Promise((t,n)=>{var a=s.miniCssF(e),i=s.p+a;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),a=0;a{var r=document.createElement("link");r.rel="stylesheet",r.type="text/css",s.nc&&(r.nonce=s.nc),r.onerror=r.onload=n=>{if(r.onerror=r.onload=null,"load"===n.type)a();else{var s=n&&n.type,o=n&&n.target&&n.target.href||t,c=new Error("Loading CSS chunk "+e+" failed.\n("+s+": "+o+")");c.name="ChunkLoadError",c.code="CSS_CHUNK_LOAD_FAILED",c.type=s,c.request=o,r.parentNode&&r.parentNode.removeChild(r),i(c)}},r.href=t,document.head.appendChild(r)})(e,i,0,t,n)}))(t).then(()=>{e[t]=0},n=>{throw delete e[t],n}))}}})(),(()=>{var e={57:0};s.f.j=(t,n)=>{var a=s.o(e,t)?e[t]:void 0;if(0!==a)if(a)n.push(a[2]);else{var i=new Promise((n,s)=>a=e[t]=[n,s]);n.push(a[2]=i);var r=s.p+s.u(t),o=new Error;s.l(r,n=>{if(s.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var i=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+i+": "+r+")",o.name="ChunkLoadError",o.type=i,o.request=r,a[1](o)}},"chunk-"+t,t)}};var t=(t,n)=>{var a,i,[r,o,c]=n,d=0;if(r.some(t=>0!==e[t])){for(a in o)s.o(o,a)&&(s.m[a]=o[a]);c&&c(s)}for(t&&t(n);dt=>(0,l.jsx)("div",{className:"gla-admin-page",children:(0,l.jsx)(e,{...t})}),"withAdminPageShell");s(2434);var u=s(6473),_=s(3905);const E=(0,r.lazy)(()=>Promise.all([s.e(223),s.e(96),s.e(945)]).then(s.bind(s,3458))),p=(0,r.lazy)(()=>Promise.all([s.e(223),s.e(96),s.e(207)]).then(s.bind(s,494))),h=(0,r.lazy)(()=>Promise.all([s.e(223),s.e(96),s.e(352)]).then(s.bind(s,5928))),m=(0,r.lazy)(()=>Promise.all([s.e(223),s.e(96),s.e(663)]).then(s.bind(s,923))),C=(0,r.lazy)(()=>Promise.all([s.e(223),s.e(96),s.e(528)]).then(s.bind(s,6831))),A=(0,r.lazy)(()=>Promise.all([s.e(223),s.e(96),s.e(61)]).then(s.bind(s,3904))),S=(0,r.lazy)(()=>Promise.all([s.e(223),s.e(96),s.e(456)]).then(s.bind(s,8885))),I=(0,r.lazy)(()=>Promise.all([s.e(223),s.e(96),s.e(844)]).then(s.bind(s,3547))),T=(0,r.lazy)(()=>Promise.all([s.e(223),s.e(96),s.e(472)]).then(s.bind(s,2379))),R=(0,r.lazy)(()=>Promise.all([s.e(223),s.e(96),s.e(553)]).then(s.bind(s,6343))),f=new Set,y=(0,c.getSetting)("admin")?.woocommerceTranslation||(0,i.__)("WooCommerce","google-listings-and-ads"),N="woocommerce_admin_pages_list";let O=!1;const P=()=>{const{serviceBasedMerchant:e}=_.Th;(0,o.addFilter)(N,"woocommerce/google-listings-and-ads/add-page-routes",t=>{const n=[["",y],["/marketing",(0,i.__)("Marketing","google-listings-and-ads")],(0,i.__)("Google for WooCommerce","google-listings-and-ads")];let a=[{breadcrumbs:[...n],container:p,path:"/google/start",wpOpenMenu:"toplevel_page_woocommerce-marketing"},{breadcrumbs:[...n,(0,i.__)("Setup your accounts","google-listings-and-ads")],container:h,path:"/google/setup-mc"},{breadcrumbs:[...n,(0,i.__)("Setup Google Ads","google-listings-and-ads")],container:m,path:"/google/setup-ads"},{breadcrumbs:[...n,(0,i.__)("Dashboard","google-listings-and-ads")],container:E,path:"/google/dashboard",wpOpenMenu:"toplevel_page_woocommerce-marketing"},{breadcrumbs:[...n,(0,i.__)("Reports","google-listings-and-ads")],container:C,path:"/google/reports",wpOpenMenu:"toplevel_page_woocommerce-marketing"},{breadcrumbs:[...n,(0,i.__)("Product Feed","google-listings-and-ads")],container:A,path:"/google/product-feed",wpOpenMenu:"toplevel_page_woocommerce-marketing"},{breadcrumbs:[...n,(0,i.__)("Price Benchmark","google-listings-and-ads")],container:I,path:"/google/price-benchmark",wpOpenMenu:"toplevel_page_woocommerce-marketing"},{breadcrumbs:[...n,(0,i.__)("Attribute Mapping","google-listings-and-ads")],container:S,path:"/google/attribute-mapping",wpOpenMenu:"toplevel_page_woocommerce-marketing"},{breadcrumbs:[...n,(0,i.__)("Settings","google-listings-and-ads")],container:T,path:"/google/settings",wpOpenMenu:"toplevel_page_woocommerce-marketing"},{breadcrumbs:[...n,(0,i.__)("Shipping","google-listings-and-ads")],container:R,path:"/google/shipping",wpOpenMenu:"toplevel_page_woocommerce-marketing"}];const s=["/google/start","/google/setup-mc","/google/setup-ads","/google/dashboard","/google/settings"];return e&&(a=a.filter(e=>s.includes(e.path))),a.forEach(e=>{e.container=g(e.container);const t=e.path.substring(1).replace(/\//g,"_");f.add(t)}),O=!0,t.concat(a)})},G=()=>(0,o.hasAction)("hookAdded",`woocommerce/woocommerce/watch_${N}`);if((0,o.didFilter)(N)>0&&!G()&&!O){const e=Date.now(),t=setInterval(()=>{if(G())return clearInterval(t),void P();Date.now()-e>3e3&&clearInterval(t)},10)}else P();(0,o.addFilter)("woocommerce_tracks_client_event_properties","woocommerce/google-listings-and-ads/add-base-event-properties-to-page-view",(e,t)=>"wcadmin_page_view"===t&&f.has(e.path)?(0,u.qX)(e):e)})();