32 lines
146 KiB
JavaScript
32 lines
146 KiB
JavaScript
|
|
"use strict";(globalThis.__googlesitekit_webpackJsonp=globalThis.__googlesitekit_webpackJsonp||[]).push([[994],{2362:(e,t,i)=>{i.d(t,{A:()=>g});var n=i(4452),o=i.n(n),r=i(62688),s=i.n(r),a=i(63696),l=i(62540);const c=(0,a.forwardRef)(({label:e,className:t,hasLeftSpacing:i=!1,...n},r)=>(0,l.jsx)("span",{ref:r,...n,className:o()("googlesitekit-badge",t,{"googlesitekit-badge--has-left-spacing":i}),children:e}));c.displayName="Badge",c.propTypes={label:s().string.isRequired,hasLeftSpacing:s().bool};const g=c},2522:(e,t,i)=>{i.d(t,{D:()=>r});var n=i(32091),o=i.n(n);function r(e,{dateRangeLength:t}){o()(Array.isArray(e),"report must be an array to partition."),o()(Number.isInteger(t)&&t>0,"dateRangeLength must be a positive integer.");const i=-1*t;return{currentRange:e.slice(i),compareRange:e.slice(2*i,i)}}},3687:(e,t,i)=>{i.d(t,{U:()=>I});var n=i(32091),o=i.n(n),r=i(17243),s=i(21125),a=i(71769),l=i(12850),c=i(50539);function g(e){return e}function u(){return{}}function d(){}const{clearError:p,receiveError:m}=s.o1;function I({baseName:e,controlCallback:t,reducerCallback:i=g,argsToParams:n=u,validateParams:s=d}){let I;o()(e,"baseName is required."),o()("function"==typeof t,"controlCallback is required and must be a function."),o()("function"==typeof i,"reducerCallback must be a function."),o()("function"==typeof n,"argsToParams must be a function."),o()("function"==typeof s,"validateParams must be a function.");try{s(n()),I=!1}catch(e){I=!0}const h=(0,a.m2)(e),y=(0,a.sP)(e),M=`FETCH_${y}`,f=`START_${M}`,N=`FINISH_${M}`,j=`CATCH_${M}`,b=`RECEIVE_${y}`,D=`fetch${h}`,k=`receive${h}`,S=`isFetching${h}`,x={[S]:{}};const v={[D](...t){const i=n(...t);return s(i),function*(t,i){let n,o;yield{payload:{params:t},type:f},yield p(e,i);try{n=yield{payload:{params:t},type:M},yield v[k](n,t),yield{payload:{params:t},type:N}}catch(n){o=n,yield m(o,e,i),yield{payload:{params:t},type:j}}return{response:n,error:o}}(i,t)},[k]:(e,t)=>(o()(void 0!==e,"response is required."),I?(o()((0,r.isPlainObject)(t),"params is required."),s(t)):t={},{payload:{response:e,params:t},type:b})},A={[M]:({payload:e})=>t(e.params)},T=(0,c.createReducer)((e,{type:t,payload:n})=>{switch(t){case f:{const{params:t}=n;return e[S]=e[S]||{},e[S][(0,l.Zm)(t)]=!0,e}case b:{const{response:t,params:o}=n;return i(e,t,o)}case N:{const{params:t}=n;return e[S]=e[S]||{},e[S][(0,l.Zm)(t)]=!1,e}case j:{const{params:t}=n;return e[S]=e[S]||{},e[S][(0,l.Zm)(t)]=!1,e}default:return e}});return{initialState:x,actions:v,controls:A,reducer:T,resolvers:{},selectors:{[S]:(e,...t)=>{if(void 0===e[S])return!1;let i;try{i=n(...t),s(i)}catch(e){return!1}return!!e[S][(0,l.Zm)(i)]}}}}},3714:(e,t,i)=>{i.d(t,{Kk:()=>r,SZ:()=>n,Yw:()=>s,oJ:()=>a,tT:()=>o});const n="body",o=[n,"display","headline","label","title"],r="small",s="medium",a=[r,s,"large"]},3782:(e,t,i)=>{i.d(t,{A:()=>CTAButton});var n=i(62688),o=i.n(n),r=i(49383),s=i(83366),a=i(62540);function CTAButton({label:e,ariaLabel:t,disabled:i,inProgress:n,onClick:o,href:l,external:c=!1,hideExternalIndicator:g=!1}){if(!e||!o&&!l)return null;let u;return c&&!g&&(u=(0,a.jsx)(s.A,{width:14,height:14})),(0,a.jsx)(r.SpinnerButton,{className:"googlesitekit-banner__cta","aria-label":t,disabled:i||n,isSaving:n,onClick:o,href:l,target:c?"_blank":void 0,trailingIcon:u,children:e})}CTAButton.propTypes={label:o().string,ariaLabel:o().string,disabled:o().bool,inProgress:o().bool,onClick:o().func,href:o().string,dismissOnClick:o().bool,dismissOptions:o().shape({expiresInSeconds:o().number,skipHidingFromQueue:o().bool})}},7070:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(63696),o=i(77766),r=i(12850);function s(e,t,{viewAction:i="view_notification",confirmAction:s="confirm_notification",dismissAction:a="dismiss_notification",clickLearnMoreAction:l="click_learn_more_link"}={}){const c=(0,o.A)(),g=null!=t?t:`${c}_${e}`;return{view:(0,n.useCallback)((...e)=>(0,r.sx)(g,i,...e),[g,i]),confirm:(0,n.useCallback)((...e)=>(0,r.sx)(g,s,...e),[g,s]),dismiss:(0,n.useCallback)((...e)=>(0,r.sx)(g,a,...e),[g,a]),clickLearnMore:(0,n.useCallback)((...e)=>(0,r.sx)(g,l,...e),[g,l])}}},7081:(e,t,
|
|||
|
|
(0,f._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 A(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 T(e){M()((0,n.isDate)(e)&&!isNaN(e),N);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 E(e){M()(A(e),j);const[t,i,n]=e.split("-");return new Date(t,i-1,n)}function _(e,t){return T(w(e,t*S))}function C(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 w(e,t){M()(A(e)||(0,n.isDate)(e)&&!isNaN(e),j);const i=A(e)?Date.parse(e):e.getTime();return new Date(i-1e3*t)}var O=i(69743),z=i(94552),L=i(62540);function R(e,t={}){if(Number.isNaN(Number(e)))return"";const{invertColor:i=!1}=t;return(0,O.Ay)((0,L.jsx)(z.A,{direction:e>0?"up":"down",invertColor:i}))}function P(e,t){return e>0&&t>0?e/t-1:e>0?1:t>0?-1:0}var G=i(8143);function B(e){const t=parseFloat(e)||0;return!!Number.isInteger(t)&&t>0}function U(e){if("number"==typeof e)return!0;const t=(e||"").toString();return!!t&&!isNaN(t)}function Z(e){return Array.isArray(e)?[...e].sort():e}var Q=i(2522);function F(e,t){function i(e){return"0"===e||0===e}if(i(e)&&i(t))return 0;if(i(e)||Number.isNaN(e))return null;const n=(t-e)/e;return Number.isNaN(n)||!Number.isFinite(n)?null:n}function Y(e){try{return JSON.parse(e)&&!!e}catch(e){return!1}}function H(e){if(!e)return"";const t=e.replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(t)).replace(/(\\)/g,"");return(0,n.unescape)(t)}},13620:e=>{e.exports=googlesitekit.modules},14007:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(47209),o=i(62688),r=i.n(o),s=i(63696),a=i(78325);function Portal({children:e,slug:t}){const[i]=(0,s.useState)(document.createElement("div"));return(0,n.A)(()=>{t&&i.classList.add(`googlesitekit-portal-${t}`);const e=document.querySelector(".googlesitekit-plugin")||document.body;return e.appendChild(i),()=>e.removeChild(i)}),(0,a.createPortal)(e,i)}Portal.propTypes={slug:r().string,children:r().node},Portal.defaultProps={slug:"",children:null};const l=Portal},15167:(e,t,i)=>{i.d(t,{A:()=>Typography});var n=i(62688),o=i.n(n),r=i(4452),s=i.n(r),a=i(3714),l=i(62540);function Typography({className:e,type:t,size:i,as:n="span",children:o,...r}){return(0,l.jsx)(n,{className:s()("googlesitekit-typography",e,{[`googlesitekit-typography--${t}`]:t&&a.tT.includes(t),[`googlesitekit-typography--${i}`]:i&&a.oJ.includes(i)}),...r,children:o})}Typography.propTypes={className:o().string,type:o().oneOf(a.tT),size:o().oneOf(a.oJ),as:o().oneOfType([o().string,o().elementType])}},15210:(e,t,i)=>{i.d(t,{O:()=>o});var n=i(31234);const o=i.n(n)()(i.g)},15577:(e,t,i)=>{i.d(t,{SO:()=>c});var n=i(55620),o=i(99123);const r={},s=void 0===i.g?null:i.g;function a(){return[i.g.innerWidth,i.g.innerHeight]}function l(e=r){const{fps:t,leading:i,initialWidth:l=0,initialHeight:c=0}=e,[g,u]=(0,n._)("undefined"==typeof document?[l,c]:a,t,i);function d(){return u(a)}return(0,o.A)(s,"resize",d),(0,o.A)(s,"orientationchange",d),g}function c(e){return l(e)[0]}},15863:(e,t,i)=>{i.d(t,{i:()=>s});var n=i(63696),o=i(50539),r=i(7081);function s(e){const{setValue:t}=(0,o.useDispatch)(r.n);return(0,n.useCallback)(()=>{t("admin-screen-tooltip",{isTooltipVisible:!0,...e})},[t,e])}},17691:(e,t,i)=>{i.d(t,{A:()=>s,G:()=>r});var n=i(62688),o=i.n(n);const r=" ";function DisplaySetting({value:e}){return e||r}DisplaySetting.propTypes={value:o().oneOfType([o().string,o().bool,o().number])};const s=DisplaySetting},17911:(e,t,i)=>{var n=i(50539),o=i.n(n),r=i(13620),s=i.n(r),a=i(46935),l=i.n(a),c=i(82871),g=i(82286),u=i(93896);const d="modules/reader-revenue-manager",p={ONBOARDING_COMPLETE:"ONBOARDING_COMPLETE",ONBOARDING_ACTION_REQUIRED:"ONBOARDING_ACTION_REQUIRED",PENDING_VERIFICATION:"PENDI
|
|||
|
|
(0,c.__)("%1$s (%2$s)","google-site-kit"),t,e)},e))})}PublicationSelect.propTypes={isDisabled:N().bool,hasModuleAccess:N().bool,className:N().string,onChange:N().func};const Z=(0,j.createContext)({}),{Consumer:Q,Provider:F}=Z,Y=Z;function ChipMultiSelect({children:e,onToggleChip:t=()=>{}}){return(0,C.jsx)(F,{value:{onToggleChip:t},children:(0,C.jsx)("div",{className:"googlesitekit-chip-multi-select",children:e})})}ChipMultiSelect.propTypes={children:N().node.isRequired,onToggleChip:N().func};var H=i(17243),W=i(80452);function ChipCheckmark(){return(0,C.jsx)("div",{className:"mdc-chip__checkmark",children:(0,C.jsx)(W.A,{className:"mdc-chip__checkmark-svg"})})}function ChipMultiSelectItem({children:e,id:t,selected:i,...n}){const{onToggleChip:o}=(0,j.useContext)(Y);return(0,C.jsx)(b.Chip,{className:"googlesitekit-chip-multi-select__item",CheckMark:ChipCheckmark,onClick:()=>{o(t,!i)},id:t,label:e,selected:i,...n})}function PostTypesSelect(e){const{isDisabled:t,hasModuleAccess:i,onChange:o=()=>{}}=e,r=(0,n.useSelect)(e=>e(u.O4).getPostTypes()),s=(0,n.useSelect)(e=>e(d).getPostTypes()),{setPostTypes:a}=(0,n.useDispatch)(d),l=(0,j.useCallback)(e=>{const t=s.includes(e)?s.filter(t=>t!==e):[...s,e];a(t),o(t)},[o,s,a]);return(0,C.jsx)(ChipMultiSelect,{onToggleChip:l,children:r.map(({slug:e,label:n})=>(0,C.jsx)(ChipMultiSelectItem,{id:e,selected:s.includes(e),disabled:t||!i,children:n},e))})}function V(e,t){if(!Array.isArray(e)||0===e.length)return"";if(!Array.isArray(t)||0===t.length)return e.join(", ");const i=t.filter(t=>e.includes(t.slug));return i.length===t.length?(0,c.__)("All post types","google-site-kit"):i.map(e=>e.label).join(", ")}function J(e){if(!e)return"";const t=e.indexOf(":");return-1===t?e:e.substring(t+1)}function ProductIDSelect(e){const{isDisabled:t,hasModuleAccess:i,showHelperText:o=!0,className:r,onChange:s=()=>{}}=e,a=(0,n.useSelect)(e=>e(d).getProductID()),l=(0,n.useSelect)(e=>e(d).getCurrentProductIDs()),{setProductID:g}=(0,n.useDispatch)(d),u=(0,j.useCallback)((e,t)=>{const i=t.dataset.value;g(i),s(i)},[g,s]);return!1===i?(0,C.jsx)(b.Select,{className:r,label:(0,c.__)("Default Product ID","google-site-kit"),value:a,enhanced:!0,outlined:!0,disabled:!0,children:(0,C.jsx)(b.Option,{value:a,children:a})}):(0,C.jsxs)(b.Select,{className:r,label:(0,c.__)("Default Product ID","google-site-kit"),value:a,onEnhancedChange:u,disabled:t,helperText:o?(0,z.A)((0,c.__)("Product IDs offer a way to link content to payment plans. <a>Learn more</a>","google-site-kit"),{a:(0,C.jsx)(D.A,{"aria-label":(0,c.__)("Learn more about product IDs","google-site-kit"),href:"https://support.google.com/news/publisher-center/answer/12345540",external:!0,hideExternalIndicator:!0})}):void 0,enhanced:!0,outlined:!0,children:[(0,C.jsx)(b.Option,{value:"openaccess",children:(0,c.__)("Open access","google-site-kit")},"openaccess"),(l||[]).map(e=>(0,C.jsx)(b.Option,{value:e,children:J(e)},e))]})}function SnippetModeSelect(e){const{isDisabled:t,hasModuleAccess:i,className:o,onChange:r=()=>{}}=e,s=(0,n.useSelect)(e=>e(d).getSnippetMode()),a=(0,n.useSelect)(e=>e(u.O4).getDocumentationLinkURL("rrm-content-settings")),{setSnippetMode:l}=(0,n.useDispatch)(d),g=(0,j.useCallback)((e,t)=>{const i=t.dataset.value;l(i),r(i)},[l,r]);return!1===i?(0,C.jsx)(b.Select,{className:o,label:(0,c.__)("Display CTAs","google-site-kit"),value:s,enhanced:!0,outlined:!0,disabled:!0,children:(0,C.jsx)(b.Option,{value:s,children:x.z9[s]})}):(0,C.jsx)(b.Select,{className:o,label:(0,c.__)("Display CTAs","google-site-kit"),value:s,onEnhancedChange:g,disabled:t,helperText:(0,z.A)((0,c.__)("Use the new settings in the block editor to customize where your CTAs appear. <a>Learn more</a>","google-site-kit"),{a:(0,C.jsx)(D.A,{"aria-label":(0,c.__)("Learn more about Reader Revenue Manager settings in the block editor","google-site-kit"),href:a,external:!0,hideExternalIndicator:!0})}),enhanced:!0,outlined:!0,children:Object.keys(x.z9).map(e=>(0,C.jsx)(b.Option,{value:e,children:x.z9[e]},e))})}function SetupForm({onCompleteSetup:e}){const t=(0,n.useSelect)(e=>e(d).canSubmitChanges()
|
|||
|
|
(0,c.__)("The previously selected publication with ID %s was not found. Please select a new publication.","google-site-kit"),t),skipRetryMessage:!0}),e&&s&&r&&(0,C.jsx)(le.A,{message:(0,c.sprintf)(/* translators: 1: Product ID. */ /* translators: 1: Product ID. */
|
|||
|
|
(0,c.__)("The previously selected product ID %s was not found. Please select a new product ID.","google-site-kit"),J(r)),skipRetryMessage:!0}),(0,C.jsx)("div",{className:"googlesitekit-setup-module__inputs",children:(0,C.jsx)(PublicationSelect,{hasModuleAccess:e})}),e&&s&&(0,C.jsx)(PublicationOnboardingStateNotice,{}),!e&&(0,C.jsx)(E.A,{className:"googlesitekit-notice--bottom-margin",type:E.A.TYPES.WARNING,description:(0,z.A)((0,c.sprintf)(/* translators: %s: module owner's name */ /* translators: %s: module owner's name */
|
|||
|
|
(0,c.__)("%s configured Reader Revenue Manager and you don’t have access to its configured publication. Contact them to share access or change the configured publication.","google-site-kit"),a),{strong:(0,C.jsx)("strong",{})})}),l&&i?.length>0&&(0,C.jsx)(ProductIDSettings,{hasModuleAccess:e})]}),(0,C.jsxs)("div",{className:"googlesitekit-settings-module__fields-group",children:[(0,C.jsx)(P.A,{as:"h4",size:"small",type:"title",className:"googlesitekit-settings-module__fields-group-title",children:(0,c.__)("CTA Placement","google-site-kit")}),(0,C.jsx)("div",{className:"googlesitekit-rrm-settings-edit__snippet-mode",children:(0,C.jsx)(SnippetModeSelect,{hasModuleAccess:e})}),"post_types"===o&&(0,C.jsxs)("div",{className:"googlesitekit-rrm-settings-edit__post-types",children:[(0,C.jsx)(P.A,{as:"h5",size:"small",type:"label",children:(0,c.__)("Select the content types where you want your CTAs to appear:","google-site-kit")}),(0,C.jsx)(PostTypesSelect,{hasModuleAccess:e})]})]})]})}function SettingsEdit(){const e=(0,A.A)(),t=(0,n.useSelect)(e=>e(d).isDoingSubmitChanges()),i=(0,n.useSelect)(e=>{const{hasModuleOwnershipOrAccess:t,getErrorForAction:i}=e(ae.i),n=t(x.K$);if(n)return!0;const o=i("checkModuleAccess",[x.K$]);return void 0!==n||o?!1!==n&&"module_not_connected"===o?.code:void 0}),o=(0,n.useSelect)(e=>e(d).haveSettingsChanged()),r=(0,n.useSelect)(e=>e(u.O4).getPostTypes()),s=(0,n.useSelect)(e=>e(d).getSettings()),{snippetMode:a,postTypes:l}=s||{},[c,g]=(0,j.useState)(s);return(0,j.useEffect)(()=>{!c&&s&&g(s)},[c,s]),(0,se.A)(()=>{o||(a!==c.snippetMode&&(0,v.sx)(`${e}_rrm-settings`,"change_snippet_mode",x.z9[a]),V(l)!==V(c.postTypes)&&(0,v.sx)(`${e}_rrm-settings`,"change_post_types",V(l,r)))}),t||void 0===i?(0,C.jsx)(b.ProgressBar,{}):(0,C.jsx)("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--reader-revenue-manager googlesitekit-rrm-settings-edit",children:(0,C.jsx)(SettingsForm,{hasModuleAccess:i})})}var ce=i(17691);function SettingsView(){const e=(0,n.useSelect)(e=>e(d).getPublicationID()),t=(0,n.useSelect)(e=>{const t=e(d).getProductID();return"openaccess"===t?(0,c.__)("Open access","google-site-kit"):J(t)}),i=(0,n.useSelect)(e=>e(d).getSnippetMode()),o=(0,n.useSelect)(e=>{const t=e(u.O4).getPostTypes();return V(e(d).getPostTypes(),t)}),r=(0,n.useSelect)(e=>{const{hasModuleOwnershipOrAccess:t,getErrorForAction:i}=e(ae.i),n=t(x.K$);if(n)return!0;const o=i("checkModuleAccess",[x.K$]);return void 0!==n||o?!1!==n&&"module_not_connected"===o?.code:void 0});return(0,C.jsxs)("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--reader-revenue-manager",children:[(0,C.jsxs)("div",{className:"googlesitekit-settings-module__meta-items",children:[(0,C.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,C.jsx)(P.A,{as:"h5",size:"medium",type:"label",className:"googlesitekit-settings-module__meta-item-type",children:(0,c.__)("Publication","google-site-kit")}),(0,C.jsx)("p",{className:"googlesitekit-settings-module__meta-item-data",children:(0,C.jsx)(ce.A,{value:e})})]}),(0,C.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,C.jsx)(P.A,{as:"h5",size:"medium",type:"label",className:"googlesitekit-settings-module__meta-item-type",children:(0,c.__)("Default Product ID","google-site-kit")}),(0,C.jsx)("p",{className:"googlesitekit-settings-module__meta-item-data",children:(0,C.jsx)(ce.A,{value:t})})]})]}),r&&(0,C.jsx)(PublicationOnboardingStateNotice,{}),(0,C.jsxs)("div",{className:"googlesitekit-settings-module__meta-items",children:[(0,C.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,C.jsx)(P.A,{as:"h5",size:"medium",type:"label",className:"googlesitekit-settings-module__meta-item-type",children:(0,c.__)("Display CTAs","google-site-kit")}),(0,C.jsx)("p",{className:"googlesitekit-settings-module__meta-item-data",children:(0,C.jsx)(ce.A,{value:x.z9[i]||i})})]}),"post_types"===i&&(0,C.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,C.jsx)(P.A,{as:"h5",size:"medium",type:"label"
|
|||
|
|
(0,n.__)("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"),s)),a&&a.login&&(c=(0,n.sprintf)(/* translators: %s: owner name */ /* translators: %s: owner name */
|
|||
|
|
(0,n.__)('This service was originally connected by the administrator "%s" — you can contact them for more information.',"google-site-kit"),a.login)),c||(c=(0,n.__)("This service was originally connected by an administrator — you can contact them for more information.","google-site-kit")),`${l} ${c}`}},67150:(e,t,i)=>{i.d(t,{G:()=>c,HY:()=>u,SG:()=>g,db:()=>o,e4:()=>p,vl:()=>d});i(17243);var n=i(82871);const o="missing_required_scopes",r="insufficientPermissions",s="forbidden",a="internal_server_error",l="invalid_json";function c(e){return e?.code===o}function g(e){return[r,s].includes(e?.data?.reason)}function u(e){return!!e?.data?.reconnectURL}function d(e,t){return!(!t?.storeName||g(e)||c(e)||u(e))}function p(e){return e?.code===a?(0,n.__)("There was a critical error on this website while fetching data","google-site-kit"):e?.code===l?(0,n.__)("The server provided an invalid response","google-site-kit"):e?.message}},68485:(e,t,i)=>{i.d(t,{r:()=>AdminScreenTooltip,i:()=>n.i});var n=i(15863),o=i(63696),r=i(50539),s=i(62688),a=i(36703),l=i(40960),c=i(60592),g=i(14007),u=i(39771),d=i(32947),p=i(62540);function JoyrideTooltip(e){const{title:t,content:n,dismissLabel:r,disableOverlay:s=!0,target:m,cta:I=!1,className:h,styles:y={},slug:M="",placement:f="auto",onDismiss:N=()=>{},onView:j=()=>{},onTourStart:b=()=>{},onTourEnd:D=()=>{}}=e;function k(){return!!i.g.document.querySelector(m)}const[S,x]=(0,o.useState)(k),v=(0,d.dv)(),A=v===d.mp||v===d.Lg,[T,E]=(0,o.useState)(!0),_=(0,o.useRef)(A);if((0,l.A)(()=>{k()&&x(!0)},S?null:250),(0,o.useEffect)(()=>{let e=()=>{};if("function"==typeof i.g.ResizeObserver){const t=i.g.document.querySelector(m);if(t){const n=new ResizeObserver(()=>{i.g.dispatchEvent(new Event("resize"))});n.observe(t),e=()=>n.disconnect()}}return e},[m,S]),(0,o.useEffect)(()=>{let e;return _.current!==A&&(E(!1),e=setTimeout(()=>{E(!0)},50),_.current=A),()=>{e&&clearTimeout(e)}},[A]),!S)return null;const C=[{title:t,target:m,content:n,disableBeacon:!0,isFixed:!0,placement:f,cta:I,className:h}],w={close:r,last:r};return(0,p.jsx)(g.A,{slug:M,children:(0,p.jsx)(a.Ay,{callback:function({type:e}){switch(e){case a.qY.TOUR_START:b(),i.g.document.body.classList.add("googlesitekit-showing-tooltip");break;case a.qY.TOUR_END:D(),i.g.document.body.classList.remove("googlesitekit-showing-tooltip");break;case a.qY.STEP_AFTER:N();break;case a.qY.TOOLTIP:j()}},disableOverlay:s,spotlightPadding:0,floaterProps:u.ei,locale:w,steps:C,styles:{...u.R0,...y,options:{...u.R0.options,...y?.options},spotlight:{...u.R0.spotlight,...y?.spotlight}},tooltipComponent:c.A,run:T,disableScrolling:!0})})}JoyrideTooltip.propTypes={title:s.PropTypes.node,content:s.PropTypes.string,disableOverlay:s.PropTypes.bool,dismissLabel:s.PropTypes.string,target:s.PropTypes.string.isRequired,onDismiss:s.PropTypes.func,onShow:s.PropTypes.func,className:s.PropTypes.string,styles:s.PropTypes.object,slug:s.PropTypes.string,placement:s.PropTypes.string,onView:s.PropTypes.func};var m=i(7081),I=i(12850),h=i(77766);function AdminScreenTooltip(){const e=(0,h.A)(),{setValue:t}=(0,r.useDispatch)(m.n),i=(0,d.dv)(),{isTooltipVisible:n=!1,target:s,placement:a,className:l,tooltipSlug:c,title:g,content:u,dismissLabel:y}=(0,r.useSelect)(e=>e(m.n).getValue("admin-screen-tooltip")||{isTooltipVisible:!1});const M=(0,o.useCallback)(()=>{c&&(0,I.sx)(`${e}_${c}`,"tooltip_dismiss"),t("admin-screen-tooltip",void 0)},[t,c,e]);if(!n)return null;const f=i===d.mp||i===d.Lg,N=null!=s?s:'#adminmenu [href*="page=googlesitekit-settings"]',j=null!=a?a:"right";return(0,p.jsx)(JoyrideTooltip,{target:f?"body":N,placement:f?"center":j,className:f?"googlesitekit-tour-tooltip__modal_step":l||(s?void 0:"googlesitekit-tour-tooltip__fixed-settings-tooltip"),disableOverlay:!f,slug:"admin-screen-tooltip",title:g,content:u,dismissLabel:y,onView:function(){(0,I.sx)(`${e}_${c}`,"tooltip_view")},onDismiss:M})}},71423:(e,t,i)=>{i.d(t,{$:()=>r,D:()=>o});var n=i(24558);const o="core/notifications",r=[n.uR,n.jU,n.f7,n.Ax,n.Is]},71769:(e,t,i)=>{function n(e){return e.charAt(0).toUpperCase()+e.slice(1)}function o
|
|||
|
|
(0,s.__)("%s (Please try again.)","google-site-kit"),N)),p||(N=(0,s.sprintf)(/* translators: $%s: Error message */ /* translators: $%s: Error message */
|
|||
|
|
(0,s.__)("Error: %s","google-site-kit"),N));const j=t?.data?.reconnectURL;j&&(0,a.m)(j)&&(N=(0,s.sprintf)(/* translators: 1: Original error message 2: Reconnect URL */ /* translators: 1: Original error message 2: Reconnect URL */
|
|||
|
|
(0,s.__)('%1$s To fix this, <a href="%2$s">redo the plugin setup</a>.',"google-site-kit"),N,j));return(0,d.jsx)(g.A,{className:e,type:g.A.TYPES.ERROR,description:(0,d.jsx)("span",{dangerouslySetInnerHTML:(0,u.p9)(N,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href"]})}),ctaButton:f?{label:(0,s.__)("Retry","google-site-kit"),onClick:M}:void 0,hideIcon:I})}ErrorNotice.propTypes={className:o().string,error:o().shape({message:o().string}),hasButton:o().bool,storeName:o().string,message:o().string,noPrefix:o().bool,skipRetryMessage:o().bool,hideIcon:o().bool}},78340:(e,t,i)=>{i.d(t,{s:()=>n});const n="core/forms"},79829:(e,t,i)=>{i.d(t,{Eo:()=>u,JK:()=>I,K5:()=>m,jq:()=>p,mK:()=>g});var n=i(17243),o=i(50532),r=i.n(o),s=i(82871);function a(e,t={}){const{formatUnit:i,formatDecimal:n}=function(e,t={}){const{hours:i,minutes:n,seconds:o}=l(e);return{hours:i,minutes:n,seconds:o,formatUnit(){const{unitDisplay:r="short",...a}=t,l={unitDisplay:r,...a,style:"unit"};return 0===e?p(o,{...l,unit:"second"}):(0,s.sprintf)(/* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */ /* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */
|
|||
|
|
(0,s._x)("%3$s %2$s %1$s","duration of time: hh mm ss","google-site-kit"),o?p(o,{...l,unit:"second"}):"",n?p(n,{...l,unit:"minute"}):"",i?p(i,{...l,unit:"hour"}):"").trim()},formatDecimal(){const t=(0,s.sprintf)(
|
|||
|
|
// translators: %s: number of seconds with "s" as the abbreviated unit.
|
|||
|
|
// translators: %s: number of seconds with "s" as the abbreviated unit.
|
|||
|
|
(0,s.__)("%ds","google-site-kit"),o);if(0===e)return t;const r=(0,s.sprintf)(
|
|||
|
|
// translators: %s: number of minutes with "m" as the abbreviated unit.
|
|||
|
|
// translators: %s: number of minutes with "m" as the abbreviated unit.
|
|||
|
|
(0,s.__)("%dm","google-site-kit"),n),a=(0,s.sprintf)(
|
|||
|
|
// translators: %s: number of hours with "h" as the abbreviated unit.
|
|||
|
|
// translators: %s: number of hours with "h" as the abbreviated unit.
|
|||
|
|
(0,s.__)("%dh","google-site-kit"),i);return(0,s.sprintf)(/* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */ /* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */
|
|||
|
|
(0,s._x)("%3$s %2$s %1$s","duration of time: hh mm ss","google-site-kit"),o?t:"",n?r:"",i?a:"").trim()}}}(e,t);try{return i()}catch{return n()}}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,n.isPlainObject)(e)&&(t={...e}),t}function u(e,t={}){e=(0,n.isFinite)(e)?e:Number(e),(0,n.isFinite)(e)||(console.warn("Invalid number",e,typeof e),e=0);const i=g(t),{style:o="metric"}=i;return"metric"===o?function(e){const t={minimumFractionDigits:1,maximumFractionDigits:1};return 1e6<=e?(0,s.sprintf)(
|
|||
|
|
// translators: %s: an abbreviated number in millions.
|
|||
|
|
// translators: %s: an abbreviated number in millions.
|
|||
|
|
(0,s.__)("%sM","google-site-kit"),p(c(e),e%10==0?{}:t)):1e4<=e?(0,s.sprintf)(
|
|||
|
|
// translators: %s: an abbreviated number in thousands.
|
|||
|
|
// translators: %s: an abbreviated number in thousands.
|
|||
|
|
(0,s.__)("%sK","google-site-kit"),p(c(e))):1e3<=e?(0,s.sprintf)(
|
|||
|
|
// translators: %s: an abbreviated number in thousands.
|
|||
|
|
// translators: %s: an abbreviated number in thousands.
|
|||
|
|
(0,s.__)("%sK","google-site-kit"),p(c(e),e%10==0?{}:t)):p(e,{signDisplay:"never",maximumFractionDigits:1})}(e):"duration"===o?a(e,i):"durationISO"===o?function(e){let{hours:t,minutes:i,seconds:n}=l(e);return n=("0"+n).slice(-2),i=("0"+i).slice(-2),t=("0"+t).slice(-2),"00"===t?`${i}:${n}`:`${t}:${i}:${n}`}(e):p(e,i)}const d=r()(console.warn);function p(e,t={}){const{locale:i=I(),...n}=t;try{return new Intl.NumberFormat(i,n).format(e)}catch(t){d(`Site Kit numberFormat error: Intl.NumberFormat( ${JSON.stringify(i)}, ${JSON.stringify(n)} ).format( ${typeof e} )`,t.message)}const o={currencyDisplay:"narrow",currencySign:"accounting",style:"unit"},r=["signDisplay","compactDisplay"],s={};for(const[e,t]of Object.entries(n))o[e]&&t===o[e]||r.includes(e)||(s[e]=t);try{return new Intl.NumberFormat(i,s).format(e)}catch{return new Intl.NumberFormat(i).format(e)}}function m(e,t={}){const{locale:i=I(),style:n="long",type:o="conjunction"}=t;if(Intl.ListFormat){return new Intl.ListFormat(i,{style:n,type:o}).format(e)}
|
|||
|
|
/* translators: used between list items, there is a space after the comma. */const r=(0,s.__)(", ","google-site-kit");return e.join(r)}function I(e=i.g){const t=(0,n.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}},80035:(e,t,i)=>{i.d(t,{A:()=>f});var n,o=i(62688),r=i.n(o),s=i(4452),a=i.n(s),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 n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}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),n||(n=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 u=i(42343),d=i(49655),p=i(62540);const m={[d.Q.NEW]:u.A,[d.Q.SUCCESS]:c.A,[d.Q.INFO]:warning_notice,[d.Q.WARNING]:warning_notice,[d.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:r().oneOf(Object.values(d.Q))},Title.propTypes={className:r().string,children:r().node},Description.propTypes={className:r().string,children:r().node};var I=i(49383),h=i(83366);function CTAButton({label:e,disabled:t,inProgress:i,onClick:n,href:o,external:r=!1,hideExternalIndicator:s=!1}){let a;return r&&!s&&(a=(0,p.jsx)(h.A,{width:14,height:14})),(0,p.jsx)(I.SpinnerButton,{className:"googlesitekit-notice__cta",disabled:t,isSaving:i,onClick:n,href:o,target:r?"_blank":void 0,trailingIcon:a,children:e})}CTAButton.propTypes={label:r().string.isRequired,disabled:r().bool,inProgress:r().bool,onClick:r().func,href:r().string,external:r().bool,hideExternalIndicator:r().bool};var y=i(82871);function DismissButton({label:e=(0,y.__)("Got it","google-site-kit"),onClick:t,disabled:i}){return(0,p.jsx)(I.Button,{onClick:t,disabled:i,tertiary:!0,children:e})}DismissButton.propTypes={label:r().string,onClick:r().func.isRequired,disabled:r().bool};const M=(0,l.forwardRef)(({className:e,title:t,description:i,dismissButton:n,ctaButton:o,type:r=d.Q.INFO,children:s,hideIcon:l},c)=>(0,p.jsxs)("div",{ref:c,className:a()("googlesitekit-notice",`googlesitekit-notice--${r}`,e),children:[!l&&(0,p.jsx)("div",{className:"googlesitekit-notice__icon",children:(0,p.jsx)(Icon,{type:r})}),(0,p.jsxs)("div",{className:"googlesitekit-notice__content",children:[t&&(0,p.jsx)(Title,{children:t}),i&&(0,p.jsx)(Description,{children:i})]}),(n?.label||n?.onClick||o?.label&&(o?.onClick||o?.href)||s)&&(0,p.jsxs)("div",{className:"googlesitekit-notice__action",children:[s,(n?.label||n?.onClick)&&(0,p.jsx)(DismissButton,{label:n.label,onClick:n.onClick,disabled:n.disabled}),o?.label&&(o?.onClick||o?.href)&&(0,p.jsx)(CTAButton,{label:o.label,onClick:o.onClick,inProgress:o.inProgress,disabled:o.disabled,href:o.href,external:o.external,hideExternalIndicator:o.hideExternalIndicator})]})]}));M.TYPES=d.Q,M.propTypes={className:r().string,title:r().oneOfType([r().string,r().object]),description:r().node,type:r().oneOf(Object.values(d.Q)),dismissButton:r().shape(DismissButton.propTypes),ctaButton:r().shape({...CTAButton.propTypes,label:r().string}),children:r().node,hideIcon:r().bool};const f=M},80452:(e,t,i)=>{i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var n,o=i(63696);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},r.apply(null,arguments)}const __WEBPACK_DEFAULT_EXPORT__=e=>o.createElement("svg",r({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 12 9"},e),n||(n=o.createE
|