37 lines
184 KiB
JavaScript
37 lines
184 KiB
JavaScript
|
|
"use strict";(globalThis.__googlesitekit_webpackJsonp=globalThis.__googlesitekit_webpackJsonp||[]).push([[15,290],{80:(e,t,i)=>{i.d(t,{CV:()=>j,Cu:()=>I,K9:()=>o,Kr:()=>h,Lf:()=>p,Oh:()=>r,PW:()=>A,Rx:()=>E,S9:()=>f,TQ:()=>d,Vt:()=>C,Wl:()=>v,ZC:()=>n,ZY:()=>a,_p:()=>T,ag:()=>m,aj:()=>u,bz:()=>w,dq:()=>M,f2:()=>c,fB:()=>S,fV:()=>N,iB:()=>g,kc:()=>l,mo:()=>y,nc:()=>x,rm:()=>b,to:()=>s,wo:()=>k,yn:()=>_});const o="modules/analytics-4",n="account_create",s="property_create",r="webdatastream_create",a="analyticsSetup",l=10,c=0,g="https://www.googleapis.com/auth/tagmanager.readonly",d="enhanced-measurement-form",u="enhanced-measurement-enabled",p="enhanced-measurement-should-dismiss-activation-banner",m="analyticsAccountCreate",h="analyticsCustomDimensionsCreate",f="https://www.googleapis.com/auth/analytics.edit",k="dashboardAllTrafficWidgetDimensionName",y="dashboardAllTrafficWidgetDimensionColor",_="dashboardAllTrafficWidgetDimensionValue",v="dashboardAllTrafficWidgetActiveRowIndex",b="dashboardAllTrafficWidgetLoaded",I={googlesitekit_post_date:{parameterName:"googlesitekit_post_date",displayName:"WordPress Post Date",description:"Created by Site Kit: Date when a post was published",scope:"EVENT"},googlesitekit_post_author:{parameterName:"googlesitekit_post_author",displayName:"WordPress Post Author",description:"Created by Site Kit: WordPress name of the post author",scope:"EVENT"},googlesitekit_post_categories:{parameterName:"googlesitekit_post_categories",displayName:"WordPress Post Categories",description:"Created by Site Kit: Names of categories assigned to a post",scope:"EVENT"},googlesitekit_post_type:{parameterName:"googlesitekit_post_type",displayName:"WordPress Post Type",description:"Created by Site Kit: Content type of a post",scope:"EVENT"}},x={ADD_TO_CART:"add_to_cart",PURCHASE:"purchase",SUBMIT_LEAD_FORM:"submit_lead_form",GENERATE_LEAD:"generate_lead",CONTACT:"contact"},N=[x.CONTACT,x.GENERATE_LEAD,x.SUBMIT_LEAD_FORM],S={"new-visitors":{description:"People who visited the site for the first time",displayName:"New visitors",membershipDurationDays:-1,filterClauses:[{clauseType:"INCLUDE",simpleFilter:{scope:"AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS",filterExpression:{andGroup:{filterExpressions:[{orGroup:{filterExpressions:[{dimensionOrMetricFilter:{fieldName:"newVsReturning",stringFilter:{matchType:"EXACT",value:"new"}}}]}},{orGroup:{filterExpressions:[{notExpression:{dimensionOrMetricFilter:{fieldName:"groupId",stringFilter:{matchType:"EXACT",value:"created_by_googlesitekit:new_visitors"}}}}]}}]}}}}]},"returning-visitors":{description:"People who have visited your site at least once before",displayName:"Returning visitors",membershipDurationDays:-1,filterClauses:[{clauseType:"INCLUDE",simpleFilter:{scope:"AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS",filterExpression:{andGroup:{filterExpressions:[{orGroup:{filterExpressions:[{dimensionOrMetricFilter:{fieldName:"newVsReturning",stringFilter:{matchType:"EXACT",value:"returning"}}}]}},{orGroup:{filterExpressions:[{notExpression:{dimensionOrMetricFilter:{fieldName:"groupId",stringFilter:{matchType:"EXACT",value:"created_by_googlesitekit:returning_visitors"}}}}]}}]}}}}]}},A="audiencePermissionsSetup",j="audienceTileCustomDimensionCreate",w="audience-selection-panel-expirable-new-badge-",M="audience",C="customDimension",T="property",E=[M,C,T]},4124:(e,t,i)=>{i.d(t,{A:()=>s});var o=i(20697),n=i(62659);function s(){const e=(0,n.A)();return o.Nn.includes(e)}},4169:(e,t,i)=>{i.d(t,{N$:()=>n,aO:()=>s,qB:()=>o});const o={BOXES:"boxes",COMPOSITE:"composite"},n={QUARTER:"quarter",HALF:"half",FULL:"full"},s="core/widgets"},4751:(e,t,i)=>{i.d(t,{A:()=>c});var o=i(62688),n=i.n(o),s=i(4452),r=i.n(s),a=i(97513),l=i(62540);function PreviewBlock({className:e,width:t,height:i,shape:o,padding:n,smallWidth:s,smallHeight:c,tabletWidth:g,tabletHeight:d,desktopWidth:u,desktopHeight:p}){const m=(0,a.dv)(),h={width:{[a.mp]:s,[a.Lg]:g,[a.Fo]:u,[a.Qb]:u},height:{[a.mp]:c,[a.Lg]:d,[a.Fo]:p,[a.Qb]:u}};return(0,l.jsx)("div",{className:r()("googlesitekit-preview-block",e,{"googlesitekit-preview
|
||
|
|
(0,y.__)("%1$d selected <MaxCount>(up to %2$d)</MaxCount>","google-site-kit"),T,n),{MaxCount:(0,m.jsx)("span",{className:"googlesitekit-selection-panel-footer__item-count--max-count"})})});return(0,m.jsx)("footer",{className:"googlesitekit-selection-panel-footer",children:(0,m.jsxs)("div",{className:"googlesitekit-selection-panel-footer__content",children:[E,(0,m.jsxs)("div",{className:"googlesitekit-selection-panel-footer__actions",children:[(0,m.jsx)(_.Button,{onClick:w,disabled:s,tertiary:!0,children:(0,y.__)("Cancel","google-site-kit")}),(0,m.jsx)(_.SpinnerButton,{onClick:j,isSaving:s,disabled:T<o||T>n||s||!l&&p,children:g||v})]})]})})}SelectionPanelFooter.propTypes={savedItemSlugs:r().array,selectedItemSlugs:r().array,saveSettings:r().func,minSelectedItemCount:r().number,maxSelectedItemCount:r().number,isBusy:r().bool,onSaveSuccess:r().func,onCancel:r().func,isOpen:r().bool,closePanel:r().func};const j=SelectionPanel},6730:(e,t,i)=>{i.d(t,{A:()=>GenericErrorHandlerActions});var o=i(62688),n=i.n(o),s=i(82871),r=i(38432),a=i(38021),l=i.n(a),c=i(63696),g=i(12417),d=i(1027),u=i(65123),p=i(49383),m=i(62540);function ReportErrorButton({message:e,componentStack:t}){const[i,o]=(0,c.useState)(!1);return(0,m.jsx)(p.Button,{"aria-label":i?(0,s.__)("Error message copied to clipboard. Click to copy the error message again.","google-site-kit"):void 0,onClick:function(){l()(`\`\`\`\n${e}\n${t}\n\`\`\``),o(!0)},trailingIcon:(0,m.jsx)(g.A,{className:"mdc-button__icon",icon:i?d.A:u.A}),children:i?(0,s.__)("Copied to clipboard","google-site-kit"):(0,s.__)("Copy error contents","google-site-kit")})}ReportErrorButton.propTypes={message:n().string,componentStack:n().string};const h=ReportErrorButton;function GenericErrorHandlerActions({message:e,componentStack:t}){return(0,m.jsxs)("div",{className:"googlesitekit-generic-error-handler-actions",children:[(0,m.jsx)(h,{message:e,componentStack:t}),(0,m.jsx)(r.A,{href:"https://wordpress.org/support/plugin/google-site-kit/",external:!0,children:(0,s.__)("Report this problem","google-site-kit")})]})}GenericErrorHandlerActions.propTypes={message:n().string,componentStack:n().string}},7076:(e,t,i)=>{i.d(t,{d:()=>r});var o=i(18117),n=i(17243),s=i(63696);function r(...e){const t=(0,o.MA)(()=>(0,n.debounce)(...e),e);return(0,s.useEffect)(()=>()=>t.cancel(),[t]),t}},7144:(e,t,i)=>{i.d(t,{EA:()=>s,GF:()=>k,Hl:()=>d,IX:()=>m,Is:()=>r,KD:()=>p,LO:()=>g,NO:()=>c,Nl:()=>l,QJ:()=>u,Uf:()=>n,XU:()=>f,Y0:()=>a,hs:()=>y,wb:()=>h});var o=i(82871);const n="key-metrics-setup-cta-widget",s="googlesitekit-key-metrics-selection-panel-opened",r="key-metrics-selection-form",a="key-metrics-selected",l="key-metrics-effective-selection",c="key-metrics-unstaged-selection",g=2,d=8,u={SLUG:"current-selection",LABEL:(0,o.__)("Current selection","google-site-kit")},p={SLUG:"suggested",LABEL:(0,o.__)("Suggested","google-site-kit")},m={SLUG:"visitors",LABEL:(0,o.__)("Visitors","google-site-kit")},h={SLUG:"driving-traffic",LABEL:(0,o.__)("Driving traffic","google-site-kit")},f={SLUG:"generating-leads",LABEL:(0,o.__)("Generating leads","google-site-kit")},k={SLUG:"selling-products",LABEL:(0,o.__)("Selling products","google-site-kit")},y={SLUG:"content-performance",LABEL:(0,o.__)("Content performance","google-site-kit")}},7551:(e,t,i)=>{i.d(t,{Ay:()=>a,Oo:()=>s,oE:()=>r});var o=i(20697),n=i(62659);const s=o.jU,r=o.f7;function a(){const e=(0,n.A)();return e===o.jU||e===o.Ax?s:e===o.f7||e===o.Is?r:null}},7972:(e,t,i)=>{i.d(t,{F:()=>n,n:()=>o});const o="core/ui",n="activeContextID"},8084:(e,t,i)=>{i.d(t,{$C:()=>j,RF:()=>A,WI:()=>N,_5:()=>b,jU:()=>v,o3:()=>_,x0:()=>x});var o=i(32091),n=i.n(o),s=i(50532),r=i.n(s),a=i(17243),l=i(78913);const c="GET_REGISTRY",g="AWAIT";function d(...e){const t=e.reduce((e,t)=>({...e,...t}),{}),i=I(e.reduce((e,t)=>[...e,...Object.keys(t)],[]));return n()(0===i.length,`collect() cannot accept collections with duplicate keys. Your call to collect() contains the following duplicated functions: ${i.join(", ")}. Check your data stores for duplicates.`),t}const u=d,p=d;function m(...e){const t=[...e];let i;re
|
||
|
|
(0,$._n)("%s is disconnected, no data to show","%s are disconnected, no data to show",c.length,"google-site-kit"),c.join((0,$.__)(" and ","google-site-kit")))})})}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},J.apply(null,arguments)}MetricItem.propTypes={slug:y().string.isRequired,title:y().string.isRequired,description:y().string.isRequired,isNewlyDetected:y().bool,savedItemSlugs:y().array};const key_metrics_no_selected_items=e=>o.createElement("svg",J({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 383 238"},e),w||(w=o.createElement("path",{fill:"#B8E6CA",d:"M59.238 58.571c-2.136 20.178 4.272 29.099 20.48 53.216 16.209 24.118-29.092 62.914 5.475 101.268 33.827 37.532 69.419.009 111.314-4.555 29.443-3.208 57.819 12.98 90.86 5.9s46.385-42.599 43.153-68.059c-5.59-44.041-26.24-49.107-34.893-66.461s2.902-52.997-30.287-73.16-76.71 14.42-112.503 12.37c-20.651-1.182-40.932-4.995-59.264.86-18.53 5.918-32.662 22.571-34.335 38.621"})),M||(M=o.createElement("g",{filter:"url(#key-metrics-no-selected-items_svg__a)"},o.createElement("rect",{width:130.621,height:89.651,x:242.455,y:45.266,fill:"#fff",rx:10.957,transform:"rotate(15 242.455 45.266)"}))),C||(C=o.createElement("rect",{width:24.903,height:7.969,x:253.726,y:64.785,fill:"#EBEEF0",rx:3.985,transform:"rotate(15 253.726 64.785)"})),T||(T=o.createElement("rect",{width:49.806,height:19.923,x:249.342,y:81.144,fill:"#FFDED3",rx:9.961,transform:"rotate(15 249.342 81.144)"})),E||(E=o.createElement("rect",{width:99.428,height:8.773,x:240.436,y:114.357,fill:"#EBEEF0",rx:3.985,transform:"rotate(15 240.436 114.357)"})),D||(D=o.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.494,d:"m256.195 90.198 4.644 8.044m0 0 1.412-4.986m-1.412 4.986-5.023-1.27"})),O||(O=o.createElement("rect",{width:19.923,height:5.977,x:268.706,y:93.551,fill:"#fff",rx:1.992,transform:"rotate(15 268.706 93.55)"})),L||(L=o.createElement("g",{filter:"url(#key-metrics-no-selected-items_svg__b)"},o.createElement("rect",{width:130.621,height:89.68,x:13.887,y:79.094,fill:"#fff",rx:10.957,transform:"rotate(-15 13.887 79.094)"}))),R||(R=o.createElement("rect",{width:62.386,height:7.798,x:32.989,y:90.122,fill:"#EBEEF0",rx:3.899,transform:"rotate(-15 32.99 90.122)"})),P||(P=o.createElement("rect",{width:49.806,height:19.923,x:37.691,y:106.902,fill:"#FFDED3",rx:9.961,transform:"rotate(-15 37.691 106.902)"})),z||(z=o.createElement("rect",{width:99.428,height:7.798,x:46.612,y:140.967,fill:"#EBEEF0",rx:3.899,transform:"rotate(-15 46.612 140.967)"})),B||(B=o.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.494,d:"m48.152 111.318 8.044 4.645m0 0-1.27-5.024m1.27 5.024-4.986 1.411"})),G||(G=o.createElement("rect",{width:19.923,height:5.977,x:60.663,y:107.966,fill:"#fff",rx:1.992,transform:"rotate(-15 60.663 107.966)"})),U||(U=o.createElement("g",{filter:"url(#key-metrics-no-selected-items_svg__c)"},o.createElement("rect",{width:130.621,height:89.68,x:126.251,y:37.4,fill:"#fff",rx:10.957}))),H||(H=o.createElement("rect",{width:98.333,height:7.867,x:143.013,y:53.134,fill:"#EBEEF0",rx:3.933})),F||(F=o.createElement("rect",{width:49.806,height:19.923,x:142.369,y:70.423,fill:"#B8E6CA",rx:9.961})),V||(V=o.createElement("rect",{width:33.04,height:7.867,x:143.013,y:105.84,fill:"#EBEEF0",rx:3.933})),W||(W=o.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.494,d:"m151.336 84.036 6.568-6.567m0 0-5.182-.073m5.182.073.073 5.18"})),Y||(Y=o.createElement("rect",{width:19.923,height:5.977,x:164.287,y:77.395,fill:"#fff",rx:1.992})),o.createElement("mask",{id:"key-metrics-no-selected-items_svg__d",width:273,height:230,x:58,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},Z||(Z=o.createElement("path",{fill:"#B8E6CA",d:"M59.237 58.571C57.1 78.75 63.509 87.67 79.717 111.787c16.209 24.118-29.091 62.914 5.475 101.268 33.827 37.532 69.419.009 111.314-4.555 2
|
||
|
|
(0,c.__)("Select up to %d metrics","google-site-kit"),h.Hl),onCloseClick:e,children:!t&&(0,I.jsx)(C.A,{children:(0,N.A)((0,c.__)("Edit your personalized goals or deactivate this widget in <link><strong>Settings</strong></link>","google-site-kit"),{link:(0,I.jsx)(j.A,{onClick:s,disabled:o,secondary:!0}),strong:(0,I.jsx)("strong",{})})})})}Header.propTypes={closePanel:a().func.isRequired};var T=i(11999),E=i(88273),D=i(13137),O=i(62659),L=i(78990),R=i(13047),P=i(49383),z=i(4751);function SelectionPanelFooter({savedItemSlugs:e=[],selectedItemSlugs:t=[],saveSettings:i=()=>{},minSelectedItemCount:o=0,maxSelectedItemCount:n=0,isBusy:r,onSaveSuccess:a=()=>{},onCancel:g=()=>{},isOpen:u,closePanel:m=()=>{},isFullScreen:h=!1}){const[f,k]=(0,l.useState)(null),[y,_]=(0,l.useState)(!1),v=(0,d.useSelect)(e=>e(p.K9).isFetchingSyncAvailableAudiences()),b=(0,l.useMemo)(()=>!(0,s.isEqual)((0,R.N9)(t),(0,R.N9)(e)),[e,t]);let x=e?.length>0&&b?(0,c.__)("Apply changes","google-site-kit"):(0,c.__)("Save selection","google-site-kit");h&&(x=(0,c.__)("Complete setup","google-site-kit"));const S=(0,l.useCallback)(async()=>{const{error:e}=await i(t);e||(a(),m(),h||(k(x),_(!0)))},[i,t,a,m,h,x]),A=(0,l.useCallback)(()=>{m(),g()},[m,g]),[j,w]=(0,l.useState)(null);(0,l.useEffect)(()=>{null!==j&&j!==u&&u&&(k(null),_(!1)),w(u)},[u,j]);const M=t?.length||0,C=v?(0,I.jsx)(z.A,{width:"89px",height:"20px"}):(0,I.jsx)("p",{className:"googlesitekit-selection-panel-footer__item-count",children:(0,N.A)((0,c.sprintf)(/* translators: 1: Number of selected items. 2: Maximum number of items that can be selected. */ /* translators: 1: Number of selected items. 2: Maximum number of items that can be selected. */
|
||
|
|
(0,c.__)("%1$d selected <MaxCount>(up to %2$d)</MaxCount>","google-site-kit"),M,n),{MaxCount:(0,I.jsx)("span",{className:"googlesitekit-selection-panel-footer__item-count--max-count"})})});return(0,I.jsx)("footer",{className:"googlesitekit-selection-panel-footer",children:(0,I.jsx)("div",{className:"googlesitekit-selection-panel-footer__content",children:(0,I.jsxs)("div",{className:"googlesitekit-selection-panel-footer__actions",children:[(0,I.jsx)(P.Button,{onClick:A,disabled:r,tertiary:!0,children:(0,c.__)("Cancel","google-site-kit")}),C,(0,I.jsx)(P.SpinnerButton,{onClick:S,isSaving:r,disabled:M<o||M>n||r||!u&&y,children:f||x})]})})})}function Footer({isOpen:e,closePanel:t=s.noop,savedMetrics:i,onNavigationToOAuthURL:o=()=>{},isFullScreen:n=!1}){const r=(0,d.useRegistry)(),a=(0,O.A)(),g=(0,_.A)(h.Is,h.Y0),k=(0,d.useSelect)(e=>e(u.oR).isSavingKeyMetricsSettings()),y=`${a}_kmw-sidebar`,v=g?.flatMap(e=>{const t=f.G[e];return t?.requiredCustomDimensions||[]}),b=(0,d.useInViewSelect)(e=>{if(!v?.length)return!1;return!e(p.K9).hasCustomDimensions(v)},[v]),x=(0,d.useInViewSelect)(e=>e(u.oR).hasScope(p.S9)),N=(0,d.useSelect)(e=>e(E.i).isModuleConnected(m.L1)),j=(0,d.useSelect)(e=>e(A.O4).getAdminURL("googlesitekit-dashboard",{notification:"custom_dimensions"})),w=(0,d.useSelect)(e=>{const t=e(u.oR).getConnectURL({additionalScopes:[p.S9],redirectURL:j});return!!t&&e(S.M).isNavigatingTo(t)}),M=(0,d.useSelect)(e=>e(A.O4).getAdminURL("googlesitekit-dashboard")),C=(0,d.useSelect)(e=>!!M&&e(S.M).isNavigatingTo(M)),{saveKeyMetricsSettings:P,setPermissionScopeError:z}=(0,d.useDispatch)(u.oR),{setValues:B}=(0,d.useDispatch)(T.s),{navigateTo:G}=(0,d.useDispatch)(S.M),U=(0,d.useSelect)(e=>e(p.K9).getKeyMetricsConversionEventWidgets()),H=(0,l.useCallback)(async e=>{const{error:t}=await P({widgetSlugs:e});return{error:t}},[P]),F=(0,l.useCallback)(async e=>{if(Object.values(U).flat().some(t=>e.includes(t))?(0,R.sx)(y,"metrics_sidebar_save","conversion_reporting"):(0,R.sx)(y,"metrics_sidebar_save"),N&&b){if(B(p.Kr,{autoSubmit:!0}),!x)return o(),t(),void z({code:D.db,message:(0,c.__)("Additional permissions are required to create new Analytics custom dimensions","google-site-kit"),data:{status:403,scopes:[p.S9],skipModal:!0,redirectURL:j}});n&&await(0,L.mR)(r)}n&&G(M)},[U,N,b,n,y,B,x,o,t,z,j,r,G,M]),V=(0,l.useCallback)(()=>{(0,R.sx)(y,"metrics_sidebar_cancel"),n&&G(M)},[n,M,G,y]);return(0,I.jsx)(SelectionPanelFooter,{savedItemSlugs:i,selectedItemSlugs:g,saveSettings:H,minSelectedItemCount:h.LO,maxSelectedItemCount:h.Hl,isBusy:k||w||C&&n,onSaveSuccess:()=>{F(g)},onCancel:V,isOpen:e,closePanel:t,isFullScreen:n})}SelectionPanelFooter.propTypes={savedItemSlugs:a().array,selectedItemSlugs:a().array,saveSettings:a().func,saveError:a().object,minSelectedItemCount:a().number,maxSelectedItemCount:a().number,isBusy:a().bool,onSaveSuccess:a().func,onCancel:a().func,isOpen:a().bool,closePanel:a().func,isFullScreen:a().bool},Footer.propTypes={isOpen:a().bool,closePanel:a().func,savedMetrics:a().array,onNavigationToOAuthURL:a().func,isFullScreen:a().bool};var B=i(12666);function SelectionPanelItems({savedItemSlugs:e=[],allMetricItems:t}){return(0,I.jsx)("div",{className:"googlesitekit-selection-panel-items",children:(0,I.jsx)(B.A,{savedItemSlugs:e,allMetricItems:t})})}function MetricItems({savedMetrics:e}){const t=(0,M.A)(),{isKeyMetricAvailable:i}=(0,d.useSelect)(e=>e(u.oR)),o=(0,d.useInViewSelect)(e=>i=>f.G[i].displayInSelectionPanel({select:e,isViewOnlyDashboard:t,slug:i}),[t]);const n=Object.keys(f.G).reduce(function(e,t){if(!i(t))return e;if(void 0===o||"function"==typeof f.G[t].displayInSelectionPanel&&!o(t))return e;const{title:n,description:s,metadata:{group:r}}=f.G[t];return{...e,[t]:{title:n,description:s,group:r}}},{});return(0,I.jsx)(SelectionPanelItems,{savedItemSlugs:e,allMetricItems:n})}SelectionPanelItems.propTypes={savedItemSlugs:a().array,allMetricItems:a().object.isRequired},MetricItems.propTypes={savedMetrics:a().array};var G=i(65695);const U=(0,y.A)({moduleName:m.L1})(function KeyMetricsError({savedMetrics:e}){const t=(0,_.A)(h.Is,h.Y0
|
||
|
|
(0,c.__)("Select at least %1$d metrics (%2$d selected)","google-site-kit"),h.LO,r):r>h.Hl&&(a=(0,c.sprintf)(/* translators: 1: Maximum number of metrics that can be selected. 2: Number of selected metrics. */ /* translators: 1: Maximum number of metrics that can be selected. 2: Number of selected metrics. */
|
||
|
|
(0,c.__)("Select up to %1$d metrics (%2$d selected)","google-site-kit"),h.Hl,r));let g=n;return o&&a&&(g={message:a}),(0,I.jsx)(G.A,{error:g,skipRetryMessage:!!a})});function PanelContent({isOpen:e=!1,closePanel:t,savedViewableMetrics:i,showHeader:o=!0,setIsNavigatingToOAuthURL:r=s.noop,isFullScreen:a=!1}){return(0,I.jsxs)(l.Fragment,{children:[o&&(0,I.jsx)(Header,{closePanel:t}),(0,I.jsx)(MetricItems,{savedMetrics:i}),(0,I.jsx)(x,{}),(0,I.jsxs)("div",{className:n()("googlesitekit-user-input__footer-container",{"googlesitekit-user-input__footer-container--fullscreen":a}),children:[(0,I.jsx)(U,{savedMetrics:i}),(0,I.jsx)(Footer,{isOpen:e,closePanel:t,savedMetrics:i,onNavigationToOAuthURL:()=>{r(!0)},isFullScreen:a})]})]})}PanelContent.propTypes={isOpen:a().bool,closePanel:a().func,savedViewableMetrics:a().array,showHeader:a().bool,setIsNavigatingToOAuthURL:a().func,isFullScreen:a().bool}},29785:(e,t,i)=>{i.d(t,{O4:()=>o,OQ:()=>s,qc:()=>n});const o="core/site",n="primary",s="secondary"},30805:(e,t,i)=>{i.d(t,{i:()=>r});var o=i(63696),n=i(79961),s=i(84895);function r(e){const t=(0,o.useContext)(n.A);return(0,s.G)(e,t)}},33052:(e,t,i)=>{i.d(t,{A:()=>Typography});var o=i(62688),n=i.n(o),s=i(4452),r=i.n(s),a=i(8513),l=i(62540);function Typography({className:e,type:t,size:i,as:o="span",children:n,...s}){return(0,l.jsx)(o,{className:r()("googlesitekit-typography",e,{[`googlesitekit-typography--${t}`]:t&&a.tT.includes(t),[`googlesitekit-typography--${i}`]:i&&a.oJ.includes(i)}),...s,children:n})}Typography.propTypes={className:n().string,type:n().oneOf(a.tT),size:n().oneOf(a.oJ),as:n().oneOfType([n().string,n().elementType])}},37133:(e,t,i)=>{i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var o=i(63696);const __WEBPACK_DEFAULT_EXPORT__=function(e,t){const[n,s]=(0,o.useState)(null);return(0,o.useEffect)(()=>{if(e.current&&"function"==typeof i.g.IntersectionObserver){function o(e){s(e[e.length-1])}const n=new i.g.IntersectionObserver(o,t);return n.observe(e.current),()=>{s(null),n.disconnect()}}return()=>{}},[e.current,t.threshold,t.root,t.rootMargin]),n}},37834:(e,t,i)=>{i.d(t,{A:()=>Notifications});var o=i(62688),n=i.n(o),s=i(50539),r=i(62659),a=i(8732),l=i(84730),c=i(50532),g=i.n(c),d=i(67438),u=i(62540);const p=g()(e=>({id:e,Notification:m(e)(d.A)}));function m(e){return t=>{function WithNotificationID(i){return(0,u.jsx)(t,{...i,id:e})}return WithNotificationID.displayName="WithNotificationID",(t.displayName||t.name)&&(WithNotificationID.displayName+=`(${t.displayName||t.name})`),WithNotificationID}}function Notifications({areaSlug:e,groupID:t=l.He.DEFAULT}){const i=(0,r.A)(),o=(0,s.useSelect)(e=>e(a.D).getQueuedNotifications(i,t));if(void 0===o?.[0]||o?.[0]?.areaSlug!==e)return null;const{id:n,Component:c}=o[0],g={...p(n)};return(0,u.jsx)(c,{...g})}Notifications.propTypes={viewContext:n().string,areaSlug:n().string}},38017:(e,t,i)=>{i.d(t,{A:()=>l});var o=i(62688),n=i.n(o),s=i(4452),r=i.n(s),a=i(62540);function ChangeArrow({direction:e,invertColor:t,width:i,height:o}){return(0,a.jsx)("svg",{className:r()("googlesitekit-change-arrow",`googlesitekit-change-arrow--${e}`,{"googlesitekit-change-arrow--inverted-color":t}),width:i,height:o,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M5.625 10L5.625 2.375L9.125 5.875L10 5L5 -1.76555e-07L-2.7055e-07 5L0.875 5.875L4.375 2.375L4.375 10L5.625 10Z",fill:"currentColor"})})}ChangeArrow.propTypes={direction:n().string,invertColor:n().bool,width:n().number,height:n().number},ChangeArrow.defaultProps={direction:"up",invertColor:!1,width:9,height:9};const l=ChangeArrow},38432:(e,t,i)=>{i.d(t,{A:()=>w});var o,n=i(4452),s=i.n(n),r=i(62688),a=i.n(r),l=i(39941),c=i(63696),g=i(82871);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},d.apply(null,arguments)}const u=e=>c.createElement("svg",d({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13"},e),o||(o=c.createElement("g",{fill:"none",fillRule:"evenodd"},c.crea
|
||
|
|
(0,c.__)("Source: %s","google-site-kit"),`<a>${e}</a>`),{a:h.createElement(g.A,{key:"link",href:t,external:o,onClick:k})}))}SourceLink.propTypes={name:n().string,href:n().string,className:n().string,external:n().bool};const f=SourceLink},44436:(e,t,i)=>{i.d(t,{A:()=>d});var o,n=i(82871),s=i(88933),r=i(63696);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},a.apply(null,arguments)}const l=e=>r.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 80 21"},e),o||(o=r.createElement("path",{fill:"#5F6368",d:"M62.09 1.664h3.038v.1L58.34 9.593l7.241 10.224v.1H62.7L56.755 11.4 53.95 14.64v5.278h-2.351V1.664h2.35v9.415h.1zM69.985 3.117c0 .454-.167.853-.488 1.175-.322.322-.71.488-1.176.488-.455 0-.854-.166-1.175-.488a1.6 1.6 0 0 1-.488-1.175c0-.466.166-.854.488-1.176s.71-.488 1.175-.488c.455 0 .854.166 1.176.488.332.333.487.72.487 1.176m-.477 4.313v12.498h-2.351V7.43zM77.016 20.128c-1.02 0-1.864-.31-2.54-.943q-1.014-.948-1.031-2.628V9.57h-2.196V7.43h2.196V3.603h2.35V7.43h3.061v2.14h-3.06v6.222c0 .831.166 1.397.488 1.696.321.3.687.444 1.097.444.189 0 .366-.022.555-.067.188-.044.344-.1.499-.166l.743 2.096c-.632.222-1.342.333-2.162.333M2.673 18.952C1.375 18.009.488 16.678 0 14.97l2.883-1.176c.289 1.076.799 1.94 1.542 2.628.732.677 1.619 1.02 2.65 1.02.965 0 1.774-.244 2.45-.742.677-.5 1.01-1.187 1.01-2.052 0-.798-.3-1.453-.887-1.974q-.883-.781-3.094-1.564l-1.22-.432Q3.371 9.997 2.04 8.716C1.153 7.862.71 6.742.71 5.346c0-.966.266-1.853.787-2.673S2.75 1.209 3.693.72C4.624.244 5.678 0 6.864 0c1.708 0 3.072.41 4.081 1.242 1.02.832 1.697 1.752 2.04 2.795L10.236 5.2c-.2-.621-.576-1.164-1.142-1.63-.565-.477-1.286-.71-2.173-.71s-1.641.222-2.251.676-.91 1.032-.91 1.742c0 .676.278 1.22.82 1.663.544.432 1.398.854 2.563 1.253l1.22.41c1.674.577 2.96 1.342 3.88 2.274.921.931 1.376 2.184 1.376 3.748 0 1.275-.322 2.34-.976 3.193a6 6 0 0 1-2.495 1.919 8 8 0 0 1-3.116.621c-1.62 0-3.072-.466-4.358-1.408M15.969 3.449a1.95 1.95 0 0 1-.588-1.43c0-.566.2-1.043.588-1.431A1.95 1.95 0 0 1 17.399 0c.566 0 1.043.2 1.43.588.389.388.588.865.588 1.43 0 .566-.2 1.043-.587 1.43a1.95 1.95 0 0 1-1.43.589c-.566-.012-1.043-.2-1.431-.588m-.067 2.595h2.994v13.883h-2.994zM25.406 19.85c-.544-.2-.987-.466-1.331-.788-.776-.776-1.176-1.84-1.176-3.182V8.683h-2.428v-2.64h2.428V2.13h2.994v3.926h3.372v2.639h-3.372v6.531c0 .743.145 1.276.433 1.575.277.366.743.543 1.42.543.31 0 .576-.044.82-.122q.35-.116.765-.399v2.917c-.599.277-1.32.41-2.173.41a5 5 0 0 1-1.753-.3M33.623 19.407a6.63 6.63 0 0 1-2.529-2.628c-.61-1.12-.909-2.373-.909-3.77 0-1.332.3-2.551.887-3.693.588-1.132 1.409-2.04 2.462-2.706s2.251-1.01 3.593-1.01c1.397 0 2.606.311 3.637.921a6.1 6.1 0 0 1 2.34 2.528c.532 1.076.799 2.274.799 3.627 0 .255-.023.576-.078.953H33.179c.111 1.287.566 2.285 1.375 2.983a4.16 4.16 0 0 0 2.817 1.043c.854 0 1.597-.189 2.218-.588a4.27 4.27 0 0 0 1.508-1.597l2.528 1.198q-.981 1.713-2.561 2.694c-1.054.655-2.318.976-3.782.976q-2.046.033-3.66-.931m7.23-8.051a3.3 3.3 0 0 0-.466-1.453c-.277-.477-.687-.887-1.242-1.208-.554-.322-1.23-.488-2.03-.488-.964 0-1.773.288-2.439.853-.665.566-1.12 1.342-1.375 2.296z"})));var c=i(55989),g=i(62540);const d=function Logo(){return(0,g.jsxs)("div",{className:"googlesitekit-logo","aria-hidden":"true",children:[(0,g.jsx)(s.A,{className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),(0,g.jsx)(l,{className:"googlesitekit-logo__logo-sitekit",height:"26",width:"99"}),(0,g.jsx)(c.A,{children:(0,n.__)("Site Kit by Google Logo","google-site-kit")})]})}},45257:(e,t,i)=>{i.d(t,{A:()=>LoadingWrapper});var o=i(62688),n=i.n(o),s=i(4751),r=i(62540);function LoadingWrapper({loading:e,children:t,...i}){return e?(0,r.jsx)(s.A,{...i}):t}LoadingWrapper.propTypes={loading:n().bool,children:n().node,...s.A.propTypes}},46467:(e,t,i)=>{i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var o,n,s,r=i(63696);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=argumen
|
||
|
|
(0,r._x)("%3$s %2$s %1$s","duration of time: hh mm ss","google-site-kit"),n?p(n,{...l,unit:"second"}):"",o?p(o,{...l,unit:"minute"}):"",i?p(i,{...l,unit:"hour"}):"").trim()},formatDecimal(){const t=(0,r.sprintf)(
|
||
|
|
// translators: %s: number of seconds with "s" as the abbreviated unit.
|
||
|
|
// translators: %s: number of seconds with "s" as the abbreviated unit.
|
||
|
|
(0,r.__)("%ds","google-site-kit"),n);if(0===e)return t;const s=(0,r.sprintf)(
|
||
|
|
// translators: %s: number of minutes with "m" as the abbreviated unit.
|
||
|
|
// translators: %s: number of minutes with "m" as the abbreviated unit.
|
||
|
|
(0,r.__)("%dm","google-site-kit"),o),a=(0,r.sprintf)(
|
||
|
|
// translators: %s: number of hours with "h" as the abbreviated unit.
|
||
|
|
// translators: %s: number of hours with "h" as the abbreviated unit.
|
||
|
|
(0,r.__)("%dh","google-site-kit"),i);return(0,r.sprintf)(/* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */ /* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */
|
||
|
|
(0,r._x)("%3$s %2$s %1$s","duration of time: hh mm ss","google-site-kit"),n?t:"",o?s:"",i?a:"").trim()}}}(e,t);try{return i()}catch{return o()}}function l(e){e=parseInt(e,10),Number.isNaN(e)&&(e=0);return{hours:Math.floor(e/60/60),minutes:Math.floor(e/60%60),seconds:Math.floor(e%60)}}function c(e){return 1e6<=e?Math.round(e/1e5)/10:1e4<=e?Math.round(e/1e3):1e3<=e?Math.round(e/100)/10:e}function g(e){let t={};return"%"===e?t={style:"percent",maximumFractionDigits:2}:"s"===e?t={style:"duration",unitDisplay:"narrow"}:e&&"string"==typeof e?t={style:"currency",currency:e}:(0,o.isPlainObject)(e)&&(t={...e}),t}function d(e,t={}){e=(0,o.isFinite)(e)?e:Number(e),(0,o.isFinite)(e)||(console.warn("Invalid number",e,typeof e),e=0);const i=g(t),{style:n="metric"}=i;return"metric"===n?function(e){const t={minimumFractionDigits:1,maximumFractionDigits:1};return 1e6<=e?(0,r.sprintf)(
|
||
|
|
// translators: %s: an abbreviated number in millions.
|
||
|
|
// translators: %s: an abbreviated number in millions.
|
||
|
|
(0,r.__)("%sM","google-site-kit"),p(c(e),e%10==0?{}:t)):1e4<=e?(0,r.sprintf)(
|
||
|
|
// translators: %s: an abbreviated number in thousands.
|
||
|
|
// translators: %s: an abbreviated number in thousands.
|
||
|
|
(0,r.__)("%sK","google-site-kit"),p(c(e))):1e3<=e?(0,r.sprintf)(
|
||
|
|
// translators: %s: an abbreviated number in thousands.
|
||
|
|
// translators: %s: an abbreviated number in thousands.
|
||
|
|
(0,r.__)("%sK","google-site-kit"),p(c(e),e%10==0?{}:t)):p(e,{signDisplay:"never",maximumFractionDigits:1})}(e):"duration"===n?a(e,i):"durationISO"===n?function(e){let{hours:t,minutes:i,seconds:o}=l(e);return o=("0"+o).slice(-2),i=("0"+i).slice(-2),t=("0"+t).slice(-2),"00"===t?`${i}:${o}`:`${t}:${i}:${o}`}(e):p(e,i)}const u=s()(console.warn);function p(e,t={}){const{locale:i=h(),...o}=t;try{return new Intl.NumberFormat(i,o).format(e)}catch(t){u(`Site Kit numberFormat error: Intl.NumberFormat( ${JSON.stringify(i)}, ${JSON.stringify(o)} ).format( ${typeof e} )`,t.message)}const n={currencyDisplay:"narrow",currencySign:"accounting",style:"unit"},s=["signDisplay","compactDisplay"],r={};for(const[e,t]of Object.entries(o))n[e]&&t===n[e]||s.includes(e)||(r[e]=t);try{return new Intl.NumberFormat(i,r).format(e)}catch{return new Intl.NumberFormat(i).format(e)}}function m(e,t={}){const{locale:i=h(),style:o="long",type:n="conjunction"}=t;if(Intl.ListFormat){return new Intl.ListFormat(i,{style:o,type:n}).format(e)}
|
||
|
|
/* translators: used between list items, there is a space after the comma. */const s=(0,r.__)(", ","google-site-kit");return e.join(s)}function h(e=i.g){const t=(0,o.get)(e,["_googlesitekitLegacyData","locale"]);if(t){const e=t.match(/^(\w{2})?(_)?(\w{2})/);if(e&&e[0])return e[0].replace(/_/g,"-")}return e.navigator.language}},49993:(e,t,i)=>{i.d(t,{Gq:()=>d,IL:()=>h,LD:()=>p,SO:()=>u,a2:()=>n,xD:()=>m});var o=i(13047);const n="googlesitekit_",s=`${n}1.175.0_${i.g._googlesitekitBaseData.storagePrefix}_`,r=["sessionStorage","localStorage"];let a,l=[...r];async function c(e){const t=i.g[e];if(!t)return!1;try{const e="__storage_test__";return t.setItem(e,e),t.removeItem(e),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==t.length}}async function g(){if(void 0!==a)return a;for(const e of l)a||await c(e)&&(a=i.g[e]);return void 0===a&&(a=null),a}async function d(e){const t=await g();if(t){const i=t.getItem(`${s}${e}`);if(i){const e=JSON.parse(i),{timestamp:t,ttl:o,value:n,isError:s}=e;if(t&&(!o||Math.round(Date.now()/1e3)-t<o))return{cacheHit:!0,value:n,isError:s}}}return{cacheHit:!1,value:void 0}}async function u(e,t,{ttl:n=o.Jg,timestamp:r=Math.round(Date.now()/1e3),isError:a=!1}={}){const l=await g();if(l)try{return l.setItem(`${s}${e}`,JSON.stringify({timestamp:r,ttl:n,value:t,isError:a})),!0}catch(e){return i.g.console.warn("Encountered an unexpected storage error:",e),!1}return!1}async function p(e){const t=await g();if(t)try{const i=e.startsWith(n)?e:`${s}${e}`;return t.removeItem(i),!0}catch(e){return i.g.console.warn("Encountered an unexpected storage error:",e),!1}return!1}async function m(){const e=await g();if(e)try{const t=[];for(let i=0;i<e.length;i++){const o=e.key(i);0===o.indexOf(n)&&t.push(o)}return t}catch(e){return i.g.console.warn("Encountered an unexpected storage error:",e),[]}return[]}async function h(){if(await g()){const e=await m();for(const t of e)await p(t);return!0}return!1}},50304:(e,t,i)=>{i.d(t,{A:()=>IconWrapper});var o=i(62688),n=i.n(o),s=i(62540);function IconWrapper({children:e,marginLeft:t,marginRight:i}){return(0,s.jsx)("span",{className:"googlesitekit-icon-wrapper",style:{marginLeft:t,marginRight:i},children:e})}IconWrapper.propTypes={children:n().node.isRequired,marginLeft:n().number,marginRight:n().number}},50454:(e,t,i)=>{i.d(t,{G:()=>d});var o=i(82871),n=i(97345),s=i(29785),r=i(80);function a({select:e,slug:t}){return e(r.K9).hasConversionReportingEvents(this.requiredConversionEventName)||e(n.oR).isKeyMetricActive(t)}var l=i(7144);function c({select:e,isViewOnlyDashboard:t}){return!t||!(!t||!e(r.K9).getAdSenseLinked())}function g({select:e,isViewOnlyDashboard:t}){return!t||e(r.K9).hasCustomDimensions(this.requiredCustomDimensions)}const d={[n.p3]:{title:(0,o.__)("Top earning pages","google-site-kit"),description:(0,o.__)("Pages that generated the most AdSense revenue","google-site-kit"),infoTooltip:(0,o.__)("Pages that generated the most AdSense revenue","google-site-kit"),displayInSelectionPanel:c,displayInList:c,metadata:{group:l.hs.SLUG}},[n.BT]:{title:(0,o.__)("Top recent trending pages","google-site-kit"),description:(0,o.__)("Pages with the most pageviews published in the last 3 days","google-site-kit"),infoTooltip:(0,o.__)("Pages with the most pageviews published in the last 3 days","google-site-kit"),requiredCustomDimensions:["googlesitekit_post_date"],displayInSelectionPanel:g,displayInWidgetArea:g,displayInList:g,metadata:{group:l.hs.SLUG}},[n.tB]:{title:(0,o.__)("Most popular authors by pageviews","google-site-kit"),description:(0,o.__)("Authors whose posts got the most visits","google-site-kit"),infoTooltip:(0,o.__)("Authors whose posts got the most visits","google-site-kit"),requiredCustomDimensions:["googlesitekit_post_author"],displayInSelectionPanel:g,displayInWidgetArea:g,displayInList:g,metadata:{group:l.hs.SLUG}},[n.t1]:{title:(0,o.__)("Top categories by pageviews","google-site-kit"),description:(0,o.__)("Categories that your site visitors viewed the most","google
|
||
|
|
(0,r._n)("Last %s day","Last %s days",e,"google-site-kit"),e)}return{"last-7-days":{slug:"last-7-days",label:e(7),days:7},"last-14-days":{slug:"last-14-days",label:e(14),days:14},"last-28-days":{slug:"last-28-days",label:e(28),days:28},"last-90-days":{slug:"last-90-days",label:e(90),days:90}}}function h(e=""){if(!(0,s.isString)(e))return!1;if(3!==e.split("-").length)return!1;const t=new Date(e);return(0,s.isDate)(t)&&!isNaN(t)}function f(e){n()((0,s.isDate)(e)&&!isNaN(e),a);const t=`${e.getMonth()+1}`,i=`${e.getDate()}`;return[e.getFullYear(),t.length<2?`0${t}`:t,i.length<2?`0${i}`:i].join("-")}function k(e){n()(h(e),l);const[t,i,o]=e.split("-");return new Date(t,i-1,o)}function y(e,t){return f(v(e,t*u))}function _(e){const t=e.split("-");return 3===t.length&&"last"===t[0]&&!Number.isNaN(t[1])&&!Number.isNaN(parseFloat(t[1]))&&"days"===t[2]}function v(e,t){n()(h(e)||(0,s.isDate)(e)&&!isNaN(e),l);const i=h(e)?Date.parse(e):e.getTime();return new Date(i-1e3*t)}},52696:(e,t,i)=>{i.d(t,{WM:()=>o.WM,wA:()=>o.wA,ws:()=>o.ws});var o=i(49057);void 0===i.g.googlesitekit&&(i.g.googlesitekit={}),i.g.googlesitekit.data=o.Ay},52721:(e,t,i)=>{i.d(t,{w:()=>a});var o=i(35470),n=i(63696),s=i(85097);function r(){}function a(e,t){const i=(0,s.W)({sticky:!0}),a=(0,n.useRef)(),l=(0,n.useCallback)(e,t),c=(0,o.A)(i?l:r);return i&&(a.current=c),a.current}},52735:(e,t,i)=>{i.d(t,{A:()=>o});const o=(0,i(63696).createContext)(!1)},55465:(e,t,i)=>{i.d(t,{O:()=>n});var o=i(31234);const n=i.n(o)()(i.g)},55989:(e,t,i)=>{i.d(t,{A:()=>l});var o=i(62688),n=i.n(o),s=i(4452),r=i.n(s),a=i(62540);function VisuallyHidden({className:e,children:t,...i}){return t?(0,a.jsx)("span",{...i,className:r()("screen-reader-text",e),children:t}):null}VisuallyHidden.propTypes={className:n().string,children:n().node},VisuallyHidden.defaultProps={className:""};const l=VisuallyHidden},58718:(e,t,i)=>{i.d(t,{CX:()=>n,Py:()=>r,SM:()=>o,kj:()=>s});const o="adsense-connect-cta",n="adsense-connect-cta-tooltip-state",s="adsense-ga4-top-earnings-notice",r="adsense"},59352:(e,t,i)=>{i.r(t),i.d(t,{CONTEXT_ENTITY_DASHBOARD_CONTENT:()=>c,CONTEXT_ENTITY_DASHBOARD_MONETIZATION:()=>d,CONTEXT_ENTITY_DASHBOARD_SPEED:()=>g,CONTEXT_ENTITY_DASHBOARD_TRAFFIC:()=>l,CONTEXT_MAIN_DASHBOARD_CONTENT:()=>s,CONTEXT_MAIN_DASHBOARD_KEY_METRICS:()=>o,CONTEXT_MAIN_DASHBOARD_MONETIZATION:()=>a,CONTEXT_MAIN_DASHBOARD_SPEED:()=>r,CONTEXT_MAIN_DASHBOARD_TRAFFIC:()=>n,default:()=>u});const o="mainDashboardKeyMetrics",n="mainDashboardTraffic",s="mainDashboardContent",r="mainDashboardSpeed",a="mainDashboardMonetization",l="entityDashboardTraffic",c="entityDashboardContent",g="entityDashboardSpeed",d="entityDashboardMonetization",u={CONTEXT_MAIN_DASHBOARD_KEY_METRICS:o,CONTEXT_MAIN_DASHBOARD_TRAFFIC:n,CONTEXT_MAIN_DASHBOARD_CONTENT:s,CONTEXT_MAIN_DASHBOARD_SPEED:r,CONTEXT_MAIN_DASHBOARD_MONETIZATION:a,CONTEXT_ENTITY_DASHBOARD_TRAFFIC:l,CONTEXT_ENTITY_DASHBOARD_CONTENT:c,CONTEXT_ENTITY_DASHBOARD_SPEED:g,CONTEXT_ENTITY_DASHBOARD_MONETIZATION:d}},59865:(e,t,i)=>{i.d(t,{A:()=>p});var o=i(62688),n=i.n(o),s=i(4452),r=i.n(s),a=i(52684),l=i(13606),c=i(82871),g=i(49383),d=i(85149),u=i(62540);function ModalDialog({className:e="",dialogActive:t=!1,handleCancel:i=null,onOpen:o=null,onClose:n=null,title:s=null,provides:p,handleConfirm:m,subtitle:h,confirmButton:f=null,notes:k=[],danger:y=!1,inProgress:_=!1,small:v=!1,medium:b=!1,buttonLink:I=null}){const x=`googlesitekit-dialog-description-${(0,a.A)(ModalDialog)}`,N=!(!p||!p.length);return(0,u.jsxs)(g.Dialog,{open:t,onOpen:o,onClose:n,"aria-describedby":N?x:void 0,tabIndex:"-1",className:r()(e,{"googlesitekit-dialog-sm":v,"googlesitekit-dialog-md":b}),children:[(0,u.jsxs)(g.DialogTitle,{children:[y&&(0,u.jsx)(d.A,{width:28,height:28}),s]}),h?(0,u.jsx)("p",{className:"mdc-dialog__lead",children:h}):[],(0,u.jsxs)(g.DialogContent,{children:[N&&(0,u.jsx)("section",{id:x,className:"mdc-dialog__provides",children:(0,u.jsx)("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive",children:p.map(e=>(0,u.jsx)("li",{className:"mdc-list-item",children:(0,u.jsx)("span",{
|
||
|
|
(0,c.__)("<strong>Note:</strong> %s","google-site-kit"),e),{strong:(0,u.jsx)("strong",{})}),"function"==typeof e&&(0,u.jsx)(e,{})]},`note-${t}`))})]}),(0,u.jsxs)(g.DialogFooter,{children:[(0,u.jsx)(g.Button,{className:"mdc-dialog__cancel-button",onClick:i,disabled:_,tertiary:!0,children:(0,c.__)("Cancel","google-site-kit")}),I?(0,u.jsx)(g.Button,{href:I,onClick:m,target:"_blank",danger:y,children:f}):(0,u.jsx)(g.SpinnerButton,{onClick:m,danger:y,disabled:_,isSaving:_,children:f||(0,c.__)("Disconnect","google-site-kit")})]})]})}ModalDialog.displayName="Dialog",ModalDialog.propTypes={className:n().string,dialogActive:n().bool,handleDialog:n().func,handleConfirm:n().func.isRequired,onOpen:n().func,onClose:n().func,title:n().string,provides:n().arrayOf(n().string),confirmButton:n().string,notes:n().arrayOf(n().oneOfType([n().string,n().elementType])),danger:n().bool,small:n().bool,medium:n().bool,buttonLink:n().string};const p=ModalDialog},61983:(e,t,i)=>{i.d(t,{A:()=>DismissButton});var o=i(62688),n=i.n(o),s=i(82871),r=i(49383),a=i(62540);function DismissButton({className:e,label:t=(0,s.__)("Maybe later","google-site-kit"),onClick:i,disabled:o,tertiary:n=!0}){return i?(0,a.jsx)(r.Button,{className:e,onClick:i,disabled:o,tertiary:n,children:t}):null}DismissButton.propTypes={className:n().string,label:n().string,onClick:n().func,disabled:n().bool,tertiary:n().bool,dismissOptions:n().shape({expiresInSeconds:n().number,skipHidingFromQueue:n().bool})}},62659:(e,t,i)=>{i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var o=i(63696),n=i(19826);const __WEBPACK_DEFAULT_EXPORT__=function(){return(0,o.useContext)(n.Ay)}},62954:(e,t,i)=>{function o(e,t){const i=e.getBoundingClientRect(),o=t.getBoundingClientRect();return!(i.bottom<o.top||o.bottom<i.top||i.right<o.left||o.right<i.left)}i.d(t,{N:()=>o})},63081:(e,t,i)=>{i.d(t,{A:()=>Root});var o=i(62688),n=i.n(o),s=i(44010),r=i(77105),a=i(63696),l=i(50539),c=i.n(l),g=i(82871),d=i(6730),u=i(19826),p=i(67510),m=i(13047),h=i(62540);class ErrorHandler extends a.Component{constructor(e){super(e),this.state={error:null,info:null,copied:!1}}componentDidCatch(e,t){i.g.console.error("Caught an error:",e,t),this.setState({error:e,info:t}),(0,m.sx)("react_error",`handle_${this.context||"unknown"}_error`,`${e?.message}\n${t?.componentStack}`.slice(0,500))}render(){const{children:e}=this.props,{error:t,info:i}=this.state;return t?(0,h.jsx)(p.A,{notificationID:"googlesitekit-error",className:"googlesitekit-error-handler",type:"error",title:(0,g.__)("Site Kit encountered an error","google-site-kit"),description:(0,h.jsxs)(a.Fragment,{children:[(0,h.jsx)(d.A,{message:t.message,componentStack:i.componentStack}),(0,h.jsxs)("pre",{className:"googlesitekit-overflow-auto",children:[t.message,i.componentStack]})]})}):e}}ErrorHandler.contextType=u.Ay,ErrorHandler.propTypes={children:n().node.isRequired};const f=ErrorHandler;var k=i(79961);const{Consumer:y,Provider:_}=k.A,v=_;var b=i(84895),I=i(82246),x=i(11999),N=i(70301),S=i(97345),A=i(78990),j=i(94656);const w=function AuthenticatedPermissionsModal(){const e=(0,l.useRegistry)(),t=(0,l.useSelect)(e=>e(S.oR).getPermissionScopeError()),o=(0,l.useSelect)(e=>e(S.oR).getUnsatisfiedScopes()),n=(0,l.useSelect)(e=>e(S.oR).getConnectURL({additionalScopes:t?.data?.scopes,redirectURL:t?.data?.redirectURL||i.g.location.href,errorRedirectURL:t?.data?.errorRedirectURL})),{clearPermissionScopeError:s}=(0,l.useDispatch)(S.oR),{navigateTo:r}=(0,l.useDispatch)(N.M),{setValues:c}=(0,l.useDispatch)(x.s),d=(0,a.useCallback)(()=>{s()},[s]),u=(0,a.useCallback)(async()=>{c(S.$8,{permissionsError:t}),await(0,A.mR)(e),r(n)},[e,n,r,t,c]);return(0,a.useEffect)(()=>{!async function(){t?.data?.skipModal&&t?.data?.scopes?.length&&await u()}()},[u,t]),t?t?.data?.scopes?.length?t?.data?.skipModal||o&&t?.data?.scopes.every(e=>o.includes(e))?null:(0,h.jsx)(j.A,{children:(0,h.jsx)(I.A,{title:(0,g.__)("Additional Permissions Required","google-site-kit"),subtitle:t.message,confirmButton:(0,g.__)("Proceed","google-site-kit"),handleConfirm:u,handleCancel:d,onClose:d,dialogActive:!0,medium:!0})}):(i.g.con
|
||
|
|
(0,r.__)("%s (Please try again.)","google-site-kit"),v)),p||(v=(0,r.sprintf)(/* translators: $%s: Error message */ /* translators: $%s: Error message */
|
||
|
|
(0,r.__)("Error: %s","google-site-kit"),v));const b=t?.data?.reconnectURL;b&&(0,a.m)(b)&&(v=(0,r.sprintf)(/* translators: 1: Original error message 2: Reconnect URL */ /* translators: 1: Original error message 2: Reconnect URL */
|
||
|
|
(0,r.__)('%1$s To fix this, <a href="%2$s">redo the plugin setup</a>.',"google-site-kit"),v,b));return(0,u.jsx)(g.A,{className:e,type:g.A.TYPES.ERROR,description:(0,u.jsx)("span",{dangerouslySetInnerHTML:(0,d.p9)(v,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href"]})}),ctaButton:_?{label:(0,r.__)("Retry","google-site-kit"),onClick:y}:void 0,hideIcon:h})}ErrorNotice.propTypes={className:n().string,error:n().shape({message:n().string}),hasButton:n().bool,storeName:n().string,message:n().string,noPrefix:n().bool,skipRetryMessage:n().bool,hideIcon:n().bool}},74426:(e,t,i)=>{function o(e){return e.charAt(0).toUpperCase()+e.slice(1)}function n(e){return e.replace(/([a-z0-9]{1})([A-Z]{1})/g,"$1_$2").toUpperCase()}function s(e){return e.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}i.d(t,{Uf:()=>s,m2:()=>o,sP:()=>n})},75662:(e,t,i)=>{i.d(t,{A:()=>h});var o=i(62688),n=i.n(o),s=i(4452),r=i.n(s),a=i(63696),l=i(10740),c=i(38432),g=i(33052),d=i(62540);class LayoutHeader extends a.Component{render(){const{title:e,badge:t,ctaLabel:i,ctaLink:o}=this.props,n=o?{alignMiddle:!0,smSize:4,lgSize:6}:{alignMiddle:!0,smSize:4,mdSize:8,lgSize:12};return(0,d.jsx)("header",{className:"googlesitekit-layout__header",children:(0,d.jsx)(l.xA,{children:(0,d.jsxs)(l.fI,{children:[e&&(0,d.jsx)(l.fh,{...n,children:(0,d.jsxs)(g.A,{as:"h3",size:"small",type:"title",className:"googlesitekit-subheading-1 googlesitekit-layout__header-title",children:[e,t]})}),o&&(0,d.jsx)(l.fh,{smSize:4,lgSize:6,alignMiddle:!0,mdAlignRight:!0,children:(0,d.jsx)(c.A,{href:o,external:!0,children:i})})]})})})}}LayoutHeader.propTypes={title:n().string,badge:n().node,ctaLabel:n().string,ctaLink:n().string},LayoutHeader.defaultProps={title:"",badge:null,ctaLabel:"",ctaLink:""};const u=LayoutHeader;var p=i(44148);class LayoutFooter extends a.Component{render(){const{ctaLabel:e,ctaLink:t,footerContent:i}=this.props;return(0,d.jsx)("footer",{className:"googlesitekit-layout__footer",children:(0,d.jsx)(l.xA,{children:(0,d.jsx)(l.fI,{children:(0,d.jsxs)(l.fh,{size:12,children:[t&&e&&(0,d.jsx)(p.A,{className:"googlesitekit-data-block__source",name:e,href:t,external:!0}),i]})})})})}}LayoutFooter.propTypes={ctaLabel:n().string,ctaLink:n().string};const m=LayoutFooter;class Layout extends a.Component{render(){const{header:e,footer:t,children:i,title:o,badge:n,headerCTALabel:s,headerCTALink:a,footerCTALabel:l,footerCTALink:c,footerContent:g,className:p,fill:h,relative:f,rounded:k=!1,transparent:y=!1,..._}=this.props;return(0,d.jsxs)("div",{className:r()("googlesitekit-layout",p,{"googlesitekit-layout--fill":h,"googlesitekit-layout--relative":f,"googlesitekit-layout--rounded":k,"googlesitekit-layout--transparent":y}),..._,children:[e&&(0,d.jsx)(u,{title:o,badge:n,ctaLabel:s,ctaLink:a}),i,t&&(0,d.jsx)(m,{ctaLabel:l,ctaLink:c,footerContent:g})]})}}Layout.propTypes={header:n().bool,footer:n().bool,children:n().node.isRequired,title:n().string,badge:n().node,headerCTALabel:n().string,headerCTALink:n().string,footerCTALabel:n().string,footerCTALink:n().string,footerContent:n().node,className:n().string,fill:n().bool,relative:n().bool,rounded:n().bool,transparent:n().bool},Layout.defaultProps={header:!1,footer:!1,title:"",badge:null,headerCTALabel:"",headerCTALink:"",footerCTALabel:"",footerCTALink:"",footerContent:null,className:"",fill:!1,relative:!1};const h=Layout},76729:(e,t,i)=>{i.d(t,{Q:()=>o});const o="emailReportingUserSettingsSelectionPanelOpened"},76984:(e,t,i)=>{i.d(t,{Q:()=>o});const o={NEW:"new",SUCCESS:"success",WARNING:"warning",INFO:"info",INFO_ALT:"info-alt",INFO_ALT_2:"info-alt-2",ERROR:"error"}},78307:(e,t,i)=>{i.d(t,{A:()=>HelpMenu});var o=i(4452),n=i.n(o),s=i(62688),r=i.n(s),a=i(21795),l=i(63696),c=i(19266),g=i(82871),d=i(50539),u=i(49383),p=i(13047),m=i(38432),h=i(62659),f=i(30805),k=i(62540);function HelpMenuLink({children:e,href:t,gaEventLabel:i,onClick:o,icon:n}){const s=(0,h.A)(),r=(0,f.i)("setupFlowRefresh"),a=(0,l.useCallback)(async()=>{o?.(),i&&await(0,p.sx)(`${s}_headerbar_helpmenu`,r?"click_menu_item":"click_outgoing_link",i)},[o,i,s,r]);return(0,k.jsx)("li"
|
||
|
|
(0,l.__)("Google Account for %1$s (Email: %2$s)","google-site-kit"),n,i)),n&&!i&&(Z=(0,l.sprintf)(/* translators: Account info text. 1: User's (full) name. */ /* translators: Account info text. 1: User's (full) name. */
|
||
|
|
(0,l.__)("Google Account for %1$s","google-site-kit"),n)),!n&&i&&(Z=(0,l.sprintf)(/* translators: Account info text. 1: User's email address. */ /* translators: Account info text. 1: User's email address. */
|
||
|
|
(0,l.__)("Google Account (Email: %1$s)","google-site-kit"),i)),(0,f.jsxs)(c.Fragment,{children:[(0,f.jsxs)("div",{ref:A,className:"googlesitekit-user-selector googlesitekit-dropdown-menu googlesitekit-dropdown-menu__icon-menu mdc-menu-surface--anchor",children:[(0,f.jsx)(m.Button,{disabled:r,ref:j,className:"googlesitekit-header__dropdown mdc-button--dropdown googlesitekit-border-radius-round--tablet googlesitekit-border-radius-round--phone googlesitekit-border-radius-round googlesitekit-button-icon",onClick:F,icon:!!o&&(0,f.jsx)("i",{className:"mdc-button__icon mdc-button__account","aria-hidden":"true",children:(0,f.jsx)("img",{className:"mdc-button__icon--image",src:o,alt:(0,l.__)("User Avatar","google-site-kit")})}),"aria-haspopup":"menu","aria-expanded":x,"aria-controls":"user-menu","aria-label":r?void 0:(0,l.__)("Account","google-site-kit"),tooltipEnterDelayInMS:500,customizedTooltip:r?null:(0,f.jsxs)("span",{"aria-label":Z,children:[(0,f.jsx)("strong",{children:(0,l.__)("Google Account","google-site-kit")}),(0,f.jsx)("br",{}),(0,f.jsx)("br",{}),n,n&&(0,f.jsx)("br",{}),i]}),text:!0,tooltip:!0}),(0,f.jsxs)(m.Menu,{className:"googlesitekit-user-menu",menuOpen:x,onSelected:W,id:"user-menu",children:[(0,f.jsx)(MenuSection,{children:(0,f.jsx)(Details,{})}),e&&(0,f.jsx)(MenuItem,{id:"manage-email-reports",icon:(0,f.jsx)(E.A,{width:"24"}),label:(0,l.__)("Manage email reports","google-site-kit"),itemClassName:"googlesitekit-user-menu__item",iconClassName:"googlesitekit-user-menu__item-icon",labelClassName:"googlesitekit-user-menu__item-label"}),!!t&&(0,f.jsx)(MenuItem,{id:"manage-sites",icon:(0,f.jsx)(T,{width:"24"}),label:(0,l.__)("Manage Sites","google-site-kit"),itemClassName:"googlesitekit-user-menu__item",iconClassName:"googlesitekit-user-menu__item-icon",labelClassName:"googlesitekit-user-menu__item-label"}),(0,f.jsx)(MenuItem,{id:"disconnect",icon:(0,f.jsx)(N,{width:"24"}),label:(0,l.__)("Disconnect","google-site-kit"),itemClassName:"googlesitekit-user-menu__item",iconClassName:"googlesitekit-user-menu__item-icon",labelClassName:"googlesitekit-user-menu__item-label"})]})]}),(0,f.jsx)(b.A,{children:(0,f.jsx)(h.A,{dialogActive:k,handleConfirm:Y,handleCancel:C,onClose:C,title:(0,l.__)("Disconnect","google-site-kit"),subtitle:(0,l.__)("Disconnecting Site Kit by Google will remove your access to all services. After disconnecting, you will need to re-authorize to restore service.","google-site-kit"),confirmButton:(0,l.__)("Disconnect","google-site-kit"),danger:!0,small:!0})})]})}var H=i(10740),F=i(4124),V=i(45257),W=i(15844),Y=i(31589),Z=i(39525),Q=i(30521),q=i(20697),$=i(7551),X=i(11883),K=i(97513);var J=i(59352),ee=i(4169);const te={[$.Oo]:{[q.SH]:J.CONTEXT_MAIN_DASHBOARD_KEY_METRICS,[q.OT]:J.CONTEXT_MAIN_DASHBOARD_TRAFFIC,[q.en]:J.CONTEXT_MAIN_DASHBOARD_CONTENT,[q.Ej]:J.CONTEXT_MAIN_DASHBOARD_SPEED,[q.Gw]:J.CONTEXT_MAIN_DASHBOARD_MONETIZATION},[$.oE]:{[q.OT]:J.CONTEXT_ENTITY_DASHBOARD_TRAFFIC,[q.en]:J.CONTEXT_ENTITY_DASHBOARD_CONTENT,[q.Ej]:J.CONTEXT_ENTITY_DASHBOARD_SPEED,[q.Gw]:J.CONTEXT_ENTITY_DASHBOARD_MONETIZATION}};var ie;function oe(){return oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},oe.apply(null,arguments)}const ne=e=>c.createElement("svg",oe({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 18 18"},e),ie||(ie=c.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M18 16V2c0-1.1-1-2-2.222-2H2.222C1 0 0 .9 0 2v14c0 1.1 1 2 2.222 2h13.556C17 18 18 17.1 18 16M9 7h5V5H9zm7-5H2v14h14zM4 4h4v4H4zm10 7H9v2h5zM4 10h4v4H4z",clipRule:"evenodd"})));var se,re,ae,le;function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},ce.apply(null,arguments)}const ge=e=>c.createElement("svg",ce({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 13 12"},e),se||(se=c.createElement("rect",{width:5,height:5,x:.5,fill:"currentColor",rx:1})),re||(
|