30 lines
152 KiB
JavaScript
30 lines
152 KiB
JavaScript
|
|
"use strict";(globalThis.__googlesitekit_webpackJsonp=globalThis.__googlesitekit_webpackJsonp||[]).push([[300],{80:(e,t,i)=>{i.d(t,{CV:()=>x,Cu:()=>j,K9:()=>o,Kr:()=>I,Lf:()=>p,Oh:()=>r,PW:()=>C,Rx:()=>_,S9:()=>y,TQ:()=>d,Vt:()=>T,Wl:()=>k,ZC:()=>s,ZY:()=>a,_p:()=>w,ag:()=>m,aj:()=>u,bz:()=>A,dq:()=>D,f2:()=>c,fB:()=>S,fV:()=>v,iB:()=>g,kc:()=>l,mo:()=>f,nc:()=>N,rm:()=>b,to:()=>n,wo:()=>h,yn:()=>M});const o="modules/analytics-4",s="account_create",n="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",I="analyticsCustomDimensionsCreate",y="https://www.googleapis.com/auth/analytics.edit",h="dashboardAllTrafficWidgetDimensionName",f="dashboardAllTrafficWidgetDimensionColor",M="dashboardAllTrafficWidgetDimensionValue",k="dashboardAllTrafficWidgetActiveRowIndex",b="dashboardAllTrafficWidgetLoaded",j={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"}},N={ADD_TO_CART:"add_to_cart",PURCHASE:"purchase",SUBMIT_LEAD_FORM:"submit_lead_form",GENERATE_LEAD:"generate_lead",CONTACT:"contact"},v=[N.CONTACT,N.GENERATE_LEAD,N.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"}}}}]}}]}}}}]}},C="audiencePermissionsSetup",x="audienceTileCustomDimensionCreate",A="audience-selection-panel-expirable-new-badge-",D="audience",T="customDimension",w="property",_=[D,T,w]},3170:(e,t,i)=>{i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var o,s=i(63696);function n(){return n=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},n.apply(null,arguments)}const __WEBPACK_DEFAULT_EXPORT__=e=>s.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 19"},e),o||(o=s.createElement("path",{fill:"currentColor",d:"M0 19h22L11 0zm12-3h-2v-2h2zm0-4h-2V8h2z"})))},4751:(e,t,i)=>{i.d(t,{A:()=>c});var o=i(62688),s=i.n(o),n=i(4452),r=i.n(n),a=i(97513),l=i(62540);function PreviewBlock({className:e,width:t,height:i,shape:o,padding:s,smallWidth:n,smallHeight:c,tabletWidth:g,tabletHeight:d,deskto
|
|||
|
|
(0,d.__)("%1$s. <Link><Strong>%2$s</Strong></Link>","google-site-kit"),i,(0,d.__)("Get help","google-site-kit")),{Link:(0,f.jsx)(p.A,{href:t,trailingIcon:(0,f.jsx)(y,{width:15,height:15}),external:!0,hideExternalIndicator:!0}),Strong:(0,f.jsx)("strong",{})}),hideIcon:!0}):null}function AdBlockerWarning({moduleSlug:e,className:t}){const i=(0,r.useSelect)(t=>t(l.i).getModuleStoreName(e)),o=(0,r.useSelect)(e=>e(i)?.getAdBlockerWarningMessage()),s=(0,r.useSelect)(t=>t(a.O4).getDocumentationLinkURL(`${e}-ad-blocker-detected`));return(0,f.jsx)(AdBlockerWarningMessage,{className:t,getHelpLink:s,warningMessage:o})}AdBlockerWarningMessage.propTypes={className:n().string,getHelpLink:n().string,warningMessage:n().string},AdBlockerWarning.propTypes={className:n().string,moduleSlug:n().string.isRequired}},24355:(e,t,i)=>{i.d(t,{SO:()=>a});var o=i(55620),s=i(99123);function n(){return[i.g.innerWidth,i.g.innerHeight]}function r({fps:e=60,leading:t=!1,initialWidth:i=0,initialHeight:r=0}={}){const[a,l]=(0,o._)("undefined"==typeof document?[i,r]:n,e,t);function c(){return l(n)}return(0,s.A)(window,"resize",c),(0,s.A)(window,"orientationchange",c),a}function a(e={}){return r(e)[0]}},25797:(e,t,i)=>{i.d(t,{A:()=>M});var o,s=i(62688),n=i.n(s),r=i(4452),a=i.n(r),l=i(63696),c=i(19793);function g(){return g=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},g.apply(null,arguments)}const warning_notice=e=>l.createElement("svg",g({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),o||(o=l.createElement("path",{fill:"currentColor",d:"M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1m0 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m-1-2h2V6h-2z"})));var d=i(42343),u=i(76984),p=i(62540);const m={[u.Q.NEW]:d.A,[u.Q.SUCCESS]:c.A,[u.Q.INFO]:warning_notice,[u.Q.WARNING]:warning_notice,[u.Q.ERROR]:warning_notice};function Icon({type:e}){const t=m[e]||warning_notice;return(0,p.jsx)(t,{width:24,height:24})}function Title({className:e,children:t}){return(0,p.jsx)("p",{className:a()("googlesitekit-notice__title",e),children:t})}function Description({className:e,children:t}){return(0,p.jsx)("p",{className:a()("googlesitekit-notice__description",e),children:t})}Icon.propTypes={type:n().oneOf(Object.values(u.Q))},Title.propTypes={className:n().string,children:n().node},Description.propTypes={className:n().string,children:n().node};var I=i(49383),y=i(83366);function CTAButton({label:e,disabled:t,inProgress:i,onClick:o,href:s,external:n=!1,hideExternalIndicator:r=!1}){let l;return n&&!r&&(l=(0,p.jsx)(y.A,{width:14,height:14})),(0,p.jsx)(I.SpinnerButton,{className:a()("googlesitekit-notice__cta",{"googlesitekit-notice__cta--spinner__running":i}),disabled:t,isSaving:i,onClick:o,href:s,target:n?"_blank":void 0,trailingIcon:l,children:e})}CTAButton.propTypes={label:n().string.isRequired,disabled:n().bool,inProgress:n().bool,onClick:n().func,href:n().string,external:n().bool,hideExternalIndicator:n().bool};var h=i(82871);function DismissButton({label:e=(0,h.__)("Got it","google-site-kit"),onClick:t,disabled:i,href:o,external:s=!1}){return(0,p.jsx)(I.Button,{onClick:t,disabled:i,href:o,target:s?"_blank":void 0,tertiary:!0,children:e})}DismissButton.propTypes={label:n().string,onClick:n().func.isRequired,disabled:n().bool,href:n().string,external:n().bool};const f=(0,l.forwardRef)(({className:e,title:t,description:i,dismissButton:o,ctaButton:s,type:n=u.Q.INFO,children:r,hideIcon:l},c)=>(0,p.jsx)("div",{className:"googlesitekit-notice-container",ref:c,children:(0,p.jsxs)("div",{className:a()("googlesitekit-notice",`googlesitekit-notice--${n}`,e),children:[!l&&(0,p.jsx)("div",{className:"googlesitekit-notice__icon",children:(0,p.jsx)(Icon,{type:n})}),(0,p.jsxs)("div",{className:"googlesitekit-notice__content",children:[t&&(0,p.jsx)(Title,{children:t}),i&&(0,p.jsx)(Description,{children:i})]}),(o?.label||o?.onClick||s?.label&&(s?.onClick||s?.href)||r)&&(0,p.jsxs)("div",{className:"googlesitekit-notice__action",children:[r
|
|||
|
|
(0,o.__)("Your Google account does not have sufficient permissions to access %s data, so you won’t be able to see stats from it on the Site Kit dashboard.","google-site-kit"),r)),a&&a.login&&(c=(0,o.sprintf)(/* translators: %s: owner name */ /* translators: %s: owner name */
|
|||
|
|
(0,o.__)('This service was originally connected by the administrator "%s" — you can contact them for more information.',"google-site-kit"),a.login)),c||(c=(0,o.__)("This service was originally connected by an administrator — you can contact them for more information.","google-site-kit")),`${l} ${c}`}},32600:(e,t,i)=>{i.d(t,{A:()=>NoticeNotification});var o=i(25797),s=i(68761),n=i(50539),r=i(8732),a=i(10740),l=i(62688),c=i.n(l),g=i(62540);function NoticeNotification({notificationID:e,children:t,dismissButton:i,ctaButton:l,gaTrackingEventArgs:c,...d}){const u=(0,s.A)(e,c?.category),{dismissNotification:p}=(0,n.useDispatch)(r.D);return(0,g.jsx)(a.xA,{children:(0,g.jsx)(a.fI,{children:(0,g.jsx)(a.fh,{size:12,alignMiddle:!0,children:(0,g.jsx)(o.A,{dismissButton:{...i,onClick:async function(t){await(i?.onClick?.(t)),u.dismiss(c?.label,c?.value),p(e,{...i?.dismissOptions||{}})}},ctaButton:{...l,onClick:async function(t){u.confirm(c?.label,c?.value),await(l?.onClick?.(t)),l?.dismissOnClick&&p(e,{...l?.dismissOptions})}},...d,children:t})})})})}NoticeNotification.propTypes={notificationID:c().string.isRequired,children:c().node,dismissButton:c().oneOfType([c().bool,c().object]),ctaButton:c().object,gaTrackingEventArgs:c().object}},32803:(e,t,i)=>{i.d(t,{Y:()=>o});const o="search-console"},33052:(e,t,i)=>{i.d(t,{A:()=>Typography});var o=i(62688),s=i.n(o),n=i(4452),r=i.n(n),a=i(8513),l=i(62540);function Typography({className:e,type:t,size:i,as:o="span",children:s,...n}){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)}),...n,children:s})}Typography.propTypes={className:s().string,type:s().oneOf(a.tT),size:s().oneOf(a.oJ),as:s().oneOfType([s().string,s().elementType])}},35403:(e,t,i)=>{i.d(t,{A:()=>GoogleTagGatewayToggle});var o=i(4452),s=i.n(o),n=i(15844),r=i(63696),a=i(13606),l=i(82871),c=i(49383),g=i(50539),d=i(29785),u=i(5855),p=i(38432),m=i(62659),I=i(13047),y=i(30289),h=i(25797),f=i(62540);const M=(0,y.A)(h.A);function GoogleTagGatewayToggle({className:e}){const t=(0,m.A)(),i=(0,g.useSelect)(e=>e(d.O4).isGoogleTagGatewayEnabled()),o=(0,g.useSelect)(e=>e(d.O4).isFetchingGetGTGServerRequirementStatus()),y=(0,g.useSelect)(e=>{const{isGTGHealthy:t,isScriptAccessEnabled:i}=e(d.O4);return!1!==t()&&!1!==i()}),{fetchGetGTGServerRequirementStatus:k,setGoogleTagGatewayEnabled:b}=(0,g.useDispatch)(d.O4),j=(0,g.useSelect)(e=>e(d.O4).getDocumentationLinkURL("google-tag-gateway-introduction")),N=(0,g.useSelect)(e=>e(d.O4).getDocumentationLinkURL("google-tag-gateway-server-requirements"));(0,n.A)(k);const v=(0,r.useCallback)(()=>{const e=i?"deactivate_google_tag_gateway":"activate_google_tag_gateway";(0,I.sx)(`${t}_gtg-settings-toggle`,e).finally(()=>{b(!i)})},[i,b,t]);return(0,f.jsxs)("div",{className:s()("googlesitekit-google-tag-gateway-toggle",e),children:[o&&(0,f.jsx)(c.ProgressBar,{className:"googlesitekit-google-tag-gateway-toggle__progress",small:!0}),!o&&(0,f.jsxs)("div",{className:"googlesitekit-module-settings-group__switch",children:[(0,f.jsx)(c.Switch,{label:(0,l.__)("Google tag gateway for advertisers","google-site-kit"),checked:!!i&&y,disabled:!y,onClick:v,hideLabel:!1}),(0,f.jsx)("div",{className:"googlesitekit-google-tag-gateway-toggle__switch-badge",children:(0,f.jsx)(u.A,{className:"googlesitekit-badge--beta",label:(0,l.__)("Beta","google-site-kit"),hasLeftSpacing:!0})})]}),(0,f.jsx)("p",{className:"googlesitekit-module-settings-group__helper-text",children:(0,a.A)((0,l.__)("Your tag data will be sent through your own domain to improve data quality and help you recover measurement signals. <a>Learn more</a>","google-site-kit"),{a:(0,f.jsx)(p.A,{href:j,onClick:()=>{(0,I.sx)(`${t}_gtg-settings-toggle`,"click_learn_more_link")},"aria-label":(0,l.__)("Learn more about Google tag gateway for advertisers","google-site-kit"),external:!0})})}),!o&&!y&&(0,f.jsx)(M,{type:h.A.TYPES.WARNING,title:(0,a.A)((0,l.__)("Your server’s current settings prevent Google tag gateway for advertisers from working. To en
|
|||
|
|
(0,r._x)("%3$s %2$s %1$s","duration of time: hh mm ss","google-site-kit"),s?p(s,{...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"),s);if(0===e)return t;const n=(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"),s?t:"",o?n:"",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:s="metric"}=i;return"metric"===s?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"===s?a(e,i):"durationISO"===s?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=n()(console.warn);function p(e,t={}){const{locale:i=I(),...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 s={currencyDisplay:"narrow",currencySign:"accounting",style:"unit"},n=["signDisplay","compactDisplay"],r={};for(const[e,t]of Object.entries(o))s[e]&&t===s[e]||n.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=I(),style:o="long",type:s="conjunction"}=t;if(Intl.ListFormat){return new Intl.ListFormat(i,{style:o,type:s}).format(e)}
|
|||
|
|
/* translators: used between list items, there is a space after the comma. */const n=(0,r.__)(", ","google-site-kit");return e.join(n)}function I(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:()=>I,LD:()=>p,SO:()=>u,a2:()=>s,xD:()=>m});var o=i(13047);const s="googlesitekit_",n=`${s}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(`${n}${e}`);if(i){const e=JSON.parse(i),{timestamp:t,ttl:o,value:s,isError:n}=e;if(t&&(!o||Math.round(Date.now()/1e3)-t<o))return{cacheHit:!0,value:s,isError:n}}}return{cacheHit:!1,value:void 0}}async function u(e,t,{ttl:s=o.Jg,timestamp:r=Math.round(Date.now()/1e3),isError:a=!1}={}){const l=await g();if(l)try{return l.setItem(`${n}${e}`,JSON.stringify({timestamp:r,ttl:s,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(s)?e:`${n}${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(s)&&t.push(o)}return t}catch(e){return i.g.console.warn("Encountered an unexpected storage error:",e),[]}return[]}async function I(){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),s=i.n(o),n=i(62540);function IconWrapper({children:e,marginLeft:t,marginRight:i}){return(0,n.jsx)("span",{className:"googlesitekit-icon-wrapper",style:{marginLeft:t,marginRight:i},children:e})}IconWrapper.propTypes={children:s().node.isRequired,marginLeft:s().number,marginRight:s().number}},50464:(e,t,i)=>{i.d(t,{A:()=>r,G:()=>n});var o=i(62688),s=i.n(o);const n=" ";function DisplaySetting({value:e}){return e||n}DisplaySetting.propTypes={value:s().oneOfType([s().string,s().bool,s().number])};const r=DisplaySetting},50477:(e,t,i)=>{i.d(t,{C:()=>n,p:()=>s});var o=i(55465);function s(e,t={}){return{__html:o.O.sanitize(e,t)}}function n(e){const t="object"==typeof e?e.toString():e;return t?.replace?.(/\/+$/,"")}},50539:e=>{e.exports=googlesitekit.data},51193:(e,t,i)=>{i.d(t,{Du:()=>p,GH:()=>l,Gp:()=>c,IS:()=>f,Jg:()=>d,N_:()=>k,O5:()=>M,Ql:()=>m,Qr:()=>I,XH:()=>h,r0:()=>g,sq:()=>y,tt:()=>u});var o=i(32091),s=i.n(o),n=i(17243),r=i(82871);const a="Date param must construct to a valid date instance or be a valid date instance itself.",l="Invalid dateString parameter, it must be a string.",c='Invalid date range, it must be a string with the format "last-x-days".',g=60,d=60*g,u=24*d,p=7*u;function m(){function e(e){return(0,r.sprintf)(/* translators: %s: number of days */ /* translators: %s: number of days */
|
|||
|
|
(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 I(e=""){if(!(0,n.isString)(e))return!1;if(3!==e.split("-").length)return!1;const t=new Date(e);return(0,n.isDate)(t)&&!isNaN(t)}function y(e){s()((0,n.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 h(e){s()(I(e),l);const[t,i,o]=e.split("-");return new Date(t,i-1,o)}function f(e,t){return y(k(e,t*u))}function M(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 k(e,t){s()(I(e)||(0,n.isDate)(e)&&!isNaN(e),l);const i=I(e)?Date.parse(e):e.getTime();return new Date(i-1e3*t)}},52274:(e,t,i)=>{i.d(t,{i:()=>r});var o=i(63696),s=i(50539),n=i(7972);function r(e){const{setValue:t}=(0,s.useDispatch)(n.n);return(0,o.useCallback)(()=>{t("admin-screen-tooltip",{isTooltipVisible:!0,...e})},[t,e])}},52735:(e,t,i)=>{i.d(t,{A:()=>o});const o=(0,i(63696).createContext)(!1)},54419:e=>{e.exports=googlesitekit.api},54519:(e,t,i)=>{function o(e,t){for(const[i,o]of Object.entries(t))e.registerNotification(i,o)}i.d(t,{U:()=>o})},55465:(e,t,i)=>{i.d(t,{O:()=>s});var o=i(31234);const s=i.n(o)()(i.g)},55989:(e,t,i)=>{i.d(t,{A:()=>l});var o=i(62688),s=i.n(o),n=i(4452),r=i.n(n),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:s().string,children:s().node},VisuallyHidden.defaultProps={className:""};const l=VisuallyHidden},59865:(e,t,i)=>{i.d(t,{A:()=>p});var o=i(62688),s=i.n(o),n=i(4452),r=i.n(n),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:s=null,title:n=null,provides:p,handleConfirm:m,subtitle:I,confirmButton:y=null,notes:h=[],danger:f=!1,inProgress:M=!1,small:k=!1,medium:b=!1,buttonLink:j=null}){const N=`googlesitekit-dialog-description-${(0,a.A)(ModalDialog)}`,v=!(!p||!p.length);return(0,u.jsxs)(g.Dialog,{open:t,onOpen:o,onClose:s,"aria-describedby":v?N:void 0,tabIndex:"-1",className:r()(e,{"googlesitekit-dialog-sm":k,"googlesitekit-dialog-md":b}),children:[(0,u.jsxs)(g.DialogTitle,{children:[f&&(0,u.jsx)(d.A,{width:28,height:28}),n]}),I?(0,u.jsx)("p",{className:"mdc-dialog__lead",children:I}):[],(0,u.jsxs)(g.DialogContent,{children:[v&&(0,u.jsx)("section",{id:N,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",{className:"mdc-list-item__text",children:e})},e))})}),h.length>0&&(0,u.jsx)("section",{className:"mdc-dialog__notes",children:h.map((e,t)=>(0,u.jsxs)("p",{className:"mdc-dialog__note",children:["string"==typeof e&&(0,l.A)((0,c.sprintf)(/* translators: %s is replaced with some sub-note text. */ /* translators: %s is replaced with some sub-note text. */
|
|||
|
|
(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:M,tertiary:!0,children:(0,c.__)("Cancel","google-site-kit")}),j?(0,u.jsx)(g.Button,{href:j,onClick:m,target:"_blank",danger:f,children:y}):(0,u.jsx)(g.SpinnerButton,{onClick:m,danger:f,disabled:M,isSaving:M,children:y||(0,c.__)("Disconnect","google-site-kit")})]})]})}ModalDialog.displayName="Dialog",ModalDialog.propTypes={className:s().string,dialogActive:s().bool,handleDialog:s().func,handleConfirm:s().func.isRequired,onOpen:s().func,onClose:s().func,title:s().string,provides:s().arrayOf(s().string),confirmButton:s().string,notes:s().arrayOf(s().oneOfType([s().string,s().elementType])),danger:s().bool,small:s().bool,medium:s().bool,buttonLink:s().string};const p=ModalDialog},60515:(e,t,i)=>{i.d(t,{A:()=>p});var o=i(62688),s=i.n(o),n=i(4452),r=i.n(n),a=i(63696),l=i(82871),c=i(49383),g=i(5855),d=i(38432),u=i(62540);function NewBadge({tooltipTitle:e,learnMoreLink:t,forceOpen:i,hasLeftSpacing:o,hasNoSpacing:s,onLearnMoreClick:n=()=>{}}){const p=(0,u.jsx)(g.A,{className:r()("googlesitekit-new-badge",{"googlesitekit-new-badge--has-no-spacing":s}),label:(0,l.__)("New","google-site-kit"),hasLeftSpacing:o});return e?(0,u.jsx)(c.Tooltip,{tooltipClassName:"googlesitekit-new-badge__tooltip",title:(0,u.jsxs)(a.Fragment,{children:[e,(0,u.jsx)("br",{}),(0,u.jsx)(d.A,{href:t,onClick:n,external:!0,hideExternalIndicator:!0,children:(0,l.__)("Learn more","google-site-kit")})]}),placement:"top",enterTouchDelay:0,leaveTouchDelay:5e3,open:i,interactive:!0,children:p}):p}NewBadge.propTypes={tooltipTitle:s().string,learnMoreLink:s().string,forceOpen:s().bool,onLearnMoreClick:s().func,hasLeftSpacing:s().bool,hasNoSpacing:s().bool};const p=NewBadge},60854:(e,t,i)=>{i.d(t,{A:()=>ConversionTrackingToggle});var o=i(63696),s=i(82871),n=i(49383),r=i(50539),a=i(29785),l=i(45257),c=i(62688),g=i.n(c),d=i(15844),u=i(82246),p=i(13047),m=i(62659),I=i(62540);function ConfirmDisableConversionTrackingDialog({onConfirm:e,onCancel:t}){const i=(0,m.A)(),o=(0,s.__)("By disabling plugin conversion tracking, you will no longer have access to:","google-site-kit"),n=[(0,s.__)("Performance of your Ad campaigns","google-site-kit"),(0,s.__)("Tracking additional conversion-related events via Analytics","google-site-kit")];return(0,d.A)(()=>{(0,p.sx)(`${i}`,"ect_view_modal")}),(0,I.jsx)(u.A,{className:"googlesitekit-settings-module__confirm-disconnect-modal",title:(0,s.__)("Disable plugin conversion tracking","google-site-kit"),subtitle:o,handleConfirm:e,handleCancel:t,onClose:t,provides:n,confirmButton:(0,s.__)("Disable","google-site-kit"),dialogActive:!0,danger:!0})}ConfirmDisableConversionTrackingDialog.propTypes={onConfirm:g().func.isRequired,onCancel:g().func.isRequired};var y=i(73198);function ConversionTrackingToggle({children:e,loading:t}){const i=(0,m.A)(),[c]=(0,o.useState)(null),[g,d]=(0,o.useState)(!1),u=(0,r.useSelect)(e=>e(a.O4).isConversionTrackingEnabled()),h=(0,r.useSelect)(e=>e(a.O4).isFetchingSaveConversionTrackingSettings()),{setConversionTrackingEnabled:f}=(0,r.useDispatch)(a.O4);return(0,I.jsxs)("div",{children:[(0,I.jsx)(l.A,{loading:t,width:"180px",height:"21.3px",children:(0,I.jsx)("div",{className:"googlesitekit-module-settings-group__switch",children:(0,I.jsx)(n.Switch,{label:(0,s.__)("Plugin conversion tracking","google-site-kit"),checked:u,disabled:h||t,onClick:()=>{u?((0,p.sx)(`${i}`,"ect_disable"),d(!0)):((0,p.sx)(`${i}`,"ect_enable"),f(!0))},hideLabel:!1})})}),!!c&&(0,I.jsx)(y.A,{message:c.message}),(0,I.jsx)(l.A,{className:"googlesitekit-settings-conversion-tracking-switch-description--loading",loading:t,width:"750px",height:"42px",smallWidth:"386px",smallHeight:"84px",tabletWidth:"540px",tabletHeight:"84px",children:(0,I.jsx)("p",{className:"googlesitekit-module-settings-group__helper-text",children:e})}),g&&(0,I.jsx)(ConfirmDisableConversionTrackingDialog,{onConfirm:()=>{(0,p.
|
|||
|
|
(0,r.__)("%s (Please try again.)","google-site-kit"),k)),p||(k=(0,r.sprintf)(/* translators: $%s: Error message */ /* translators: $%s: Error message */
|
|||
|
|
(0,r.__)("Error: %s","google-site-kit"),k));const b=t?.data?.reconnectURL;b&&(0,a.m)(b)&&(k=(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"),k,b));return(0,u.jsx)(g.A,{className:e,type:g.A.TYPES.ERROR,description:(0,u.jsx)("span",{dangerouslySetInnerHTML:(0,d.p9)(k,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href"]})}),ctaButton:M?{label:(0,r.__)("Retry","google-site-kit"),onClick:f}:void 0,hideIcon:I})}ErrorNotice.propTypes={className:s().string,error:s().shape({message:s().string}),hasButton:s().bool,storeName:s().string,message:s().string,noPrefix:s().bool,skipRetryMessage:s().bool,hideIcon:s().bool}},73866:(e,t,i)=>{i.d(t,{g4:()=>I,o1:()=>m});var o=i(78913),s=i(32091),n=i.n(s),r=i(10523),a=i.n(r),l=i(13047),c=i(50539);const g="RECEIVE_ERROR",d="CLEAR_ERROR",u="CLEAR_ERRORS";function p(e,t){if(t&&Array.isArray(t)){const i=t.map(e=>"object"==typeof e?(0,l.Zm)(e):e);return`${e}::${a()(JSON.stringify(i))}`}return e}const m={receiveError:(e,t,i=[])=>(n()(e,"error is required."),n()(t,"baseName is required."),n()(i&&Array.isArray(i),"args must be an array."),{type:g,payload:{error:e,baseName:t,args:i}}),clearError:(e,t=[])=>(n()(e,"baseName is required."),n()(t&&Array.isArray(t),"args must be an array."),{type:d,payload:{baseName:e,args:t}}),clearErrors:e=>({type:u,payload:{baseName:e}})};function I(e){n()(e,"storeName must be defined.");const t=(0,c.createReducer)((e,{type:t,payload:i})=>{switch(t){case g:{const{baseName:t,args:o,error:s}=i,n=p(t,o);e.errors=e.errors||{},e.errorArgs=e.errorArgs||{},e.errors[n]=s,e.errorArgs[n]=o;break}case d:{const{baseName:t,args:o}=i,s=p(t,o);e.errors=e.errors||{},e.errorArgs=e.errorArgs||{},delete e.errors[s],delete e.errorArgs[s];break}case u:{const{baseName:t}=i;if(t){e.errors=e.errors||{},e.errorArgs=e.errorArgs||{};for(const i in e.errors)(i===t||i.startsWith(`${t}::`))&&(delete e.errors[i],delete e.errorArgs[i])}else e.errors={},e.errorArgs={};break}}}),i={getErrorForSelector:(e,t,o=[])=>(n()(t,"selectorName is required."),i.getError(e,t,o)),getErrorForAction:(e,t,o=[])=>(n()(t,"actionName is required."),i.getError(e,t,o)),getError(e,t,i){const{errors:o}=e;return n()(t,"baseName is required."),o[p(t,i)]},getErrors(e){const t=new Set(Object.values(e.errors));return Array.from(t)},getMetaDataForError(e,t){const i=Object.keys(e.errors).find(i=>e.errors[i]===t);if(i){return{baseName:i.substring(0,i.indexOf("::")),args:e.errorArgs[i]}}return null},getSelectorDataForError:(0,o.N)(t=>function(i,o){const s=t(e).getMetaDataForError(o);if(s){const{baseName:i,args:o}=s;if(!!t(e)[i])return{storeName:e,name:i,args:o}}return null}),hasErrors:e=>i.getErrors(e).length>0};return{initialState:{errors:{},errorArgs:{}},actions:m,controls:{},reducer:t,resolvers:{},selectors:i}}},74426:(e,t,i)=>{function o(e){return e.charAt(0).toUpperCase()+e.slice(1)}function s(e){return e.replace(/([a-z0-9]{1})([A-Z]{1})/g,"$1_$2").toUpperCase()}function n(e){return e.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}i.d(t,{Uf:()=>n,m2:()=>o,sP:()=>s})},75649:(e,t,i)=>{i.d(t,{A:()=>n});var o=i(82871),s=i(63696);function n({isDismissalFinal:e}={}){const[t]=(0,s.useState)(!0===e?(0,o.__)("Don’t show again","google-site-kit"):(0,o.__)("Maybe later","google-site-kit"));return t}},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"}},78014:(e,t,i)=>{i.d(t,{A:()=>StoreErrorNotices});var o=i(62688),s=i.n(o),n=i(50539),r=i(73198),a=i(88273),l=i(13137),c=i(31012),g=i(62540);function StoreErrorNotices({hasButton:e=!1,moduleSlug:t,storeName:i}){const o=(0,n.useSelect)(e=>e(i).getErrors()),s=(0,n.useSelect)(e=>e(a.i).getModule(t)),d=[];return o.filter(e=>!(!e?.message||d.includes(e.message))&&(d.push(e.message),!0)).map((t,o)=>{let{message:n}=t;return(0,l.SG)(t)&&(n=(0,c.c)(n,s)),(0,g.jsx)(r.A,{error:t,hasButton:e,storeName:i,message:n},o)})}StoreErrorNotices.propTypes={hasButton:s().bool,storeName:s().string.isRequired,moduleSlug:s().string}},79961:(e,t,i)=>{i.d(t,{A:()=>n});var o=i(63696),s=i(84895);const n=(0,o.createContext)(s.t)},81597:(e,t,i)=>{i.d(t,{I:()=>o
|