Site Kit by Google - Version 1.2.0

Version Description

Download this release

Release Info

Developer flixos90
Plugin Icon 128x128 Site Kit by Google
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.1.4 to 1.2.0

Files changed (73) hide show
  1. dist/assets/js/ads.js +1 -1
  2. dist/assets/js/allmodules.js +7 -6
  3. dist/assets/js/chunk-googlesitekit-adminbar.js +1 -1
  4. dist/assets/js/chunk-googlesitekit-setup-wizard-proxy.js +2 -2
  5. dist/assets/js/chunk-googlesitekit-setup-wizard.js +2 -2
  6. dist/assets/js/chunk-googlesitekit-setup-wrapper.js +1 -1
  7. dist/assets/js/commons.js +1 -1
  8. dist/assets/js/googlesitekit-activation.js +1 -0
  9. dist/assets/js/googlesitekit-admin.js +1 -1
  10. dist/assets/js/googlesitekit-adminbar-loader.js +1 -1
  11. dist/assets/js/googlesitekit-api.js +1 -0
  12. dist/assets/js/googlesitekit-dashboard-details.js +1 -1
  13. dist/assets/js/googlesitekit-dashboard-splash.js +1 -1
  14. dist/assets/js/googlesitekit-dashboard.js +1 -1
  15. dist/assets/js/googlesitekit-module.js +1 -1
  16. dist/assets/js/googlesitekit-settings.js +1 -1
  17. dist/assets/js/googlesitekit-tests.js +14 -14
  18. dist/assets/js/googlesitekit-wp-dashboard.js +1 -1
  19. dist/assets/js/vendor.js +1 -1
  20. google-site-kit.php +2 -2
  21. includes/Core/Assets/Asset.php +23 -12
  22. includes/Core/Assets/Assets.php +193 -70
  23. includes/Core/Assets/Script.php +7 -26
  24. includes/Core/Assets/Stylesheet.php +6 -25
  25. includes/Core/Authentication/Authentication.php +41 -4
  26. includes/Core/Authentication/Clients/{Google_Proxy_Client.php → Google_Site_Kit_Client.php} +102 -117
  27. includes/Core/Authentication/Clients/Google_Site_Kit_Proxy_Client.php +146 -0
  28. includes/Core/Authentication/Clients/OAuth_Client.php +149 -75
  29. includes/Core/Authentication/Credentials.php +18 -39
  30. includes/Core/Authentication/Exception/Google_OAuth_Exception.php +24 -0
  31. includes/Core/Authentication/{Clients/Google_Proxy_Exception.php → Exception/Google_Proxy_Code_Exception.php} +4 -3
  32. includes/Core/Modules/Module.php +43 -20
  33. includes/Core/Modules/Module_Settings.php +75 -0
  34. includes/Core/Modules/Module_With_Settings.php +23 -0
  35. includes/Core/Modules/Module_With_Settings_Trait.php +54 -0
  36. includes/Core/Modules/Modules.php +15 -19
  37. includes/Core/REST_API/REST_Routes.php +47 -5
  38. includes/Core/Storage/Encrypted_Options.php +1 -1
  39. includes/Core/Storage/Options.php +3 -4
  40. includes/Core/Storage/Options_Interface.php +52 -0
  41. includes/Core/Storage/Setting.php +153 -0
  42. includes/Core/Storage/Setting_With_Legacy_Keys_Trait.php +44 -0
  43. includes/Core/Util/Activation.php +20 -154
  44. includes/Core/Util/Debug_Bar.php +0 -63
  45. includes/Core/Util/Migrate_Legacy_Keys.php +41 -0
  46. includes/Core/Util/Tracking.php +6 -0
  47. includes/Modules/AdSense.php +248 -353
  48. includes/Modules/AdSense/Settings.php +85 -0
  49. includes/Modules/Analytics.php +544 -695
  50. includes/Modules/Analytics/Settings.php +120 -0
  51. includes/Modules/Optimize.php +92 -125
  52. includes/Modules/Optimize/Settings.php +59 -0
  53. includes/Modules/PageSpeed_Insights.php +53 -63
  54. includes/Modules/Search_Console.php +98 -110
  55. includes/Modules/Site_Verification.php +131 -145
  56. includes/Modules/Tag_Manager.php +310 -265
  57. includes/Modules/Tag_Manager/Settings.php +61 -0
  58. includes/Plugin.php +0 -10
  59. includes/vendor/composer/autoload_classmap.php +15 -3
  60. readme.txt +1 -1
  61. third-party/google/apiclient/src/Google/Http/REST.php +1 -1
  62. third-party/guzzlehttp/guzzle/src/Cookie/SetCookie.php +1 -1
  63. third-party/guzzlehttp/psr7/src/ServerRequest.php +1 -1
  64. third-party/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +3 -0
  65. third-party/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php +1 -1
  66. third-party/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php +1 -1
  67. third-party/monolog/monolog/src/Monolog/Handler/AmqpHandler.php +4 -4
  68. third-party/monolog/monolog/src/Monolog/Handler/FilterHandler.php +3 -1
  69. third-party/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php +1 -1
  70. third-party/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +6 -6
  71. third-party/monolog/monolog/src/Monolog/Handler/RedisHandler.php +4 -3
  72. third-party/monolog/monolog/src/Monolog/Logger.php +7 -2
  73. third-party/monolog/monolog/src/Monolog/SignalHandler.php +11 -11
dist/assets/js/ads.js CHANGED
@@ -1 +1 @@
1
- !function(e){var _={};function __webpack_require__(r){if(_[r])return _[r].exports;var t=_[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,__webpack_require__),t.l=!0,t.exports}__webpack_require__.m=e,__webpack_require__.c=_,__webpack_require__.d=function(e,_,r){__webpack_require__.o(e,_)||Object.defineProperty(e,_,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,_){if(1&_&&(e=__webpack_require__(e)),8&_)return e;if(4&_&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&_&&"string"!=typeof e)for(var t in e)__webpack_require__.d(r,t,function(_){return e[_]}.bind(null,t));return r},__webpack_require__.n=function(e){var _=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(_,"a",_),_},__webpack_require__.o=function(e,_){return Object.prototype.hasOwnProperty.call(e,_)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=186)}({186:function(e,_){window.googlesitekit=window.googlesitekit||{},googlesitekit.canAdsRun=!0}});
1
+ !function(e){var _={};function __webpack_require__(r){if(_[r])return _[r].exports;var t=_[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,__webpack_require__),t.l=!0,t.exports}__webpack_require__.m=e,__webpack_require__.c=_,__webpack_require__.d=function(e,_,r){__webpack_require__.o(e,_)||Object.defineProperty(e,_,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,_){if(1&_&&(e=__webpack_require__(e)),8&_)return e;if(4&_&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&_&&"string"!=typeof e)for(var t in e)__webpack_require__.d(r,t,function(_){return e[_]}.bind(null,t));return r},__webpack_require__.n=function(e){var _=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(_,"a",_),_},__webpack_require__.o=function(e,_){return Object.prototype.hasOwnProperty.call(e,_)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=196)}({196:function(e,_){window.googlesitekit=window.googlesitekit||{},window.googlesitekit.canAdsRun=!0,document.addEventListener("DOMContentLoaded",(function(){window.googlesitekit.canAdsRun=!0}))}});
dist/assets/js/allmodules.js CHANGED
@@ -1,11 +1,12 @@
1
- !function(e){function t(t){for(var n,c,s=t[0],r=t[1],d=t[2],u=0,g=[];u<s.length;u++)c=s[u],i[c]&&g.push(i[c][0]),i[c]=0;for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);for(l&&l(t);g.length;)g.shift()();return o.push.apply(o,d||[]),a()}function a(){for(var e,t=0;t<o.length;t++){for(var a=o[t],n=!0,c=1;c<a.length;c++){var s=a[c];0!==i[s]&&(n=!1)}n&&(o.splice(t--,1),e=__webpack_require__(__webpack_require__.s=a[0]))}return e}var n={},i={3:0},o=[];function __webpack_require__(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,__webpack_require__),a.l=!0,a.exports}__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,a){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(__webpack_require__.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(a,n,function(t){return e[t]}.bind(null,n));return a},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="";var c=window.webpackJsonp=window.webpackJsonp||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var r=0;r<c.length;r++)t(c[r]);var l=s;o.push([187,0,1]),a()}([function(e,t){e.exports=wp.i18n},function(e,t){e.exports=wp.element},,,,,,,,,function(e,t){e.exports=wp.hooks},function(e,t){e.exports=lodash},,,,,,,function(e,t){e.exports=React},function(e,t,a){"use strict";var n=a(68),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(11),b=a(55),f=a(45),k=a(90),y=a(10),v=a(0);t.a=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{inGrid:!1,fullWidth:!1,createGrid:!1},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return!1},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(e){if(e&&e.error)return e.error.message?e.error.message:e.error.errors&&e.error.errors[0]&&e.error.errors[0].message?e.error.errors[0].message:Object(v.__)("Unidentified error","google-site-kit");if(e&&e.errors&&e.errors[0]&&e.errors[0].message)return e.errors[0].message;if(e&&e.error_data){var t=Object.values(e.error_data);if(t[0]&&"RateLimitExceeded"===t[0].reason)return Object(v.__)("Too many requests have been sent within a given time span. Please reload this page again in a few seconds","google-site-kit")}if(e&&e.errors){var a=Object.values(e.errors);if(a[0]&&a[0][0])return a[0][0]}return!1};return function(l){function u(e){var a;c()(this,u),(a=d()(this,g()(u).call(this,e))).state={data:!1,zeroData:!1,error:!1},Object(y.addAction)("googlesitekit.moduleDataReset","googlesitekit.moduleDataResetHandler",(function(){a.setState({data:!1})}));var n=function(e,t){var n=a.props,i=n.handleDataError,c=n.handleDataSuccess,r=t.datapoint,l=t.identifier,d=t.toState,u=s(e);u?(a.setState({error:u,module:l}),i&&i(u)):o(e,r,t)?(i&&i(u),a.setState({zeroData:!0})):c&&c(),a.setState({requestDataToState:d,data:e,datapoint:r,module:l})};return Object(_.each)(t,(function(e){Array.isArray(e.context)?Object(_.each)(e.context,(function(t){Object(y.addFilter)("googlesitekit.module".concat(t,"DataRequest"),"googlesitekit.data".concat(t),(function(t){return e.callback=function(t){n(t,e)},t.push(e),t}))})):Object(y.addFilter)("googlesitekit.module".concat(e.context,"DataRequest"),"googlesitekit.data".concat(e.context),(function(t){return e.callback=function(t){n(t,e)},t.push(e),t}))})),a}return p()(u,l),r()(u,[{key:"render",value:function(){var t=this.state,o=t.data,c=t.datapoint,s=t.module,r=t.zeroData,l=t.error,d=t.requestDataToState;if(!o)return a;var u=s?googlesitekit.modules[s].name:Object(v.__)("Site Kit","google-site-kit");return s&&googlesitekit.modules[s].active&&!googlesitekit.modules[s].setupComplete?Object(k.a)(s,n.inGrid,n.fullWidth,n.createGrid):l?"string"!=typeof l?l:Object(f.a)(u,l,n.inGrid,n.fullWidth,n.createGrid):r?Object(b.a)(u,n.inGrid,n.fullWidth,n.createGrid):React.createElement(e,i()({data:o,datapoint:c,requestDataToState:d},this.props))}}]),u}(h.Component)}},,,,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(8),h=a.n(p),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.width,a=e.height,n=e.shape,i=e.padding;return React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-preview-block\n\t\t\t\t\t".concat(i?"googlesitekit-preview-block--padding":"","\n\t\t\t\t"),style:{width:t,height:a}},React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-preview-block__wrapper\n\t\t\t\t\t".concat("circular"===n?"googlesitekit-preview-block__wrapper--circle":"","\n\t\t\t\t")}))}}]),t}(m.Component);_.propTypes={width:h.a.string,height:h.a.string,shape:h.a.string,padding:h.a.bool},_.defaultProps={width:"100px",height:"100px",shape:"square",padding:!1},t.a=_},,,,,function(e,t,a){"use strict";a.d(t,"b",(function(){return v})),a.d(t,"a",(function(){return O}));var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(8),b=a.n(_),f=a(60),k=a(14),y=a(11),v=function(e,t,a){var n=[],i=a.links,o=a.source,c=a.showURLs;return a.cap&&(e=e.slice(0,a.cap)),Object(y.each)(e,(function(e,t){var a=[],o=i&&i[t];Object(y.each)(e,(function(t,n){"string"==typeof t&&(t=t.replace(/\(none\)/gi,"direct")),a.push(React.createElement("td",{key:"cell-"+n,className:"googlesitekit-table__body-item"},e[0]===t&&o?React.createElement("div",{className:"googlesitekit-table__body-item-content"},React.createElement(k.a,{className:"googlesitekit-table__body-item-link",href:o,external:!0,inherit:!0},t),c&&""!==Object(y.trim)(o,"/")&&React.createElement(k.a,{className:"googlesitekit-table__body-item-url",href:o,inherit:!0,external:!0},Object(y.trim)(o,"/"))):React.createElement("div",{className:"googlesitekit-table__body-item-content"},t)))})),n.push(React.createElement("tr",{key:"tr-"+t,className:"googlesitekit-table__body-row"},a))})),React.createElement("div",{className:"googlesitekit-table".concat(a&&a.disableListMode?"":" googlesitekit-table--with-list")},React.createElement("table",{className:"\n\t\t\t\t\tgooglesitekit-table__wrapper\n\t\t\t\t\tgooglesitekit-table__wrapper--".concat(e&&e[0]?e[0].length:1,"-col\n\t\t\t\t")},React.createElement("thead",{className:"googlesitekit-table__head"},React.createElement("tr",{key:"gksc_data_row_header-wrap",style:a&&a.hideHeader?{display:"none"}:{},className:"googlesitekit-table__head-row"},t.map((function(e,t){return React.createElement("th",{key:"gksc_data_row_header-".concat(t),className:"\n\t\t\t\t\t\t\t\t\tgooglesitekit-table__head-item\n\t\t\t\t\t\t\t\t\t".concat(e.primary?"googlesitekit-table__head-item--primary":"","\n\t\t\t\t\t\t\t\t"),"data-tooltip":e.tooltip},e.title)})))),React.createElement("tbody",{className:"googlesitekit-table__body"},n)),o&&React.createElement(f.a,{className:"googlesitekit-table__source",name:o.name,href:o.link}))},O=function(e){function t(){var e;return i()(this,t),(e=r()(this,d()(t).call(this))).state={isScrolling:!1},e.scrollRef=Object(h.createRef)(),e.updateFadeOnScroll=e.updateFadeOnScroll.bind(g()(e)),e}return p()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;e.updateFadeOnScroll(),this.resize=Object(y.debounce)((function(){e.updateFadeOnScroll()}),100),window.addEventListener("resize",this.resize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.resize)}},{key:"updateFadeOnScroll",value:function(){var e=this.scrollRef.current,t=e.scrollLeft,a=e.scrollWidth-e.offsetWidth,n=t<a-16&&0<a-16;this.setState({isScrolling:n})}},{key:"render",value:function(){var e=this.props.children,t=this.state.isScrolling;return React.createElement("div",{onScroll:Object(y.debounce)(this.updateFadeOnScroll,100),className:"\n\t\t\t\t\tgooglesitekit-table-overflow\n\t\t\t\t\t".concat(t?"googlesitekit-table-overflow--gradient":"","\n\t\t\t\t")},React.createElement("div",{ref:this.scrollRef,className:"googlesitekit-table-overflow__container"},e))}}]),t}(h.Component);O.propTypes={children:b.a.element}},,,,,,,function(e,t){e.exports=wp.apiFetch},function(e,t){e.exports=wp.url},,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(23),h=a(8),_=a.n(h),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){for(var e=this.props,t=e.rows,a=e.rowHeight,n=e.padding,i=[],o=0;t>o;o++)i.push(React.createElement("div",{className:"googlesitekit-preview-table__row",key:"table-row-"+o},React.createElement(p.a,{width:"100%",height:a+"px"})));return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-preview-table\n\t\t\t\t".concat(n?"googlesitekit-preview-table--padding":"","\n\t\t\t")},i)}}]),t}(m.Component);b.propTypes={rows:_.a.number,rowHeight:_.a.number,padding:_.a.bool},b.defaultProps={rows:11,rowHeight:35,padding:!1},t.a=b},,,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(8),h=a.n(p),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.title,a=e.description;return React.createElement("header",{className:"googlesitekit-dashboard-module-header"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-dashboard-module-header__title "},t),a&&React.createElement("p",{className:"googlesitekit-dashboard-module-header__description"},a))))}}]),t}(m.Component);_.propTypes={title:h.a.string,description:h.a.string},_.defaultProps={title:"",description:""},t.a=_},function(e,t,a){"use strict";a.r(t),a.d(t,"reduceAdSenseData",(function(){return u})),a.d(t,"propsFromAccountStatus",(function(){return g})),a.d(t,"getAdSenseAccountStatus",(function(){return m})),a.d(t,"isAdsenseConnectedAnalytics",(function(){return p})),a.d(t,"isDataZeroAdSense",(function(){return h}));var n=a(12),i=a.n(n),o=a(168),c=a(9),s=a(2),r=a(11),l=a(0),d=a(15);function u(e){var t=[[{type:"date",label:"Day"},{type:"number",label:"RPM"},{type:"number",label:"Earnings"},{type:"number",label:"Impressions"}]];return Object(r.each)(e,(function(e){var a=new Date(e[0]);t.push([a,e[2],e[1],e[3]])})),{dataMap:t}}var g=function(e,t){var a,n,i,c,r,d,u,g,m,p,h,_,b,f=!1,k=!1,y=!1,v=!1,O=!1,R=!1,E=googlesitekit.modules.adsense,S=E.accountURL,j=E.signupURL,w=Object(s.n)("googlesitekit-module-adsense",{}),D=new URL(googlesitekit.admin.siteURL);switch(e){case"account-connected":t?(g=!1,u="alert",m=Object(l.__)("Site Kit will place AdSense code to your site","google-site-kit"),p=Object(l.__)("This means Google will automatically place ads for you in all the best places.","google-site-kit"),n=Object(l.__)("Continue","google-site-kit"),a=w,f=!0,h=Object(l.__)("Let Site Kit place code on your site","google-site-kit"),_=Object(l.__)("If you don’t let Site Kit place the code you may not get the best ads experience. You can set this up later on the Site Kit settings page.","google-site-kit"),b=Object(l.__)("If you’ve already set up ads on your site, it may change how they appear. You can customize this later in AdSense.","google-site-kit")):(g=!1,u=!1,m=Object(l.__)("Looks like you’re already using AdSense","google-site-kit"),p=Object(l.__)("Site Kit will place AdSense code on your site to connect your site to AdSense and help you get the most out of ads. This means Google will automatically place ads for you in all the best places.","google-site-kit"),n=Object(l.__)("Continue","google-site-kit"),a=w,R={eventCategory:"adsense_setup",eventName:"complete_adsense_setup"},h=Object(l.__)("Let Site Kit place code on your site to get your site approved","google-site-kit"),_=Object(l.__)("If you’ve already got some AdSense code on your site, we recommend you use Site Kit to place code to get the most out of AdSense.","google-site-kit"));break;case"account-connected-nonmatching":g=!1,u=!1,m=Object(l.__)("Your site has code from another AdSense account","google-site-kit"),p=Object(l.__)("We’ve found some AdSense code on your site, but it’s not linked to this AdSense account.","google-site-kit"),v=!1,n=Object(l.__)("Switch Google account","google-site-kit"),a=Object(s.m)("adsense",!0),k={accountStatus:"account-connected",continueText:Object(l.__)("Continue anyway","google-site-kit"),statusHeadline:Object(l.__)("Site Kit will place AdSense code on your site","google-site-kit"),statusMessage:Object(l.__)("To connect your site to your AdSense account, Site Kit will place AdSense code on your site. For a better ads experience, you should remove AdSense code that’s not linked to this AdSense account.","google-site-kit"),profile:!0,ctaLink:w,ctaLinkText:Object(l.__)("Continue","google-site-kit"),continueAction:!1,switchLabel:Object(l.__)("Let Site Kit place code on your site","google-site-kit"),switchOffMessage:Object(l.__)("You can let Site Kit do this later.","google-site-kit")};break;case"ads-display-pending":var C=Object(o.parse)(D.hostname).domain;m=Object(l.__)("Let’s get your site ready for ads","google-site-kit"),p=Object(l.__)("After you’ve finished setting up your account, we’ll let you know when your site is ready to show ads. This usually takes less than a day, but it can sometimes take a bit longer.","google-site-kit"),n=Object(l.__)("Go to your AdSense account to check on your site’s status or to complete setting up","google-site-kit"),a="https://www.google.com/adsense/new/sites?url=".concat(C||D.hostname,"&source=site-kit");break;case"account-pending-review":m=Object(l.__)("We’re getting your site ready for ads","google-site-kit"),p=Object(l.__)("AdSense is reviewing your site. Meanwhile, make sure you’ve completed these steps in AdSense.","google-site-kit"),n=Object(l.__)("Go to your AdSense account to check on your site’s status","google-site-kit"),a="https://www.google.com/adsense/new/sites?url=".concat(D.hostname,"&source=site-kit"),y=!0;break;case"account-required-action":O=!0;break;case"disapproved-account":a=S,n=Object(l.__)("Go to AdSense to find out how to fix the issue","google-site-kit"),m=Object(l.__)("Your site isn’t ready to show ads yet","google-site-kit"),p=Object(l.__)("You need to fix some things before we can connect Site Kit to your AdSense account.","google-site-kit");break;case"disapproved-account-afc":g=Object(l.__)("There is an AdSense account, but the AFC account is disapproved","google-site-kit"),u="error",m=Object(l.__)("Create Account","google-site-kit"),p=Object(l.__)("Create an AdMob account, then open AdSense and try to upgrade.","google-site-kit"),n=Object(l.__)("Create an AdMob Account","google-site-kit"),a="https://google.com/admob";break;case"no-account":m=Object(l.__)("Create your AdSense account","google-site-kit"),p=Object(l.__)("Site Kit will place AdSense code on every page across your site. This means Google will automatically place ads for you in all the best places.","google-site-kit"),v=!0,n=Object(l.__)("Create AdSense Account","google-site-kit"),a=j,d=Object(l.__)("Already have an AdSense account?","google-site-kit"),i=Object(l.__)("to connect to it","google-site-kit"),c=Object(l.__)("Switch Google account","google-site-kit"),r=Object(s.m)("adsense",!0),R={eventCategory:"adsense_setup",eventName:"create_adsense_account"};break;case"no-account-tag-found":m=Object(l.__)("Looks like you’re already using AdSense","google-site-kit"),p=Object(l.__)("We’ve found some AdSense code on your site, but it’s not linked to this Google account.","google-site-kit"),v=!1,n=Object(l.__)("Switch Google account","google-site-kit"),a=Object(s.m)("adsense",!0),h=Object(l.__)("Let Site Kit place code on your site to get your site approved","google-site-kit"),k={statusHeadline:Object(l.__)("Create a new AdSense account","google-site-kit"),statusMessage:Object(l.__)("Site Kit will place additional AdSense code on every page across your site after you create an account. This means Google will automatically place ads for you in all the best places.","google-site-kit"),notice:Object(l.__)("We recommend you remove the old AdSense code from this site.","google-site-kit"),icon:"warning",continueText:Object(l.__)("Continue anyway","google-site-kit"),ctaLinkText:Object(l.__)("Create AdSense Account","google-site-kit"),ctaLink:j,ctaTarget:"_blank",continueAction:!1};break;case"account-connected-no-data":m=Object(l.__)("We’re getting your site ready for ads","google-site-kit"),p=Object(l.__)("AdSense is reviewing your site. Meanwhile, make sure you’ve completed these steps in AdSense.","google-site-kit"),y=!0}return{accountTagMatch:f,continueAction:k,ctaLink:a,ctaLinkText:n,footerAppendedText:i,footerCTA:c,footerCTALink:r,footerText:d,icon:u,incomplete:y,issue:g,profile:v,required:O,setupComplete:!1,statusHeadline:m,statusMessage:p,switchLabel:h,switchOffMessage:_,switchOnMessage:b,tracking:R}},m=function(){var e,t,a,n,o,d,u,g,m,p,h,_,b,f,k,y,v,O,R,E,S,j,w,D,C,x,N,A,P,L=arguments;return i.a.async((function(M){for(;;)switch(M.prev=M.next){case 0:return e=L.length>0&&void 0!==L[0]&&L[0],t=L.length>1&&void 0!==L[1]?L[1]:function(){},n=!1,M.prev=3,t(Object(l.__)("Locating accounts…","google-site-kit")),M.next=7,i.a.awrap(c.c.get(c.b,"adsense","accounts").then((function(e){return e})).catch((function(e){return e})));case 7:if(o=M.sent,!(1<(d=!o.data||o.data.status&&200!==o.data.status?o:o.data).length)){M.next=42;break}t(Object(l.__)("Searching for domain…","google-site-kit")),u=!0,g=!1,m=void 0,M.prev=14,p=d[Symbol.iterator]();case 16:if(u=(h=p.next()).done){M.next=28;break}return _=h.value,b=_.id,M.next=21,i.a.awrap(c.c.get(c.b,"adsense","urlchannels",{clientID:b}).then((function(e){return e})).catch((function(e){return e})));case 21:f=M.sent,k=new URL(googlesitekit.admin.siteURL),(y=f&&f.length?Object(r.filter)(f,{urlPattern:k.hostname}):[])&&0!==y.length?(O=y[0].id,Object(s.v)("adsense_setup","adsense_account_detected")):(a="account-pending-review",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status account-pending-review"));case 25:u=!0,M.next=16;break;case 28:M.next=34;break;case 30:M.prev=30,M.t0=M.catch(14),g=!0,m=M.t0;case 34:M.prev=34,M.prev=35,u||null==p.return||p.return();case 37:if(M.prev=37,!g){M.next=40;break}throw m;case 40:return M.finish(37);case 41:return M.finish(34);case 42:if(v=d&&d.message&&d.message.error,O=!!(d&&d.length&&d[0])&&d[0].id,d&&O&&!v){M.next=50;break}R=(v||{}).errors,"noAdSenseAccount"!==(E=R[0].reason)&&d&&O||(a="disapprovedAccount"===E?"disapproved-account":e?"no-account-tag-found":"no-account"),M.next=118;break;case 50:return googlesitekit.modules.adsense.accountURL=Object(l.sprintf)("https://www.google.com/adsense/new/%s/home",O),t(Object(l.__)("Account found, checking account status…","google-site-kit")),M.next=54,i.a.awrap(c.c.get(c.b,"adsense","alerts",{accountID:O}).then((function(e){return e})).catch((function(e){return e})));case 54:if(S=M.sent,j=!S.data||S.data.status&&200!==S.data.status?S:S.data,w=j&&j.message&&j.message.error,!Object(r.find)(S,{type:"GRAYLISTED_PUBLISHER"})){M.next=62;break}a="ads-display-pending",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending"),M.next=118;break;case 62:return M.next=64,i.a.awrap(c.c.get(c.b,"adsense","clients").then((function(e){return e})).catch((function(e){return e})));case 64:if(D=M.sent,C=!D.data||D.data.status&&200!==D.data.status?D:D.data,x=C&&C.message&&C.message.error,!(N=!(!C||!C.length)&&Object(r.find)(C,{productCode:"AFC"}))){M.next=72;break}return n=N.id,M.next=72,i.a.awrap(c.c.set(c.b,"adsense","client-id",{clientID:n}).then((function(e){return e})).catch((function(e){return e})));case 72:if(!w){M.next=77;break}"accountPendingReview"===j.message.error.errors[0].reason&&(a="ads-display-pending",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending")),M.next=118;break;case 77:if(t(Object(l.__)("Looking for AdSense client…","google-site-kit")),!x){M.next=83;break}a="account-required-action",Object(s.v)("adsense_setup","adsense_required_action","accountRequiredAction status"),M.next=118;break;case 83:if(!N){M.next=117;break}return n=N.id,t(Object(l.__)("Looking for site domain…","google-site-kit")),M.next=88,i.a.awrap(c.c.get(c.b,"adsense","urlchannels",{clientID:n}).then((function(e){return e})).catch((function(e){return e})));case 88:if(A=M.sent,P=A&&A.length&&Object(r.filter)(A,(function(e){return 0<googlesitekit.admin.siteURL.indexOf(e.urlPattern)})),0!==A.length){M.next=95;break}a="ads-display-pending",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending"),M.next=115;break;case 95:if(P&&0!==P.length){M.next=100;break}a="account-pending-review",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status account-pending-review"),M.next=115;break;case 100:if(!e||n!==e){M.next=105;break}a="account-connected",Object(s.v)("adsense_setup","adsense_account_connected","existing_matching_tag"),M.next=115;break;case 105:if(!e||n===e){M.next=110;break}a="account-connected-nonmatching",Object(s.v)("adsense_setup","adsense_account_connected","existing_non_matching_tag"),M.next=115;break;case 110:return a="account-connected",t(Object(l.__)("Connecting…","google-site-kit")),Object(s.v)("adsense_setup","adsense_account_connected"),M.next=115,i.a.awrap(c.c.set(c.b,"adsense","setup-complete",{clientID:n}).then((function(e){return e})).catch((function(e){return e})));case 115:M.next=118;break;case 117:a="disapproved-account-afc";case 118:return M.next=120,i.a.awrap(c.c.set(c.b,"adsense","account-status",{accountStatus:a}).then((function(e){return e})).catch((function(e){return e})));case 120:return M.abrupt("return",{accountStatus:a,clientID:n});case 123:return M.prev=123,M.t1=M.catch(3),M.abrupt("return",{isLoading:!1,error:M.t1.code,message:M.t1.message});case 126:case"end":return M.stop()}}),null,null,[[3,123],[14,30,34,42],[35,,37,41]])},p=function(){var e,t,a;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(e=googlesitekit.modules.adsense.active,t=googlesitekit.modules.analytics.active,a=!0,!e||!t){n.next=6;break}return n.next=6,i.a.awrap(c.c.get(c.b,"analytics","report",d.analyticsAdsenseReportDataDefaults).then((function(e){e&&(a=!0)})).catch((function(e){400===e.code&&"INVALID_ARGUMENT"===e.message&&(a=!1)})));case 6:return n.abrupt("return",new Promise((function(e){e(a)})));case 7:case"end":return n.stop()}}))},h=function(e,t,a){if(!a.data||!a.data.dateRange||"last-28-days"!==a.data.dateRange)return!1;var n=[];return e.totals&&(n=e.totals),0===(n=n.filter((function(e){return 0<e}))).length}},,,function(e,t,a){"use strict";var n=a(1),i=a(32),o=a(71),c=a(2),s=a(3),r=a.n(s),l=a(4),d=a.n(l),u=a(5),g=a.n(u),m=a(6),p=a.n(m),h=a(7),_=a.n(h),b=a(26),f=a(0),k=function(e){function t(){return r()(this,t),g()(this,p()(t).apply(this,arguments))}return _()(t,e),d()(t,[{key:"render",value:function(){return React.createElement(b.a,{id:"notification-id",title:Object(f.__)("Security Token Error","google-site-kit"),description:Object(f.__)("We’re unable to retrieve your data because your security token is expired or revoked. Please ","google-site-kit"),learnMoreURL:googlesitekit.admin.connectURL,learnMoreLabel:Object(f.__)("reauthenticate your account","google-site-kit"),format:"small",type:"win-error"})}}]),t}(n.Component);t.a=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=React.createElement(i.a,{title:Object(f.sprintf)(Object(f.__)("Data error in %s","google-site-kit"),e),description:t,error:!0});return"Invalid Credentials"===t&&Object(c.w)(k),Object(o.a)(r,a,n,s)}},,,,,function(e,t){e.exports=ReactDOM},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(56),h=a(8),_=a.n(h),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.change,n=e.id,i=e.loadSmall,o=e.loadCompressed,c=e.loadHeight,s=e.loadText;if(!t)return"loading...";var r={title:"",backgroundColor:"transparent",curveType:"line",width:"100%",height:"50",enableInteractivity:!1,chartArea:{height:"100%",width:"100%"},legend:{position:"none"},axisFontSize:0,hAxis:{baselineColor:"none",ticks:[]},vAxis:{baselineColor:"none",ticks:[]},axes:[],colors:[0<=+a?"green":"red"]};return React.createElement("div",{className:"googlesitekit-analytics-sparkline-chart-wrap"},React.createElement(p.a,{data:t,options:r,id:n,loadSmall:i,loadCompressed:o,loadHeight:c,loadText:s}))}}]),t}(m.Component);b.propTypes={loadSmall:_.a.bool,loadCompressed:_.a.bool,loadHeight:_.a.number,loadText:_.a.bool},b.defaultProps={loadSmall:!0,loadCompressed:!0,loadHeight:46,loadText:!1},t.a=b},,,,function(e,t,a){"use strict";a(1);var n=a(32),i=a(71),o=a(0);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=React.createElement(n.a
2
/* translators: %s: Module name */,{title:Object(o.sprintf)(Object(o.__)("%s Gathering Data","google-site-kit"),e)
3
- /* translators: %s: Module name */,description:Object(o.sprintf)(Object(o.__)("%s data is not yet available, please check back later.","google-site-kit"),e)});return Object(i.a)(s,t,a,c)}},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(31),b=a(8),f=a.n(b),k=a(0),y=a(10),v=a(11),O=function(e){function t(e){var a;if(i()(this,t),(a=r()(this,d()(t).call(this,e))).state={loading:!0,chart:null},a.waitForChart=a.waitForChart.bind(g()(a)),a.getData=a.getData.bind(g()(a)),a.prepareChart=a.prepareChart.bind(g()(a)),a.drawChart=a.drawChart.bind(g()(a)),a.updateChart=a.updateChart.bind(g()(a)),a.chartRef=Object(h.createRef)(),window.google||window.googleChartLoaded)window.google&&window.google.charts?window.google.charts.setOnLoadCallback((function(){a.getData(),a.prepareChart(),a.drawChart()})):Object(y.addAction)("googlesitekit.ChartLoaderLoaded","googlesitekit.HandleChartLoaderLoaded",(function(){window.google.charts.setOnLoadCallback((function(){a.getData(),a.prepareChart(),a.drawChart()}))}));else{window.googleChartLoaded=!0;var n=document.createElement("script");n.type="text/javascript",n.onload=function(){n.onload=null,window.google.charts.load("visualization","1",{packages:["corechart"]}),window.google.charts.setOnLoadCallback((function(){a.getData(),a.prepareChart(),a.drawChart(),a.setState({loading:!1})})),Object(y.doAction)("googlesitekit.ChartLoaderLoaded")},document.getElementsByTagName("head")[0].appendChild(n),n.src="https://www.gstatic.com/charts/loader.js"}return a}return p()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;this.resize=Object(v.debounce)((function(){e.drawChart()}),100),window.addEventListener("resize",this.resize)}},{key:"componentDidUpdate",value:function(e){var t=this.props.selectedStats;0!==t.length&&JSON.stringify(t)!==JSON.stringify(e.selectedStats)&&this.updateChart()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.resize)}},{key:"waitForChart",value:function(e){setTimeout((function(){e()}),500)}},{key:"getData",value:function(){return window.google&&window.google.visualization&&window.google.visualization.arrayToDataTable(this.props.data)}},{key:"prepareChart",value:function(){if(window.google){var e=this.chartRef.current,t="pie"===this.props.chartType?new window.google.visualization.PieChart(e):new window.google.visualization.LineChart(e);this.setState({chart:t})}else this.waitForChart(this.prepareChart)}},{key:"drawChart",value:function(){var e=this.state.chart,t=this.props,a=t.selectedStats,n=t.options,i=this.getData();null!==i&&null!==e?(e.draw(i,n),0!==a.length&&this.updateChart()):this.waitForChart(this.drawChart)}},{key:"updateChart",value:function(){var e=this.state.chart,t=this.props,a=t.selectedStats,n=t.options,i=t.singleStat,o=this.getData();if(null!==o&&null!==e){var c=new window.google.visualization.DataView(o);if(!i){var s=[0];s=s.concat(a.map((function(e){return e+1}))),c.setColumns(s)}e.draw(c,n)}else this.waitForChart(this.drawChart)}},{key:"render",value:function(){var e=this.state.loading,t=this.props,a=t.className,n=t.loadSmall,i=t.loadCompressed,o=t.loadHeight,c=t.loadText;return React.createElement("div",{className:"googlesitekit-graph-wrapper"},React.createElement("div",{ref:this.chartRef,className:"googlesitekit-line-chart"},React.createElement("div",{className:"googlesitekit-chart-loading"},e&&React.createElement("div",{className:"googlesitekit-chart-loading__wrapper"},c&&React.createElement("p",null,Object(k.__)("Loading chart...","google-site-kit")),React.createElement(_.a,{className:a,small:n,compress:i,height:o})))))}}]),t}(h.Component);O.propTypes={selectedStats:f.a.array,options:f.a.object.isRequired,id:f.a.string,singleStat:f.a.bool,className:f.a.string,loadSmall:f.a.bool,loadCompressed:f.a.bool,loadHeight:f.a.number,loadText:f.a.bool},O.defaultProps={selectedStats:[],id:"",singleStat:!0,className:"",loadSmall:!1,loadCompressed:!1,loadHeight:null,loadText:!0},t.a=O},,,function(e,t){e.exports=wp.compose},,,,,function(e,t,a){"use strict";a.r(t),a.d(t,"getScoreCategoryLabel",(function(){return o})),a.d(t,"PageSpeedReportScoreCategoryWrapper",(function(){return c})),a.d(t,"PageSpeedReportScoreGauge",(function(){return s})),a.d(t,"PageSpeedReportScale",(function(){return r}));a(1);var n=a(0);function i(e){return.9<=e?"fast":.5<=e?"average":"slow"}var o=function(e){var t=i(e);return"fast"===t?Object(n.__)("Fast","google-site-kit"):"average"===t?Object(n.__)("Average","google-site-kit"):Object(n.__)("Slow","google-site-kit")},c=function(e){var t=e.score,a=e.children,n="googlesitekit-pagespeed-report__score-category-wrapper googlesitekit-pagespeed-report__score-category-wrapper--".concat(i(t)),o="googlesitekit-pagespeed-report__score-icon googlesitekit-pagespeed-report__score-icon--".concat(i(t));return React.createElement("span",{className:n},a," ",React.createElement("span",{className:o}))},s=function(e){var t=e.score,a=parseInt(100*t,10),o="\n\t\tgooglesitekit-percentage-circle\n\t\tgooglesitekit-percentage-circle--".concat(i(t),"\n\t\tgooglesitekit-percentage-circle--percent-").concat(a,"\n\t");return React.createElement("div",{className:"googlesitekit-pagespeed-report__score-gauge"},React.createElement("div",{className:o},React.createElement("div",{className:"googlesitekit-percentage-circle__text"},a),React.createElement("div",{className:"googlesitekit-percentage-circle__slice"},React.createElement("div",{className:"googlesitekit-percentage-circle__bar"}),React.createElement("div",{className:"googlesitekit-percentage-circle__fill"}))),React.createElement("span",{className:"googlesitekit-pagespeed-report__score-gauge-label screen-reader-only"},Object(n.__)("Performance","google-site-kit")))},r=function(){return React.createElement("div",{className:"googlesitekit-pagespeed-report__scale"},React.createElement("span",null,Object(n.__)("Scale:","google-site-kit")),React.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--fast"},Object(n.__)("90-100 (fast)","google-site-kit")),React.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--average"},Object(n.__)("50-89 (average)","google-site-kit")),React.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--slow"},Object(n.__)("0-49 (slow)","google-site-kit")))}},,function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(56),b=a(2),f=a(19),k=a(9),y=a(0),v=a(8),O=a.n(v),R=a(14),E=a(23),S=a(15);function j(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var w=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.source;if(!t||t.error||!t.length)return null;var n=Object(S.extractAnalyticsDataForTrafficChart)(t);return React.createElement("div",{className:"googlesitekit-chart googlesitekit-chart--pie"},React.createElement(_.a,{data:n,options:{chartArea:{width:"100%",height:"100%"},backgroundColor:"transparent",height:250,legend:{alignment:"center",textStyle:{color:"#5b5b61",fontSize:12}},slices:{0:{color:"#178EC5"},1:{color:"#54B23B"},2:{color:"#EB5729"},3:{color:"#ECED33"},4:{color:"#34CBE3"},5:{color:"#82E88E"}},title:null,width:"100%"},chartType:"pie",id:"overview-piechart",loadHeight:205}),a&&React.createElement("div",{className:"googlesitekit-chart__source"},[Object(y.__)("Source:","google-site-kit")," ",React.createElement(R.a,{key:"link",href:Object(b.n)("googlesitekit-module-analytics"),inherit:!0},Object(y._x)("Analytics","Service name","google-site-kit"))]))}}]),t}(h.Component);w.defaultProps={source:!1},w.propTypes={source:O.a.bool},t.default=Object(f.a)(w,[{type:k.b,identifier:"analytics",datapoint:"report",data:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?j(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):j(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},S.trafficSourcesReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(b.p)("day"),context:["Dashboard","Single"]}],React.createElement(E.a,{width:"282px",height:"282px",shape:"circular"}),{},S.isDataZeroForReporting,S.getAnalyticsErrorMessageFromData)},,,,,function(e,t,a){"use strict";var n=a(1),i=a(17);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return React.createElement(n.Fragment,null,t&&a&&o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(i.a,{fill:!0},React.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e))))),t&&!a&&o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(i.a,{fill:!0},React.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e))))),t&&a&&!o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e),t&&!a&&!o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e),!t&&!a&&o&&React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e))),!t&&!a&&!o&&e)}},function(e,t,a){"use strict";var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(9),b=a(26),f=a(8),k=a.n(f),y=a(0),v=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={isLoading:!0,alerts:[],error:!1,message:""},a}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.getAlert()}},{key:"getAlert",value:function(){var e,t;return i.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e=this.props.module,a.next=4,i.a.awrap(_.c.getNotifications(e,3600));case 4:t=a.sent,this.setState({isLoading:!1,error:!1,alerts:t}),a.next=11;break;case 8:a.prev=8,a.t0=a.catch(0),this.setState({isLoading:!1,error:a.t0.code});case 11:case"end":return a.stop()}}),null,this,[[0,8]])}},{key:"render",value:function(){var e=this.state,t=e.alerts,a=e.error,n=e.isLoading;if(a||n||!t||!t.length)return null;var i=t.map((function(e){return React.createElement(b.a,{id:e.id,key:e.id,title:e.title,description:e.message||e.description,dismiss:Object(y.__)("Dismiss","google-site-kit"),isDismissable:e.isDismissible,format:"small",ctaLink:e.ctaURL,ctaLabel:e.ctaLabel,ctaTarget:e.ctaTarget,type:e.severity})}));return React.createElement(h.Fragment,null,i)}}]),t}(h.Component);v.propTypes={module:k.a.string.isRequired},t.a=v},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(22),h=a(8),_=a.n(h),b=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).switchRef=Object(m.createRef)(),a}return g()(t,e),c()(t,[{key:"componentDidMount",value:function(){new p.i(this.switchRef.current)}},{key:"render",value:function(){var e=this.props,t=e.id,a=e.onClick,n=e.label,i=e.checked,o=e.hideLabel;return React.createElement(m.Fragment,null,React.createElement("div",{"aria-checked":i?"true":"false",className:"mdc-switch ".concat(i?"mdc-switch--checked":""),onClick:a,onKeyPress:function(e){"function"==typeof a&&"Enter"===e.code&&a(e)},role:"switch",ref:this.switchRef,tabIndex:0},React.createElement("div",{className:"mdc-switch__track"}," "),React.createElement("div",{className:"mdc-switch__thumb-underlay"},React.createElement("div",{className:"mdc-switch__thumb"},React.createElement("input",{type:"checkbox",id:t,className:"mdc-switch__native-control",role:"switch",checked:i,onChange:function(){}})))),React.createElement("label",{className:o?"screen-reader-only":"",htmlFor:t},n))}}]),t}(m.Component);b.propTypes={id:_.a.string.isRequired,onClick:_.a.func,label:_.a.string.isRequired,checked:_.a.bool,hideLabel:_.a.bool},b.defaultProps={checked:!1,hideLabel:!0},t.a=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(14),h=a(88),_=a(31),b=a(0),f=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLink,a=e.ctaLinkText,n=e.header,i=e.incomplete,o=e.loadingMessage,c=e.subHeader,s=e.required,r=new URL(googlesitekit.admin.siteURL),l="https://www.google.com/adsense/new/sites?url=".concat(r.hostname,"&source=site-kit"),d=[{id:1,
4
/* translators: %s: Site URL */
5
- text:Object(b.sprintf)(Object(b.__)("Added your site %s in ","google-site-kit"),r.hostname),linkText:Object(b.__)("Sites","google-site-kit"),linkURL:l},{id:2,text:Object(b.__)("Enabled ads in","google-site-kit"),linkText:Object(b.__)("Ads","google-site-kit"),linkURL:"https://www.google.com/adsense/new/myads/auto-ads"}];return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},s&&React.createElement(h.a,null),o&&React.createElement(m.Fragment,null,o,React.createElement(_.a,null)),n&&React.createElement("h3",{className:" googlesitekit-heading-4 googlesitekit-setup-module__title "},n),c&&React.createElement("p",null,c),i&&React.createElement("div",{className:"googlesitekit-setup-module__list-wrapper"},React.createElement("ol",{className:"googlesitekit-setup-module__list"},d.map((function(e){return React.createElement("li",{className:"googlesitekit-setup-module__list-item",key:e.id},e.text," ",React.createElement(p.a,{href:e.linkURL,external:!0,inherit:!0},e.linkText))})))),t&&a&&React.createElement("div",{className:"googlesitekit-setup-module__cta"},React.createElement(p.a,{className:"googlesitekit-setup-module__cta-link",href:t,external:!0},a)))}}]),t}(m.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(73),b=a(9),f=a(8),k=a.n(f),y=a(2),v=a(0),O=a(10),R=function(e){function t(e){var a;i()(this,t),a=r()(this,d()(t).call(this,e));var n=googlesitekit.modules.adsense.settings.useSnippet,o=void 0===n||n;return a.state={useSnippet:!!o,disabled:!1},a.handleUseSnippetSwitch=a.handleUseSnippetSwitch.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0,Object(O.addFilter)("googlekit.SettingsConfirmed","googlekit.AdSenseSettingsConfirmed",(function(t,a){return"adsense"!==a.replace("-module","")?t:e.save()})),this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(O.removeFilter)("googlekit.SettingsConfirmed","googlekit.AdSenseSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"save",value:function(){var e=this.state.useSnippet;this._isMounted&&this.setState({useSnippet:e});var t={useSnippet:e||!1};return googlesitekit.modules.adsense.settings&&(googlesitekit.modules.adsense.settings.useSnippet=e),b.c.set(b.b,"adsense","use-snippet",t).then((function(e){return e})).catch((function(e){return e}))}},{key:"handleUseSnippetSwitch",value:function(){var e=this.props.saveOnChange,t=this.state.useSnippet;t=!t,this._isMounted&&this.setState({useSnippet:t}),Object(y.v)("adsense_setup",t?"adsense_tag_enabled":"adsense_tag_disabled"),e&&b.c.set(b.b,"adsense","use-snippet",{useSnippet:t}).then((function(e){return e})).catch((function(e){return e}))}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(y.y)("adsense",{useSnippet:"useSnippet"},this.state)}}},{key:"render",value:function(){var e=this.state.useSnippet,t=this.props,a=t.isEditing,n=t.switchLabel,i=t.switchOnMessage,o=t.switchOffMessage;return React.createElement(h.Fragment,null,a?React.createElement(h.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__switch"},React.createElement(_.a,{id:"enableAutoAds",label:n,onClick:this.handleUseSnippetSwitch,checked:e,hideLabel:!1})," ",React.createElement("span",{className:"googlesitekit-recommended"},Object(v.__)("RECOMMENDED","google-site-kit"))),e&&i&&React.createElement("div",{className:"googlesitekit-settings-notice googlesitekit-settings-notice--suggestion"},React.createElement("div",{className:"googlesitekit-settings-notice__text"},i)),!e&&o&&React.createElement("div",{className:"googlesitekit-settings-notice"},React.createElement("div",{className:"googlesitekit-settings-notice__text"},o))):React.createElement(h.Fragment,null,Object(v.__)("The AdSense code has","google-site-kit")," ",e?Object(v.__)("been placed on your site.","google-site-kit"):Object(v.__)("not been placed on your site.","google-site-kit")))}}]),t}(h.Component);R.propTypes={isEditing:k.a.bool,accountTagMatch:k.a.bool,existingTag:k.a.oneOfType([k.a.bool,k.a.string]),switchLabel:k.a.string,switchOnMessage:k.a.string,switchOffMessage:k.a.string},R.defaultProps={isEditing:!1,accountTagMatch:!1,existingTag:!1,switchLabel:Object(v.__)("Let Site Kit place code on your site","google-site-kit"),switchOnMessage:"",switchOffMessage:""},t.default=R},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(20),h=a(29),_=a(0),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.modules.adsense.accountURL;return React.createElement("section",{className:"googlesitekit-module-outro"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-module-outro__logo"},React.createElement(p.a,{id:"adsense",height:"36",width:"42"}),React.createElement(p.a,{id:"plus",height:"13",width:"13"}),React.createElement(p.a,{id:"analytics",height:"36",width:"34"})),React.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-module-outro__title "},Object(_.__)("Connect Analytics with AdSense to create a powerful team that shows robust metrics for your site.","google-site-kit")),React.createElement("div",{className:"googlesitekit-module-outro__button"},React.createElement(h.a,{href:e,target:"_blank"},Object(_.__)("Connect Accounts","google-site-kit")))))))}}]),t}(m.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(19),b=a(9),f=a(2),k=a(28),y=a(38),v=a(95),O=a(11),R=a(0),E=a(15);function S(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var j=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=Object(f.i)().dateRangeFrom,a=[{title:Object(R.__)("Medium","google-site-kit"),tooltip:Object(R.__)("Medium refers to where your traffic originated from","google-site-kit")},{title:Object(R.__)("Users","google-site-kit"),tooltip:Object(R.__)("Number of users that originated from that traffic","google-site-kit")},{title:Object(R.__)("New Users","google-site-kit"),tooltip:Object(R.sprintf)(Object(R.__)("Number of new users to visit your page over %s","google-site-kit"),t)},{title:Object(R.__)("Sessions","google-site-kit"),tooltip:Object(R.sprintf)(Object(R.__)("Number of sessions users had on your website over %s","google-site-kit"),t)},{title:Object(R.__)("Percentage","google-site-kit"),tooltip:Object(R.__)("Percentage of sessions","google-site-kit")}],n=e[0].data.totals[0].values[0],i=Object(O.map)(e[0].data.rows,(function(e,t){var a=e.metrics[0].values[0]/n*100;return!(1>a)&&[e.dimensions[0],Object(f.r)(e.metrics[0].values[0]),Object(f.r)(e.metrics[0].values[1]),Object(f.r)(e.metrics[0].values[2]),React.createElement(h.Fragment,{key:"minichart-analytics-top-as-"+t},React.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(a.toFixed(2),"%")," ",React.createElement(v.a,{percent:a.toFixed(1),index:t})))]})),o=Object(k.b)(i,a,{hideHeader:!1,chartsEnabled:!1});return React.createElement("div",{className:"googlesitekit-details-widget"},React.createElement(k.a,null,o))}}]),t}(h.Component);t.default=Object(_.a)(j,[{type:b.b,identifier:"analytics",datapoint:"report",data:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?S(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):S(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},E.trafficSourcesReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(f.p)("day"),context:["Single","Dashboard"]}],React.createElement(y.a,{rows:4,rowHeight:50}))},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(19),h=a(9),_=a(2),b=a(28),f=a(38),k=a(11),y=a(0),v=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=[{title:Object(y.__)("Keyword","google-site-kit"),tooltip:Object(y.__)("Most searched for keywords related to your content","google-site-kit"),primary:!0},{title:Object(y.__)("Clicks","google-site-kit"),tooltip:Object(y.__)("Number of times users clicked on your content in search results","google-site-kit")},{title:Object(y.__)("Impressions","google-site-kit"),tooltip:Object(y.__)("Counted each time your content appears in search results","google-site-kit")}],a=googlesitekit.admin.siteURL,n=[],i=Object(k.map)(e,(function(e,t){var i=e.keys[0];return n[t]=Object(y.sprintf)("https://search.google.com/search-console/performance/search-analytics?resource_id=%s&query=!%s&num_of_days=28",a,i),[i,Object(_.r)(e.clicks),Object(_.r)(e.impressions)]})),o={hideHeader:!1,chartsEnabled:!1,links:n},c=Object(b.b)(i,t,o);return React.createElement(b.a,null,c)}}]),t}(m.Component);t.default=Object(p.a)(v,[{type:h.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:googlesitekit.permaLink,dimensions:"query",limit:10},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"]}],React.createElement(f.a,{padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(21),p=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(p.Component);t.default=Object(m.a)("googlesitekit.DashboardSearchFunnel")(h)},,,,,,,,,,,function(e,t,a){"use strict";a(1);var n=a(32),i=a(71),o=a(2),c=a(0);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=googlesitekit.modules[e].name,l=React.createElement(n.a
6
/* translators: %s: Module name */,{title:Object(c.sprintf)(Object(c.__)("%s activation","google-site-kit"),r)
7
- /* translators: %s: Module name */,description:Object(c.sprintf)(Object(c.__)("%s module needs to be configured","google-site-kit"),r),ctaLabel:Object(c.__)("Complete activation","google-site-kit"),onClick:function(){window.location=Object(o.m)(e,!0)}});return Object(i.a)(l,t,a,s)}},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(23),h=a(8),_=a.n(h),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){for(var e=this.props,t=e.width,a=e.height,n=e.shape,i=e.count,o=[],c=0;c++<i;)o.push(React.createElement(p.a,{width:t,height:a,shape:n,key:c}));return o}}]),t}(m.Component);b.propTypes={width:_.a.string,height:_.a.string,shape:_.a.string,count:_.a.number},b.defaultProps={width:"100px",height:"100px",shape:"square",count:1},t.a=b},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(13),p=a.n(m),h=a(7),_=a.n(h),b=a(1),f=a(29),k=a(14),y=a(9),v=a(22),O=a(20),R=a(8),E=a.n(R),S=a(2),j=a(0),w=a(10),D=function(e){function t(e){var a;c()(this,t),a=d()(this,g()(t).call(this,e));var n=googlesitekit.modules.optimize.settings,i=n.optimizeID,o=n.ampClientIDOptIn,s=n.ampExperimentJSON,r=(googlesitekit.modules.analytics||{}).settings,l=googlesitekit.modules.tagmanager||{},u=l.active,m=l.settings,h=!!r&&r.useSnippet,_=!(!u||!m)&&m.useSnippet;return a.state={optimizeID:i||"",analyticsUseSnippet:h,gtmUseSnippet:_,errorCode:!1,errorMsg:"",ampClientIDOptIn:o||!1,ampExperimentJSON:s||"",ampExperimentJSONValidated:!0,OptimizeIDValidated:!0},a.handleOptimizeIDEntry=a.handleOptimizeIDEntry.bind(p()(a)),a.handleSubmit=a.handleSubmit.bind(p()(a)),a.renderInstructionInfo=a.renderInstructionInfo.bind(p()(a)),a.handleAMPOptimizeEntry=a.handleAMPOptimizeEntry.bind(p()(a)),a}return _()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0,Object(w.addFilter)("googlekit.SettingsConfirmed","googlekit.OptimizeSettingsConfirmed",(function(t,a){return"optimize"!==a.replace("-module","")?t:e.props.isEditing?e.handleSubmit():void 0})),this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(w.removeFilter)("googlekit.SettingsConfirmed","googlekit.OptimizeSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(S.y)("optimize",{optimizeID:"optimizeID",ampExperimentJSON:"ampExperimentJSON"},this.state)}}},{key:"handleSubmit",value:function(){var e,t,a,n,o,c,s=this;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=this.state,t=e.optimizeID,a=e.ampExperimentJSON,n=e.OptimizeIDValidated,o=this.props.finishSetup,n&&0!==t.length){r.next=4;break}return r.abrupt("return",!1);case 4:return c={optimizeID:t,ampExperimentJSON:a},r.next=7,i.a.awrap(y.c.set(y.b,"optimize","settings",c).then((function(){o&&o(),googlesitekit.modules.optimize.settings.optimizeID=t,s._isMounted&&s.setState({isSaving:!1})})).catch((function(e){s._isMounted&&s.setState({errorCode:!0,errorMsg:e.errorMsg})})));case 7:return r.abrupt("return",r.sent);case 8:case"end":return r.stop()}}),null,this)}},{key:"handleOptimizeIDEntry",value:function(e){var t=Object(S.A)(e.target.value);this._isMounted&&this.setState({optimizeID:e.target.value,OptimizeIDValidated:t})}},{key:"handleAMPOptimizeEntry",value:function(e){var t=Object(S.z)(e.target.value);this._isMounted&&this.setState({ampExperimentJSON:e.target.value,ampExperimentJSONValidated:t})}},{key:"renderInfo",value:function(){var e=this.state.optimizeID;return React.createElement(b.Fragment,null,e?React.createElement("div",null,Object(j.__)("Your Optimize Container ID","google-site-kit"),": ",React.createElement("strong",null,e)):React.createElement("div",null,Object(j.__)('Optimize Container ID missing, press "edit" to add',"google-site-kit"),"."))}},{key:"renderInstructionInfo",value:function(){var e=this.state,t=e.analyticsUseSnippet,a=e.gtmUseSnippet,n=e.optimizeID;return!t&&a?React.createElement(b.Fragment,null,React.createElement("p",null,Object(j.__)("You are using auto insert snippet with Tag Manager","google-site-kit")),React.createElement("p",null,React.createElement("a",{href:"https://support.google.com/optimize/answer/6314801"},Object(j.__)("Click here","google-site-kit"))," ",Object(j.__)("for how to implement Optimize tag through your Tag Manager","google-site-kit"))):t?null:React.createElement(b.Fragment,null,React.createElement("p",null,Object(j.__)("You disabled analytics auto insert snippet. If You are using Google Analytics code snippet, add the code below:","google-site-kit")),React.createElement("pre",null,'ga("require", "',n||"GTM-XXXXXXX",'");'),React.createElement("p",null,React.createElement("a",{href:"https://support.google.com/optimize/answer/6262084"},Object(j.__)("Click here","google-site-kit"))," ",Object(j.__)("for how to implement Optimize tag in Google Analytics Code Snippet","google-site-kit")))}},{key:"renderAMPSnippet",value:function(){var e=this.state,t=e.analyticsUseSnippet,a=e.ampClientIDOptIn,n=e.ampExperimentJSON,i=e.ampExperimentJSONValidated,o=window.googlesitekit.admin.ampEnabled;return t&&o?React.createElement(b.Fragment,null,a&&React.createElement(b.Fragment,null,React.createElement("p",null,Object(j.__)("Please input your AMP experiment settings in JSON format below.","google-site-kit")," ",React.createElement(k.a,{href:"https://developers.google.com/optimize/devguides/amp-experiments",external:!0,inherit:!0},Object(j.__)("Learn More.","google-site-kit"))),React.createElement(v.l,{className:"\n\t\t\t\t\t\t\t\tmdc-text-field\n\t\t\t\t\t\t\t\t".concat(i?"":"mdc-text-field--error","\n\t\t\t\t\t\t\t"),name:"amp-experiment",onChange:this.handleAMPOptimizeEntry,textarea:!0},React.createElement(v.b,{inputType:"textarea",value:null===n?"":n})),!i&&React.createElement("p",{className:"googlesitekit-error-text"},Object(j.__)("Error: AMP experiment settings are not in a valid JSON format.","google-site-kit")))):null}},{key:"renderForm",value:function(){var e=this.state,t=e.optimizeID,a=e.errorCode,n=e.errorMsg,i=e.OptimizeIDValidated;return React.createElement(b.Fragment,null,React.createElement("p",null,Object(j.__)("Please copy and paste your Optimize ID to complete your setup.","google-site-kit")," ",React.createElement(k.a,{href:"https://support.google.com/optimize/answer/6211921",external:!0,inherit:!0},Object(j.__)("You can locate this here.","google-site-kit"))),a&&0<n.length&&React.createElement("p",{className:"googlesitekit-error-text"},Object(j.__)("Error:","google-site-kit")," ",n),React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(v.l,{className:"\n\t\t\t\t\t\t\tmdc-text-field\n\t\t\t\t\t\t\t".concat(a?"mdc-text-field--error":"","\n\t\t\t\t\t\t\t").concat(i?"":"mdc-text-field--error","\n\t\t\t\t\t\t"),label:Object(j.__)("Optimize Container ID","google-site-kit"),name:"optimizeID",onChange:this.handleOptimizeIDEntry,helperText:React.createElement(v.a,null,Object(j.__)("Format: GTM-XXXXXXX.","google-site-kit")),outlined:!0,required:!0},React.createElement(v.b,{value:t}))),!i&&React.createElement("p",{className:"googlesitekit-error-text"},Object(j.__)("Error: Not a valid Optimize ID.","google-site-kit")),this.renderAMPSnippet(),this.renderInstructionInfo())}},{key:"render",value:function(){var e=this.props,t=e.onSettingsPage,a=e.isEditing;return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--optimize"},!t&&React.createElement(b.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(O.a,{id:"optimize",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(j._x)("Optimize","Service name","google-site-kit"))),a&&this.renderForm(),!a&&this.renderInfo(),!t&&React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(f.a,{onClick:this.handleSubmit},Object(j.__)("Configure Optimize","google-site-kit"))))}}]),t}(b.Component);D.propTypes={onSettingsPage:E.a.bool,finishSetup:E.a.func,isEditing:E.a.bool},D.defaultProps={onSettingsPage:!0,isEditing:!1},t.default=D},function(e,t,a){"use strict";a.r(t),a.d(t,"PageSpeedInsightsDashboardWidgetHomepageSpeedMobile",(function(){return O})),a.d(t,"PageSpeedInsightsDashboardWidgetHomepageSpeedDesktop",(function(){return R}));var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(19),h=a(45),_=a(9),b=a(2),f=a(28),k=a(0),y=a(64),v=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.data,a=e.handleDataLoaded;t&&a&&a()}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.title;if(!t||t.error)return null;if(function(e){return 0===e.categories.performance.score}(t))return Object(h.a)(Object(k._x)("PageSpeed Insights","Service name","google-site-kit"),Object(k.__)("An unknown error occurred while trying to fetch PageSpeed Insights data. Please try again later.","google-site-kit"),!0);var n=t.categories.performance.score,i=Object(y.getScoreCategoryLabel)(n),o=t.audits.interactive.displayValue,c=Object(f.b)([[Object(k.__)("Real user speed data","google-site-kit"),React.createElement(y.PageSpeedReportScoreCategoryWrapper,{key:"0",score:n},i)],[Object(k.__)("Time to become fully interactive","google-site-kit"),React.createElement(y.PageSpeedReportScoreCategoryWrapper,{key:"0",score:n},o)]],[],{hideHeader:!0,disableListMode:!0,chartsEnabled:!1,links:[]});return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement("div",{className:"googlesitekit-pagespeed-report__heading-wrapper"},React.createElement("h3",{className:" googlesitekit-subheading-1 "},a),React.createElement(y.PageSpeedReportScoreGauge,{score:n})),React.createElement(f.a,null,c))}}]),t}(m.Component),O=Object(p.a)(v,[{type:_.b,identifier:"pagespeed-insights",datapoint:"pagespeed",data:{url:googlesitekit.permaLink,strategy:"mobile"},priority:10,maxAge:Object(b.p)("day"),context:["Single","Dashboard"]}],null,{inGrid:!0}),R=Object(p.a)(v,[{type:_.b,identifier:"pagespeed-insights",datapoint:"pagespeed",data:{url:googlesitekit.permaLink,strategy:"desktop"},priority:10,maxAge:Object(b.p)("day"),context:["Single","Dashboard"]}],null,{inGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(12),c=a.n(o),s=a(3),r=a.n(s),l=a(4),d=a.n(l),u=a(5),g=a.n(u),m=a(6),p=a.n(m),h=a(13),_=a.n(h),b=a(7),f=a.n(b),k=a(1),y=a(29),v=a(14),O=a(9),R=a(31),E=a(22),S=a(20),j=a(8),w=a.n(j),D=a(2),C=a(11),x=a(0),N=a(10),A=function(e){function t(e){var a;r()(this,t),a=g()(this,p()(t).call(this,e));var n=googlesitekit.modules.tagmanager.settings,i="primary"===googlesitekit.admin.ampMode?"amp":"web",o="amp"===i?"ampContainerID":"containerID";return a.state={isLoading:!0,accounts:[],containers:[],errorCode:!1,errorMsg:"",refetch:!1,selectedAccount:n.accountID,selectedContainer:n[o],containersLoading:!1,usageContext:i,containerKey:o},a.handleSubmit=a.handleSubmit.bind(_()(a)),a.renderAccountDropdownForm=a.renderAccountDropdownForm.bind(_()(a)),a.handleAccountChange=a.handleAccountChange.bind(_()(a)),a.handleContainerChange=a.handleContainerChange.bind(_()(a)),a.refetchAccount=a.refetchAccount.bind(_()(a)),a}return f()(t,e),d()(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,a=t.isOpen,n=t.onSettingsPage;this._isMounted=!0,n&&!a||(this.requestTagManagerAccounts(),Object(N.addFilter)("googlekit.SettingsConfirmed","googlekit.TagmanagerSettingsConfirmed",(function(t,a){return"tagmanager"!==a.replace("-module","")?t:e.props.isEditing?e.handleSubmit():void 0})),this.toggleConfirmChangesButton())}},{key:"componentDidUpdate",value:function(){this.state.refetch&&this.requestTagManagerAccounts(),this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(N.removeFilter)("googlekit.SettingsConfirmed","googlekit.TagmanagerSettingsConfirmed")}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){var e={selectedContainer:this.state.containerKey,selectedAccount:"selectedAccount"};Object(D.y)("tagmanager",e,this.state)}}},{key:"requestTagManagerAccounts",value:function(){var e,t,a,n,i,o,s,r,l,d;return c.a.async((function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,e=this.state,t=e.selectedAccount,a=e.usageContext,n=this.state.selectedContainer,i={accountID:t,usageContext:a},o=!1,s="",u.next=8,c.a.awrap(O.c.get(O.b,"tagmanager","accounts-containers",i));case 8:r=u.sent,l=r.accounts,d=r.containers,t||0!==l.length||(o="accountEmpty",s=Object(x.__)("We didn’t find an associated Google Tag Manager account, would you like to set it up now? If you’ve just set up an account please re-fetch your account to sync it with Site Kit.","google-site-kit")),t&&!l.find((function(e){return e.accountId===t}))&&(O.c.invalidateCacheGroup(O.b,"tagmanager","accounts-containers"),o="insufficientPermissions",s=Object(x.__)("You currently don't have access to this Google Tag Manager account. You can either request access from your team, or remove this Google Tag Manager snippet and connect to a different account.","google-site-kit")),n&&!d.find((function(e){return e.publicId===n}))&&(n=null),this._isMounted&&this.setState({isLoading:!1,accounts:l,selectedAccount:t||Object(C.get)(d,[0,"accountId"]),containers:d,selectedContainer:n||Object(C.get)(d,[0,"publicId"]),refetch:!1,errorCode:o,errorMsg:s}),u.next=20;break;case 17:u.prev=17,u.t0=u.catch(0),this._isMounted&&this.setState({isLoading:!1,errorCode:u.t0.code,errorMsg:u.t0.message,refetch:!1});case 20:case"end":return u.stop()}}),null,this,[[0,17]])}},{key:"requestTagManagerContainers",value:function(e){var t,a;return c.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,t={accountID:e,usageContext:this.state.usageContext},n.next=4,c.a.awrap(O.c.get(O.b,"tagmanager","containers",t));case 4:a=n.sent,this._isMounted&&this.setState({containersLoading:!1,containers:a,selectedContainer:Object(C.get)(a,[0,"publicId"]),errorCode:!1}),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),this._isMounted&&this.setState({errorCode:n.t0.code,errorMsg:n.t0.message});case 11:case"end":return n.stop()}}),null,this,[[0,8]])}},{key:"handleSubmit",value:function(){var e,t,a,n,o,s,r,l,d;return c.a.async((function(u){for(;;)switch(u.prev=u.next){case 0:return e=this.state,t=e.selectedAccount,a=e.selectedContainer,n=e.usageContext,o=e.containerKey,s=this.props.finishSetup,u.prev=2,r={accountID:t},i()(r,o,a),i()(r,"usageContext",n),l=r,u.next=6,c.a.awrap(O.c.set(O.b,"tagmanager","settings",l));case 6:d=u.sent,s&&s(),googlesitekit.modules.tagmanager.settings=d,this._isMounted&&this.setState({isSaving:!1}),u.next=16;break;case 12:return u.prev=12,u.t0=u.catch(2),this._isMounted&&this.setState({isLoading:!1,errorCode:u.t0.code,errorMsg:u.t0.message}),u.abrupt("return",new Promise((function(e,t){t(u.t0)})));case 16:case"end":return u.stop()}}),null,this,[[2,12]])}},{key:"handleAccountChange",value:function(e,t){var a=this.state.selectedAccount,n=t.getAttribute("data-value");n!==a&&(this._isMounted&&this.setState({containersLoading:!0,selectedAccount:n}),this.requestTagManagerContainers(n))}},{key:"handleContainerChange",value:function(e,t){var a=this.state.selectedContainer,n=t.getAttribute("data-value");n!==a&&this._isMounted&&this.setState({selectedContainer:n})}},{key:"refetchAccount",value:function(e){e.preventDefault(),this._isMounted&&this.setState({isLoading:!0,refetch:!0,errorCode:!1})}},{key:"renderSettingsInfo",value:function(){var e=this.state,t=e.isLoading,a=e.selectedAccount,n=e.selectedContainer;return t?React.createElement(R.a,null):React.createElement(k.Fragment,null,React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(x.__)("Account","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},a||!1)),React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(x.__)("Container ID","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},n||!1))))}},{key:"renderAccountDropdownForm",value:function(){var e=this.state,a=e.accounts,n=e.selectedAccount,i=e.containers,o=e.selectedContainer,c=e.isLoading,s=e.containersLoading,r=this.props.onSettingsPage;return c?React.createElement(R.a,null):0>=a.length?React.createElement(k.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(y.a,{onClick:t.createNewAccount},Object(x.__)("Create an account","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(v.a,{onClick:this.refetchAccount},Object(x.__)("Re-fetch My Account","google-site-kit"))))):React.createElement(k.Fragment,null,React.createElement("p",null,Object(x.__)("Please select your Tag Manager account and container below, the snippet will be inserted automatically into your site.","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(E.k,{enhanced:!0,name:"accounts",label:Object(x.__)("Account","google-site-kit"),value:n,onEnhancedChange:this.handleAccountChange,outlined:!0},a.map((function(e){return React.createElement(E.j,{key:e.accountId,value:e.accountId},e.name)}))),s?React.createElement(R.a,{small:!0}):React.createElement(E.k,{enhanced:!0,name:"containers",label:Object(x.__)("Container","google-site-kit"),value:o,onEnhancedChange:this.handleContainerChange,outlined:!0},i.concat({name:Object(x.__)("Set up a new container","google-site-kit"),publicId:0}).map((function(e,t){var a=e.name,n=e.publicId;return React.createElement(E.j,{key:t,value:n},a)})))),!r&&React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(y.a,{onClick:this.handleSubmit},Object(x.__)("Confirm & Continue","google-site-kit"))))}},{key:"renderErrorOrNotice",value:function(){var e=this.state,t=e.errorCode,a=e.errorMsg,n=this.props.onSettingsPage;if(0===a.length)return null;var i=!n||"insufficientPermissions"!==t;return React.createElement("div",{className:i?"googlesitekit-error-text":""},React.createElement("p",null,i?
8
/* translators: %s: Error message */
9
- Object(x.sprintf)(Object(x.__)("Error: %s","google-site-kit"),a):a))}},{key:"render",value:function(){var e=this.props,t=e.onSettingsPage,a=e.isEditing;return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--tag-manager"},!t&&React.createElement(k.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(S.a,{id:"tagmanager",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(x._x)("Tag Manager","Service name","google-site-kit"))),this.renderErrorOrNotice(),a&&this.renderAccountDropdownForm(),!a&&this.renderSettingsInfo())}}],[{key:"createNewAccount",value:function(e){e.preventDefault(),window.open("https://marketingplatform.google.com/about/tag-manager/","_blank")}}]),t}(k.Component);A.propTypes={onSettingsPage:w.a.bool,finishSetup:w.a.func,isEditing:w.a.bool},A.defaultProps={onSettingsPage:!0,isEditing:!1},t.default=A},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(56),h=["#178EC5","#54B23B","#EB5729","#ECED33","#34CBE3","#82E88E"],_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.index,a=e.percent,n={backgroundColor:"transparent",chartArea:{width:"100%",height:"100%"},enableInteractivity:!1,height:28,legend:{position:"none"},slices:{0:{color:h[t]},1:{color:"#e6e6e6"}},title:null,tooltip:{trigger:"none"},width:28},i=[["source","percent"],["",+a],["",100-a]];return React.createElement("div",{className:"googlesitekit-mini-chart"},React.createElement(p.a,{data:i,options:n,chartType:"pie",loadSmall:!0,loadCompressed:!0,loadHeight:24,loadText:!1,id:"minichart"+t}))}}]),t}(m.Component);t.a=_},function(e,t,a){"use strict";a.r(t);var n=a(169),i=a.n(n),o=a(12),c=a.n(o),s=a(3),r=a.n(s),l=a(4),d=a.n(l),u=a(5),g=a.n(u),m=a(6),p=a.n(m),h=a(13),_=a.n(h),b=a(7),f=a.n(b),k=a(27),y=a.n(k),v=a(1),O=a(9),R=a(8),E=a.n(R),S=a(29),j=a(31),w=a(14),D=a(22),C=function(e){function t(e){var a;return r()(this,t),(a=g()(this,p()(t).call(this,e))).formFieldRef=Object(v.createRef)(),a.radioRef=Object(v.createRef)(),a}return f()(t,e),d()(t,[{key:"componentDidMount",value:function(){new D.e(this.formFieldRef.current).input=new D.g(this.radioRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onClick,a=e.id,n=e.name,i=e.value,o=e.checked,c=e.disabled,s=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-radio\n\t\t\t\t\t\t".concat(c?"mdc-radio--disabled":"","\n\t\t\t\t\t"),ref:this.radioRef},React.createElement("input",{className:"mdc-radio__native-control",onClick:t,type:"radio",id:a,name:n,value:i,checked:o,disabled:c,onChange:function(){}}),React.createElement("div",{className:"mdc-radio__background"},React.createElement("div",{className:"mdc-radio__outer-circle"}),React.createElement("div",{className:"mdc-radio__inner-circle"}))),React.createElement("label",{htmlFor:a},s))}}]),t}(v.Component);C.propTypes={onClick:E.a.func,id:E.a.string.isRequired,name:E.a.string.isRequired,value:E.a.string.isRequired,checked:E.a.bool,disabled:E.a.bool,children:E.a.string.isRequired},C.defaultProps={onClick:null,checked:!1,disabled:!1};var x=C,N=a(73),A=a(20),P=a(2),L=a(0),M=a(10);function I(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function F(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?I(a,!0).forEach((function(t){y()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):I(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var T=y()({},"loggedinUsers",Object(L.__)("Logged-in users","google-site-kit")),U=function(e){function t(e){var a;r()(this,t),a=g()(this,p()(t).call(this,e));var n=googlesitekit.modules.analytics.settings,i=n.accountID,o=n.anonymizeIP,c=n.internalWebPropertyID,s=n.profileID,l=n.propertyID,d=n.useSnippet,u=n.ampClientIDOptIn,m=n.trackingDisabled;return a.state={anonymizeIP:o,isLoading:!0,isSaving:!1,propertiesLoading:!1,profilesLoading:!1,useSnippet:d||!1,errorCode:!1,errorMsg:"",errorReason:!1,accounts:[],properties:[],profiles:[],selectedAccount:i,selectedProperty:l,selectedProfile:s,selectedinternalWebProperty:c,ampClientIDOptIn:u,existingTag:!1,trackingDisabled:m||[]},a.handleAccountChange=a.handleAccountChange.bind(_()(a)),a.handlePropertyChange=a.handlePropertyChange.bind(_()(a)),a.handleProfileChange=a.handleProfileChange.bind(_()(a)),a.processAccountChange=a.processAccountChange.bind(_()(a)),a.processPropertyChange=a.processPropertyChange.bind(_()(a)),a.handleSubmit=a.handleSubmit.bind(_()(a)),a.handleRadioClick=a.handleRadioClick.bind(_()(a)),a.handleRefetchAccount=a.handleRefetchAccount.bind(_()(a)),a.handleExclusionsChange=a.handleExclusionsChange.bind(_()(a)),a.switchStatus=a.switchStatus.bind(_()(a)),a}return f()(t,e),d()(t,[{key:"componentDidMount",value:function(){var e,t,a,n,i,o=this;return c.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:if(e=this.props,t=e.isOpen,a=e.onSettingsPage,this._isMounted=!0,!a||t){s.next=4;break}return s.abrupt("return");case 4:return s.next=6,c.a.awrap(Object(P.k)("analytics"));case 6:if(!(n=s.sent)||!n.length){s.next=21;break}return s.prev=8,s.next=11,c.a.awrap(O.c.get(O.b,"analytics","tag-permission",{tag:n}));case 11:return i=s.sent,s.next=14,c.a.awrap(this.getAccounts(i));case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(8),this.setState({isLoading:!1,errorCode:s.t0.code,errorMsg:s.t0.message,errorReason:!(!s.t0.data||!s.t0.data.reason)&&s.t0.data.reason});case 19:s.next=23;break;case 21:return s.next=23,c.a.awrap(this.getAccounts());case 23:Object(M.addFilter)("googlekit.SettingsConfirmed","googlekit.AnalyticsSettingsConfirmed",(function(e,t){return"analytics"!==t.replace("-module","")?e:o.props.isEditing?o.handleSubmit():void 0}));case 24:case"end":return s.stop()}}),null,this,[[8,16]])}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(M.removeFilter)("googlekit.SettingsConfirmed","googlekit.AnalyticsSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(P.y)("analytics",{anonymizeIP:"anonymizeIP",selectedAccount:"accountID",selectedProperty:"propertyID",selectedProfile:"profileID",selectedinternalWebProperty:"internalWebPropertyID",useSnippet:"useSnippet",ampClientIDOptIn:"ampClientIDOptIn",trackingDisabled:"trackingDisabled"},this.state)}}},{key:"handleAccountChange",value:function(e,t){var a=this.state.selectedAccount,n=t.getAttribute("data-value");n!==a&&("0"!==n?(this.setState({propertiesLoading:!0,profilesLoading:!0,selectedAccount:n}),Object(P.v)("analytics_setup","account_change",n),this.processAccountChange(n)):this.setState({selectedAccount:n,selectedProperty:"-1",selectedProfile:"-1",properties:[{id:"-1",name:Object(L.__)("Select an account","google-site-kit")}],profiles:[{id:"-1",name:Object(L.__)("Select an account","google-site-kit")}]}))}},{key:"handlePropertyChange",value:function(e,t){var a=this.state.selectedProperty,n=t.getAttribute("data-value");n!==a&&("0"!==n?(this.setState({profilesLoading:!0,selectedProperty:n}),Object(P.v)("analytics_setup","property_change",n),this.processPropertyChange(n)):this.setState({selectedProperty:n,selectedProfile:n,profiles:[{id:0,name:Object(L.__)("Setup a New Profile","google-site-kit")}]}))}},{key:"handleProfileChange",value:function(e,t){var a=t.getAttribute("data-value");this.setState({selectedProfile:a}),Object(P.v)("analytics_setup","profile_change",a)}},{key:"getAccounts",value:function(){var e,t,a,n,i,o,s,r,l,d,u,g,m,p,h,_,b=this,f=arguments;return c.a.async((function(k){for(;;)switch(k.prev=k.next){case 0:return e=f.length>0&&void 0!==f[0]&&f[0],t=this.state,a=t.selectedAccount,n=t.selectedProperty,i=t.selectedProfile,o=t.useSnippet,s=this.props,r=s.isEditing,l=s.onSettingsPage,d=this.state.errorCode,u={},k.prev=5,g=e?{existingAccountID:e.accountID,existingPropertyID:e.propertyID}:{},k.next=9,c.a.awrap(O.c.get(O.b,"analytics","accounts-properties-profiles",g));case 9:0===(m=k.sent).accounts.length?(u=F({},u,{errorCode:"no_account",errorReason:"noAccount"}),O.c.invalidateCacheGroup(O.b,"analytics","accounts-properties-profiles")):a?a&&!m.accounts.find((function(e){return e.id===a}))&&(O.c.invalidateCacheGroup(O.b,"analytics","accounts-properties-profiles"),m.accounts.unshift({id:0,name:Object(L.__)("Select one...","google-site-kit")}),r&&(a="0",n="-1",i="-1"),u=F({},u,{errorCode:"insufficient_permissions",errorReason:"insufficientPermissions"})):(p=null,m.matchedProperty&&(p=m.matchedProperty),p?(a=p.accountId,n=p.id,(h=m.profiles.find((function(e){return e.accountId===a})))&&(i=h.id)):m.accounts.unshift({id:0,name:Object(L.__)("Select one...","google-site-kit")})),_={id:"-1",name:Object(L.__)("Select an account","google-site-kit")},this.state.existingTag||m.properties.push({id:0,name:Object(L.__)("Setup a New Property","google-site-kit")}),m.profiles.push({id:0,name:Object(L.__)("Setup a New Profile","google-site-kit")}),l||(o=!e),u=F({},u,{isLoading:!1,accounts:m.accounts,errorCode:d||u.errorCode,selectedAccount:a,selectedProperty:n,selectedProfile:i,properties:[_],profiles:[_],existingTag:!!e&&e.propertyID,useSnippet:o}),a&&"0"!==a&&(u=Object.assign(u,{properties:m.properties,profiles:m.profiles,selectedinternalWebProperty:m.properties[0]?m.properties[0].internalWebPropertyID:0})),k.next=22;break;case 19:k.prev=19,k.t0=k.catch(5),u={isLoading:!1,errorCode:k.t0.code,errorMsg:k.t0.message,errorReason:!(!k.t0.data||!k.t0.data.reason)&&k.t0.data.reason};case 22:return k.abrupt("return",new Promise((function(e){b._isMounted?b.setState(u,e):e()})));case 23:case"end":return k.stop()}}),null,this,[[5,19]])}},{key:"processAccountChange",value:function(e){var t,a,n,i;return c.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,t={accountID:e},o.next=4,c.a.awrap(O.c.get(O.b,"analytics","properties-profiles",t));case 4:a=o.sent,n={id:0,name:Object(L.__)("Setup a New Property","google-site-kit")},a.properties.push(n),i={id:0,name:Object(L.__)("Setup a New Profile","google-site-kit")},a.profiles.push(i),this.setState({propertiesLoading:!1,profilesLoading:!1,properties:a.properties,profiles:a.profiles,selectedAccount:e,selectedProperty:a.properties[0].id,selectedinternalWebProperty:a.properties[0].internalWebPropertyID,selectedProfile:a.profiles[0].id,errorCode:!1}),o.next=15;break;case 12:o.prev=12,o.t0=o.catch(0),this.setState({errorCode:o.t0.code,errorMsg:o.t0.message});case 15:case"end":return o.stop()}}),null,this,[[0,12]])}},{key:"processPropertyChange",value:function(e){var t,a,n;return c.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return t=this.state.selectedAccount,i.prev=1,a={accountID:t,propertyID:e},i.next=5,c.a.awrap(O.c.get(O.b,"analytics","profiles",a));case 5:n=i.sent,this.setState({profilesLoading:!1,profiles:n,selectedProperty:e,selectedinternalWebProperty:n[0].internalWebPropertyID,selectedProfile:n[0].id,errorCode:!1}),i.next=12;break;case 9:i.prev=9,i.t0=i.catch(1),this.setState({errorCode:i.t0.code,errorMsg:i.t0.message});case 12:case"end":return i.stop()}}),null,this,[[1,9]])}},{key:"handleSubmit",value:function(e){var t,a,n,i,o,s,r,l,d,u,g,m,p,h,_,b,f,k;return c.a.async((function(y){for(;;)switch(y.prev=y.next){case 0:if(e&&e.preventDefault(),this.state.selectedAccount&&"-1"!==this.state.selectedAccount){y.next=3;break}return y.abrupt("return");case 3:return t=this.state,a=t.anonymizeIP,n=t.selectedAccount,i=t.selectedProperty,o=t.selectedProfile,s=t.useSnippet,r=t.selectedinternalWebProperty,l=t.accounts,d=t.properties,u=t.profiles,g=t.ampClientIDOptIn,m=t.trackingDisabled,this.setState({isSaving:!0}),p=this.props.finishSetup,h=o||(u[0].id||0===u[0].id?u[0].id.toString():null),_=i||(d[0].id||0===d[0].id?d[0].id.toString():null),b="0"===_?"0":r||(d[0].internalWebPropertyId||0===d[0].internalWebPropertyId?d[0].internalWebPropertyId.toString():null),f={anonymizeIP:a,accountID:n||l[0].id||null,profileID:h,propertyID:_,internalWebPropertyID:b,useSnippet:s||!1,ampClientIDOptIn:g||!1,trackingDisabled:m},y.prev=10,y.next=13,c.a.awrap(O.c.set(O.b,"analytics","settings",f));case 13:return k=y.sent,O.c.invalidateCacheGroup(O.b,"analytics","accounts-properties-profiles"),y.next=17,c.a.awrap(this.getAccounts());case 17:googlesitekit.modules.analytics.settings=k,Object(P.v)("analytics_setup","analytics_configured"),p&&p(),this._isMounted&&this.setState({isSaving:!1,selectedAccount:k.accountID,selectedProfile:k.profileID,selectedProperty:k.propertyID,selectedinternalWebProperty:k.internalWebPropertyID}),y.next=26;break;case 23:y.prev=23,y.t0=y.catch(10),this.setState({isSaving:!1,errorCode:y.t0.code,errorMsg:y.t0.message});case 26:case"end":return y.stop()}}),null,this,[[10,23]])}},{key:"handleRadioClick",value:function(e){var t="1"===e.target.value;this.setState({useSnippet:t}),Object(P.v)("analytics_setup",t?"analytics_tag_enabled":"analytics_tag_disabled")}},{key:"switchStatus",value:function(e){var t=this;return function(){t.setState(y()({},e,!t.state[e]))}}},{key:"handleRefetchAccount",value:function(){this.setState({isLoading:!0,errorCode:!1,errorMsg:""}),this.getAccounts()}},{key:"handleExclusionsChange",value:function(e){var t=this.state.trackingDisabled,a=e.target,n=a.id,o=a.checked,c=Object.assign.apply(Object,[{}].concat(i()(t.map((function(e){return y()({},e,!0)}))),[y()({},n,o)]));this.setState({trackingDisabled:Object.keys(c).filter((function(e){return c[e]}))})}},{key:"renderAutoInsertSnippetForm",value:function(){var e=this.state,t=e.anonymizeIP,a=e.useSnippet,n=e.isSaving,i=e.ampClientIDOptIn,o=e.existingTag,c=this.props,s=c.isEditing,r=c.onSettingsPage,l=!s,d=window.googlesitekit.admin,u=d.ampEnabled,g=d.ampMode,m=window.googlesitekit.modules.analytics.settings.useSnippet;return React.createElement("div",{className:"googlesitekit-setup-module__inputs googlesitekit-setup-module__inputs--multiline"},(s||n)&&React.createElement(v.Fragment,null,r&&React.createElement(v.Fragment,null,!m&&!o&&React.createElement(v.Fragment,null,React.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(L.__)("Currently there is no Analytics snippet placed on your site, so no stats are being gathered. Would you like Site Kit to insert the Analytics snippet? You can change this setting later.","google-site-kit"))),m&&React.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(L.__)("Do you want to remove the Analytics snippet inserted by Site Kit?","google-site-kit"))),r&&!o&&!a&&m&&React.createElement("p",null,Object(L.__)("If the code snippet is removed, you will no longer be able to gather Analytics insights about your site.","google-site-kit"))),r&&React.createElement(v.Fragment,null,o&&React.createElement("p",null,Object(L.__)("Placing two tags at the same time is not recommended.","google-site-kit")),React.createElement(x,{onClick:this.handleRadioClick,id:"useSnippetTrue",name:"useSnippet",value:"1",checked:a,disabled:l},m?Object(L.__)("Not at this time","google-site-kit"):Object(L.__)("Insert snippet","google-site-kit")),React.createElement(x,{onClick:this.handleRadioClick,id:"useSnippetFalse",name:"useSnippet",value:"0",checked:!a,disabled:l},m?Object(L.__)("Remove snippet","google-site-kit"):Object(L.__)("Not at this time","google-site-kit"))),a&&u&&React.createElement("div",{className:"googlesitekit-setup-module__input"},React.createElement(N.a,{id:"ampClientIDOptIn",label:Object(L.__)("Opt in AMP Client ID","google-site-kit"),onClick:this.switchStatus("ampClientIDOptIn"),checked:i,hideLabel:!1}),React.createElement("p",null,i?Object(L.__)("Sessions will be combined across AMP/non-AMP pages.","google-site-kit")+" ":Object(L.__)("Sessions will be tracked separately between AMP/non-AMP pages.","google-site-kit")+" ",React.createElement(w.a,{href:"https://support.google.com/analytics/answer/7486764",external:!0,inherit:!0},Object(L.__)("Learn more","google-site-kit")))),r&&a&&"primary"!==g&&React.createElement("div",{className:"googlesitekit-setup-module__input"},React.createElement(N.a,{id:"anonymizeIP",label:Object(L.__)("Anonymize IP addresses","google-site-kit"),onClick:this.switchStatus("anonymizeIP"),checked:t,hideLabel:!1}),React.createElement("p",null,t?Object(L.__)("IP addresses will be anonymized.","google-site-kit"):Object(L.__)("IP addresses will not be anonymized.","google-site-kit")," ",React.createElement(w.a,{href:"https://support.google.com/analytics/answer/2763052",external:!0,inherit:!0,dangerouslySetInnerHTML:{__html:Object(L.__)('Learn more<span class="screen-reader-text"> about IP anonymization.</span>',"google-site-kit")}}))))}},{key:"accountsDropdown",value:function(){var e=this.state,t=e.accounts,a=e.selectedAccount,n=e.existingTag,i=!this.props.isEditing;return n&&a&&(i=!0),React.createElement(D.k,{enhanced:!0,name:"accounts",value:a||"0",onEnhancedChange:this.handleAccountChange,label:Object(L.__)("Account","google-site-kit"),disabled:i,outlined:!0},t.map((function(e,t){return React.createElement(D.j,{key:t,value:e.id},e.name)})))}},{key:"renderForm",value:function(){var e=this.state,a=e.anonymizeIP,n=e.isLoading,i=e.propertiesLoading,o=e.profilesLoading,c=e.accounts,s=e.properties,r=e.profiles,l=e.selectedAccount,d=e.selectedProperty,u=e.selectedProfile,g=e.useSnippet,m=e.existingTag,p=e.errorCode,h=e.trackingDisabled,_=this.props,b=_.onSettingsPage,f=_.isEditing,k=!f,y=!f;m&&d&&(y=!0);var O=window.googlesitekit.admin.ampMode,R=googlesitekit.modules.analytics.setupComplete;if(n)return React.createElement(j.a,null);if("google_analytics_existing_tag_permission"===p)return null;if(0>=c.length){if(!f)return Object(L.__)("No account found.","google-site-kit");if(!R||f)return React.createElement(v.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(S.a,{onClick:t.createNewAccount},Object(L.__)("Create an account","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(w.a,{onClick:this.handleRefetchAccount},Object(L.__)("Re-fetch My Account","google-site-kit")))))}if(!f){var E=g?Object(L.__)("Snippet is inserted","google-site-kit"):Object(L.__)("Snippet is not inserted","google-site-kit");return m&&(E=Object(L.__)("Inserted by another plugin or theme","google-site-kit")),React.createElement(v.Fragment,null,React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Account","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},l||c[0].name||!1)),React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Property","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},d||s[0].name||!1)),React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("View","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},u||r[0].name||!1))),React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item "},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Analytics Code Snippet","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},E))),b&&g&&"primary"!==O&&React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item "},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("IP Address Anonymization","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},a&&Object(L.__)("IP addresses are being anonymized.","google-site-kit"),!a&&Object(L.__)("IP addresses are not being anonymized.","google-site-kit")))),React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item "},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Excluded from Analytics","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},!!h.length&&h.map((function(e){return T[e]})).join(Object(L._x)(", ","list separator","google-site-kit")),!h.length&&Object(L.__)("Analytics is currently enabled for all visitors.","google-site-kit")))))}return React.createElement(v.Fragment,null,!b&&0<c.length&&!m&&React.createElement("p",null,Object(L.__)("Please select the account information below. You can change this view later in your settings.","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__inputs"},this.accountsDropdown(),i?React.createElement(j.a,{small:!0}):React.createElement(D.k,{enhanced:!0,name:"properties",value:d||0===d?d.toString():"-1",onEnhancedChange:this.handlePropertyChange,label:Object(L.__)("Property","google-site-kit"),disabled:y,outlined:!0},s.map((function(e,t){return React.createElement(D.j,{key:t,value:e.id},e.name)}))),o?React.createElement(j.a,{small:!0}):React.createElement(D.k,{enhanced:!0,name:"profiles",value:u||0===u?u.toString():"-1",onEnhancedChange:this.handleProfileChange,label:Object(L.__)("View","google-site-kit"),disabled:k,outlined:!0},r.map((function(e,t){return React.createElement(D.j,{key:t,value:e.id},e.name)})))),this.renderAutoInsertSnippetForm(),b&&this.renderExclusionsForm(),!b&&React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(S.a,{disabled:!this.state.selectedAccount,onClick:this.handleSubmit},Object(L.__)("Configure Analytics","google-site-kit"))))}},{key:"renderExclusionsForm",value:function(){var e=this.state.trackingDisabled;return React.createElement("div",null,React.createElement("p",{className:"googlesitekit-setup-module__text"},Object(L.__)("Exclude from Analytics","google-site-kit")),React.createElement("div",{className:"mdc-form-field"},React.createElement(N.a,{id:"loggedinUsers",label:T.loggedinUsers,onClick:this.handleExclusionsChange,checked:e.includes("loggedinUsers"),hideLabel:!1})),React.createElement("p",null,e.includes("loggedinUsers")?Object(L.__)("Logged-in users will be excluded from Analytics tracking.","google-site-kit"):Object(L.__)("Logged-in users will be included in Analytics tracking.","google-site-kit")))}},{key:"renderErrorOrNotice",value:function(){var e=this.state,t=e.errorCode,a=e.errorMsg,n=e.errorReason,i=e.accounts,o=this.props.onSettingsPage;if(!t)return null;var c=!0,s=a;switch(!0){case"google_analytics_existing_tag_permission"===t:c=!1;break;case o&&t&&"insufficientPermissions"===n:c=!1,s=Object(L.__)("You currently don't have access to this Google Analytics account. You can either request access from your team, or remove this Google Analytics snippet and connect to a different account.","google-site-kit");break;case!o&&0===i.length:c=!1,s=Object(L.__)('Looks like you don\'t have an Analytics account yet. Once you create it, click on "Re-fetch my account" and Site Kit will locate it.',"google-site-kit")}return 0===s.length?null:React.createElement("div",{className:c?"googlesitekit-error-text":""},React.createElement("p",null,c?
10
/* translators: %s: Error message */
11
- Object(L.sprintf)(Object(L.__)("Error: %s","google-site-kit"),s):s))}},{key:"render",value:function(){var e=this.props.onSettingsPage,t=this.state.existingTag;return e||Object(P.v)("analytics_setup","configure_analytics_screen"),React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--analytics"},!e&&React.createElement(v.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(A.a,{id:"analytics",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(L._x)("Analytics","Service name","google-site-kit"))),!!t&&React.createElement("p",null,Object(L.sprintf)(Object(L.__)("An existing analytics tag was found on your site with the id %s. If later on you decide to replace this tag, Site Kit can place the new tag for you. Make sure you remove the old tag first.","google-site-kit"),t)),this.renderErrorOrNotice(),this.renderForm())}}],[{key:"createNewAccount",value:function(e){e.preventDefault(),Object(P.v)("analytics_setup","new_analytics_account"),window.open("https://analytics.google.com/analytics/web/?#/provision/SignUp","_blank")}}]),t}(v.Component);U.propTypes={onSettingsPage:E.a.bool,finishSetup:E.a.func,isEditing:E.a.bool},U.defaultProps={onSettingsPage:!0,isEditing:!1};t.default=U},,function(e,t,a){"use strict";a.r(t);var n=a(68),i=a.n(n),o=a(27),c=a.n(o),s=a(12),r=a.n(s),l=a(3),d=a.n(l),u=a(4),g=a.n(u),m=a(5),p=a.n(m),h=a(6),_=a.n(h),b=a(7),f=a.n(b),k=a(1),y=a(8),v=a.n(y),O=a(20),R=a(0),E=a(99),S=a(74),j=a(2),w=a(42);function D(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function C(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?D(a,!0).forEach((function(t){c()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):D(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var x=function(e){function t(e){var a;return d()(this,t),(a=p()(this,_()(t).call(this,e))).state={accountStatus:void 0,loadingMessage:Object(R.__)("Loading…","google-site-kit"),instructionProps:{}},a}return f()(t,e),g()(t,[{key:"componentDidMount",value:function(){return r.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.a.awrap(this.updateAccountStatus());case 2:case"end":return e.stop()}}),null,this)}},{key:"componentDidUpdate",value:function(e,t){var a=this.state.accountStatus;if(t.accountStatus!==a){var n=Object(w.propsFromAccountStatus)(a);this.setState({instructionProps:n})}}},{key:"continueSetup",value:function(e){var t=this.state.instructionProps;e.existingState=C({},t),this.setState({instructionProps:e})}},{key:"goBack",value:function(){var e=C({},this.state.instructionProps).existingState;e&&(e.existingState=!1,this.setState({instructionProps:e}))}},{key:"updateAccountStatus",value:function(){var e,t,a,n,i,o=this;return r.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,r.a.awrap(Object(j.k)("adsense"));case 2:return e=c.sent,t=function(e){o.setState({loadingMessage:e})},c.next=6,r.a.awrap(Object(w.getAdSenseAccountStatus)(e,t));case 6:a=c.sent,n=a.accountStatus,i=a.clientID,this.setState({accountStatus:n,clientID:i});case 10:case"end":return c.stop()}}),null,this)}},{key:"render",value:function(){var e=this.state,t=e.accountStatus,a=e.clientID,n=e.loadingMessage,o=e.instructionProps,c=!t||!googlesitekit.modules.adsense.setupComplete||["ads-display-pending","account-pending-review","account-required-action"].includes(t);return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},React.createElement("div",{className:"googlesitekit-setup-module__step"},React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(O.a,{id:"adsense",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(R._x)("AdSense","Service name","google-site-kit"))),React.createElement("div",{className:"googlesitekit-setup-module__step"},!googlesitekit.canAdsRun&&!googlesitekit.modules.adsense.setupComplete&&React.createElement("div",{className:"googlesitekit-settings-module-warning"},React.createElement(O.a,{id:"error",height:"20",width:"23"}),Object(R.__)("Ad blocker detected, you need to disable it in order to setup AdSense.","google-site-kit")),c&&"account-connected"!==t&&React.createElement(S.default,{ctaLink:o.ctaLink,ctaLinkText:o.ctaLinkText,header:o.statusHeadline,subHeader:o.statusMessage,incomplete:o.incomplete,required:o.required,loadingMessage:!t&&n}),googlesitekit.canAdsRun&&t&&(googlesitekit.modules.adsense.setupComplete||"account-connected"===t)&&React.createElement(E.default,i()({},o,{accountStatus:t,clientID:a,continueSetup:this.continueSetup,goBack:this.goBack}))))}}]),t}(k.Component);x.propTypes={status:v.a.string,module:v.a.string},t.default=x},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(20),h=a(14),_=a(29),b=a(75),f=a(9),k=a(62),y=a(18),v=a(2),O=a(0),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={isSaving:!1},a}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this,t=this.props,a=t.error,n=t.message,i=t.issue,o=t.notice,c=t.statusHeadline,s=t.statusMessage,r=t.profile,l=t.ctaLinkText,d=t.ctaLink,u=t.footerText,g=t.footerAppendedText,m=t.footerCTA,R=t.footerCTALink,E=t.continueAction,S=t.continueSetup,j=t.accountStatus,w=t.accountTagMatch,D=t.clientID,C=t.existingTag,x=t.switchLabel,N=t.tracking,A=t.switchOffMessage,P=t.switchOnMessage,L=t.goBack,M=t.existingState,I=this.state.isSaving,F=googlesitekit.admin.userData,T=F.email,U=void 0===T?"":T,z=F.picture,q=void 0===z?"":z;return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},React.createElement("div",{className:"googlesitekit-setup-module__step"},i&&React.createElement("p",{className:"googlesitekit-setup__notice"},React.createElement(p.a,{id:"error",height:"20",width:"23"}),React.createElement("span",{className:"googlesitekit-setup__notice-text"},i)),React.createElement("h2",{className:" googlesitekit-heading-4 googlesitekit-setup-module__title "},c),React.createElement("p",null,s),r&&React.createElement("p",{className:"googlesitekit-setup-module__user"},q&&React.createElement("img",{className:"googlesitekit-setup-module__user-image",src:q,alt:Object(O.__)("User Avatar","google-site-kit")}),React.createElement("span",{className:"googlesitekit-setup-module__user-email"},U)),"account-connected"===j&&React.createElement(b.default,{isEditing:!0,accountTagMatch:w,existingTag:C,saveOnChange:!0,switchLabel:x,switchOffMessage:A,switchOnMessage:P}),o&&React.createElement("div",{className:"googlesitekit-settings-notice"},React.createElement("div",{className:"googlesitekit-settings-notice__text"},o)),a&&0<n.length&&React.createElement("div",{className:"googlesitekit-error-text"},React.createElement("p",null,Object(O.__)("Error:","google-site-kit")," ",n)),React.createElement("div",{className:"googlesitekit-setup-module__action"},"account-connected"===j&&React.createElement(y.Fragment,null,React.createElement(_.a,{disabled:I,onClick:function(){N&&Object(v.v)(N.eventCategory,N.eventName),e.setState({isSaving:!0});var t=document.getElementById("enableAutoAds"),a=t&&t.checked;f.c.set(f.b,"adsense","setup-complete",{clientID:D,useSnippet:a}).then((function(){document.location=d})).catch((function(){e.setState({isSaving:!1})}))}},l),React.createElement(k.a,{isSaving:I})),"account-connected"!==j&&React.createElement(h.a,{className:"googlesitekit-setup-module__cta-link",external:!0,inherit:!0,href:d},l),E&&React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(h.a,{inherit:!0,onClick:function(){S(E)}},E.continueText)),M&&React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(h.a,{inherit:!0,onClick:function(){L()}},Object(O.__)("Back","google-site-kit")))),u&&React.createElement("p",{className:"googlesitekit-setup-module__footer-text"},u," ",m&&React.createElement(h.a,{href:R,inherit:!0,external:!0},m)," ",g)))}}]),t}(m.Component);t.default=R},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(21),p=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(p.Component);t.default=Object(m.a)("googlesitekit.AnalyticsAdSenseTopPagesTableSmall")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(21),p=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(p.Component);t.default=Object(m.a)("googlesitekit.AnalyticsAdSenseTopPagesTable")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(41),h=a(100),_=a(103),b=a(53),f=a(0),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(p.a,{title:Object(f.__)("Earnings","google-site-kit"),description:Object(f.__)("How much you’re earning from your content through AdSense.","google-site-kit"),timePeriod:Object(f.__)("Last 28 days","google-site-kit")}),React.createElement(b.a,{slug:"adsense",context:"module-sitekit-dashboard"})),React.createElement(_.default,null),React.createElement(h.default,null))}}]),t}(m.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(19),h=a(9),_=a(23),b=a(2),f=a(25),k=a(51),y=a(0),v=a(42),O=a(17),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={today:!1,period:!1,daily:!1},a}return g()(t,e),c()(t,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var e=this.state,t=e.today,a=e.period,n=e.daily;if(!(t&&a&&n&&a.totals))return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(O.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},React.createElement(_.a,{width:"100%",height:"276px",padding:!0})));var i=Object(v.reduceAdSenseData)(n.rows),o=Object(b.n)("googlesitekit-module-adsense",{}),c=a.headers.find((function(e){return null!==e.currency&&0<e.currency.length})),s=!!c&&c.currency;return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(O.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{className:"overview-adsense-rpm",title:Object(y.__)("RPM","google-site-kit"),datapoint:Object(b.t)(a.totals[1],s),source:{name:Object(y._x)("AdSense","Service name","google-site-kit"),link:o},sparkline:n&&React.createElement(k.a,{data:Object(b.f)(i.dataMap,2),change:1,id:"adsense-rpm-sparkline",loadSmall:!1}),context:"compact"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{className:"overview-adsense-earnings",title:Object(y.__)("Total Earnings","google-site-kit"),datapoint:Object(b.t)(a.totals[0],s),source:{name:Object(y._x)("AdSense","Service name","google-site-kit"),link:o},change:t.totals[0],changeDataUnit:"quot;,sparkline:n&&React.createElement(k.a,{data:Object(b.f)(i.dataMap,1),change:1,id:"adsense-earnings-sparkline",loadSmall:!1}),context:"compact"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{className:"overview-adsense-impressions",title:Object(y.__)("Ad Impressions","google-site-kit"),datapoint:Object(b.t)(a.totals[2]),source:{name:Object(y._x)("AdSense","Service name","google-site-kit"),link:o},sparkline:n&&React.createElement(k.a,{data:Object(b.f)(i.dataMap,3),change:1,id:"adsense-impressions-sparkline",loadSmall:!1}),context:"compact"})))))))}}]),t}(m.Component);t.default=Object(p.a)(R,[{type:h.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"today"},priority:1,maxAge:Object(b.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.today)return{today:a}}},{type:h.b,identifier:"adsense",datapoint:"earnings",data:{},priority:1,maxAge:Object(b.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.period)return{period:a}}},{type:h.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month",dimensions:["DATE"]},priority:1,maxAge:Object(b.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.daily)return{daily:a}}}],React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(O.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},React.createElement(_.a,{width:"100%",height:"276px",padding:!0}))),{inGrid:!0,createGrid:!0},v.isDataZeroAdSense)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(25),h=a(23),_=a(2),b=a(19),f=a(9),k=a(42),y=a(0),v=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={refetch:!1,today:!1,yesterday:!1,sevenDays:!1,month:!1,twentyEightDays:!1,sameDayLastWeek:!1,prev7Days:!1,monthLastYear:!1,prev28Days:!1,error:!1,message:""},a}return g()(t,e),c()(t,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var e=this.state,a=e.today,n=e.yesterday,i=e.sevenDays,o=e.month,c=e.twentyEightDays,s=e.sameDayLastWeek,r=e.prev7Days,l=e.monthLastYear,d=e.prev28Days;if(!(a&&n&&i&&o&&c&&s&&r&&l&&d))return null;var u=a.headers.find((function(e){return null!==e.currency&&0<e.currency.length})),g=!!u&&u.currency,m=a.totals?[{className:"googlesitekit-data-block--today",title:Object(y.__)("Today so far","google-site-kit"),datapoint:Object(_.t)(a.totals[0],g)},{className:"googlesitekit-data-block--yesterday",title:Object(y.__)("Yesterday","google-site-kit"),datapoint:Object(_.t)(n.totals[0],g),change:s.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--7days",title:Object(y.__)("Last 7 days","google-site-kit"),datapoint:Object(_.t)(i.totals[0],g),change:r.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--month",title:Object(y.__)("This month","google-site-kit"),datapoint:Object(_.t)(o.totals[0],g),change:l.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--28days",title:Object(y.__)("Last 28 days","google-site-kit"),datapoint:Object(_.t)(c.totals[0],g),change:d.totals[0],changeDataUnit:"%"}]:[];return t.renderLayout(m)}}],[{key:"renderLayout",value:function(e){return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},e.map((function(e,t){return React.createElement("div",{key:t,className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-top mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},React.createElement(p.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection}))}))))}},{key:"renderPreviews",value:function(){for(var e=[],t=0;5>t;t++)e.push(React.createElement("div",{key:t,className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-top mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},React.createElement(h.a,{width:"100%",height:"104px"})));return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},e))}}]),t}(m.Component);t.default=Object(b.a)(v,[{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"today"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.today)return{today:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"yesterday"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.yesterday)return{yesterday:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"same-day-last-week"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.sameDayLastWeek)return{sameDayLastWeek:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-7-days"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.sevenDays)return{sevenDays:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-7-days"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev7Days)return{prev7Days:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.month)return{month:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month-last-year"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.monthLastYear)return{monthLastYear:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-28-days"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.twentyEightDays)return{twentyEightDays:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-28-days"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev28Days)return{prev28Days:a}}}],v.renderPreviews(),{createGrid:!0},k.isDataZeroAdSense)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(9),h=a(25),_=a(23),b=a(2),f=a(42),k=a(19),y=a(0),v=a(11),O=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={twentyEightDays:!1,prev28Days:!1},a}return g()(t,e),c()(t,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var e=this.state,t=e.twentyEightDays,a=e.prev28Days,n=t.totals?[{className:"googlesitekit-data-block--page-rpm",title:Object(y.__)("Page RPM","google-site-kit"),datapoint:Object(b.t)(t.totals[1]),change:Object(v.isUndefined)(a.totals)?0:a.totals[1],changeDataUnit:"%"},{className:"googlesitekit-data-block--impression",title:Object(y.__)("Impressions","google-site-kit"),datapoint:Object(b.t)(t.totals[2]),change:Object(v.isUndefined)(a.totals)?0:a.totals[2],changeDataUnit:"%"}]:[];return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},n.map((function(e,t){return React.createElement("div",{key:t,className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-top mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},React.createElement(h.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection}))}))))}}]),t}(m.Component);t.default=Object(k.a)(O,[{type:p.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-28-days"},priority:1,maxAge:Object(b.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.twentyEightDays)return{twentyEightDays:a}}},{type:p.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-28-days"},priority:1,maxAge:Object(b.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev28Days)return{prev28Days:a}}}],React.createElement(_.a,{width:"100%",height:"250px"}),{},f.isDataZeroAdSense)},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(13),p=a.n(m),h=a(7),_=a.n(h),b=a(1),f=a(44),k=a(47),y=a(17),v=a(0),O=a(104),R=a(105),E=a(72),S=a(101),j=a(55),w=a(45),D=a(31),C=a(76),x=a(42),N=a(53),A=a(74),P=a(43),L=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={receivingData:!0,error:!1,loading:!0,isAdSenseConnected:!0,zeroData:!1,instructionProps:{}},a.handleDataError=a.handleDataError.bind(p()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(p()(a)),a.handleZeroData=a.handleZeroData.bind(p()(a)),a}return _()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.isAdSenseConnected()}},{key:"isAdSenseConnected",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(Object(x.isAdsenseConnectedAnalytics)());case 2:e.sent?this.setState({isAdSenseConnected:!0}):this.setState({isAdSenseConnected:!1});case 4:case"end":return e.stop()}}),null,this)}},{key:"handleDataError",value:function(e){this.setState({receivingData:!1,error:e,loading:!1})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0,loading:!1})}},{key:"handleZeroData",value:function(){var e=Object(x.propsFromAccountStatus)("account-connected-no-data");this.setState({zeroData:!0,loading:!1,instructionProps:e})}},{key:"render",value:function(){var e=this,t=this.state,a=t.receivingData,n=t.error,i=t.loading,o=t.isAdSenseConnected,c=t.zeroData,s=t.instructionProps,r=googlesitekit.modules.adsense.homepage,l=i||!a||c?"googlesitekit-nodata":"";return React.createElement(b.Fragment,null,React.createElement(f.a,null),React.createElement("div",{className:"".concat(l)},React.createElement(E.a,{module:"adsense"})),React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--adsense"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},!n&&googlesitekit.modules.adsense.setupComplete?React.createElement(k.a,{title:Object(v._x)("AdSense","Service name","google-site-kit"),icon:!0,iconWidth:"30",iconHeight:"26",iconID:"adsense",status:"connected",statusText:Object(v.__)("AdSense is connected","google-site-kit")}):React.createElement(k.a,{title:Object(v._x)("AdSense","Service name","google-site-kit"),icon:!0,iconWidth:"30",iconHeight:"26",iconID:"adsense",status:"not-connected",statusText:Object(v.__)("AdSense is not connected","google-site-kit")}),i&&React.createElement(D.a,null)),c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(y.a,{fill:!0},React.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(A.default,{ctaLink:s.ctaLink,ctaLinkText:s.ctaLinkText,header:s.statusHeadline,subHeader:s.statusMessage,incomplete:s.incomplete,required:s.required})))))),!a&&(n?Object(w.a)(Object(v._x)("AdSense","Service name","google-site-kit"),n,!0,!0,!0):Object(j.a)(Object(v._x)("AdSense","Service name","google-site-kit"),!0,!0,!0)),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(l,"\n\t\t\t\t\t\t\t")},React.createElement(N.a,{slug:"adsense",context:"module-dashboard"}),React.createElement(y.a,{header:!0,title:Object(v.__)("Estimated earnings","google-site-kit"),headerCtaLabel:Object(v.__)("Advanced Settings","google-site-kit"),headerCtaLink:r},React.createElement(O.default,{handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(l,"\n\t\t\t\t\t\t\t")},React.createElement(y.a,{header:!0,title:Object(v.__)("Performance over previous 28 days","google-site-kit"),headerCtaLabel:Object(v.__)("Advanced Settings","google-site-kit"),headerCtaLink:r},React.createElement(R.default,{handleDataError:function(t){t||e.handleZeroData()}}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(l,"\n\t\t\t\t\t\t\t")},React.createElement(S.default,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(P.a,null))))),!o&&React.createElement(C.default,null))}}]),t}(b.Component);t.default=L},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(2),h=a(14),_=a(0),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.slug,a=e.screenID,n=e.OriginalComponent,i=googlesitekit.modules.adsense.settings.accountStatus;return i&&"adsense"===t&&("account-pending-review"===i||"ads-display-pending"===i)?React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},Object(_.__)("Site Kit has placed the code on your site, ","google-site-kit"),React.createElement(h.a,{className:"googlesitekit-settings-module__edit-button",onClick:function(){var e=a||"googlesitekit-dashboard";window.location=Object(p.n)(e,{reAuth:!0,slug:t})},inherit:!0},Object(_.__)("check module page","google-site-kit"))):React.createElement(n,this.props)}}]),t}(m.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(20),h=a(0),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.slug,a=e.context,n=e.OriginalComponent;if("adsense"!==t)return React.createElement(n,this.props);var i=googlesitekit.modules.adsense,o=i.active,c=i.setupComplete,s=Object(h.__)("Ad blocker detected, you need to disable it in order to setup AdSense.","google-site-kit");return o&&c&&(s=Object(h.__)("Ad blocker detected, You need to disable it to get the AdSense latest data.","google-site-kit")),googlesitekit.canAdsRun?React.createElement(n,this.props):React.createElement("div",{className:"googlesitekit-settings-module-warning googlesitekit-settings-module-warning--".concat(a)},React.createElement(p.a,{id:"error",height:"20",width:"23"})," ",s)}}]),t}(m.Component);t.default=_},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(29),b=a(0),f=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).renderAccountSetup=a.renderAccountSetup.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"renderAccountSetup",value:function(){if("no-account"===this.props.accountStatus)return React.createElement(_.a,{onClick:t.createNewAccount},Object(b.__)("Sign up for AdSense","google-site-kit"))}},{key:"render",value:function(){return React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},this.renderAccountSetup()))}}],[{key:"createNewAccount",value:function(e){e.preventDefault();var t=googlesitekit.modules.adsense.signupURL;window.open(t,"_blank")}}]),t}(h.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(25),b=a(19),f=a(9),k=a(2),y=a(15),v=a(23),O=a(0);function R(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var E=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||e.error||!e.length)return null;var t=Object(y.calculateOverviewData)(e);if(!t)return null;var a=t.totalUsers,n=t.totalSessions,i=t.totalUsersChange,o=t.totalSessionsChange;return React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(_.a,{className:"overview-total-users",title:Object(O.__)("Total Users","google-site-kit"),datapoint:Object(k.t)(a),change:i,changeDataUnit:"%"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(_.a,{className:"overview-total-sessions",title:Object(O.__)("Total Sessions","google-site-kit"),datapoint:Object(k.t)(n),change:o,changeDataUnit:"%"})))}}]),t}(h.Component);t.default=Object(b.a)(E,[{type:f.b,identifier:"analytics",datapoint:"report",data:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?R(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):R(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},y.overviewReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(k.p)("day"),context:"Adminbar"}],React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(v.a,{width:"auto",height:"59px"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(v.a,{width:"auto",height:"59px"}))),{inGrid:!0},y.isDataZeroForReporting,y.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(49),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(110),b=a(63),f=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){return"undefined"!==i()(googlesitekit.permaLink)&&""===googlesitekit.permaLink?null:googlesitekit.modules.analytics.active?React.createElement(_.default,null):React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(b.a,null)))}}]),t}(h.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(41),h=a(17),_=a(0),b=a(77),f=a(66),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(p.a,{title:Object(_.__)("All Traffic","google-site-kit"),description:Object(_.__)("How people found your page.","google-site-kit")})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{className:"googlesitekit-analytics-acquisition-sources",footer:!0,headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(_.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(_._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(f.default,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(b.default,null)))))))}}]),t}(m.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(19),h=a(9),_=a(2),b=a(28),f=a(95),k=a(38),y=a(11),v=a(0),O=a(15),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=[{title:Object(v.__)("Source","google-site-kit"),primary:!0},{title:Object(v.__)("Percent","google-site-kit")}],a=e[0].data.totals[0].values[0],n=Object(y.map)(e[0].data.rows,(function(e,t){var n=e.metrics[0].values[0]/a*100;return!(1>n)&&[e.dimensions[0],React.createElement(m.Fragment,{key:"minichart-"+t},React.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(n.toFixed(2),"%")," ",React.createElement(f.a,{percent:n.toFixed(1),index:t})))]})),i=Object(b.b)(n,t,{hideHeader:!0,chartsEnabled:!0});return React.createElement("div",{className:"googlesitekit-alltraffic-widget"},React.createElement(b.a,null,i))}}]),t}(m.Component);t.default=Object(p.a)(R,[{type:h.b,identifier:"analytics",datapoint:"report",data:O.trafficSourcesReportDataDefaults,priority:1,maxAge:Object(_.p)("day"),context:"Dashboard"}],React.createElement(k.a,{rows:3,rowHeight:50}))},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(66),b=a(113),f=a(0),k=a(17),y=a(41),v=a(55),O=a(45),R=a(90),E=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={receivingData:!0,error:!1},a.handleDataError=a.handleDataError.bind(g()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"handleDataError",value:function(e){this.setState({receivingData:!1,error:e})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0})}},{key:"getErrorDataComponent",value:function(){var e=googlesitekit.modules.analytics,t=e.active,a=e.setupComplete,n=this.state,i=n.error,o=n.receivingData;return t&&!a?Object(R.a)("analytics",!0,!0,!0):o?null:i?Object(O.a)(Object(f._x)("Analytics","Service name","google-site-kit"),i,!0,!0,!0):Object(v.a)(Object(f._x)("Analytics","Service name","google-site-kit"),!0,!0,!0)}},{key:"render",value:function(){var e=this.state,t=e.error,a=e.receivingData,n=t||!a?"googlesitekit-nodata":"";return React.createElement(h.Fragment,null,React.createElement("div",{className:"\n\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t"},React.createElement(y.a,{timePeriod:Object(f.__)("Last 28 days","google-site-kit"),description:Object(f.__)("How people found your site.","google-site-kit"),title:Object(f.__)("All Traffic","google-site-kit")})),this.getErrorDataComponent(),React.createElement("div",{className:"\n\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t".concat(n,"\n\t\t\t\t")},React.createElement(k.a,{className:"googlesitekit-dashboard-all-traffic"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(_.default,{source:!0,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(b.default,null)))))))}}]),t}(h.Component);t.default=E},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(19),h=a(9),_=a(2),b=a(28),f=a(17),k=a(38),y=a(11),v=a(0),O=a(15),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var a=[{title:Object(v.__)("Page Title","google-site-kit"),tooltip:Object(v.__)("Page Title","google-site-kit"),primary:!0},{title:Object(v.__)("Earnings","google-site-kit"),tooltip:Object(v.__)("Earnings","google-site-kit")},{title:Object(v.__)("Page RPM","google-site-kit"),tooltip:Object(v.__)("Page RPM","google-site-kit")},{title:Object(v.__)("Impressions","google-site-kit"),tooltip:Object(v.__)("Impressions","google-site-kit")}],n=Object(y.map)(e[0].data.rows,(function(e){return[e.dimensions[0],Number(e.metrics[0].values[0]).toFixed(2),Number(e.metrics[0].values[1]).toFixed(2),Object(_.r)(e.metrics[0].values[2])]})),i=googlesitekit.modules.analytics.settings,o=i.accountID,c=i.internalWebPropertyID,s=i.profileID,r="https://analytics.google.com/analytics/web/?pli=1#/report/content-pages/a".concat(o,"w").concat(c,"p").concat(s,"/explorer-table.plotKeys=%5B%5D&_r.drilldown=analytics.pagePath:~2F"),l={hideHeader:!1,chartsEnabled:!1,links:Object(y.map)(e[0].data.rows,(function(e){var t=e.dimensions[1].replace(/\//g,"~2F");return r+t}))},d=Object(b.b)(n,a,l);return t.renderLayout(React.createElement(b.a,null,d))}}],[{key:"renderLayout",value:function(e){var t=googlesitekit.modules.adsense.accountURL;return React.createElement(f.a,{header:!0,title:Object(v.__)("Performance over previous 28 days","google-site-kit"),headerCtaLabel:Object(v.__)("Advanced Settings","google-site-kit"),headerCtaLink:t},e)}}]),t}(m.Component);t.default=Object(p.a)(R,[{type:h.b,identifier:"analytics",datapoint:"report",data:O.analyticsAdsenseReportDataDefaults,priority:1,maxAge:Object(_.p)("day"),context:"Single"}],R.renderLayout(React.createElement(k.a,{padding:!0})),{inGrid:!0,fullWidth:!0,createGrid:!0},(function(){return!1}),(function(e){return!(!e||!e.error)&&(400===e.error.code&&"INVALID_ARGUMENT"===e.error.status&&googlesitekit.modules.analytics.active?null:e.error.message?e.error.message:e.error.errors&&e.error.errors[0]&&e.error.errors[0].message?e.error.errors[0].message:Object(v.__)("Unidentified error","google-site-kit"))}))},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(25),h=a(19),_=a(9),b=a(2),f=a(15),k=a(23),y=a(8),v=a.n(y),O=a(0),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,n=e.handleStatSelection;if(!t||!t.length)return null;var i=Object(f.calculateOverviewData)(t);if(!i)return null;var o=i.totalUsers,c=i.totalSessions,s=i.averageBounceRate,r=i.averageSessionDuration,l=i.totalUsersChange,d=i.totalSessionsChange,u=i.averageBounceRateChange,g=i.averageSessionDurationChange,m=[{className:"googlesitekit-data-block--users googlesitekit-data-block--button-1",title:Object(O.__)("Users","google-site-kit"),datapoint:Object(b.t)(o),change:l,changeDataUnit:"%",context:"button",selected:a.includes(0),handleStatSelection:n},{className:"googlesitekit-data-block--sessions googlesitekit-data-block--button-2",title:Object(O.__)("Sessions","google-site-kit"),datapoint:Object(b.t)(c),change:d,changeDataUnit:"%",context:"button",selected:a.includes(1),handleStatSelection:n},{className:"googlesitekit-data-block--bounce googlesitekit-data-block--button-3",title:Object(O.__)("Bounce Rate","google-site-kit"),datapoint:Number(s).toFixed(2),change:u,changeDataUnit:"%",context:"button",selected:a.includes(2),handleStatSelection:n,datapointUnit:"%",reverseArrowDirection:!0},{className:"googlesitekit-data-block--duration googlesitekit-data-block--button-4",title:Object(O.__)("Session Duration","google-site-kit"),datapoint:Object(b.s)(r),change:g,changeDataUnit:"%",context:"button",selected:a.includes(3),handleStatSelection:n}];return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner",role:"toolbar","aria-label":"Line Chart Options"},m.map((function(e,t){return React.createElement("div",{key:t,className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(p.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection,datapointUnit:e.datapointUnit,reverseArrowDirection:e.reverseArrowDirection}))}))))}}]),t}(m.Component);R.propTypes={handleDataError:v.a.func.isRequired},t.default=Object(h.a)(R,[{type:_.b,identifier:"analytics",datapoint:"report",data:f.overviewReportDataDefaults,priority:1,maxAge:Object(b.p)("day"),context:["Single","Dashboard"]}],React.createElement(k.a,{width:"100%",height:"190px",padding:!0}),{createGrid:!0},f.isDataZeroForReporting,f.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(61),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(19),b=a(9),f=a(2),k=a(28),y=a(38),v=a(17),O=a(11),R=a(0),E=a(15),S=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data,a=googlesitekit.admin.siteURL;if(!e||!e.length)return null;var n=[{title:Object(R.__)("Most popular content","google-site-kit"),primary:!0},{title:Object(R.__)("Views","google-site-kit")}],o=[],c=Object(O.map)(e[0].data.rows,(function(e,t){var n=i()(e.dimensions,2),c=n[0],s=n[1];return o[t]=a+s,[c,Object(f.r)(e.metrics[0].values[0])]})),s={hideHeader:!1,chartsEnabled:!1,links:o,showURLs:!0},r=Object(k.b)(c,n,s);return t.renderLayout(React.createElement(k.a,null,r))}}],[{key:"renderLayout",value:function(e){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(v.a,{className:"googlesitekit-popular-content",footer:!0,footerCtaLabel:Object(R._x)("Analytics","Service name","google-site-kit"),footerCtaLink:googlesitekit.modules.analytics.homepage,fill:!0},e))}}]),t}(h.Component);t.default=Object(_.a)(S,[{type:b.b,identifier:"analytics",datapoint:"report",data:Object(E.getTopPagesReportDataDefaults)(),priority:1,maxAge:Object(f.p)("day"),context:["Single","Dashboard"]}],S.renderLayout(React.createElement(y.a,{padding:!0})),{inGrid:!0,createGrid:!0},E.isDataZeroForReporting)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(56),b=a(2),f=a(19),k=a(9),y=a(15),v=a(23),O=a(0),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).setOptions=a.setOptions.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"setOptions",value:function(){var e=this.props,t=e.series,a=e.vAxes,n={chart:{title:""===googlesitekit.pageTitle?"":Object(O.__)("Users Traffic Summary","google-site-kit")},curveType:"line",height:270,width:"100%",chartArea:{height:"80%",width:"87%"},legend:{position:"top",textStyle:{color:"#616161",fontSize:12}},hAxis:{format:"M/d/yy",gridlines:{color:"#fff"},textStyle:{color:"#616161",fontSize:12}},vAxis:{gridlines:{color:"#eee"},minorGridlines:{color:"#eee"},textStyle:{color:"#616161",fontSize:12},titleTextStyle:{color:"#616161",fontSize:12,italic:!1}}};return n.series=t,n.vAxes=a,n}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,n=e.dateRangeFrom;if(!t||!t.length)return null;var i=n?n.match(/\d+/).map(Number)[0]:28,o=Object(y.extractAnalyticsDashboardData)(t,a,i);if(!o)return null;var c=this.setOptions();return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(_.a,{selectedStats:a,data:o,options:c}))))}}]),t}(h.Component);t.default=Object(f.a)(R,[{type:k.b,identifier:"analytics",datapoint:"report",data:y.siteAnalyticsReportDataDefaults,priority:1,maxAge:Object(b.p)("day"),context:"Single"}],React.createElement(v.a,{width:"100%",height:"270px",padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(11),h=a(19),_=a(9),b=a(2),f=a(28),k=a(38),y=a(17),v=a(32),O=a(0),R=a(15),E=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var a=[{title:Object(O.__)("Top Earning Pages","google-site-kit"),tooltip:Object(O.__)("Top Earning Pages","google-site-kit"),primary:!0},{title:Object(O.__)("Revenue","google-site-kit"),tooltip:Object(O.__)("Revenue","google-site-kit")}],n=[],i=Object(p.map)(e[0].data.rows,(function(e,t){return n[t]=e.dimensions[1],[e.dimensions[0],Number(e.metrics[0].values[0]).toFixed(2)]})),o={hideHeader:!1,chartsEnabled:!1,cap:5,links:n},c=Object(f.b)(i,a,o);return t.renderLayout(React.createElement(f.a,null,c))}}],[{key:"renderLayout",value:function(e){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(y.a,{className:"googlesitekit-top-earnings-pages",footer:!0,footerCtaLabel:Object(O._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"http://analytics.google.com",fill:!0},e))}}]),t}(m.Component);t.default=Object(h.a)(E,[{type:_.b,identifier:"analytics",datapoint:"report",data:R.analyticsAdsenseReportDataDefaults,priority:1,maxAge:Object(b.p)("day"),context:"Dashboard"}],E.renderLayout(React.createElement(k.a,{rows:5,padding:!0})),{inGrid:!0,createGrid:!0},(function(){return!1}),(function(e){if(e&&e.error_data){var t=Object.values(e.error_data);if(t[0]&&"badRequest"===t[0].reason)return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(y.a,{className:"googlesitekit-top-earnings-pages",fill:!0},React.createElement(v.a,{title:Object(O.__)("Restricted metric(s)","google-site-kit"),description:Object(O.__)("You need to link Analytics and AdSense to get report for your top earning pages. Learn more: https://support.google.com/adsense/answer/6084409 ","google-site-kit")})))}if(e&&e.errors){var a=Object.values(e.errors);if(a[0]&&a[0][0])return a[0][0]}return!1}))},function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(25),b=a(19),f=a(9),k=a(51),y=a(32),v=a(23),O=a(2),R=a(11),E=a(0),S=a(15);function j(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function w(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?j(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):j(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var D=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={accounts:!1,goals:!1},a}return p()(t,e),r()(t,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var e=this.state,t=e.overview,a=e.extractedAnalytics,n=e.goals,i=googlesitekit.permaLink,o=Object(O.n)("googlesitekit-module-analytics",{}),c="",s="",r="",l="",d="",u="";return t&&(c=t.totalUsers,s=t.totalUsersChange,r=t.goalCompletions,l=t.goalCompletionsChange,d=t.averageBounceRate,u=t.averageBounceRateChange),React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(_.a,{className:"overview-total-users",title:Object(E.__)("Unique Visitors from Search","google-site-kit"),datapoint:Object(O.t)(c),change:s,changeDataUnit:"%",source:{name:Object(E._x)("Analytics","Service name","google-site-kit"),link:o},sparkline:a&&React.createElement(k.a,{data:Object(O.f)(a,1),change:s,id:"analytics-users-sparkline"})})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},i&&React.createElement(_.a,{className:"overview-bounce-rate",title:Object(E.__)("Bounce Rate","google-site-kit"),datapoint:Number(d).toFixed(2),datapointUnit:Object(E.__)("%","google-site-kit"),change:u,changeDataUnit:"%",reverseArrowDirection:!0,source:{name:Object(E._x)("Analytics","Service name","google-site-kit"),link:o},sparkline:a&&React.createElement(k.a,{data:Object(O.f)(a,2),change:u,id:"analytics-sessions-sparkline"})}),!i&&n&&Object(R.isEmpty)(n.items)&&React.createElement(y.a,{title:Object(E.__)("Use goals to measure success.","google-site-kit"),description:Object(E.__)("Goals measure how well your site or app fulfills your target objectives.","google-site-kit"),ctaLink:"https://support.google.com/analytics/answer/1032415?hl=en#create_or_edit_goals",ctaLabel:Object(E.__)("Create a new goal","google-site-kit")}),!i&&n&&!Object(R.isEmpty)(n.items)&&React.createElement(_.a,{className:"overview-goals-completed",title:Object(E.__)("Goals Completed","google-site-kit"),datapoint:Object(O.t)(r),change:l,changeDataUnit:"%",source:{name:Object(E._x)("Analytics","Service name","google-site-kit"),link:o},sparkline:a&&React.createElement(k.a,{data:Object(O.f)(a,3),change:l,id:"analytics-sessions-sparkline"})}),!i&&!n&&React.createElement(v.a,{width:"100%",height:"202px"})))}}]),t}(h.Component);t.default=Object(b.a)(D,[{type:f.b,identifier:"analytics",datapoint:"report",data:w({},S.overviewReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(O.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.overview)return{overview:Object(S.calculateOverviewData)(a)}}},{type:f.b,identifier:"analytics",datapoint:"report",data:w({},S.siteAnalyticsReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(O.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.extractedAnalytics)return{extractedAnalytics:Object(S.extractAnalyticsDashboardSparklineData)(a)}}},{type:f.b,identifier:"analytics",datapoint:"goals",data:{url:googlesitekit.permaLink},priority:1,maxAge:Object(O.p)("hour"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.goals)return{goals:a}}}],React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(v.a,{width:"100%",height:"202px"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(v.a,{width:"100%",height:"202px"}))),{inGrid:!0},(function(e,t){return"report"===t&&Object(S.isDataZeroForReporting)(e)}),S.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(61),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(19),b=a(9),f=a(2),k=a(28),y=a(38),v=a(11),O=a(8),R=a.n(O),E=a(0),S=a(15),j=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,a=e.data,n=e.colspan;if(!a||!a.length)return null;var o=[{title:Object(E.__)("Title","google-site-kit"),tooltip:Object(E.__)("Page Title","google-site-kit"),primary:!0},{title:Object(E.__)("Pageviews","google-site-kit"),tooltip:Object(E.__)("Pageviews","google-site-kit")},{title:Object(E.__)("Unique Pageviews","google-site-kit"),tooltip:Object(E.__)("Unique Pageviews","google-site-kit")},{title:Object(E.__)("Bounce Rate","google-site-kit"),tooltip:Object(E.__)("Bounce Rate","google-site-kit")}],c=[],s=Object(v.map)(a[0].data.rows,(function(e,a){var n=Number(e.metrics[0].values[2]),o=i()(e.dimensions,2),s=o[0],r=o[1];return c[a]=t.addDeepLink(r),[s,Object(f.r)(e.metrics[0].values[0]),Object(f.r)(e.metrics[0].values[1]),React.createElement(h.Fragment,{key:"minichart-"+a},React.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(n.toFixed(2),"%")))]})),r={hideHeader:!1,chartsEnabled:!1,links:c},l=Object(k.b)(s,o,r);return React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-".concat(n)},React.createElement(k.a,null,l))}}],[{key:"addDeepLink",value:function(e){var t=googlesitekit.modules.analytics.settings,a=t.accountID,n=t.internalWebPropertyID,i=t.profileID;return a?"https://analytics.google.com/analytics/web/#/report/content-drilldown/a".concat(a,"w").concat(n,"p").concat(i,"/explorer-table.plotKeys=%5B%5D&_r.drilldown=analytics.pagePath:").concat(encodeURIComponent(e.replace(/\//g,"~2F"))):"https://analytics.google.com/analytics/web/"}}]),t}(h.Component);j.propTypes={data:R.a.array,colspan:R.a.number},j.defaultProps={data:null,colspan:12},t.default=Object(_.a)(j,[{type:b.b,identifier:"analytics",datapoint:"report",data:Object(S.getTopPagesReportDataDefaults)(),priority:1,maxAge:Object(f.p)("day"),context:["Single","Dashboard"]}],React.createElement(y.a,{padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(13),p=a.n(m),h=a(7),_=a.n(h),b=a(1),f=a(44),k=a(0),y=a(118),v=a(121),O=a(116),R=a(77),E=a(17),S=a(47),j=a(66),w=a(72),D=a(31),C=a(55),x=a(45),N=a(76),A=a(42),P=a(2),L=a(43),M=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={selectedStats:[0],receivingData:!0,error:!1,loading:!0,isAdSenseConnected:!0},a.handleStatSelection=a.handleStatSelection.bind(p()(a)),a.buildSeries=a.buildSeries.bind(p()(a)),a.handleDataError=a.handleDataError.bind(p()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(p()(a)),a}return _()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.isAdSenseConnected()}},{key:"isAdSenseConnected",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(Object(A.isAdsenseConnectedAnalytics)());case 2:e.sent?this.setState({isAdSenseConnected:!0}):this.setState({isAdSenseConnected:!1});case 4:case"end":return e.stop()}}),null,this)}},{key:"handleStatSelection",value:function(e){this.setState({selectedStats:[e]})}},{key:"handleDataError",value:function(e){this.setState({receivingData:!1,loading:!1,error:e})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0,loading:!1})}},{key:"buildSeries",value:function(){var e=this.state.selectedStats,t={0:"#4285f4",1:"#27bcd4",2:"#1b9688",3:"#673ab7"};return{0:{color:t[e],targetAxisIndex:0},1:{color:t[e],targetAxisIndex:0,lineDashStyle:[3,3],lineWidth:1}}}},{key:"render",value:function(){var e=this.state,t=e.selectedStats,a=e.error,n=e.receivingData,i=e.loading,o=e.isAdSenseConnected,c=this.buildSeries(),s=!i&&n?"":"googlesitekit-nodata",r=Object(P.i)();return React.createElement(b.Fragment,null,React.createElement(f.a,null),React.createElement(w.a,{module:"analytics"}),React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--analytics"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(S.a,{title:Object(k._x)("Analytics","Service name","google-site-kit"),icon:!0,iconWidth:"24",iconHeight:"26",iconID:"analytics",status:"connected",statusText:Object(k.__)("Analytics is connected","google-site-kit")}),i&&React.createElement(D.a,null)),!n&&(a?Object(x.a)(Object(k._x)("Analytics","Service name","google-site-kit"),a,!0,!0,!0):Object(C.a)(Object(k._x)("Analytics","Service name","google-site-kit"),!0,!0,!0)),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(E.a,{header:!0,title:Object(k.sprintf)(Object(k.__)("Audience overview for the last %s","google-site-kit"),r),headerCtaLabel:Object(k.__)("See full stats in Analytics","google-site-kit"),headerCtaLink:"http://analytics.google.com"},React.createElement(O.default,{selectedStats:t,handleStatSelection:this.handleStatSelection,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}),React.createElement(y.default,{selectedStats:t,series:c,vAxes:null,dateRangeFrom:r}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(E.a,{header:!0,footer:!0,title:Object(k.sprintf)(Object(k.__)("Top content over the last %s","google-site-kit"),r),headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(k.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(k._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},React.createElement(v.default,null))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(E.a,{header:!0,footer:!0,title:Object(k.sprintf)(Object(k.__)("Top acquisition sources over the last %s","google-site-kit"),r),headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(k.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(k._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(j.default,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(R.default,null)))))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(L.a,null))))),!i&&!o&&React.createElement(N.default,null))}}]),t}(b.Component);t.default=M},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(91),h=a(25),_=a(32),b=a(19),f=a(9),k=a(2),y=a(15),v=a(0),O=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=Object(y.calculateOverviewData)(e);if(!t)return null;var a=t.totalUsers,n=t.averageSessionDuration,i=t.totalUsersChange,o=t.averageSessionDurationChange;return React.createElement(m.Fragment,null,e.length?React.createElement(m.Fragment,null,React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-users",title:Object(v.__)("Total Unique Visitors","google-site-kit"),datapoint:Object(k.t)(a),change:i,changeDataUnit:"%"}),React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-average-session-duration",title:Object(v.__)("Avg. Time on Page","google-site-kit"),datapoint:Object(k.s)(n),change:o,changeDataUnit:"%"})):React.createElement("div",{className:"googlesitekit-wp-dashboard-stats__cta"},React.createElement(_.a,{title:Object(v.__)("Analytics Gathering Data","google-site-kit"),description:Object(v.__)("Analytics data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""})))}}]),t}(m.Component);t.default=Object(b.a)(O,[{type:f.b,identifier:"analytics",datapoint:"report",data:y.overviewReportDataDefaults,priority:1,maxAge:Object(k.p)("day"),context:["WPDashboard"]}],React.createElement(p.a,{width:"23%",height:"94px",count:2}),{},y.isDataZeroForReporting,y.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(61),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(19),b=a(9),f=a(2),k=a(28),y=a(38),v=a(11),O=a(0),R=a(15),E=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data,t=googlesitekit.admin.siteURL;if(Object(R.isDataZeroForReporting)(e))return null;var a=[],n=Object(v.map)(e[0].data.rows,(function(e,n){var o=i()(e.dimensions,2),c=o[0],s=o[1];return a[n]=t+s,[c,Object(f.r)(e.metrics[0].values[0])]})),o=[{title:Object(O.__)("Title","google-site-kit"),tooltip:Object(O.__)("Page Title","google-site-kit"),primary:!0},{title:Object(O.__)("Pageviews","google-site-kit"),tooltip:Object(O.__)("Pageviews","google-site-kit")}],c={chartsEnabled:!0,links:a,cap:5,showURLs:!0},s=Object(k.b)(n,o,c);return React.createElement("div",{className:"googlesitekit-search-console-widget"},React.createElement("h2",{className:"googlesitekit-search-console-widget__title"},Object(O.__)("Top content over the last 28 days","google-site-kit")),React.createElement(k.a,null,s))}}]),t}(h.Component);t.default=Object(_.a)(E,[{type:b.b,identifier:"analytics",datapoint:"report",data:Object(R.getTopPagesReportDataDefaults)(),priority:1,maxAge:Object(f.p)("day"),context:"WPDashboard"}],React.createElement(y.a,{rows:6}))},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=(a(1),a(32)),c=a(9),s=a(54),r=a(2),l=a(0);t.default=function(){var e=googlesitekit.modules["pagespeed-insights"],t=e.active,a=e.setupComplete;if(!googlesitekit.permissions.canManageOptions&&!a)return null;return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(o.a,{title:!a&&t?Object(l.__)("Complete PageSpeed Insights activation.","google-site-kit"):Object(l.__)("Activate PageSpeed Insights.","google-site-kit"),description:Object(l.__)("Google PageSpeed Insights gives you metrics about performance, accessibility, SEO and PWA.","google-site-kit"),ctaLink:"#",ctaLabel:!a&&t?Object(l.__)("Complete activation","google-site-kit"):Object(l.__)("Activate PageSpeed Insights","google-site-kit"),onClick:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.a.awrap(Object(r.a)(c.c,"pagespeed-insights",!0));case 3:window.location=Object(r.m)("pagespeed-insights"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),Object(r.w)(s.a,{id:"pagespeed-insights-setup-error",title:Object(l.__)("Internal Server Error","google-site-kit"),description:e.t0.message,format:"small",type:"win-error"});case 9:case"end":return e.stop()}}),null,null,[[0,6]])}}))}},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(60),b=a(31),f=a(45),k=a(0),y=a(93),v=a(64),O=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={loading:!0,error:!1},a.handleDataLoaded=a.handleDataLoaded.bind(g()(a)),a.handleDataError=a.handleDataError.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"handleDataLoaded",value:function(){this.setState({loading:!1})}},{key:"handleDataError",value:function(e){this.setState({error:e})}},{key:"render",value:function(){var e=this.state,t=e.loading,a=e.error,n={name:Object(k._x)("PageSpeed Insights","Service name","google-site-kit"),link:Object(k.sprintf)("https://developers.google.com/speed/pagespeed/insights/?url=%s",googlesitekit.permaLink||googlesitekit.admin.siteURL)};return a?React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},Object(f.a)(Object(k._x)("PageSpeed Insights","Service name","google-site-kit"),a,!0,!0,!1)):React.createElement(h.Fragment,null,t&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-pagespeed-report__loading"},React.createElement(b.a,null),React.createElement("p",null,Object(k.__)("PageSpeed Insights is preparing data…","google-site-kit")))),React.createElement(y.PageSpeedInsightsDashboardWidgetHomepageSpeedMobile,{handleDataLoaded:this.handleDataLoaded,handleDataError:this.handleDataError,title:Object(k.__)("Mobile","google-site-kit")}),React.createElement(y.PageSpeedInsightsDashboardWidgetHomepageSpeedDesktop,{title:Object(k.__)("Desktop","google-site-kit")}),!t&&React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(_.a,{name:n.name,href:n.link,external:!0})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--align-right-tablet "},React.createElement(v.PageSpeedReportScale,null))))}}]),t}(h.Component);t.default=O},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(21),p=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(p.Component);t.default=Object(m.a)("googlesitekit.DashboardSpeed")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(127),h=a(17),_=a(41),b=a(0),f=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.permaLink?Object(b.__)("How fast this page is.","google-site-kit"):Object(b.__)("How fast your home page is.","google-site-kit");return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(_.a,{title:Object(b.__)("Speed","google-site-kit"),description:e})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{className:"googlesitekit-pagespeed-report"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(p.default,null))))))}}]),t}(m.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(25),h=a(19),_=a(9),b=a(2),f=a(33),k=a(23),y=a(0),v=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||e.error)return null;var t=Object(f.extractSearchConsoleDashboardData)(e),a=t.totalClicks,n=t.totalImpressions,i=t.totalClicksChange,o=t.totalImpressionsChange;return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(p.a,{className:"overview-total-impressions",title:Object(y.__)("Total Impressions","google-site-kit"),datapoint:n,change:o,changeDataUnit:"%"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(p.a,{className:"overview-total-clicks",title:Object(y.__)("Total Clicks","google-site-kit"),datapoint:a,change:i,changeDataUnit:"%"})))}}]),t}(m.Component);t.default=Object(h.a)(v,[{type:_.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:googlesitekit.permaLink,dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(b.p)("day"),context:"Adminbar"}],React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(k.a,{width:"auto",height:"59px"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(k.a,{width:"auto",height:"59px"}))),{inGrid:!0},f.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(49),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(129),b=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){return"undefined"!==i()(googlesitekit.permaLink)&&""===googlesitekit.permaLink?null:React.createElement(_.default,null)}}]),t}(h.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(41),h=a(17),_=a(0),b=a(78),f=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(p.a,{title:Object(_.__)("Top Queries","google-site-kit"),description:Object(_.__)("What people searched for to find your page.","google-site-kit")})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{footer:!0,footerCtaLabel:Object(_._x)("Search Console","Service name","google-site-kit"),footerCtaLink:Object(_.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",googlesitekit.admin.siteURL)},React.createElement(b.default,null))))}}]),t}(m.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(63),h=a(41),_=a(17),b=a(0),f=a(79),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{description:Object(b.__)("How your site appeared in Search results and how many visitors you got from Search.","google-site-kit"),title:Object(b.__)("Search Funnel","google-site-kit")})),React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(_.a,{className:"googlesitekit-analytics-search-funnel"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(f.default,null),!googlesitekit.modules.analytics.active&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(p.a,null)))))))}}]),t}(m.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(25),h=a(19),_=a(9),b=a(23),f=a(2),k=a(33),y=a(8),v=a.n(y),O=a(0),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,n=e.handleStatSelection;if(!t||!t.length)return null;var i=Object(k.extractSearchConsoleDashboardData)(t),o=i.totalClicks,c=i.totalImpressions,s=i.averageCTR,r=i.averagePosition,l=i.totalClicksChange,d=i.totalImpressionsChange,u=i.averageCTRChange,g=i.averagePositionChange,h=[{className:"googlesitekit-data-block--clicks googlesitekit-data-block--button-1",title:Object(O.__)("Total Clicks","google-site-kit"),datapoint:o,change:l,changeDataUnit:"%",context:"button",selected:a.includes(0),handleStatSelection:n},{className:"googlesitekit-data-block--impressions googlesitekit-data-block--button-2",title:Object(O.__)("Total Impressions","google-site-kit"),datapoint:c,change:d,changeDataUnit:"%",context:"button",selected:a.includes(1),handleStatSelection:n},{className:"googlesitekit-data-block--ctr googlesitekit-data-block--button-3",title:Object(O.__)("Average CTR","google-site-kit"),datapoint:s+"%",change:u,changeDataUnit:"%",context:"button",selected:a.includes(2),handleStatSelection:n},{className:"googlesitekit-data-block--position googlesitekit-data-block--button-4",title:Object(O.__)("Average Position","google-site-kit"),datapoint:r,change:g,changeDataUnit:"%",context:"button",selected:a.includes(3),handleStatSelection:n}];return React.createElement(m.Fragment,null,React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner",role:"toolbar","aria-label":"Line Chart Options"},h.map((function(e,t){return React.createElement("div",{key:t,className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(p.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection}))})))))}}]),t}(m.Component);R.propTypes={handleDataError:v.a.func.isRequired},t.default=Object(h.a)(R,[{type:_.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(f.p)("day"),context:["Single","Dashboard"]}],React.createElement(b.a,{width:"100%",height:"190px",padding:!0}),{createGrid:!0},k.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(19),h=a(9),_=a(2),b=a(28),f=a(38),k=a(17),y=a(11),v=a(0),O=a(33),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var a=[{title:Object(v.__)("Top search queries for your site","google-site-kit"),tooltip:Object(v.__)("Most searched for keywords related to your content","google-site-kit"),primary:!0},{title:Object(v.__)("Clicks","google-site-kit"),tooltip:Object(v.__)("Number of times users clicked on your content in search results","google-site-kit")},{title:Object(v.__)("Impressions","google-site-kit"),tooltip:Object(v.__)("Counted each time your content appears in search results","google-site-kit")}],n=googlesitekit.admin.siteURL,i=[],o=Object(y.map)(e,(function(e,t){var a=e.keys[0];return i[t]=Object(v.sprintf)("https://search.google.com/search-console/performance/search-analytics?resource_id=%s&query=!%s&num_of_days=28",n,a),[a,Object(_.r)(e.clicks),Object(_.r)(e.impressions)]})),c={hideHeader:!1,chartsEnabled:!1,links:i},s=Object(b.b)(o,a,c);return t.renderLayout(React.createElement(b.a,null,s))}}],[{key:"renderLayout",value:function(e){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(k.a,{className:"googlesitekit-popular-content",footer:!0,footerCtaLabel:Object(v._x)("Search Console","Service name","google-site-kit"),footerCtaLink:Object(v.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",googlesitekit.admin.siteURL),fill:!0},e))}}]),t}(m.Component);t.default=Object(p.a)(R,[{type:h.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"query",limit:10},priority:1,maxAge:Object(_.p)("day"),context:["Dashboard"]}],R.renderLayout(React.createElement(f.a,{padding:!0})),{inGrid:!0,createGrid:!0},O.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(21),p=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(p.Component);t.default=Object(m.a)("googlesitekit.DashboardPopularity")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(135),h=a(41),_=a(0),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{title:Object(_.__)("Popularity","google-site-kit"),description:Object(_.__)("Your most popular pages and how people found them from Search.","google-site-kit"),timePeriod:Object(_.__)("Last 28 days","google-site-kit")})),React.createElement(p.default,null))}}]),t}(m.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(79),h=a(17),_=a(41),b=a(63),f=a(0),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.permissions.canManageOptions,t=googlesitekit.modules.analytics.active||e?12:6;return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(_.a,{title:Object(f.__)("Search Funnel","google-site-kit"),description:Object(f.__)("How your site appeared in Search results and how many visitors you got from Search.","google-site-kit"),timePeriod:Object(f.__)("Last 28 days","google-site-kit")})),React.createElement("div",{className:"\n\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\tmdc-layout-grid__cell--span-".concat(t,"\n\t\t\t\t")},React.createElement(h.a,{className:"googlesitekit-analytics-search-funnel"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(p.default,null),!googlesitekit.modules.analytics.active&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(b.a,null)))))))}}]),t}(m.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(19),b=a(9),f=a(56),k=a(23),y=a(2),v=a(33),O=a(0),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).setOptions=a.setOptions.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"setOptions",value:function(){var e=this.props,t=e.selectedStats,a=e.series,n=e.vAxes,i={chart:{title:googlesitekit.pageTitle&&googlesitekit.pageTitle.length?Object(O.sprintf)(Object(O.__)("Search Traffic Summary for %s","google-site-kit"),Object(y.e)(googlesitekit.pageTitle)):Object(O.__)("Search Traffic Summary","google-site-kit")},curveType:"line",height:270,width:"100%",chartArea:{height:"80%",width:"87%"},legend:{position:"top",textStyle:{color:"#616161",fontSize:12}},hAxis:{format:"M/d/yy",gridlines:{color:"#fff"},textStyle:{color:"#616161",fontSize:12}},vAxis:{gridlines:{color:"#eee"},minorGridlines:{color:"#eee"},textStyle:{color:"#616161",fontSize:12},titleTextStyle:{color:"#616161",fontSize:12,italic:!1}}};return i.series=a,i.vAxes=n,3<=t.length&&(i.vAxis.textPosition="none",i.vAxis.gridlines.color="#fff",i.vAxis.minorGridlines.color="#fff",i.vAxes={},i.chartArea.width="98%"),i}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats;if(!t||!t.length)return null;var n=this.setOptions(),i=Object(v.extractSearchConsoleDashboardData)(t);return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(f.a,{selectedStats:a,data:i.dataMap,options:n,singleStat:!1}))))}}]),t}(h.Component);t.default=Object(_.a)(R,[{type:b.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(y.p)("day"),context:"Single"}],React.createElement(k.a,{width:"100%",height:"270px",padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(25),h=a(19),_=a(9),b=a(0),f=a(33),k=a(51),y=a(23),v=a(2),O=a(32),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data,t=e.error;if(t)return Object(v.v)("plugin_setup","search_console_error",t.message),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(O.a,{title:Object(b.__)("Something went wrong","google-site-kit"),description:t.message,error:!0}));if(!e)return null;if(!e.length)return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(O.a,{title:Object(b.__)("Search Console Data Empty","google-site-kit"),description:Object(b.__)("Search Console data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""}));var a=Object(v.n)("googlesitekit-module-search-console",{}),n=Object(f.extractSearchConsoleDashboardData)(e),i=n.totalClicks,o=n.totalImpressions,c=n.totalClicksChange,s=n.totalImpressionsChange,r=n.dataMap;return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(p.a,{className:"overview-total-impressions",title:Object(b.__)("Impressions","google-site-kit"),datapoint:o,change:s,changeDataUnit:"%",source:{name:Object(b._x)("Search Console","Service name","google-site-kit"),link:a},sparkline:React.createElement(k.a,{data:Object(v.f)(r,2),change:s,id:"search-console-impressions-sparkline"})})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(p.a,{className:"overview-total-clicks",title:Object(b.__)("Clicks","google-site-kit"),datapoint:i,change:c,changeDataUnit:"%",source:{name:Object(b._x)("Search Console","Service name","google-site-kit"),link:a},sparkline:React.createElement(k.a,{data:Object(v.f)(r,1),change:c,id:"search-console-clicks-sparkline"})})))}}]),t}(m.Component);t.default=Object(h.a)(R,[{type:_.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:googlesitekit.permaLink,dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(v.p)("day"),context:["Single","Dashboard"]}],React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(y.a,{width:"100%",height:"202px"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(y.a,{width:"100%",height:"202px"}))),{inGrid:!0},f.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(44),b=a(0),f=a(138),k=a(78),y=a(133),v=a(47),O=a(17),R=a(72),E=a(31),S=a(55),j=a(45),w=a(2),D=a(43),C=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={selectedStats:[0,1],receivingData:!0,error:!1,loading:!0},a.handleStatSelection=a.handleStatSelection.bind(g()(a)),a.buildSeries=a.buildSeries.bind(g()(a)),a.buildVAxes=a.buildVAxes.bind(g()(a)),a.handleDataError=a.handleDataError.bind(g()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"handleDataError",value:function(e){this.setState({receivingData:!1,error:e,loading:!1})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0,loading:!1})}},{key:"handleStatSelection",value:function(e){var t=this.state.selectedStats,a=t.slice();t.includes(e)?a=t.filter((function(t){return e!==t})):a.push(e),0!==a.length&&this.setState({selectedStats:a})}},{key:"buildSeries",value:function(){var e=this.state.selectedStats,t={0:"#4285f4",1:"#27bcd4",2:"#1b9688",3:"#673ab7"};return e.map((function(e,a){return{color:t[e],targetAxisIndex:a}}))}},{key:"buildVAxes",value:function(){var e=this.state.selectedStats,t={0:"Clicks",1:"Impressions",2:"Average CTR",3:"Average Position"};return e.map((function(e){return{title:t[e]}}))}},{key:"render",value:function(){var e=this.state,t=e.selectedStats,a=e.receivingData,n=e.error,i=e.loading,o=this.buildSeries(),c=this.buildVAxes(),s=!i&&a?"":"googlesitekit-nodata",r=Object(w.i)(),l=Object(b.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",googlesitekit.admin.siteURL);return React.createElement(h.Fragment,null,React.createElement(_.a,null),React.createElement(R.a,{module:"search-console"}),React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--search-console"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(v.a,{title:Object(b._x)("Search Console","Service name","google-site-kit"),icon:!0,iconWidth:"23",iconHeight:"21",iconID:"search-console",status:"connected",statusText:Object(b.__)("Search Console is connected","google-site-kit")}),i&&React.createElement(E.a,null)),!a&&(n?Object(j.a)(Object(b._x)("Search Console","Service name","google-site-kit"),n,!0,!0,!0):Object(S.a)(Object(b._x)("Search Console","Service name","google-site-kit"),!0,!0,!0)),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(O.a,{header:!0,title:Object(b.sprintf)(Object(b.__)("Overview for the last %s","google-site-kit"),r),headerCtaLabel:Object(b.__)("See full stats in Search Console","google-site-kit"),headerCtaLink:l},React.createElement(y.default,{selectedStats:t,handleStatSelection:this.handleStatSelection,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}),React.createElement(f.default,{selectedStats:t,series:o,vAxes:c}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(O.a,{title:Object(b.sprintf)(Object(b.__)("Top search queries over the last %s","google-site-kit"),r),header:!0,footer:!0,headerCtaLabel:Object(b.__)("See full stats in Search Console","google-site-kit"),headerCtaLink:l,footerCtaLabel:Object(b._x)("Search Console","Service name","google-site-kit"),footerCtaLink:l},React.createElement(k.default,null))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(D.a,null))))))}}]),t}(h.Component);t.default=C},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(142),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement(p.default,null))}}]),t}(m.Component);t.default=h},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(91),h=a(25),_=a(19),b=a(9),f=a(2),k=a(33),y=a(32),v=a(0),O=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=Object(k.extractSearchConsoleDashboardData)(e),a=t.totalClicks,n=t.totalImpressions,i=t.totalClicksChange,o=t.totalImpressionsChange;return React.createElement(m.Fragment,null,e.length?React.createElement(m.Fragment,null,React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-impressions",title:Object(v.__)("Total Impressions","google-site-kit"),datapoint:n,change:o,changeDataUnit:"%"}),React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-clicks",title:Object(v.__)("Total Clicks","google-site-kit"),datapoint:a,change:i,changeDataUnit:"%"})):React.createElement("div",{className:"googlesitekit-wp-dashboard-stats__cta"},React.createElement(y.a,{title:Object(v.__)("Search Console Data Empty","google-site-kit"),description:Object(v.__)("Search Console data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""})))}}]),t}(m.Component);t.default=Object(_.a)(O,[{type:b.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(f.p)("day"),context:["WPDashboard"]}],React.createElement(p.a,{width:"23%",height:"94px",count:2}),{},k.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(0),h=googlesitekit.admin.siteURL,_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-settings-module__meta-item-type"},Object(p.__)("Connected URL","google-site-kit")),React.createElement("div",{className:"googlesitekit-settings-module__meta-item-data"},h))}}]),t}(m.Component);t.default=_},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,a){a(74),a(98),a(100),a(101),a(102),a(76),a(104),a(103),a(105),a(106),a(191),a(107),a(108),a(75),a(99),a(192),a(109),a(42),a(110),a(111),a(112),a(113),a(66),a(114),a(115),a(116),a(117),a(118),a(77),a(119),a(120),a(121),a(122),a(193),a(96),a(15),a(123),a(124),a(197),a(92),a(125),a(93),a(126),a(127),a(128),a(64),a(198),a(129),a(130),a(131),a(132),a(78),a(133),a(134),a(135),a(136),a(79),a(137),a(138),a(139),a(140),a(33),a(207),a(143),a(142),a(141),a(200),e.exports=a(94)},,,,function(e,t,a){"use strict";a.r(t);a(1);var n=a(24),i=a(2),o=a(106),c=a(102),s=a(75),r=a(98),l=a(107),d=a(108),u=a(10),g="adsense";if(Object(u.addFilter)("googlesitekit.ModuleSettingsWarning","googlesitekit.adsenseSettingsWarning",Object(i.g)(d.default,{})),Object(u.addFilter)("googlesitekit.SetupModuleShowLink","googlesitekit.adsenseSetupModuleShowLink",(function(e,t){return!("adsense"===t&&!googlesitekit.canAdsRun)&&e})),googlesitekit.modules.adsense.active){var m=Object(n.a)(React.createElement(o.default,null)),p=Object(n.a)(React.createElement(c.default,null));if(googlesitekit.modules[g].setupComplete)Object(u.addFilter)("googlesitekit.ModuleApp-".concat(g),"googlesitekit.ModuleApp",m),Object(u.addFilter)("googlesitekit.DashboardModule","googlesitekit.DashboardEarningModule",p,50);else{var h=googlesitekit.admin,_=h.reAuth,b=h.currentScreen,f=b?b.id:null;_||"site-kit_page_googlesitekit-module-adsense"!==f||(window.location=Object(i.n)("googlesitekit-module-".concat(g),{reAuth:!0,slug:g})),Object(u.addFilter)("googlesitekit.Connected-".concat(g),"googlesitekit.AdSenseModuleConnected",(function(e){var t=googlesitekit.modules[g].settings;return!(e||void 0===t||"account-pending-review"!==t.accountStatus&&"ads-display-pending"!==t.accountStatus)||e}))}Object(u.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(g),"googlesitekit.AdSenseModuleSettingsDetails",Object(i.g)(s.default,{onSettingsPage:!0})),Object(u.addFilter)("googlesitekit.ModuleSetup-".concat(g),"googlesitekit.TagmanagerModuleSetupWizard",Object(i.g)(r.default,{onSettingsPage:!1})),Object(u.addFilter)("googlesitekit.autoRefreshModules","googlesitekit.AdSenseAutoRefresh",(function(e){return e.push({identifier:"adsense",toRefresh:function(){var e="";return googlesitekit.modules.adsense&&googlesitekit.modules.adsense["account-status"]&&(e=googlesitekit.modules.adsense["account-status"].accountStatus),!(e&&-1<e.indexOf("account-connected"))}}),e})),Object(u.addFilter)("googlesitekit.ModulesNotificationsRequest","googlesitekit.adsenseNotifications",(function(e){return e.push({identifier:"adsense"}),e})),Object(u.addFilter)("googlesitekit.ModuleSetupIncomplete","googlesitekit.adsenseSettingStatus",Object(i.g)(l.default,{}))}},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(9),b=a(109),f=a(62),k=a(0),y=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={isLoading:!0,error:!1,message:"",accounts:[],accountStatus:""},a}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isOpen;e.onSettingsPage&&!t||this.getAccounts()}},{key:"getAccounts",value:function(){var e,t,a;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,i.a.awrap(_.c.get(_.b,"adsense","accounts"));case 3:e=n.sent,t="",e&&e.length||(t="no-account"),a=e,this.setState({isLoading:!1,accountStatus:t,accounts:a,error:!1}),n.next=13;break;case 10:n.prev=10,n.t0=n.catch(0),this.setState({isLoading:!1,error:n.t0.code,message:n.t0.message});case 13:case"end":return n.stop()}}),null,this,[[0,10]])}},{key:"renderErrorMessage",value:function(){var e=this.state,t=e.error,a=e.message;return t&&0<a.length?React.createElement("div",{className:"googlesitekit-error-text"},React.createElement("p",null,Object(k.__)("Error:","google-site-kit")," ",a)):null}},{key:"render",value:function(){var e=this.state,t=e.isLoading,a=e.accounts,n=e.accountStatus;return React.createElement(h.Fragment,null,React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--adsense"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t?React.createElement(f.a,{isSaving:t}):React.createElement(b.default,{accountStatus:n,accounts:a}),t?null:this.renderErrorMessage()))))}}]),t}(h.Component);t.default=y},function(e,t,a){"use strict";a.r(t);a(1);var n=a(2),i=a(24),o=a(122),c=a(111),s=a(114),r=a(120),l=a(123),d=a(112),u=a(124),g=a(115),m=a(117),p=a(119),h=a(96),_=a(10),b="analytics",f=Object(i.a)(React.createElement(c.default,null));if(Object(_.addFilter)("googlesitekit.AdminbarModules","googlesitekit.Analytics",f,11),!googlesitekit.modules[b].setupComplete){var k=googlesitekit.admin,y=k.reAuth,v=k.currentScreen,O=v?v.id:null;y||"site-kit_page_googlesitekit-module-analytics"!==O||(window.location=Object(n.n)("googlesitekit-module-".concat(b),{reAuth:!0,slug:b}))}if(googlesitekit.modules.analytics.active){var R=Object(i.a)(React.createElement(o.default,null)),E=Object(i.a)(React.createElement(s.default,null)),S=Object(i.a)(React.createElement(l.default,null)),j=Object(i.a)(React.createElement(u.default,null)),w=Object(i.a)(React.createElement(r.default,null)),D=Object(i.a)(React.createElement(d.default,null)),C=Object(i.a)(React.createElement(g.default,null)),x=Object(i.a)(React.createElement(m.default,null)),N=Object(i.a)(React.createElement(p.default,null));Object(_.addFilter)("googlesitekit.DashboardModule","googlesitekit.Analytics",E,9),Object(_.addFilter)("googlesitekit.DashboardSearchFunnel","googlesitekit.Analytics",w,11),Object(_.addFilter)("googlesitekit.DashboardPopularity","googlesitekit.Analytics",x,20),Object(_.addFilter)("googlesitekit.AnalyticsAdSenseTopPagesTableSmall","googlesitekit.Analytics",N,20),Object(_.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.Analytics",D,20),Object(_.addFilter)("googlesitekit.WPDashboardHeader","googlesitekit.Analytics",S),Object(_.addFilter)("googlesitekit.WPDashboardModule","googlesitekit.Analytics",j),Object(_.addFilter)("googlesitekit.ModuleApp-"+b,"googlesitekit.Analytics",R),Object(_.addFilter)("googlesitekit.AnalyticsAdSenseTopPagesTable","googlesitekit.Analytics",C,11),Object(_.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(b),"googlesitekit.AnalyticsModuleSettingsDetails",Object(n.g)(h.default,{onSettingsPage:!0})),Object(_.addFilter)("googlesitekit.showDateRangeSelector-".concat(b),"googlesitekit.analyticsShowDateRangeSelector",(function(){return!0})),Object(_.addFilter)("googlesitekit.ModuleSetup-".concat(b),"googlesitekit.AnalyticsModuleSetupWizard",Object(n.g)(h.default,{onSettingsPage:!1}))}},,,,function(e,t,a){"use strict";a.r(t);var n=a(2),i=a(92),o=a(10),c=a(0),s="optimize";googlesitekit.modules.optimize.active&&(Object(o.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(s),"googlesitekit.OptimizeModuleSettingsDetails",Object(n.g)(i.default,{onSettingsPage:!0})),Object(o.addFilter)("googlesitekit.ModuleSetup-".concat(s),"googlesitekit.OptimizeModuleSetupWizard",Object(n.g)(i.default,{onSettingsPage:!1})),Object(o.addFilter)("googlesitekit.SetupWinNotification-".concat(s),"googlesitekit.OptimizeSetupWinNotification",(function(e){return e.description=Object(c.__)("To set up experiments and see the results, go to ","google-site-kit"),e.learnMore.label="Optimize",e.learnMore.url="https://optimize.withgoogle.com/",e})))},function(e,t,a){"use strict";a.r(t);a(1);var n=a(24),i=a(128),o=a(126),c=a(125),s=a(10),r=googlesitekit.modules["pagespeed-insights"],l=r.active,d=r.setupComplete;if(l&&d){var u=Object(n.a)(React.createElement(i.default,null)),g=Object(n.a)(React.createElement(o.default,null));Object(s.addFilter)("googlesitekit.DashboardModule","googlesitekit.PageSpeedInsights",u,45),Object(s.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.PageSpeedInsights",u,45),Object(s.addFilter)("googlesitekit.DashboardSpeed","googlesitekit.PageSpeedInsightsHomepageSpeed",g)}else{var m=Object(n.a)(React.createElement(c.default,null));Object(s.addFilter)("googlesitekit.DashboardModule","googlesitekit.PageSpeedInsights",m,45)}},,function(e,t,a){"use strict";a.r(t);var n=a(2),i=a(94),o=a(10);googlesitekit.modules.tagmanager.active&&(Object(o.addFilter)("googlesitekit.ModuleSettingsDetails-".concat("tagmanager"),"googlesitekit.TagmanagerModuleSettingsDetails",Object(n.g)(i.default,{onSettingsPage:!0})),Object(o.addFilter)("googlesitekit.ModuleSetup-".concat("tagmanager"),"googlesitekit.TagmanagerModuleSetupWizard",Object(n.g)(i.default,{onSettingsPage:!1})))},,,,,,,function(e,t,a){"use strict";a.r(t);var n=a(1),i=a(140),o=a(130),c=a(141),s=a(137),r=a(139),l=a(131),d=a(134),u=a(132),g=a(136),m=a(12),p=a.n(m),h=a(3),_=a.n(h),b=a(4),f=a.n(b),k=a(5),y=a.n(k),v=a(6),O=a.n(v),R=a(13),E=a.n(R),S=a(7),j=a.n(S),w=a(11),D=a(170),C=a.n(D),x=a(9),N=a(29),A=a(17),P=a(2),L=a(0),M=function(e){function t(e){var a;return _()(this,t),(a=y()(this,O()(t).call(this,e))).state={isSearching:!1,results:[],error:!1,message:""},a.postSearch=a.postSearch.bind(E()(a)),a.onClick=a.onClick.bind(E()(a)),a.onConfirm=a.onConfirm.bind(E()(a)),a}return j()(t,e),f()(t,[{key:"postSearch",value:function(e,t){var a;return p.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t([Object(L.__)("Loading...","google-site-kit")]),n.prev=1,n.next=4,p.a.awrap(x.c.get(x.a,"search","post-search",{query:encodeURIComponent(e)}));case 4:0<(a=n.sent).length?t(Object(w.map)(a,(function(e){return e.post_title}))):t([Object(L.__)("No results found","google-site-kit")]),this.setState({isSearching:!0,results:a,error:!1,message:""}),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(1),t([Object(L.__)("No results found","google-site-kit")]),this.setState({isSearching:!1,error:n.t0.code,message:n.t0.message});case 13:case"end":return n.stop()}}),null,this,[[1,9]])}},{key:"getURLPathname",value:function(e){try{var t=new URL(e);return Object(w.trim)(t.pathname,"/")}catch(e){return!1}}},{key:"onConfirm",value:function(e){this.setState({selection:e})}},{key:"onClick",value:function(){var e=this.state,t=e.results,a=e.selection,n=Object(w.find)(t,(function(e){return e.post_title===a}));document.location=Object(P.n)("googlesitekit-dashboard",{id:n.id,permaLink:n.permalink,pageTitle:a})}},{key:"render",value:function(){var e=googlesitekit.modules,t=e.analytics&&e.analytics.active?"mdc-layout-grid__cell mdc-layout-grid__cell--span-12":"mdc-layout-grid__cell mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop";return React.createElement("div",{className:t},React.createElement(A.a,{title:Object(L.__)("Search for individual page or post information","google-site-kit"),header:!0},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement("div",{className:"googlesitekit-post-searcher"},React.createElement("label",{className:"googlesitekit-post-searcher__label",htmlFor:"autocomplete"},Object(L.__)("Title or URL","google-site-kit")),React.createElement(C.a,{id:"autocomplete",source:Object(w.debounce)(this.postSearch,200),minLength:2,onConfirm:this.onConfirm,showNoOptionsFound:!1}),React.createElement("div",{className:"googlesitekit-post-searcher__button-wrapper"},React.createElement(N.a,{onClick:this.onClick,className:"googlesitekit-post-searcher__button"},Object(L.__)("View Data","google-site-kit")))))))))}}]),t}(n.Component),I=a(143),F=a(24),T=a(10),U="search-console",z=Object(F.a)(React.createElement(i.default,null)),q=Object(F.a)(React.createElement(o.default,null)),W=Object(F.a)(React.createElement(c.default,null)),G=Object(F.a)(React.createElement(s.default,null)),H=Object(F.a)(React.createElement(r.default,null)),B=Object(F.a)(React.createElement(u.default,null)),K=Object(F.a)(React.createElement(l.default,null)),Y=Object(F.a)(React.createElement(d.default,null)),V=Object(F.a)(React.createElement(g.default,null)),Z=Object(F.a)(React.createElement(M,null));Object(T.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(U),"googlesitekit.SearchConsoleModuleSettingsDetails",Object(P.g)(I.default,{onSettingsPage:!0})),Object(T.addFilter)("googlesitekit.DashboardModule","googlesitekit.SearchConsole",G,11),Object(T.addFilter)("googlesitekit.DashboardModule","googlesitekit.DashboardPopularityModule",V,40),Object(T.addFilter)("googlesitekit.DashboardSearchFunnel","googlesitekit.SearchConsoleSearchFunnel",H),Object(T.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.SearchConsole",B),Object(T.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.SearchConsole",K,40),Object(T.addFilter)("googlesitekit.DashboardPopularity","googlesitekit.SearchConsoleDashboardPopularity",Y),Object(T.addFilter)("googlesitekit.DashboardPopularity","googlesitekit.DashboardPPostSearcherModule",Z,30),Object(T.addFilter)("googlesitekit.WPDashboardHeader","googlesitekit.SearchConsole",W,11),Object(T.addFilter)("googlesitekit.ModuleApp-"+U,"googlesitekit.ModuleApp",z),Object(T.addFilter)("googlesitekit.showDateRangeSelector-".concat(U),"googlesitekit.searchConsoleShowDateRangeSelector",(function(){return!0})),Object(T.addFilter)("googlesitekit.AdminbarModules","googlesitekit.SearchConsole",q)}]);
1
+ !function(e){function t(t){for(var n,c,s=t[0],r=t[1],d=t[2],u=0,g=[];u<s.length;u++)c=s[u],i[c]&&g.push(i[c][0]),i[c]=0;for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);for(l&&l(t);g.length;)g.shift()();return o.push.apply(o,d||[]),a()}function a(){for(var e,t=0;t<o.length;t++){for(var a=o[t],n=!0,c=1;c<a.length;c++){var s=a[c];0!==i[s]&&(n=!1)}n&&(o.splice(t--,1),e=__webpack_require__(__webpack_require__.s=a[0]))}return e}var n={},i={3:0},o=[];function __webpack_require__(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,__webpack_require__),a.l=!0,a.exports}__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,a){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(__webpack_require__.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(a,n,function(t){return e[t]}.bind(null,n));return a},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="";var c=window.webpackJsonp=window.webpackJsonp||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var r=0;r<c.length;r++)t(c[r]);var l=s;o.push([197,0,1]),a()}([function(e,t){e.exports=wp.i18n},function(e,t){e.exports=wp.element},,,,,,,,,function(e,t){e.exports=wp.hooks},,function(e,t){e.exports=lodash},,,,,,function(e,t){e.exports=React},function(e,t,a){"use strict";var n=a(72),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(12),b=a(58),f=a(45),k=a(96),y=a(10),v=a(0);t.a=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{inGrid:!1,fullWidth:!1,createGrid:!1},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return!1},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(e){if(e&&e.error)return e.error.message?e.error.message:e.error.errors&&e.error.errors[0]&&e.error.errors[0].message?e.error.errors[0].message:Object(v.__)("Unidentified error","google-site-kit");if(e&&e.errors&&e.errors[0]&&e.errors[0].message)return e.errors[0].message;if(e&&e.error_data){var t=Object.values(e.error_data);if(t[0]&&"RateLimitExceeded"===t[0].reason)return Object(v.__)("Too many requests have been sent within a given time span. Please reload this page again in a few seconds","google-site-kit")}if(e&&e.errors){var a=Object.values(e.errors);if(a[0]&&a[0][0])return a[0][0]}return!1};return function(l){function u(e){var a;c()(this,u),(a=d()(this,g()(u).call(this,e))).state={data:!1,zeroData:!1,error:!1},Object(y.addAction)("googlesitekit.moduleDataReset","googlesitekit.moduleDataResetHandler",(function(){a.setState({data:!1})}));var n=function(e,t){var n=a.props,i=n.handleDataError,c=n.handleDataSuccess,r=t.datapoint,l=t.identifier,d=t.toState,u=s(e);u?(a.setState({error:u,module:l}),i&&i(u)):o(e,r,t)?(i&&i(u),a.setState({zeroData:!0})):c&&c(),a.setState({requestDataToState:d,data:e,datapoint:r,module:l})};return Object(_.each)(t,(function(e){Array.isArray(e.context)?Object(_.each)(e.context,(function(t){Object(y.addFilter)("googlesitekit.module".concat(t,"DataRequest"),"googlesitekit.data".concat(t),(function(t){return e.callback=function(t){n(t,e)},t.push(e),t}))})):Object(y.addFilter)("googlesitekit.module".concat(e.context,"DataRequest"),"googlesitekit.data".concat(e.context),(function(t){return e.callback=function(t){n(t,e)},t.push(e),t}))})),a}return p()(u,l),r()(u,[{key:"render",value:function(){var t=this.state,o=t.data,c=t.datapoint,s=t.module,r=t.zeroData,l=t.error,d=t.requestDataToState;if(!o)return a;var u=s?googlesitekit.modules[s].name:Object(v.__)("Site Kit","google-site-kit");return s&&googlesitekit.modules[s].active&&!googlesitekit.modules[s].setupComplete?Object(k.a)(s,n.inGrid,n.fullWidth,n.createGrid):l?"string"!=typeof l?l:Object(f.a)(u,l,n.inGrid,n.fullWidth,n.createGrid):r?Object(b.a)(u,n.inGrid,n.fullWidth,n.createGrid):React.createElement(e,i()({data:o,datapoint:c,requestDataToState:d},this.props))}}]),u}(h.Component)}},,,,,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(8),h=a.n(p),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.width,a=e.height,n=e.shape,i=e.padding;return React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-preview-block\n\t\t\t\t\t".concat(i?"googlesitekit-preview-block--padding":"","\n\t\t\t\t"),style:{width:t,height:a}},React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-preview-block__wrapper\n\t\t\t\t\t".concat("circular"===n?"googlesitekit-preview-block__wrapper--circle":"","\n\t\t\t\t")}))}}]),t}(m.Component);_.propTypes={width:h.a.string,height:h.a.string,shape:h.a.string,padding:h.a.bool},_.defaultProps={width:"100px",height:"100px",shape:"square",padding:!1},t.a=_},,,,,function(e,t,a){"use strict";a.d(t,"b",(function(){return v})),a.d(t,"a",(function(){return O}));var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(8),b=a.n(_),f=a(62),k=a(14),y=a(12),v=function(e,t,a){var n=[],i=a.links,o=a.source,c=a.showURLs;return a.cap&&(e=e.slice(0,a.cap)),Object(y.each)(e,(function(e,t){var a=[],o=i&&i[t];Object(y.each)(e,(function(t,n){"string"==typeof t&&(t=t.replace(/\(none\)/gi,"direct")),a.push(React.createElement("td",{key:"cell-"+n,className:"googlesitekit-table__body-item"},e[0]===t&&o?React.createElement("div",{className:"googlesitekit-table__body-item-content"},React.createElement(k.a,{className:"googlesitekit-table__body-item-link",href:o,external:!0,inherit:!0},t),c&&""!==Object(y.trim)(o,"/")&&React.createElement(k.a,{className:"googlesitekit-table__body-item-url",href:o,inherit:!0,external:!0},Object(y.trim)(o,"/"))):React.createElement("div",{className:"googlesitekit-table__body-item-content"},t)))})),n.push(React.createElement("tr",{key:"tr-"+t,className:"googlesitekit-table__body-row"},a))})),React.createElement("div",{className:"googlesitekit-table".concat(a&&a.disableListMode?"":" googlesitekit-table--with-list")},React.createElement("table",{className:"\n\t\t\t\t\tgooglesitekit-table__wrapper\n\t\t\t\t\tgooglesitekit-table__wrapper--".concat(e&&e[0]?e[0].length:1,"-col\n\t\t\t\t")},React.createElement("thead",{className:"googlesitekit-table__head"},React.createElement("tr",{key:"gksc_data_row_header-wrap",style:a&&a.hideHeader?{display:"none"}:{},className:"googlesitekit-table__head-row"},t.map((function(e,t){return React.createElement("th",{key:"gksc_data_row_header-".concat(t),className:"\n\t\t\t\t\t\t\t\t\tgooglesitekit-table__head-item\n\t\t\t\t\t\t\t\t\t".concat(e.primary?"googlesitekit-table__head-item--primary":"","\n\t\t\t\t\t\t\t\t"),"data-tooltip":e.tooltip},e.title)})))),React.createElement("tbody",{className:"googlesitekit-table__body"},n)),o&&React.createElement(f.a,{className:"googlesitekit-table__source",name:o.name,href:o.link}))},O=function(e){function t(){var e;return i()(this,t),(e=r()(this,d()(t).call(this))).state={isScrolling:!1},e.scrollRef=Object(h.createRef)(),e.updateFadeOnScroll=e.updateFadeOnScroll.bind(g()(e)),e}return p()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;e.updateFadeOnScroll(),this.resize=Object(y.debounce)((function(){e.updateFadeOnScroll()}),100),window.addEventListener("resize",this.resize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.resize)}},{key:"updateFadeOnScroll",value:function(){var e=this.scrollRef.current,t=e.scrollLeft,a=e.scrollWidth-e.offsetWidth,n=t<a-16&&0<a-16;this.setState({isScrolling:n})}},{key:"render",value:function(){var e=this.props.children,t=this.state.isScrolling;return React.createElement("div",{onScroll:Object(y.debounce)(this.updateFadeOnScroll,100),className:"\n\t\t\t\t\tgooglesitekit-table-overflow\n\t\t\t\t\t".concat(t?"googlesitekit-table-overflow--gradient":"","\n\t\t\t\t")},React.createElement("div",{ref:this.scrollRef,className:"googlesitekit-table-overflow__container"},e))}}]),t}(h.Component);O.propTypes={children:b.a.element}},,,function(e,t){e.exports=wp.url},function(e,t){e.exports=wp.apiFetch},,,,,,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(24),h=a(8),_=a.n(h),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){for(var e=this.props,t=e.rows,a=e.rowHeight,n=e.padding,i=[],o=0;t>o;o++)i.push(React.createElement("div",{className:"googlesitekit-preview-table__row",key:"table-row-"+o},React.createElement(p.a,{width:"100%",height:a+"px"})));return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-preview-table\n\t\t\t\t".concat(n?"googlesitekit-preview-table--padding":"","\n\t\t\t")},i)}}]),t}(m.Component);b.propTypes={rows:_.a.number,rowHeight:_.a.number,padding:_.a.bool},b.defaultProps={rows:11,rowHeight:35,padding:!1},t.a=b},,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(8),h=a.n(p),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.title,a=e.description;return React.createElement("header",{className:"googlesitekit-dashboard-module-header"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-dashboard-module-header__title "},t),a&&React.createElement("p",{className:"googlesitekit-dashboard-module-header__description"},a))))}}]),t}(m.Component);_.propTypes={title:h.a.string,description:h.a.string},_.defaultProps={title:"",description:""},t.a=_},function(e,t,a){"use strict";a.r(t),a.d(t,"reduceAdSenseData",(function(){return u})),a.d(t,"propsFromAccountStatus",(function(){return g})),a.d(t,"getAdSenseAccountStatus",(function(){return m})),a.d(t,"isAdsenseConnectedAnalytics",(function(){return p})),a.d(t,"isDataZeroAdSense",(function(){return h}));var n=a(11),i=a.n(n),o=a(176),c=a(9),s=a(2),r=a(12),l=a(0),d=a(15);function u(e){var t=[[{type:"date",label:"Day"},{type:"number",label:"RPM"},{type:"number",label:"Earnings"},{type:"number",label:"Impressions"}]];return Object(r.each)(e,(function(e){var a=new Date(e[0]);t.push([a,e[2],e[1],e[3]])})),{dataMap:t}}var g=function(e,t){var a,n,i,c,r,d,u,g,m,p,h,_,b,f=!1,k=!1,y=!1,v=!1,O=!1,E=!1,R=googlesitekit.modules.adsense,j=R.accountURL,S=R.signupURL,w=Object(s.m)("googlesitekit-module-adsense",{}),D=new URL(googlesitekit.admin.siteURL);switch(e){case"account-connected":t?(g=!1,u="alert",m=Object(l.__)("Site Kit will place AdSense code to your site","google-site-kit"),p=Object(l.__)("This means Google will automatically place ads for you in all the best places.","google-site-kit"),n=Object(l.__)("Continue","google-site-kit"),a=w,f=!0,h=Object(l.__)("Let Site Kit place code on your site","google-site-kit"),_=Object(l.__)("If you don’t let Site Kit place the code you may not get the best ads experience. You can set this up later on the Site Kit settings page.","google-site-kit"),b=Object(l.__)("If you’ve already set up ads on your site, it may change how they appear. You can customize this later in AdSense.","google-site-kit")):(g=!1,u=!1,m=Object(l.__)("Looks like you’re already using AdSense","google-site-kit"),p=Object(l.__)("Site Kit will place AdSense code on your site to connect your site to AdSense and help you get the most out of ads. This means Google will automatically place ads for you in all the best places.","google-site-kit"),n=Object(l.__)("Continue","google-site-kit"),a=w,E={eventCategory:"adsense_setup",eventName:"complete_adsense_setup"},h=Object(l.__)("Let Site Kit place code on your site to get your site approved","google-site-kit"),_=Object(l.__)("If you’ve already got some AdSense code on your site, we recommend you use Site Kit to place code to get the most out of AdSense.","google-site-kit"));break;case"account-connected-nonmatching":g=!1,u=!1,m=Object(l.__)("Your site has code from another AdSense account","google-site-kit"),p=Object(l.__)("We’ve found some AdSense code on your site, but it’s not linked to this AdSense account.","google-site-kit"),v=!1,n=Object(l.__)("Switch Google account","google-site-kit"),a=Object(s.l)("adsense",!0),k={accountStatus:"account-connected",continueText:Object(l.__)("Continue anyway","google-site-kit"),statusHeadline:Object(l.__)("Site Kit will place AdSense code on your site","google-site-kit"),statusMessage:Object(l.__)("To connect your site to your AdSense account, Site Kit will place AdSense code on your site. For a better ads experience, you should remove AdSense code that’s not linked to this AdSense account.","google-site-kit"),profile:!0,ctaLink:w,ctaLinkText:Object(l.__)("Continue","google-site-kit"),continueAction:!1,switchLabel:Object(l.__)("Let Site Kit place code on your site","google-site-kit"),switchOffMessage:Object(l.__)("You can let Site Kit do this later.","google-site-kit")};break;case"ads-display-pending":var C=Object(o.parse)(D.hostname).domain;m=Object(l.__)("Let’s get your site ready for ads","google-site-kit"),p=Object(l.__)("After you’ve finished setting up your account, we’ll let you know when your site is ready to show ads. This usually takes less than a day, but it can sometimes take a bit longer.","google-site-kit"),n=Object(l.__)("Go to your AdSense account to check on your site’s status or to complete setting up","google-site-kit"),a="https://www.google.com/adsense/new/sites?url=".concat(C||D.hostname,"&source=site-kit");break;case"account-pending-review":m=Object(l.__)("We’re getting your site ready for ads","google-site-kit"),p=Object(l.__)("AdSense is reviewing your site. Meanwhile, make sure you’ve completed these steps in AdSense.","google-site-kit"),n=Object(l.__)("Go to your AdSense account to check on your site’s status","google-site-kit"),a="https://www.google.com/adsense/new/sites?url=".concat(D.hostname,"&source=site-kit"),y=!0;break;case"account-required-action":O=!0;break;case"disapproved-account":a=j,n=Object(l.__)("Go to AdSense to find out how to fix the issue","google-site-kit"),m=Object(l.__)("Your site isn’t ready to show ads yet","google-site-kit"),p=Object(l.__)("You need to fix some things before we can connect Site Kit to your AdSense account.","google-site-kit");break;case"disapproved-account-afc":g=Object(l.__)("There is an AdSense account, but the AFC account is disapproved","google-site-kit"),u="error",m=Object(l.__)("Create Account","google-site-kit"),p=Object(l.__)("Create an AdMob account, then open AdSense and try to upgrade.","google-site-kit"),n=Object(l.__)("Create an AdMob Account","google-site-kit"),a="https://google.com/admob";break;case"no-account":m=Object(l.__)("Create your AdSense account","google-site-kit"),p=Object(l.__)("Site Kit will place AdSense code on every page across your site. This means Google will automatically place ads for you in all the best places.","google-site-kit"),v=!0,n=Object(l.__)("Create AdSense Account","google-site-kit"),a=S,d=Object(l.__)("Already have an AdSense account?","google-site-kit"),i=Object(l.__)("to connect to it","google-site-kit"),c=Object(l.__)("Switch Google account","google-site-kit"),r=Object(s.l)("adsense",!0),E={eventCategory:"adsense_setup",eventName:"create_adsense_account"};break;case"no-account-tag-found":m=Object(l.__)("Looks like you’re already using AdSense","google-site-kit"),p=Object(l.__)("We’ve found some AdSense code on your site, but it’s not linked to this Google account.","google-site-kit"),v=!1,n=Object(l.__)("Switch Google account","google-site-kit"),a=Object(s.l)("adsense",!0),h=Object(l.__)("Let Site Kit place code on your site to get your site approved","google-site-kit"),k={statusHeadline:Object(l.__)("Create a new AdSense account","google-site-kit"),statusMessage:Object(l.__)("Site Kit will place additional AdSense code on every page across your site after you create an account. This means Google will automatically place ads for you in all the best places.","google-site-kit"),notice:Object(l.__)("We recommend you remove the old AdSense code from this site.","google-site-kit"),icon:"warning",continueText:Object(l.__)("Continue anyway","google-site-kit"),ctaLinkText:Object(l.__)("Create AdSense Account","google-site-kit"),ctaLink:S,ctaTarget:"_blank",continueAction:!1};break;case"account-connected-no-data":m=Object(l.__)("We’re getting your site ready for ads","google-site-kit"),p=Object(l.__)("AdSense is reviewing your site. Meanwhile, make sure you’ve completed these steps in AdSense.","google-site-kit"),y=!0}return{accountTagMatch:f,continueAction:k,ctaLink:a,ctaLinkText:n,footerAppendedText:i,footerCTA:c,footerCTALink:r,footerText:d,icon:u,incomplete:y,issue:g,profile:v,required:O,setupComplete:!1,statusHeadline:m,statusMessage:p,switchLabel:h,switchOffMessage:_,switchOnMessage:b,tracking:E}},m=function(){var e,t,a,n,o,d,u,g,m,p,h,_,b,f,k,y,v,O,E,R,j,S,w,D,C,x,N,A,P,L=arguments;return i.a.async((function(I){for(;;)switch(I.prev=I.next){case 0:return e=L.length>0&&void 0!==L[0]&&L[0],t=L.length>1&&void 0!==L[1]?L[1]:function(){},n=!1,I.prev=3,t(Object(l.__)("Locating accounts…","google-site-kit")),I.next=7,i.a.awrap(c.c.get(c.b,"adsense","accounts").then((function(e){return e})).catch((function(e){return e})));case 7:if(o=I.sent,!(1<(d=!o.data||o.data.status&&200!==o.data.status?o:o.data).length)){I.next=42;break}t(Object(l.__)("Searching for domain…","google-site-kit")),u=!0,g=!1,m=void 0,I.prev=14,p=d[Symbol.iterator]();case 16:if(u=(h=p.next()).done){I.next=28;break}return _=h.value,b=_.id,I.next=21,i.a.awrap(c.c.get(c.b,"adsense","urlchannels",{clientID:b}).then((function(e){return e})).catch((function(e){return e})));case 21:f=I.sent,k=new URL(googlesitekit.admin.siteURL),(y=f&&f.length?Object(r.filter)(f,{urlPattern:k.hostname}):[])&&0!==y.length?(O=y[0].id,Object(s.v)("adsense_setup","adsense_account_detected")):(a="account-pending-review",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status account-pending-review"));case 25:u=!0,I.next=16;break;case 28:I.next=34;break;case 30:I.prev=30,I.t0=I.catch(14),g=!0,m=I.t0;case 34:I.prev=34,I.prev=35,u||null==p.return||p.return();case 37:if(I.prev=37,!g){I.next=40;break}throw m;case 40:return I.finish(37);case 41:return I.finish(34);case 42:if(v=d&&d.message&&d.message.error,O=!!(d&&d.length&&d[0])&&d[0].id,d&&O&&!v){I.next=50;break}E=(v||{}).errors,"noAdSenseAccount"!==(R=E[0].reason)&&d&&O||(a="disapprovedAccount"===R?"disapproved-account":e?"no-account-tag-found":"no-account"),I.next=118;break;case 50:return googlesitekit.modules.adsense.accountURL=Object(l.sprintf)("https://www.google.com/adsense/new/%s/home",O),t(Object(l.__)("Account found, checking account status…","google-site-kit")),I.next=54,i.a.awrap(c.c.get(c.b,"adsense","alerts",{accountID:O}).then((function(e){return e})).catch((function(e){return e})));case 54:if(j=I.sent,S=!j.data||j.data.status&&200!==j.data.status?j:j.data,w=S&&S.message&&S.message.error,!Object(r.find)(j,{type:"GRAYLISTED_PUBLISHER"})){I.next=62;break}a="ads-display-pending",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending"),I.next=118;break;case 62:return I.next=64,i.a.awrap(c.c.get(c.b,"adsense","clients").then((function(e){return e})).catch((function(e){return e})));case 64:if(D=I.sent,C=!D.data||D.data.status&&200!==D.data.status?D:D.data,x=C&&C.message&&C.message.error,!(N=!(!C||!C.length)&&Object(r.find)(C,{productCode:"AFC"}))){I.next=72;break}return n=N.id,I.next=72,i.a.awrap(c.c.set(c.b,"adsense","client-id",{clientID:n}).then((function(e){return e})).catch((function(e){return e})));case 72:if(!w){I.next=77;break}"accountPendingReview"===S.message.error.errors[0].reason&&(a="ads-display-pending",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending")),I.next=118;break;case 77:if(t(Object(l.__)("Looking for AdSense client…","google-site-kit")),!x){I.next=83;break}a="account-required-action",Object(s.v)("adsense_setup","adsense_required_action","accountRequiredAction status"),I.next=118;break;case 83:if(!N){I.next=117;break}return n=N.id,t(Object(l.__)("Looking for site domain…","google-site-kit")),I.next=88,i.a.awrap(c.c.get(c.b,"adsense","urlchannels",{clientID:n}).then((function(e){return e})).catch((function(e){return e})));case 88:if(A=I.sent,P=A&&A.length&&Object(r.filter)(A,(function(e){return 0<googlesitekit.admin.siteURL.indexOf(e.urlPattern)})),0!==A.length){I.next=95;break}a="ads-display-pending",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending"),I.next=115;break;case 95:if(P&&0!==P.length){I.next=100;break}a="account-pending-review",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status account-pending-review"),I.next=115;break;case 100:if(!e||n!==e){I.next=105;break}a="account-connected",Object(s.v)("adsense_setup","adsense_account_connected","existing_matching_tag"),I.next=115;break;case 105:if(!e||n===e){I.next=110;break}a="account-connected-nonmatching",Object(s.v)("adsense_setup","adsense_account_connected","existing_non_matching_tag"),I.next=115;break;case 110:return a="account-connected",t(Object(l.__)("Connecting…","google-site-kit")),Object(s.v)("adsense_setup","adsense_account_connected"),I.next=115,i.a.awrap(c.c.set(c.b,"adsense","setup-complete",{clientID:n}).then((function(e){return e})).catch((function(e){return e})));case 115:I.next=118;break;case 117:a="disapproved-account-afc";case 118:return I.next=120,i.a.awrap(c.c.set(c.b,"adsense","account-status",{accountStatus:a}).then((function(e){return e})).catch((function(e){return e})));case 120:return I.abrupt("return",{accountStatus:a,clientID:n});case 123:return I.prev=123,I.t1=I.catch(3),I.abrupt("return",{isLoading:!1,error:I.t1.code,message:I.t1.message});case 126:case"end":return I.stop()}}),null,null,[[3,123],[14,30,34,42],[35,,37,41]])},p=function(){var e,t,a;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(e=googlesitekit.modules.adsense.active,t=googlesitekit.modules.analytics.active,a=!0,!e||!t){n.next=6;break}return n.next=6,i.a.awrap(c.c.get(c.b,"analytics","report",d.analyticsAdsenseReportDataDefaults).then((function(e){e&&(a=!0)})).catch((function(e){400===e.code&&"INVALID_ARGUMENT"===e.message&&(a=!1)})));case 6:return n.abrupt("return",new Promise((function(e){e(a)})));case 7:case"end":return n.stop()}}))},h=function(e,t,a){if(!a.data||!a.data.dateRange||"last-28-days"!==a.data.dateRange)return!1;var n=[];return e.totals&&(n=e.totals),0===(n=n.filter((function(e){return 0<e}))).length}},,,function(e,t,a){"use strict";var n=a(1),i=a(34),o=a(77),c=a(2),s=a(3),r=a.n(s),l=a(4),d=a.n(l),u=a(5),g=a.n(u),m=a(6),p=a.n(m),h=a(7),_=a.n(h),b=a(26),f=a(0),k=function(e){function t(){return r()(this,t),g()(this,p()(t).apply(this,arguments))}return _()(t,e),d()(t,[{key:"render",value:function(){return React.createElement(b.a,{id:"notification-id",title:Object(f.__)("Security Token Error","google-site-kit"),description:Object(f.__)("We’re unable to retrieve your data because your security token is expired or revoked. Please ","google-site-kit"),learnMoreURL:googlesitekit.admin.connectURL,learnMoreLabel:Object(f.__)("reauthenticate your account","google-site-kit"),format:"small",type:"win-error"})}}]),t}(n.Component);t.a=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=React.createElement(i.a,{title:Object(f.sprintf)(Object(f.__)("Data error in %s","google-site-kit"),e),description:t,error:!0});return"Invalid Credentials"===t&&Object(c.w)(k),Object(o.a)(r,a,n,s)}},,,,function(e,t){e.exports=ReactDOM},,,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(59),h=a(8),_=a.n(h),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.change,n=e.id,i=e.loadSmall,o=e.loadCompressed,c=e.loadHeight,s=e.loadText;if(!t)return"loading...";var r={title:"",backgroundColor:"transparent",curveType:"line",width:"100%",height:"50",enableInteractivity:!1,chartArea:{height:"100%",width:"100%"},legend:{position:"none"},axisFontSize:0,hAxis:{baselineColor:"none",ticks:[]},vAxis:{baselineColor:"none",ticks:[]},axes:[],colors:[0<=+a?"green":"red"]};return React.createElement("div",{className:"googlesitekit-analytics-sparkline-chart-wrap"},React.createElement(p.a,{data:t,options:r,id:n,loadSmall:i,loadCompressed:o,loadHeight:c,loadText:s}))}}]),t}(m.Component);b.propTypes={loadSmall:_.a.bool,loadCompressed:_.a.bool,loadHeight:_.a.number,loadText:_.a.bool},b.defaultProps={loadSmall:!0,loadCompressed:!0,loadHeight:46,loadText:!1},t.a=b},,function(e,t){e.exports=wp.compose},,,,function(e,t,a){"use strict";a(1);var n=a(34),i=a(77),o=a(0);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=React.createElement(n.a
2
/* translators: %s: Module name */,{title:Object(o.sprintf)(Object(o.__)("%s Gathering Data","google-site-kit"),e)
3
+ /* translators: %s: Module name */,description:Object(o.sprintf)(Object(o.__)("%s data is not yet available, please check back later.","google-site-kit"),e)});return Object(i.a)(s,t,a,c)}},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(31),b=a(8),f=a.n(b),k=a(0),y=a(10),v=a(12),O=function(e){function t(e){var a;if(i()(this,t),(a=r()(this,d()(t).call(this,e))).state={loading:!0,chart:null},a.waitForChart=a.waitForChart.bind(g()(a)),a.getData=a.getData.bind(g()(a)),a.prepareChart=a.prepareChart.bind(g()(a)),a.drawChart=a.drawChart.bind(g()(a)),a.updateChart=a.updateChart.bind(g()(a)),a.chartRef=Object(h.createRef)(),window.google||window.googleChartLoaded)window.google&&window.google.charts?window.google.charts.setOnLoadCallback((function(){a.getData(),a.prepareChart(),a.drawChart()})):Object(y.addAction)("googlesitekit.ChartLoaderLoaded","googlesitekit.HandleChartLoaderLoaded",(function(){window.google.charts.setOnLoadCallback((function(){a.getData(),a.prepareChart(),a.drawChart()}))}));else{window.googleChartLoaded=!0;var n=document.createElement("script");n.type="text/javascript",n.onload=function(){n.onload=null,window.google.charts.load("visualization","1",{packages:["corechart"]}),window.google.charts.setOnLoadCallback((function(){a.getData(),a.prepareChart(),a.drawChart(),a.setState({loading:!1})})),Object(y.doAction)("googlesitekit.ChartLoaderLoaded")},document.getElementsByTagName("head")[0].appendChild(n),n.src="https://www.gstatic.com/charts/loader.js"}return a}return p()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;this.resize=Object(v.debounce)((function(){e.drawChart()}),100),window.addEventListener("resize",this.resize)}},{key:"componentDidUpdate",value:function(e){var t=this.props.selectedStats;0!==t.length&&JSON.stringify(t)!==JSON.stringify(e.selectedStats)&&this.updateChart()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.resize)}},{key:"waitForChart",value:function(e){setTimeout((function(){e()}),500)}},{key:"getData",value:function(){return window.google&&window.google.visualization&&window.google.visualization.arrayToDataTable(this.props.data)}},{key:"prepareChart",value:function(){var e=this.chartRef.current;if(window.google&&e){var t="pie"===this.props.chartType?new window.google.visualization.PieChart(e):new window.google.visualization.LineChart(e);this.setState({chart:t})}else this.waitForChart(this.prepareChart)}},{key:"drawChart",value:function(){var e=this.state.chart,t=this.props,a=t.selectedStats,n=t.options,i=this.getData();null!==i&&null!==e?(e.draw(i,n),0!==a.length&&this.updateChart()):this.waitForChart(this.drawChart)}},{key:"updateChart",value:function(){var e=this.state.chart,t=this.props,a=t.selectedStats,n=t.options,i=t.singleStat,o=this.getData();if(null!==o&&null!==e){var c=new window.google.visualization.DataView(o);if(!i){var s=[0];s=s.concat(a.map((function(e){return e+1}))),c.setColumns(s)}e.draw(c,n)}else this.waitForChart(this.drawChart)}},{key:"render",value:function(){var e=this.state.loading,t=this.props,a=t.className,n=t.loadSmall,i=t.loadCompressed,o=t.loadHeight,c=t.loadText;return React.createElement("div",{className:"googlesitekit-graph-wrapper"},React.createElement("div",{ref:this.chartRef,className:"googlesitekit-line-chart"},React.createElement("div",{className:"googlesitekit-chart-loading"},e&&React.createElement("div",{className:"googlesitekit-chart-loading__wrapper"},c&&React.createElement("p",null,Object(k.__)("Loading chart...","google-site-kit")),React.createElement(_.a,{className:a,small:n,compress:i,height:o})))))}}]),t}(h.Component);O.propTypes={selectedStats:f.a.array,options:f.a.object.isRequired,id:f.a.string,singleStat:f.a.bool,className:f.a.string,loadSmall:f.a.bool,loadCompressed:f.a.bool,loadHeight:f.a.number,loadText:f.a.bool},O.defaultProps={selectedStats:[],id:"",singleStat:!0,className:"",loadSmall:!1,loadCompressed:!1,loadHeight:null,loadText:!0},t.a=O},,,,,,,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(22),h=a(8),_=a.n(h),b=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).switchRef=Object(m.createRef)(),a}return g()(t,e),c()(t,[{key:"componentDidMount",value:function(){new p.i(this.switchRef.current)}},{key:"render",value:function(){var e=this.props,t=e.id,a=e.onClick,n=e.label,i=e.checked,o=e.hideLabel;return React.createElement(m.Fragment,null,React.createElement("div",{"aria-checked":i?"true":"false",className:"mdc-switch ".concat(i?"mdc-switch--checked":""),onClick:a,onKeyPress:function(e){"function"==typeof a&&"Enter"===e.code&&a(e)},role:"switch",ref:this.switchRef,tabIndex:0},React.createElement("div",{className:"mdc-switch__track"}," "),React.createElement("div",{className:"mdc-switch__thumb-underlay"},React.createElement("div",{className:"mdc-switch__thumb"},React.createElement("input",{type:"checkbox",id:t,className:"mdc-switch__native-control",role:"switch",checked:i,onChange:function(){}})))),React.createElement("label",{className:o?"screen-reader-only":"",htmlFor:t},n))}}]),t}(m.Component);b.propTypes={id:_.a.string.isRequired,onClick:_.a.func,label:_.a.string.isRequired,checked:_.a.bool,hideLabel:_.a.bool},b.defaultProps={checked:!1,hideLabel:!0},t.a=b},function(e,t,a){"use strict";a.r(t),a.d(t,"getScoreCategoryLabel",(function(){return o})),a.d(t,"PageSpeedReportScoreCategoryWrapper",(function(){return c})),a.d(t,"PageSpeedReportScoreGauge",(function(){return s})),a.d(t,"PageSpeedReportScale",(function(){return r}));a(1);var n=a(0);function i(e){return.9<=e?"fast":.5<=e?"average":"slow"}var o=function(e){var t=i(e);return"fast"===t?Object(n.__)("Fast","google-site-kit"):"average"===t?Object(n.__)("Average","google-site-kit"):Object(n.__)("Slow","google-site-kit")},c=function(e){var t=e.score,a=e.children,n="googlesitekit-pagespeed-report__score-category-wrapper googlesitekit-pagespeed-report__score-category-wrapper--".concat(i(t)),o="googlesitekit-pagespeed-report__score-icon googlesitekit-pagespeed-report__score-icon--".concat(i(t));return React.createElement("span",{className:n},a," ",React.createElement("span",{className:o}))},s=function(e){var t=e.score,a=parseInt(100*t,10),o="\n\t\tgooglesitekit-percentage-circle\n\t\tgooglesitekit-percentage-circle--".concat(i(t),"\n\t\tgooglesitekit-percentage-circle--percent-").concat(a,"\n\t");return React.createElement("div",{className:"googlesitekit-pagespeed-report__score-gauge"},React.createElement("div",{className:o},React.createElement("div",{className:"googlesitekit-percentage-circle__text"},a),React.createElement("div",{className:"googlesitekit-percentage-circle__slice"},React.createElement("div",{className:"googlesitekit-percentage-circle__bar"}),React.createElement("div",{className:"googlesitekit-percentage-circle__fill"}))),React.createElement("span",{className:"googlesitekit-pagespeed-report__score-gauge-label screen-reader-only"},Object(n.__)("Performance","google-site-kit")))},r=function(){return React.createElement("div",{className:"googlesitekit-pagespeed-report__scale"},React.createElement("span",null,Object(n.__)("Scale:","google-site-kit")),React.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--fast"},Object(n.__)("90-100 (fast)","google-site-kit")),React.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--average"},Object(n.__)("50-89 (average)","google-site-kit")),React.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--slow"},Object(n.__)("0-49 (slow)","google-site-kit")))}},,function(e,t,a){"use strict";a.r(t);var n=a(23),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(59),b=a(2),f=a(19),k=a(9),y=a(0),v=a(8),O=a.n(v),E=a(14),R=a(24),j=a(15);function S(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var w=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.source;if(!t||t.error||!t.length)return null;var n=Object(j.extractAnalyticsDataForTrafficChart)(t);return React.createElement("div",{className:"googlesitekit-chart googlesitekit-chart--pie"},React.createElement(_.a,{data:n,options:{chartArea:{width:"100%",height:"100%"},backgroundColor:"transparent",height:250,legend:{alignment:"center",textStyle:{color:"#5b5b61",fontSize:12}},slices:{0:{color:"#178EC5"},1:{color:"#54B23B"},2:{color:"#EB5729"},3:{color:"#ECED33"},4:{color:"#34CBE3"},5:{color:"#82E88E"}},title:null,width:"100%"},chartType:"pie",id:"overview-piechart",loadHeight:205}),a&&React.createElement("div",{className:"googlesitekit-chart__source"},[Object(y.__)("Source:","google-site-kit")," ",React.createElement(E.a,{key:"link",href:Object(b.m)("googlesitekit-module-analytics"),inherit:!0},Object(y._x)("Analytics","Service name","google-site-kit"))]))}}]),t}(h.Component);w.defaultProps={source:!1},w.propTypes={source:O.a.bool},t.default=Object(f.a)(w,[{type:k.b,identifier:"analytics",datapoint:"report",data:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?S(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):S(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},j.trafficSourcesReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(b.o)("day"),context:["Dashboard","Single"]}],React.createElement(R.a,{width:"282px",height:"282px",shape:"circular"}),{},j.isDataZeroForReporting,j.getAnalyticsErrorMessageFromData)},,,,,,,,function(e,t,a){"use strict";var n=a(1),i=a(17);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return React.createElement(n.Fragment,null,t&&a&&o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(i.a,{fill:!0},React.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e))))),t&&!a&&o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(i.a,{fill:!0},React.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e))))),t&&a&&!o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e),t&&!a&&!o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e),!t&&!a&&o&&React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e))),!t&&!a&&!o&&e)}},function(e,t,a){"use strict";var n=a(11),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(9),b=a(26),f=a(8),k=a.n(f),y=a(0),v=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={isLoading:!0,alerts:[],error:!1,message:""},a}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.getAlert()}},{key:"getAlert",value:function(){var e,t;return i.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e=this.props.module,a.next=4,i.a.awrap(_.c.getNotifications(e,3600));case 4:t=a.sent,this.setState({isLoading:!1,error:!1,alerts:t}),a.next=11;break;case 8:a.prev=8,a.t0=a.catch(0),this.setState({isLoading:!1,error:a.t0.code});case 11:case"end":return a.stop()}}),null,this,[[0,8]])}},{key:"render",value:function(){var e=this.state,t=e.alerts,a=e.error,n=e.isLoading;if(a||n||!t||!t.length)return null;var i=t.map((function(e){return React.createElement(b.a,{id:e.id,key:e.id,title:e.title,description:e.message||e.description,dismiss:Object(y.__)("Dismiss","google-site-kit"),isDismissable:e.isDismissible,format:"small",ctaLink:e.ctaURL,ctaLabel:e.ctaLabel,ctaTarget:e.ctaTarget,type:e.severity})}));return React.createElement(h.Fragment,null,i)}}]),t}(h.Component);v.propTypes={module:k.a.string.isRequired},t.a=v},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(14),h=a(93),_=a(31),b=a(0),f=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLink,a=e.ctaLinkText,n=e.header,i=e.incomplete,o=e.loadingMessage,c=e.subHeader,s=e.required,r=new URL(googlesitekit.admin.siteURL),l="https://www.google.com/adsense/new/sites?url=".concat(r.hostname,"&source=site-kit"),d=[{id:1,
4
/* translators: %s: Site URL */
5
+ text:Object(b.sprintf)(Object(b.__)("Added your site %s in ","google-site-kit"),r.hostname),linkText:Object(b.__)("Sites","google-site-kit"),linkURL:l},{id:2,text:Object(b.__)("Enabled ads in","google-site-kit"),linkText:Object(b.__)("Ads","google-site-kit"),linkURL:"https://www.google.com/adsense/new/myads/auto-ads"}];return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},s&&React.createElement(h.a,null),o&&React.createElement(m.Fragment,null,o,React.createElement(_.a,null)),n&&React.createElement("h3",{className:" googlesitekit-heading-4 googlesitekit-setup-module__title "},n),c&&React.createElement("p",null,c),i&&React.createElement("div",{className:"googlesitekit-setup-module__list-wrapper"},React.createElement("ol",{className:"googlesitekit-setup-module__list"},d.map((function(e){return React.createElement("li",{className:"googlesitekit-setup-module__list-item",key:e.id},e.text," ",React.createElement(p.a,{href:e.linkURL,external:!0,inherit:!0},e.linkText))})))),t&&a&&React.createElement("div",{className:"googlesitekit-setup-module__cta"},React.createElement(p.a,{className:"googlesitekit-setup-module__cta-link",href:t,external:!0},a)))}}]),t}(m.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(66),b=a(9),f=a(8),k=a.n(f),y=a(2),v=a(0),O=a(10),E=function(e){function t(e){var a;i()(this,t),a=r()(this,d()(t).call(this,e));var n=googlesitekit.modules.adsense.settings.useSnippet,o=void 0===n||n;return a.state={useSnippet:!!o,disabled:!1},a.handleUseSnippetSwitch=a.handleUseSnippetSwitch.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0,Object(O.addFilter)("googlekit.SettingsConfirmed","googlekit.AdSenseSettingsConfirmed",(function(t,a){return"adsense"!==a.replace("-module","")?t:e.save()})),this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(O.removeFilter)("googlekit.SettingsConfirmed","googlekit.AdSenseSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"save",value:function(){var e=this.state.useSnippet;this._isMounted&&this.setState({useSnippet:e});var t={useSnippet:e||!1};return googlesitekit.modules.adsense.settings&&(googlesitekit.modules.adsense.settings.useSnippet=e),b.c.set(b.b,"adsense","use-snippet",t).then((function(e){return e})).catch((function(e){return e}))}},{key:"handleUseSnippetSwitch",value:function(){var e=this.props.saveOnChange,t=this.state.useSnippet;t=!t,this._isMounted&&this.setState({useSnippet:t}),Object(y.v)("adsense_setup",t?"adsense_tag_enabled":"adsense_tag_disabled"),e&&b.c.set(b.b,"adsense","use-snippet",{useSnippet:t}).then((function(e){return e})).catch((function(e){return e}))}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(y.y)("adsense",{useSnippet:"useSnippet"},this.state)}}},{key:"render",value:function(){var e=this.state.useSnippet,t=this.props,a=t.isEditing,n=t.switchLabel,i=t.switchOnMessage,o=t.switchOffMessage;return React.createElement(h.Fragment,null,a?React.createElement(h.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__switch"},React.createElement(_.a,{id:"enableAutoAds",label:n,onClick:this.handleUseSnippetSwitch,checked:e,hideLabel:!1})," ",React.createElement("span",{className:"googlesitekit-recommended"},Object(v.__)("RECOMMENDED","google-site-kit"))),e&&i&&React.createElement("div",{className:"googlesitekit-settings-notice googlesitekit-settings-notice--suggestion"},React.createElement("div",{className:"googlesitekit-settings-notice__text"},i)),!e&&o&&React.createElement("div",{className:"googlesitekit-settings-notice"},React.createElement("div",{className:"googlesitekit-settings-notice__text"},o))):React.createElement(h.Fragment,null,Object(v.__)("The AdSense code has","google-site-kit")," ",e?Object(v.__)("been placed on your site.","google-site-kit"):Object(v.__)("not been placed on your site.","google-site-kit")))}}]),t}(h.Component);E.propTypes={isEditing:k.a.bool,accountTagMatch:k.a.bool,existingTag:k.a.oneOfType([k.a.bool,k.a.string]),switchLabel:k.a.string,switchOnMessage:k.a.string,switchOffMessage:k.a.string},E.defaultProps={isEditing:!1,accountTagMatch:!1,existingTag:!1,switchLabel:Object(v.__)("Let Site Kit place code on your site","google-site-kit"),switchOnMessage:"",switchOffMessage:""},t.default=E},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(20),h=a(28),_=a(0),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.modules.adsense.accountURL;return React.createElement("section",{className:"googlesitekit-module-outro"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-module-outro__logo"},React.createElement(p.a,{id:"adsense",height:"36",width:"42"}),React.createElement(p.a,{id:"plus",height:"13",width:"13"}),React.createElement(p.a,{id:"analytics",height:"36",width:"34"})),React.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-module-outro__title "},Object(_.__)("Connect Analytics with AdSense to create a powerful team that shows robust metrics for your site.","google-site-kit")),React.createElement("div",{className:"googlesitekit-module-outro__button"},React.createElement(h.a,{href:e,target:"_blank"},Object(_.__)("Connect Accounts","google-site-kit")))))))}}]),t}(m.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(23),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(19),b=a(9),f=a(2),k=a(29),y=a(39),v=a(101),O=a(12),E=a(0),R=a(15);function j(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var S=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=Object(f.h)().dateRangeFrom,a=[{title:Object(E.__)("Medium","google-site-kit"),tooltip:Object(E.__)("Medium refers to where your traffic originated from","google-site-kit")},{title:Object(E.__)("Users","google-site-kit"),tooltip:Object(E.__)("Number of users that originated from that traffic","google-site-kit")},{title:Object(E.__)("New Users","google-site-kit"),tooltip:Object(E.sprintf)(Object(E.__)("Number of new users to visit your page over %s","google-site-kit"),t)},{title:Object(E.__)("Sessions","google-site-kit"),tooltip:Object(E.sprintf)(Object(E.__)("Number of sessions users had on your website over %s","google-site-kit"),t)},{title:Object(E.__)("Percentage","google-site-kit"),tooltip:Object(E.__)("Percentage of sessions","google-site-kit")}],n=e[0].data.totals[0].values[0],i=Object(O.map)(e[0].data.rows,(function(e,t){var a=e.metrics[0].values[0]/n*100;return!(1>a)&&[e.dimensions[0],Object(f.r)(e.metrics[0].values[0]),Object(f.r)(e.metrics[0].values[1]),Object(f.r)(e.metrics[0].values[2]),React.createElement(h.Fragment,{key:"minichart-analytics-top-as-"+t},React.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(a.toFixed(2),"%")," ",React.createElement(v.a,{percent:a.toFixed(1),index:t})))]})),o=Object(k.b)(i,a,{hideHeader:!1,chartsEnabled:!1});return React.createElement("div",{className:"googlesitekit-details-widget"},React.createElement(k.a,null,o))}}]),t}(h.Component);t.default=Object(_.a)(S,[{type:b.b,identifier:"analytics",datapoint:"report",data:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?j(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):j(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},R.trafficSourcesReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(f.o)("day"),context:["Single","Dashboard"]}],React.createElement(y.a,{rows:4,rowHeight:50}))},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(19),h=a(9),_=a(2),b=a(29),f=a(39),k=a(12),y=a(0),v=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=[{title:Object(y.__)("Keyword","google-site-kit"),tooltip:Object(y.__)("Most searched for keywords related to your content","google-site-kit"),primary:!0},{title:Object(y.__)("Clicks","google-site-kit"),tooltip:Object(y.__)("Number of times users clicked on your content in search results","google-site-kit")},{title:Object(y.__)("Impressions","google-site-kit"),tooltip:Object(y.__)("Counted each time your content appears in search results","google-site-kit")}],a=googlesitekit.admin.siteURL,n=[],i=Object(k.map)(e,(function(e,t){var i=e.keys[0];return n[t]=Object(y.sprintf)("https://search.google.com/search-console/performance/search-analytics?resource_id=%s&query=!%s&num_of_days=28",a,i),[i,Object(_.r)(e.clicks),Object(_.r)(e.impressions)]})),o={hideHeader:!1,chartsEnabled:!1,links:n},c=Object(b.b)(i,t,o);return React.createElement(b.a,null,c)}}]),t}(m.Component);t.default=Object(p.a)(v,[{type:h.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:googlesitekit.permaLink,dimensions:"query",limit:10},priority:1,maxAge:Object(_.o)("day"),context:["Single","Dashboard"]}],React.createElement(f.a,{padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(21),p=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(p.Component);t.default=Object(m.a)("googlesitekit.DashboardSearchFunnel")(h)},,,,,,,,,,,,function(e,t,a){"use strict";a(1);var n=a(34),i=a(77),o=a(2),c=a(0);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=googlesitekit.modules[e].name,l=React.createElement(n.a
6
/* translators: %s: Module name */,{title:Object(c.sprintf)(Object(c.__)("%s activation","google-site-kit"),r)
7
+ /* translators: %s: Module name */,description:Object(c.sprintf)(Object(c.__)("%s module needs to be configured","google-site-kit"),r),ctaLabel:Object(c.__)("Complete activation","google-site-kit"),onClick:function(){window.location=Object(o.l)(e,!0)}});return Object(i.a)(l,t,a,s)}},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(24),h=a(8),_=a.n(h),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){for(var e=this.props,t=e.width,a=e.height,n=e.shape,i=e.count,o=[],c=0;c++<i;)o.push(React.createElement(p.a,{width:t,height:a,shape:n,key:c}));return o}}]),t}(m.Component);b.propTypes={width:_.a.string,height:_.a.string,shape:_.a.string,count:_.a.number},b.defaultProps={width:"100px",height:"100px",shape:"square",count:1},t.a=b},function(e,t,a){"use strict";a.r(t);var n=a(11),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(13),p=a.n(m),h=a(7),_=a.n(h),b=a(1),f=a(28),k=a(14),y=a(9),v=a(22),O=a(20),E=a(8),R=a.n(E),j=a(2),S=a(0),w=a(10),D=function(e){function t(e){var a;c()(this,t),a=d()(this,g()(t).call(this,e));var n=googlesitekit.modules.optimize.settings,i=n.optimizeID,o=n.ampClientIDOptIn,s=n.ampExperimentJSON,r=(googlesitekit.modules.analytics||{}).settings,l=googlesitekit.modules.tagmanager||{},u=l.active,m=l.settings,h=!!r&&r.useSnippet,_=!(!u||!m)&&m.useSnippet;return a.state={optimizeID:i||"",analyticsUseSnippet:h,gtmUseSnippet:_,errorCode:!1,errorMsg:"",ampClientIDOptIn:o||!1,ampExperimentJSON:s||"",ampExperimentJSONValidated:!0,OptimizeIDValidated:!0},a.handleOptimizeIDEntry=a.handleOptimizeIDEntry.bind(p()(a)),a.handleSubmit=a.handleSubmit.bind(p()(a)),a.renderInstructionInfo=a.renderInstructionInfo.bind(p()(a)),a.handleAMPOptimizeEntry=a.handleAMPOptimizeEntry.bind(p()(a)),a}return _()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0,Object(w.addFilter)("googlekit.SettingsConfirmed","googlekit.OptimizeSettingsConfirmed",(function(t,a){return"optimize"!==a.replace("-module","")?t:e.props.isEditing?e.handleSubmit():void 0})),this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(w.removeFilter)("googlekit.SettingsConfirmed","googlekit.OptimizeSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(j.y)("optimize",{optimizeID:"optimizeID",ampExperimentJSON:"ampExperimentJSON"},this.state)}}},{key:"handleSubmit",value:function(){var e,t,a,n,o,c,s=this;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=this.state,t=e.optimizeID,a=e.ampExperimentJSON,n=e.OptimizeIDValidated,o=this.props.finishSetup,n&&0!==t.length){r.next=4;break}return r.abrupt("return",!1);case 4:return c={optimizeID:t,ampExperimentJSON:a},r.next=7,i.a.awrap(y.c.set(y.b,"optimize","settings",c).then((function(){o&&o(),googlesitekit.modules.optimize.settings.optimizeID=t,s._isMounted&&s.setState({isSaving:!1})})).catch((function(e){s._isMounted&&s.setState({errorCode:!0,errorMsg:e.errorMsg})})));case 7:return r.abrupt("return",r.sent);case 8:case"end":return r.stop()}}),null,this)}},{key:"handleOptimizeIDEntry",value:function(e){var t=Object(j.A)(e.target.value);this._isMounted&&this.setState({optimizeID:e.target.value,OptimizeIDValidated:t})}},{key:"handleAMPOptimizeEntry",value:function(e){var t=Object(j.z)(e.target.value);this._isMounted&&this.setState({ampExperimentJSON:e.target.value,ampExperimentJSONValidated:t})}},{key:"renderInfo",value:function(){var e=this.state.optimizeID;return React.createElement(b.Fragment,null,e?React.createElement("div",null,Object(S.__)("Your Optimize Container ID","google-site-kit"),": ",React.createElement("strong",null,e)):React.createElement("div",null,Object(S.__)('Optimize Container ID missing, press "edit" to add',"google-site-kit"),"."))}},{key:"renderInstructionInfo",value:function(){var e=this.state,t=e.analyticsUseSnippet,a=e.gtmUseSnippet,n=e.optimizeID;return!t&&a?React.createElement(b.Fragment,null,React.createElement("p",null,Object(S.__)("You are using auto insert snippet with Tag Manager","google-site-kit")),React.createElement("p",null,React.createElement("a",{href:"https://support.google.com/optimize/answer/6314801"},Object(S.__)("Click here","google-site-kit"))," ",Object(S.__)("for how to implement Optimize tag through your Tag Manager","google-site-kit"))):t?null:React.createElement(b.Fragment,null,React.createElement("p",null,Object(S.__)("You disabled analytics auto insert snippet. If You are using Google Analytics code snippet, add the code below:","google-site-kit")),React.createElement("pre",null,'ga("require", "',n||"GTM-XXXXXXX",'");'),React.createElement("p",null,React.createElement("a",{href:"https://support.google.com/optimize/answer/6262084"},Object(S.__)("Click here","google-site-kit"))," ",Object(S.__)("for how to implement Optimize tag in Google Analytics Code Snippet","google-site-kit")))}},{key:"renderAMPSnippet",value:function(){var e=this.state,t=e.analyticsUseSnippet,a=e.ampClientIDOptIn,n=e.ampExperimentJSON,i=e.ampExperimentJSONValidated,o=window.googlesitekit.admin.ampEnabled;return t&&o?React.createElement(b.Fragment,null,a&&React.createElement(b.Fragment,null,React.createElement("p",null,Object(S.__)("Please input your AMP experiment settings in JSON format below.","google-site-kit")," ",React.createElement(k.a,{href:"https://developers.google.com/optimize/devguides/amp-experiments",external:!0,inherit:!0},Object(S.__)("Learn More.","google-site-kit"))),React.createElement(v.l,{className:"\n\t\t\t\t\t\t\t\tmdc-text-field\n\t\t\t\t\t\t\t\t".concat(i?"":"mdc-text-field--error","\n\t\t\t\t\t\t\t"),name:"amp-experiment",onChange:this.handleAMPOptimizeEntry,textarea:!0},React.createElement(v.b,{inputType:"textarea",value:null===n?"":n})),!i&&React.createElement("p",{className:"googlesitekit-error-text"},Object(S.__)("Error: AMP experiment settings are not in a valid JSON format.","google-site-kit")))):null}},{key:"renderForm",value:function(){var e=this.state,t=e.optimizeID,a=e.errorCode,n=e.errorMsg,i=e.OptimizeIDValidated;return React.createElement(b.Fragment,null,React.createElement("p",null,Object(S.__)("Please copy and paste your Optimize ID to complete your setup.","google-site-kit")," ",React.createElement(k.a,{href:"https://support.google.com/optimize/answer/6211921",external:!0,inherit:!0},Object(S.__)("You can locate this here.","google-site-kit"))),a&&0<n.length&&React.createElement("p",{className:"googlesitekit-error-text"},Object(S.__)("Error:","google-site-kit")," ",n),React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(v.l,{className:"\n\t\t\t\t\t\t\tmdc-text-field\n\t\t\t\t\t\t\t".concat(a?"mdc-text-field--error":"","\n\t\t\t\t\t\t\t").concat(i?"":"mdc-text-field--error","\n\t\t\t\t\t\t"),label:Object(S.__)("Optimize Container ID","google-site-kit"),name:"optimizeID",onChange:this.handleOptimizeIDEntry,helperText:React.createElement(v.a,null,Object(S.__)("Format: GTM-XXXXXXX.","google-site-kit")),outlined:!0,required:!0},React.createElement(v.b,{value:t}))),!i&&React.createElement("p",{className:"googlesitekit-error-text"},Object(S.__)("Error: Not a valid Optimize ID.","google-site-kit")),this.renderAMPSnippet(),this.renderInstructionInfo())}},{key:"render",value:function(){var e=this.props,t=e.onSettingsPage,a=e.isEditing;return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--optimize"},!t&&React.createElement(b.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(O.a,{id:"optimize",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(S._x)("Optimize","Service name","google-site-kit"))),a&&this.renderForm(),!a&&this.renderInfo(),!t&&React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(f.a,{onClick:this.handleSubmit},Object(S.__)("Configure Optimize","google-site-kit"))))}}]),t}(b.Component);D.propTypes={onSettingsPage:R.a.bool,finishSetup:R.a.func,isEditing:R.a.bool},D.defaultProps={onSettingsPage:!0,isEditing:!1},t.default=D},function(e,t,a){"use strict";a.r(t),a.d(t,"PageSpeedInsightsDashboardWidgetHomepageSpeedMobile",(function(){return O})),a.d(t,"PageSpeedInsightsDashboardWidgetHomepageSpeedDesktop",(function(){return E}));var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(19),h=a(45),_=a(9),b=a(2),f=a(29),k=a(0),y=a(67),v=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.data,a=e.handleDataLoaded;t&&a&&a()}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.title;if(!t||t.error)return null;if(function(e){return 0===e.categories.performance.score}(t))return Object(h.a)(Object(k._x)("PageSpeed Insights","Service name","google-site-kit"),Object(k.__)("An unknown error occurred while trying to fetch PageSpeed Insights data. Please try again later.","google-site-kit"),!0);var n=t.categories.performance.score,i=Object(y.getScoreCategoryLabel)(n),o=t.audits.interactive.displayValue,c=Object(f.b)([[Object(k.__)("Real user speed data","google-site-kit"),React.createElement(y.PageSpeedReportScoreCategoryWrapper,{key:"0",score:n},i)],[Object(k.__)("Time to become fully interactive","google-site-kit"),React.createElement(y.PageSpeedReportScoreCategoryWrapper,{key:"0",score:n},o)]],[],{hideHeader:!0,disableListMode:!0,chartsEnabled:!1,links:[]});return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement("div",{className:"googlesitekit-pagespeed-report__heading-wrapper"},React.createElement("h3",{className:" googlesitekit-subheading-1 "},a),React.createElement(y.PageSpeedReportScoreGauge,{score:n})),React.createElement(f.a,null,c))}}]),t}(m.Component),O=Object(p.a)(v,[{type:_.b,identifier:"pagespeed-insights",datapoint:"pagespeed",data:{url:googlesitekit.permaLink,strategy:"mobile"},priority:10,maxAge:Object(b.o)("day"),context:["Single","Dashboard"]}],null,{inGrid:!0}),E=Object(p.a)(v,[{type:_.b,identifier:"pagespeed-insights",datapoint:"pagespeed",data:{url:googlesitekit.permaLink,strategy:"desktop"},priority:10,maxAge:Object(b.o)("day"),context:["Single","Dashboard"]}],null,{inGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(23),i=a.n(n),o=a(11),c=a.n(o),s=a(3),r=a.n(s),l=a(4),d=a.n(l),u=a(5),g=a.n(u),m=a(6),p=a.n(m),h=a(13),_=a.n(h),b=a(7),f=a.n(b),k=a(1),y=a(28),v=a(14),O=a(66),E=a(9),R=a(31),j=a(22),S=a(20),w=a(8),D=a.n(w),C=a(2),x=a(12),N=a(0),A=a(10),P=function(e){function t(e){var a;r()(this,t),a=g()(this,p()(t).call(this,e));var n=googlesitekit.modules.tagmanager.settings,i="primary"===googlesitekit.admin.ampMode?"amp":"web",o="amp"===i?"ampContainerID":"containerID";return a.state={isLoading:!0,accounts:[],containers:[],errorCode:!1,errorMsg:"",refetch:!1,selectedAccount:n.accountID,selectedContainer:n[o],containersLoading:!1,usageContext:i,containerKey:o,hasExistingTag:!1,useSnippet:n.useSnippet},a.handleSubmit=a.handleSubmit.bind(_()(a)),a.renderAccountDropdownForm=a.renderAccountDropdownForm.bind(_()(a)),a.handleAccountChange=a.handleAccountChange.bind(_()(a)),a.handleContainerChange=a.handleContainerChange.bind(_()(a)),a.refetchAccount=a.refetchAccount.bind(_()(a)),a}return f()(t,e),d()(t,[{key:"componentDidMount",value:function(){var e,t,a,n=this;return c.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(e=this.props,t=e.isOpen,a=e.onSettingsPage,this._isMounted=!0,!a||t){i.next=4;break}return i.abrupt("return");case 4:return i.next=6,c.a.awrap(this.loadAccountsContainers());case 6:Object(A.addFilter)("googlekit.SettingsConfirmed","googlekit.TagmanagerSettingsConfirmed",(function(e,t){return"tagmanager"!==t.replace("-module","")?e:n.props.isEditing?n.handleSubmit():void 0})),this.toggleConfirmChangesButton();case 8:case"end":return i.stop()}}),null,this)}},{key:"componentDidUpdate",value:function(){this.state.refetch&&this.requestTagManagerAccounts(),this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(A.removeFilter)("googlekit.SettingsConfirmed","googlekit.TagmanagerSettingsConfirmed")}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){var e=this.state,t={selectedContainer:e.containerKey,selectedAccount:"selectedAccount",useSnippet:"useSnippet"};"tag_manager_existing_tag_permission"===e.errorCode&&(t={}),Object(C.y)("tagmanager",t,this.state)}}},{key:"loadAccountsContainers",value:function(){var e,t,a,n;return c.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,c.a.awrap(Object(C.j)("tagmanager"));case 2:if(!(e=i.sent)){i.next=18;break}return i.prev=4,i.next=7,c.a.awrap(E.c.get(E.b,"tagmanager","tag-permission",{tag:e}));case 7:t=i.sent,a=t.account,n=t.container,this.setState({isLoading:!1,selectedAccount:a.accountId,selectedContainer:n.publicId,accounts:[a],containers:[n],hasExistingTag:!0}),i.next=16;break;case 13:i.prev=13,i.t0=i.catch(4),this.setState({isLoading:!1,errorCode:i.t0.code,errorMsg:i.t0.message,errorReason:!(!i.t0.data||!i.t0.data.reason)&&i.t0.data.reason,hasExistingTag:!!e});case 16:i.next=20;break;case 18:return i.next=20,c.a.awrap(this.requestTagManagerAccounts());case 20:case"end":return i.stop()}}),null,this,[[4,13]])}},{key:"requestTagManagerAccounts",value:function(){var e,t,a,n,i,o,s,r,l,d;return c.a.async((function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,e=this.state,t=e.selectedAccount,a=e.usageContext,n=this.state.selectedContainer,i={accountID:t,usageContext:a},o=!1,s="",u.next=8,c.a.awrap(E.c.get(E.b,"tagmanager","accounts-containers",i));case 8:r=u.sent,l=r.accounts,d=r.containers,t||0!==l.length||(o="accountEmpty",s=Object(N.__)("We didn’t find an associated Google Tag Manager account, would you like to set it up now? If you’ve just set up an account please re-fetch your account to sync it with Site Kit.","google-site-kit")),t&&!l.find((function(e){return e.accountId===t}))&&(E.c.invalidateCacheGroup(E.b,"tagmanager","accounts-containers"),o="insufficientPermissions",s=Object(N.__)("You currently don't have access to this Google Tag Manager account. You can either request access from your team, or remove this Google Tag Manager snippet and connect to a different account.","google-site-kit")),n&&!d.find((function(e){return e.publicId===n}))&&(n=null),this._isMounted&&this.setState({isLoading:!1,accounts:l,selectedAccount:t||Object(x.get)(d,[0,"accountId"]),containers:d,selectedContainer:n||Object(x.get)(d,[0,"publicId"]),refetch:!1,errorCode:o,errorMsg:s}),u.next=20;break;case 17:u.prev=17,u.t0=u.catch(0),this._isMounted&&this.setState({isLoading:!1,errorCode:u.t0.code,errorMsg:u.t0.message,refetch:!1});case 20:case"end":return u.stop()}}),null,this,[[0,17]])}},{key:"requestTagManagerContainers",value:function(e){var t,a;return c.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,t={accountID:e,usageContext:this.state.usageContext},n.next=4,c.a.awrap(E.c.get(E.b,"tagmanager","containers",t));case 4:a=n.sent,this._isMounted&&this.setState({containersLoading:!1,containers:a,selectedContainer:Object(x.get)(a,[0,"publicId"]),errorCode:!1}),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),this._isMounted&&this.setState({errorCode:n.t0.code,errorMsg:n.t0.message});case 11:case"end":return n.stop()}}),null,this,[[0,8]])}},{key:"handleSubmit",value:function(){var e,t,a,n,o,s,r,l,d,u,g;return c.a.async((function(m){for(;;)switch(m.prev=m.next){case 0:return e=this.state,t=e.containerKey,a=e.hasExistingTag,n=e.selectedAccount,o=e.selectedContainer,s=e.usageContext,r=e.useSnippet,l=this.props.finishSetup,m.prev=2,d={accountID:n},i()(d,t,o),i()(d,"usageContext",s),i()(d,"useSnippet",!a&&r),u=d,m.next=6,c.a.awrap(E.c.set(E.b,"tagmanager","settings",u));case 6:g=m.sent,l&&l(),googlesitekit.modules.tagmanager.settings=g,this._isMounted&&this.setState({isSaving:!1}),m.next=16;break;case 12:return m.prev=12,m.t0=m.catch(2),this._isMounted&&this.setState({isLoading:!1,errorCode:m.t0.code,errorMsg:m.t0.message}),m.abrupt("return",new Promise.reject(m.t0));case 16:case"end":return m.stop()}}),null,this,[[2,12]])}},{key:"handleAccountChange",value:function(e,t){var a=this.state.selectedAccount,n=t.getAttribute("data-value");n!==a&&(this._isMounted&&this.setState({containersLoading:!0,selectedAccount:n}),this.requestTagManagerContainers(n))}},{key:"handleContainerChange",value:function(e,t){var a=this.state.selectedContainer,n=t.getAttribute("data-value");n!==a&&this._isMounted&&this.setState({selectedContainer:n})}},{key:"refetchAccount",value:function(e){e.preventDefault(),this._isMounted&&this.setState({isLoading:!0,refetch:!0,errorCode:!1})}},{key:"renderSettingsInfo",value:function(){var e=googlesitekit.modules.tagmanager.settings,t=this.state,a=t.hasExistingTag,n=t.containerKey,i=t.isLoading,o=e.accountID,c=e.useSnippet;return i?React.createElement(R.a,null):React.createElement(k.Fragment,null,React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(N.__)("Account","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},o||!1)),React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(N.__)("Container ID","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},e[n]||!1))),React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(N.__)("Tag Manager Code Snippet","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},c&&Object(N.__)("Snippet is inserted","google-site-kit"),!c&&Object(N.__)("Snippet is not inserted","google-site-kit")),a&&React.createElement("p",null,Object(N.__)("Placing two tags at the same time is not recommended.","google-site-kit")))))}},{key:"renderAccountDropdownForm",value:function(){var e=this,a=this.state,n=a.accounts,i=a.selectedAccount,o=a.containers,c=a.selectedContainer,s=a.hasExistingTag,r=a.isLoading,l=a.containersLoading,d=a.errorCode,u=a.useSnippet,g=this.props.onSettingsPage;return r?React.createElement(R.a,null):"tag_manager_existing_tag_permission"===d?null:"accountEmpty"===d?React.createElement(k.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(y.a,{onClick:t.createNewAccount},Object(N.__)("Create an account","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(v.a,{onClick:this.refetchAccount},Object(N.__)("Re-fetch My Account","google-site-kit"))))):React.createElement(k.Fragment,null,s&&React.createElement("p",null,Object(N.sprintf)(// translators: %s: the existing container ID.
8
+ Object(N.__)("An existing tag was found on your site (%s). If you later decide to replace this tag, Site Kit can place the new tag for you. Make sure you remove the old tag first.","google-site-kit"),c)),!s&&React.createElement("p",null,Object(N.__)("Please select your Tag Manager account and container below, the snippet will be inserted automatically into your site.","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(j.k,{enhanced:!0,name:"accounts",label:Object(N.__)("Account","google-site-kit"),value:i,disabled:s,onEnhancedChange:this.handleAccountChange,outlined:!0},n.map((function(e){return React.createElement(j.j,{key:e.accountId,value:e.accountId},e.name)}))),l?React.createElement(R.a,{small:!0}):React.createElement(j.k,{enhanced:!0,name:"containers",label:Object(N.__)("Container","google-site-kit"),value:c,disabled:s,onEnhancedChange:this.handleContainerChange,outlined:!0},o.concat({name:Object(N.__)("Set up a new container","google-site-kit"),publicId:0}).map((function(e,t){var a=e.name,n=e.publicId;return React.createElement(j.j,{key:t,value:n},a)})))),g&&React.createElement(k.Fragment,null,s&&React.createElement("p",null,Object(N.__)("Placing two tags at the same time is not recommended.","google-site-kit")),React.createElement(O.a,{id:"tagmanagerUseSnippet",onClick:function(){return e.setState({useSnippet:!u})},name:"useSnippet",checked:u,label:Object(N.__)("Let Site Kit place code on your site","google-site-kit"),hideLabel:!1}),React.createElement("p",null,u?Object(N.__)("Site Kit will add the code automatically","google-site-kit"):Object(N.__)("Site Kit will not add the code to your site","google-site-kit"))),!g&&React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(y.a,{onClick:this.handleSubmit},Object(N.__)("Confirm & Continue","google-site-kit"))))}},{key:"renderErrorOrNotice",value:function(){var e=this.state,t=e.errorCode,a=e.errorMsg,n=this.props.onSettingsPage;if(0===a.length)return null;var i=!n||"insufficientPermissions"!==t;return React.createElement("div",{className:i?"googlesitekit-error-text":""},React.createElement("p",null,i?
9
/* translators: %s: Error message */
10
+ Object(N.sprintf)(Object(N.__)("Error: %s","google-site-kit"),a):a))}},{key:"render",value:function(){var e=this.props,t=e.onSettingsPage,a=e.isEditing;return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--tag-manager"},!t&&React.createElement(k.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(S.a,{id:"tagmanager",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(N._x)("Tag Manager","Service name","google-site-kit"))),this.renderErrorOrNotice(),a&&this.renderAccountDropdownForm(),!a&&this.renderSettingsInfo())}}],[{key:"createNewAccount",value:function(e){e.preventDefault(),window.open("https://marketingplatform.google.com/about/tag-manager/","_blank")}}]),t}(k.Component);P.propTypes={onSettingsPage:D.a.bool,finishSetup:D.a.func,isEditing:D.a.bool},P.defaultProps={onSettingsPage:!0,isEditing:!1},t.default=P},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(59),h=["#178EC5","#54B23B","#EB5729","#ECED33","#34CBE3","#82E88E"],_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.index,a=e.percent,n={backgroundColor:"transparent",chartArea:{width:"100%",height:"100%"},enableInteractivity:!1,height:28,legend:{position:"none"},slices:{0:{color:h[t]},1:{color:"#e6e6e6"}},title:null,tooltip:{trigger:"none"},width:28},i=[["source","percent"],["",+a],["",100-a]];return React.createElement("div",{className:"googlesitekit-mini-chart"},React.createElement(p.a,{data:i,options:n,chartType:"pie",loadSmall:!0,loadCompressed:!0,loadHeight:24,loadText:!1,id:"minichart"+t}))}}]),t}(m.Component);t.a=_},function(e,t,a){"use strict";a.r(t);var n=a(95),i=a.n(n),o=a(11),c=a.n(o),s=a(3),r=a.n(s),l=a(4),d=a.n(l),u=a(5),g=a.n(u),m=a(6),p=a.n(m),h=a(13),_=a.n(h),b=a(7),f=a.n(b),k=a(23),y=a.n(k),v=a(1),O=a(9),E=a(8),R=a.n(E),j=a(28),S=a(31),w=a(14),D=a(22),C=function(e){function t(e){var a;return r()(this,t),(a=g()(this,p()(t).call(this,e))).formFieldRef=Object(v.createRef)(),a.radioRef=Object(v.createRef)(),a}return f()(t,e),d()(t,[{key:"componentDidMount",value:function(){new D.e(this.formFieldRef.current).input=new D.g(this.radioRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onClick,a=e.id,n=e.name,i=e.value,o=e.checked,c=e.disabled,s=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-radio\n\t\t\t\t\t\t".concat(c?"mdc-radio--disabled":"","\n\t\t\t\t\t"),ref:this.radioRef},React.createElement("input",{className:"mdc-radio__native-control",onClick:t,type:"radio",id:a,name:n,value:i,checked:o,disabled:c,onChange:function(){}}),React.createElement("div",{className:"mdc-radio__background"},React.createElement("div",{className:"mdc-radio__outer-circle"}),React.createElement("div",{className:"mdc-radio__inner-circle"}))),React.createElement("label",{htmlFor:a},s))}}]),t}(v.Component);C.propTypes={onClick:R.a.func,id:R.a.string.isRequired,name:R.a.string.isRequired,value:R.a.string.isRequired,checked:R.a.bool,disabled:R.a.bool,children:R.a.string.isRequired},C.defaultProps={onClick:null,checked:!1,disabled:!1};var x=C,N=a(66),A=a(20),P=a(2),L=a(0),I=a(10);function M(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function T(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?M(a,!0).forEach((function(t){y()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):M(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var F=y()({},"loggedinUsers",Object(L.__)("Logged-in users","google-site-kit")),U=function(e){function t(e){var a;r()(this,t),a=g()(this,p()(t).call(this,e));var n=googlesitekit.modules.analytics.settings,i=n.accountID,o=n.anonymizeIP,c=n.internalWebPropertyID,s=n.profileID,l=n.propertyID,d=n.useSnippet,u=n.ampClientIDOptIn,m=n.trackingDisabled;return a.state={anonymizeIP:o,isLoading:!0,isSaving:!1,propertiesLoading:!1,profilesLoading:!1,useSnippet:d||!1,errorCode:!1,errorMsg:"",errorReason:!1,accounts:[],properties:[],profiles:[],selectedAccount:i,selectedProperty:l,selectedProfile:s,selectedinternalWebProperty:c,ampClientIDOptIn:u,existingTag:!1,trackingDisabled:m||[]},a.handleAccountChange=a.handleAccountChange.bind(_()(a)),a.handlePropertyChange=a.handlePropertyChange.bind(_()(a)),a.handleProfileChange=a.handleProfileChange.bind(_()(a)),a.processAccountChange=a.processAccountChange.bind(_()(a)),a.processPropertyChange=a.processPropertyChange.bind(_()(a)),a.handleSubmit=a.handleSubmit.bind(_()(a)),a.handleRadioClick=a.handleRadioClick.bind(_()(a)),a.handleRefetchAccount=a.handleRefetchAccount.bind(_()(a)),a.handleExclusionsChange=a.handleExclusionsChange.bind(_()(a)),a.switchStatus=a.switchStatus.bind(_()(a)),a}return f()(t,e),d()(t,[{key:"componentDidMount",value:function(){var e,t,a,n,i,o=this;return c.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:if(e=this.props,t=e.isOpen,a=e.onSettingsPage,this._isMounted=!0,!a||t){s.next=4;break}return s.abrupt("return");case 4:return s.next=6,c.a.awrap(Object(P.j)("analytics"));case 6:if(!(n=s.sent)||!n.length){s.next=21;break}return s.prev=8,s.next=11,c.a.awrap(O.c.get(O.b,"analytics","tag-permission",{tag:n}));case 11:return i=s.sent,s.next=14,c.a.awrap(this.getAccounts(i));case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(8),this.setState({isLoading:!1,errorCode:s.t0.code,errorMsg:s.t0.message,errorReason:!(!s.t0.data||!s.t0.data.reason)&&s.t0.data.reason});case 19:s.next=23;break;case 21:return s.next=23,c.a.awrap(this.getAccounts());case 23:Object(I.addFilter)("googlekit.SettingsConfirmed","googlekit.AnalyticsSettingsConfirmed",(function(e,t){return"analytics"!==t.replace("-module","")?e:o.props.isEditing?o.handleSubmit():void 0}));case 24:case"end":return s.stop()}}),null,this,[[8,16]])}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(I.removeFilter)("googlekit.SettingsConfirmed","googlekit.AnalyticsSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){var e={anonymizeIP:"anonymizeIP",selectedAccount:"accountID",selectedProperty:"propertyID",selectedProfile:"profileID",selectedinternalWebProperty:"internalWebPropertyID",useSnippet:"useSnippet",ampClientIDOptIn:"ampClientIDOptIn",trackingDisabled:"trackingDisabled"};"-1"===this.state.selectedAccount&&(e={}),Object(P.y)("analytics",e,this.state)}}},{key:"handleAccountChange",value:function(e,t){var a=this.state.selectedAccount,n=t.dataset.value;n!==a&&("0"!==n?(this.setState({propertiesLoading:!0,profilesLoading:!0,selectedAccount:n}),Object(P.v)("analytics_setup","account_change",n),"-1"!==n&&this.processAccountChange(n)):this.setState({selectedAccount:n,selectedProperty:"-1",selectedProfile:"-1",properties:[{id:"-1",name:Object(L.__)("Select an account","google-site-kit")}],profiles:[{id:"-1",name:Object(L.__)("Select an account","google-site-kit")}]}))}},{key:"handlePropertyChange",value:function(e,t){var a=this.state.selectedProperty,n=t.dataset.value;n!==a&&("0"!==n?(this.setState({profilesLoading:!0,selectedProperty:n}),Object(P.v)("analytics_setup","property_change",n),this.processPropertyChange(n)):this.setState({selectedProperty:n,selectedProfile:n,profiles:[{id:0,name:Object(L.__)("Setup a New Profile","google-site-kit")}]}))}},{key:"handleProfileChange",value:function(e,t){var a=t.dataset.value;this.setState({selectedProfile:a}),Object(P.v)("analytics_setup","profile_change",a)}},{key:"getAccounts",value:function(){var e,t,a,n,i,o,s,r,l,d,u,g,m,p,h,_,b=this,f=arguments;return c.a.async((function(k){for(;;)switch(k.prev=k.next){case 0:return e=f.length>0&&void 0!==f[0]&&f[0],t=this.state,a=t.selectedAccount,n=t.selectedProperty,i=t.selectedProfile,o=t.useSnippet,s=this.props,r=s.isEditing,l=s.onSettingsPage,d=this.state.errorCode,u={},k.prev=5,g=e?{existingAccountID:e.accountID,existingPropertyID:e.propertyID}:{},k.next=9,c.a.awrap(O.c.get(O.b,"analytics","accounts-properties-profiles",g));case 9:0===(m=k.sent).accounts.length?(u=T({},u,{errorCode:"no_account",errorReason:"noAccount"}),O.c.invalidateCacheGroup(O.b,"analytics","accounts-properties-profiles")):a?"0"===a?m.accounts.unshift({id:0,name:Object(L.__)("Select one...","google-site-kit")}):a&&!m.accounts.find((function(e){return e.id===a}))&&(O.c.invalidateCacheGroup(O.b,"analytics","accounts-properties-profiles"),m.accounts.unshift({id:0,name:Object(L.__)("Select one...","google-site-kit")}),r&&(a="0",n="-1",i="-1"),u=T({},u,{errorCode:"insufficient_permissions",errorReason:"insufficientPermissions"})):(p=null,m.matchedProperty&&(p=m.matchedProperty),p?(a=p.accountId,n=p.id,(h=m.profiles.find((function(e){return e.accountId===a})))&&(i=h.id)):m.accounts.unshift({id:0,name:Object(L.__)("Select one...","google-site-kit")})),_={id:"-1",name:Object(L.__)("Select an account","google-site-kit")},this.state.existingTag||m.properties.push({id:0,name:Object(L.__)("Setup a New Property","google-site-kit")}),m.profiles.push({id:0,name:Object(L.__)("Setup a New Profile","google-site-kit")}),l||(o=!e),u=T({},u,{isLoading:!1,accounts:m.accounts,errorCode:d||u.errorCode,selectedAccount:a,selectedProperty:n,selectedProfile:i,properties:[_],profiles:[_],existingTag:!!e&&e.propertyID,useSnippet:o}),a&&"0"!==a&&(u=Object.assign(u,{properties:m.properties,profiles:m.profiles,selectedinternalWebProperty:m.properties[0]?m.properties[0].internalWebPropertyID:0})),k.next=22;break;case 19:k.prev=19,k.t0=k.catch(5),u={isLoading:!1,errorCode:k.t0.code,errorMsg:k.t0.message,errorReason:!(!k.t0.data||!k.t0.data.reason)&&k.t0.data.reason};case 22:return k.abrupt("return",new Promise((function(e){b._isMounted?b.setState(u,e):e()})));case 23:case"end":return k.stop()}}),null,this,[[5,19]])}},{key:"processAccountChange",value:function(e){var t,a,n,i;return c.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,t={accountID:e},o.next=4,c.a.awrap(O.c.get(O.b,"analytics","properties-profiles",t));case 4:a=o.sent,n={id:0,name:Object(L.__)("Setup a New Property","google-site-kit")},a.properties.push(n),i={id:0,name:Object(L.__)("Setup a New Profile","google-site-kit")},a.profiles.push(i),this.setState({propertiesLoading:!1,profilesLoading:!1,properties:a.properties,profiles:a.profiles,selectedAccount:e,selectedProperty:a.properties[0].id,selectedinternalWebProperty:a.properties[0].internalWebPropertyID,selectedProfile:a.profiles[0].id,errorCode:!1}),o.next=15;break;case 12:o.prev=12,o.t0=o.catch(0),this.setState({errorCode:o.t0.code,errorMsg:o.t0.message});case 15:case"end":return o.stop()}}),null,this,[[0,12]])}},{key:"processPropertyChange",value:function(e){var t,a,n;return c.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return t=this.state.selectedAccount,i.prev=1,a={accountID:t,propertyID:e},i.next=5,c.a.awrap(O.c.get(O.b,"analytics","profiles",a));case 5:n=i.sent,this.setState({profilesLoading:!1,profiles:n,selectedProperty:e,selectedinternalWebProperty:n[0].internalWebPropertyID,selectedProfile:n[0].id,errorCode:!1}),i.next=12;break;case 9:i.prev=9,i.t0=i.catch(1),this.setState({errorCode:i.t0.code,errorMsg:i.t0.message});case 12:case"end":return i.stop()}}),null,this,[[1,9]])}},{key:"handleSubmit",value:function(e){var t,a,n,i,o,s,r,l,d,u,g,m,p,h,_,b,f,k;return c.a.async((function(y){for(;;)switch(y.prev=y.next){case 0:if(e&&e.preventDefault(),this.state.selectedAccount&&"-1"!==this.state.selectedAccount){y.next=3;break}return y.abrupt("return");case 3:return t=this.state,a=t.anonymizeIP,n=t.selectedAccount,i=t.selectedProperty,o=t.selectedProfile,s=t.useSnippet,r=t.selectedinternalWebProperty,l=t.accounts,d=t.properties,u=t.profiles,g=t.ampClientIDOptIn,m=t.trackingDisabled,this.setState({isSaving:!0}),p=this.props.finishSetup,h=o||(u[0].id||0===u[0].id?u[0].id.toString():null),_=i||(d[0].id||0===d[0].id?d[0].id.toString():null),b="0"===_?"0":r||(d[0].internalWebPropertyId||0===d[0].internalWebPropertyId?d[0].internalWebPropertyId.toString():null),f={anonymizeIP:a,accountID:n||l[0].id||null,profileID:h,propertyID:_,internalWebPropertyID:b,useSnippet:s||!1,ampClientIDOptIn:g||!1,trackingDisabled:m},y.prev=10,y.next=13,c.a.awrap(O.c.set(O.b,"analytics","settings",f));case 13:return k=y.sent,O.c.invalidateCacheGroup(O.b,"analytics","accounts-properties-profiles"),y.next=17,c.a.awrap(this.getAccounts());case 17:googlesitekit.modules.analytics.settings=k,Object(P.v)("analytics_setup","analytics_configured"),p&&p(),this._isMounted&&this.setState({isSaving:!1,selectedAccount:k.accountID,selectedProfile:k.profileID,selectedProperty:k.propertyID,selectedinternalWebProperty:k.internalWebPropertyID}),y.next=26;break;case 23:y.prev=23,y.t0=y.catch(10),this.setState({isSaving:!1,errorCode:y.t0.code,errorMsg:y.t0.message});case 26:case"end":return y.stop()}}),null,this,[[10,23]])}},{key:"handleRadioClick",value:function(e){var t="1"===e.target.value;this.setState({useSnippet:t}),Object(P.v)("analytics_setup",t?"analytics_tag_enabled":"analytics_tag_disabled")}},{key:"switchStatus",value:function(e){var t=this;return function(){t.setState(y()({},e,!t.state[e]))}}},{key:"handleRefetchAccount",value:function(){this.setState({isLoading:!0,errorCode:!1,errorMsg:"",selectedAccount:"0",selectedProperty:"-1",selectedProfile:"-1",propertiesLoading:!1,profilesLoading:!1},this.getAccounts)}},{key:"handleExclusionsChange",value:function(e){var t=this.state.trackingDisabled,a=e.target,n=a.id,o=a.checked,c=Object.assign.apply(Object,[{}].concat(i()(t.map((function(e){return y()({},e,!0)}))),[y()({},n,o)]));this.setState({trackingDisabled:Object.keys(c).filter((function(e){return c[e]}))})}},{key:"renderAutoInsertSnippetForm",value:function(){var e=this.state,t=e.anonymizeIP,a=e.useSnippet,n=e.isSaving,i=e.ampClientIDOptIn,o=e.existingTag,c=this.props,s=c.isEditing,r=c.onSettingsPage,l=!s,d=window.googlesitekit.admin,u=d.ampEnabled,g=d.ampMode,m=window.googlesitekit.modules.analytics.settings.useSnippet;return React.createElement("div",{className:"googlesitekit-setup-module__inputs googlesitekit-setup-module__inputs--multiline"},(s||n)&&React.createElement(v.Fragment,null,r&&React.createElement(v.Fragment,null,!m&&!o&&React.createElement(v.Fragment,null,React.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(L.__)("Currently there is no Analytics snippet placed on your site, so no stats are being gathered. Would you like Site Kit to insert the Analytics snippet? You can change this setting later.","google-site-kit"))),m&&React.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(L.__)("Do you want to remove the Analytics snippet inserted by Site Kit?","google-site-kit"))),r&&!o&&!a&&m&&React.createElement("p",null,Object(L.__)("If the code snippet is removed, you will no longer be able to gather Analytics insights about your site.","google-site-kit"))),r&&React.createElement(v.Fragment,null,o&&React.createElement("p",null,Object(L.__)("Placing two tags at the same time is not recommended.","google-site-kit")),React.createElement(x,{onClick:this.handleRadioClick,id:"useSnippetTrue",name:"useSnippet",value:"1",checked:a,disabled:l},m?Object(L.__)("Not at this time","google-site-kit"):Object(L.__)("Insert snippet","google-site-kit")),React.createElement(x,{onClick:this.handleRadioClick,id:"useSnippetFalse",name:"useSnippet",value:"0",checked:!a,disabled:l},m?Object(L.__)("Remove snippet","google-site-kit"):Object(L.__)("Not at this time","google-site-kit"))),a&&u&&React.createElement("div",{className:"googlesitekit-setup-module__input"},React.createElement(N.a,{id:"ampClientIDOptIn",label:Object(L.__)("Opt in AMP Client ID","google-site-kit"),onClick:this.switchStatus("ampClientIDOptIn"),checked:i,hideLabel:!1}),React.createElement("p",null,i?Object(L.__)("Sessions will be combined across AMP/non-AMP pages.","google-site-kit")+" ":Object(L.__)("Sessions will be tracked separately between AMP/non-AMP pages.","google-site-kit")+" ",React.createElement(w.a,{href:"https://support.google.com/analytics/answer/7486764",external:!0,inherit:!0},Object(L.__)("Learn more","google-site-kit")))),r&&a&&"primary"!==g&&React.createElement("div",{className:"googlesitekit-setup-module__input"},React.createElement(N.a,{id:"anonymizeIP",label:Object(L.__)("Anonymize IP addresses","google-site-kit"),onClick:this.switchStatus("anonymizeIP"),checked:t,hideLabel:!1}),React.createElement("p",null,t?Object(L.__)("IP addresses will be anonymized.","google-site-kit"):Object(L.__)("IP addresses will not be anonymized.","google-site-kit")," ",React.createElement(w.a,{href:"https://support.google.com/analytics/answer/2763052",external:!0,inherit:!0,dangerouslySetInnerHTML:{__html:Object(L.__)('Learn more<span class="screen-reader-text"> about IP anonymization.</span>',"google-site-kit")}}))))}},{key:"accountsDropdown",value:function(){var e=this.state,t=e.accounts,a=e.selectedAccount,n=e.existingTag,i=!this.props.isEditing;return n&&a&&(i=!0),React.createElement(D.k,{className:"googlesitekit-analytics__select-account",enhanced:!0,name:"accounts",value:a||"0",onEnhancedChange:this.handleAccountChange,label:Object(L.__)("Account","google-site-kit"),disabled:i,outlined:!0},t.concat(n?[]:[{id:"-1",name:Object(L.__)("Set up a new account","google-site-kit")}]).map((function(e,t){return React.createElement(D.j,{key:t,value:e.id},e.name)})))}},{key:"renderForm",value:function(){var e=this.state,a=e.anonymizeIP,n=e.isLoading,i=e.propertiesLoading,o=e.profilesLoading,c=e.accounts,s=e.properties,r=e.profiles,l=e.selectedAccount,d=e.selectedProperty,u=e.selectedProfile,g=e.useSnippet,m=e.existingTag,p=e.errorCode,h=e.trackingDisabled,_=this.props,b=_.onSettingsPage,f=_.isEditing,k=parseInt(l)||0,y=!m&&k>0,O=!!/^UA-/.test(d.toString()),E=window.googlesitekit.admin.ampMode,R=googlesitekit.modules.analytics.setupComplete;if(n)return React.createElement(S.a,null);if("google_analytics_existing_tag_permission"===p)return null;if(!c.length||"-1"===l){if(!f)return Object(L.__)("No account found.","google-site-kit");if(!R||f)return React.createElement(v.Fragment,null,"-1"===l&&React.createElement(v.Fragment,null,React.createElement("p",null,Object(L.__)("To create a new account, click the button below which will open the Google Analytics account creation screen in a new window.","google-site-kit")),React.createElement("p",null,Object(L.__)("Once completed, click the link below to re-fetch your accounts to continue.","google-site-kit"))),React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(j.a,{onClick:t.createNewAccount},Object(L.__)("Create an account","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(w.a,{onClick:this.handleRefetchAccount},Object(L.__)("Re-fetch My Account","google-site-kit")))))}if(!f){var C=g?Object(L.__)("Snippet is inserted","google-site-kit"):Object(L.__)("Snippet is not inserted","google-site-kit");return m&&(C=Object(L.__)("Inserted by another plugin or theme","google-site-kit")),React.createElement(v.Fragment,null,React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Account","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},l||c[0].name||!1)),React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Property","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},d||s[0].name||!1)),React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("View","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},u||r[0].name||!1))),React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item "},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Analytics Code Snippet","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},C))),b&&g&&"primary"!==E&&React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item "},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("IP Address Anonymization","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},a&&Object(L.__)("IP addresses are being anonymized.","google-site-kit"),!a&&Object(L.__)("IP addresses are not being anonymized.","google-site-kit")))),React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item "},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Excluded from Analytics","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},!!h.length&&h.map((function(e){return F[e]})).join(Object(L._x)(", ","list separator","google-site-kit")),!h.length&&Object(L.__)("Analytics is currently enabled for all visitors.","google-site-kit")))))}return React.createElement(v.Fragment,null,!b&&0<c.length&&!m&&React.createElement("p",null,Object(L.__)("Please select the account information below. You can change this view later in your settings.","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__inputs"},this.accountsDropdown(),i?React.createElement(S.a,{small:!0}):React.createElement(D.k,{className:"googlesitekit-analytics__select-property",enhanced:!0,name:"properties",value:d||0===d?d.toString():"-1",onEnhancedChange:this.handlePropertyChange,label:Object(L.__)("Property","google-site-kit"),disabled:!y,outlined:!0},s.map((function(e,t){return React.createElement(D.j,{key:t,value:e.id},e.name)}))),o?React.createElement(S.a,{small:!0}):React.createElement(D.k,{className:"googlesitekit-analytics__select-profile",enhanced:!0,name:"profiles",value:u||0===u?u.toString():"-1",onEnhancedChange:this.handleProfileChange,label:Object(L.__)("View","google-site-kit"),disabled:!O,outlined:!0},r.map((function(e,t){return React.createElement(D.j,{key:t,value:e.id},e.name)})))),this.renderAutoInsertSnippetForm(),b&&this.renderExclusionsForm(),!b&&React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(j.a,{disabled:!this.state.selectedAccount,onClick:this.handleSubmit},Object(L.__)("Configure Analytics","google-site-kit"))))}},{key:"renderExclusionsForm",value:function(){var e=this.state.trackingDisabled;return React.createElement("div",null,React.createElement("p",{className:"googlesitekit-setup-module__text"},Object(L.__)("Exclude from Analytics","google-site-kit")),React.createElement("div",{className:"mdc-form-field"},React.createElement(N.a,{id:"loggedinUsers",label:F.loggedinUsers,onClick:this.handleExclusionsChange,checked:e.includes("loggedinUsers"),hideLabel:!1})),React.createElement("p",null,e.includes("loggedinUsers")?Object(L.__)("Logged-in users will be excluded from Analytics tracking.","google-site-kit"):Object(L.__)("Logged-in users will be included in Analytics tracking.","google-site-kit")))}},{key:"renderErrorOrNotice",value:function(){var e=this.state,t=e.errorCode,a=e.errorMsg,n=e.errorReason,i=e.accounts,o=this.props.onSettingsPage;if(!t)return null;var c=!0,s=a;switch(!0){case"google_analytics_existing_tag_permission"===t:c=!0;break;case o&&t&&"insufficientPermissions"===n:c=!1,s=Object(L.__)("You currently don't have access to this Google Analytics account. You can either request access from your team, or remove this Google Analytics snippet and connect to a different account.","google-site-kit");break;case!o&&0===i.length:c=!1,s=Object(L.__)('Looks like you don\'t have an Analytics account yet. Once you create it, click on "Re-fetch my account" and Site Kit will locate it.',"google-site-kit")}return s&&0!==s.length?React.createElement("div",{className:c?"googlesitekit-error-text":""},React.createElement("p",null,c?
11
/* translators: %s: Error message */
12
+ Object(L.sprintf)(Object(L.__)("Error: %s","google-site-kit"),s):s)):null}},{key:"render",value:function(){var e=this.props.onSettingsPage,t=this.state.existingTag;return e||Object(P.v)("analytics_setup","configure_analytics_screen"),React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--analytics"},!e&&React.createElement(v.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(A.a,{id:"analytics",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(L._x)("Analytics","Service name","google-site-kit"))),!!t&&React.createElement("p",null,Object(L.sprintf)(Object(L.__)("An existing analytics tag was found on your site with the id %s. If later on you decide to replace this tag, Site Kit can place the new tag for you. Make sure you remove the old tag first.","google-site-kit"),t)),this.renderErrorOrNotice(),this.renderForm())}}],[{key:"createNewAccount",value:function(e){e.preventDefault(),Object(P.v)("analytics_setup","new_analytics_account"),window.open("https://analytics.google.com/analytics/web/?#/provision/SignUp","_blank")}}]),t}(v.Component);U.propTypes={onSettingsPage:R.a.bool,finishSetup:R.a.func,isEditing:R.a.bool},U.defaultProps={onSettingsPage:!0,isEditing:!1};t.default=U},,,,,,function(e,t,a){"use strict";a.r(t);var n=a(72),i=a.n(n),o=a(23),c=a.n(o),s=a(11),r=a.n(s),l=a(3),d=a.n(l),u=a(4),g=a.n(u),m=a(5),p=a.n(m),h=a(6),_=a.n(h),b=a(7),f=a.n(b),k=a(1),y=a(8),v=a.n(y),O=a(20),E=a(0),R=a(109),j=a(79),S=a(2),w=a(42);function D(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function C(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?D(a,!0).forEach((function(t){c()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):D(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var x=function(e){function t(e){var a;return d()(this,t),(a=p()(this,_()(t).call(this,e))).state={accountStatus:void 0,loadingMessage:Object(E.__)("Loading…","google-site-kit"),instructionProps:{}},a}return f()(t,e),g()(t,[{key:"componentDidMount",value:function(){return r.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.a.awrap(this.updateAccountStatus());case 2:case"end":return e.stop()}}),null,this)}},{key:"componentDidUpdate",value:function(e,t){var a=this.state.accountStatus;if(t.accountStatus!==a){var n=Object(w.propsFromAccountStatus)(a);this.setState({instructionProps:n})}}},{key:"continueSetup",value:function(e){var t=this.state.instructionProps;e.existingState=C({},t),this.setState({instructionProps:e})}},{key:"goBack",value:function(){var e=C({},this.state.instructionProps).existingState;e&&(e.existingState=!1,this.setState({instructionProps:e}))}},{key:"updateAccountStatus",value:function(){var e,t,a,n,i,o=this;return r.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,r.a.awrap(Object(S.j)("adsense"));case 2:return e=c.sent,t=function(e){o.setState({loadingMessage:e})},c.next=6,r.a.awrap(Object(w.getAdSenseAccountStatus)(e,t));case 6:a=c.sent,n=a.accountStatus,i=a.clientID,this.setState({accountStatus:n,clientID:i});case 10:case"end":return c.stop()}}),null,this)}},{key:"render",value:function(){var e=this.state,t=e.accountStatus,a=e.clientID,n=e.loadingMessage,o=e.instructionProps,c=!t||!googlesitekit.modules.adsense.setupComplete||["ads-display-pending","account-pending-review","account-required-action"].includes(t);return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},React.createElement("div",{className:"googlesitekit-setup-module__step"},React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(O.a,{id:"adsense",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(E._x)("AdSense","Service name","google-site-kit"))),React.createElement("div",{className:"googlesitekit-setup-module__step"},!googlesitekit.canAdsRun&&!googlesitekit.modules.adsense.setupComplete&&React.createElement("div",{className:"googlesitekit-settings-module-warning"},React.createElement(O.a,{id:"error",height:"20",width:"23"}),Object(E.__)("Ad blocker detected, you need to disable it in order to setup AdSense.","google-site-kit")),c&&"account-connected"!==t&&React.createElement(j.default,{ctaLink:o.ctaLink,ctaLinkText:o.ctaLinkText,header:o.statusHeadline,subHeader:o.statusMessage,incomplete:o.incomplete,required:o.required,loadingMessage:!t&&n}),googlesitekit.canAdsRun&&t&&(googlesitekit.modules.adsense.setupComplete||"account-connected"===t)&&React.createElement(R.default,i()({},o,{accountStatus:t,clientID:a,continueSetup:this.continueSetup,goBack:this.goBack}))))}}]),t}(k.Component);x.propTypes={status:v.a.string,module:v.a.string},t.default=x},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(20),h=a(14),_=a(28),b=a(80),f=a(9),k=a(64),y=a(18),v=a(2),O=a(0),E=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={isSaving:!1},a}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this,t=this.props,a=t.error,n=t.message,i=t.issue,o=t.notice,c=t.statusHeadline,s=t.statusMessage,r=t.profile,l=t.ctaLinkText,d=t.ctaLink,u=t.footerText,g=t.footerAppendedText,m=t.footerCTA,E=t.footerCTALink,R=t.continueAction,j=t.continueSetup,S=t.accountStatus,w=t.accountTagMatch,D=t.clientID,C=t.existingTag,x=t.switchLabel,N=t.tracking,A=t.switchOffMessage,P=t.switchOnMessage,L=t.goBack,I=t.existingState,M=this.state.isSaving,T=googlesitekit.admin.userData,F=T.email,U=void 0===F?"":F,z=T.picture,q=void 0===z?"":z;return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},React.createElement("div",{className:"googlesitekit-setup-module__step"},i&&React.createElement("p",{className:"googlesitekit-setup__notice"},React.createElement(p.a,{id:"error",height:"20",width:"23"}),React.createElement("span",{className:"googlesitekit-setup__notice-text"},i)),React.createElement("h2",{className:" googlesitekit-heading-4 googlesitekit-setup-module__title "},c),React.createElement("p",null,s),r&&React.createElement("p",{className:"googlesitekit-setup-module__user"},q&&React.createElement("img",{className:"googlesitekit-setup-module__user-image",src:q,alt:Object(O.__)("User Avatar","google-site-kit")}),React.createElement("span",{className:"googlesitekit-setup-module__user-email"},U)),"account-connected"===S&&React.createElement(b.default,{isEditing:!0,accountTagMatch:w,existingTag:C,saveOnChange:!0,switchLabel:x,switchOffMessage:A,switchOnMessage:P}),o&&React.createElement("div",{className:"googlesitekit-settings-notice"},React.createElement("div",{className:"googlesitekit-settings-notice__text"},o)),a&&0<n.length&&React.createElement("div",{className:"googlesitekit-error-text"},React.createElement("p",null,Object(O.__)("Error:","google-site-kit")," ",n)),React.createElement("div",{className:"googlesitekit-setup-module__action"},"account-connected"===S&&React.createElement(y.Fragment,null,React.createElement(_.a,{disabled:M,onClick:function(){N&&Object(v.v)(N.eventCategory,N.eventName),e.setState({isSaving:!0});var t=document.getElementById("enableAutoAds"),a=t&&t.checked;f.c.set(f.b,"adsense","setup-complete",{clientID:D,useSnippet:a}).then((function(){document.location=d})).catch((function(){e.setState({isSaving:!1})}))}},l),React.createElement(k.a,{isSaving:M})),"account-connected"!==S&&React.createElement(h.a,{className:"googlesitekit-setup-module__cta-link",external:!0,inherit:!0,href:d},l),R&&React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(h.a,{inherit:!0,onClick:function(){j(R)}},R.continueText)),I&&React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(h.a,{inherit:!0,onClick:function(){L()}},Object(O.__)("Back","google-site-kit")))),u&&React.createElement("p",{className:"googlesitekit-setup-module__footer-text"},u," ",m&&React.createElement(h.a,{href:E,inherit:!0,external:!0},m)," ",g)))}}]),t}(m.Component);t.default=E},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(21),p=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(p.Component);t.default=Object(m.a)("googlesitekit.AnalyticsAdSenseTopPagesTableSmall")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(21),p=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(p.Component);t.default=Object(m.a)("googlesitekit.AnalyticsAdSenseTopPagesTable")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(41),h=a(110),_=a(113),b=a(57),f=a(0),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(p.a,{title:Object(f.__)("Earnings","google-site-kit"),description:Object(f.__)("How much you’re earning from your content through AdSense.","google-site-kit"),timePeriod:Object(f.__)("Last 28 days","google-site-kit")}),React.createElement(b.a,{slug:"adsense",context:"module-sitekit-dashboard"})),React.createElement(_.default,null),React.createElement(h.default,null))}}]),t}(m.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(19),h=a(9),_=a(24),b=a(2),f=a(27),k=a(52),y=a(0),v=a(42),O=a(17),E=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={today:!1,period:!1,daily:!1},a}return g()(t,e),c()(t,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var e=this.state,t=e.today,a=e.period,n=e.daily;if(!(t&&a&&n&&a.totals))return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(O.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},React.createElement(_.a,{width:"100%",height:"276px",padding:!0})));var i=Object(v.reduceAdSenseData)(n.rows),o=Object(b.m)("googlesitekit-module-adsense",{}),c=a.headers.find((function(e){return null!==e.currency&&0<e.currency.length})),s=!!c&&c.currency;return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(O.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{className:"overview-adsense-rpm",title:Object(y.__)("RPM","google-site-kit"),datapoint:Object(b.t)(a.totals[1],s),source:{name:Object(y._x)("AdSense","Service name","google-site-kit"),link:o},sparkline:n&&React.createElement(k.a,{data:Object(b.e)(i.dataMap,2),change:1,id:"adsense-rpm-sparkline",loadSmall:!1}),context:"compact"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{className:"overview-adsense-earnings",title:Object(y.__)("Total Earnings","google-site-kit"),datapoint:Object(b.t)(a.totals[0],s),source:{name:Object(y._x)("AdSense","Service name","google-site-kit"),link:o},change:t.totals[0],changeDataUnit:"quot;,sparkline:n&&React.createElement(k.a,{data:Object(b.e)(i.dataMap,1),change:1,id:"adsense-earnings-sparkline",loadSmall:!1}),context:"compact"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{className:"overview-adsense-impressions",title:Object(y.__)("Ad Impressions","google-site-kit"),datapoint:Object(b.t)(a.totals[2]),source:{name:Object(y._x)("AdSense","Service name","google-site-kit"),link:o},sparkline:n&&React.createElement(k.a,{data:Object(b.e)(i.dataMap,3),change:1,id:"adsense-impressions-sparkline",loadSmall:!1}),context:"compact"})))))))}}]),t}(m.Component);t.default=Object(p.a)(E,[{type:h.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"today"},priority:1,maxAge:Object(b.o)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.today)return{today:a}}},{type:h.b,identifier:"adsense",datapoint:"earnings",data:{},priority:1,maxAge:Object(b.o)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.period)return{period:a}}},{type:h.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month",dimensions:["DATE"]},priority:1,maxAge:Object(b.o)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.daily)return{daily:a}}}],React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(O.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},React.createElement(_.a,{width:"100%",height:"276px",padding:!0}))),{inGrid:!0,createGrid:!0},v.isDataZeroAdSense)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(27),h=a(24),_=a(2),b=a(19),f=a(9),k=a(42),y=a(0),v=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={refetch:!1,today:!1,yesterday:!1,sevenDays:!1,month:!1,twentyEightDays:!1,sameDayLastWeek:!1,prev7Days:!1,monthLastYear:!1,prev28Days:!1,error:!1,message:""},a}return g()(t,e),c()(t,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var e=this.state,a=e.today,n=e.yesterday,i=e.sevenDays,o=e.month,c=e.twentyEightDays,s=e.sameDayLastWeek,r=e.prev7Days,l=e.monthLastYear,d=e.prev28Days;if(!(a&&n&&i&&o&&c&&s&&r&&l&&d))return null;var u=a.headers.find((function(e){return null!==e.currency&&0<e.currency.length})),g=!!u&&u.currency,m=a.totals?[{className:"googlesitekit-data-block--today",title:Object(y.__)("Today so far","google-site-kit"),datapoint:Object(_.t)(a.totals[0],g)},{className:"googlesitekit-data-block--yesterday",title:Object(y.__)("Yesterday","google-site-kit"),datapoint:Object(_.t)(n.totals[0],g),change:s.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--7days",title:Object(y.__)("Last 7 days","google-site-kit"),datapoint:Object(_.t)(i.totals[0],g),change:r.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--month",title:Object(y.__)("This month","google-site-kit"),datapoint:Object(_.t)(o.totals[0],g),change:l.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--28days",title:Object(y.__)("Last 28 days","google-site-kit"),datapoint:Object(_.t)(c.totals[0],g),change:d.totals[0],changeDataUnit:"%"}]:[];return t.renderLayout(m)}}],[{key:"renderLayout",value:function(e){return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},e.map((function(e,t){return React.createElement("div",{key:t,className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-top mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},React.createElement(p.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection}))}))))}},{key:"renderPreviews",value:function(){for(var e=[],t=0;5>t;t++)e.push(React.createElement("div",{key:t,className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-top mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},React.createElement(h.a,{width:"100%",height:"104px"})));return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},e))}}]),t}(m.Component);t.default=Object(b.a)(v,[{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"today"},priority:1,maxAge:Object(_.o)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.today)return{today:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"yesterday"},priority:1,maxAge:Object(_.o)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.yesterday)return{yesterday:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"same-day-last-week"},priority:1,maxAge:Object(_.o)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.sameDayLastWeek)return{sameDayLastWeek:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-7-days"},priority:1,maxAge:Object(_.o)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.sevenDays)return{sevenDays:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-7-days"},priority:1,maxAge:Object(_.o)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev7Days)return{prev7Days:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month"},priority:1,maxAge:Object(_.o)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.month)return{month:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month-last-year"},priority:1,maxAge:Object(_.o)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.monthLastYear)return{monthLastYear:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-28-days"},priority:1,maxAge:Object(_.o)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.twentyEightDays)return{twentyEightDays:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-28-days"},priority:1,maxAge:Object(_.o)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev28Days)return{prev28Days:a}}}],v.renderPreviews(),{createGrid:!0},k.isDataZeroAdSense)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(9),h=a(27),_=a(24),b=a(2),f=a(42),k=a(19),y=a(0),v=a(12),O=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={twentyEightDays:!1,prev28Days:!1},a}return g()(t,e),c()(t,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var e=this.state,t=e.twentyEightDays,a=e.prev28Days,n=t.totals?[{className:"googlesitekit-data-block--page-rpm",title:Object(y.__)("Page RPM","google-site-kit"),datapoint:Object(b.t)(t.totals[1]),change:Object(v.isUndefined)(a.totals)?0:a.totals[1],changeDataUnit:"%"},{className:"googlesitekit-data-block--impression",title:Object(y.__)("Impressions","google-site-kit"),datapoint:Object(b.t)(t.totals[2]),change:Object(v.isUndefined)(a.totals)?0:a.totals[2],changeDataUnit:"%"}]:[];return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},n.map((function(e,t){return React.createElement("div",{key:t,className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-top mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},React.createElement(h.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection}))}))))}}]),t}(m.Component);t.default=Object(k.a)(O,[{type:p.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-28-days"},priority:1,maxAge:Object(b.o)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.twentyEightDays)return{twentyEightDays:a}}},{type:p.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-28-days"},priority:1,maxAge:Object(b.o)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev28Days)return{prev28Days:a}}}],React.createElement(_.a,{width:"100%",height:"250px"}),{},f.isDataZeroAdSense)},function(e,t,a){"use strict";a.r(t);var n=a(11),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(13),p=a.n(m),h=a(7),_=a.n(h),b=a(1),f=a(44),k=a(47),y=a(17),v=a(0),O=a(114),E=a(115),R=a(78),j=a(111),S=a(58),w=a(45),D=a(31),C=a(81),x=a(42),N=a(57),A=a(79),P=a(43),L=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={receivingData:!0,error:!1,loading:!0,isAdSenseConnected:!0,zeroData:!1,instructionProps:{}},a.handleDataError=a.handleDataError.bind(p()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(p()(a)),a.handleZeroData=a.handleZeroData.bind(p()(a)),a}return _()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.isAdSenseConnected()}},{key:"isAdSenseConnected",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(Object(x.isAdsenseConnectedAnalytics)());case 2:e.sent?this.setState({isAdSenseConnected:!0}):this.setState({isAdSenseConnected:!1});case 4:case"end":return e.stop()}}),null,this)}},{key:"handleDataError",value:function(e){this.setState({receivingData:!1,error:e,loading:!1})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0,loading:!1})}},{key:"handleZeroData",value:function(){var e=Object(x.propsFromAccountStatus)("account-connected-no-data");this.setState({zeroData:!0,loading:!1,instructionProps:e})}},{key:"render",value:function(){var e=this,t=this.state,a=t.receivingData,n=t.error,i=t.loading,o=t.isAdSenseConnected,c=t.zeroData,s=t.instructionProps,r=googlesitekit.modules.adsense.homepage,l=i||!a||c?"googlesitekit-nodata":"";return React.createElement(b.Fragment,null,React.createElement(f.a,null),React.createElement("div",{className:"".concat(l)},React.createElement(R.a,{module:"adsense"})),React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--adsense"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},!n&&googlesitekit.modules.adsense.setupComplete?React.createElement(k.a,{title:Object(v._x)("AdSense","Service name","google-site-kit"),icon:!0,iconWidth:"30",iconHeight:"26",iconID:"adsense",status:"connected",statusText:Object(v.__)("AdSense is connected","google-site-kit")}):React.createElement(k.a,{title:Object(v._x)("AdSense","Service name","google-site-kit"),icon:!0,iconWidth:"30",iconHeight:"26",iconID:"adsense",status:"not-connected",statusText:Object(v.__)("AdSense is not connected","google-site-kit")}),i&&React.createElement(D.a,null)),c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(y.a,{fill:!0},React.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(A.default,{ctaLink:s.ctaLink,ctaLinkText:s.ctaLinkText,header:s.statusHeadline,subHeader:s.statusMessage,incomplete:s.incomplete,required:s.required})))))),!a&&(n?Object(w.a)(Object(v._x)("AdSense","Service name","google-site-kit"),n,!0,!0,!0):Object(S.a)(Object(v._x)("AdSense","Service name","google-site-kit"),!0,!0,!0)),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(l,"\n\t\t\t\t\t\t\t")},React.createElement(N.a,{slug:"adsense",context:"module-dashboard"}),React.createElement(y.a,{header:!0,title:Object(v.__)("Estimated earnings","google-site-kit"),headerCtaLabel:Object(v.__)("Advanced Settings","google-site-kit"),headerCtaLink:r},React.createElement(O.default,{handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(l,"\n\t\t\t\t\t\t\t")},React.createElement(y.a,{header:!0,title:Object(v.__)("Performance over previous 28 days","google-site-kit"),headerCtaLabel:Object(v.__)("Advanced Settings","google-site-kit"),headerCtaLink:r},React.createElement(E.default,{handleDataError:function(t){t||e.handleZeroData()}}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(l,"\n\t\t\t\t\t\t\t")},React.createElement(j.default,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(P.a,null))))),!o&&React.createElement(C.default,null))}}]),t}(b.Component);t.default=L},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(2),h=a(14),_=a(0),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.slug,a=e.screenID,n=e.OriginalComponent,i=googlesitekit.modules.adsense.settings.accountStatus;return i&&"adsense"===t&&("account-pending-review"===i||"ads-display-pending"===i)?React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},Object(_.__)("Site Kit has placed the code on your site, ","google-site-kit"),React.createElement(h.a,{className:"googlesitekit-settings-module__edit-button",onClick:function(){var e=a||"googlesitekit-dashboard";window.location=Object(p.m)(e,{reAuth:!0,slug:t})},inherit:!0},Object(_.__)("check module page","google-site-kit"))):React.createElement(n,this.props)}}]),t}(m.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(20),h=a(0),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.slug,a=e.context,n=e.OriginalComponent;if("adsense"!==t)return React.createElement(n,this.props);var i=googlesitekit.modules.adsense,o=i.active,c=i.setupComplete,s=Object(h.__)("Ad blocker detected, you need to disable it in order to setup AdSense.","google-site-kit");return o&&c&&(s=Object(h.__)("Ad blocker detected, You need to disable it to get the AdSense latest data.","google-site-kit")),googlesitekit.canAdsRun?React.createElement(n,this.props):React.createElement("div",{className:"googlesitekit-settings-module-warning googlesitekit-settings-module-warning--".concat(a)},React.createElement(p.a,{id:"error",height:"20",width:"23"})," ",s)}}]),t}(m.Component);t.default=_},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(28),b=a(0),f=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).renderAccountSetup=a.renderAccountSetup.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"renderAccountSetup",value:function(){if("no-account"===this.props.accountStatus)return React.createElement(_.a,{onClick:t.createNewAccount},Object(b.__)("Sign up for AdSense","google-site-kit"))}},{key:"render",value:function(){return React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},this.renderAccountSetup()))}}],[{key:"createNewAccount",value:function(e){e.preventDefault();var t=googlesitekit.modules.adsense.signupURL;window.open(t,"_blank")}}]),t}(h.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(23),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(27),b=a(19),f=a(9),k=a(2),y=a(15),v=a(24),O=a(0);function E(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var R=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||e.error||!e.length)return null;var t=Object(y.calculateOverviewData)(e);if(!t)return null;var a=t.totalUsers,n=t.totalSessions,i=t.totalUsersChange,o=t.totalSessionsChange;return React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(_.a,{className:"overview-total-users",title:Object(O.__)("Total Users","google-site-kit"),datapoint:Object(k.t)(a),change:i,changeDataUnit:"%"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(_.a,{className:"overview-total-sessions",title:Object(O.__)("Total Sessions","google-site-kit"),datapoint:Object(k.t)(n),change:o,changeDataUnit:"%"})))}}]),t}(h.Component);t.default=Object(b.a)(R,[{type:f.b,identifier:"analytics",datapoint:"report",data:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?E(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):E(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},y.overviewReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(k.o)("day"),context:"Adminbar"}],React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(v.a,{width:"auto",height:"59px"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(v.a,{width:"auto",height:"59px"}))),{inGrid:!0},y.isDataZeroForReporting,y.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(51),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(120),b=a(65),f=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){return"undefined"!==i()(googlesitekit.permaLink)&&""===googlesitekit.permaLink?null:googlesitekit.modules.analytics.active?React.createElement(_.default,null):React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(b.a,null)))}}]),t}(h.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(41),h=a(17),_=a(0),b=a(82),f=a(69),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(p.a,{title:Object(_.__)("All Traffic","google-site-kit"),description:Object(_.__)("How people found your page.","google-site-kit")})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{className:"googlesitekit-analytics-acquisition-sources",footer:!0,headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(_.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(_._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(f.default,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(b.default,null)))))))}}]),t}(m.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(19),h=a(9),_=a(2),b=a(29),f=a(101),k=a(39),y=a(12),v=a(0),O=a(15),E=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=[{title:Object(v.__)("Source","google-site-kit"),primary:!0},{title:Object(v.__)("Percent","google-site-kit")}],a=e[0].data.totals[0].values[0],n=Object(y.map)(e[0].data.rows,(function(e,t){var n=e.metrics[0].values[0]/a*100;return!(1>n)&&[e.dimensions[0],React.createElement(m.Fragment,{key:"minichart-"+t},React.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(n.toFixed(2),"%")," ",React.createElement(f.a,{percent:n.toFixed(1),index:t})))]})),i=Object(b.b)(n,t,{hideHeader:!0,chartsEnabled:!0});return React.createElement("div",{className:"googlesitekit-alltraffic-widget"},React.createElement(b.a,null,i))}}]),t}(m.Component);t.default=Object(p.a)(E,[{type:h.b,identifier:"analytics",datapoint:"report",data:O.trafficSourcesReportDataDefaults,priority:1,maxAge:Object(_.o)("day"),context:"Dashboard"}],React.createElement(k.a,{rows:3,rowHeight:50}))},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(69),b=a(123),f=a(0),k=a(17),y=a(41),v=a(58),O=a(45),E=a(96),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={receivingData:!0,error:!1},a.handleDataError=a.handleDataError.bind(g()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"handleDataError",value:function(e){this.setState({receivingData:!1,error:e})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0})}},{key:"getErrorDataComponent",value:function(){var e=googlesitekit.modules.analytics,t=e.active,a=e.setupComplete,n=this.state,i=n.error,o=n.receivingData;return t&&!a?Object(E.a)("analytics",!0,!0,!0):o?null:i?Object(O.a)(Object(f._x)("Analytics","Service name","google-site-kit"),i,!0,!0,!0):Object(v.a)(Object(f._x)("Analytics","Service name","google-site-kit"),!0,!0,!0)}},{key:"render",value:function(){var e=this.state,t=e.error,a=e.receivingData,n=t||!a?"googlesitekit-nodata":"";return React.createElement(h.Fragment,null,React.createElement("div",{className:"\n\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t"},React.createElement(y.a,{timePeriod:Object(f.__)("Last 28 days","google-site-kit"),description:Object(f.__)("How people found your site.","google-site-kit"),title:Object(f.__)("All Traffic","google-site-kit")})),this.getErrorDataComponent(),React.createElement("div",{className:"\n\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t".concat(n,"\n\t\t\t\t")},React.createElement(k.a,{className:"googlesitekit-dashboard-all-traffic"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(_.default,{source:!0,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(b.default,null)))))))}}]),t}(h.Component);t.default=R},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(19),h=a(9),_=a(2),b=a(29),f=a(17),k=a(39),y=a(12),v=a(0),O=a(15),E=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var a=[{title:Object(v.__)("Page Title","google-site-kit"),tooltip:Object(v.__)("Page Title","google-site-kit"),primary:!0},{title:Object(v.__)("Earnings","google-site-kit"),tooltip:Object(v.__)("Earnings","google-site-kit")},{title:Object(v.__)("Page RPM","google-site-kit"),tooltip:Object(v.__)("Page RPM","google-site-kit")},{title:Object(v.__)("Impressions","google-site-kit"),tooltip:Object(v.__)("Impressions","google-site-kit")}],n=Object(y.map)(e[0].data.rows,(function(e){return[e.dimensions[0],Number(e.metrics[0].values[0]).toFixed(2),Number(e.metrics[0].values[1]).toFixed(2),Object(_.r)(e.metrics[0].values[2])]})),i=googlesitekit.modules.analytics.settings,o=i.accountID,c=i.internalWebPropertyID,s=i.profileID,r="https://analytics.google.com/analytics/web/?pli=1#/report/content-pages/a".concat(o,"w").concat(c,"p").concat(s,"/explorer-table.plotKeys=%5B%5D&_r.drilldown=analytics.pagePath:~2F"),l={hideHeader:!1,chartsEnabled:!1,links:Object(y.map)(e[0].data.rows,(function(e){var t=e.dimensions[1].replace(/\//g,"~2F");return r+t}))},d=Object(b.b)(n,a,l);return t.renderLayout(React.createElement(b.a,null,d))}}],[{key:"renderLayout",value:function(e){var t=googlesitekit.modules.adsense.accountURL;return React.createElement(f.a,{header:!0,title:Object(v.__)("Performance over previous 28 days","google-site-kit"),headerCtaLabel:Object(v.__)("Advanced Settings","google-site-kit"),headerCtaLink:t},e)}}]),t}(m.Component);t.default=Object(p.a)(E,[{type:h.b,identifier:"analytics",datapoint:"report",data:O.analyticsAdsenseReportDataDefaults,priority:1,maxAge:Object(_.o)("day"),context:"Single"}],E.renderLayout(React.createElement(k.a,{padding:!0})),{inGrid:!0,fullWidth:!0,createGrid:!0},(function(){return!1}),(function(e){return!(!e||!e.error)&&(400===e.error.code&&"INVALID_ARGUMENT"===e.error.status&&googlesitekit.modules.analytics.active?null:e.error.message?e.error.message:e.error.errors&&e.error.errors[0]&&e.error.errors[0].message?e.error.errors[0].message:Object(v.__)("Unidentified error","google-site-kit"))}))},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(27),h=a(19),_=a(9),b=a(2),f=a(15),k=a(24),y=a(8),v=a.n(y),O=a(0),E=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,n=e.handleStatSelection;if(!t||!t.length)return null;var i=Object(f.calculateOverviewData)(t);if(!i)return null;var o=i.totalUsers,c=i.totalSessions,s=i.averageBounceRate,r=i.averageSessionDuration,l=i.totalUsersChange,d=i.totalSessionsChange,u=i.averageBounceRateChange,g=i.averageSessionDurationChange,m=[{className:"googlesitekit-data-block--users googlesitekit-data-block--button-1",title:Object(O.__)("Users","google-site-kit"),datapoint:Object(b.t)(o),change:l,changeDataUnit:"%",context:"button",selected:a.includes(0),handleStatSelection:n},{className:"googlesitekit-data-block--sessions googlesitekit-data-block--button-2",title:Object(O.__)("Sessions","google-site-kit"),datapoint:Object(b.t)(c),change:d,changeDataUnit:"%",context:"button",selected:a.includes(1),handleStatSelection:n},{className:"googlesitekit-data-block--bounce googlesitekit-data-block--button-3",title:Object(O.__)("Bounce Rate","google-site-kit"),datapoint:Number(s).toFixed(2),change:u,changeDataUnit:"%",context:"button",selected:a.includes(2),handleStatSelection:n,datapointUnit:"%",reverseArrowDirection:!0},{className:"googlesitekit-data-block--duration googlesitekit-data-block--button-4",title:Object(O.__)("Session Duration","google-site-kit"),datapoint:Object(b.s)(r),change:g,changeDataUnit:"%",context:"button",selected:a.includes(3),handleStatSelection:n}];return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner",role:"toolbar","aria-label":"Line Chart Options"},m.map((function(e,t){return React.createElement("div",{key:t,className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(p.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection,datapointUnit:e.datapointUnit,reverseArrowDirection:e.reverseArrowDirection}))}))))}}]),t}(m.Component);E.propTypes={handleDataError:v.a.func.isRequired},t.default=Object(h.a)(E,[{type:_.b,identifier:"analytics",datapoint:"report",data:f.overviewReportDataDefaults,priority:1,maxAge:Object(b.o)("day"),context:["Single","Dashboard"]}],React.createElement(k.a,{width:"100%",height:"190px",padding:!0}),{createGrid:!0},f.isDataZeroForReporting,f.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(63),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(19),b=a(9),f=a(2),k=a(29),y=a(39),v=a(17),O=a(12),E=a(0),R=a(15),j=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data,a=googlesitekit.admin.siteURL;if(!e||!e.length)return null;var n=[{title:Object(E.__)("Most popular content","google-site-kit"),primary:!0},{title:Object(E.__)("Views","google-site-kit")}],o=[],c=Object(O.map)(e[0].data.rows,(function(e,t){var n=i()(e.dimensions,2),c=n[0],s=n[1];return o[t]=a+s,[c,Object(f.r)(e.metrics[0].values[0])]})),s={hideHeader:!1,chartsEnabled:!1,links:o,showURLs:!0},r=Object(k.b)(c,n,s);return t.renderLayout(React.createElement(k.a,null,r))}}],[{key:"renderLayout",value:function(e){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(v.a,{className:"googlesitekit-popular-content",footer:!0,footerCtaLabel:Object(E._x)("Analytics","Service name","google-site-kit"),footerCtaLink:googlesitekit.modules.analytics.homepage,fill:!0},e))}}]),t}(h.Component);t.default=Object(_.a)(j,[{type:b.b,identifier:"analytics",datapoint:"report",data:Object(R.getTopPagesReportDataDefaults)(),priority:1,maxAge:Object(f.o)("day"),context:["Single","Dashboard"]}],j.renderLayout(React.createElement(y.a,{padding:!0})),{inGrid:!0,createGrid:!0},R.isDataZeroForReporting)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(59),b=a(2),f=a(19),k=a(9),y=a(15),v=a(24),O=a(0),E=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).setOptions=a.setOptions.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"setOptions",value:function(){var e=this.props,t=e.series,a=e.vAxes,n={chart:{title:""===googlesitekit.pageTitle?"":Object(O.__)("Users Traffic Summary","google-site-kit")},curveType:"line",height:270,width:"100%",chartArea:{height:"80%",width:"87%"},legend:{position:"top",textStyle:{color:"#616161",fontSize:12}},hAxis:{format:"M/d/yy",gridlines:{color:"#fff"},textStyle:{color:"#616161",fontSize:12}},vAxis:{gridlines:{color:"#eee"},minorGridlines:{color:"#eee"},textStyle:{color:"#616161",fontSize:12},titleTextStyle:{color:"#616161",fontSize:12,italic:!1}}};return n.series=t,n.vAxes=a,n}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,n=e.dateRangeFrom;if(!t||!t.length)return null;var i=n?n.match(/\d+/).map(Number)[0]:28,o=Object(y.extractAnalyticsDashboardData)(t,a,i);if(!o)return null;var c=this.setOptions();return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(_.a,{selectedStats:a,data:o,options:c}))))}}]),t}(h.Component);t.default=Object(f.a)(E,[{type:k.b,identifier:"analytics",datapoint:"report",data:y.siteAnalyticsReportDataDefaults,priority:1,maxAge:Object(b.o)("day"),context:"Single"}],React.createElement(v.a,{width:"100%",height:"270px",padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(12),h=a(19),_=a(9),b=a(2),f=a(29),k=a(39),y=a(17),v=a(34),O=a(0),E=a(15),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var a=[{title:Object(O.__)("Top Earning Pages","google-site-kit"),tooltip:Object(O.__)("Top Earning Pages","google-site-kit"),primary:!0},{title:Object(O.__)("Revenue","google-site-kit"),tooltip:Object(O.__)("Revenue","google-site-kit")}],n=[],i=Object(p.map)(e[0].data.rows,(function(e,t){return n[t]=e.dimensions[1],[e.dimensions[0],Number(e.metrics[0].values[0]).toFixed(2)]})),o={hideHeader:!1,chartsEnabled:!1,cap:5,links:n},c=Object(f.b)(i,a,o);return t.renderLayout(React.createElement(f.a,null,c))}}],[{key:"renderLayout",value:function(e){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(y.a,{className:"googlesitekit-top-earnings-pages",footer:!0,footerCtaLabel:Object(O._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"http://analytics.google.com",fill:!0},e))}}]),t}(m.Component);t.default=Object(h.a)(R,[{type:_.b,identifier:"analytics",datapoint:"report",data:E.analyticsAdsenseReportDataDefaults,priority:1,maxAge:Object(b.o)("day"),context:"Dashboard"}],R.renderLayout(React.createElement(k.a,{rows:5,padding:!0})),{inGrid:!0,createGrid:!0},(function(){return!1}),(function(e){if(e&&e.error_data){var t=Object.values(e.error_data);if(t[0]&&"badRequest"===t[0].reason)return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(y.a,{className:"googlesitekit-top-earnings-pages",fill:!0},React.createElement(v.a,{title:Object(O.__)("Restricted metric(s)","google-site-kit"),description:Object(O.__)("You need to link Analytics and AdSense to get report for your top earning pages. Learn more: https://support.google.com/adsense/answer/6084409 ","google-site-kit")})))}if(e&&e.errors){var a=Object.values(e.errors);if(a[0]&&a[0][0])return a[0][0]}return!1}))},function(e,t,a){"use strict";a.r(t);var n=a(23),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(27),b=a(19),f=a(9),k=a(52),y=a(34),v=a(24),O=a(2),E=a(12),R=a(0),j=a(15);function S(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function w(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?S(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):S(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var D=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={accounts:!1,goals:!1},a}return p()(t,e),r()(t,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var e=this.state,t=e.overview,a=e.extractedAnalytics,n=e.goals,i=googlesitekit.permaLink,o=Object(O.m)("googlesitekit-module-analytics",{}),c="",s="",r="",l="",d="",u="";return t&&(c=t.totalUsers,s=t.totalUsersChange,r=t.goalCompletions,l=t.goalCompletionsChange,d=t.averageBounceRate,u=t.averageBounceRateChange),React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(_.a,{className:"overview-total-users",title:Object(R.__)("Unique Visitors from Search","google-site-kit"),datapoint:Object(O.t)(c),change:s,changeDataUnit:"%",source:{name:Object(R._x)("Analytics","Service name","google-site-kit"),link:o},sparkline:a&&React.createElement(k.a,{data:Object(O.e)(a,1),change:s,id:"analytics-users-sparkline"})})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},i&&React.createElement(_.a,{className:"overview-bounce-rate",title:Object(R.__)("Bounce Rate","google-site-kit"),datapoint:Number(d).toFixed(2),datapointUnit:Object(R.__)("%","google-site-kit"),change:u,changeDataUnit:"%",reverseArrowDirection:!0,source:{name:Object(R._x)("Analytics","Service name","google-site-kit"),link:o},sparkline:a&&React.createElement(k.a,{data:Object(O.e)(a,2),change:u,id:"analytics-sessions-sparkline"})}),!i&&n&&Object(E.isEmpty)(n.items)&&React.createElement(y.a,{title:Object(R.__)("Use goals to measure success.","google-site-kit"),description:Object(R.__)("Goals measure how well your site or app fulfills your target objectives.","google-site-kit"),ctaLink:"https://support.google.com/analytics/answer/1032415?hl=en#create_or_edit_goals",ctaLabel:Object(R.__)("Create a new goal","google-site-kit")}),!i&&n&&!Object(E.isEmpty)(n.items)&&React.createElement(_.a,{className:"overview-goals-completed",title:Object(R.__)("Goals Completed","google-site-kit"),datapoint:Object(O.t)(r),change:l,changeDataUnit:"%",source:{name:Object(R._x)("Analytics","Service name","google-site-kit"),link:o},sparkline:a&&React.createElement(k.a,{data:Object(O.e)(a,3),change:l,id:"analytics-sessions-sparkline"})}),!i&&!n&&React.createElement(v.a,{width:"100%",height:"202px"})))}}]),t}(h.Component);t.default=Object(b.a)(D,[{type:f.b,identifier:"analytics",datapoint:"report",data:w({},j.overviewReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(O.o)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.overview)return{overview:Object(j.calculateOverviewData)(a)}}},{type:f.b,identifier:"analytics",datapoint:"report",data:w({},j.siteAnalyticsReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(O.o)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.extractedAnalytics)return{extractedAnalytics:Object(j.extractAnalyticsDashboardSparklineData)(a)}}},{type:f.b,identifier:"analytics",datapoint:"goals",data:{url:googlesitekit.permaLink},priority:1,maxAge:Object(O.o)("hour"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.goals)return{goals:a}}}],React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(v.a,{width:"100%",height:"202px"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(v.a,{width:"100%",height:"202px"}))),{inGrid:!0},(function(e,t){return"report"===t&&Object(j.isDataZeroForReporting)(e)}),j.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(63),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(19),b=a(9),f=a(2),k=a(29),y=a(39),v=a(12),O=a(8),E=a.n(O),R=a(0),j=a(15),S=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,a=e.data,n=e.colspan;if(!a||!a.length)return null;var o=[{title:Object(R.__)("Title","google-site-kit"),tooltip:Object(R.__)("Page Title","google-site-kit"),primary:!0},{title:Object(R.__)("Pageviews","google-site-kit"),tooltip:Object(R.__)("Pageviews","google-site-kit")},{title:Object(R.__)("Unique Pageviews","google-site-kit"),tooltip:Object(R.__)("Unique Pageviews","google-site-kit")},{title:Object(R.__)("Bounce Rate","google-site-kit"),tooltip:Object(R.__)("Bounce Rate","google-site-kit")}],c=[],s=Object(v.map)(a[0].data.rows,(function(e,a){var n=Number(e.metrics[0].values[2]),o=i()(e.dimensions,2),s=o[0],r=o[1];return c[a]=t.addDeepLink(r),[s,Object(f.r)(e.metrics[0].values[0]),Object(f.r)(e.metrics[0].values[1]),React.createElement(h.Fragment,{key:"minichart-"+a},React.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(n.toFixed(2),"%")))]})),r={hideHeader:!1,chartsEnabled:!1,links:c},l=Object(k.b)(s,o,r);return React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-".concat(n)},React.createElement(k.a,null,l))}}],[{key:"addDeepLink",value:function(e){var t=googlesitekit.modules.analytics.settings,a=t.accountID,n=t.internalWebPropertyID,i=t.profileID;return a?"https://analytics.google.com/analytics/web/#/report/content-drilldown/a".concat(a,"w").concat(n,"p").concat(i,"/explorer-table.plotKeys=%5B%5D&_r.drilldown=analytics.pagePath:").concat(encodeURIComponent(e.replace(/\//g,"~2F"))):"https://analytics.google.com/analytics/web/"}}]),t}(h.Component);S.propTypes={data:E.a.array,colspan:E.a.number},S.defaultProps={data:null,colspan:12},t.default=Object(_.a)(S,[{type:b.b,identifier:"analytics",datapoint:"report",data:Object(j.getTopPagesReportDataDefaults)(),priority:1,maxAge:Object(f.o)("day"),context:["Single","Dashboard"]}],React.createElement(y.a,{padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(11),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(13),p=a.n(m),h=a(7),_=a.n(h),b=a(1),f=a(44),k=a(0),y=a(128),v=a(131),O=a(126),E=a(82),R=a(17),j=a(47),S=a(69),w=a(78),D=a(31),C=a(58),x=a(45),N=a(81),A=a(42),P=a(2),L=a(43),I=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={selectedStats:[0],receivingData:!0,error:!1,loading:!0,isAdSenseConnected:!0},a.handleStatSelection=a.handleStatSelection.bind(p()(a)),a.buildSeries=a.buildSeries.bind(p()(a)),a.handleDataError=a.handleDataError.bind(p()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(p()(a)),a}return _()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.isAdSenseConnected()}},{key:"isAdSenseConnected",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(Object(A.isAdsenseConnectedAnalytics)());case 2:e.sent?this.setState({isAdSenseConnected:!0}):this.setState({isAdSenseConnected:!1});case 4:case"end":return e.stop()}}),null,this)}},{key:"handleStatSelection",value:function(e){this.setState({selectedStats:[e]})}},{key:"handleDataError",value:function(e){this.setState({receivingData:!1,loading:!1,error:e})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0,loading:!1})}},{key:"buildSeries",value:function(){var e=this.state.selectedStats,t={0:"#4285f4",1:"#27bcd4",2:"#1b9688",3:"#673ab7"};return{0:{color:t[e],targetAxisIndex:0},1:{color:t[e],targetAxisIndex:0,lineDashStyle:[3,3],lineWidth:1}}}},{key:"render",value:function(){var e=this.state,t=e.selectedStats,a=e.error,n=e.receivingData,i=e.loading,o=e.isAdSenseConnected,c=this.buildSeries(),s=!i&&n?"":"googlesitekit-nodata",r=Object(P.h)();return React.createElement(b.Fragment,null,React.createElement(f.a,null),React.createElement(w.a,{module:"analytics"}),React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--analytics"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(j.a,{title:Object(k._x)("Analytics","Service name","google-site-kit"),icon:!0,iconWidth:"24",iconHeight:"26",iconID:"analytics",status:"connected",statusText:Object(k.__)("Analytics is connected","google-site-kit")}),i&&React.createElement(D.a,null)),!n&&(a?Object(x.a)(Object(k._x)("Analytics","Service name","google-site-kit"),a,!0,!0,!0):Object(C.a)(Object(k._x)("Analytics","Service name","google-site-kit"),!0,!0,!0)),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(R.a,{header:!0,title:Object(k.sprintf)(Object(k.__)("Audience overview for the last %s","google-site-kit"),r),headerCtaLabel:Object(k.__)("See full stats in Analytics","google-site-kit"),headerCtaLink:"http://analytics.google.com"},React.createElement(O.default,{selectedStats:t,handleStatSelection:this.handleStatSelection,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}),React.createElement(y.default,{selectedStats:t,series:c,vAxes:null,dateRangeFrom:r}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(R.a,{header:!0,footer:!0,title:Object(k.sprintf)(Object(k.__)("Top content over the last %s","google-site-kit"),r),headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(k.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(k._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},React.createElement(v.default,null))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(R.a,{header:!0,footer:!0,title:Object(k.sprintf)(Object(k.__)("Top acquisition sources over the last %s","google-site-kit"),r),headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(k.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(k._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(S.default,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(E.default,null)))))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(L.a,null))))),!i&&!o&&React.createElement(N.default,null))}}]),t}(b.Component);t.default=I},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(97),h=a(27),_=a(34),b=a(19),f=a(9),k=a(2),y=a(15),v=a(0),O=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=Object(y.calculateOverviewData)(e);if(!t)return null;var a=t.totalUsers,n=t.averageSessionDuration,i=t.totalUsersChange,o=t.averageSessionDurationChange;return React.createElement(m.Fragment,null,e.length?React.createElement(m.Fragment,null,React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-users",title:Object(v.__)("Total Unique Visitors","google-site-kit"),datapoint:Object(k.t)(a),change:i,changeDataUnit:"%"}),React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-average-session-duration",title:Object(v.__)("Avg. Time on Page","google-site-kit"),datapoint:Object(k.s)(n),change:o,changeDataUnit:"%"})):React.createElement("div",{className:"googlesitekit-wp-dashboard-stats__cta"},React.createElement(_.a,{title:Object(v.__)("Analytics Gathering Data","google-site-kit"),description:Object(v.__)("Analytics data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""})))}}]),t}(m.Component);t.default=Object(b.a)(O,[{type:f.b,identifier:"analytics",datapoint:"report",data:y.overviewReportDataDefaults,priority:1,maxAge:Object(k.o)("day"),context:["WPDashboard"]}],React.createElement(p.a,{width:"23%",height:"94px",count:2}),{},y.isDataZeroForReporting,y.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(63),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(19),b=a(9),f=a(2),k=a(29),y=a(39),v=a(12),O=a(0),E=a(15),R=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data,t=googlesitekit.admin.siteURL;if(Object(E.isDataZeroForReporting)(e))return null;var a=[],n=Object(v.map)(e[0].data.rows,(function(e,n){var o=i()(e.dimensions,2),c=o[0],s=o[1];return a[n]=t+s,[c,Object(f.r)(e.metrics[0].values[0])]})),o=[{title:Object(O.__)("Title","google-site-kit"),tooltip:Object(O.__)("Page Title","google-site-kit"),primary:!0},{title:Object(O.__)("Pageviews","google-site-kit"),tooltip:Object(O.__)("Pageviews","google-site-kit")}],c={chartsEnabled:!0,links:a,cap:5,showURLs:!0},s=Object(k.b)(n,o,c);return React.createElement("div",{className:"googlesitekit-search-console-widget"},React.createElement("h2",{className:"googlesitekit-search-console-widget__title"},Object(O.__)("Top content over the last 28 days","google-site-kit")),React.createElement(k.a,null,s))}}]),t}(h.Component);t.default=Object(_.a)(R,[{type:b.b,identifier:"analytics",datapoint:"report",data:Object(E.getTopPagesReportDataDefaults)(),priority:1,maxAge:Object(f.o)("day"),context:"WPDashboard"}],React.createElement(y.a,{rows:6}))},function(e,t,a){"use strict";a.r(t);var n=a(11),i=a.n(n),o=(a(1),a(34)),c=a(9),s=a(56),r=a(2),l=a(0);t.default=function(){var e=googlesitekit.modules["pagespeed-insights"],t=e.active,a=e.setupComplete;if(!googlesitekit.permissions.canManageOptions&&!a)return null;return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(o.a,{title:!a&&t?Object(l.__)("Complete PageSpeed Insights activation.","google-site-kit"):Object(l.__)("Activate PageSpeed Insights.","google-site-kit"),description:Object(l.__)("Google PageSpeed Insights gives you metrics about performance, accessibility, SEO and PWA.","google-site-kit"),ctaLink:"#",ctaLabel:!a&&t?Object(l.__)("Complete activation","google-site-kit"):Object(l.__)("Activate PageSpeed Insights","google-site-kit"),onClick:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.a.awrap(Object(r.a)(c.c,"pagespeed-insights",!0));case 3:window.location=Object(r.l)("pagespeed-insights"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),Object(r.w)(s.a,{id:"pagespeed-insights-setup-error",title:Object(l.__)("Internal Server Error","google-site-kit"),description:e.t0.message,format:"small",type:"win-error"});case 9:case"end":return e.stop()}}),null,null,[[0,6]])}}))}},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(62),b=a(31),f=a(45),k=a(0),y=a(99),v=a(67),O=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={loading:!0,error:!1},a.handleDataLoaded=a.handleDataLoaded.bind(g()(a)),a.handleDataError=a.handleDataError.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"handleDataLoaded",value:function(){this.setState({loading:!1})}},{key:"handleDataError",value:function(e){this.setState({error:e})}},{key:"render",value:function(){var e=this.state,t=e.loading,a=e.error,n={name:Object(k._x)("PageSpeed Insights","Service name","google-site-kit"),link:Object(k.sprintf)("https://developers.google.com/speed/pagespeed/insights/?url=%s",googlesitekit.permaLink||googlesitekit.admin.siteURL)};return a?React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},Object(f.a)(Object(k._x)("PageSpeed Insights","Service name","google-site-kit"),a,!0,!0,!1)):React.createElement(h.Fragment,null,t&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-pagespeed-report__loading"},React.createElement(b.a,null),React.createElement("p",null,Object(k.__)("PageSpeed Insights is preparing data…","google-site-kit")))),React.createElement(y.PageSpeedInsightsDashboardWidgetHomepageSpeedMobile,{handleDataLoaded:this.handleDataLoaded,handleDataError:this.handleDataError,title:Object(k.__)("Mobile","google-site-kit")}),React.createElement(y.PageSpeedInsightsDashboardWidgetHomepageSpeedDesktop,{title:Object(k.__)("Desktop","google-site-kit")}),!t&&React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(_.a,{name:n.name,href:n.link,external:!0})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--align-right-tablet "},React.createElement(v.PageSpeedReportScale,null))))}}]),t}(h.Component);t.default=O},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(21),p=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(p.Component);t.default=Object(m.a)("googlesitekit.DashboardSpeed")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(137),h=a(17),_=a(41),b=a(0),f=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.permaLink?Object(b.__)("How fast this page is.","google-site-kit"):Object(b.__)("How fast your home page is.","google-site-kit");return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(_.a,{title:Object(b.__)("Speed","google-site-kit"),description:e})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{className:"googlesitekit-pagespeed-report"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(p.default,null))))))}}]),t}(m.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(27),h=a(19),_=a(9),b=a(2),f=a(35),k=a(24),y=a(0),v=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||e.error)return null;var t=Object(f.extractSearchConsoleDashboardData)(e),a=t.totalClicks,n=t.totalImpressions,i=t.totalClicksChange,o=t.totalImpressionsChange;return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(p.a,{className:"overview-total-impressions",title:Object(y.__)("Total Impressions","google-site-kit"),datapoint:n,change:o,changeDataUnit:"%"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(p.a,{className:"overview-total-clicks",title:Object(y.__)("Total Clicks","google-site-kit"),datapoint:a,change:i,changeDataUnit:"%"})))}}]),t}(m.Component);t.default=Object(h.a)(v,[{type:_.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:googlesitekit.permaLink,dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(b.o)("day"),context:"Adminbar"}],React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(k.a,{width:"auto",height:"59px"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(k.a,{width:"auto",height:"59px"}))),{inGrid:!0},f.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(51),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(139),b=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){return"undefined"!==i()(googlesitekit.permaLink)&&""===googlesitekit.permaLink?null:React.createElement(_.default,null)}}]),t}(h.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(41),h=a(17),_=a(0),b=a(83),f=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(p.a,{title:Object(_.__)("Top Queries","google-site-kit"),description:Object(_.__)("What people searched for to find your page.","google-site-kit")})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{footer:!0,footerCtaLabel:Object(_._x)("Search Console","Service name","google-site-kit"),footerCtaLink:Object(_.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",googlesitekit.admin.siteURL)},React.createElement(b.default,null))))}}]),t}(m.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(65),h=a(41),_=a(17),b=a(0),f=a(84),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{description:Object(b.__)("How your site appeared in Search results and how many visitors you got from Search.","google-site-kit"),title:Object(b.__)("Search Funnel","google-site-kit")})),React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(_.a,{className:"googlesitekit-analytics-search-funnel"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(f.default,null),!googlesitekit.modules.analytics.active&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(p.a,null)))))))}}]),t}(m.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(27),h=a(19),_=a(9),b=a(24),f=a(2),k=a(35),y=a(8),v=a.n(y),O=a(0),E=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,n=e.handleStatSelection;if(!t||!t.length)return null;var i=Object(k.extractSearchConsoleDashboardData)(t),o=i.totalClicks,c=i.totalImpressions,s=i.averageCTR,r=i.averagePosition,l=i.totalClicksChange,d=i.totalImpressionsChange,u=i.averageCTRChange,g=i.averagePositionChange,h=[{className:"googlesitekit-data-block--clicks googlesitekit-data-block--button-1",title:Object(O.__)("Total Clicks","google-site-kit"),datapoint:o,change:l,changeDataUnit:"%",context:"button",selected:a.includes(0),handleStatSelection:n},{className:"googlesitekit-data-block--impressions googlesitekit-data-block--button-2",title:Object(O.__)("Total Impressions","google-site-kit"),datapoint:c,change:d,changeDataUnit:"%",context:"button",selected:a.includes(1),handleStatSelection:n},{className:"googlesitekit-data-block--ctr googlesitekit-data-block--button-3",title:Object(O.__)("Average CTR","google-site-kit"),datapoint:s+"%",change:u,changeDataUnit:"%",context:"button",selected:a.includes(2),handleStatSelection:n},{className:"googlesitekit-data-block--position googlesitekit-data-block--button-4",title:Object(O.__)("Average Position","google-site-kit"),datapoint:r,change:g,changeDataUnit:"%",context:"button",selected:a.includes(3),handleStatSelection:n}];return React.createElement(m.Fragment,null,React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner",role:"toolbar","aria-label":"Line Chart Options"},h.map((function(e,t){return React.createElement("div",{key:t,className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(p.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection}))})))))}}]),t}(m.Component);E.propTypes={handleDataError:v.a.func.isRequired},t.default=Object(h.a)(E,[{type:_.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(f.o)("day"),context:["Single","Dashboard"]}],React.createElement(b.a,{width:"100%",height:"190px",padding:!0}),{createGrid:!0},k.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(19),h=a(9),_=a(2),b=a(29),f=a(39),k=a(17),y=a(12),v=a(0),O=a(35),E=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var a=[{title:Object(v.__)("Top search queries for your site","google-site-kit"),tooltip:Object(v.__)("Most searched for keywords related to your content","google-site-kit"),primary:!0},{title:Object(v.__)("Clicks","google-site-kit"),tooltip:Object(v.__)("Number of times users clicked on your content in search results","google-site-kit")},{title:Object(v.__)("Impressions","google-site-kit"),tooltip:Object(v.__)("Counted each time your content appears in search results","google-site-kit")}],n=googlesitekit.admin.siteURL,i=[],o=Object(y.map)(e,(function(e,t){var a=e.keys[0];return i[t]=Object(v.sprintf)("https://search.google.com/search-console/performance/search-analytics?resource_id=%s&query=!%s&num_of_days=28",n,a),[a,Object(_.r)(e.clicks),Object(_.r)(e.impressions)]})),c={hideHeader:!1,chartsEnabled:!1,links:i},s=Object(b.b)(o,a,c);return t.renderLayout(React.createElement(b.a,null,s))}}],[{key:"renderLayout",value:function(e){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(k.a,{className:"googlesitekit-popular-content",footer:!0,footerCtaLabel:Object(v._x)("Search Console","Service name","google-site-kit"),footerCtaLink:Object(v.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",googlesitekit.admin.siteURL),fill:!0},e))}}]),t}(m.Component);t.default=Object(p.a)(E,[{type:h.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"query",limit:10},priority:1,maxAge:Object(_.o)("day"),context:["Dashboard"]}],E.renderLayout(React.createElement(f.a,{padding:!0})),{inGrid:!0,createGrid:!0},O.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(21),p=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(p.Component);t.default=Object(m.a)("googlesitekit.DashboardPopularity")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(145),h=a(41),_=a(0),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{title:Object(_.__)("Popularity","google-site-kit"),description:Object(_.__)("Your most popular pages and how people found them from Search.","google-site-kit"),timePeriod:Object(_.__)("Last 28 days","google-site-kit")})),React.createElement(p.default,null))}}]),t}(m.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(84),h=a(17),_=a(41),b=a(65),f=a(0),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.permissions.canManageOptions,t=googlesitekit.modules.analytics.active||e?12:6;return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(_.a,{title:Object(f.__)("Search Funnel","google-site-kit"),description:Object(f.__)("How your site appeared in Search results and how many visitors you got from Search.","google-site-kit"),timePeriod:Object(f.__)("Last 28 days","google-site-kit")})),React.createElement("div",{className:"\n\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\tmdc-layout-grid__cell--span-".concat(t,"\n\t\t\t\t")},React.createElement(h.a,{className:"googlesitekit-analytics-search-funnel"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(p.default,null),!googlesitekit.modules.analytics.active&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(b.a,null)))))))}}]),t}(m.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(19),b=a(9),f=a(59),k=a(24),y=a(2),v=a(35),O=a(0),E=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).setOptions=a.setOptions.bind(g()(a)),a}return p()(t,e),c()(t,[{key:"setOptions",value:function(){var e=this.props,t=e.selectedStats,a=e.series,n=e.vAxes,i={chart:{title:googlesitekit.pageTitle&&googlesitekit.pageTitle.length?Object(O.sprintf)(Object(O.__)("Search Traffic Summary for %s","google-site-kit"),Object(y.d)(googlesitekit.pageTitle)):Object(O.__)("Search Traffic Summary","google-site-kit")},curveType:"line",height:270,width:"100%",chartArea:{height:"80%",width:"87%"},legend:{position:"top",textStyle:{color:"#616161",fontSize:12}},hAxis:{format:"M/d/yy",gridlines:{color:"#fff"},textStyle:{color:"#616161",fontSize:12}},vAxis:{gridlines:{color:"#eee"},minorGridlines:{color:"#eee"},textStyle:{color:"#616161",fontSize:12},titleTextStyle:{color:"#616161",fontSize:12,italic:!1}}};return i.series=a,i.vAxes=n,3<=t.length&&(i.vAxis.textPosition="none",i.vAxis.gridlines.color="#fff",i.vAxis.minorGridlines.color="#fff",i.chartArea.width="98%"),i}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats;if(!t||!t.length)return null;var n=this.setOptions(),i=Object(v.extractSearchConsoleDashboardData)(t);return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(f.a,{selectedStats:a,data:i.dataMap,options:n,singleStat:!1}))))}}]),t}(h.Component);t.default=Object(_.a)(E,[{type:b.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(y.o)("day"),context:"Single"}],React.createElement(k.a,{width:"100%",height:"270px",padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(27),h=a(19),_=a(9),b=a(0),f=a(35),k=a(52),y=a(24),v=a(2),O=a(34),E=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data,t=e.error;if(t)return Object(v.v)("plugin_setup","search_console_error",t.message),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(O.a,{title:Object(b.__)("Something went wrong","google-site-kit"),description:t.message,error:!0}));if(!e)return null;if(!e.length)return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(O.a,{title:Object(b.__)("Search Console Data Empty","google-site-kit"),description:Object(b.__)("Search Console data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""}));var a=Object(v.m)("googlesitekit-module-search-console",{}),n=Object(f.extractSearchConsoleDashboardData)(e),i=n.totalClicks,o=n.totalImpressions,c=n.totalClicksChange,s=n.totalImpressionsChange,r=n.dataMap;return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(p.a,{className:"overview-total-impressions",title:Object(b.__)("Impressions","google-site-kit"),datapoint:o,change:s,changeDataUnit:"%",source:{name:Object(b._x)("Search Console","Service name","google-site-kit"),link:a},sparkline:React.createElement(k.a,{data:Object(v.e)(r,2),change:s,id:"search-console-impressions-sparkline"})})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(p.a,{className:"overview-total-clicks",title:Object(b.__)("Clicks","google-site-kit"),datapoint:i,change:c,changeDataUnit:"%",source:{name:Object(b._x)("Search Console","Service name","google-site-kit"),link:a},sparkline:React.createElement(k.a,{data:Object(v.e)(r,1),change:c,id:"search-console-clicks-sparkline"})})))}}]),t}(m.Component);t.default=Object(h.a)(E,[{type:_.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:googlesitekit.permaLink,dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(v.o)("day"),context:["Single","Dashboard"]}],React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(y.a,{width:"100%",height:"202px"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(y.a,{width:"100%",height:"202px"}))),{inGrid:!0},f.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(23),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(13),p=a.n(m),h=a(7),_=a.n(h),b=a(1),f=a(44),k=a(0),y=a(148),v=a(83),O=a(143),E=a(47),R=a(17),j=a(78),S=a(31),w=a(58),D=a(45),C=a(2),x=a(43);function N(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var A=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={selectedStats:[0,1],receivingData:!0,error:!1,loading:!0},a.handleStatSelection=a.handleStatSelection.bind(p()(a)),a.buildSeries=a.buildSeries.bind(p()(a)),a.buildVAxes=a.buildVAxes.bind(p()(a)),a.handleDataError=a.handleDataError.bind(p()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(p()(a)),a}return _()(t,e),r()(t,[{key:"handleDataError",value:function(e){this.setState({receivingData:!1,error:e,loading:!1})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0,loading:!1})}},{key:"handleStatSelection",value:function(e){var t=this.state.selectedStats,a=t.slice();t.includes(e)?a=t.filter((function(t){return e!==t})):a.push(e),0!==a.length&&this.setState({selectedStats:a})}},{key:"buildSeries",value:function(){var e=this.state.selectedStats,t={0:"#4285f4",1:"#27bcd4",2:"#1b9688",3:"#673ab7"};return e.map((function(e,a){return{color:t[e],targetAxisIndex:a}}))}},{key:"buildVAxes",value:function(){var e=this.state.selectedStats,t={0:Object(k.__)("Clicks","google-site-kit"),1:Object(k.__)("Impressions","google-site-kit"),2:Object(k.__)("Average CTR","google-site-kit"),3:Object(k.__)("Average Position","google-site-kit")};return e.map((function(e){var a={};return 3===e&&(a.direction=-1),function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?N(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):N(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({title:t[e]},a)}))}},{key:"render",value:function(){var e=this.state,t=e.selectedStats,a=e.receivingData,n=e.error,i=e.loading,o=this.buildSeries(),c=this.buildVAxes(),s=!i&&a?"":"googlesitekit-nodata",r=Object(C.h)(),l=Object(k.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",googlesitekit.admin.siteURL);return React.createElement(b.Fragment,null,React.createElement(f.a,null),React.createElement(j.a,{module:"search-console"}),React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--search-console"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(E.a,{title:Object(k._x)("Search Console","Service name","google-site-kit"),icon:!0,iconWidth:"23",iconHeight:"21",iconID:"search-console",status:"connected",statusText:Object(k.__)("Search Console is connected","google-site-kit")}),i&&React.createElement(S.a,null)),!a&&(n?Object(D.a)(Object(k._x)("Search Console","Service name","google-site-kit"),n,!0,!0,!0):Object(w.a)(Object(k._x)("Search Console","Service name","google-site-kit"),!0,!0,!0)),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(R.a,{header:!0,title:Object(k.sprintf)(Object(k.__)("Overview for the last %s","google-site-kit"),r),headerCtaLabel:Object(k.__)("See full stats in Search Console","google-site-kit"),headerCtaLink:l},React.createElement(O.default,{selectedStats:t,handleStatSelection:this.handleStatSelection,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}),React.createElement(y.default,{selectedStats:t,series:o,vAxes:c}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(R.a,{title:Object(k.sprintf)(Object(k.__)("Top search queries over the last %s","google-site-kit"),r),header:!0,footer:!0,headerCtaLabel:Object(k.__)("See full stats in Search Console","google-site-kit"),headerCtaLink:l,footerCtaLabel:Object(k._x)("Search Console","Service name","google-site-kit"),footerCtaLink:l},React.createElement(v.default,null))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(x.a,null))))))}}]),t}(b.Component);t.default=A},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(152),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement(p.default,null))}}]),t}(m.Component);t.default=h},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(97),h=a(27),_=a(19),b=a(9),f=a(2),k=a(35),y=a(34),v=a(0),O=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=Object(k.extractSearchConsoleDashboardData)(e),a=t.totalClicks,n=t.totalImpressions,i=t.totalClicksChange,o=t.totalImpressionsChange;return React.createElement(m.Fragment,null,e.length?React.createElement(m.Fragment,null,React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-impressions",title:Object(v.__)("Total Impressions","google-site-kit"),datapoint:n,change:o,changeDataUnit:"%"}),React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-clicks",title:Object(v.__)("Total Clicks","google-site-kit"),datapoint:a,change:i,changeDataUnit:"%"})):React.createElement("div",{className:"googlesitekit-wp-dashboard-stats__cta"},React.createElement(y.a,{title:Object(v.__)("Search Console Data Empty","google-site-kit"),description:Object(v.__)("Search Console data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""})))}}]),t}(m.Component);t.default=Object(_.a)(O,[{type:b.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(f.o)("day"),context:["WPDashboard"]}],React.createElement(p.a,{width:"23%",height:"94px",count:2}),{},k.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(1),p=a(0),h=googlesitekit.admin.siteURL,_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-settings-module__meta-item-type"},Object(p.__)("Connected URL","google-site-kit")),React.createElement("div",{className:"googlesitekit-settings-module__meta-item-data"},h))}}]),t}(m.Component);t.default=_},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,a){a(79),a(108),a(110),a(111),a(112),a(81),a(114),a(113),a(115),a(116),a(200),a(117),a(118),a(80),a(109),a(201),a(119),a(42),a(105),a(120),a(121),a(122),a(123),a(69),a(124),a(125),a(126),a(127),a(128),a(82),a(129),a(130),a(131),a(132),a(202),a(102),a(15),a(106),a(133),a(134),a(203),a(98),a(135),a(99),a(136),a(137),a(138),a(67),a(204),a(139),a(140),a(141),a(142),a(83),a(143),a(144),a(145),a(146),a(84),a(147),a(148),a(149),a(150),a(35),a(214),a(153),a(152),a(151),a(206),a(100),e.exports=a(107)},,,function(e,t,a){"use strict";a.r(t);a(1);var n=a(25),i=a(2),o=a(116),c=a(112),s=a(80),r=a(108),l=a(117),d=a(118),u=a(10),g="adsense";if(Object(u.addFilter)("googlesitekit.ModuleSettingsWarning","googlesitekit.adsenseSettingsWarning",Object(i.f)(d.default,{})),Object(u.addFilter)("googlesitekit.SetupModuleShowLink","googlesitekit.adsenseSetupModuleShowLink",(function(e,t){return!("adsense"===t&&!googlesitekit.canAdsRun)&&e})),googlesitekit.modules.adsense.active){var m=Object(n.a)(React.createElement(o.default,null)),p=Object(n.a)(React.createElement(c.default,null));if(googlesitekit.modules[g].setupComplete)Object(u.addFilter)("googlesitekit.ModuleApp-".concat(g),"googlesitekit.ModuleApp",m),Object(u.addFilter)("googlesitekit.DashboardModule","googlesitekit.DashboardEarningModule",p,50);else{var h=googlesitekit.admin,_=h.reAuth,b=h.currentScreen,f=b?b.id:null;_||"site-kit_page_googlesitekit-module-adsense"!==f||(window.location=Object(i.m)("googlesitekit-module-".concat(g),{reAuth:!0,slug:g})),Object(u.addFilter)("googlesitekit.Connected-".concat(g),"googlesitekit.AdSenseModuleConnected",(function(e){var t=googlesitekit.modules[g].settings;return!(e||void 0===t||"account-pending-review"!==t.accountStatus&&"ads-display-pending"!==t.accountStatus)||e}))}Object(u.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(g),"googlesitekit.AdSenseModuleSettingsDetails",Object(i.f)(s.default,{onSettingsPage:!0})),Object(u.addFilter)("googlesitekit.ModuleSetup-".concat(g),"googlesitekit.TagmanagerModuleSetupWizard",Object(i.f)(r.default,{onSettingsPage:!1})),Object(u.addFilter)("googlesitekit.autoRefreshModules","googlesitekit.AdSenseAutoRefresh",(function(e){return e.push({identifier:"adsense",toRefresh:function(){var e="";return googlesitekit.modules.adsense&&googlesitekit.modules.adsense["account-status"]&&(e=googlesitekit.modules.adsense["account-status"].accountStatus),!(e&&-1<e.indexOf("account-connected"))}}),e})),Object(u.addFilter)("googlesitekit.ModulesNotificationsRequest","googlesitekit.adsenseNotifications",(function(e){return e.push({identifier:"adsense"}),e})),Object(u.addFilter)("googlesitekit.ModuleSetupIncomplete","googlesitekit.adsenseSettingStatus",Object(i.f)(l.default,{}))}},function(e,t,a){"use strict";a.r(t);var n=a(11),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(1),_=a(9),b=a(119),f=a(64),k=a(0),y=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={isLoading:!0,error:!1,message:"",accounts:[],accountStatus:""},a}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isOpen;e.onSettingsPage&&!t||this.getAccounts()}},{key:"getAccounts",value:function(){var e,t,a;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,i.a.awrap(_.c.get(_.b,"adsense","accounts"));case 3:e=n.sent,t="",e&&e.length||(t="no-account"),a=e,this.setState({isLoading:!1,accountStatus:t,accounts:a,error:!1}),n.next=13;break;case 10:n.prev=10,n.t0=n.catch(0),this.setState({isLoading:!1,error:n.t0.code,message:n.t0.message});case 13:case"end":return n.stop()}}),null,this,[[0,10]])}},{key:"renderErrorMessage",value:function(){var e=this.state,t=e.error,a=e.message;return t&&0<a.length?React.createElement("div",{className:"googlesitekit-error-text"},React.createElement("p",null,Object(k.__)("Error:","google-site-kit")," ",a)):null}},{key:"render",value:function(){var e=this.state,t=e.isLoading,a=e.accounts,n=e.accountStatus;return React.createElement(h.Fragment,null,React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--adsense"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t?React.createElement(f.a,{isSaving:t}):React.createElement(b.default,{accountStatus:n,accounts:a}),t?null:this.renderErrorMessage()))))}}]),t}(h.Component);t.default=y},function(e,t,a){"use strict";a.r(t);a(1);var n=a(2),i=a(25),o=a(132),c=a(121),s=a(124),r=a(130),l=a(133),d=a(122),u=a(134),g=a(125),m=a(127),p=a(129),h=a(102),_=a(10),b="analytics",f=Object(i.a)(React.createElement(c.default,null));if(Object(_.addFilter)("googlesitekit.AdminbarModules","googlesitekit.Analytics",f,11),!googlesitekit.modules[b].setupComplete){var k=googlesitekit.admin,y=k.reAuth,v=k.currentScreen,O=v?v.id:null;y||"site-kit_page_googlesitekit-module-analytics"!==O||(window.location=Object(n.m)("googlesitekit-module-".concat(b),{reAuth:!0,slug:b}))}if(googlesitekit.modules.analytics.active){var E=Object(i.a)(React.createElement(o.default,null)),R=Object(i.a)(React.createElement(s.default,null)),j=Object(i.a)(React.createElement(l.default,null)),S=Object(i.a)(React.createElement(u.default,null)),w=Object(i.a)(React.createElement(r.default,null)),D=Object(i.a)(React.createElement(d.default,null)),C=Object(i.a)(React.createElement(g.default,null)),x=Object(i.a)(React.createElement(m.default,null)),N=Object(i.a)(React.createElement(p.default,null));Object(_.addFilter)("googlesitekit.DashboardModule","googlesitekit.Analytics",R,9),Object(_.addFilter)("googlesitekit.DashboardSearchFunnel","googlesitekit.Analytics",w,11),Object(_.addFilter)("googlesitekit.DashboardPopularity","googlesitekit.Analytics",x,20),Object(_.addFilter)("googlesitekit.AnalyticsAdSenseTopPagesTableSmall","googlesitekit.Analytics",N,20),Object(_.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.Analytics",D,20),Object(_.addFilter)("googlesitekit.WPDashboardHeader","googlesitekit.Analytics",j),Object(_.addFilter)("googlesitekit.WPDashboardModule","googlesitekit.Analytics",S),Object(_.addFilter)("googlesitekit.ModuleApp-"+b,"googlesitekit.Analytics",E),Object(_.addFilter)("googlesitekit.AnalyticsAdSenseTopPagesTable","googlesitekit.Analytics",C,11),Object(_.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(b),"googlesitekit.AnalyticsModuleSettingsDetails",Object(n.f)(h.default,{onSettingsPage:!0})),Object(_.addFilter)("googlesitekit.showDateRangeSelector-".concat(b),"googlesitekit.analyticsShowDateRangeSelector",(function(){return!0})),Object(_.addFilter)("googlesitekit.ModuleSetup-".concat(b),"googlesitekit.AnalyticsModuleSetupWizard",Object(n.f)(h.default,{onSettingsPage:!1}))}},function(e,t,a){"use strict";a.r(t);var n=a(2),i=a(98),o=a(10),c=a(0),s="optimize";googlesitekit.modules.optimize.active&&(Object(o.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(s),"googlesitekit.OptimizeModuleSettingsDetails",Object(n.f)(i.default,{onSettingsPage:!0})),Object(o.addFilter)("googlesitekit.ModuleSetup-".concat(s),"googlesitekit.OptimizeModuleSetupWizard",Object(n.f)(i.default,{onSettingsPage:!1})),Object(o.addFilter)("googlesitekit.SetupWinNotification-".concat(s),"googlesitekit.OptimizeSetupWinNotification",(function(e){return e.description=Object(c.__)("To set up experiments and see the results, go to ","google-site-kit"),e.learnMore.label="Optimize",e.learnMore.url="https://optimize.withgoogle.com/",e})))},function(e,t,a){"use strict";a.r(t);a(1);var n=a(25),i=a(10),o=a(138),c=a(136),s=a(135),r=googlesitekit.modules["pagespeed-insights"],l=r.active,d=r.setupComplete;if(l&&d){var u=Object(n.a)(React.createElement(o.default,null)),g=Object(n.a)(React.createElement(c.default,null));Object(i.addFilter)("googlesitekit.DashboardModule","googlesitekit.PageSpeedInsights",u,45),Object(i.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.PageSpeedInsights",u,45),Object(i.addFilter)("googlesitekit.DashboardSpeed","googlesitekit.PageSpeedInsightsHomepageSpeed",g)}else{var m=Object(n.a)(React.createElement(s.default,null));Object(i.addFilter)("googlesitekit.DashboardModule","googlesitekit.PageSpeedInsights",m,45)}},,function(e,t,a){"use strict";a.r(t);var n=a(2),i=a(100),o=a(10);googlesitekit.modules.tagmanager.active&&(Object(o.addFilter)("googlesitekit.ModuleSettingsDetails-".concat("tagmanager"),"googlesitekit.TagmanagerModuleSettingsDetails",Object(n.f)(i.default,{onSettingsPage:!0})),Object(o.addFilter)("googlesitekit.ModuleSetup-".concat("tagmanager"),"googlesitekit.TagmanagerModuleSetupWizard",Object(n.f)(i.default,{onSettingsPage:!1})))},,,,,,,,function(e,t,a){"use strict";a.r(t);var n=a(1),i=a(150),o=a(140),c=a(151),s=a(147),r=a(149),l=a(141),d=a(144),u=a(142),g=a(146),m=a(11),p=a.n(m),h=a(3),_=a.n(h),b=a(4),f=a.n(b),k=a(5),y=a.n(k),v=a(6),O=a.n(v),E=a(13),R=a.n(E),j=a(7),S=a.n(j),w=a(12),D=a(177),C=a.n(D),x=a(9),N=a(28),A=a(17),P=a(2),L=a(0),I=function(e){function t(e){var a;return _()(this,t),(a=y()(this,O()(t).call(this,e))).state={isSearching:!1,results:[],error:!1,message:""},a.postSearch=a.postSearch.bind(R()(a)),a.onClick=a.onClick.bind(R()(a)),a.onConfirm=a.onConfirm.bind(R()(a)),a}return S()(t,e),f()(t,[{key:"postSearch",value:function(e,t){var a;return p.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t([Object(L.__)("Loading...","google-site-kit")]),n.prev=1,n.next=4,p.a.awrap(x.c.get(x.a,"search","post-search",{query:encodeURIComponent(e)}));case 4:0<(a=n.sent).length?t(Object(w.map)(a,(function(e){return e.post_title}))):t([Object(L.__)("No results found","google-site-kit")]),this.setState({isSearching:!0,results:a,error:!1,message:""}),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(1),t([Object(L.__)("No results found","google-site-kit")]),this.setState({isSearching:!1,error:n.t0.code,message:n.t0.message});case 13:case"end":return n.stop()}}),null,this,[[1,9]])}},{key:"getURLPathname",value:function(e){try{var t=new URL(e);return Object(w.trim)(t.pathname,"/")}catch(e){return!1}}},{key:"onConfirm",value:function(e){this.setState({selection:e})}},{key:"onClick",value:function(){var e=this.state,t=e.results,a=e.selection,n=Object(w.find)(t,(function(e){return e.post_title===a}));document.location=Object(P.m)("googlesitekit-dashboard",{id:n.id,permaLink:n.permalink,pageTitle:a})}},{key:"render",value:function(){var e=googlesitekit.modules,t=e.analytics&&e.analytics.active?"mdc-layout-grid__cell mdc-layout-grid__cell--span-12":"mdc-layout-grid__cell mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop";return React.createElement("div",{className:t},React.createElement(A.a,{title:Object(L.__)("Search for individual page or post information","google-site-kit"),header:!0},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement("div",{className:"googlesitekit-post-searcher"},React.createElement("label",{className:"googlesitekit-post-searcher__label",htmlFor:"autocomplete"},Object(L.__)("Title or URL","google-site-kit")),React.createElement(C.a,{id:"autocomplete",source:Object(w.debounce)(this.postSearch,200),minLength:2,onConfirm:this.onConfirm,showNoOptionsFound:!1}),React.createElement("div",{className:"googlesitekit-post-searcher__button-wrapper"},React.createElement(N.a,{onClick:this.onClick,className:"googlesitekit-post-searcher__button"},Object(L.__)("View Data","google-site-kit")))))))))}}]),t}(n.Component),M=a(153),T=a(25),F=a(10),U="search-console",z=Object(T.a)(React.createElement(i.default,null)),q=Object(T.a)(React.createElement(o.default,null)),W=Object(T.a)(React.createElement(c.default,null)),G=Object(T.a)(React.createElement(s.default,null)),H=Object(T.a)(React.createElement(r.default,null)),B=Object(T.a)(React.createElement(u.default,null)),K=Object(T.a)(React.createElement(l.default,null)),Y=Object(T.a)(React.createElement(d.default,null)),V=Object(T.a)(React.createElement(g.default,null)),Z=Object(T.a)(React.createElement(I,null));Object(F.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(U),"googlesitekit.SearchConsoleModuleSettingsDetails",Object(P.f)(M.default,{onSettingsPage:!0})),Object(F.addFilter)("googlesitekit.DashboardModule","googlesitekit.SearchConsole",G,11),Object(F.addFilter)("googlesitekit.DashboardModule","googlesitekit.DashboardPopularityModule",V,40),Object(F.addFilter)("googlesitekit.DashboardSearchFunnel","googlesitekit.SearchConsoleSearchFunnel",H),Object(F.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.SearchConsole",B),Object(F.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.SearchConsole",K,40),Object(F.addFilter)("googlesitekit.DashboardPopularity","googlesitekit.SearchConsoleDashboardPopularity",Y),Object(F.addFilter)("googlesitekit.DashboardPopularity","googlesitekit.DashboardPPostSearcherModule",Z,30),Object(F.addFilter)("googlesitekit.WPDashboardHeader","googlesitekit.SearchConsole",W,11),Object(F.addFilter)("googlesitekit.ModuleApp-"+U,"googlesitekit.ModuleApp",z),Object(F.addFilter)("googlesitekit.showDateRangeSelector-".concat(U),"googlesitekit.searchConsoleShowDateRangeSelector",(function(){return!0})),Object(F.addFilter)("googlesitekit.AdminbarModules","googlesitekit.SearchConsole",q)}]);
dist/assets/js/chunk-googlesitekit-adminbar.js CHANGED
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{208:function(e,t,n){"use strict";n.r(t);var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),r=n.n(c),s=n(6),d=n.n(s),m=n(13),u=n.n(m),g=n(7),k=n.n(g),_=n(1),p=n(14),b=n(2),h=n(10),v=n(0),f=n(21),y=function(e){function t(){return a()(this,t),r()(this,d()(t).apply(this,arguments))}return k()(t,e),o()(t,[{key:"render",value:function(){return React.createElement(_.Fragment,null)}}]),t}(_.Component),j=Object(f.a)("googlesitekit.AdminbarModules")(y);n.d(t,"GoogleSitekitAdminbar",(function(){return O})),n.d(t,"init",(function(){return E}));var O=function(e){function t(e){var n;return a()(this,t),n=r()(this,d()(t).call(this,e)),Object(v.setLocaleData)(googlesitekit.locale,"google-site-kit"),n.handleMoreDetailsLink=n.handleMoreDetailsLink.bind(u()(n)),n}return k()(t,e),o()(t,[{key:"handleMoreDetailsLink",value:function(){var e=googlesitekit,t=e.permaLink,n=e.postID,i=e.postType,a=e.pageTitle,l=Object(b.n)("googlesitekit-dashboard",{permaLink:t,id:n,postType:i,pageTitle:a});Object(b.v)("admin_bar","post_details_click"),document.location=l}},{key:"render",value:function(){var e=googlesitekit,t=e.pageTitle,n=e.permaLink;return React.createElement(_.Fragment,null,React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-3 mdc-layout-grid__cell--align-middle "},React.createElement("div",{className:"googlesitekit-adminbar__subtitle"},Object(v.__)("Stats for","google-site-kit")),React.createElement("div",{className:"googlesitekit-adminbar__title"},t?Object(b.e)(t):n)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-7-desktop mdc-layout-grid__cell--align-middle "},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(j,null))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2 mdc-layout-grid__cell--align-middle "},React.createElement(p.a,{className:"googlesitekit-adminbar__link",href:"#",onClick:this.handleMoreDetailsLink},Object(v.__)("More details","google-site-kit"))))),React.createElement(p.a,{className:"googlesitekit-adminbar__link googlesitekit-adminbar__link--mobile",href:"#",onClick:this.handleMoreDetailsLink},Object(v.__)("More details","google-site-kit")))}}]),t}(_.Component);function E(){null!==document.getElementById("js-googlesitekit-adminbar-modules")&&(Object(_.render)(React.createElement(O,null),document.getElementById("js-googlesitekit-adminbar-modules")),Object(h.doAction)("googlesitekit.moduleLoaded","Adminbar"))}},21:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),r=n.n(c),s=n(6),d=n.n(s),m=n(7),u=n.n(m),g=n(1),k=n(11),_=n(10),p=n(59),b=16;function h(e){return Object(p.createHigherOrderComponent)((function(t){var n,i="core/with-filters/"+e;var l=function(l){function c(){var i;return a()(this,c),i=r()(this,d()(c).apply(this,arguments)),void 0===n&&(n=Object(_.applyFilters)(e,t)),i}return u()(c,l),o()(c,[{key:"componentDidMount",value:function(){c.instances.push(this),1===c.instances.length&&(Object(_.addAction)("hookRemoved",i,s),Object(_.addAction)("hookAdded",i,s))}},{key:"componentWillUnmount",value:function(){c.instances=Object(k.without)(c.instances,this),0===c.instances.length&&(Object(_.removeAction)("hookRemoved",i),Object(_.removeAction)("hookAdded",i))}},{key:"render",value:function(){return React.createElement(n,this.props)}}]),c}(g.Component);l.instances=[];var c=Object(k.debounce)((function(){n=Object(_.applyFilters)(e,t),l.instances.forEach((function(e){e.forceUpdate()}))}),b);function s(t){t===e&&c()}return l}),"withFilters")}}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{105:function(e,t,n){"use strict";n.r(t),t.default=[/google_ad_client: ?["|'](.*?)["|']/,/<(?:script|amp-auto-ads) [^>]*data-ad-client="([^"]+)"/]},106:function(e,t,n){"use strict";n.r(t),t.default=[/<script [^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtag\/js\?id=(UA-.*?)['|"][^>]*><\/script>/,/<script[^>]*>[^<]+google-analytics\.com\/analytics\.js[^<]+(UA-\d+-\d+)/,/__gaTracker\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/,/ga\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/,/_gaq.push\( ?\[ ?['|"]_setAccount['|"], ?['|"](UA-.*?)['|"] ?] ?\)/,/<amp-analytics [^>]*type="gtag"[^>]*>[^<]*<script type="application\/json">[^<]*"gtag_id":\s*"(UA-[^"]+)"/,/<amp-analytics [^>]*type="googleanalytics"[^>]*>[^<]*<script type="application\/json">[^<]*"account":\s*"(UA-[^"]+)"/]},107:function(e,t,n){"use strict";n.r(t),t.default=[/<script[^>]*>[^>]+?www.googletagmanager.com\/gtm[^>]+?['|"](GTM-[0-9A-Z]+)['|"]/,/<script[^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtm\.js\?id=(GTM-[0-9A-Z]+)['|"]/,/<script[^>]*src=['|"]https:\/\/www.googletagmanager.com\/ns.html\?id=(GTM-[0-9A-Z]+)['|"]/,/<amp-analytics [^>]*config=['|"]https:\/\/www.googletagmanager.com\/amp.json\?id=(GTM-[0-9A-Z]+)['|"]/]},14:function(e,t,n){"use strict";var a=n(3),i=n.n(a),r=n(4),o=n.n(r),c=n(5),s=n.n(c),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.dangerouslySetInnerHTML,n=e.onClick,a=e.href,i=e.children,r=e.className,o=e.arrow,c=e.external,s=e.inverse,l=e.back,u=e.small,d=e.inherit,g=e.caps,m=e.danger,p=e.disabled,h=e.id,f=a&&!p,b=f?"a":"button";return React.createElement(b,{className:"\n\t\t\t\t\tgooglesitekit-cta-link\n\t\t\t\t\t".concat(r||"","\n\t\t\t\t\t").concat(o?"googlesitekit-cta-link--arrow":"","\n\t\t\t\t\t").concat(c?"googlesitekit-cta-link--external":"","\n\t\t\t\t\t").concat(s?"googlesitekit-cta-link--inverse":"","\n\t\t\t\t\t").concat(l?"googlesitekit-cta-link--back":"","\n\t\t\t\t\t").concat(u?"googlesitekit-cta-link--small":"","\n\t\t\t\t\t").concat(d?"googlesitekit-cta-link--inherit":"","\n\t\t\t\t\t").concat(g?"googlesitekit-cta-link--caps":"","\n\t\t\t\t\t").concat(m?"googlesitekit-cta-link--danger":"","\n\t\t\t\t\t").concat(p?"googlesitekit-cta-link--disabled":"","\n\t\t\t\t"),onClick:n,id:h,href:f?a:void 0,target:f&&c?"_blank":void 0,rel:c?"noopener noreferrer":void 0,disabled:p,dangerouslySetInnerHTML:t},i)}}]),t}(m.Component);f.propTypes={dangerouslySetInnerHTML:h.a.shape({__html:h.a.string}),onClick:h.a.func,href:h.a.string,children:h.a.oneOfType([h.a.string.isRequired,h.a.array.isRequired]),className:h.a.string,arrow:h.a.bool,external:h.a.bool,inverse:h.a.bool,back:h.a.bool,small:h.a.bool,inherit:h.a.bool,caps:h.a.bool,danger:h.a.bool,disabled:h.a.bool},f.defaultProps={dangerouslySetInnerHTML:void 0,onClick:null,href:"",className:"",arrow:!1,external:!1,inverse:!1,back:!1,small:!1,inherit:!1,caps:!1,danger:!1,disabled:!1},t.a=f},2:function(e,t,n){"use strict";var a,i=n(51),r=n.n(i),o=n(72),c=n.n(o),s=n(23),l=n.n(s),u=n(11),d=n.n(u),g=(n(1),n(12)),m=n(9),p=n(20),h=n(18),f=n.n(h),b=n(33),v=n.n(b),k=n(10),y=n(0),_=n(32),w=n(105),O=n(106),j=n(107),E=n(50),R=n(3),N=n.n(R),C=n(4),x=n.n(C),D=function(e){var t=window[e];if(!t)return!1;try{var n="__storage_test__";return t.setItem(n,n),t.removeItem(n),!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}},A=function(){function e(){N()(this,e)}return x()(e,[{key:"key",value:function(){return null}},{key:"getItem",value:function(){return null}},{key:"setItem",value:function(){}},{key:"removeItem",value:function(){}},{key:"clear",value:function(){}},{key:"length",get:function(){return 0}}]),e}(),S=function(){return a||(a=D("sessionStorage")?window.sessionStorage:D("localStorage")?window.localStorage:new A),a};function M(){Object(y.setLocaleData)(googlesitekit.locale,"google-site-kit")}function P(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(n,!0).forEach((function(t){l()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.d(t,"t",(function(){return T})),n.d(t,"r",(function(){return L})),n.d(t,"o",(function(){return U})),n.d(t,"s",(function(){return F})),n.d(t,"i",(function(){return q})),n.d(t,"b",(function(){return G})),n.d(t,"e",(function(){return K})),n.d(t,"u",(function(){return H})),n.d(t,"l",(function(){return z})),n.d(t,"f",(function(){return Q})),n.d(t,"m",(function(){return B})),n.d(t,"z",(function(){return J})),n.d(t,"A",(function(){return W})),n.d(t,"j",(function(){return Z})),n.d(t,"a",(function(){return $})),n.d(t,"y",(function(){return X})),n.d(t,"w",(function(){return ee})),n.d(t,"d",(function(){return te})),n.d(t,"h",(function(){return ae})),n.d(t,"g",(function(){return ie})),n.d(t,"q",(function(){return re})),n.d(t,"x",(function(){return oe})),n.d(t,"c",(function(){return E.b})),n.d(t,"k",(function(){return E.c})),n.d(t,"v",(function(){return E.d})),n.d(t,"n",(function(){return S})),n.d(t,"p",(function(){return M}));var T=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t=Object(g.isUndefined)(e)?0:1e6<e?(e/=1e6).toFixed(1)+"M":1e3<e?99<(e/=1e3)?Math.round(e)+"K":e.toFixed(1)+"K":e,(Object(g.isNull)(e)||Object(g.isUndefined)(e)||isNaN(e))&&(t="",e=0),0===e)return t="0.00",n?new Intl.NumberFormat(navigator.language,{style:"currency",currency:n}).format(e):e;if(!1!==n&&""!==t){var a=new Intl.NumberFormat(navigator.language,{style:"currency",currency:n}).formatToParts(e),i=a.find((function(e){return"decimal"===e.type}));!Object(g.isUndefined)(i)&&!Object(g.isUndefined)(i.value)&&1e3>e&&(t=Number.isInteger(e)?e:e.replace(".",i.value));var r=a.find((function(e){return"currency"===e.type})),o=r?r.value:"";return"".concat(o).concat(t)}return t.toString()},L=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t||(t=navigator.language),t=t.replace("_","-").toLocaleLowerCase(),new Intl.NumberFormat(t).format(e)},U=function(e){switch(e){case"minute":return 60;case"hour":return 3600;case"day":return 86400;case"week":return 604800;case"month":return 2592e3;case"year":return 31536e3}},F=function(e){if(e=parseInt(e,10),isNaN(e)||0===e)return"0.0s";var t={};return t.hours=Math.floor(e/60/60),t.minutes=Math.floor(e/60%60),t.seconds=Math.floor(e%60),((t.hours?t.hours+"h ":"")+(t.minutes?t.minutes+"m ":"")+(t.seconds?t.seconds+"s ":"")).trim()},q=function(e,t){var n=1e3*U("day"),a=e.getTime(),i=t.getTime();return Math.round(Math.abs(a-i)/n)},G=function(e,t){if("0"===e||0===e||isNaN(e))return"";var n=((t-e)/e*100).toFixed(1);return isNaN(n)||"Infinity"===n?"":n},K=function(e,t){return Object(g.map)(e,(function(e,n){return[e[0],e[t]||(0===n?"":0)]}))},H=function(){var e,t;return d.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,d.a.awrap(m.c.get(m.a,"user","authentication"));case 3:e=n.sent,t=e.grantedScopes.filter((function(t){return-1!==e.requiredScopes.indexOf(t)})),window.googlesitekit.setup=window.googlesitekit.setup||{},window.googlesitekit.setup.isAuthenticated=e.isAuthenticated,window.googlesitekit.setup.requiredScopes=e.requiredScopes,window.googlesitekit.setup.grantedScopes=e.grantedScopes,window.googlesitekit.setup.needReauthenticate=t.length<e.requiredScopes.length,n.next=14;break;case 12:n.prev=12,n.t0=n.catch(0);case 14:case"end":return n.stop()}}),null,null,[[0,12]])},z=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:googlesitekit,a=n.admin,i=a.connectURL,r=a.adminRoot,o=n.setup.needReauthenticate,c=n.modules[e].screenID,s="pagespeed-insights"===e?{notification:"authentication_success",reAuth:void 0}:{},l=Object(_.addQueryArgs)(r,I({page:e&&t&&c?c:"googlesitekit-dashboard",slug:e,reAuth:t},s));if(!o)return l;var u=encodeURIComponent(Object(_.getQueryString)(l));return l=r+"?"+u,Object(_.addQueryArgs)(i,{redirect:l,status:t})},Q=function(e,t){return function(n){return function(a){return f.a.createElement(e,c()({},a,t,{OriginalComponent:n}))}}},B=function(e,t){var n=googlesitekit.admin.adminRoot;return e||(e="googlesitekit-dashboard"),t=I({page:e},t),Object(_.addQueryArgs)(n,t)},J=function(e){try{return JSON.parse(e)&&!!e}catch(e){return!1}},W=function(e){return e.match(/^GTM-[a-zA-Z\d]{7}#x2F;)},Z=function(e){var t,n,a,i,r;return d.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return t=googlesitekit.admin,n=t.homeURL,a=t.ampMode,i={tagverify:1,timestamp:Date.now()},o.next=4,d.a.awrap(V(Object(_.addQueryArgs)(n,i),e));case 4:if((r=o.sent)||"secondary"!==a){o.next=9;break}return o.next=8,d.a.awrap(v()({path:"/wp/v2/posts?per_page=1"}).then((function(t){return t.slice(0,1).map((function(t){return d.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,d.a.awrap(V(Object(_.addQueryArgs)(t.link,I({},i,{amp:1})),e));case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}))})).pop()})));case 8:r=o.sent;case 9:return o.abrupt("return",Promise.resolve(r||null));case 10:case"end":return o.stop()}}))},V=function(e,t){var n;return d.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,d.a.awrap(fetch(e,{credentials:"omit"}).then((function(e){return e.text()})));case 3:return n=a.sent,a.abrupt("return",Y(n,t)||null);case 7:return a.prev=7,a.t0=a.catch(0),a.abrupt("return",null);case 10:case"end":return a.stop()}}),null,null,[[0,7]])},Y=function(e,t){var n=({adsense:w.default,analytics:O.default,tagmanager:j.default}[t]||[]).find((function(t){return t.test(e)}));return!!n&&n.exec(e)[1]},$=function(e,t,n){return e.setModuleActive(t,n).then((function(e){return window.googlesitekit.modules&&window.googlesitekit.modules[t]&&(window.googlesitekit.modules[t].active=e.active),Object(E.d)("".concat(t,"_setup"),e.active?"module_activate":"module_deactivate",t),new Promise((function(t){t(e)}))}))},X=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:googlesitekit,r=i.modules[e],o=r.settings,c=r.setupComplete,s=a||document.getElementById("confirm-changes-".concat(e));if(c&&s){var l=!!Object.keys(t).find((function(e){var a=t[e];return!Object(g.isEqual)(n[e],o[a])}));return a||(s.disabled=!l),l}},ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(k.addFilter)("googlesitekit.ErrorNotification","googlesitekit.ErrorNotification",Q(e,t),1)},te=function(e){if(!e)return"";var t=e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)})).replace(/(\\)/g,"");return Object(g.unescape)(t)};function ne(){return Object(k.applyFilters)("googlesitekit.dateRange",Object(y.__)("Last 28 days","google-site-kit"))}function ae(){return ne().replace("Last ","")}function ie(){return e=ne(),Object(g.toLower)(Object(g.deburr)(Object(g.trim)(e.replace(/[\s./_]+/g,"-"),"-")));var e}function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"33",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"33",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(googlesitekit){var r=f.a.createElement(p.a,{id:e,width:n,height:a,className:i});return t?r=f.a.createElement(p.a,{id:"".concat(e,"-disabled"),width:n,height:a,className:i}):"pagespeed-insights"===e&&(r=f.a.createElement("img",{src:googlesitekit.admin.assetsRoot+"images/icon-pagespeed.png",width:n,alt:"",className:i})),r}}function oe(e){var t={};return Object.keys(e).sort().forEach((function(n){var a=e[n];a&&"object"===r()(a)&&!Array.isArray(a)&&(a=oe(a)),t[n]=a})),t}},20:function(e,t,n){"use strict";n(1);var a=n(8),i=n.n(a),r=function(e){var t=e.id,n=e.className,a=e.height,i=e.width,r="".concat(googlesitekit.admin.assetsRoot,"svg/svg.svg");return React.createElement("svg",{className:"svg".concat(" ",n),height:a,width:i},React.createElement("use",{xlinkHref:"".concat(r,"#").concat(t)}))};r.propTypes={id:i.a.string.isRequired,className:i.a.string,height:i.a.string,width:i.a.string},r.defaultProps={className:"",height:20,width:20},t.a=r},21:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var a=n(3),i=n.n(a),r=n(4),o=n.n(r),c=n(5),s=n.n(c),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(12),h=n(10),f=n(54),b=16;function v(e){return Object(f.createHigherOrderComponent)((function(t){var n,a="core/with-filters/"+e;var r=function(r){function c(){var a;return i()(this,c),a=s()(this,u()(c).apply(this,arguments)),void 0===n&&(n=Object(h.applyFilters)(e,t)),a}return g()(c,r),o()(c,[{key:"componentDidMount",value:function(){c.instances.push(this),1===c.instances.length&&(Object(h.addAction)("hookRemoved",a,l),Object(h.addAction)("hookAdded",a,l))}},{key:"componentWillUnmount",value:function(){c.instances=Object(p.without)(c.instances,this),0===c.instances.length&&(Object(h.removeAction)("hookRemoved",a),Object(h.removeAction)("hookAdded",a))}},{key:"render",value:function(){return React.createElement(n,this.props)}}]),c}(m.Component);r.instances=[];var c=Object(p.debounce)((function(){n=Object(h.applyFilters)(e,t),r.instances.forEach((function(e){e.forceUpdate()}))}),b);function l(t){t===e&&c()}return r}),"withFilters")}},216:function(e,t,n){"use strict";n.r(t);var a=n(3),i=n.n(a),r=n(4),o=n.n(r),c=n(5),s=n.n(c),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(14),b=n(2),v=n(10),k=n(0),y=n(21),_=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return p()(t,e),o()(t,[{key:"render",value:function(){return React.createElement(h.Fragment,null)}}]),t}(h.Component),w=Object(y.a)("googlesitekit.AdminbarModules")(_);n.d(t,"GoogleSitekitAdminbar",(function(){return O})),n.d(t,"init",(function(){return j}));var O=function(e){function t(e){var n;return i()(this,t),(n=s()(this,u()(t).call(this,e))).handleMoreDetailsLink=n.handleMoreDetailsLink.bind(g()(n)),n}return p()(t,e),o()(t,[{key:"handleMoreDetailsLink",value:function(){var e=googlesitekit,t=e.permaLink,n=e.postID,a=e.postType,i=e.pageTitle,r=Object(b.m)("googlesitekit-dashboard",{permaLink:t,id:n,postType:a,pageTitle:i});Object(b.v)("admin_bar","post_details_click"),document.location=r}},{key:"render",value:function(){var e=googlesitekit,t=e.pageTitle,n=e.permaLink;return React.createElement(h.Fragment,null,React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-3 mdc-layout-grid__cell--align-middle "},React.createElement("div",{className:"googlesitekit-adminbar__subtitle"},Object(k.__)("Stats for","google-site-kit")),React.createElement("div",{className:"googlesitekit-adminbar__title"},t?Object(b.d)(t):n)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-7-desktop mdc-layout-grid__cell--align-middle "},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(w,null))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2 mdc-layout-grid__cell--align-middle "},React.createElement(f.a,{className:"googlesitekit-adminbar__link",href:"#",onClick:this.handleMoreDetailsLink},Object(k.__)("More details","google-site-kit"))))),React.createElement(f.a,{className:"googlesitekit-adminbar__link googlesitekit-adminbar__link--mobile",href:"#",onClick:this.handleMoreDetailsLink},Object(k.__)("More details","google-site-kit")))}}]),t}(h.Component);function j(){var e=document.getElementById("js-googlesitekit-adminbar-modules");e&&(Object(b.p)(),Object(h.render)(React.createElement(O,null),e),Object(v.doAction)("googlesitekit.moduleLoaded","Adminbar"))}},22:function(e,t,n){"use strict";var a=n(86),i=n.n(a);n.d(t,"l",(function(){return i.a})),n.d(t,"a",(function(){return a.HelperText})),n.d(t,"b",(function(){return a.Input}));var r=n(154);n.d(t,"h",(function(){return r.a}));var o=n(160);n.d(t,"e",(function(){return o.a}));var c=n(159);n.d(t,"g",(function(){return c.a}));var s=n(104),l=n.n(s);n.d(t,"k",(function(){return l.a})),n.d(t,"j",(function(){return s.Option}));var u=n(161);n.d(t,"i",(function(){return u.a}));var d=n(158);n.d(t,"d",(function(){return d.a}));var g=n(157);n.d(t,"c",(function(){return g.a}));var m=n(156);n.d(t,"f",(function(){return m.a}))},26:function(e,t,n){"use strict";var a=n(3),i=n.n(a),r=n(4),o=n.n(r),c=n(5),s=n.n(c),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(8),b=n.n(f),v=n(9),k=n(27),y=n(28);var _=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#F9BB2D",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"warning-title warning-desc"},React.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),React.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))},w=n(93),O=n(14),j=n(20),E=n(12),R=function(e){function t(e){var n;return i()(this,t),(n=s()(this,u()(t).call(this,e))).state={isClosed:!1},n.cardRef=Object(h.createRef)(),n.handleDismiss=n.handleDismiss.bind(g()(n)),0<n.props.dismissExpires&&n.expireDismiss(),n.props.showOnce&&v.c.setCache("notification::displayed::".concat(n.props.id),new Date),n}return p()(t,e),o()(t,[{key:"handleDismiss",value:function(e){var t=this,n=this.state.isClosed,a=this.cardRef.current;e.preventDefault(),this.setState({isClosed:!n}),setTimeout((function(){v.c.setCache("notification::dismissed::".concat(t.props.id),new Date),a.style.display="none";var e=new Event("notificationDismissed");document.dispatchEvent(e)}),350)}},{key:"expireDismiss",value:function(){var e=this.props,t=e.id,n=e.dismissExpires,a=v.c.getCache("notification::dismissed::".concat(t));if(a){var i=new Date(a);i.setSeconds(i.getSeconds()+parseInt(n,10)),i<new Date&&v.c.deleteCache("notification::dismissed::".concat(t))}}},{key:"render",value:function(){var e=this.state.isClosed,t=this.props,n=t.children,a=t.id,i=t.title,r=t.description,o=t.blockData,c=t.winImage,s=t.smallImage,l=t.format,u=t.learnMoreURL,d=t.learnMoreDescription,g=t.learnMoreLabel,m=t.ctaLink,p=t.ctaLabel,f=t.ctaTarget,b=t.type,R=t.dismiss,N=t.isDismissable,C=t.logo,x=t.module,D=t.moduleName,A=t.pageIndex;if(v.c.getCache("notification::dismissed::".concat(a)))return null;var S,M=e?"is-closed":"is-open",P="large"===l&&"win-stats-increase"===b,I="mdc-layout-grid__cell--span-12";"large"===l?(I="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-6-tablet mdc-layout-grid__cell--span-8-desktop ",P&&(I="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-5-tablet mdc-layout-grid__cell--span-8-desktop ")):"small"===l&&(I="mdc-layout-grid__cell--span-11-desktop mdc-layout-grid__cell--span-7-tablet mdc-layout-grid__cell--span-3-phone"),S="win-warning"===b?React.createElement(_,null):"win-error"===b?React.createElement(w.a,null):"";var T=React.createElement(h.Fragment,null,o&&React.createElement("div",{className:"mdc-layout-grid__inner"},Object(E.map)(o,(function(e,t){return React.createElement("div",{key:t,className:"mdc-layout-grid__cell ".concat(P?"mdc-layout-grid__cell--span-5-desktop":"mdc-layout-grid__cell--span-4-desktop")},React.createElement("div",{className:"googlesitekit-publisher-win__stats"},React.createElement(k.a,e)))})))),L=React.createElement(h.Fragment,null,React.createElement("h3",{className:"googlesitekit-heading-2 googlesitekit-publisher-win__title"},i),r&&React.createElement("div",{className:"googlesitekit-publisher-win__desc"},React.createElement("p",null,r,g&&React.createElement(h.Fragment,null," ",React.createElement(O.a,{href:u,external:!0,inherit:!0},g),d),A&&React.createElement("span",{className:"googlesitekit-publisher-win__detect"},A))),n),U=x?React.createElement(j.a,{id:x,height:"19",width:"19"}):React.createElement(j.a,{id:"logo-g",height:"34",width:"32"});return React.createElement("section",{ref:this.cardRef,className:"\n\t\t\t\tgooglesitekit-publisher-win\n\t\t\t\t".concat(l?"googlesitekit-publisher-win--".concat(l):"","\n\t\t\t\t").concat(b?"googlesitekit-publisher-win--".concat(b):"","\n\t\t\t\t").concat(M?"googlesitekit-publisher-win--".concat(M):"","\n\t\t\t")},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},C&&React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12 ".concat(P?"mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet":"")},React.createElement("div",{className:"googlesitekit-publisher-win__logo"},U),D&&React.createElement("div",{className:"googlesitekit-publisher-win__module-name"},D)),s&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},React.createElement("img",{className:"googlesitekit-publisher-win__small-image",alt:"",src:s})),React.createElement("div",{className:"mdc-layout-grid__cell ".concat(I)},P?React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-5-desktop mdc-layout-grid__cell--span-8-tablet"},L),React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-7-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--align-bottom"},T)):React.createElement(h.Fragment,null,L,T),m&&React.createElement(y.a,{href:m,target:f},p),N&&R&&React.createElement(O.a,{onClick:this.handleDismiss},R)),c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--order-1-phone mdc-layout-grid__cell--order-2-tablet mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},React.createElement("div",{className:"googlesitekit-publisher-win__image-large"},React.createElement("img",{alt:"",src:c}))),("win-error"===b||"win-warning"===b)&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},React.createElement("div",{className:"googlesitekit-publisher-win__icons"},S)))))}}]),t}(h.Component);R.propTypes={id:b.a.string.isRequired,title:b.a.string.isRequired,description:b.a.string,learnMoreURL:b.a.string,learnMoreDescription:b.a.string,learnMoreLabel:b.a.string,blockData:b.a.array,winImage:b.a.string,smallImage:b.a.string,format:b.a.string,ctaLink:b.a.string,ctaLabel:b.a.string,type:b.a.string,dismiss:b.a.string,isDismissable:b.a.bool,logo:b.a.bool,module:b.a.string,moduleName:b.a.string,pageIndex:b.a.string,dismissExpires:b.a.number,showOnce:b.a.bool},R.defaultProps={isDismissable:!0,dismissExpires:0,showOnce:!1};t.a=R},27:function(e,t,n){"use strict";var a=n(3),i=n.n(a),r=n(4),o=n.n(r),c=n(5),s=n.n(c),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(8),b=n.n(f),v=n(62),k=n(20),y=function(e){function t(e){var n;return i()(this,t),(n=s()(this,u()(t).call(this,e))).handleClick=n.handleClick.bind(g()(n)),n.handleKeyPress=n.handleKeyPress.bind(g()(n)),n}return p()(t,e),o()(t,[{key:"handleClick",value:function(){var e=this.props,t=e.stat;(0,e.handleStatSelection)(t)}},{key:"handleKeyPress",value:function(e){e.preventDefault();var t=this.props,n=t.stat,a=t.handleStatSelection;"Enter"!==e.key&&" "!==e.key||a(n)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.title,a=e.datapoint,i=e.datapointUnit,r=e.change,o=e.changeDataUnit,c=e.context,s=e.period,l=e.selected,u=e.handleStatSelection,d=e.source,g=e.sparkline,m=e.reverseArrowDirection,p="button"===c?"button":"",f=0<=r?"-positive":"-negative";return React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-data-block\n\t\t\t\t\tgooglesitekit-data-block--".concat(c,"\n\t\t\t\t\t").concat(l?"googlesitekit-data-block--selected":"","\n\t\t\t\t\t").concat(t,"\n\t\t\t\t"),tabIndex:"button"===c?"0":"-1",role:u&&p,onClick:u&&this.handleClick,onKeyPress:u&&this.handleKeyPress,"aria-label":u&&n,"aria-pressed":u&&l},React.createElement("div",{className:"googlesitekit-data-block__title-datapoint-wrapper"},React.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-data-block__title "},n),React.createElement("div",{className:"googlesitekit-data-block__datapoint"},"".concat(a).concat(i))),g&&React.createElement("div",{className:"googlesitekit-data-block__sparkline"},g),React.createElement("div",{className:"googlesitekit-data-block__change-source-wrapper"},React.createElement("div",{className:"\n\t\t\t\t\t\tgooglesitekit-data-block__change\n\t\t\t\t\t\tgooglesitekit-data-block__change--".concat(0<=r?"positive":"negative","\n\t\t\t\t\t")},""===r&&React.createElement(h.Fragment,null," "),r&&[React.createElement("span",{key:"arrow",className:"googlesitekit-data-block__arrow ".concat(m?"googlesitekit-data-block__arrow--reverse":"")},React.createElement(k.a,{id:"arrow".concat(f),height:"9",width:"9"})),React.createElement("span",{key:"values",className:"googlesitekit-data-block__value"},"".concat(Math.abs(r)).concat(o," ").concat(s))]),d&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:d.name,href:d.link})))}}]),t}(h.Component);y.propTypes={stat:b.a.number,onClick:b.a.func,className:b.a.string,title:b.a.string,datapoint:b.a.oneOfType([b.a.string,b.a.number]),datapointUnit:b.a.string,change:b.a.oneOfType([b.a.string,b.a.number]),changeDataUnit:b.a.string,context:b.a.string,period:b.a.string,selected:b.a.bool,handleStatSelection:b.a.func,reverseArrowDirection:b.a.bool},y.defaultProps={stat:null,onClick:null,className:"",title:"",datapoint:null,datapointUnit:"",change:null,changeDataUnit:"",context:"default",period:"",selected:!1,handleStatSelection:null,reverseArrowDirection:!1},t.a=y},28:function(e,t,n){"use strict";var a=n(3),i=n.n(a),r=n(4),o=n.n(r),c=n(5),s=n.n(c),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(22),h=n(8),f=n.n(h),b=function(e){function t(e){var n;return i()(this,t),(n=s()(this,u()(t).call(this,e))).buttonRef=Object(m.createRef)(),n}return g()(t,e),o()(t,[{key:"componentDidMount",value:function(){new p.h(this.buttonRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.children,a=e.href,i=e.text,r=e.className,o=e.danger,c=e.disabled,s=e.target,l=e.id,u=e.icon,d=e.trailingIcon,g=e.ariaHaspopup,m=e.ariaExpanded,p=e.ariaControls,h=a?"a":"button";return React.createElement(h,{className:"\n\t\t\t\t\tmdc-button\n\t\t\t\t\t".concat(!i&&"mdc-button--raised","\n\t\t\t\t\t").concat(r&&r,"\n\t\t\t\t\t").concat(o?"mdc-button--danger":"","\n\t\t\t\t"),onClick:t,href:a,ref:this.buttonRef,disabled:c?"disabled":"",target:s||"_self",id:l,"aria-haspopup":g,"aria-expanded":m,"aria-controls":p},u&&u,React.createElement("span",{className:"mdc-button__label"},n),d&&d)}}]),t}(m.Component);b.propTypes={onClick:f.a.func,children:f.a.string.isRequired,href:f.a.string,text:f.a.bool,className:f.a.string,danger:f.a.bool,disabled:f.a.bool,icon:f.a.element,trailingIcon:f.a.element,ariaHaspopup:f.a.string,ariaExpanded:f.a.bool,ariaControls:f.a.string},b.defaultProps={onClick:null,href:null,text:!1,className:"",danger:!1,disabled:!1,icon:null,trailingIcon:null,ariaHaspopup:"",ariaExpanded:!1,ariaControls:""},t.a=b},62:function(e,t,n){"use strict";var a=n(3),i=n.n(a),r=n(4),o=n.n(r),c=n(5),s=n.n(c),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=n(0),v=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return g()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.name,n=e.href,a=e.className,i=e.external;return React.createElement("div",{className:"googlesitekit-source-link ".concat(a)},[Object(b.__)("Source:","google-site-kit")," ",React.createElement(f.a,{key:"link",href:n,external:i,inherit:!0},t)])}}]),t}(m.Component);v.propTypes={name:h.a.string,href:h.a.string,className:h.a.string,external:h.a.bool},v.defaultProps={name:"",href:"",className:"",external:!1},t.a=v},88:function(e,t,n){"use strict";n(1);var a=n(26),i=n(0);t.a=function(){var e=googlesitekit.admin.connectURL;return React.createElement(a.a,{id:"authentication error",title:Object(i.__)("Issue accessing data","google-site-kit"),description:Object(i.__)("You need to reauthenticate your Google account.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0,ctaLink:e,ctaLabel:Object(i.__)("Click here","google-site-kit")})}},9:function(e,t,n){"use strict";var a=n(11),i=n.n(a),r=n(23),o=n.n(r),c=n(51),s=n.n(c),l=n(88),u=(n(1),n(26)),d=n(0),g=function(){return React.createElement(u.a,{id:"permission error",title:Object(d.__)("Permissions issue accessing data","google-site-kit"),description:Object(d.__)("This account does not have access to the requested data.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0})},m=n(94),p=n.n(m),h=n(2),f=n(12),b=n(33),v=n.n(b),k=n(32),y=n(10);function _(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(n,!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.d(t,"a",(function(){return O})),n.d(t,"b",(function(){return j}));var O="core",j="modules",E=function(){googlesitekit.admin=googlesitekit.admin||{},"string"==typeof googlesitekit.admin.datacache&&(googlesitekit.admin.datacache=JSON.parse(googlesitekit.admin.datacache)),"object"!==s()(googlesitekit.admin.datacache)&&(googlesitekit.admin.datacache={})},R=function(e,t){var n=w({data:{}},e);return n.data=w({dateRange:t},n.data),n},N={maxRequests:10,init:function(){googlesitekit.initialized||(googlesitekit.initialized=!0,this.collectModuleData=this.collectModuleData.bind(this),googlesitekit.cache=[],Object(y.addAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingData",this.collectModuleData))},combinedGetFromCache:function(e){var t=this;return new Promise((function(n,a){try{var i=[],r=Object(h.g)();Object(f.each)(e,(function(e){var n=R(e,r);n.key=t.getCacheKey(n.type,n.identifier,n.datapoint,n.data);var a=t.getCache(n.key,n.maxAge);void 0!==a&&(i[n.key]=a,t.resolve(n,a))})),n(i)}catch(e){a()}}))},combinedGet:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=[],i=25,r=Object(h.g)();Object(f.each)(e,(function(e){var n=R(e,r);n.key=t.getCacheKey(n.type,n.identifier,n.datapoint,n.data);var o=t.getCache(n.key,n.maxAge);void 0!==o?(setTimeout((function(){t.resolve(n,o)}),i),i+=25):a.push(n)})),a=Object(f.sortBy)(a,"priority");var o=[],c=[],s={},l=!!a.find((function(e){return e.priority<10}));Object(f.each)(a,(function(e,t){!n&&10<=e.priority&&l?c.push(e):s[e.key]?s[e.key].push(t):(s[e.key]=[t],o.push(e))}));var u=10,d=o.slice(0,u),g=o.slice(u);if(g=g.concat(c),0!==d.length||0!==g.length){0<g.length&&0<this.maxRequests--?setTimeout((function(){t.combinedGet(g,!0)}),50):this.maxRequests=10;var m=null!==Object(h.k)("datacache");return v()({path:Object(k.addQueryArgs)("/google-site-kit/v1/data/",{datacache:m||void 0}),data:{request:d},method:"POST"}).then((function(e){Object(f.each)(e,(function(e,n){s[n]?(t.handleWPError(e),Object(f.each)(s[n],(function(n){var i=a[n];t.setCache(i.key,e),t.resolve(i,e)})),0===g.length&&Object(y.doAction)("googlesitekit.dataLoaded","api")):console.error("data_error","unknown response key "+n)}))})).catch((function(e){console.warn("Error caught during combinedGet",e)}))}Object(y.doAction)("googlesitekit.dataLoaded","cache")},handleWPError:function(e){var t=["code","data","message"],n=Object(f.intersection)(t,Object.keys(e));if(Object(f.isEqual)(t,n)){console.warn("WP Error in data response",e);var a=e.data;if(a.reason){var i=0;["authError","insufficientPermissions"].includes(a.reason)&&(Object(y.addFilter)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",Object(h.f)(l.a),1),i++),"forbidden"===a.reason&&(Object(y.addFilter)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",Object(h.f)(g),1),i++),i&&Object(y.addFilter)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease",(function(e){return Object(y.removeFilter)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease"),e+i}))}}},resolve:function(e,t){e&&"function"==typeof e.callback&&e.callback(t,e.datapoint)},setCache:function(e,t){if(void 0!==t&&(!t||"object"!==s()(t)||!t.error&&!t.errors)){E(),googlesitekit.admin.datacache[e]=Object(f.cloneDeep)(t);var n={value:t,date:Date.now()/1e3};Object(h.n)().setItem("googlesitekit_"+e,JSON.stringify(n))}},getCache:function(e,t){if(!googlesitekit.admin.nojscache){if(E(),void 0!==googlesitekit.admin.datacache[e])return googlesitekit.admin.datacache[e];var n=JSON.parse(Object(h.n)().getItem("googlesitekit_"+e));return n&&"object"===s()(n)&&n.date&&(!t||Date.now()/1e3-n.date<t)?(googlesitekit.admin.datacache[e]=Object(f.cloneDeep)(n.value),Object(f.cloneDeep)(googlesitekit.admin.datacache[e])):void 0}},deleteCache:function(e){E(),delete googlesitekit.admin.datacache[e],Object(h.n)().removeItem("googlesitekit_"+e)},invalidateCacheGroup:function(e,t,n){var a=this.getCacheKey(e,t,n);E(),Object.keys(googlesitekit.admin.datacache).forEach((function(e){0!==e.indexOf(a+"::")&&e!==a||delete googlesitekit.admin.datacache[e]})),Object.keys(Object(h.n)()).forEach((function(e){0!==e.indexOf("googlesitekit_"+a+"::")&&e!=="googlesitekit_"+a||Object(h.n)().removeItem(e)}))},collectModuleData:function(e,t){var n=Object(y.applyFilters)("googlesitekit.module"+e+"DataRequest",[],t);0!==n.length&&this.combinedGet(n)},get:function(e,t,n){var a=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.getCacheKey(e,t,n,i);if(!r){var c=this.getCache(o,3600);if(void 0!==c)return new Promise((function(e){e(c)}))}return v()({path:Object(k.addQueryArgs)("/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),i)}).then((function(e){return r||a.setCache(o,e),Promise.resolve(e)})).catch((function(e){return a.handleWPError(e),Promise.reject(e)}))},getNotifications:function(e){var t,n,a,r=arguments;return i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(t=r.length>1&&void 0!==r[1]?r[1]:0,n=[],e){o.next=4;break}return o.abrupt("return",n);case 4:if(a=this.getCacheKey("modules",e,"notifications"),(n=N.getCache(a,t))&&0!==n.length){o.next=11;break}return o.next=9,i.a.awrap(v()({path:"/google-site-kit/v1/modules/".concat(e,"/notifications/")}));case 9:n=o.sent,N.setCache(a,n);case 11:return o.abrupt("return",n);case 12:case"end":return o.stop()}}),null,this)},set:function(e,t,n,a){var i={};return i.data=a,v()({path:"/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),data:i,method:"POST"}).then((function(a){return N.invalidateCacheGroup(e,t,n),new Promise((function(e){e(a)}))}))},getCacheKey:function(e,t,n){for(var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=[],r=[e,t,n],o=0,c=r;o<c.length;o++){var l=c[o];if(!l||!l.length)break;i.push(l)}return 3===i.length&&a&&"object"===s()(a)&&Object.keys(a).length&&i.push(p()(JSON.stringify(Object(h.x)(a)))),i.join("::")},setModuleActive:function(e,t){return v()({path:"/google-site-kit/v1/modules/".concat(e),data:{active:t},method:"POST"}).then((function(e){return new Promise((function(t){t(e)}))})).catch((function(e){return Promise.reject(e)}))}};N.init();t.c=N},93:function(e,t,n){"use strict";n(1);t.a=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#EA4336",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"error-title error-desc"},React.createElement("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3zM12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1zm1 4h-2v-2h2v2z"}))}}}]);
dist/assets/js/chunk-googlesitekit-setup-wizard-proxy.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{144:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),c=n.n(o),l=n(5),r=n.n(l),s=n(6),d=n.n(s),u=n(13),m=n.n(u),g=n(7),h=n.n(g),p=n(1),f=n(22),_=n(8),k=n.n(_),v=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).formFieldRef=Object(p.createRef)(),n.checkboxRef=Object(p.createRef)(),n}return h()(t,e),c()(t,[{key:"componentDidMount",value:function(){new f.e(this.formFieldRef.current).input=new f.c(this.checkboxRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onChange,n=e.id,a=e.name,i=e.value,o=e.checked,c=e.disabled,l=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-checkbox\n\t\t\t\t\t\t".concat(c?"mdc-checkbox--disabled":"","\n\t\t\t\t\t"),ref:this.checkboxRef},React.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:n,name:a,value:i,checked:o,disabled:c,onChange:t}),React.createElement("div",{className:"mdc-checkbox__background"},React.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},React.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),React.createElement("div",{className:"mdc-checkbox__mixedmark"}))),React.createElement("label",{htmlFor:n},l))}}]),t}(p.Component);v.propTypes={onChange:k.a.func.isRequired,id:k.a.string.isRequired,name:k.a.string.isRequired,value:k.a.string.isRequired,checked:k.a.bool,disabled:k.a.bool,children:k.a.node.isRequired},v.defaultProps={checked:!1,disabled:!1};var y=v,b=n(35),R=n.n(b),E=n(0),C=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).state={scriptOnPage:!!window.googlesitekitTrackingEnabled,optIn:!!window.googlesitekitTrackingEnabled,error:!1},n.handleOptIn=n.handleOptIn.bind(m()(n)),n}return h()(t,e),c()(t,[{key:"handleOptIn",value:function(e){var t=this,n=e.target.checked,a={googlesitekit_tracking_optin:n};R()({path:"/wp/v2/settings",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(a),method:"POST"}).then((function(){if(window.googlesitekitTrackingEnabled=!!n,n&&!t.state.scriptOnPage){var e=window.document;if(!e)return;e.body.insertAdjacentHTML("beforeend",'\n\t\t\t\t\t\t<script async src="https://www.googletagmanager.com/gtag/js?id='.concat(googlesitekit.admin.trackingID,'"><\/script>\n\t\t\t\t\t')),e.body.insertAdjacentHTML("beforeend","\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\t\t\tgtag('config', '".concat(googlesitekit.admin.trackingID,"');\n\t\t\t\t\t\t<\/script>\n\t\t\t\t\t"))}t.setState({optIn:!!n,error:!1,scriptOnPage:!0})})).catch((function(n){t.setState({optIn:!e.target.checked,error:{errorCode:n.code,errorMsg:n.message}})}))}},{key:"render",value:function(){var e=this.state,t=e.optIn,n=e.error,a=this.props,i=a.id,o=a.name;return React.createElement("div",{className:"googlesitekit-opt-in"},React.createElement(y,{id:i,name:o,value:"1",checked:t,onChange:this.handleOptIn},Object(E.__)("Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with ","google-site-kit"),React.createElement("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer"},Object(E.__)("Google Privacy Policy","google-site-kit")),"."),n&&React.createElement("div",{className:"googlesitekit-error-text"},n.errorMsg))}}]),t}(p.Component);C.propTypes={id:k.a.string,name:k.a.string},C.defaultProps={id:"googlesitekit-opt-in",name:"optIn"};t.a=C},146:function(e,t,n){"use strict";n.d(t,"a",(function(){return C}));var a=n(12),i=n.n(a),o=n(3),c=n.n(o),l=n(4),r=n.n(l),s=n(5),d=n.n(s),u=n(6),m=n.n(u),g=n(13),h=n.n(g),p=n(7),f=n.n(p),_=n(1),k=n(9),v=n(2),y=n(67),b=n(0),R=n(14),E=n(80),C=function(e){function t(e){var n;return c()(this,t),(n=d()(this,m()(t).call(this,e))).state={dialogActive:!1},n.handleDialog=n.handleDialog.bind(h()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(h()(n)),n.handleCloseModal=n.handleCloseModal.bind(h()(n)),n}return f()(t,e),r()(t,[{key:"componentDidMount",value:function(){window.addEventListener("keyup",this.handleCloseModal,!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keyup",this.handleCloseModal)}},{key:"handleUnlinkConfirm",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(k.c.set(k.a,"site","reset"));case 2:Object(v.d)(),this.handleDialog(),document.location=Object(v.n)("googlesitekit-splash",{notification:"reset_success"});case 5:case"end":return e.stop()}}),null,this)}},{key:"handleCloseModal",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1})}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive}}))}},{key:"render",value:function(){var e=this,t=this.props.children,n=this.state.dialogActive;return React.createElement(_.Fragment,null,React.createElement(R.a,{className:"googlesitekit-reset-button",onClick:function(){return e.setState({dialogActive:!0})},inherit:!0},t||Object(b.__)("Reset Site Kit","google-site-kit")),React.createElement(E.a,null,React.createElement(y.a,{dialogActive:n,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(b.__)("Reset Site Kit","google-site-kit"),subtitle:Object(b.__)("Resetting this site will remove access to all services. After disconnecting, you will need to re-authorize your access to restore service.","google-site-kit"),confirmButton:Object(b.__)("Reset","google-site-kit"),provides:[]})))}}]),t}(_.Component)},17:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),c=n.n(o),l=n(5),r=n.n(l),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(8),p=n.n(h),f=n(14),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.ctaLabel,a=e.ctaLink;return React.createElement("header",{className:"googlesitekit-layout__header"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:"\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\t\t".concat(a?"mdc-layout-grid__cell--span-6-desktop":"mdc-layout-grid__cell--span-12-desktop","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--align-middle\n\t\t\t\t\t\t\t\t\t").concat(a?"":"mdc-layout-grid__cell--span-8-tablet","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\t\t")},React.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},t)),a&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "},React.createElement(f.a,{href:a,external:!0,inherit:!0},n)))))}}]),t}(g.Component);_.propTypes={title:p.a.string,ctaLabel:p.a.string,ctaLink:p.a.string},_.defaultProps={title:"",ctaLabel:"",ctaLink:""};var k=_,v=n(60),y=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLabel,n=e.ctaLink,a=e.footerContent;return React.createElement("footer",{className:"googlesitekit-layout__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n&&t&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:t,href:n,external:!0}),a))))}}]),t}(g.Component);y.propTypes={ctaLabel:p.a.string,ctaLink:p.a.string};var b=y,R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.footer,a=e.children,i=e.title,o=e.headerCtaLabel,c=e.headerCtaLink,l=e.footerCtaLabel,r=e.footerCtaLink,s=e.footerContent,d=e.className,u=e.fill,m=e.relative;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-layout\n\t\t\t\t".concat(d&&d,"\n\t\t\t\t").concat(u?"googlesitekit-layout--fill":"","\n\t\t\t\t").concat(m?"googlesitekit-layout--relative":"","\n\t\t\t")},t&&React.createElement(k,{title:i,ctaLabel:o,ctaLink:c}),a,n&&React.createElement(b,{ctaLabel:l,ctaLink:r,footerContent:s}))}}]),t}(g.Component);R.propTypes={header:p.a.bool,footer:p.a.bool,children:p.a.node.isRequired,title:p.a.string,headerCtaLabel:p.a.string,headerCtaLink:p.a.string,footerCtaLabel:p.a.string,footerCtaLink:p.a.string,footerContent:p.a.node,className:p.a.string,fill:p.a.bool,relative:p.a.bool},R.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1};t.a=R},209:function(e,t,n){"use strict";n.r(t);var a=n(3),i=n.n(a),o=n(4),c=n.n(o),l=n(5),r=n.n(l),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(44),p=n(29),f=n(146),_=n(17),k=n(26),v=n(144),y=n(2),b=n(11),R=n(0),E=n(36),C=function(e){function t(e){var n;i()(this,t),n=r()(this,d()(t).call(this,e));var a=googlesitekit.admin,o=a.proxySetupURL,c=a.siteURL,l=googlesitekit.setup,s=l.isSiteKitConnected,u=l.isResettable,m=l.errorMessage,g=googlesitekit.permissions.canSetup;return n.state={canSetup:g,errorMessage:m,isSiteKitConnected:s,isResettable:u,completeSetup:!1,proxySetupURL:o,resetSuccess:"reset_success"===Object(E.getQueryArg)(location.href,"notification"),context:Object(E.getQueryArg)(location.href,"googlesitekit_context"),siteHostname:new URL(c).hostname},n}return m()(t,e),c()(t,[{key:"isSetupFinished",value:function(){var e=this.state,t=e.isSiteKitConnected,n=e.completeSetup;return t&&n}},{key:"render",value:function(){if(this.isSetupFinished()){var e=Object(y.n)("googlesitekit-dashboard",{notification:"authentication_success"});Object(b.delay)((function(){window.location.replace(e)}),500,"later")}var t,n,a,i=this.state,o=i.context,c=i.errorMessage,l=i.isResettable,r=i.proxySetupURL,s=i.resetSuccess,d=i.siteHostname,u=l;return"revoked"===o?(t=Object(R.sprintf)(
2
/* translators: %s is the site's hostname. (e.g. example.com) */
3
- Object(R.__)("You revoked access to Site Kit for %s","google-site-kit"),d),n=Object(R.__)('Site Kit will no longer have access to your account. If you’d like to reconnect Site Kit, click "Start Setup" below to generate new credentials.',"google-site-kit"),a=Object(R.__)("Sign in with Google","google-site-kit")):u?(t=Object(R.__)("Sign in with Google to configure Site Kit"),n=Object(R.__)("To use Site Kit, sign in with your Google account. The Site Kit service will guide you through 3 simple steps to complete the connection and configure the plugin."),a=Object(R.__)("Sign in with Google","google-site-kit")):(t=Object(R.__)("Sign in with Google to set up Site Kit","google-site-kit"),n=Object(R.__)("The Site Kit service will guide you through 3 simple setup steps.","google-site-kit"),a=Object(R.__)("Start setup","google-site-kit")),React.createElement(g.Fragment,null,React.createElement(h.a,null),c&&React.createElement(k.a,{id:"setup_error",type:"win-error",title:Object(R.__)("Oops! There was a problem during set up. Please try again.","google-site-kit"),description:c,isDismissable:!1}),s&&React.createElement(k.a,{id:"reset_success",title:Object(R.__)("Site Kit by Google was successfully reset.","google-site-kit"),isDismissable:!1}),React.createElement("div",{className:"googlesitekit-wizard"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(_.a,null,React.createElement("section",{className:"googlesitekit-wizard-progress"},React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h1",{className:"googlesitekit-setup__title"},t),React.createElement("p",{className:"googlesitekit-setup__description"},n),React.createElement(v.a,null),React.createElement(p.a,{className:"googlesitekit-start-setup",href:r,onClick:function(){Object(y.v)("plugin_setup","proxy_start_setup_landing_page")}},a),l&&React.createElement(f.a,null))))))))))))}}]),t}(g.Component);t.default=C},44:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),c=n.n(o),l=n(5),r=n.n(l),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(21),p=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(g.Component),f=Object(h.a)("googlesitekit.ErrorNotification")(p),_=n(81),k=n(12),v=n.n(k),y=n(13),b=n.n(y),R=n(67),E=n(29),C=n(22),w=n(8),O=n.n(w),N=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).menuRef=Object(g.createRef)(),n}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new C.f(this.menuRef.current),this.menu.open=e,this.menu.setDefaultFocusState(1)}},{key:"componentDidUpdate",value:function(e){var t=this.props.menuOpen;t!==e.menuOpen&&(this.menu.open=t)}},{key:"render",value:function(){var e=this.props,t=e.menuOpen,n=e.menuItems,a=e.onSelected,i=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:i,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},n.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:a.bind(null,t),onKeyDown:a.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(g.Component);N.propTypes={menuOpen:O.a.bool.isRequired,menuItems:O.a.array.isRequired,id:O.a.string.isRequired};var S=N,j=n(80),L=n(2),D=n(0),M=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},n.handleMenu=n.handleMenu.bind(b()(n)),n.handleMenuClose=n.handleMenuClose.bind(b()(n)),n.handleMenuItemSelect=n.handleMenuItemSelect.bind(b()(n)),n.handleDialog=n.handleDialog.bind(b()(n)),n.handleDialogClose=n.handleDialogClose.bind(b()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(b()(n)),n.menuButtonRef=Object(g.createRef)(),n.menuRef=Object(g.createRef)(),n}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.removeEventListener("keyup",this.handleDialogClose)}},{key:"handleMenu",value:function(){var e=this.state.menuOpen;this.setState({menuOpen:!e})}},{key:"handleMenuClose",value:function(e){("keyup"!==e.type||27!==e.keyCode)&&"mouseup"!==e.type||this.menuButtonRef.current.buttonRef.current.contains(e.target)||this.menuRef.current.menuRef.current.contains(e.target)||this.setState({menuOpen:!1})}},{key:"handleMenuItemSelect",value:function(e,t){var n=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(n);break;default:this.handleMenu()}}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive,menuOpen:!1}}))}},{key:"handleDialogClose",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1,menuOpen:!1})}},{key:"handleUnlinkConfirm",value:function(){return v.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(L.d)(),document.location=Object(L.n)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,n=t.email,a=void 0===n?"":n,i=t.picture,o=void 0===i?"":i,c=e.proxyPermissionsURL,l=this.state,r=l.dialogActive,s=l.menuOpen;return React.createElement(g.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(E.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:o?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:o,alt:Object(D.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:s,ariaControls:"user-menu"},a),React.createElement(S,{ref:this.menuRef,menuOpen:s,menuItems:[Object(D.__)("Disconnect","google-site-kit")].concat(c?[Object(D.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(j.a,null,React.createElement(R.a,{dialogActive:r,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(D.__)("Disconnect","google-site-kit"),subtitle:Object(D.__)("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:Object(D.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(g.Component),x=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(g.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(_.a,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-phone mdc-layout-grid__cell--span-1-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e&&React.createElement(M,null))))),React.createElement(f,null))}}]),t}(g.Component);t.a=x},67:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),c=n.n(o),l=n(5),r=n.n(l),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(8),p=n.n(h),f=n(29),_=n(14),k=n(22),v=n(145),y=n.n(v),b=n(0),R=function(e){function t(){var e;return i()(this,t),(e=r()(this,d()(t).call(this))).state={attributes:[Object(b.__)("Audience overview","google-site-kit"),Object(b.__)("Top pages","google-site-kit"),Object(b.__)("Top acquisition sources","google-site-kit"),Object(b.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(g.createRef)(),e}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){new k.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,n=e.handleDialog,a=e.title,i=e.provides,o=e.handleConfirm,c=e.subtitle,l=e.confirmButton,r=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(y.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},a&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},a),c&&React.createElement("p",{className:"mdc-dialog__lead"},c),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},i&&i.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),r&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(b.__)("Note: ","google-site-kit")),r),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(f.a,{onClick:o,danger:!0},l||Object(b.__)("Disconnect","google-site-kit")),React.createElement(_.a,{className:"mdc-dialog__cancel-button",onClick:function(){return n()},inherit:!0},Object(b.__)("Cancel","google-site-kit"))))))))}}]),t}(g.Component);R.propTypes={dialogActive:p.a.bool,handleDialog:p.a.func,handleConfirm:p.a.func.isRequired,title:p.a.string,description:p.a.string,confirmButton:p.a.string},R.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=R},80:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var a=n(3),i=n.n(a),o=n(4),c=n.n(o),l=n(5),r=n.n(l),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).el=document.createElement("div"),n.root=document.querySelector(".googlesitekit-plugin")||document.body,n}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(g.createPortal)(this.props.children,this.el)}}]),t}(g.Component)}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{162:function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var a=n(11),i=n.n(a),o=n(3),c=n.n(o),l=n(4),r=n.n(l),s=n(5),d=n.n(s),u=n(6),m=n.n(u),g=n(13),h=n.n(g),p=n(7),f=n.n(p),_=n(1),k=n(9),v=n(2),y=n(70),b=n(0),R=n(32),E=n(14),C=n(85),w=function(e){function t(e){var n;c()(this,t),n=d()(this,m()(t).call(this,e));var a=window._googlesitekitBase.splashURL;return n.state={dialogActive:!1,postResetURL:Object(R.addQueryArgs)(a,{notification:"reset_success"})},n.handleDialog=n.handleDialog.bind(h()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(h()(n)),n.handleCloseModal=n.handleCloseModal.bind(h()(n)),n}return f()(t,e),r()(t,[{key:"componentDidMount",value:function(){window.addEventListener("keyup",this.handleCloseModal,!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keyup",this.handleCloseModal)}},{key:"handleUnlinkConfirm",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(k.c.set(k.a,"site","reset"));case 2:Object(v.c)(),this.handleDialog(),document.location=this.state.postResetURL;case 5:case"end":return e.stop()}}),null,this)}},{key:"handleCloseModal",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1})}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive}}))}},{key:"render",value:function(){var e=this,t=this.props.children,n=this.state.dialogActive;return React.createElement(_.Fragment,null,React.createElement(E.a,{className:"googlesitekit-reset-button",onClick:function(){return e.setState({dialogActive:!0})},inherit:!0},t||Object(b.__)("Reset Site Kit","google-site-kit")),React.createElement(C.a,null,React.createElement(y.a,{dialogActive:n,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(b.__)("Reset Site Kit","google-site-kit"),subtitle:Object(b.__)("Resetting this site will remove access to all services. After disconnecting, you will need to re-authorize your access to restore service.","google-site-kit"),confirmButton:Object(b.__)("Reset","google-site-kit"),provides:[]})))}}]),t}(_.Component)},17:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),c=n.n(o),l=n(5),r=n.n(l),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(8),p=n.n(h),f=n(14),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.ctaLabel,a=e.ctaLink;return React.createElement("header",{className:"googlesitekit-layout__header"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:"\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\t\t".concat(a?"mdc-layout-grid__cell--span-6-desktop":"mdc-layout-grid__cell--span-12-desktop","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--align-middle\n\t\t\t\t\t\t\t\t\t").concat(a?"":"mdc-layout-grid__cell--span-8-tablet","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\t\t")},React.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},t)),a&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "},React.createElement(f.a,{href:a,external:!0,inherit:!0},n)))))}}]),t}(g.Component);_.propTypes={title:p.a.string,ctaLabel:p.a.string,ctaLink:p.a.string},_.defaultProps={title:"",ctaLabel:"",ctaLink:""};var k=_,v=n(62),y=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLabel,n=e.ctaLink,a=e.footerContent;return React.createElement("footer",{className:"googlesitekit-layout__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n&&t&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:t,href:n,external:!0}),a))))}}]),t}(g.Component);y.propTypes={ctaLabel:p.a.string,ctaLink:p.a.string};var b=y,R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.footer,a=e.children,i=e.title,o=e.headerCtaLabel,c=e.headerCtaLink,l=e.footerCtaLabel,r=e.footerCtaLink,s=e.footerContent,d=e.className,u=e.fill,m=e.relative;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-layout\n\t\t\t\t".concat(d&&d,"\n\t\t\t\t").concat(u?"googlesitekit-layout--fill":"","\n\t\t\t\t").concat(m?"googlesitekit-layout--relative":"","\n\t\t\t")},t&&React.createElement(k,{title:i,ctaLabel:o,ctaLink:c}),a,n&&React.createElement(b,{ctaLabel:l,ctaLink:r,footerContent:s}))}}]),t}(g.Component);R.propTypes={header:p.a.bool,footer:p.a.bool,children:p.a.node.isRequired,title:p.a.string,headerCtaLabel:p.a.string,headerCtaLink:p.a.string,footerCtaLabel:p.a.string,footerCtaLink:p.a.string,footerContent:p.a.node,className:p.a.string,fill:p.a.bool,relative:p.a.bool},R.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1};t.a=R},217:function(e,t,n){"use strict";n.r(t);var a=n(3),i=n.n(a),o=n(4),c=n.n(o),l=n(5),r=n.n(l),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(44),p=n(28),f=n(162),_=n(17),k=n(26),v=n(87),y=n(2),b=n(12),R=n(0),E=n(32),C=function(e){function t(e){var n;i()(this,t),n=r()(this,d()(t).call(this,e));var a=googlesitekit.admin,o=a.proxySetupURL,c=a.siteURL,l=googlesitekit.setup,s=l.isSiteKitConnected,u=l.isResettable,m=l.errorMessage,g=googlesitekit.permissions.canSetup;return n.state={canSetup:g,errorMessage:m,isSiteKitConnected:s,isResettable:u,completeSetup:!1,proxySetupURL:o,resetSuccess:"reset_success"===Object(E.getQueryArg)(location.href,"notification"),context:Object(E.getQueryArg)(location.href,"googlesitekit_context"),siteHostname:new URL(c).hostname},n}return m()(t,e),c()(t,[{key:"isSetupFinished",value:function(){var e=this.state,t=e.isSiteKitConnected,n=e.completeSetup;return t&&n}},{key:"render",value:function(){if(this.isSetupFinished()){var e=Object(y.m)("googlesitekit-dashboard",{notification:"authentication_success"});Object(b.delay)((function(){window.location.replace(e)}),500,"later")}var t,n,a,i=this.state,o=i.context,c=i.errorMessage,l=i.isResettable,r=i.proxySetupURL,s=i.resetSuccess,d=i.siteHostname,u=l;return"revoked"===o?(t=Object(R.sprintf)(
2
/* translators: %s is the site's hostname. (e.g. example.com) */
3
+ Object(R.__)("You revoked access to Site Kit for %s","google-site-kit"),d),n=Object(R.__)('Site Kit will no longer have access to your account. If you’d like to reconnect Site Kit, click "Start Setup" below to generate new credentials.',"google-site-kit"),a=Object(R.__)("Sign in with Google","google-site-kit")):u?(t=Object(R.__)("Sign in with Google to configure Site Kit"),n=Object(R.__)("To use Site Kit, sign in with your Google account. The Site Kit service will guide you through 3 simple steps to complete the connection and configure the plugin."),a=Object(R.__)("Sign in with Google","google-site-kit")):(t=Object(R.__)("Sign in with Google to set up Site Kit","google-site-kit"),n=Object(R.__)("The Site Kit service will guide you through 3 simple setup steps.","google-site-kit"),a=Object(R.__)("Start setup","google-site-kit")),React.createElement(g.Fragment,null,React.createElement(h.a,null),c&&React.createElement(k.a,{id:"setup_error",type:"win-error",title:Object(R.__)("Oops! There was a problem during set up. Please try again.","google-site-kit"),description:c,isDismissable:!1}),s&&React.createElement(k.a,{id:"reset_success",title:Object(R.__)("Site Kit by Google was successfully reset.","google-site-kit"),isDismissable:!1}),React.createElement("div",{className:"googlesitekit-wizard"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(_.a,null,React.createElement("section",{className:"googlesitekit-wizard-progress"},React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h1",{className:"googlesitekit-setup__title"},t),React.createElement("p",{className:"googlesitekit-setup__description"},n),React.createElement(v.a,null),React.createElement(p.a,{className:"googlesitekit-start-setup",href:r,onClick:function(){Object(y.v)("plugin_setup","proxy_start_setup_landing_page")}},a),l&&React.createElement(f.a,null))))))))))))}}]),t}(g.Component);t.default=C},44:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),c=n.n(o),l=n(5),r=n.n(l),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(21),p=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(g.Component),f=Object(h.a)("googlesitekit.ErrorNotification")(p),_=n(71),k=n(11),v=n.n(k),y=n(13),b=n.n(y),R=n(70),E=n(28),C=n(22),w=n(8),O=n.n(w),N=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).menuRef=Object(g.createRef)(),n}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new C.f(this.menuRef.current),this.menu.open=e,this.menu.setDefaultFocusState(1)}},{key:"componentDidUpdate",value:function(e){var t=this.props.menuOpen;t!==e.menuOpen&&(this.menu.open=t)}},{key:"render",value:function(){var e=this.props,t=e.menuOpen,n=e.menuItems,a=e.onSelected,i=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:i,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},n.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:a.bind(null,t),onKeyDown:a.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(g.Component);N.propTypes={menuOpen:O.a.bool.isRequired,menuItems:O.a.array.isRequired,id:O.a.string.isRequired};var S=N,j=n(85),L=n(2),D=n(0),M=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},n.handleMenu=n.handleMenu.bind(b()(n)),n.handleMenuClose=n.handleMenuClose.bind(b()(n)),n.handleMenuItemSelect=n.handleMenuItemSelect.bind(b()(n)),n.handleDialog=n.handleDialog.bind(b()(n)),n.handleDialogClose=n.handleDialogClose.bind(b()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(b()(n)),n.menuButtonRef=Object(g.createRef)(),n.menuRef=Object(g.createRef)(),n}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.removeEventListener("keyup",this.handleDialogClose)}},{key:"handleMenu",value:function(){var e=this.state.menuOpen;this.setState({menuOpen:!e})}},{key:"handleMenuClose",value:function(e){("keyup"!==e.type||27!==e.keyCode)&&"mouseup"!==e.type||this.menuButtonRef.current.buttonRef.current.contains(e.target)||this.menuRef.current.menuRef.current.contains(e.target)||this.setState({menuOpen:!1})}},{key:"handleMenuItemSelect",value:function(e,t){var n=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(n);break;default:this.handleMenu()}}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive,menuOpen:!1}}))}},{key:"handleDialogClose",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1,menuOpen:!1})}},{key:"handleUnlinkConfirm",value:function(){return v.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(L.c)(),document.location=Object(L.m)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,n=t.email,a=void 0===n?"":n,i=t.picture,o=void 0===i?"":i,c=e.proxyPermissionsURL,l=this.state,r=l.dialogActive,s=l.menuOpen;return React.createElement(g.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(E.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:o?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:o,alt:Object(D.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:s,ariaControls:"user-menu"},a),React.createElement(S,{ref:this.menuRef,menuOpen:s,menuItems:[Object(D.__)("Disconnect","google-site-kit")].concat(c?[Object(D.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(j.a,null,React.createElement(R.a,{dialogActive:r,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(D.__)("Disconnect","google-site-kit"),subtitle:Object(D.__)("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:Object(D.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(g.Component),x=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(g.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(_.a,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-phone mdc-layout-grid__cell--span-1-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e&&React.createElement(M,null))))),React.createElement(f,null))}}]),t}(g.Component);t.a=x},70:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),c=n.n(o),l=n(5),r=n.n(l),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(8),p=n.n(h),f=n(28),_=n(14),k=n(22),v=n(155),y=n.n(v),b=n(0),R=function(e){function t(){var e;return i()(this,t),(e=r()(this,d()(t).call(this))).state={attributes:[Object(b.__)("Audience overview","google-site-kit"),Object(b.__)("Top pages","google-site-kit"),Object(b.__)("Top acquisition sources","google-site-kit"),Object(b.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(g.createRef)(),e}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){new k.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,n=e.handleDialog,a=e.title,i=e.provides,o=e.handleConfirm,c=e.subtitle,l=e.confirmButton,r=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(y.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},a&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},a),c&&React.createElement("p",{className:"mdc-dialog__lead"},c),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},i&&i.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),r&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(b.__)("Note: ","google-site-kit")),r),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(f.a,{onClick:o,danger:!0},l||Object(b.__)("Disconnect","google-site-kit")),React.createElement(_.a,{className:"mdc-dialog__cancel-button",onClick:function(){return n()},inherit:!0},Object(b.__)("Cancel","google-site-kit"))))))))}}]),t}(g.Component);R.propTypes={dialogActive:p.a.bool,handleDialog:p.a.func,handleConfirm:p.a.func.isRequired,title:p.a.string,description:p.a.string,confirmButton:p.a.string},R.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=R},85:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var a=n(3),i=n.n(a),o=n(4),c=n.n(o),l=n(5),r=n.n(l),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).el=document.createElement("div"),n.root=document.querySelector(".googlesitekit-plugin")||document.body,n}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(g.createPortal)(this.props.children,this.el)}}]),t}(g.Component)},87:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),c=n.n(o),l=n(5),r=n.n(l),s=n(6),d=n.n(s),u=n(13),m=n.n(u),g=n(7),h=n.n(g),p=n(1),f=n(22),_=n(8),k=n.n(_),v=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).formFieldRef=Object(p.createRef)(),n.checkboxRef=Object(p.createRef)(),n}return h()(t,e),c()(t,[{key:"componentDidMount",value:function(){new f.e(this.formFieldRef.current).input=new f.c(this.checkboxRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onChange,n=e.id,a=e.name,i=e.value,o=e.checked,c=e.disabled,l=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-checkbox\n\t\t\t\t\t\t".concat(c?"mdc-checkbox--disabled":"","\n\t\t\t\t\t"),ref:this.checkboxRef},React.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:n,name:a,value:i,checked:o,disabled:c,onChange:t}),React.createElement("div",{className:"mdc-checkbox__background"},React.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},React.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),React.createElement("div",{className:"mdc-checkbox__mixedmark"}))),React.createElement("label",{htmlFor:n},l))}}]),t}(p.Component);v.propTypes={onChange:k.a.func.isRequired,id:k.a.string.isRequired,name:k.a.string.isRequired,value:k.a.string.isRequired,checked:k.a.bool,disabled:k.a.bool,children:k.a.node.isRequired},v.defaultProps={checked:!1,disabled:!1};var y=v,b=n(33),R=n.n(b),E=n(0),C=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).state={scriptOnPage:!!window.googlesitekitTrackingEnabled,optIn:!!window.googlesitekitTrackingEnabled,error:!1},n.handleOptIn=n.handleOptIn.bind(m()(n)),n}return h()(t,e),c()(t,[{key:"handleOptIn",value:function(e){var t=this,n=e.target.checked,a={googlesitekit_tracking_optin:n};R()({path:"/wp/v2/settings",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(a),method:"POST"}).then((function(){if(window.googlesitekitTrackingEnabled=!!n,n&&!t.state.scriptOnPage){var e=window.document;if(!e)return;e.body.insertAdjacentHTML("beforeend",'\n\t\t\t\t\t\t<script async src="https://www.googletagmanager.com/gtag/js?id='.concat(googlesitekit.admin.trackingID,'"><\/script>\n\t\t\t\t\t')),e.body.insertAdjacentHTML("beforeend","\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\t\t\tgtag('config', '".concat(googlesitekit.admin.trackingID,"');\n\t\t\t\t\t\t<\/script>\n\t\t\t\t\t"))}t.setState({optIn:!!n,error:!1,scriptOnPage:!0})})).catch((function(n){t.setState({optIn:!e.target.checked,error:{errorCode:n.code,errorMsg:n.message}})}))}},{key:"render",value:function(){var e=this.state,t=e.optIn,n=e.error,a=this.props,i=a.id,o=a.name;return React.createElement("div",{className:"googlesitekit-opt-in"},React.createElement(y,{id:i,name:o,value:"1",checked:t,onChange:this.handleOptIn},Object(E.__)("Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with ","google-site-kit"),React.createElement("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer"},Object(E.__)("Google Privacy Policy","google-site-kit")),"."),n&&React.createElement("div",{className:"googlesitekit-error-text"},n.errorMsg))}}]),t}(p.Component);C.propTypes={id:k.a.string,name:k.a.string},C.defaultProps={id:"googlesitekit-opt-in",name:"optIn"};t.a=C}}]);
dist/assets/js/chunk-googlesitekit-setup-wizard.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{144:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(13),m=a.n(d),g=a(7),p=a.n(g),h=a(1),_=a(22),f=a(8),k=a.n(f),v=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).formFieldRef=Object(h.createRef)(),a.checkboxRef=Object(h.createRef)(),a}return p()(t,e),s()(t,[{key:"componentDidMount",value:function(){new _.e(this.formFieldRef.current).input=new _.c(this.checkboxRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onChange,a=e.id,n=e.name,i=e.value,r=e.checked,s=e.disabled,o=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-checkbox\n\t\t\t\t\t\t".concat(s?"mdc-checkbox--disabled":"","\n\t\t\t\t\t"),ref:this.checkboxRef},React.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:a,name:n,value:i,checked:r,disabled:s,onChange:t}),React.createElement("div",{className:"mdc-checkbox__background"},React.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},React.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),React.createElement("div",{className:"mdc-checkbox__mixedmark"}))),React.createElement("label",{htmlFor:a},o))}}]),t}(h.Component);v.propTypes={onChange:k.a.func.isRequired,id:k.a.string.isRequired,name:k.a.string.isRequired,value:k.a.string.isRequired,checked:k.a.bool,disabled:k.a.bool,children:k.a.node.isRequired},v.defaultProps={checked:!1,disabled:!1};var R=v,y=a(35),b=a.n(y),E=a(0),C=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).state={scriptOnPage:!!window.googlesitekitTrackingEnabled,optIn:!!window.googlesitekitTrackingEnabled,error:!1},a.handleOptIn=a.handleOptIn.bind(m()(a)),a}return p()(t,e),s()(t,[{key:"handleOptIn",value:function(e){var t=this,a=e.target.checked,n={googlesitekit_tracking_optin:a};b()({path:"/wp/v2/settings",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(n),method:"POST"}).then((function(){if(window.googlesitekitTrackingEnabled=!!a,a&&!t.state.scriptOnPage){var e=window.document;if(!e)return;e.body.insertAdjacentHTML("beforeend",'\n\t\t\t\t\t\t<script async src="https://www.googletagmanager.com/gtag/js?id='.concat(googlesitekit.admin.trackingID,'"><\/script>\n\t\t\t\t\t')),e.body.insertAdjacentHTML("beforeend","\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\t\t\tgtag('config', '".concat(googlesitekit.admin.trackingID,"');\n\t\t\t\t\t\t<\/script>\n\t\t\t\t\t"))}t.setState({optIn:!!a,error:!1,scriptOnPage:!0})})).catch((function(a){t.setState({optIn:!e.target.checked,error:{errorCode:a.code,errorMsg:a.message}})}))}},{key:"render",value:function(){var e=this.state,t=e.optIn,a=e.error,n=this.props,i=n.id,r=n.name;return React.createElement("div",{className:"googlesitekit-opt-in"},React.createElement(R,{id:i,name:r,value:"1",checked:t,onChange:this.handleOptIn},Object(E.__)("Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with ","google-site-kit"),React.createElement("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer"},Object(E.__)("Google Privacy Policy","google-site-kit")),"."),a&&React.createElement("div",{className:"googlesitekit-error-text"},a.errorMsg))}}]),t}(h.Component);C.propTypes={id:k.a.string,name:k.a.string},C.defaultProps={id:"googlesitekit-opt-in",name:"optIn"};t.a=C},17:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=a(8),h=a.n(p),_=a(14),f=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.title,a=e.ctaLabel,n=e.ctaLink;return React.createElement("header",{className:"googlesitekit-layout__header"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:"\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\t\t".concat(n?"mdc-layout-grid__cell--span-6-desktop":"mdc-layout-grid__cell--span-12-desktop","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--align-middle\n\t\t\t\t\t\t\t\t\t").concat(n?"":"mdc-layout-grid__cell--span-8-tablet","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\t\t")},React.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},t)),n&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "},React.createElement(_.a,{href:n,external:!0,inherit:!0},a)))))}}]),t}(g.Component);f.propTypes={title:h.a.string,ctaLabel:h.a.string,ctaLink:h.a.string},f.defaultProps={title:"",ctaLabel:"",ctaLink:""};var k=f,v=a(60),R=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLabel,a=e.ctaLink,n=e.footerContent;return React.createElement("footer",{className:"googlesitekit-layout__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},a&&t&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:t,href:a,external:!0}),n))))}}]),t}(g.Component);R.propTypes={ctaLabel:h.a.string,ctaLink:h.a.string};var y=R,b=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.header,a=e.footer,n=e.children,i=e.title,r=e.headerCtaLabel,s=e.headerCtaLink,o=e.footerCtaLabel,c=e.footerCtaLink,l=e.footerContent,u=e.className,d=e.fill,m=e.relative;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-layout\n\t\t\t\t".concat(u&&u,"\n\t\t\t\t").concat(d?"googlesitekit-layout--fill":"","\n\t\t\t\t").concat(m?"googlesitekit-layout--relative":"","\n\t\t\t")},t&&React.createElement(k,{title:i,ctaLabel:r,ctaLink:s}),n,a&&React.createElement(y,{ctaLabel:o,ctaLink:c,footerContent:l}))}}]),t}(g.Component);b.propTypes={header:h.a.bool,footer:h.a.bool,children:h.a.node.isRequired,title:h.a.string,headerCtaLabel:h.a.string,headerCtaLink:h.a.string,footerCtaLabel:h.a.string,footerCtaLink:h.a.string,footerContent:h.a.node,className:h.a.string,fill:h.a.bool,relative:h.a.bool},b.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1};t.a=b},210:function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),r=a(3),s=a.n(r),o=a(4),c=a.n(o),l=a(5),u=a.n(l),d=a(6),m=a.n(d),g=a(13),p=a.n(g),h=a(7),_=a.n(h),f=a(1),k=a(11),v=a(0),R=a(44),y=a(29),b=a(17),E=a(9),C=a(2),S=a(8),w=a.n(S),N=a(14),O=a(144),j=a(43),L=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.connectURL,a=e.needReauthenticate,n=e.resetAndRestart;return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--two"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Authenticate with Google","google-site-kit")),React.createElement("p",null,Object(v.__)("Please sign into your Google account to begin.","google-site-kit")),a&&React.createElement("p",{className:"googlesitekit-error-text"},Object(v.__)("You did not grant access to one or more of the requested scopes. Please grant all scopes that you are prompted for.","google-site-kit")),React.createElement("p",null,React.createElement(y.a,{onClick:function(){Object(C.v)("plugin_setup","signin_with_google"),document.location=t}},Object(v.__)("Sign in with Google","google-site-kit")),n&&React.createElement(N.a,{className:"googlesitekit-wizard-step__back",onClick:n},Object(v.__)("Back","google-site-kit"))),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(O.a,null),React.createElement(j.a,null))))))}}]),t}(f.Component);L.propTypes={connectURL:w.a.string.isRequired,resetAndRestart:w.a.func};var x=L,M=a(68),A=a.n(M),U=a(31),P=a(22),z=function(e){function t(e){var a;s()(this,t);var n=(a=u()(this,m()(t).call(this,e))).props,i=n.isAuthenticated,r=n.shouldSetup;return a.state={loading:i&&r,loadingMsg:Object(v.__)("Getting your verified sites...","google-site-kit"),siteURL:" ",selectedURL:"",errorCode:!1,errorMsg:""},a.onProceed=a.onProceed.bind(p()(a)),a}return _()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isAuthenticated,a=e.shouldSetup;t&&a&&this.requestSitePropertyList()}},{key:"requestSitePropertyList",value:function(){var e,t,a,n,r,s=this,o=this.props.setErrorMessage;i.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return c.prev=0,c.next=3,i.a.awrap(E.c.get(E.b,"site-verification","verification"));case 3:if(e=c.sent,t=e.verified,a=e.identifier,!t){c.next=16;break}return Object(C.v)("verification_setup","verification_check_true"),c.next=10,i.a.awrap(s.insertSiteVerification(a));case 10:if(!0!==c.sent.verified){c.next=14;break}return s.props.siteVerificationSetup(!0),c.abrupt("return",!0);case 14:c.next=17;break;case 16:Object(C.v)("verification_setup","verification_check_false");case 17:s.setState({loading:!1,siteURL:a}),c.next=26;break;case 20:c.prev=20,c.t0=c.catch(0),n=c.t0.message,Object(C.z)(c.t0.message)&&(r=JSON.parse(c.t0.message),n=r.error.message||c.t0.message),o(n),s.setState({loading:!1,errorCode:c.t0.code,errorMsg:n,siteURL:googlesitekit.admin.siteURL});case 26:case"end":return c.stop()}}),null,null,[[0,20]])}},{key:"insertSiteVerification",value:function(e){return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(E.c.set(E.b,"site-verification","verification",{siteURL:e}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}))}},{key:"onProceed",value:function(){var e,t,a,n;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return e=this.props.setErrorMessage,t=this.state.siteURL?this.state.siteURL:googlesitekit.admin.siteURL,e(""),this.setState({loading:!0,loadingMsg:Object(v.__)("Verifying...","google-site-kit"),errorCode:!1,errorMsg:""}),r.prev=4,r.next=7,i.a.awrap(this.insertSiteVerification(t));case 7:!0===r.sent.verified&&(Object(C.v)("verification_setup","verification_insert_tag"),this.props.siteVerificationSetup(!0)),r.next=17;break;case 11:r.prev=11,r.t0=r.catch(4),a=r.t0.message,Object(C.z)(r.t0.message)&&(n=JSON.parse(r.t0.message),a=n.error.message||r.t0.message),e(a),this.setState({loading:!1,errorCode:r.t0.code,errorMsg:a});case 17:case"end":return r.stop()}}),null,this,[[4,11]])}},{key:"renderForm",value:function(){var e=this.state,t=e.loading,a=e.loadingMsg,n=e.siteURL,i=React.createElement(f.Fragment,null,a&&React.createElement("p",null,a),React.createElement(U.a,null));return t?i:React.createElement(f.Fragment,null,React.createElement("div",{className:"googlesitekit-wizard-step__inputs"},React.createElement(P.l,{label:Object(v.__)("Website Address","google-site-kit"),name:"siteProperty",floatingLabelClassName:"mdc-floating-label--float-above",outlined:!0,disabled:!0},React.createElement(P.b,{value:n}))),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(y.a,{onClick:this.onProceed},Object(v.__)("Continue","google-site-kit")),React.createElement(j.a,null)))}},{key:"render",value:function(){var e=this.props,a=e.isAuthenticated,n=e.shouldSetup,i=this.state.errorMsg;return n?React.createElement(f.Fragment,null,React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Verify URL","google-site-kit")),React.createElement("p",{className:"googlesitekit-wizard-step__text"},Object(v.__)("We will need to verify your URL for Site Kit.","google-site-kit")),i&&0<i.length&&React.createElement("p",{className:"googlesitekit-error-text"},i),a&&this.renderForm()):t.renderSetupDone()}}],[{key:"renderSetupDone",value:function(){return React.createElement(f.Fragment,null,React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Verify URL","google-site-kit")),React.createElement("p",{className:"googlesitekit-wizard-step__text"},Object(v.__)("Congratulations, your site has been verified!","google-site-kit")))}}]),t}(f.Component);z.propTypes={isAuthenticated:w.a.bool.isRequired,shouldSetup:w.a.bool.isRequired,siteVerificationSetup:w.a.func.isRequired,completeSetup:w.a.func,setErrorMessage:w.a.func.isRequired};var D=z,q=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=!this.props.isVerified;return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--three"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(D,A()({shouldSetup:e},this.props))))))}}]),t}(f.Component);q.propTypes={siteVerificationSetup:w.a.func.isRequired};var F=q,T=function(e){function t(e){var a;s()(this,t),a=u()(this,m()(t).call(this,e));var n=googlesitekit.admin.siteURL;return a.state={loading:!0,sites:!1,selectedURL:n,siteURL:n,connected:!1,errorCode:!1,errorMsg:""},a.handleURLSelect=a.handleURLSelect.bind(p()(a)),a.insertPropertyToSearchConsole=a.insertPropertyToSearchConsole.bind(p()(a)),a.submitPropertyEventHandler=a.submitPropertyEventHandler.bind(p()(a)),a}return _()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e,t,a,n,r,s;return i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(e=this.props,t=e.isAuthenticated,a=e.shouldSetup,t&&a){o.next=3;break}return o.abrupt("return");case 3:return o.prev=3,n=["siteRestrictedUser","siteOwner","siteFullUser"],o.next=7,i.a.awrap(E.c.get(E.b,"search-console","matched-sites"));case 7:if(r=o.sent,!(s=r.exactMatch)||!n.includes(s.permissionLevel)){o.next=13;break}return o.next=12,i.a.awrap(E.c.set(E.b,"search-console","site",{siteURL:s.siteURL}));case 12:return o.abrupt("return",this.props.searchConsoleSetup(s.siteURL));case 13:o.next=17;break;case 15:o.prev=15,o.t0=o.catch(3);case 17:this.requestSearchConsoleSiteList();case 18:case"end":return o.stop()}}),null,this,[[3,15]])}},{key:"requestSearchConsoleSiteList",value:function(){var e=this;if(!this.state.errorCode){var t,a,n,r,s=this.props.setErrorMessage;i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,i.a.awrap(E.c.get(E.b,"search-console","matched-sites"));case 3:if(t=o.sent,a=t.exactMatch,n=t.propertyMatches,!a){o.next=11;break}return o.next=9,i.a.awrap(e.insertPropertyToSearchConsole(a.siteURL));case 9:return e.props.searchConsoleSetup(a.siteURL),o.abrupt("return");case 11:r="",r=1<n.length?Object(v.sprintf)(
2
/* translators: %d: the number of matching properties. %s: URL of recommended site. */
3
- Object(v.__)("We found %d existing accounts. We recommend using the account “%s”. Please confirm or change below to use.","google-site-kit"),n.length,n[0].siteURL):Object(v.__)("Your site has not been added to Search Console yet. Would you like to add it now?","google-site-kit"),s(r),e.setState({loading:!1,sites:n,errorCode:"no_property_matched",errorMsg:r}),o.next=21;break;case 17:o.prev=17,o.t0=o.catch(0),s(o.t0.message),e.setState({loading:!1,errorCode:o.t0.code,errorMsg:o.t0.message});case 21:case"end":return o.stop()}}),null,null,[[0,17]])}}},{key:"insertPropertyToSearchConsole",value:function(e){return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(E.c.set(E.b,"search-console","site",{siteURL:e}));case 2:Object(C.v)("search_console_setup","add_new_sc_property"),this.setState({loading:!1,connected:!0});case 4:case"end":return t.stop()}}),null,this)}},{key:"submitPropertyEventHandler",value:function(){var e=this,t=this.state.selectedURL,a=this.props.setErrorMessage;i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,i.a.awrap(e.insertPropertyToSearchConsole(t));case 3:a(""),e.props.searchConsoleSetup(t),n.next=11;break;case 7:n.prev=7,n.t0=n.catch(0),a(n.t0.message[0].message),e.setState({loading:!1,errorCode:n.t0.code,errorMsg:n.t0.message[0].message});case 11:case"end":return n.stop()}}),null,null,[[0,7]])}},{key:"handleURLSelect",value:function(e,t){this.setState({selectedURL:t.getAttribute("data-value")})}},{key:"matchedForm",value:function(){var e=this.state,t=e.sites,a=e.selectedURL,n=[{label:"",value:"",disabled:!0}];return t?(t.forEach((function(e){n.push({label:e,value:e})})),React.createElement(f.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(P.k,{enhanced:!0,name:"siteProperty",label:Object(v.__)("Choose URL","google-site-kit"),outlined:!0,onEnhancedChange:this.handleURLSelect,options:n,value:a})),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(y.a,{onClick:this.submitPropertyEventHandler},Object(v.__)("Continue","google-site-kit")),React.createElement(j.a,null)))):null}},{key:"noSiteForm",value:function(){var e=this.state.siteURL;return React.createElement(f.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(P.l,{label:Object(v.__)("Website Address","google-site-kit"),name:"siteProperty",floatingLabelClassName:"mdc-floating-label--float-above",outlined:!0,disabled:!0},React.createElement(P.b,{value:e}))),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(y.a,{onClick:this.submitPropertyEventHandler},Object(v.__)("Continue","google-site-kit")),React.createElement(j.a,null)))}},{key:"renderForm",value:function(){var e=this.state,t=e.loading,a=e.sites;return t?React.createElement(f.Fragment,null,React.createElement("p",null,Object(v.__)("We’re locating your Search Console account.","google-site-kit")),React.createElement(U.a,null)):0===a.length?this.noSiteForm():this.matchedForm()}},{key:"render",value:function(){var e=this.props,a=e.isAuthenticated,n=e.shouldSetup,i=this.state,r=i.errorMsg,s=i.connected;return!n||s?t.connected():React.createElement("section",{className:"googlesitekit-setup-module googlesitekit-setup-module--search-console"},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(v._x)("Search Console","Service name","google-site-kit")),r&&0<r.length&&React.createElement("p",{className:"googlesitekit-error-text"},r),a&&n&&this.renderForm())}}],[{key:"connected",value:function(){return React.createElement("section",{className:"googlesitekit-setup-module googlesitekit-setup-module--search-console"},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(v._x)("Search Console","Service name","google-site-kit")),React.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(v.__)("Your Search Console is set up with Site Kit.","google-site-kit")))}}]),t}(f.Component);T.propTypes={isAuthenticated:w.a.bool.isRequired,shouldSetup:w.a.bool.isRequired,searchConsoleSetup:w.a.func.isRequired,setErrorMessage:w.a.func.isRequired};var V=T,I=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.isVerified,a=e.hasSearchConsoleProperty,n=t&&!a;return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--four"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n?React.createElement(V,A()({shouldSetup:n},this.props)):V.connected()))))}}]),t}(f.Component);I.propTypes={searchConsoleSetup:w.a.func.isRequired};var K=I,B=function(e){function t(e){var a;return s()(this,t),a=u()(this,m()(t).call(this,e)),googlesitekit.setup.hasSearchConsoleProperty?Object(C.v)("plugin_setup","user_verified"):Object(C.v)("plugin_setup","site_verified"),a}return _()(t,e),c()(t,[{key:"render",value:function(){return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--five"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-5-tablet mdc-layout-grid__cell--span-9-desktop "},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Congratulations!","google-site-kit")),React.createElement("p",null,Object(v.__)("You successfully completed the Site Kit setup and connected Search Console. Check the dashboard for more services to connect.","google-site-kit")),React.createElement("div",{className:"googlesitekit-wizard-step__action"},React.createElement(y.a,{id:"wizard-step-five-proceed",onClick:this.props.completeSetup},Object(v.__)("Go to Dashboard","google-site-kit")))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-3-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement("div",{className:"googlesitekit-rocket"},React.createElement("img",{className:"googlesitekit-rocket__body",alt:"",src:googlesitekit.admin.assetsRoot+"images/rocket-body.png"}),React.createElement("img",{className:"googlesitekit-rocket__clouds",alt:"",src:googlesitekit.admin.assetsRoot+"images/rocket-clouds.png"}),React.createElement("img",{className:"googlesitekit-rocket__dust",alt:"",src:googlesitekit.admin.assetsRoot+"images/rocket-dust.png"}))))))}}]),t}(f.Component);B.propTypes={completeSetup:w.a.func.isRequired};var G=B,H={authentication:{title:Object(v.__)("Authenticate","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&!e.needReauthenticate},Component:x},verification:{title:Object(v.__)("Verify URL","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified},Component:F},seachConsoleProperty:{title:Object(v.__)("Connect Search Console","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified&&e.hasSearchConsoleProperty},Component:K},completeSetup:{title:Object(v.__)("Finish","google-site-kit"),required:!1,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified&&e.hasSearchConsoleProperty},Component:G}},W=a(20),J=a(18),Y=a.n(J),Q=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.currentStep,a=e.step,n=e.title,i=e.status,r=e.warning,s=e.error,o=e.stepKey,c=i;r?c="warning":s&&(c="error");var l=!1;switch(c){case"warning":case"error":l=Y.a.createElement(W.a,{id:"exclamation",height:"12",width:"2"});break;case"completed":l=Y.a.createElement(W.a,{id:"check",height:"12",width:"16"})}return Y.a.createElement("div",{className:"\n\t\t\t\tgooglesitekit-wizard-progress-step\n\t\t\t\tgooglesitekit-wizard-progress-step--".concat(a,"\n\t\t\t\t").concat(t?"googlesitekit-wizard-progress-step--current":"","\n\t\t\t\tgooglesitekit-wizard-progress-step--").concat(o,"\n\t\t\t")},Y.a.createElement("div",{className:"googlesitekit-wizard-progress-step__number-wrapper"},Y.a.createElement("div",{className:"\n\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number\n\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number--".concat(c,"\n\t\t\t\t\t")},Y.a.createElement("span",{className:"\n\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-text\n\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-text--".concat(c,"\n\t\t\t\t\t\t")},a),l&&Y.a.createElement("span",{className:"\n\t\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-icon\n\t\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-icon--".concat(c,"\n\t\t\t\t\t\t\t")},l))),Y.a.createElement("p",{className:"googlesitekit-wizard-progress-step__text"},n))}}]),t}(f.Component);Q.propTypes={currentStep:w.a.bool.isRequired,step:w.a.number.isRequired,title:w.a.string,status:w.a.string,warning:w.a.bool,error:w.a.bool},Q.defaultProps={title:"",status:"",warning:!1,error:!1,removeFirstStep:!1};var X=Q,Z=function(e){function t(e){var a;s()(this,t),a=u()(this,m()(t).call(this,e));var n=googlesitekit.admin.connectURL,i=googlesitekit.setup,r=i.isAuthenticated,o=i.hasSearchConsoleProperty,c=i.isSiteKitConnected,l=i.isVerified,d=i.needReauthenticate,g=googlesitekit.permissions.canSetup;return a.state={canSetup:g,isAuthenticated:r,isVerified:l,needReauthenticate:d,hasSearchConsoleProperty:o,hasSearchConsolePropertyFromTheStart:o,connectURL:n,errorMsg:"",isSiteKitConnected:c,completeSetup:!1},a.siteConnectedSetup=a.siteConnectedSetup.bind(p()(a)),a.siteVerificationSetup=a.siteVerificationSetup.bind(p()(a)),a.searchConsoleSetup=a.searchConsoleSetup.bind(p()(a)),a.resetAndRestart=a.resetAndRestart.bind(p()(a)),a.completeSetup=a.completeSetup.bind(p()(a)),a.setErrorMessage=a.setErrorMessage.bind(p()(a)),a}return _()(t,e),c()(t,[{key:"resetAndRestart",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(E.c.set(E.a,"site","reset"));case 2:Object(C.d)(),this.setState({isSiteKitConnected:!1,isAuthenticated:!1,isVerified:!1,hasSearchConsoleProperty:!1,completeSetup:!1,errorMsg:""});case 4:case"end":return e.stop()}}),null,this)}},{key:"completeSetup",value:function(){this.setState({completeSetup:!0})}},{key:"siteConnectedSetup",value:function(e){this.setState({isSiteKitConnected:e})}},{key:"siteVerificationSetup",value:function(e){this.setState({isVerified:e})}},{key:"searchConsoleSetup",value:function(e){this.setState({hasSearchConsoleProperty:e})}},{key:"isSetupFinished",value:function(){var e=this.state,t=e.isSiteKitConnected,a=e.isAuthenticated,n=e.isVerified,i=e.hasSearchConsoleProperty,r=e.completeSetup;return t&&a&&n&&i&&r}},{key:"setErrorMessage",value:function(e){this.setState({errorMsg:e})}},{key:"getApplicableSteps",value:function(){var e,t=H,a=Object.keys(t);for(e=0;e<a.length;e++)t[a[e]].isApplicable(this.state)||delete t[a[e]];return t}},{key:"currentStep",value:function(e){var t,a=Object.keys(e);for(t=0;t<a.length-1;t++)if(!e[a[t]].isCompleted(this.state))return a[t];return a[t]}},{key:"stepStatus",value:function(e,t){return e[t].isCompleted(this.state)?"completed":t===this.currentStep(e)?"inprogress":""}},{key:"render",value:function(){var e=this,t=this.state,a=t.canSetup,n=t.isAuthenticated,i=t.isVerified,r=t.needReauthenticate,s=t.hasSearchConsoleProperty,o=t.connectURL,c=t.isSiteKitConnected;if(this.isSetupFinished()){var l=Object(C.n)("googlesitekit-dashboard",{notification:"authentication_success"});Object(k.delay)((function(){window.location.replace(l)}),500,"later")}var u=this.getApplicableSteps(),d=this.currentStep(u),m=u[d].Component,g=React.createElement(m,{siteConnectedSetup:this.siteConnectedSetup,connectURL:o,siteVerificationSetup:this.siteVerificationSetup,searchConsoleSetup:this.searchConsoleSetup,completeSetup:this.completeSetup,isSiteKitConnected:c,isAuthenticated:n,isVerified:i,needReauthenticate:r,hasSearchConsoleProperty:s,setErrorMessage:this.setErrorMessage,resetAndRestart:u.clientCredentials?this.resetAndRestart:void 0}),p=a,h=!p&&!n;return React.createElement(f.Fragment,null,React.createElement(R.a,null),React.createElement("div",{className:"googlesitekit-wizard"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(b.a,null,React.createElement("section",{className:"googlesitekit-wizard-progress"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},p&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-wizard-progress__steps"},Object.keys(u).map((function(t,a){return React.createElement(X,{key:u[t].title,currentStep:d===t,title:u[t].title,step:a+1,status:e.stepStatus(u,t),warning:u[t].warning,error:u[t].error,stepKey:t})})))))),h&&React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h1",{className:"googlesitekit-setup__title"},Object(v.__)("Authenticate Site Kit","google-site-kit")),React.createElement("p",{className:"googlesitekit-setup__description"},Object(v.__)("Please sign into your Google account to begin.","google-site-kit")),React.createElement(y.a,{href:"#",onClick:function(){Object(C.v)("plugin_setup","signin_with_google"),document.location=o}},Object(v.__)("Sign in with Google","google-site-kit"))))))),p&&g))))))}}]),t}(f.Component);t.default=Z},43:function(e,t,a){"use strict";a(1);var n=a(0),i=a(14);t.a=function(){var e=Object(n.__)("Need help?","google-site-kit");return React.createElement(i.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},e)}},44:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=a(21),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){return null}}]),t}(g.Component),_=Object(p.a)("googlesitekit.ErrorNotification")(h),f=a(81),k=a(12),v=a.n(k),R=a(13),y=a.n(R),b=a(67),E=a(29),C=a(22),S=a(8),w=a.n(S),N=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).menuRef=Object(g.createRef)(),a}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new C.f(this.menuRef.current),this.menu.open=e,this.menu.setDefaultFocusState(1)}},{key:"componentDidUpdate",value:function(e){var t=this.props.menuOpen;t!==e.menuOpen&&(this.menu.open=t)}},{key:"render",value:function(){var e=this.props,t=e.menuOpen,a=e.menuItems,n=e.onSelected,i=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:i,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},a.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:n.bind(null,t),onKeyDown:n.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(g.Component);N.propTypes={menuOpen:w.a.bool.isRequired,menuItems:w.a.array.isRequired,id:w.a.string.isRequired};var O=N,j=a(80),L=a(2),x=a(0),M=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},a.handleMenu=a.handleMenu.bind(y()(a)),a.handleMenuClose=a.handleMenuClose.bind(y()(a)),a.handleMenuItemSelect=a.handleMenuItemSelect.bind(y()(a)),a.handleDialog=a.handleDialog.bind(y()(a)),a.handleDialogClose=a.handleDialogClose.bind(y()(a)),a.handleUnlinkConfirm=a.handleUnlinkConfirm.bind(y()(a)),a.menuButtonRef=Object(g.createRef)(),a.menuRef=Object(g.createRef)(),a}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.removeEventListener("keyup",this.handleDialogClose)}},{key:"handleMenu",value:function(){var e=this.state.menuOpen;this.setState({menuOpen:!e})}},{key:"handleMenuClose",value:function(e){("keyup"!==e.type||27!==e.keyCode)&&"mouseup"!==e.type||this.menuButtonRef.current.buttonRef.current.contains(e.target)||this.menuRef.current.menuRef.current.contains(e.target)||this.setState({menuOpen:!1})}},{key:"handleMenuItemSelect",value:function(e,t){var a=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(a);break;default:this.handleMenu()}}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive,menuOpen:!1}}))}},{key:"handleDialogClose",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1,menuOpen:!1})}},{key:"handleUnlinkConfirm",value:function(){return v.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(L.d)(),document.location=Object(L.n)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,a=t.email,n=void 0===a?"":a,i=t.picture,r=void 0===i?"":i,s=e.proxyPermissionsURL,o=this.state,c=o.dialogActive,l=o.menuOpen;return React.createElement(g.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(E.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:r?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:r,alt:Object(x.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:l,ariaControls:"user-menu"},n),React.createElement(O,{ref:this.menuRef,menuOpen:l,menuItems:[Object(x.__)("Disconnect","google-site-kit")].concat(s?[Object(x.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(j.a,null,React.createElement(b.a,{dialogActive:c,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(x.__)("Disconnect","google-site-kit"),subtitle:Object(x.__)("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:Object(x.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(g.Component),A=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(g.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(f.a,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-phone mdc-layout-grid__cell--span-1-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e&&React.createElement(M,null))))),React.createElement(_,null))}}]),t}(g.Component);t.a=A},67:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=a(8),h=a.n(p),_=a(29),f=a(14),k=a(22),v=a(145),R=a.n(v),y=a(0),b=function(e){function t(){var e;return i()(this,t),(e=c()(this,u()(t).call(this))).state={attributes:[Object(y.__)("Audience overview","google-site-kit"),Object(y.__)("Top pages","google-site-kit"),Object(y.__)("Top acquisition sources","google-site-kit"),Object(y.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(g.createRef)(),e}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){new k.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,a=e.handleDialog,n=e.title,i=e.provides,r=e.handleConfirm,s=e.subtitle,o=e.confirmButton,c=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(R.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},n&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},n),s&&React.createElement("p",{className:"mdc-dialog__lead"},s),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},i&&i.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),c&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(y.__)("Note: ","google-site-kit")),c),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(_.a,{onClick:r,danger:!0},o||Object(y.__)("Disconnect","google-site-kit")),React.createElement(f.a,{className:"mdc-dialog__cancel-button",onClick:function(){return a()},inherit:!0},Object(y.__)("Cancel","google-site-kit"))))))))}}]),t}(g.Component);b.propTypes={dialogActive:h.a.bool,handleDialog:h.a.func,handleConfirm:h.a.func.isRequired,title:h.a.string,description:h.a.string,confirmButton:h.a.string},b.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=b},80:function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).el=document.createElement("div"),a.root=document.querySelector(".googlesitekit-plugin")||document.body,a}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(g.createPortal)(this.props.children,this.el)}}]),t}(g.Component)}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{17:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=a(8),h=a.n(p),_=a(14),f=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.title,a=e.ctaLabel,n=e.ctaLink;return React.createElement("header",{className:"googlesitekit-layout__header"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:"\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\t\t".concat(n?"mdc-layout-grid__cell--span-6-desktop":"mdc-layout-grid__cell--span-12-desktop","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--align-middle\n\t\t\t\t\t\t\t\t\t").concat(n?"":"mdc-layout-grid__cell--span-8-tablet","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\t\t")},React.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},t)),n&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "},React.createElement(_.a,{href:n,external:!0,inherit:!0},a)))))}}]),t}(g.Component);f.propTypes={title:h.a.string,ctaLabel:h.a.string,ctaLink:h.a.string},f.defaultProps={title:"",ctaLabel:"",ctaLink:""};var k=f,v=a(62),R=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLabel,a=e.ctaLink,n=e.footerContent;return React.createElement("footer",{className:"googlesitekit-layout__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},a&&t&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:t,href:a,external:!0}),n))))}}]),t}(g.Component);R.propTypes={ctaLabel:h.a.string,ctaLink:h.a.string};var y=R,b=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.header,a=e.footer,n=e.children,i=e.title,r=e.headerCtaLabel,s=e.headerCtaLink,o=e.footerCtaLabel,c=e.footerCtaLink,l=e.footerContent,u=e.className,d=e.fill,m=e.relative;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-layout\n\t\t\t\t".concat(u&&u,"\n\t\t\t\t").concat(d?"googlesitekit-layout--fill":"","\n\t\t\t\t").concat(m?"googlesitekit-layout--relative":"","\n\t\t\t")},t&&React.createElement(k,{title:i,ctaLabel:r,ctaLink:s}),n,a&&React.createElement(y,{ctaLabel:o,ctaLink:c,footerContent:l}))}}]),t}(g.Component);b.propTypes={header:h.a.bool,footer:h.a.bool,children:h.a.node.isRequired,title:h.a.string,headerCtaLabel:h.a.string,headerCtaLink:h.a.string,footerCtaLabel:h.a.string,footerCtaLink:h.a.string,footerContent:h.a.node,className:h.a.string,fill:h.a.bool,relative:h.a.bool},b.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1};t.a=b},218:function(e,t,a){"use strict";a.r(t);var n=a(11),i=a.n(n),r=a(3),s=a.n(r),o=a(4),c=a.n(o),l=a(5),u=a.n(l),d=a(6),m=a.n(d),g=a(13),p=a.n(g),h=a(7),_=a.n(h),f=a(1),k=a(12),v=a(0),R=a(44),y=a(28),b=a(17),E=a(9),C=a(2),S=a(8),w=a.n(S),N=a(14),O=a(87),j=a(43),L=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.connectURL,a=e.needReauthenticate,n=e.resetAndRestart;return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--two"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Authenticate with Google","google-site-kit")),React.createElement("p",null,Object(v.__)("Please sign into your Google account to begin.","google-site-kit")),a&&React.createElement("p",{className:"googlesitekit-error-text"},Object(v.__)("You did not grant access to one or more of the requested scopes. Please grant all scopes that you are prompted for.","google-site-kit")),React.createElement("p",null,React.createElement(y.a,{onClick:function(){Object(C.v)("plugin_setup","signin_with_google"),document.location=t}},Object(v.__)("Sign in with Google","google-site-kit")),n&&React.createElement(N.a,{className:"googlesitekit-wizard-step__back",onClick:n},Object(v.__)("Back","google-site-kit"))),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(O.a,null),React.createElement(j.a,null))))))}}]),t}(f.Component);L.propTypes={connectURL:w.a.string.isRequired,resetAndRestart:w.a.func};var x=L,M=a(72),A=a.n(M),U=a(31),P=a(22),z=function(e){function t(e){var a;s()(this,t);var n=(a=u()(this,m()(t).call(this,e))).props,i=n.isAuthenticated,r=n.shouldSetup;return a.state={loading:i&&r,loadingMsg:Object(v.__)("Getting your verified sites...","google-site-kit"),siteURL:" ",selectedURL:"",errorCode:!1,errorMsg:""},a.onProceed=a.onProceed.bind(p()(a)),a}return _()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isAuthenticated,a=e.shouldSetup;t&&a&&this.requestSitePropertyList()}},{key:"requestSitePropertyList",value:function(){var e,t,a,n,r,s=this,o=this.props.setErrorMessage;i.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return c.prev=0,c.next=3,i.a.awrap(E.c.get(E.b,"site-verification","verification"));case 3:if(e=c.sent,t=e.verified,a=e.identifier,!t){c.next=16;break}return Object(C.v)("verification_setup","verification_check_true"),c.next=10,i.a.awrap(s.insertSiteVerification(a));case 10:if(!0!==c.sent.verified){c.next=14;break}return s.props.siteVerificationSetup(!0),c.abrupt("return",!0);case 14:c.next=17;break;case 16:Object(C.v)("verification_setup","verification_check_false");case 17:s.setState({loading:!1,siteURL:a}),c.next=26;break;case 20:c.prev=20,c.t0=c.catch(0),n=c.t0.message,Object(C.z)(c.t0.message)&&(r=JSON.parse(c.t0.message),n=r.error.message||c.t0.message),o(n),s.setState({loading:!1,errorCode:c.t0.code,errorMsg:n,siteURL:googlesitekit.admin.siteURL});case 26:case"end":return c.stop()}}),null,null,[[0,20]])}},{key:"insertSiteVerification",value:function(e){return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(E.c.set(E.b,"site-verification","verification",{siteURL:e}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}))}},{key:"onProceed",value:function(){var e,t,a,n;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return e=this.props.setErrorMessage,t=this.state.siteURL?this.state.siteURL:googlesitekit.admin.siteURL,e(""),this.setState({loading:!0,loadingMsg:Object(v.__)("Verifying...","google-site-kit"),errorCode:!1,errorMsg:""}),r.prev=4,r.next=7,i.a.awrap(this.insertSiteVerification(t));case 7:!0===r.sent.verified&&(Object(C.v)("verification_setup","verification_insert_tag"),this.props.siteVerificationSetup(!0)),r.next=17;break;case 11:r.prev=11,r.t0=r.catch(4),a=r.t0.message,Object(C.z)(r.t0.message)&&(n=JSON.parse(r.t0.message),a=n.error.message||r.t0.message),e(a),this.setState({loading:!1,errorCode:r.t0.code,errorMsg:a});case 17:case"end":return r.stop()}}),null,this,[[4,11]])}},{key:"renderForm",value:function(){var e=this.state,t=e.loading,a=e.loadingMsg,n=e.siteURL,i=React.createElement(f.Fragment,null,a&&React.createElement("p",null,a),React.createElement(U.a,null));return t?i:React.createElement(f.Fragment,null,React.createElement("div",{className:"googlesitekit-wizard-step__inputs"},React.createElement(P.l,{label:Object(v.__)("Website Address","google-site-kit"),name:"siteProperty",floatingLabelClassName:"mdc-floating-label--float-above",outlined:!0,disabled:!0},React.createElement(P.b,{value:n}))),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(y.a,{onClick:this.onProceed},Object(v.__)("Continue","google-site-kit")),React.createElement(j.a,null)))}},{key:"render",value:function(){var e=this.props,a=e.isAuthenticated,n=e.shouldSetup,i=this.state.errorMsg;return n?React.createElement(f.Fragment,null,React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Verify URL","google-site-kit")),React.createElement("p",{className:"googlesitekit-wizard-step__text"},Object(v.__)("We will need to verify your URL for Site Kit.","google-site-kit")),i&&0<i.length&&React.createElement("p",{className:"googlesitekit-error-text"},i),a&&this.renderForm()):t.renderSetupDone()}}],[{key:"renderSetupDone",value:function(){return React.createElement(f.Fragment,null,React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Verify URL","google-site-kit")),React.createElement("p",{className:"googlesitekit-wizard-step__text"},Object(v.__)("Congratulations, your site has been verified!","google-site-kit")))}}]),t}(f.Component);z.propTypes={isAuthenticated:w.a.bool.isRequired,shouldSetup:w.a.bool.isRequired,siteVerificationSetup:w.a.func.isRequired,completeSetup:w.a.func,setErrorMessage:w.a.func.isRequired};var D=z,q=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=!this.props.isVerified;return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--three"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(D,A()({shouldSetup:e},this.props))))))}}]),t}(f.Component);q.propTypes={siteVerificationSetup:w.a.func.isRequired};var F=q,T=function(e){function t(e){var a;s()(this,t),a=u()(this,m()(t).call(this,e));var n=googlesitekit.admin.siteURL;return a.state={loading:!0,sites:!1,selectedURL:n,siteURL:n,connected:!1,errorCode:!1,errorMsg:""},a.handleURLSelect=a.handleURLSelect.bind(p()(a)),a.insertPropertyToSearchConsole=a.insertPropertyToSearchConsole.bind(p()(a)),a.submitPropertyEventHandler=a.submitPropertyEventHandler.bind(p()(a)),a}return _()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e,t,a,n,r,s;return i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(e=this.props,t=e.isAuthenticated,a=e.shouldSetup,t&&a){o.next=3;break}return o.abrupt("return");case 3:return o.prev=3,n=["siteRestrictedUser","siteOwner","siteFullUser"],o.next=7,i.a.awrap(E.c.get(E.b,"search-console","matched-sites"));case 7:if(r=o.sent,!(s=r.exactMatch)||!n.includes(s.permissionLevel)){o.next=13;break}return o.next=12,i.a.awrap(E.c.set(E.b,"search-console","site",{siteURL:s.siteURL}));case 12:return o.abrupt("return",this.props.searchConsoleSetup(s.siteURL));case 13:o.next=17;break;case 15:o.prev=15,o.t0=o.catch(3);case 17:this.requestSearchConsoleSiteList();case 18:case"end":return o.stop()}}),null,this,[[3,15]])}},{key:"requestSearchConsoleSiteList",value:function(){var e=this;if(!this.state.errorCode){var t,a,n,r,s=this.props.setErrorMessage;i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,i.a.awrap(E.c.get(E.b,"search-console","matched-sites"));case 3:if(t=o.sent,a=t.exactMatch,n=t.propertyMatches,!a){o.next=11;break}return o.next=9,i.a.awrap(e.insertPropertyToSearchConsole(a.siteURL));case 9:return e.props.searchConsoleSetup(a.siteURL),o.abrupt("return");case 11:r="",r=1<n.length?Object(v.sprintf)(
2
/* translators: %d: the number of matching properties. %s: URL of recommended site. */
3
+ Object(v.__)("We found %d existing accounts. We recommend using the account “%s”. Please confirm or change below to use.","google-site-kit"),n.length,n[0].siteURL):Object(v.__)("Your site has not been added to Search Console yet. Would you like to add it now?","google-site-kit"),s(r),e.setState({loading:!1,sites:n,errorCode:"no_property_matched",errorMsg:r}),o.next=21;break;case 17:o.prev=17,o.t0=o.catch(0),s(o.t0.message),e.setState({loading:!1,errorCode:o.t0.code,errorMsg:o.t0.message});case 21:case"end":return o.stop()}}),null,null,[[0,17]])}}},{key:"insertPropertyToSearchConsole",value:function(e){return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(E.c.set(E.b,"search-console","site",{siteURL:e}));case 2:Object(C.v)("search_console_setup","add_new_sc_property"),this.setState({loading:!1,connected:!0});case 4:case"end":return t.stop()}}),null,this)}},{key:"submitPropertyEventHandler",value:function(){var e=this,t=this.state.selectedURL,a=this.props.setErrorMessage;i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,i.a.awrap(e.insertPropertyToSearchConsole(t));case 3:a(""),e.props.searchConsoleSetup(t),n.next=11;break;case 7:n.prev=7,n.t0=n.catch(0),a(n.t0.message[0].message),e.setState({loading:!1,errorCode:n.t0.code,errorMsg:n.t0.message[0].message});case 11:case"end":return n.stop()}}),null,null,[[0,7]])}},{key:"handleURLSelect",value:function(e,t){this.setState({selectedURL:t.getAttribute("data-value")})}},{key:"matchedForm",value:function(){var e=this.state,t=e.sites,a=e.selectedURL,n=[{label:"",value:"",disabled:!0}];return t?(t.forEach((function(e){n.push({label:e,value:e})})),React.createElement(f.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(P.k,{enhanced:!0,name:"siteProperty",label:Object(v.__)("Choose URL","google-site-kit"),outlined:!0,onEnhancedChange:this.handleURLSelect,options:n,value:a})),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(y.a,{onClick:this.submitPropertyEventHandler},Object(v.__)("Continue","google-site-kit")),React.createElement(j.a,null)))):null}},{key:"noSiteForm",value:function(){var e=this.state.siteURL;return React.createElement(f.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(P.l,{label:Object(v.__)("Website Address","google-site-kit"),name:"siteProperty",floatingLabelClassName:"mdc-floating-label--float-above",outlined:!0,disabled:!0},React.createElement(P.b,{value:e}))),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(y.a,{onClick:this.submitPropertyEventHandler},Object(v.__)("Continue","google-site-kit")),React.createElement(j.a,null)))}},{key:"renderForm",value:function(){var e=this.state,t=e.loading,a=e.sites;return t?React.createElement(f.Fragment,null,React.createElement("p",null,Object(v.__)("We’re locating your Search Console account.","google-site-kit")),React.createElement(U.a,null)):0===a.length?this.noSiteForm():this.matchedForm()}},{key:"render",value:function(){var e=this.props,a=e.isAuthenticated,n=e.shouldSetup,i=this.state,r=i.errorMsg,s=i.connected;return!n||s?t.connected():React.createElement("section",{className:"googlesitekit-setup-module googlesitekit-setup-module--search-console"},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(v._x)("Search Console","Service name","google-site-kit")),r&&0<r.length&&React.createElement("p",{className:"googlesitekit-error-text"},r),a&&n&&this.renderForm())}}],[{key:"connected",value:function(){return React.createElement("section",{className:"googlesitekit-setup-module googlesitekit-setup-module--search-console"},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(v._x)("Search Console","Service name","google-site-kit")),React.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(v.__)("Your Search Console is set up with Site Kit.","google-site-kit")))}}]),t}(f.Component);T.propTypes={isAuthenticated:w.a.bool.isRequired,shouldSetup:w.a.bool.isRequired,searchConsoleSetup:w.a.func.isRequired,setErrorMessage:w.a.func.isRequired};var V=T,I=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.isVerified,a=e.hasSearchConsoleProperty,n=t&&!a;return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--four"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n?React.createElement(V,A()({shouldSetup:n},this.props)):V.connected()))))}}]),t}(f.Component);I.propTypes={searchConsoleSetup:w.a.func.isRequired};var K=I,B=function(e){function t(e){var a;return s()(this,t),a=u()(this,m()(t).call(this,e)),googlesitekit.setup.hasSearchConsoleProperty?Object(C.v)("plugin_setup","user_verified"):Object(C.v)("plugin_setup","site_verified"),a}return _()(t,e),c()(t,[{key:"render",value:function(){return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--five"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-5-tablet mdc-layout-grid__cell--span-9-desktop "},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Congratulations!","google-site-kit")),React.createElement("p",null,Object(v.__)("You successfully completed the Site Kit setup and connected Search Console. Check the dashboard for more services to connect.","google-site-kit")),React.createElement("div",{className:"googlesitekit-wizard-step__action"},React.createElement(y.a,{id:"wizard-step-five-proceed",onClick:this.props.completeSetup},Object(v.__)("Go to Dashboard","google-site-kit")))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-3-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement("div",{className:"googlesitekit-rocket"},React.createElement("img",{className:"googlesitekit-rocket__body",alt:"",src:googlesitekit.admin.assetsRoot+"images/rocket-body.png"}),React.createElement("img",{className:"googlesitekit-rocket__clouds",alt:"",src:googlesitekit.admin.assetsRoot+"images/rocket-clouds.png"}),React.createElement("img",{className:"googlesitekit-rocket__dust",alt:"",src:googlesitekit.admin.assetsRoot+"images/rocket-dust.png"}))))))}}]),t}(f.Component);B.propTypes={completeSetup:w.a.func.isRequired};var G=B,H={authentication:{title:Object(v.__)("Authenticate","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&!e.needReauthenticate},Component:x},verification:{title:Object(v.__)("Verify URL","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified},Component:F},seachConsoleProperty:{title:Object(v.__)("Connect Search Console","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified&&e.hasSearchConsoleProperty},Component:K},completeSetup:{title:Object(v.__)("Finish","google-site-kit"),required:!1,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified&&e.hasSearchConsoleProperty},Component:G}},W=a(20),J=a(18),Y=a.n(J),Q=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.currentStep,a=e.step,n=e.title,i=e.status,r=e.warning,s=e.error,o=e.stepKey,c=i;r?c="warning":s&&(c="error");var l=!1;switch(c){case"warning":case"error":l=Y.a.createElement(W.a,{id:"exclamation",height:"12",width:"2"});break;case"completed":l=Y.a.createElement(W.a,{id:"check",height:"12",width:"16"})}return Y.a.createElement("div",{className:"\n\t\t\t\tgooglesitekit-wizard-progress-step\n\t\t\t\tgooglesitekit-wizard-progress-step--".concat(a,"\n\t\t\t\t").concat(t?"googlesitekit-wizard-progress-step--current":"","\n\t\t\t\tgooglesitekit-wizard-progress-step--").concat(o,"\n\t\t\t")},Y.a.createElement("div",{className:"googlesitekit-wizard-progress-step__number-wrapper"},Y.a.createElement("div",{className:"\n\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number\n\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number--".concat(c,"\n\t\t\t\t\t")},Y.a.createElement("span",{className:"\n\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-text\n\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-text--".concat(c,"\n\t\t\t\t\t\t")},a),l&&Y.a.createElement("span",{className:"\n\t\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-icon\n\t\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-icon--".concat(c,"\n\t\t\t\t\t\t\t")},l))),Y.a.createElement("p",{className:"googlesitekit-wizard-progress-step__text"},n))}}]),t}(f.Component);Q.propTypes={currentStep:w.a.bool.isRequired,step:w.a.number.isRequired,title:w.a.string,status:w.a.string,warning:w.a.bool,error:w.a.bool},Q.defaultProps={title:"",status:"",warning:!1,error:!1,removeFirstStep:!1};var X=Q,Z=function(e){function t(e){var a;s()(this,t),a=u()(this,m()(t).call(this,e));var n=googlesitekit.admin.connectURL,i=googlesitekit.setup,r=i.isAuthenticated,o=i.hasSearchConsoleProperty,c=i.isSiteKitConnected,l=i.isVerified,d=i.needReauthenticate,g=googlesitekit.permissions.canSetup;return a.state={canSetup:g,isAuthenticated:r,isVerified:l,needReauthenticate:d,hasSearchConsoleProperty:o,hasSearchConsolePropertyFromTheStart:o,connectURL:n,errorMsg:"",isSiteKitConnected:c,completeSetup:!1},a.siteConnectedSetup=a.siteConnectedSetup.bind(p()(a)),a.siteVerificationSetup=a.siteVerificationSetup.bind(p()(a)),a.searchConsoleSetup=a.searchConsoleSetup.bind(p()(a)),a.resetAndRestart=a.resetAndRestart.bind(p()(a)),a.completeSetup=a.completeSetup.bind(p()(a)),a.setErrorMessage=a.setErrorMessage.bind(p()(a)),a}return _()(t,e),c()(t,[{key:"resetAndRestart",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(E.c.set(E.a,"site","reset"));case 2:Object(C.c)(),this.setState({isSiteKitConnected:!1,isAuthenticated:!1,isVerified:!1,hasSearchConsoleProperty:!1,completeSetup:!1,errorMsg:""});case 4:case"end":return e.stop()}}),null,this)}},{key:"completeSetup",value:function(){this.setState({completeSetup:!0})}},{key:"siteConnectedSetup",value:function(e){this.setState({isSiteKitConnected:e})}},{key:"siteVerificationSetup",value:function(e){this.setState({isVerified:e})}},{key:"searchConsoleSetup",value:function(e){this.setState({hasSearchConsoleProperty:e})}},{key:"isSetupFinished",value:function(){var e=this.state,t=e.isSiteKitConnected,a=e.isAuthenticated,n=e.isVerified,i=e.hasSearchConsoleProperty,r=e.completeSetup;return t&&a&&n&&i&&r}},{key:"setErrorMessage",value:function(e){this.setState({errorMsg:e})}},{key:"getApplicableSteps",value:function(){var e,t=H,a=Object.keys(t);for(e=0;e<a.length;e++)t[a[e]].isApplicable(this.state)||delete t[a[e]];return t}},{key:"currentStep",value:function(e){var t,a=Object.keys(e);for(t=0;t<a.length-1;t++)if(!e[a[t]].isCompleted(this.state))return a[t];return a[t]}},{key:"stepStatus",value:function(e,t){return e[t].isCompleted(this.state)?"completed":t===this.currentStep(e)?"inprogress":""}},{key:"render",value:function(){var e=this,t=this.state,a=t.canSetup,n=t.isAuthenticated,i=t.isVerified,r=t.needReauthenticate,s=t.hasSearchConsoleProperty,o=t.connectURL,c=t.isSiteKitConnected;if(this.isSetupFinished()){var l=Object(C.m)("googlesitekit-dashboard",{notification:"authentication_success"});Object(k.delay)((function(){window.location.replace(l)}),500,"later")}var u=this.getApplicableSteps(),d=this.currentStep(u),m=u[d].Component,g=React.createElement(m,{siteConnectedSetup:this.siteConnectedSetup,connectURL:o,siteVerificationSetup:this.siteVerificationSetup,searchConsoleSetup:this.searchConsoleSetup,completeSetup:this.completeSetup,isSiteKitConnected:c,isAuthenticated:n,isVerified:i,needReauthenticate:r,hasSearchConsoleProperty:s,setErrorMessage:this.setErrorMessage,resetAndRestart:u.clientCredentials?this.resetAndRestart:void 0}),p=a,h=!p&&!n;return React.createElement(f.Fragment,null,React.createElement(R.a,null),React.createElement("div",{className:"googlesitekit-wizard"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(b.a,null,React.createElement("section",{className:"googlesitekit-wizard-progress"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},p&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-wizard-progress__steps"},Object.keys(u).map((function(t,a){return React.createElement(X,{key:u[t].title,currentStep:d===t,title:u[t].title,step:a+1,status:e.stepStatus(u,t),warning:u[t].warning,error:u[t].error,stepKey:t})})))))),h&&React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h1",{className:"googlesitekit-setup__title"},Object(v.__)("Authenticate Site Kit","google-site-kit")),React.createElement("p",{className:"googlesitekit-setup__description"},Object(v.__)("Please sign into your Google account to begin.","google-site-kit")),React.createElement(y.a,{href:"#",onClick:function(){Object(C.v)("plugin_setup","signin_with_google"),document.location=o}},Object(v.__)("Sign in with Google","google-site-kit"))))))),p&&g))))))}}]),t}(f.Component);t.default=Z},43:function(e,t,a){"use strict";a(1);var n=a(0),i=a(14);t.a=function(){var e=Object(n.__)("Need help?","google-site-kit");return React.createElement(i.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},e)}},44:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=a(21),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){return null}}]),t}(g.Component),_=Object(p.a)("googlesitekit.ErrorNotification")(h),f=a(71),k=a(11),v=a.n(k),R=a(13),y=a.n(R),b=a(70),E=a(28),C=a(22),S=a(8),w=a.n(S),N=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).menuRef=Object(g.createRef)(),a}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new C.f(this.menuRef.current),this.menu.open=e,this.menu.setDefaultFocusState(1)}},{key:"componentDidUpdate",value:function(e){var t=this.props.menuOpen;t!==e.menuOpen&&(this.menu.open=t)}},{key:"render",value:function(){var e=this.props,t=e.menuOpen,a=e.menuItems,n=e.onSelected,i=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:i,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},a.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:n.bind(null,t),onKeyDown:n.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(g.Component);N.propTypes={menuOpen:w.a.bool.isRequired,menuItems:w.a.array.isRequired,id:w.a.string.isRequired};var O=N,j=a(85),L=a(2),x=a(0),M=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},a.handleMenu=a.handleMenu.bind(y()(a)),a.handleMenuClose=a.handleMenuClose.bind(y()(a)),a.handleMenuItemSelect=a.handleMenuItemSelect.bind(y()(a)),a.handleDialog=a.handleDialog.bind(y()(a)),a.handleDialogClose=a.handleDialogClose.bind(y()(a)),a.handleUnlinkConfirm=a.handleUnlinkConfirm.bind(y()(a)),a.menuButtonRef=Object(g.createRef)(),a.menuRef=Object(g.createRef)(),a}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.removeEventListener("keyup",this.handleDialogClose)}},{key:"handleMenu",value:function(){var e=this.state.menuOpen;this.setState({menuOpen:!e})}},{key:"handleMenuClose",value:function(e){("keyup"!==e.type||27!==e.keyCode)&&"mouseup"!==e.type||this.menuButtonRef.current.buttonRef.current.contains(e.target)||this.menuRef.current.menuRef.current.contains(e.target)||this.setState({menuOpen:!1})}},{key:"handleMenuItemSelect",value:function(e,t){var a=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(a);break;default:this.handleMenu()}}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive,menuOpen:!1}}))}},{key:"handleDialogClose",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1,menuOpen:!1})}},{key:"handleUnlinkConfirm",value:function(){return v.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(L.c)(),document.location=Object(L.m)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,a=t.email,n=void 0===a?"":a,i=t.picture,r=void 0===i?"":i,s=e.proxyPermissionsURL,o=this.state,c=o.dialogActive,l=o.menuOpen;return React.createElement(g.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(E.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:r?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:r,alt:Object(x.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:l,ariaControls:"user-menu"},n),React.createElement(O,{ref:this.menuRef,menuOpen:l,menuItems:[Object(x.__)("Disconnect","google-site-kit")].concat(s?[Object(x.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(j.a,null,React.createElement(b.a,{dialogActive:c,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(x.__)("Disconnect","google-site-kit"),subtitle:Object(x.__)("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:Object(x.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(g.Component),A=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(g.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(f.a,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-phone mdc-layout-grid__cell--span-1-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e&&React.createElement(M,null))))),React.createElement(_,null))}}]),t}(g.Component);t.a=A},70:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=a(8),h=a.n(p),_=a(28),f=a(14),k=a(22),v=a(155),R=a.n(v),y=a(0),b=function(e){function t(){var e;return i()(this,t),(e=c()(this,u()(t).call(this))).state={attributes:[Object(y.__)("Audience overview","google-site-kit"),Object(y.__)("Top pages","google-site-kit"),Object(y.__)("Top acquisition sources","google-site-kit"),Object(y.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(g.createRef)(),e}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){new k.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,a=e.handleDialog,n=e.title,i=e.provides,r=e.handleConfirm,s=e.subtitle,o=e.confirmButton,c=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(R.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},n&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},n),s&&React.createElement("p",{className:"mdc-dialog__lead"},s),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},i&&i.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),c&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(y.__)("Note: ","google-site-kit")),c),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(_.a,{onClick:r,danger:!0},o||Object(y.__)("Disconnect","google-site-kit")),React.createElement(f.a,{className:"mdc-dialog__cancel-button",onClick:function(){return a()},inherit:!0},Object(y.__)("Cancel","google-site-kit"))))))))}}]),t}(g.Component);b.propTypes={dialogActive:h.a.bool,handleDialog:h.a.func,handleConfirm:h.a.func.isRequired,title:h.a.string,description:h.a.string,confirmButton:h.a.string},b.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=b},85:function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).el=document.createElement("div"),a.root=document.querySelector(".googlesitekit-plugin")||document.body,a}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(g.createPortal)(this.props.children,this.el)}}]),t}(g.Component)},87:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(13),m=a.n(d),g=a(7),p=a.n(g),h=a(1),_=a(22),f=a(8),k=a.n(f),v=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).formFieldRef=Object(h.createRef)(),a.checkboxRef=Object(h.createRef)(),a}return p()(t,e),s()(t,[{key:"componentDidMount",value:function(){new _.e(this.formFieldRef.current).input=new _.c(this.checkboxRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onChange,a=e.id,n=e.name,i=e.value,r=e.checked,s=e.disabled,o=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-checkbox\n\t\t\t\t\t\t".concat(s?"mdc-checkbox--disabled":"","\n\t\t\t\t\t"),ref:this.checkboxRef},React.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:a,name:n,value:i,checked:r,disabled:s,onChange:t}),React.createElement("div",{className:"mdc-checkbox__background"},React.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},React.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),React.createElement("div",{className:"mdc-checkbox__mixedmark"}))),React.createElement("label",{htmlFor:a},o))}}]),t}(h.Component);v.propTypes={onChange:k.a.func.isRequired,id:k.a.string.isRequired,name:k.a.string.isRequired,value:k.a.string.isRequired,checked:k.a.bool,disabled:k.a.bool,children:k.a.node.isRequired},v.defaultProps={checked:!1,disabled:!1};var R=v,y=a(33),b=a.n(y),E=a(0),C=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).state={scriptOnPage:!!window.googlesitekitTrackingEnabled,optIn:!!window.googlesitekitTrackingEnabled,error:!1},a.handleOptIn=a.handleOptIn.bind(m()(a)),a}return p()(t,e),s()(t,[{key:"handleOptIn",value:function(e){var t=this,a=e.target.checked,n={googlesitekit_tracking_optin:a};b()({path:"/wp/v2/settings",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(n),method:"POST"}).then((function(){if(window.googlesitekitTrackingEnabled=!!a,a&&!t.state.scriptOnPage){var e=window.document;if(!e)return;e.body.insertAdjacentHTML("beforeend",'\n\t\t\t\t\t\t<script async src="https://www.googletagmanager.com/gtag/js?id='.concat(googlesitekit.admin.trackingID,'"><\/script>\n\t\t\t\t\t')),e.body.insertAdjacentHTML("beforeend","\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\t\t\tgtag('config', '".concat(googlesitekit.admin.trackingID,"');\n\t\t\t\t\t\t<\/script>\n\t\t\t\t\t"))}t.setState({optIn:!!a,error:!1,scriptOnPage:!0})})).catch((function(a){t.setState({optIn:!e.target.checked,error:{errorCode:a.code,errorMsg:a.message}})}))}},{key:"render",value:function(){var e=this.state,t=e.optIn,a=e.error,n=this.props,i=n.id,r=n.name;return React.createElement("div",{className:"googlesitekit-opt-in"},React.createElement(R,{id:i,name:r,value:"1",checked:t,onChange:this.handleOptIn},Object(E.__)("Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with ","google-site-kit"),React.createElement("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer"},Object(E.__)("Google Privacy Policy","google-site-kit")),"."),a&&React.createElement("div",{className:"googlesitekit-error-text"},a.errorMsg))}}]),t}(h.Component);C.propTypes={id:k.a.string,name:k.a.string},C.defaultProps={id:"googlesitekit-opt-in",name:"optIn"};t.a=C}}]);
dist/assets/js/chunk-googlesitekit-setup-wrapper.js CHANGED
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{156:function(e,t,n){"use strict";n.r(t);var i=n(13),a=n.n(i),l=n(3),o=n.n(l),c=n(4),s=n.n(c),r=n(5),u=n.n(r),d=n(6),m=n.n(d),g=n(7),h=n.n(g),p=n(1),f=n(11),v=n(44),_=n(14),k=n(43),R=n(2),y=n(21),E=n(0),b=n(10),w=function(e){function t(){return o()(this,t),u()(this,m()(t).apply(this,arguments))}return h()(t,e),s()(t,[{key:"render",value:function(){var e=this.props.children;return React.createElement(p.Fragment,null,e)}}]),t}(p.Component),N=function(e){function t(e){var n;o()(this,t),n=u()(this,m()(t).call(this,e));var i=googlesitekit.setup.moduleToSetup;return n.state={currentModule:i,refresh:!1},n.timeoutID=null,n.unfocusedTime=0,n.autoRefreshModules=Object(b.applyFilters)("googlesitekit.autoRefreshModules",[]),n.moduleRefresh=n.autoRefreshModules.find((function(e){return n.state.currentModule===e.identifier})),n.refreshStatus=n.refreshStatus.bind(a()(n)),n.startUnfocusedTimer=n.startUnfocusedTimer.bind(a()(n)),n}return h()(t,e),s()(t,[{key:"componentDidMount",value:function(){window.addEventListener("focus",this.refreshStatus),window.addEventListener("blur",this.startUnfocusedTimer)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("focus",this.refreshStatus),window.removeEventListener("blur",this.startUnfocusedTimer)}},{key:"startUnfocusedTimer",value:function(){var e=this;if(this.moduleRefresh){var t=!0;this.moduleRefresh.toRefresh&&(t=this.moduleRefresh.toRefresh()),t&&(this.timeoutID=window.setInterval((function(){e.unfocusedTime++}),1e3))}}},{key:"refreshStatus",value:function(){if(this.moduleRefresh){var e=this.moduleRefresh.idleTime||15,t=!0;this.moduleRefresh.toRefresh&&(t=this.moduleRefresh.toRefresh()),t&&(e<this.unfocusedTime&&this.setState({refresh:this.timeoutID}),window.clearTimeout(this.timeoutID),this.unfocusedTime=0,this.timeoutID=null)}}},{key:"render",value:function(){var e=this.state.currentModule,n=t.loadSetupModule(e),i=Object(R.n)("googlesitekit-settings",{});return React.createElement(p.Fragment,null,React.createElement(v.a,null),React.createElement("div",{className:"googlesitekit-setup"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("section",{className:"googlesitekit-setup__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("p",{className:" googlesitekit-setup__intro-title googlesitekit-overline "},Object(E.__)("Connect Service","google-site-kit")),n))),React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(_.a,{id:"setup-".concat(e,"-cancel"),href:i},Object(E.__)("Cancel","google-site-kit"))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--align-right "},React.createElement(k.a,null)))))))))))}}],[{key:"loadSetupModule",value:function(e){var n=Object(y.a)("googlesitekit.ModuleSetup-".concat(e))(w);return React.createElement(n,{finishSetup:t.finishSetup,onSettingsPage:!1,isEditing:!0})}},{key:"finishSetup",value:function(){var e={notification:"authentication_success"};googlesitekit.setup&&googlesitekit.setup.moduleToSetup&&(e.slug=googlesitekit.setup.moduleToSetup);var t=Object(R.n)("googlesitekit-dashboard",e);Object(f.delay)((function(){window.location.replace(t)}),500,"later")}}]),t}(p.Component);t.default=N},43:function(e,t,n){"use strict";n(1);var i=n(0),a=n(14);t.a=function(){var e=Object(i.__)("Need help?","google-site-kit");return React.createElement(a.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},e)}},44:function(e,t,n){"use strict";var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),s=n.n(c),r=n(6),u=n.n(r),d=n(7),m=n.n(d),g=n(1),h=n(21),p=function(e){function t(){return a()(this,t),s()(this,u()(t).apply(this,arguments))}return m()(t,e),o()(t,[{key:"render",value:function(){return null}}]),t}(g.Component),f=Object(h.a)("googlesitekit.ErrorNotification")(p),v=n(81),_=n(12),k=n.n(_),R=n(13),y=n.n(R),E=n(67),b=n(29),w=n(22),N=n(8),O=n.n(N),C=function(e){function t(e){var n;return a()(this,t),(n=s()(this,u()(t).call(this,e))).menuRef=Object(g.createRef)(),n}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new w.f(this.menuRef.current),this.menu.open=e,this.menu.setDefaultFocusState(1)}},{key:"componentDidUpdate",value:function(e){var t=this.props.menuOpen;t!==e.menuOpen&&(this.menu.open=t)}},{key:"render",value:function(){var e=this.props,t=e.menuOpen,n=e.menuItems,i=e.onSelected,a=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:a,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},n.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:i.bind(null,t),onKeyDown:i.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(g.Component);C.propTypes={menuOpen:O.a.bool.isRequired,menuItems:O.a.array.isRequired,id:O.a.string.isRequired};var D=C,S=n(80),M=n(2),j=n(0),T=function(e){function t(e){var n;return a()(this,t),(n=s()(this,u()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},n.handleMenu=n.handleMenu.bind(y()(n)),n.handleMenuClose=n.handleMenuClose.bind(y()(n)),n.handleMenuItemSelect=n.handleMenuItemSelect.bind(y()(n)),n.handleDialog=n.handleDialog.bind(y()(n)),n.handleDialogClose=n.handleDialogClose.bind(y()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(y()(n)),n.menuButtonRef=Object(g.createRef)(),n.menuRef=Object(g.createRef)(),n}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.removeEventListener("keyup",this.handleDialogClose)}},{key:"handleMenu",value:function(){var e=this.state.menuOpen;this.setState({menuOpen:!e})}},{key:"handleMenuClose",value:function(e){("keyup"!==e.type||27!==e.keyCode)&&"mouseup"!==e.type||this.menuButtonRef.current.buttonRef.current.contains(e.target)||this.menuRef.current.menuRef.current.contains(e.target)||this.setState({menuOpen:!1})}},{key:"handleMenuItemSelect",value:function(e,t){var n=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(n);break;default:this.handleMenu()}}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive,menuOpen:!1}}))}},{key:"handleDialogClose",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1,menuOpen:!1})}},{key:"handleUnlinkConfirm",value:function(){return k.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(M.d)(),document.location=Object(M.n)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,n=t.email,i=void 0===n?"":n,a=t.picture,l=void 0===a?"":a,o=e.proxyPermissionsURL,c=this.state,s=c.dialogActive,r=c.menuOpen;return React.createElement(g.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(b.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:l?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:l,alt:Object(j.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:r,ariaControls:"user-menu"},i),React.createElement(D,{ref:this.menuRef,menuOpen:r,menuItems:[Object(j.__)("Disconnect","google-site-kit")].concat(o?[Object(j.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(S.a,null,React.createElement(E.a,{dialogActive:s,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(j.__)("Disconnect","google-site-kit"),subtitle:Object(j.__)("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:Object(j.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(g.Component),A=function(e){function t(){return a()(this,t),s()(this,u()(t).apply(this,arguments))}return m()(t,e),o()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(g.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(v.a,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-phone mdc-layout-grid__cell--span-1-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e&&React.createElement(T,null))))),React.createElement(f,null))}}]),t}(g.Component);t.a=A},67:function(e,t,n){"use strict";var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),s=n.n(c),r=n(6),u=n.n(r),d=n(7),m=n.n(d),g=n(1),h=n(8),p=n.n(h),f=n(29),v=n(14),_=n(22),k=n(145),R=n.n(k),y=n(0),E=function(e){function t(){var e;return a()(this,t),(e=s()(this,u()(t).call(this))).state={attributes:[Object(y.__)("Audience overview","google-site-kit"),Object(y.__)("Top pages","google-site-kit"),Object(y.__)("Top acquisition sources","google-site-kit"),Object(y.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(g.createRef)(),e}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){new _.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,n=e.handleDialog,i=e.title,a=e.provides,l=e.handleConfirm,o=e.subtitle,c=e.confirmButton,s=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(R.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},i&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},i),o&&React.createElement("p",{className:"mdc-dialog__lead"},o),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},a&&a.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),s&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(y.__)("Note: ","google-site-kit")),s),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(f.a,{onClick:l,danger:!0},c||Object(y.__)("Disconnect","google-site-kit")),React.createElement(v.a,{className:"mdc-dialog__cancel-button",onClick:function(){return n()},inherit:!0},Object(y.__)("Cancel","google-site-kit"))))))))}}]),t}(g.Component);E.propTypes={dialogActive:p.a.bool,handleDialog:p.a.func,handleConfirm:p.a.func.isRequired,title:p.a.string,description:p.a.string,confirmButton:p.a.string},E.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=E},80:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),s=n.n(c),r=n(6),u=n.n(r),d=n(7),m=n.n(d),g=n(1),h=function(e){function t(e){var n;return a()(this,t),(n=s()(this,u()(t).call(this,e))).el=document.createElement("div"),n.root=document.querySelector(".googlesitekit-plugin")||document.body,n}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(g.createPortal)(this.props.children,this.el)}}]),t}(g.Component)},81:function(e,t,n){"use strict";n(1);var i=n(20),a=n(0);t.a=function(){return React.createElement("div",{className:"googlesitekit-logo","aria-hidden":"true"},React.createElement(i.a,{id:"logo-g",className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),React.createElement(i.a,{id:"logo-sitekit",className:"\n\t\t\t\t googlesitekit-logo__logo-sitekit\n\t\t\t\t",height:"26",width:"99"}),React.createElement("span",{className:"screen-reader-text"},Object(a.__)("Site Kit by Google Logo","google-site-kit")))}}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{172:function(e,t,n){"use strict";n.r(t);var i=n(13),a=n.n(i),l=n(3),o=n.n(l),c=n(4),s=n.n(c),r=n(5),u=n.n(r),d=n(6),m=n.n(d),g=n(7),h=n.n(g),p=n(1),f=n(12),v=n(44),_=n(14),k=n(43),R=n(2),y=n(21),E=n(0),b=n(10),w=function(e){function t(){return o()(this,t),u()(this,m()(t).apply(this,arguments))}return h()(t,e),s()(t,[{key:"render",value:function(){var e=this.props.children;return React.createElement(p.Fragment,null,e)}}]),t}(p.Component),N=function(e){function t(e){var n;o()(this,t),n=u()(this,m()(t).call(this,e));var i=googlesitekit.setup.moduleToSetup;return n.state={currentModule:i,refresh:!1},n.timeoutID=null,n.unfocusedTime=0,n.autoRefreshModules=Object(b.applyFilters)("googlesitekit.autoRefreshModules",[]),n.moduleRefresh=n.autoRefreshModules.find((function(e){return n.state.currentModule===e.identifier})),n.refreshStatus=n.refreshStatus.bind(a()(n)),n.startUnfocusedTimer=n.startUnfocusedTimer.bind(a()(n)),n}return h()(t,e),s()(t,[{key:"componentDidMount",value:function(){window.addEventListener("focus",this.refreshStatus),window.addEventListener("blur",this.startUnfocusedTimer)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("focus",this.refreshStatus),window.removeEventListener("blur",this.startUnfocusedTimer)}},{key:"startUnfocusedTimer",value:function(){var e=this;if(this.moduleRefresh){var t=!0;this.moduleRefresh.toRefresh&&(t=this.moduleRefresh.toRefresh()),t&&(this.timeoutID=window.setInterval((function(){e.unfocusedTime++}),1e3))}}},{key:"refreshStatus",value:function(){if(this.moduleRefresh){var e=this.moduleRefresh.idleTime||15,t=!0;this.moduleRefresh.toRefresh&&(t=this.moduleRefresh.toRefresh()),t&&(e<this.unfocusedTime&&this.setState({refresh:this.timeoutID}),window.clearTimeout(this.timeoutID),this.unfocusedTime=0,this.timeoutID=null)}}},{key:"render",value:function(){var e=this.state.currentModule,n=t.loadSetupModule(e),i=Object(R.m)("googlesitekit-settings",{});return React.createElement(p.Fragment,null,React.createElement(v.a,null),React.createElement("div",{className:"googlesitekit-setup"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("section",{className:"googlesitekit-setup__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("p",{className:" googlesitekit-setup__intro-title googlesitekit-overline "},Object(E.__)("Connect Service","google-site-kit")),n))),React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(_.a,{id:"setup-".concat(e,"-cancel"),href:i},Object(E.__)("Cancel","google-site-kit"))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--align-right "},React.createElement(k.a,null)))))))))))}}],[{key:"loadSetupModule",value:function(e){var n=Object(y.a)("googlesitekit.ModuleSetup-".concat(e))(w);return React.createElement(n,{finishSetup:t.finishSetup,onSettingsPage:!1,isEditing:!0})}},{key:"finishSetup",value:function(){var e={notification:"authentication_success"};googlesitekit.setup&&googlesitekit.setup.moduleToSetup&&(e.slug=googlesitekit.setup.moduleToSetup);var t=Object(R.m)("googlesitekit-dashboard",e);Object(f.delay)((function(){window.location.replace(t)}),500,"later")}}]),t}(p.Component);t.default=N},43:function(e,t,n){"use strict";n(1);var i=n(0),a=n(14);t.a=function(){var e=Object(i.__)("Need help?","google-site-kit");return React.createElement(a.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},e)}},44:function(e,t,n){"use strict";var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),s=n.n(c),r=n(6),u=n.n(r),d=n(7),m=n.n(d),g=n(1),h=n(21),p=function(e){function t(){return a()(this,t),s()(this,u()(t).apply(this,arguments))}return m()(t,e),o()(t,[{key:"render",value:function(){return null}}]),t}(g.Component),f=Object(h.a)("googlesitekit.ErrorNotification")(p),v=n(71),_=n(11),k=n.n(_),R=n(13),y=n.n(R),E=n(70),b=n(28),w=n(22),N=n(8),O=n.n(N),C=function(e){function t(e){var n;return a()(this,t),(n=s()(this,u()(t).call(this,e))).menuRef=Object(g.createRef)(),n}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new w.f(this.menuRef.current),this.menu.open=e,this.menu.setDefaultFocusState(1)}},{key:"componentDidUpdate",value:function(e){var t=this.props.menuOpen;t!==e.menuOpen&&(this.menu.open=t)}},{key:"render",value:function(){var e=this.props,t=e.menuOpen,n=e.menuItems,i=e.onSelected,a=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:a,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},n.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:i.bind(null,t),onKeyDown:i.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(g.Component);C.propTypes={menuOpen:O.a.bool.isRequired,menuItems:O.a.array.isRequired,id:O.a.string.isRequired};var D=C,S=n(85),M=n(2),j=n(0),T=function(e){function t(e){var n;return a()(this,t),(n=s()(this,u()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},n.handleMenu=n.handleMenu.bind(y()(n)),n.handleMenuClose=n.handleMenuClose.bind(y()(n)),n.handleMenuItemSelect=n.handleMenuItemSelect.bind(y()(n)),n.handleDialog=n.handleDialog.bind(y()(n)),n.handleDialogClose=n.handleDialogClose.bind(y()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(y()(n)),n.menuButtonRef=Object(g.createRef)(),n.menuRef=Object(g.createRef)(),n}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.removeEventListener("keyup",this.handleDialogClose)}},{key:"handleMenu",value:function(){var e=this.state.menuOpen;this.setState({menuOpen:!e})}},{key:"handleMenuClose",value:function(e){("keyup"!==e.type||27!==e.keyCode)&&"mouseup"!==e.type||this.menuButtonRef.current.buttonRef.current.contains(e.target)||this.menuRef.current.menuRef.current.contains(e.target)||this.setState({menuOpen:!1})}},{key:"handleMenuItemSelect",value:function(e,t){var n=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(n);break;default:this.handleMenu()}}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive,menuOpen:!1}}))}},{key:"handleDialogClose",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1,menuOpen:!1})}},{key:"handleUnlinkConfirm",value:function(){return k.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(M.c)(),document.location=Object(M.m)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,n=t.email,i=void 0===n?"":n,a=t.picture,l=void 0===a?"":a,o=e.proxyPermissionsURL,c=this.state,s=c.dialogActive,r=c.menuOpen;return React.createElement(g.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(b.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:l?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:l,alt:Object(j.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:r,ariaControls:"user-menu"},i),React.createElement(D,{ref:this.menuRef,menuOpen:r,menuItems:[Object(j.__)("Disconnect","google-site-kit")].concat(o?[Object(j.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(S.a,null,React.createElement(E.a,{dialogActive:s,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(j.__)("Disconnect","google-site-kit"),subtitle:Object(j.__)("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:Object(j.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(g.Component),A=function(e){function t(){return a()(this,t),s()(this,u()(t).apply(this,arguments))}return m()(t,e),o()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(g.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(v.a,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-phone mdc-layout-grid__cell--span-1-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e&&React.createElement(T,null))))),React.createElement(f,null))}}]),t}(g.Component);t.a=A},70:function(e,t,n){"use strict";var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),s=n.n(c),r=n(6),u=n.n(r),d=n(7),m=n.n(d),g=n(1),h=n(8),p=n.n(h),f=n(28),v=n(14),_=n(22),k=n(155),R=n.n(k),y=n(0),E=function(e){function t(){var e;return a()(this,t),(e=s()(this,u()(t).call(this))).state={attributes:[Object(y.__)("Audience overview","google-site-kit"),Object(y.__)("Top pages","google-site-kit"),Object(y.__)("Top acquisition sources","google-site-kit"),Object(y.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(g.createRef)(),e}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){new _.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,n=e.handleDialog,i=e.title,a=e.provides,l=e.handleConfirm,o=e.subtitle,c=e.confirmButton,s=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(R.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},i&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},i),o&&React.createElement("p",{className:"mdc-dialog__lead"},o),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},a&&a.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),s&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(y.__)("Note: ","google-site-kit")),s),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(f.a,{onClick:l,danger:!0},c||Object(y.__)("Disconnect","google-site-kit")),React.createElement(v.a,{className:"mdc-dialog__cancel-button",onClick:function(){return n()},inherit:!0},Object(y.__)("Cancel","google-site-kit"))))))))}}]),t}(g.Component);E.propTypes={dialogActive:p.a.bool,handleDialog:p.a.func,handleConfirm:p.a.func.isRequired,title:p.a.string,description:p.a.string,confirmButton:p.a.string},E.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=E},71:function(e,t,n){"use strict";n(1);var i=n(20),a=n(0);t.a=function(){return React.createElement("div",{className:"googlesitekit-logo","aria-hidden":"true"},React.createElement(i.a,{id:"logo-g",className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),React.createElement(i.a,{id:"logo-sitekit",className:"\n\t\t\t\t googlesitekit-logo__logo-sitekit\n\t\t\t\t",height:"26",width:"99"}),React.createElement("span",{className:"screen-reader-text"},Object(a.__)("Site Kit by Google Logo","google-site-kit")))}},85:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),s=n.n(c),r=n(6),u=n.n(r),d=n(7),m=n.n(d),g=n(1),h=function(e){function t(e){var n;return a()(this,t),(n=s()(this,u()(t).call(this,e))).el=document.createElement("div"),n.root=document.querySelector(".googlesitekit-plugin")||document.body,n}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(g.createPortal)(this.props.children,this.el)}}]),t}(g.Component)}}]);
dist/assets/js/commons.js CHANGED
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{14:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.dangerouslySetInnerHTML,n=e.onClick,a=e.href,i=e.children,o=e.className,r=e.arrow,s=e.external,c=e.inverse,l=e.back,u=e.small,d=e.inherit,g=e.caps,m=e.danger,p=e.disabled,h=e.id,f=a&&!p,b=f?"a":"button";return React.createElement(b,{className:"\n\t\t\t\t\tgooglesitekit-cta-link\n\t\t\t\t\t".concat(o||"","\n\t\t\t\t\t").concat(r?"googlesitekit-cta-link--arrow":"","\n\t\t\t\t\t").concat(s?"googlesitekit-cta-link--external":"","\n\t\t\t\t\t").concat(c?"googlesitekit-cta-link--inverse":"","\n\t\t\t\t\t").concat(l?"googlesitekit-cta-link--back":"","\n\t\t\t\t\t").concat(u?"googlesitekit-cta-link--small":"","\n\t\t\t\t\t").concat(d?"googlesitekit-cta-link--inherit":"","\n\t\t\t\t\t").concat(g?"googlesitekit-cta-link--caps":"","\n\t\t\t\t\t").concat(m?"googlesitekit-cta-link--danger":"","\n\t\t\t\t\t").concat(p?"googlesitekit-cta-link--disabled":"","\n\t\t\t\t"),onClick:n,id:h,href:f?a:void 0,target:f&&s?"_blank":void 0,rel:s?"noopener noreferrer":void 0,disabled:p,dangerouslySetInnerHTML:t},i)}}]),t}(m.Component);f.propTypes={dangerouslySetInnerHTML:h.a.shape({__html:h.a.string}),onClick:h.a.func,href:h.a.string,children:h.a.oneOfType([h.a.string.isRequired,h.a.array.isRequired]),className:h.a.string,arrow:h.a.bool,external:h.a.bool,inverse:h.a.bool,back:h.a.bool,small:h.a.bool,inherit:h.a.bool,caps:h.a.bool,danger:h.a.bool,disabled:h.a.bool},f.defaultProps={dangerouslySetInnerHTML:void 0,onClick:null,href:"",className:"",arrow:!1,external:!1,inverse:!1,back:!1,small:!1,inherit:!1,caps:!1,danger:!1,disabled:!1},t.a=f},15:function(e,t,n){"use strict";n.r(t),n.d(t,"extractAnalyticsDataForTrafficChart",(function(){return r})),n.d(t,"extractAnalyticsDashboardData",(function(){return c})),n.d(t,"extractAnalyticsDashboardSparklineData",(function(){return l})),n.d(t,"calculateOverviewData",(function(){return u})),n.d(t,"translateAnalyticsError",(function(){return d})),n.d(t,"getAnalyticsErrorMessageFromData",(function(){return g})),n.d(t,"isDataZeroForReporting",(function(){return m})),n.d(t,"analyticsAdsenseReportDataDefaults",(function(){return p})),n.d(t,"siteAnalyticsReportDataDefaults",(function(){return h})),n.d(t,"overviewReportDataDefaults",(function(){return f})),n.d(t,"trafficSourcesReportDataDefaults",(function(){return b})),n.d(t,"getTopPagesReportDataDefaults",(function(){return v}));var a=n(2),i=n(11),o=n(0),r=function(e){if(!e||!e.length)return null;var t=e[0].data,n=t.rows,a=t.totals[0].values[0],o=[["Source","Percent"]];return Object(i.each)(n,(function(e){var t=e.metrics[0].values[0]/a;if(1>100*t)return!1;var n=e.dimensions[0].replace(/\(none\)/gi,"direct");o.push([n,t])})),o};function s(e,t){var n=[];return Object(i.each)(e,(function(e){if(e.metrics){var a=e.metrics[0].values,i=e.dimensions[0],o=i.slice(0,4)+"-"+i.slice(4,6)+"-"+i.slice(6,8),r=new Date(o);n.push([r,a[t]])}})),n}var c=function(e,t,n){if(!e||!e.length)return null;var a=e[0].data.rows;if(!a)return!1;var r=a.length;if(2*n>r){for(var c=new Date,l=0;n>l;l++){var u=(c.getMonth()+1).toString(),d=c.getDate().toString(),g=c.getFullYear().toString()+(2>u.length?"0":"")+u+(2>d.length?"0":"")+d;if(l>r){var m={dimensions:[g],metrics:[{values:[0,0,0,0,0]}]};a.unshift(m)}c.setDate(c.getDate()-1)}a.push([0,0])}var p=[Object(o.__)("Users","google-site-kit"),Object(o.__)("Sessions","google-site-kit"),Object(o.__)("Bounce Rate","google-site-kit"),Object(o.__)("Session Duration","google-site-kit")],h=[[{type:"date",label:Object(o.__)("Day","google-site-kit")},{type:"number",label:p[t]},{type:"number",label:Object(o.__)("Previous month","google-site-kit")}]],f=a.slice(a.length-n,a.length),b=a.slice(0,a.length-n),v=s(f,t),k=s(b,t);return Object(i.each)(v,(function(e,t){e[0]&&e[1]&&k[t]&&h.push([e[0],e[1],k[t][1]])})),h},l=function(e){if(!e||!e.length)return null;var t=e[0].data.rows,n=[[{type:"date",label:"Day"},{type:"number",label:"Users"},{type:"number",label:"Sessions"},{type:"number",label:"Goals Completed"}]];return Object(i.each)(t,(function(e){var t=e.metrics[0].values,a=e.dimensions[0],i=a.slice(0,4)+"-"+a.slice(4,6)+"-"+a.slice(6,8),o=new Date(i);n.push([o,t[0],t[1],t[4]])})),n},u=function(e){if(!e||!e.length)return!1;var t=e[0].data.totals,n=t[0].values,i=t[1].values,o=n[0],r=n[1],s=n[2],c=n[3],l=n[4],u=n[5];return{totalUsers:o,totalSessions:r,averageBounceRate:s,averageSessionDuration:c,totalUsersChange:Object(a.c)(i[0],n[0]),totalSessionsChange:Object(a.c)(i[1],n[1]),averageBounceRateChange:Object(a.c)(i[2],n[2]),averageSessionDurationChange:Object(a.c)(i[3],n[3]),goalCompletions:l,goalCompletionsChange:Object(a.c)(i[4],n[4]),totalPageViews:u,totalPageViewsChange:Object(a.c)(i[5],n[5])}},d=function(e,t){var n="";switch(e){case"INVALID_ARGUMENT":n=Object(o.__)("Analytics module needs to be configured.","google-site-kit");break;case"UNAUTHENTICATED":n=Object(o.__)("You need to be authenticated to get this data.","google-site-kit");break;case"PERMISSION_DENIED":n=Object(o.__)("Your account does not have sufficient permission to access this data, please consult to your web administrator.","google-site-kit");break;case"RESOURCE_EXHAUSTED":n=Object(o.__)("Your account exceeded the maximum quota. Please try again later.","google-site-kit");break;case"INTERNAL":n=Object(o.__)("Unexpected internal server error occurred.","google-site-kit");break;case"BACKEND_ERROR":n=Object(o.__)("Analytics server returned unknown error. Please try again later.","google-site-kit");break;case"UNAVAILABLE":n=Object(o.__)("The service was unable to process the request. Please try again later.","google-site-kit");break;default:n=t}return n},g=function(e){return!(!e.error||!e.error.status)&&d(e.error.status,e.error.message)},m=function(e){if(!e||!e.length)return!0;if(e&&e[0]&&e[0].data&&e[0].data.totals&&e[0].data.totals[0]){var t=e[0].data.totals[0].values,n=!0;return Object(i.each)(t,(function(e){0!==parseInt(e)&&(n=!1)})),n}return!1},p={dimensions:["ga:pageTitle","ga:pagePath"].join(","),metrics:[{expression:"ga:adsenseRevenue",alias:"Earnings"},{expression:"ga:adsenseECPM",alias:"Page RPM"},{expression:"ga:adsensePageImpressions",alias:"Impressions"}],orderby:[{fieldName:"ga:adsenseRevenue",sortOrder:"DESCENDING"}],limit:10},h={compareDateRanges:1,dimensions:"ga:date",metrics:[{expression:"ga:users",alias:"Users"},{expression:"ga:sessions",alias:"Sessions"},{expression:"ga:bounceRate",alias:"Bounce Rate"},{expression:"ga:avgSessionDuration",alias:"Average Session Duration"},{expression:"ga:goalCompletionsAll",alias:"Goal Completions"}],limit:180},f={multiDateRange:1,dimensions:"ga:date",metrics:[{expression:"ga:users",alias:"Users"},{expression:"ga:sessions",alias:"Sessions"},{expression:"ga:bounceRate",alias:"Bounce Rate"},{expression:"ga:avgSessionDuration",alias:"Average Session Duration"},{expression:"ga:goalCompletionsAll",alias:"Goal Completions"},{expression:"ga:pageviews",alias:"Pageviews"}],limit:10},b={dimensions:"ga:medium",metrics:[{expression:"ga:sessions",alias:"Sessions"},{expression:"ga:users",alias:"Users"},{expression:"ga:newUsers",alias:"New Users"}],orderby:[{fieldName:"ga:sessions",sortOrder:"DESCENDING"}],limit:10},v=function(){var e=[{expression:"ga:pageviews",alias:"Pageviews"},{expression:"ga:uniquePageviews",alias:"Unique Pageviews"},{expression:"ga:bounceRate",alias:"Bounce rate"}];return window.googlesitekit.modules.analytics.adsenseLinked&&e.push({expression:"ga:adsenseRevenue",alias:"AdSense Revenue"},{expression:"ga:adsenseECPM",alias:"AdSense ECPM"}),{dimensions:["ga:pageTitle","ga:pagePath"].join(","),metrics:e,orderby:[{fieldName:"ga:pageviews",sortOrder:"DESCENDING"}],limit:10}}},158:function(e,t,n){"use strict";var a={};n.r(a),n.d(a,"totalStats",(function(){return u})),n.d(a,"firstPostWin",(function(){return d})),n.d(a,"pageviewIncrease",(function(){return m})),n.d(a,"publishingWin",(function(){return p})),n.d(a,"trafficIncrease",(function(){return h}));var i=n(27),o=n.n(i),r=n(2),s=n(9),c=n(33),l=n(0),u=function(e,t){if(5>=parseInt(googlesitekit.admin.newSitePosts,10))return!1;if(!e||!e.rows)return!1;var n=[],a=Object(l.__)("Here are some high level stats","google-site-kit");if(e&&e.rows){var i=Object(c.extractSearchConsoleDashboardData)(e),o=i.totalClicks,s=i.totalClicksChange,u=i.totalImpressions,d=i.totalImpressionsChange,g=i.averageCTR,m=i.averageCTRChange;0<s&&0<d&&0<m&&(a="".concat(Object(l.__)("Last month was great!","google-site-kit"),". ").concat(a)),n=[{title:Object(l.__)("Total Clicks","google-site-kit"),datapoint:o,datapointUnit:"",change:s,changeDataUnit:"%",period:Object(l.__)("for month","google-site-kit")},{title:Object(l.__)("Total Impressions","google-site-kit"),datapoint:u,datapointUnit:"",change:d,changeDataUnit:"%",period:Object(l.__)("for month","google-site-kit")},{title:Object(l.__)("Average CTR","google-site-kit"),datapoint:g,datapointUnit:"%",change:m,changeDataUnit:"%",period:Object(l.__)("for month","google-site-kit")}]}var p=new Date,h=new Date(p.getFullYear(),p.getMonth()+1,0),f=Object(r.j)(p,h)+1;return{id:t,title:Object(l.__)("Welcome Back!","google-site-kit"),description:a,format:"large",winImage:"".concat(googlesitekit.admin.assetsRoot,"images/g-win.png"),blockData:n,type:"win-stats",dismissExpires:Object(r.p)("day")*f,showOnce:!0}},d=function(e){return!(1!==parseInt(googlesitekit.admin.newSitePosts,10))&&{id:e,title:Object(l.__)("Congrats on your first post!","google-site-kit"),format:"small",smallImage:"".concat(googlesitekit.admin.assetsRoot,"images/thumbs-up.png"),type:"win-success",showOnce:!0}},g=n(15),m=function(e,t){if(!googlesitekit.modules.analytics||!googlesitekit.modules.analytics.active)return!1;if(!e||!e.reports)return!1;var n=Object(g.calculateOverviewData)(e);if(!n)return!1;var a=n.totalPageViewsChange,i=n.totalPageViews;return!(10>a)&&{id:t,title:Object(l.__)("Increased page views!","google-site-kit"),description:Object(l.__)("Over the past 4 weeks","google-site-kit"),format:"large",logo:!1,winImage:"".concat(googlesitekit.admin.assetsRoot,"images/sun-small.png"),blockData:[{title:Object(l.__)("Total Page Views","google-site-kit"),datapoint:Object(r.r)(i),datapointUnit:""},{title:Object(l.__)("Increase","google-site-kit"),datapoint:a,datapointUnit:"%"}],type:"win-stats-increase",dismissExpires:Object(r.p)("month"),showOnce:!0}},p=function(e,t){if(!(5===parseInt(googlesitekit.admin.newSitePosts,10)))return!1;var n=Object(l.__)("That’s out of this world.","google-site-kit"),a=[];if(googlesitekit.modules["search-console"]&&googlesitekit.modules["search-console"].active&&e){var i=Object(c.extractSearchConsoleDashboardData)(e),o=i.totalClicks,s=i.totalImpressions,u=i.averageCTR;a=[{title:Object(l.__)("Total Impressions","google-site-kit"),datapoint:Object(r.t)(s),datapointUnit:""},{title:Object(l.__)("Total Clicks","google-site-kit"),datapoint:Object(r.t)(o),datapointUnit:""},{title:Object(l.__)("Average CTR","google-site-kit"),datapoint:u,datapointUnit:"%"}],n=Object(l.__)("That’s out of this world. Here are the combined stats for your posts","google-site-kit")}return{id:t,title:Object(l.__)("Congrats on five published posts","google-site-kit"),description:n,format:"large",winImage:"".concat(googlesitekit.admin.assetsRoot,"images/rocket.png"),blockData:a,type:"win-stats",showOnce:!0}},h=function(e,t){if(!googlesitekit.modules.analytics||!googlesitekit.modules.analytics.active)return!1;if(!e||!e[0])return!1;var n=Object(g.calculateOverviewData)(e);if(!n)return!1;var a=n.totalUsersChange,i=n.totalUsers;return!(10>a||100<a)&&{id:t,title:Object(l.__)("Congrats on more website visitors!","google-site-kit"),description:Object(l.__)("You had a record-high amount of visitors to your website yesterday.","google-site-kit"),dismiss:Object(l.__)("OK, Got it!","google-site-kit"),format:"large",winImage:"".concat(googlesitekit.admin.assetsRoot,"images/sun.png"),blockData:[{title:Object(l.__)("Site Visitors","google-site-kit"),datapoint:Object(r.t)(i),datapointUnit:""},{title:Object(l.__)("Increase","google-site-kit"),datapoint:a,datapointUnit:"%"}],type:"win-stats",dismissExpires:Object(r.p)("week"),showOnce:!0}},f=n(10);function b(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}var v=Object(r.l)("notification");"authentication_success"!==v&&"authentication_failure"!==v&&(Object(f.addFilter)("googlesitekit.winCallbacks","googlesitekit.publisherwinCallbacks",(function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(n,!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e,{},a)})),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){return e.push({identifier:"first-post-win"}),e}),1),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"publishing-win",withData:{type:s.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(r.p)("day"),context:"Dashboard"}};return e.push(t),e}),1),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"total-stats",withData:{type:s.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(r.p)("day"),context:"Dashboard"}};return e.push(t),e}),2),googlesitekit.modules.analytics.active&&(Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"pageview-increase",withData:{type:s.b,identifier:"analytics",datapoint:"reports",data:g.overviewReportDataDefaults,priority:1,maxAge:Object(r.p)("day"),context:"Dashboard"}};return e.push(t),e}),2),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"traffic-increase",withData:{type:s.b,identifier:"analytics",datapoint:"report",data:g.overviewReportDataDefaults,priority:1,maxAge:Object(r.p)("day"),context:"Dashboard"}};return e.push(t),e}),2)))},161:function(e,t,n){"use strict";var a=n(1),i=n(3),o=n.n(i),r=n(4),s=n.n(r),c=n(5),l=n.n(c),u=n(6),d=n.n(u),g=n(7),m=n.n(g),p=n(2),h=n(26),f=n(12),b=n.n(f),v=n(13),k=n.n(v),_=n(11),y=n(9),O=n(54),w=n(53),R=n(0),j=n(14),E=function(e){function t(e){var n;return o()(this,t),(n=l()(this,d()(t).call(this,e))).setupModuleClick=n.setupModuleClick.bind(k()(n)),n}return m()(t,e),s()(t,[{key:"setupModuleClick",value:function(e){return b.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.setState({isSaving:!0}),t.next=4,b.a.awrap(Object(p.a)(y.c,e,!0));case 4:return t.next=6,b.a.awrap(Object(p.u)());case 6:window.location=Object(p.m)(e,!0),t.next=13;break;case 9:t.prev=9,t.t0=t.catch(0),Object(p.w)(O.a,{id:"setup-module-error",title:Object(R.__)("Internal Server Error","google-site-kit"),description:t.t0.message,format:"small",type:"win-error"}),this.setState({isSaving:!1});case 13:case"end":return t.stop()}}),null,this,[[0,9]])}},{key:"render",value:function(){var e=this,t=Object.values(window.googlesitekit.modules||{}).filter((function(e){return!e.internal})),n=t.filter((function(e){return e.active&&e.setupComplete})).reduce((function(e,t){return e[t.slug]=t.name,e}),{}),a=t.filter((function(e){return 0===e.required.length})).sort((function(e,t){return e.sort-t.sort}));return React.createElement("div",{className:"googlesitekit-modules-list"},Object(_.map)(a,(function(t){var a=!1,i="",o=t.slug,r=t.name,s=t.setupComplete,c=t.required;return 0<c.length&&c.forEach((function(e){n[e]&&(a=!0,i=n[e])})),React.createElement("div",{key:o,className:"\n\t\t\t\t\t\t\tgooglesitekit-modules-list__module\n\t\t\t\t\t\t\tgooglesitekit-modules-list__module--".concat(o,"\n\t\t\t\t\t\t\t").concat(a?"googlesitekit-modules-list__module--disabled":"","\n\t\t\t\t\t\t")},React.createElement("div",{className:"googlesitekit-settings-connect-module__wrapper"},React.createElement("div",{className:"googlesitekit-settings-connect-module__logo"},Object(p.q)(o,a)),React.createElement("h3",{className:"googlesitekit-settings-connect-module__title"},r)),React.createElement(w.a,{slug:o,context:"modules-list"}),s&&React.createElement("span",{className:"googlesitekit-settings-module__status"},React.createElement("span",{className:"googlesitekit-settings-module__status-icon googlesitekit-settings-module__status-icon--connected"},React.createElement("span",{className:"screen-reader-text"},Object(R.__)("Connected","google-site-kit"))),Object(R.__)("Connected","google-site-kit")),!s&&!a&&React.createElement(j.a,{arrow:!0,small:!0,inherit:!0,onClick:function(){e.setupModuleClick(o)}}," ",Object(R.__)("Connect Service","google-site-kit")),!s&&a&&React.createElement(j.a,{disabled:!0,small:!0,inherit:!0},Object(R.sprintf)(Object(R.__)("Enable %s to start setup","google-site-kit"),i)))})))}}]),t}(a.Component),C=n(10),D=function(e){function t(){return o()(this,t),l()(this,d()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=Object(p.l)("notification");if(!e||""===e)return null;var t={id:"connected-successfully",setupTitle:Object(R.__)("Site Kit","google-site-kit"),description:Object(R.__)("Now you’ll be able to see how your site is doing in search. To get even more detailed stats, activate more modules. Here are our recommendations for what to include in your Site Kit:","google-site-kit"),learnMore:{label:"",url:"",description:""}},n=googlesitekit.permissions.canManageOptions;switch(e){case"authentication_success":if(!n)return null;var i=Object(p.l)("slug");return i&&googlesitekit.modules[i]&&!googlesitekit.modules[i].active?null:(i&&googlesitekit.modules[i]&&(t.id="".concat(t.id,"-").concat(i),t.setupTitle=googlesitekit.modules[i].name,t.description=Object(R.__)("Here are some other services you can connect to see even more stats:","google-site-kit"),t=Object(C.applyFilters)("googlesitekit.SetupWinNotification-".concat(i),t)),React.createElement(a.Fragment,null,React.createElement(h.a,{id:t.id,title:Object(R.sprintf)(Object(R.__)("Congrats on completing the setup for %s!","google-site-kit"),t.setupTitle),description:t.description,handleDismiss:function(){},winImage:googlesitekit.admin.assetsRoot+"images/rocket.png",dismiss:Object(R.__)("OK, Got it!","google-site-kit"),format:"large",type:"win-success",learnMoreLabel:t.learnMore.label,learnMoreDescription:t.learnMore.description,learnMoreURL:t.learnMore.url},React.createElement(E,null))));case"authentication_failure":return React.createElement(a.Fragment,null,React.createElement(h.a,{id:"connection error",title:Object(R.__)("There was a problem connecting to Google!","google-site-kit"),description:"",handleDismiss:function(){},format:"small",type:"win-error"}))}}}]),t}(a.Component),N=n(58),x=function(e){function t(e){var n;return o()(this,t),(n=l()(this,d()(t).call(this,e))).state={data:!1},n}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){var e=this,t=Object(N.f)();t&&Object(N.b)(t).then((function(t){e.setState({data:t.results})}))}},{key:"render",value:function(){var e=this.state.data;if(0===Object.keys(e).length)return null;var t=[];return Object.keys(e).forEach((function(n){Object(_.each)(e[n],(function(e){t.push(React.createElement(h.a,{key:e.id,id:e.id,title:e.title||"",description:e.description||"",blockData:e.blockData||[],winImage:e.winImage?"".concat(googlesitekit.admin.assetsRoot,"images/").concat(e.winImage):"",format:e.format||"small",learnMoreURL:e.learnMoreURL||"",learnMoreDescription:e.learnMoreDescription||"",learnMoreLabel:e.learnMoreLabel||"",ctaLink:e.ctaURL||"",ctaLabel:e.ctaLabel||"",ctaTarget:e.ctaTarget||"",type:e.severity||"",dismiss:e.dismiss||Object(R.__)("OK, Got it!","google-site-kit"),isDismissable:e.isDismissable||!0,logo:e.logo||!0,module:n,moduleName:googlesitekit.modules[n].name,pageIndex:e.pageIndex||"",dismissExpires:e.dismissExpires||0,showOnce:e.showOnce||!1}))}))})),React.createElement(a.Fragment,null,t)}}]),t}(a.Component),S=function(e){function t(e){var n;return o()(this,t),(n=l()(this,d()(t).call(this,e))).state={data:!1},n}return m()(t,e),s()(t,[{key:"componentWillMount",value:function(){var e=this;Object(C.addAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications",(function(){Object(C.removeAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications");var t=Object(N.g)();t&&Object(N.d)(t).then((function(t){e.setState({data:t.results})}))}))}},{key:"render",value:function(){var e=this.state.data;if(0===Object.keys(e).length)return null;var t=[];return Object.keys(e).forEach((function(n){Object(_.each)(e[n],(function(e){t.push(React.createElement(h.a,{key:e.id,id:e.id,title:e.title||"",description:e.description||"",blockData:e.blockData||[],winImage:e.winImage||"",format:e.format||"small",learnMoreURL:e.learnMoreURL||"",learnMoreDescription:e.learnMoreDescription||"",learnMoreLabel:e.learnMoreLabel||"",ctaLink:e.ctaLink||"",ctaLabel:e.ctaLabel||"",type:e.severity||"",dismiss:e.dismiss||Object(R.__)("OK, Got it!","google-site-kit"),isDismissable:e.isDismissable||!0,logo:e.logo||!1,pageIndex:e.pageIndex||"",dismissExpires:e.dismissExpires||0,showOnce:e.showOnce||!1}))}))})),React.createElement(a.Fragment,null,t)}}]),t}(a.Component),A=n(87),L=n(24),I=window.googlesitekit.setup,M=Object(p.l)("notification"),P=Object(L.a)(React.createElement(D,null)),T=Object(L.a)(React.createElement(x,null)),U=Object(L.a)(React.createElement(S,null)),F=Object(L.a)(React.createElement(A.a,null));I.needReauthenticate&&Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.AuthNotification",F,1),"authentication_success"===M||"authentication_failure"===M?Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.SetupNotification",P,1):I.isAuthenticated&&I.isVerified&&(Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.ModulesNotification",T,1),Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.WinsNotification",U,1))},17:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.ctaLabel,a=e.ctaLink;return React.createElement("header",{className:"googlesitekit-layout__header"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:"\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\t\t".concat(a?"mdc-layout-grid__cell--span-6-desktop":"mdc-layout-grid__cell--span-12-desktop","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--align-middle\n\t\t\t\t\t\t\t\t\t").concat(a?"":"mdc-layout-grid__cell--span-8-tablet","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\t\t")},React.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},t)),a&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "},React.createElement(f.a,{href:a,external:!0,inherit:!0},n)))))}}]),t}(m.Component);b.propTypes={title:h.a.string,ctaLabel:h.a.string,ctaLink:h.a.string},b.defaultProps={title:"",ctaLabel:"",ctaLink:""};var v=b,k=n(60),_=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLabel,n=e.ctaLink,a=e.footerContent;return React.createElement("footer",{className:"googlesitekit-layout__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n&&t&&React.createElement(k.a,{className:"googlesitekit-data-block__source",name:t,href:n,external:!0}),a))))}}]),t}(m.Component);_.propTypes={ctaLabel:h.a.string,ctaLink:h.a.string};var y=_,O=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.footer,a=e.children,i=e.title,o=e.headerCtaLabel,r=e.headerCtaLink,s=e.footerCtaLabel,c=e.footerCtaLink,l=e.footerContent,u=e.className,d=e.fill,g=e.relative;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-layout\n\t\t\t\t".concat(u&&u,"\n\t\t\t\t").concat(d?"googlesitekit-layout--fill":"","\n\t\t\t\t").concat(g?"googlesitekit-layout--relative":"","\n\t\t\t")},t&&React.createElement(v,{title:i,ctaLabel:o,ctaLink:r}),a,n&&React.createElement(y,{ctaLabel:s,ctaLink:c,footerContent:l}))}}]),t}(m.Component);O.propTypes={header:h.a.bool,footer:h.a.bool,children:h.a.node.isRequired,title:h.a.string,headerCtaLabel:h.a.string,headerCtaLink:h.a.string,footerCtaLabel:h.a.string,footerCtaLink:h.a.string,footerContent:h.a.node,className:h.a.string,fill:h.a.bool,relative:h.a.bool},O.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1};t.a=O},2:function(e,t,n){"use strict";var a,i=n(49),o=n.n(i),r=n(68),s=n.n(r),c=n(27),l=n.n(c),u=n(12),d=n.n(u),g=n(61),m=n.n(g),p=(n(1),n(11)),h=n(9),f=n(20),b=n(18),v=n.n(b),k=n(35),_=n.n(k),y=n(10),O=n(0),w=n(36),R=n(3),j=n.n(R),E=n(4),C=n.n(E),D=function(e){var t=window[e];if(!t)return!1;try{var n="__storage_test__";return t.setItem(n,n),t.removeItem(n),!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}},N=function(){function e(){j()(this,e)}return C()(e,[{key:"key",value:function(){return null}},{key:"getItem",value:function(){return null}},{key:"setItem",value:function(){}},{key:"removeItem",value:function(){}},{key:"clear",value:function(){}},{key:"length",get:function(){return 0}}]),e}(),x=function(){return a||(a=D("sessionStorage")?window.sessionStorage:D("localStorage")?window.localStorage:new N),a};function S(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(n,!0).forEach((function(t){l()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.d(t,"t",(function(){return L})),n.d(t,"r",(function(){return I})),n.d(t,"p",(function(){return M})),n.d(t,"s",(function(){return P})),n.d(t,"j",(function(){return T})),n.d(t,"c",(function(){return U})),n.d(t,"l",(function(){return q})),n.d(t,"f",(function(){return H})),n.d(t,"u",(function(){return W})),n.d(t,"m",(function(){return G})),n.d(t,"g",(function(){return K})),n.d(t,"n",(function(){return B})),n.d(t,"z",(function(){return z})),n.d(t,"A",(function(){return V})),n.d(t,"b",(function(){return Q})),n.d(t,"v",(function(){return Y})),n.d(t,"k",(function(){return J})),n.d(t,"a",(function(){return $})),n.d(t,"y",(function(){return ee})),n.d(t,"w",(function(){return te})),n.d(t,"e",(function(){return ne})),n.d(t,"i",(function(){return ie})),n.d(t,"h",(function(){return oe})),n.d(t,"q",(function(){return re})),n.d(t,"d",(function(){return se})),n.d(t,"x",(function(){return ce})),n.d(t,"o",(function(){return x}));var L=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t=Object(p.isUndefined)(e)?0:1e6<e?(e/=1e6).toFixed(1)+"M":1e3<e?99<(e/=1e3)?Math.round(e)+"K":e.toFixed(1)+"K":e,(Object(p.isNull)(e)||Object(p.isUndefined)(e)||isNaN(e))&&(t="",e=0),0===e)return t="0.00",n?new Intl.NumberFormat(navigator.language,{style:"currency",currency:n}).format(e):e;if(!1!==n&&""!==t){var a=new Intl.NumberFormat(navigator.language,{style:"currency",currency:n}).formatToParts(e),i=a.find((function(e){return"decimal"===e.type}));!Object(p.isUndefined)(i)&&!Object(p.isUndefined)(i.value)&&1e3>e&&(t=Number.isInteger(e)?e:e.replace(".",i.value));var o=a.find((function(e){return"currency"===e.type})),r=o?o.value:"";return"".concat(r).concat(t)}return t.toString()},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t||(t=navigator.language),t=t.replace("_","-").toLocaleLowerCase(),new Intl.NumberFormat(t).format(e)},M=function(e){switch(e){case"minute":return 60;case"hour":return 3600;case"day":return 86400;case"week":return 604800;case"month":return 2592e3;case"year":return 31536e3}},P=function(e){if(e=parseInt(e,10),isNaN(e)||0===e)return"0.0s";var t={};return t.hours=Math.floor(e/60/60),t.minutes=Math.floor(e/60%60),t.seconds=Math.floor(e%60),((t.hours?t.hours+"h ":"")+(t.minutes?t.minutes+"m ":"")+(t.seconds?t.seconds+"s ":"")).trim()},T=function(e,t){var n=1e3*M("day"),a=e.getTime(),i=t.getTime();return Math.round(Math.abs(a-i)/n)},U=function(e,t){if("0"===e||0===e||isNaN(e))return"";var n=((t-e)/e*100).toFixed(1);return isNaN(n)||"Infinity"===n?"":n},F=function(e){for(var t=location.search.substr(1).split("&"),n={},a=0;a<t.length;a++)n[t[a].split("=")[0]]=decodeURIComponent(t[a].split("=")[1]);return e?n.hasOwnProperty(e)?decodeURIComponent(n[e].replace(/\+/g," ")):"":n},q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location,n=new URL(t.href);if(e)return n.searchParams&&n.searchParams.get?n.searchParams.get(e):F(e);var a={},i=!0,o=!1,r=void 0;try{for(var s,c=n.searchParams.entries()[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var l=m()(s.value,2),u=l[0],d=l[1];a[u]=d}}catch(e){o=!0,r=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw r}}return a},H=function(e,t){return Object(p.map)(e,(function(e,n){return[e[0],e[t]||(0===n?"":0)]}))},W=function(){var e,t;return d.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,d.a.awrap(h.c.get(h.a,"user","authentication"));case 3:e=n.sent,t=e.grantedScopes.filter((function(t){return-1!==e.requiredScopes.indexOf(t)})),window.googlesitekit.setup=window.googlesitekit.setup||{},window.googlesitekit.setup.isAuthenticated=e.isAuthenticated,window.googlesitekit.setup.requiredScopes=e.requiredScopes,window.googlesitekit.setup.grantedScopes=e.grantedScopes,window.googlesitekit.setup.needReauthenticate=t.length<e.requiredScopes.length,n.next=14;break;case 12:n.prev=12,n.t0=n.catch(0);case 14:case"end":return n.stop()}}),null,null,[[0,12]])},G=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:googlesitekit,a=n.admin,i=a.connectURL,o=a.adminRoot,r=n.setup.needReauthenticate,s=n.modules[e].screenID,c="pagespeed-insights"===e?{notification:"authentication_success",reAuth:void 0}:{},l=Object(w.addQueryArgs)(o,A({page:e&&t&&s?s:"googlesitekit-dashboard",slug:e,reAuth:t},c));if(!r)return l;var u=encodeURIComponent(Object(w.getQueryString)(l));return l=o+"?"+u,Object(w.addQueryArgs)(i,{redirect:l,status:t})},K=function(e,t){return function(n){return function(a){return v.a.createElement(e,s()({},a,t,{OriginalComponent:n}))}}},B=function(e,t){var n=googlesitekit.admin.adminRoot;return e||(e="googlesitekit-dashboard"),t=A({page:e},t),Object(w.addQueryArgs)(n,t)},z=function(e){try{return JSON.parse(e)&&!!e}catch(e){return!1}},V=function(e){return e.match(/^GTM-[a-zA-Z\d]{7}#x2F;)},Q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=null,n=null,a=document.querySelector("#toplevel_page_googlesitekit-dashboard #googlesitekit-notifications-counter"),i=document.querySelector("#wp-admin-bar-google-site-kit #googlesitekit-notifications-counter");if(a&&i)return!1;if(t=document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"),n=document.querySelector("#wp-admin-bar-google-site-kit .ab-item"),null===t&&null===n)return!1;var o=document.createElement("span");o.setAttribute("class","googlesitekit-notifications-counter update-plugins count-".concat(e)),o.setAttribute("id","googlesitekit-notifications-counter");var r=document.createElement("span");r.setAttribute("class","plugin-count"),r.setAttribute("aria-hidden","true"),r.textContent=e;var s=document.createElement("span");return s.setAttribute("class","screen-reader-text"),s.textContent=Object(O.sprintf)(Object(O._n)("%d notification","%d notifications",e,"google-site-kit"),e),o.appendChild(r),o.appendChild(s),t&&null===a&&t.appendChild(o),n&&null===i&&n.appendChild(o),o},Y=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if("undefined"!=typeof gtag&&window.googlesitekitTrackingEnabled){var i=googlesitekit.admin,o=i.siteURL,r=i.siteUserID,s=googlesitekit.setup.isFirstAdmin;return gtag("event",t,{send_to:googlesitekit.admin.trackingID,event_category:e,event_label:n,event_value:a,dimension1:Object(p.trimEnd)(o,"/"),dimension2:s?"true":"false",dimension3:r})}},J=function(e){var t,n,a,i,o;return d.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=googlesitekit.admin,n=t.homeURL,a=t.ampMode,i={tagverify:1,timestamp:Date.now()},r.next=4,d.a.awrap(Z(Object(w.addQueryArgs)(n,i),e));case 4:if((o=r.sent)||"secondary"!==a){r.next=9;break}return r.next=8,d.a.awrap(_()({path:"/wp/v2/posts?per_page=1"}).then((function(t){return t.slice(0,1).map((function(t){return d.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,d.a.awrap(Z(Object(w.addQueryArgs)(t.link,A({},i,{amp:1})),e));case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}))})).pop()})));case 8:o=r.sent;case 9:return r.abrupt("return",Promise.resolve(o||null));case 10:case"end":return r.stop()}}))},Z=function(e,t){var n;return d.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,d.a.awrap(fetch(e,{credentials:"omit"}).then((function(e){return e.text()})));case 3:return n=a.sent,a.abrupt("return",X(n,t)||null);case 7:return a.prev=7,a.t0=a.catch(0),a.abrupt("return",null);case 10:case"end":return a.stop()}}),null,null,[[0,7]])},X=function(e,t){var n=!1;switch(t){case"analytics":(n=!!(n=new RegExp(/<script [^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtag\/js\?id=(UA-.*?)['|"][^>]*><\/script>/gm).exec(e))&&n[1])||(n=!!(n=new RegExp(/<script[^>]*>[^<]+google-analytics\.com\/analytics\.js[^<]+(UA-\d+-\d+)/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/__gaTracker\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/ga\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/_gaq.push\( ?\[ ?['|"]_setAccount['|"], ?['|"](UA-.*?)['|"] ?] ?\)/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/<amp-analytics [^>]*type="gtag"[^>]*>[^<]*<script type="application\/json">[^<]*"gtag_id":\s*"(UA-[^"]+)"/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/<amp-analytics [^>]*type="googleanalytics"[^>]*>[^<]*<script type="application\/json">[^<]*"account":\s*"(UA-[^"]+)"/gm).exec(e))&&n[1]);break;case"adsense":(n=!!(n=new RegExp(/google_ad_client: ?["|'](.*?)["|']/gm).exec(e))&&n[1])||(n=!!(n=new RegExp(/<(?:script|amp-auto-ads) [^>]*data-ad-client="([^"]+)"/gm).exec(e))&&n[1])}return n},$=function(e,t,n){return e.setModuleActive(t,n).then((function(e){return window.googlesitekit.modules&&window.googlesitekit.modules[t]&&(window.googlesitekit.modules[t].active=e.active),Y("".concat(t,"_setup"),e.active?"module_activate":"module_deactivate",t),new Promise((function(t){t(e)}))}))},ee=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:googlesitekit,o=i.modules[e],r=o.settings,s=o.setupComplete,c=a||document.getElementById("confirm-changes-".concat(e));if(s&&c){var l=[];Object.keys(n).forEach((function(e){-1<Object.keys(t).indexOf(e)&&(l[t[e]]=n[e])}));var u=[];Object.keys(r).forEach((function(e){-1<Object.values(t).indexOf(e)&&(u[e]=r[e])}));var d=Object.keys(u).filter((function(e){return u[e]!==l[e]}));if(0<d.length){if(a)return!0;c.removeAttribute("disabled")}else{if(a)return!1;c.setAttribute("disabled","disabled")}}},te=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(y.addFilter)("googlesitekit.ErrorNotification","googlesitekit.ErrorNotification",K(e,t),1)},ne=function(e){if(!e)return"";var t=e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)})).replace(/(\\)/g,"");return Object(p.unescape)(t)};function ae(){return Object(y.applyFilters)("googlesitekit.dateRange",Object(O.__)("Last 28 days","google-site-kit"))}function ie(){return ae().replace("Last ","")}function oe(){return e=ae(),Object(p.toLower)(Object(p.deburr)(Object(p.trim)(e.replace(/[\s./_]+/g,"-"),"-")));var e}function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"33",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"33",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(googlesitekit){var o=v.a.createElement(f.a,{id:e,width:n,height:a,className:i});return t?o=v.a.createElement(f.a,{id:"".concat(e,"-disabled"),width:n,height:a,className:i}):"pagespeed-insights"===e&&(o=v.a.createElement("img",{src:googlesitekit.admin.assetsRoot+"images/icon-pagespeed.png",width:n,alt:"",className:i})),o}}function se(){window.localStorage&&window.localStorage.clear(),window.sessionStorage&&window.sessionStorage.clear()}function ce(e){var t={};return Object.keys(e).sort().forEach((function(n){var a=e[n];a&&"object"===o()(a)&&!Array.isArray(a)&&(a=ce(a)),t[n]=a})),t}},20:function(e,t,n){"use strict";n(1);var a=n(8),i=n.n(a),o=function(e){var t=e.id,n=e.className,a=e.height,i=e.width,o="".concat(googlesitekit.admin.assetsRoot,"svg/svg.svg");return React.createElement("svg",{className:"svg".concat(" ",n),height:a,width:i},React.createElement("use",{xlinkHref:"".concat(o,"#").concat(t)}))};o.propTypes={id:i.a.string.isRequired,className:i.a.string,height:i.a.string,width:i.a.string},o.defaultProps={className:"",height:20,width:20},t.a=o},21:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(11),h=n(10),f=n(59),b=16;function v(e){return Object(f.createHigherOrderComponent)((function(t){var n,a="core/with-filters/"+e;var o=function(o){function s(){var a;return i()(this,s),a=c()(this,u()(s).apply(this,arguments)),void 0===n&&(n=Object(h.applyFilters)(e,t)),a}return g()(s,o),r()(s,[{key:"componentDidMount",value:function(){s.instances.push(this),1===s.instances.length&&(Object(h.addAction)("hookRemoved",a,l),Object(h.addAction)("hookAdded",a,l))}},{key:"componentWillUnmount",value:function(){s.instances=Object(p.without)(s.instances,this),0===s.instances.length&&(Object(h.removeAction)("hookRemoved",a),Object(h.removeAction)("hookAdded",a))}},{key:"render",value:function(){return React.createElement(n,this.props)}}]),s}(m.Component);o.instances=[];var s=Object(p.debounce)((function(){n=Object(h.applyFilters)(e,t),o.instances.forEach((function(e){e.forceUpdate()}))}),b);function l(t){t===e&&s()}return o}),"withFilters")}},22:function(e,t,n){"use strict";var a=n(82),i=n.n(a);n.d(t,"l",(function(){return i.a})),n.d(t,"a",(function(){return a.HelperText})),n.d(t,"b",(function(){return a.Input}));var o=n(151);n.d(t,"h",(function(){return o.a}));var r=n(162);n.d(t,"e",(function(){return r.a}));var s=n(163);n.d(t,"g",(function(){return s.a}));var c=n(97),l=n.n(c);n.d(t,"k",(function(){return l.a})),n.d(t,"j",(function(){return c.Option}));var u=n(164);n.d(t,"i",(function(){return u.a}));var d=n(160);n.d(t,"d",(function(){return d.a}));var g=n(159);n.d(t,"c",(function(){return g.a}));var m=n(157);n.d(t,"f",(function(){return m.a}))},24:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(1),i=function(e){return function(t){return function(n){return Object(a.createElement)(a.Fragment,{},"",Object(a.createElement)(t,n),e)}}}},25:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(8),b=n.n(f),v=n(60),k=n(20),_=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).handleClick=n.handleClick.bind(g()(n)),n.handleKeyPress=n.handleKeyPress.bind(g()(n)),n}return p()(t,e),r()(t,[{key:"handleClick",value:function(){var e=this.props,t=e.stat;(0,e.handleStatSelection)(t)}},{key:"handleKeyPress",value:function(e){e.preventDefault();var t=this.props,n=t.stat,a=t.handleStatSelection;"Enter"!==e.key&&" "!==e.key||a(n)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.title,a=e.datapoint,i=e.datapointUnit,o=e.change,r=e.changeDataUnit,s=e.context,c=e.period,l=e.selected,u=e.handleStatSelection,d=e.source,g=e.sparkline,m=e.reverseArrowDirection,p="button"===s?"button":"",f=0<=o?"-positive":"-negative";return React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-data-block\n\t\t\t\t\tgooglesitekit-data-block--".concat(s,"\n\t\t\t\t\t").concat(l?"googlesitekit-data-block--selected":"","\n\t\t\t\t\t").concat(t,"\n\t\t\t\t"),tabIndex:"button"===s?"0":"-1",role:u&&p,onClick:u&&this.handleClick,onKeyPress:u&&this.handleKeyPress,"aria-label":u&&n,"aria-pressed":u&&l},React.createElement("div",{className:"googlesitekit-data-block__title-datapoint-wrapper"},React.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-data-block__title "},n),React.createElement("div",{className:"googlesitekit-data-block__datapoint"},"".concat(a).concat(i))),g&&React.createElement("div",{className:"googlesitekit-data-block__sparkline"},g),React.createElement("div",{className:"googlesitekit-data-block__change-source-wrapper"},React.createElement("div",{className:"\n\t\t\t\t\t\tgooglesitekit-data-block__change\n\t\t\t\t\t\tgooglesitekit-data-block__change--".concat(0<=o?"positive":"negative","\n\t\t\t\t\t")},""===o&&React.createElement(h.Fragment,null," "),o&&[React.createElement("span",{key:"arrow",className:"googlesitekit-data-block__arrow ".concat(m?"googlesitekit-data-block__arrow--reverse":"")},React.createElement(k.a,{id:"arrow".concat(f),height:"9",width:"9"})),React.createElement("span",{key:"values",className:"googlesitekit-data-block__value"},"".concat(Math.abs(o)).concat(r," ").concat(c))]),d&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:d.name,href:d.link})))}}]),t}(h.Component);_.propTypes={stat:b.a.number,onClick:b.a.func,className:b.a.string,title:b.a.string,datapoint:b.a.oneOfType([b.a.string,b.a.number]),datapointUnit:b.a.string,change:b.a.oneOfType([b.a.string,b.a.number]),changeDataUnit:b.a.string,context:b.a.string,period:b.a.string,selected:b.a.bool,handleStatSelection:b.a.func,reverseArrowDirection:b.a.bool},_.defaultProps={stat:null,onClick:null,className:"",title:"",datapoint:null,datapointUnit:"",change:null,changeDataUnit:"",context:"default",period:"",selected:!1,handleStatSelection:null,reverseArrowDirection:!1},t.a=_},26:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(8),b=n.n(f),v=n(9),k=n(25),_=n(29);var y=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#F9BB2D",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"warning-title warning-desc"},React.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),React.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))},O=n(88),w=n(14),R=n(20),j=n(11),E=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={isClosed:!1},n.cardRef=Object(h.createRef)(),n.handleDismiss=n.handleDismiss.bind(g()(n)),0<n.props.dismissExpires&&n.expireDismiss(),n.props.showOnce&&v.c.setCache("notification::displayed::".concat(n.props.id),new Date),n}return p()(t,e),r()(t,[{key:"handleDismiss",value:function(e){var t=this,n=this.state.isClosed,a=this.cardRef.current;e.preventDefault(),this.setState({isClosed:!n}),setTimeout((function(){v.c.setCache("notification::dismissed::".concat(t.props.id),new Date),a.style.display="none";var e=new Event("notificationDismissed");document.dispatchEvent(e)}),350)}},{key:"expireDismiss",value:function(){var e=this.props,t=e.id,n=e.dismissExpires,a=v.c.getCache("notification::dismissed::".concat(t));if(a){var i=new Date(a);i.setSeconds(i.getSeconds()+parseInt(n,10)),i<new Date&&v.c.deleteCache("notification::dismissed::".concat(t))}}},{key:"render",value:function(){var e=this.state.isClosed,t=this.props,n=t.children,a=t.id,i=t.title,o=t.description,r=t.blockData,s=t.winImage,c=t.smallImage,l=t.format,u=t.learnMoreURL,d=t.learnMoreDescription,g=t.learnMoreLabel,m=t.ctaLink,p=t.ctaLabel,f=t.ctaTarget,b=t.type,E=t.dismiss,C=t.isDismissable,D=t.logo,N=t.module,x=t.moduleName,S=t.pageIndex;if(v.c.getCache("notification::dismissed::".concat(a)))return null;var A,L=e?"is-closed":"is-open",I="large"===l&&"win-stats-increase"===b,M="mdc-layout-grid__cell--span-12";"large"===l?(M="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-6-tablet mdc-layout-grid__cell--span-8-desktop ",I&&(M="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-5-tablet mdc-layout-grid__cell--span-8-desktop ")):"small"===l&&(M="mdc-layout-grid__cell--span-11-desktop mdc-layout-grid__cell--span-7-tablet mdc-layout-grid__cell--span-3-phone"),A="win-warning"===b?React.createElement(y,null):"win-error"===b?React.createElement(O.a,null):"";var P=React.createElement(h.Fragment,null,r&&React.createElement("div",{className:"mdc-layout-grid__inner"},Object(j.map)(r,(function(e,t){return React.createElement("div",{key:t,className:"mdc-layout-grid__cell ".concat(I?"mdc-layout-grid__cell--span-5-desktop":"mdc-layout-grid__cell--span-4-desktop")},React.createElement("div",{className:"googlesitekit-publisher-win__stats"},React.createElement(k.a,e)))})))),T=React.createElement(h.Fragment,null,React.createElement("h3",{className:"googlesitekit-heading-2 googlesitekit-publisher-win__title"},i),o&&React.createElement("div",{className:"googlesitekit-publisher-win__desc"},React.createElement("p",null,o,g&&React.createElement(h.Fragment,null," ",React.createElement(w.a,{href:u,external:!0,inherit:!0},g),d),S&&React.createElement("span",{className:"googlesitekit-publisher-win__detect"},S))),n),U=N?React.createElement(R.a,{id:N,height:"19",width:"19"}):React.createElement(R.a,{id:"logo-g",height:"34",width:"32"});return React.createElement("section",{ref:this.cardRef,className:"\n\t\t\t\tgooglesitekit-publisher-win\n\t\t\t\t".concat(l?"googlesitekit-publisher-win--".concat(l):"","\n\t\t\t\t").concat(b?"googlesitekit-publisher-win--".concat(b):"","\n\t\t\t\t").concat(L?"googlesitekit-publisher-win--".concat(L):"","\n\t\t\t")},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},D&&React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12 ".concat(I?"mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet":"")},React.createElement("div",{className:"googlesitekit-publisher-win__logo"},U),x&&React.createElement("div",{className:"googlesitekit-publisher-win__module-name"},x)),c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},React.createElement("img",{className:"googlesitekit-publisher-win__small-image",alt:"",src:c})),React.createElement("div",{className:"mdc-layout-grid__cell ".concat(M)},I?React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-5-desktop mdc-layout-grid__cell--span-8-tablet"},T),React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-7-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--align-bottom"},P)):React.createElement(h.Fragment,null,T,P),m&&React.createElement(_.a,{href:m,target:f},p),C&&E&&React.createElement(w.a,{onClick:this.handleDismiss},E)),s&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--order-1-phone mdc-layout-grid__cell--order-2-tablet mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},React.createElement("div",{className:"googlesitekit-publisher-win__image-large"},React.createElement("img",{alt:"",src:s}))),("win-error"===b||"win-warning"===b)&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},React.createElement("div",{className:"googlesitekit-publisher-win__icons"},A)))))}}]),t}(h.Component);E.propTypes={id:b.a.string.isRequired,title:b.a.string.isRequired,description:b.a.string,learnMoreURL:b.a.string,learnMoreDescription:b.a.string,learnMoreLabel:b.a.string,blockData:b.a.array,winImage:b.a.string,smallImage:b.a.string,format:b.a.string,ctaLink:b.a.string,ctaLabel:b.a.string,type:b.a.string,dismiss:b.a.string,isDismissable:b.a.bool,logo:b.a.bool,module:b.a.string,moduleName:b.a.string,pageIndex:b.a.string,dismissExpires:b.a.number,showOnce:b.a.bool},E.defaultProps={isDismissable:!0,dismissExpires:0,showOnce:!1};t.a=E},29:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(22),h=n(8),f=n.n(h),b=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).buttonRef=Object(m.createRef)(),n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){new p.h(this.buttonRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.children,a=e.href,i=e.text,o=e.className,r=e.danger,s=e.disabled,c=e.target,l=e.id,u=e.icon,d=e.trailingIcon,g=e.ariaHaspopup,m=e.ariaExpanded,p=e.ariaControls,h=a?"a":"button";return React.createElement(h,{className:"\n\t\t\t\t\tmdc-button\n\t\t\t\t\t".concat(!i&&"mdc-button--raised","\n\t\t\t\t\t").concat(o&&o,"\n\t\t\t\t\t").concat(r?"mdc-button--danger":"","\n\t\t\t\t"),onClick:t,href:a,ref:this.buttonRef,disabled:s?"disabled":"",target:c||"_self",id:l,"aria-haspopup":g,"aria-expanded":m,"aria-controls":p},u&&u,React.createElement("span",{className:"mdc-button__label"},n),d&&d)}}]),t}(m.Component);b.propTypes={onClick:f.a.func,children:f.a.string.isRequired,href:f.a.string,text:f.a.bool,className:f.a.string,danger:f.a.bool,disabled:f.a.bool,icon:f.a.element,trailingIcon:f.a.element,ariaHaspopup:f.a.string,ariaExpanded:f.a.bool,ariaControls:f.a.string},b.defaultProps={onClick:null,href:null,text:!1,className:"",danger:!1,disabled:!1,icon:null,trailingIcon:null,ariaHaspopup:"",ariaExpanded:!1,ariaControls:""},t.a=b},31:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.small,a=e.compress,i=e.height,o=i?Math.round(i/2):null;return React.createElement("div",{role:"progressbar",className:"\n\t\t\t\t\tmdc-linear-progress\n\t\t\t\t\tmdc-linear-progress--indeterminate\n\t\t\t\t\t".concat(t||"","\n\t\t\t\t\t").concat(n?"mdc-linear-progress--small":"","\n\t\t\t\t\t").concat(a?"mdc-linear-progress--compress":"","\n\t\t\t\t"),style:{marginTop:o,marginBottom:o}},React.createElement("div",{className:"mdc-linear-progress__buffering-dots"}),React.createElement("div",{className:"mdc-linear-progress__buffer"}),React.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__primary-bar"},React.createElement("span",{className:"mdc-linear-progress__bar-inner"})),React.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__secondary-bar"},React.createElement("span",{className:"mdc-linear-progress__bar-inner"})))}}]),t}(m.Component);f.propTypes={className:h.a.string,small:h.a.bool,compress:h.a.bool},f.defaultProps={className:"",small:!1,compress:!1},t.a=f},32:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.description,a=e.ctaLink,i=e.ctaLabel,o=e.error,r=e.onClick;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-cta\n\t\t\t\t".concat(o?"googlesitekit-cta--error":"","\n\t\t\t")},t&&React.createElement("h3",{className:"googlesitekit-cta__title"},t),n&&React.createElement("p",{className:"googlesitekit-cta__description"},n),i&&React.createElement(f.a,{href:a,onClick:r,inverse:!o,caps:!0,arrow:!0},i))}}]),t}(m.Component);b.propTypes={title:h.a.string.isRequired,description:h.a.string,ctaLink:h.a.string,ctaLabel:h.a.string,error:h.a.bool,onClick:h.a.func},b.defaultProps={title:"",description:"",ctaLink:"",ctaLabel:"",error:!1,onClick:function(){}},t.a=b},33:function(e,t,n){"use strict";n.r(t),n.d(t,"extractSearchConsoleDashboardData",(function(){return r})),n.d(t,"isDataZeroSearchConsole",(function(){return s}));var a=n(2),i=n(11);function o(e){var t=[[{type:"string",label:"Day"},{type:"number",label:"Clicks"},{type:"number",label:"Impressions"},{type:"number",label:"CTR"},{type:"number",label:"Position"}]],n=0,o=0,r=0,s=0,c=e.length;Object(i.each)(e,(function(e){var a=new Date(e.keys[0]);t.push([a.getMonth()+1+"/"+a.getUTCDate(),e.clicks,e.impressions,e.ctr,e.position]),n+=e.clicks,o+=e.impressions,r+=e.ctr,s+=e.position}));var l=n,u=o;n=Object(a.t)(n),o=Object(a.t)(o);var d=(r/c*100).toFixed(1),g=r/c,m=(s/c).toFixed(1);return{dataMap:t,totalClicks:n,totalClicksRaw:l,totalImpressions:o,totalImpressionsRaw:u,averageCTR:d,averageCTRRaw:g,averagePosition:m}}var r=function(e){var t=Math.floor(e.length/2),n=o(e.slice(t)),i=o(e.slice(0,t));return{dataMap:n.dataMap,totalClicks:n.totalClicks,totalImpressions:n.totalImpressions,averageCTR:n.averageCTR,averagePosition:n.averagePosition,totalClicksChange:Object(a.c)(i.totalClicksRaw,n.totalClicksRaw),totalImpressionsChange:Object(a.c)(i.totalImpressionsRaw,n.totalImpressionsRaw),averageCTRChange:Object(a.c)(i.averageCTRRaw,n.averageCTRRaw),averagePositionChange:Object(a.c)(i.averagePosition,n.averagePosition)}},s=function(e){if(!e.length)return!0;var t=r(e),n=t.totalClicks,a=t.totalImpressions,i=t.averageCTR,o=t.averagePosition;return 0===parseInt(n)&&0===parseInt(a)&&0===parseInt(i)&&0===parseInt(o)}},43:function(e,t,n){"use strict";n(1);var a=n(0),i=n(14);t.a=function(){var e=Object(a.__)("Need help?","google-site-kit");return React.createElement(i.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},e)}},44:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(21),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){return null}}]),t}(m.Component),f=Object(p.a)("googlesitekit.ErrorNotification")(h),b=n(81),v=n(12),k=n.n(v),_=n(13),y=n.n(_),O=n(67),w=n(29),R=n(22),j=n(8),E=n.n(j),C=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).menuRef=Object(m.createRef)(),n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new R.f(this.menuRef.current),this.menu.open=e,this.menu.setDefaultFocusState(1)}},{key:"componentDidUpdate",value:function(e){var t=this.props.menuOpen;t!==e.menuOpen&&(this.menu.open=t)}},{key:"render",value:function(){var e=this.props,t=e.menuOpen,n=e.menuItems,a=e.onSelected,i=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:i,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},n.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:a.bind(null,t),onKeyDown:a.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(m.Component);C.propTypes={menuOpen:E.a.bool.isRequired,menuItems:E.a.array.isRequired,id:E.a.string.isRequired};var D=C,N=n(80),x=n(2),S=n(0),A=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},n.handleMenu=n.handleMenu.bind(y()(n)),n.handleMenuClose=n.handleMenuClose.bind(y()(n)),n.handleMenuItemSelect=n.handleMenuItemSelect.bind(y()(n)),n.handleDialog=n.handleDialog.bind(y()(n)),n.handleDialogClose=n.handleDialogClose.bind(y()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(y()(n)),n.menuButtonRef=Object(m.createRef)(),n.menuRef=Object(m.createRef)(),n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.removeEventListener("keyup",this.handleDialogClose)}},{key:"handleMenu",value:function(){var e=this.state.menuOpen;this.setState({menuOpen:!e})}},{key:"handleMenuClose",value:function(e){("keyup"!==e.type||27!==e.keyCode)&&"mouseup"!==e.type||this.menuButtonRef.current.buttonRef.current.contains(e.target)||this.menuRef.current.menuRef.current.contains(e.target)||this.setState({menuOpen:!1})}},{key:"handleMenuItemSelect",value:function(e,t){var n=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(n);break;default:this.handleMenu()}}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive,menuOpen:!1}}))}},{key:"handleDialogClose",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1,menuOpen:!1})}},{key:"handleUnlinkConfirm",value:function(){return k.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(x.d)(),document.location=Object(x.n)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,n=t.email,a=void 0===n?"":n,i=t.picture,o=void 0===i?"":i,r=e.proxyPermissionsURL,s=this.state,c=s.dialogActive,l=s.menuOpen;return React.createElement(m.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(w.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:o?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:o,alt:Object(S.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:l,ariaControls:"user-menu"},a),React.createElement(D,{ref:this.menuRef,menuOpen:l,menuItems:[Object(S.__)("Disconnect","google-site-kit")].concat(r?[Object(S.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(N.a,null,React.createElement(O.a,{dialogActive:c,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(S.__)("Disconnect","google-site-kit"),subtitle:Object(S.__)("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:Object(S.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(m.Component),L=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(m.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(b.a,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-phone mdc-layout-grid__cell--span-1-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e&&React.createElement(A,null))))),React.createElement(f,null))}}]),t}(m.Component);t.a=L},47:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(69),h=n(8),f=n.n(h),b=n(20),v=n(10),k=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.icon,a=e.iconWidth,i=e.iconHeight,o=e.iconID,r=e.className,s=e.status,c=e.statusText,l=e.fullWidth?"\n\t\t\tmdc-layout-grid__cell\n\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t":"\n\t\t\tmdc-layout-grid__cell\n\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\tmdc-layout-grid__cell--span-4-tablet\n\t\t\tmdc-layout-grid__cell--span-6-desktop\n\t\t\t",u=Object(v.applyFilters)("googlesitekit.showDateRangeSelector-".concat(o),!1),d=!(""===s&&!u);return React.createElement("header",{className:"googlesitekit-page-header"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:l},n&&React.createElement(b.a,{id:o,height:i,width:a,className:"googlesitekit-page-header__icon"}),React.createElement("h1",{className:"googlesitekit-page-header__title ".concat(r)},t)),d&&React.createElement("div",{className:"\n\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\tmdc-layout-grid__cell--align-bottom\n\t\t\t\t\t\t\tmdc-layout-grid__cell--align-right-tablet\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-tablet\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-6-desktop\n\t\t\t\t\t\t"},React.createElement("div",{className:"googlesitekit-page-header__details"},s&&React.createElement("span",{className:"\n\t\t\t\t\t\t\t\t\t\tgooglesitekit-page-header__status\n\t\t\t\t\t\t\t\t\t\tgooglesitekit-page-header__status--".concat(s,"\n\t\t\t\t\t\t\t\t\t")},c),u&&React.createElement("span",{className:"googlesitekit-page-header__range"},React.createElement(p.a,null))))))}}]),t}(m.Component);k.propTypes={title:f.a.string,icon:f.a.bool,iconID:f.a.string,iconWidth:f.a.string,iconHeight:f.a.string,className:f.a.string,status:f.a.string,statusText:f.a.string,fullWidth:f.a.bool},k.defaultProps={title:"",icon:!1,iconID:"",iconWidth:"",iconHeight:"",className:"googlesitekit-heading-3",status:"",statusText:"",fullWidth:!1},t.a=k},53:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(21),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.a=Object(p.a)("googlesitekit.ModuleSettingsWarning")(h)},54:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(26),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){return React.createElement(p.a,this.props)}}]),t}(m.Component);t.a=h},58:function(e,t,n){"use strict";var a=n(12),i=n.n(a),o=n(9),r=n(2),s=n(3),c=n.n(s),l=n(4),u=n.n(l),d=n(11),g=function(){function e(t){c()(this,e),this.wins=t,this.response=[]}return u()(e,[{key:"get",value:function(){var e,t=this;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return e=Object(d.filter)(this.wins.map((function(e){return!!e.withData&&(e.withData.callback=function(n){t.response[e.identifier]=n},e.withData)}))),n.next=3,i.a.awrap(o.c.combinedGetFromCache(e));case 3:return n.abrupt("return",this.response);case 4:case"end":return n.stop()}}),null,this)}}]),e}(),m=n(10);n.d(t,"g",(function(){return h})),n.d(t,"f",(function(){return f})),n.d(t,"c",(function(){return b})),n.d(t,"b",(function(){return _})),n.d(t,"d",(function(){return y})),n.d(t,"e",(function(){return O})),n.d(t,"a",(function(){return w}));var p=Object(m.applyFilters)("googlesitekit.winCallbacks",{}),h=function(){return Object(m.applyFilters)("googlesitekit.WinsNotificationsRequest",[])},f=function(){return Object(m.applyFilters)("googlesitekit.ModulesNotificationsRequest",[])};function b(){var e,t,n,a;return i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if((e=window.googlesitekit.setup).isSiteKitConnected&&(e.isAuthenticated||e.isVerified)){o.next=3;break}return o.abrupt("return",0);case 3:return t=0,o.next=6,i.a.awrap(_());case 6:return(n=o.sent)&&n.total&&(t+=n.total),o.next=10,i.a.awrap(y());case 10:return(a=o.sent)&&a.total&&(t+=a.total),t=Object(m.applyFilters)("googlesitekit.TotalNotifications",t),t=Math.max(0,Math.abs(t)),window.localStorage&&window.localStorage.setItem("googlesitekit::total-notifications",t),o.abrupt("return",t);case 16:case"end":return o.stop()}}))}var v=function(e){return e?e.length?e.filter((function(e){return!o.c.getCache("notification::dismissed::".concat(e.id))})):e:[]},k=function(e){var t=function(e){return Object.keys(e).slice(0,1).map((function(t){return e[t]}))};if(1>=Object.keys(e).length)return e;var n=Object.values(e).filter((function(e){var t=o.c.getCache("notification::displayed::".concat(e[0].id));if(t){var n=new Date(t),a=new Date,i=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()));if(n.setHours(0,0,0),i.setHours(0,0,0),n.getTime()===i.getTime())return!0;7<=Object(r.j)(n,i)&&o.c.deleteCache("notification::displayed::".concat(e[0].id))}return null===t})),a=null,i=[];return 0<Object.keys(n).length?(a=t(n),i[Object.keys(n)[0]]=a):(a=t(e),i[Object.keys(e)[0]]=a)};function _(){var e,t,n,a;return i.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return e={},t=0,s.next=4,i.a.awrap(f());case 4:return n=s.sent,a=[],n.map((function(e){var t;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:t=new Promise((function(t){var n,a;return i.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return n=e.identifier,s.t0=v,s.next=4,i.a.awrap(o.c.getNotifications(n,Object(r.p)("day")));case 4:s.t1=s.sent,a=(0,s.t0)(s.t1),t({identifier:n,notifications:a});case 7:case"end":return s.stop()}}))})),a.push(t);case 2:case"end":return n.stop()}}))})),s.next=9,i.a.awrap(Promise.all(a).then((function(n){n.forEach((function(n){n.notifications.length&&(t+=n.notifications.length,e[n.identifier]=n.notifications)}))})));case 9:return s.abrupt("return",{results:e,total:t});case 10:case"end":return s.stop()}}))}function y(){var e,t,n,a,o;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return e={},t=0,r.next=4,i.a.awrap(h());case 4:return n=r.sent,r.next=7,i.a.awrap(new g(n).get());case 7:return a=r.sent,o=[],n.map((function(e){var t;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:t=new Promise((function(t){var n,o,r,s,c;return i.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:n=e.identifier,o=e.callback||Object(d.camelCase)(n),r=null,s=[],e.withData?(c=a[n]||null,r=p[o](c,n)):r=p[o](n),s=v(s=r?[r]:[]),t({identifier:n,notifications:s});case 8:case"end":return i.stop()}}))})),o.push(t);case 2:case"end":return n.stop()}}))})),r.next=12,i.a.awrap(Promise.all(o).then((function(t){t.forEach((function(t){t.notifications.length&&(e[t.identifier]=t.notifications)}))})));case 12:return e=k(e),t=e.length||Object.keys(e).length||0,r.abrupt("return",{results:e,total:t});case 15:case"end":return r.stop()}}))}var O=function(e){var t=Math.abs(e.count)+1;return window.localStorage&&window.localStorage.setItem("googlesitekit::total-notifications",t),{count:t}},w=function(e){var t=Math.max(0,Math.abs(e.count)-1);return window.localStorage&&window.localStorage.setItem("googlesitekit::total-notifications",t),{count:t}}},60:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=n(0),v=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.name,n=e.href,a=e.className,i=e.external;return React.createElement("div",{className:"googlesitekit-source-link ".concat(a)},[Object(b.__)("Source:","google-site-kit")," ",React.createElement(f.a,{key:"link",href:n,external:i,inherit:!0},t)])}}]),t}(m.Component);v.propTypes={name:h.a.string,href:h.a.string,className:h.a.string,external:h.a.bool},v.defaultProps={name:"",href:"",className:"",external:!1},t.a=v},62:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.isSaving;return React.createElement("span",{className:"spinner",style:{display:e?"inline-block":"none",float:"none",marginTop:"0",visibility:"visible"}})}}]),t}(m.Component);t.a=p},63:function(e,t,n){"use strict";var a=n(12),i=n.n(a),o=n(3),r=n.n(o),s=n(4),c=n.n(s),l=n(5),u=n.n(l),d=n(6),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(2),b=n(9),v=n(32),k=n(8),_=n.n(k),y=n(54),O=n(0),w=function(e){function t(){return r()(this,t),u()(this,g()(t).apply(this,arguments))}return p()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,n=e.title,a=e.description,i=e.ctaLabel;return googlesitekit.permissions.canManageOptions?React.createElement(v.a,{title:n,description:a,onClick:t.setupAnalyticsClick,ctaLabel:i}):null}}],[{key:"setupAnalyticsClick",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.a.awrap(Object(f.a)(b.c,"analytics",!0));case 3:return e.next=5,i.a.awrap(Object(f.u)());case 5:window.location=Object(f.m)("analytics",!0),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),Object(f.w)(y.a,{id:"analytics-setup-error",title:Object(O.__)("Internal Server Error","google-site-kit"),description:e.t0.message,format:"small",type:"win-error"});case 11:case"end":return e.stop()}}),null,null,[[0,8]])}}]),t}(h.Component);w.propTypes={title:_.a.string,description:_.a.string,ctaLabel:_.a.string},w.defaultProps={title:Object(O.__)("Learn more about what visitors do on your site.","google-site-kit"),description:Object(O.__)("Connecting with Google Analytics to see unique vistors, goal completions, top pages and more.","google-site-kit"),ctaLabel:Object(O.__)("Set up Analytics","google-site-kit")},t.a=w},65:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r}));var a=n(18),i=n(1),o=i.Suspense?i.Suspense:a.Suspense,r=i.lazy?i.lazy:a.lazy},67:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(29),b=n(14),v=n(22),k=n(145),_=n.n(k),y=n(0),O=function(e){function t(){var e;return i()(this,t),(e=c()(this,u()(t).call(this))).state={attributes:[Object(y.__)("Audience overview","google-site-kit"),Object(y.__)("Top pages","google-site-kit"),Object(y.__)("Top acquisition sources","google-site-kit"),Object(y.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(m.createRef)(),e}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){new v.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,n=e.handleDialog,a=e.title,i=e.provides,o=e.handleConfirm,r=e.subtitle,s=e.confirmButton,c=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(_.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},a&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},a),r&&React.createElement("p",{className:"mdc-dialog__lead"},r),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},i&&i.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),c&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(y.__)("Note: ","google-site-kit")),c),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(f.a,{onClick:o,danger:!0},s||Object(y.__)("Disconnect","google-site-kit")),React.createElement(b.a,{className:"mdc-dialog__cancel-button",onClick:function(){return n()},inherit:!0},Object(y.__)("Cancel","google-site-kit"))))))))}}]),t}(m.Component);O.propTypes={dialogActive:h.a.bool,handleDialog:h.a.func,handleConfirm:h.a.func.isRequired,title:h.a.string,description:h.a.string,confirmButton:h.a.string},O.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=O},69:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(22),b=n(0),v=n(10),k=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={context:"Dashboard"},n.dateRangeHook="googlesitekit.dateRange",n.dateRangeHandlerHook="googlesitekit.dateRageHandler",n.dateRangeHookAddedHook="googlesitekit.dateRageHookAddedHandler",Object(v.addAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingDataForDateRangeSelector",(function(e){n.setState({context:e}),Object(v.removeAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingDataForDateRangeSelector")})),n.handleSelection=n.handleSelection.bind(g()(n)),n}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this;Object(v.addAction)("hookAdded",this.dateRangeHookAddedHook,(function(t){e.dateRangeHook===t&&e.forceUpdate()}))}},{key:"componentWillUnmount",value:function(){Object(v.removeAction)("hookAdded",this.dateRangeHookAddedHook)}},{key:"handleSelection",value:function(e,t){var n=this.state.context,a=t.getAttribute("data-value");return Object(v.removeFilter)(this.dateRangeHook,this.dateRangeHandlerHook),Object(v.addFilter)(this.dateRangeHook,this.dateRangeHandlerHook,(function(){return a})),Object(v.doAction)("googlesitekit.moduleDataReset"),Object(v.doAction)("googlesitekit.moduleLoaded",n),!1}},{key:"render",value:function(){var e=[Object(b.__)("Last 7 days","google-site-kit"),Object(b.__)("Last 14 days","google-site-kit"),Object(b.__)("Last 28 days","google-site-kit"),Object(b.__)("Last 90 days","google-site-kit")];return React.createElement(f.k,{enhanced:!0,className:"mdc-select--minimal",name:"time_period",label:"",onEnhancedChange:this.handleSelection,options:e,value:Object(v.applyFilters)(this.dateRangeHook,Object(b.__)("Last 28 days","google-site-kit"))})}}]),t}(h.Component);t.a=k},80:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).el=document.createElement("div"),n.root=document.querySelector(".googlesitekit-plugin")||document.body,n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(m.createPortal)(this.props.children,this.el)}}]),t}(m.Component)},81:function(e,t,n){"use strict";n(1);var a=n(20),i=n(0);t.a=function(){return React.createElement("div",{className:"googlesitekit-logo","aria-hidden":"true"},React.createElement(a.a,{id:"logo-g",className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),React.createElement(a.a,{id:"logo-sitekit",className:"\n\t\t\t\t googlesitekit-logo__logo-sitekit\n\t\t\t\t",height:"26",width:"99"}),React.createElement("span",{className:"screen-reader-text"},Object(i.__)("Site Kit by Google Logo","google-site-kit")))}},87:function(e,t,n){"use strict";n(1);var a=n(26),i=n(0);t.a=function(){var e=googlesitekit.admin.connectURL;return React.createElement(a.a,{id:"authentication error",title:Object(i.__)("Issue accessing data","google-site-kit"),description:Object(i.__)("You need to reauthenticate your Google account.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0,ctaLink:e,ctaLabel:Object(i.__)("Click here","google-site-kit")})}},88:function(e,t,n){"use strict";n(1);t.a=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#EA4336",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"error-title error-desc"},React.createElement("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3zM12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1zm1 4h-2v-2h2v2z"}))}},89:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(58),b=n(0),v=n(10),k=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={count:0},n.handleIncrement=n.handleIncrement.bind(g()(n)),n.handleDecrement=n.handleDecrement.bind(g()(n)),n}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this;Object(v.addAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications",(function(){Object(v.removeAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications"),Object(f.c)().then((function(t){e.setState({count:t})}))})),document.addEventListener("notificationDismissed",this.handleDecrement,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("notificationDismissed",this.handleDecrement)}},{key:"handleIncrement",value:function(){this.setState(f.e)}},{key:"handleDecrement",value:function(){this.setState(f.a)}},{key:"render",value:function(){var e=Object(b.sprintf)(Object(b._n)("%d notification","%d notifications",this.state.count,"google-site-kit"),this.state.count),t=React.createElement("span",{id:"googlesitekit-notifications-counter",className:"googlesitekit-notifications-counter update-plugins count-".concat(this.state.count)},React.createElement("span",{className:"plugin-count","aria-hidden":"true"},this.state.count),React.createElement("span",{className:"screen-reader-text"},e));return Object(h.createPortal)(t,document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"))}}]),t}(h.Component);t.a=k},9:function(e,t,n){"use strict";var a=n(12),i=n.n(a),o=n(27),r=n.n(o),s=n(49),c=n.n(s),l=n(87),u=(n(1),n(26)),d=n(0),g=function(){return React.createElement(u.a,{id:"permission error",title:Object(d.__)("Permissions issue accessing data","google-site-kit"),description:Object(d.__)("This account does not have access to the requested data.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0})},m=n(165),p=n.n(m),h=n(2),f=n(11),b=n(35),v=n.n(b),k=n(36),_=n(10);function y(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(n,!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.d(t,"a",(function(){return w})),n.d(t,"b",(function(){return R}));var w="core",R="modules",j=function(){googlesitekit.admin=googlesitekit.admin||{},"string"==typeof googlesitekit.admin.datacache&&(googlesitekit.admin.datacache=JSON.parse(googlesitekit.admin.datacache)),"object"!==c()(googlesitekit.admin.datacache)&&(googlesitekit.admin.datacache={})},E=function(e,t){var n=O({data:{}},e);return n.data=O({dateRange:t},n.data),n},C={maxRequests:10,init:function(){googlesitekit.initialized||(googlesitekit.initialized=!0,this.collectModuleData=this.collectModuleData.bind(this),googlesitekit.cache=[],Object(_.addAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingData",this.collectModuleData))},combinedGetFromCache:function(e){var t=this;return new Promise((function(n,a){try{var i=[],o=Object(h.h)();Object(f.each)(e,(function(e){var n=E(e,o);n.key=t.getCacheKey(n.type,n.identifier,n.datapoint,n.data);var a=t.getCache(n.key,n.maxAge);void 0!==a&&(i[n.key]=a,t.resolve(n,a))})),n(i)}catch(e){a()}}))},combinedGet:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=[],i=25,o=Object(h.h)();Object(f.each)(e,(function(e){var n=E(e,o);n.key=t.getCacheKey(n.type,n.identifier,n.datapoint,n.data);var r=t.getCache(n.key,n.maxAge);void 0!==r?(setTimeout((function(){t.resolve(n,r)}),i),i+=25):a.push(n)})),a=Object(f.sortBy)(a,"priority");var r=[],s=[],c={},u=!!a.find((function(e){return e.priority<10}));Object(f.each)(a,(function(e,t){!n&&10<=e.priority&&u?s.push(e):c[e.key]?c[e.key].push(t):(c[e.key]=[t],r.push(e))}));var d=10,m=r.slice(0,d),p=r.slice(d);if(p=p.concat(s),0!==m.length||0!==p.length){0<p.length&&0<this.maxRequests--?setTimeout((function(){t.combinedGet(p,!0)}),50):this.maxRequests=10;var b=null!==Object(h.l)("datacache");return v()({path:Object(k.addQueryArgs)("/google-site-kit/v1/data/",{datacache:b||void 0}),data:{request:m},method:"POST"}).then((function(e){Object(f.each)(e,(function(e,n){if(e.xdebug_message)console.log("data_error",e.xdebug_message);else{if(!c[n])return void console.log("data_error","unknown response key "+n);e.error_data&&e.error_data[403]&&e.error_data[403].reason&&("insufficientPermissions"===e.error_data[403].reason?Object(_.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.AuthNotification",Object(h.g)(l.a),1):"forbidden"===e.error_data[403].reason&&Object(_.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.AuthNotification",Object(h.g)(g),1),Object(_.addFilter)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease",(function(e){return Object(_.removeFilter)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease"),e+1}))),Object(f.each)(c[n],(function(n){var i=a[n];t.setCache(i.key,e),t.resolve(i,e)}))}0===p.length&&Object(_.doAction)("googlesitekit.dataLoaded","api")}))})).catch((function(e){console.log("error",e)}))}Object(_.doAction)("googlesitekit.dataLoaded","cache")},resolve:function(e,t){e&&"function"==typeof e.callback&&e.callback(t,e.datapoint)},setCache:function(e,t){if(void 0!==t&&(!t||"object"!==c()(t)||!t.error&&!t.errors)){j(),googlesitekit.admin.datacache[e]=Object(f.cloneDeep)(t);var n={value:t,date:Date.now()/1e3};Object(h.o)().setItem("googlesitekit_"+e,JSON.stringify(n))}},getCache:function(e,t){if(!googlesitekit.admin.nojscache){if(j(),void 0!==googlesitekit.admin.datacache[e])return googlesitekit.admin.datacache[e];var n=JSON.parse(Object(h.o)().getItem("googlesitekit_"+e));return n&&"object"===c()(n)&&n.date&&(!t||Date.now()/1e3-n.date<t)?(googlesitekit.admin.datacache[e]=Object(f.cloneDeep)(n.value),Object(f.cloneDeep)(googlesitekit.admin.datacache[e])):void 0}},deleteCache:function(e){j(),delete googlesitekit.admin.datacache[e],Object(h.o)().removeItem("googlesitekit_"+e)},invalidateCacheGroup:function(e,t,n){var a=this.getCacheKey(e,t,n);j(),Object.keys(googlesitekit.admin.datacache).forEach((function(e){0!==e.indexOf(a+"::")&&e!==a||delete googlesitekit.admin.datacache[e]})),Object.keys(Object(h.o)()).forEach((function(e){0!==e.indexOf("googlesitekit_"+a+"::")&&e!=="googlesitekit_"+a||Object(h.o)().removeItem(e)}))},collectModuleData:function(e,t){var n=Object(_.applyFilters)("googlesitekit.module"+e+"DataRequest",[],t);0!==n.length&&this.combinedGet(n)},get:function(e,t,n){var a=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=this.getCacheKey(e,t,n,i);if(!o){var s=this.getCache(r,3600);if(void 0!==s)return new Promise((function(e){e(s)}))}return v()({path:Object(k.addQueryArgs)("/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),i)}).then((function(e){return o||a.setCache(r,e),new Promise((function(t){t(e)}))})).catch((function(e){return Promise.reject(e)}))},getNotifications:function(e){var t,n,a,o=arguments;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(t=o.length>1&&void 0!==o[1]?o[1]:0,n=[],e){r.next=4;break}return r.abrupt("return",n);case 4:if(a=this.getCacheKey("modules",e,"notifications"),(n=C.getCache(a,t))&&0!==n.length){r.next=11;break}return r.next=9,i.a.awrap(v()({path:"/google-site-kit/v1/modules/".concat(e,"/notifications/")}));case 9:n=r.sent,C.setCache(a,n);case 11:return r.abrupt("return",n);case 12:case"end":return r.stop()}}),null,this)},set:function(e,t,n,a){var i={};return i.data=a,v()({path:"/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),data:i,method:"POST"}).then((function(a){return C.invalidateCacheGroup(e,t,n),new Promise((function(e){e(a)}))}))},getCacheKey:function(e,t,n){for(var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=[],o=[e,t,n],r=0,s=o;r<s.length;r++){var l=s[r];if(!l||!l.length)break;i.push(l)}return 3===i.length&&a&&"object"===c()(a)&&Object.keys(a).length&&i.push(p()(JSON.stringify(Object(h.x)(a)))),i.join("::")},setModuleActive:function(e,t){return v()({path:"/google-site-kit/v1/modules/".concat(e),data:{active:t},method:"POST"}).then((function(e){return new Promise((function(t){t(e)}))})).catch((function(e){return Promise.reject(e)}))}};C.init();t.c=C}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{105:function(e,t,n){"use strict";n.r(t),t.default=[/google_ad_client: ?["|'](.*?)["|']/,/<(?:script|amp-auto-ads) [^>]*data-ad-client="([^"]+)"/]},106:function(e,t,n){"use strict";n.r(t),t.default=[/<script [^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtag\/js\?id=(UA-.*?)['|"][^>]*><\/script>/,/<script[^>]*>[^<]+google-analytics\.com\/analytics\.js[^<]+(UA-\d+-\d+)/,/__gaTracker\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/,/ga\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/,/_gaq.push\( ?\[ ?['|"]_setAccount['|"], ?['|"](UA-.*?)['|"] ?] ?\)/,/<amp-analytics [^>]*type="gtag"[^>]*>[^<]*<script type="application\/json">[^<]*"gtag_id":\s*"(UA-[^"]+)"/,/<amp-analytics [^>]*type="googleanalytics"[^>]*>[^<]*<script type="application\/json">[^<]*"account":\s*"(UA-[^"]+)"/]},107:function(e,t,n){"use strict";n.r(t),t.default=[/<script[^>]*>[^>]+?www.googletagmanager.com\/gtm[^>]+?['|"](GTM-[0-9A-Z]+)['|"]/,/<script[^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtm\.js\?id=(GTM-[0-9A-Z]+)['|"]/,/<script[^>]*src=['|"]https:\/\/www.googletagmanager.com\/ns.html\?id=(GTM-[0-9A-Z]+)['|"]/,/<amp-analytics [^>]*config=['|"]https:\/\/www.googletagmanager.com\/amp.json\?id=(GTM-[0-9A-Z]+)['|"]/]},14:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.dangerouslySetInnerHTML,n=e.onClick,a=e.href,i=e.children,o=e.className,r=e.arrow,s=e.external,c=e.inverse,l=e.back,u=e.small,d=e.inherit,g=e.caps,m=e.danger,p=e.disabled,h=e.id,f=a&&!p,b=f?"a":"button";return React.createElement(b,{className:"\n\t\t\t\t\tgooglesitekit-cta-link\n\t\t\t\t\t".concat(o||"","\n\t\t\t\t\t").concat(r?"googlesitekit-cta-link--arrow":"","\n\t\t\t\t\t").concat(s?"googlesitekit-cta-link--external":"","\n\t\t\t\t\t").concat(c?"googlesitekit-cta-link--inverse":"","\n\t\t\t\t\t").concat(l?"googlesitekit-cta-link--back":"","\n\t\t\t\t\t").concat(u?"googlesitekit-cta-link--small":"","\n\t\t\t\t\t").concat(d?"googlesitekit-cta-link--inherit":"","\n\t\t\t\t\t").concat(g?"googlesitekit-cta-link--caps":"","\n\t\t\t\t\t").concat(m?"googlesitekit-cta-link--danger":"","\n\t\t\t\t\t").concat(p?"googlesitekit-cta-link--disabled":"","\n\t\t\t\t"),onClick:n,id:h,href:f?a:void 0,target:f&&s?"_blank":void 0,rel:s?"noopener noreferrer":void 0,disabled:p,dangerouslySetInnerHTML:t},i)}}]),t}(m.Component);f.propTypes={dangerouslySetInnerHTML:h.a.shape({__html:h.a.string}),onClick:h.a.func,href:h.a.string,children:h.a.oneOfType([h.a.string.isRequired,h.a.array.isRequired]),className:h.a.string,arrow:h.a.bool,external:h.a.bool,inverse:h.a.bool,back:h.a.bool,small:h.a.bool,inherit:h.a.bool,caps:h.a.bool,danger:h.a.bool,disabled:h.a.bool},f.defaultProps={dangerouslySetInnerHTML:void 0,onClick:null,href:"",className:"",arrow:!1,external:!1,inverse:!1,back:!1,small:!1,inherit:!1,caps:!1,danger:!1,disabled:!1},t.a=f},15:function(e,t,n){"use strict";n.r(t),n.d(t,"extractAnalyticsDataForTrafficChart",(function(){return r})),n.d(t,"extractAnalyticsDashboardData",(function(){return c})),n.d(t,"extractAnalyticsDashboardSparklineData",(function(){return l})),n.d(t,"calculateOverviewData",(function(){return u})),n.d(t,"translateAnalyticsError",(function(){return d})),n.d(t,"getAnalyticsErrorMessageFromData",(function(){return g})),n.d(t,"isDataZeroForReporting",(function(){return m})),n.d(t,"analyticsAdsenseReportDataDefaults",(function(){return p})),n.d(t,"siteAnalyticsReportDataDefaults",(function(){return h})),n.d(t,"overviewReportDataDefaults",(function(){return f})),n.d(t,"trafficSourcesReportDataDefaults",(function(){return b})),n.d(t,"getTopPagesReportDataDefaults",(function(){return k}));var a=n(2),i=n(12),o=n(0),r=function(e){if(!e||!e.length)return null;var t=e[0].data,n=t.rows,a=t.totals[0].values[0],o=[["Source","Percent"]];return Object(i.each)(n,(function(e){var t=e.metrics[0].values[0]/a;if(1>100*t)return!1;var n=e.dimensions[0].replace(/\(none\)/gi,"direct");o.push([n,t])})),o};function s(e,t){var n=[];return Object(i.each)(e,(function(e){if(e.metrics){var a=e.metrics[0].values,i=e.dimensions[0],o=i.slice(0,4)+"-"+i.slice(4,6)+"-"+i.slice(6,8),r=new Date(o);n.push([r,a[t]])}})),n}var c=function(e,t,n){if(!e||!e.length)return null;var a=e[0].data.rows;if(!a)return!1;var r=a.length;if(2*n>r){for(var c=new Date,l=0;n>l;l++){var u=(c.getMonth()+1).toString(),d=c.getDate().toString(),g=c.getFullYear().toString()+(2>u.length?"0":"")+u+(2>d.length?"0":"")+d;if(l>r){var m={dimensions:[g],metrics:[{values:[0,0,0,0,0]}]};a.unshift(m)}c.setDate(c.getDate()-1)}a.push([0,0])}var p=[Object(o.__)("Users","google-site-kit"),Object(o.__)("Sessions","google-site-kit"),Object(o.__)("Bounce Rate","google-site-kit"),Object(o.__)("Session Duration","google-site-kit")],h=[[{type:"date",label:Object(o.__)("Day","google-site-kit")},{type:"number",label:p[t]},{type:"number",label:Object(o.__)("Previous month","google-site-kit")}]],f=a.slice(a.length-n,a.length),b=a.slice(0,a.length-n),k=s(f,t),v=s(b,t);return Object(i.each)(k,(function(e,t){e[0]&&e[1]&&v[t]&&h.push([e[0],e[1],v[t][1]])})),h},l=function(e){if(!e||!e.length)return null;var t=e[0].data.rows,n=[[{type:"date",label:"Day"},{type:"number",label:"Users"},{type:"number",label:"Sessions"},{type:"number",label:"Goals Completed"}]];return Object(i.each)(t,(function(e){var t=e.metrics[0].values,a=e.dimensions[0],i=a.slice(0,4)+"-"+a.slice(4,6)+"-"+a.slice(6,8),o=new Date(i);n.push([o,t[0],t[1],t[4]])})),n},u=function(e){if(!e||!e.length)return!1;var t=e[0].data.totals,n=t[0].values,i=t[1].values,o=n[0],r=n[1],s=n[2],c=n[3],l=n[4],u=n[5];return{totalUsers:o,totalSessions:r,averageBounceRate:s,averageSessionDuration:c,totalUsersChange:Object(a.b)(i[0],n[0]),totalSessionsChange:Object(a.b)(i[1],n[1]),averageBounceRateChange:Object(a.b)(i[2],n[2]),averageSessionDurationChange:Object(a.b)(i[3],n[3]),goalCompletions:l,goalCompletionsChange:Object(a.b)(i[4],n[4]),totalPageViews:u,totalPageViewsChange:Object(a.b)(i[5],n[5])}},d=function(e,t){var n="";switch(e){case"INVALID_ARGUMENT":n=Object(o.__)("Analytics module needs to be configured.","google-site-kit");break;case"UNAUTHENTICATED":n=Object(o.__)("You need to be authenticated to get this data.","google-site-kit");break;case"PERMISSION_DENIED":n=Object(o.__)("Your account does not have sufficient permission to access this data, please consult to your web administrator.","google-site-kit");break;case"RESOURCE_EXHAUSTED":n=Object(o.__)("Your account exceeded the maximum quota. Please try again later.","google-site-kit");break;case"INTERNAL":n=Object(o.__)("Unexpected internal server error occurred.","google-site-kit");break;case"BACKEND_ERROR":n=Object(o.__)("Analytics server returned unknown error. Please try again later.","google-site-kit");break;case"UNAVAILABLE":n=Object(o.__)("The service was unable to process the request. Please try again later.","google-site-kit");break;default:n=t}return n},g=function(e){return!(!e.error||!e.error.status)&&d(e.error.status,e.error.message)},m=function(e){if(!e||!e.length)return!0;if(e&&e[0]&&e[0].data&&e[0].data.totals&&e[0].data.totals[0]){var t=e[0].data.totals[0].values,n=!0;return Object(i.each)(t,(function(e){0!==parseInt(e)&&(n=!1)})),n}return!1},p={dimensions:["ga:pageTitle","ga:pagePath"].join(","),metrics:[{expression:"ga:adsenseRevenue",alias:"Earnings"},{expression:"ga:adsenseECPM",alias:"Page RPM"},{expression:"ga:adsensePageImpressions",alias:"Impressions"}],orderby:[{fieldName:"ga:adsenseRevenue",sortOrder:"DESCENDING"}],limit:10},h={compareDateRanges:1,dimensions:"ga:date",metrics:[{expression:"ga:users",alias:"Users"},{expression:"ga:sessions",alias:"Sessions"},{expression:"ga:bounceRate",alias:"Bounce Rate"},{expression:"ga:avgSessionDuration",alias:"Average Session Duration"},{expression:"ga:goalCompletionsAll",alias:"Goal Completions"}],limit:180},f={multiDateRange:1,dimensions:"ga:date",metrics:[{expression:"ga:users",alias:"Users"},{expression:"ga:sessions",alias:"Sessions"},{expression:"ga:bounceRate",alias:"Bounce Rate"},{expression:"ga:avgSessionDuration",alias:"Average Session Duration"},{expression:"ga:goalCompletionsAll",alias:"Goal Completions"},{expression:"ga:pageviews",alias:"Pageviews"}],limit:10},b={dimensions:"ga:medium",metrics:[{expression:"ga:sessions",alias:"Sessions"},{expression:"ga:users",alias:"Users"},{expression:"ga:newUsers",alias:"New Users"}],orderby:[{fieldName:"ga:sessions",sortOrder:"DESCENDING"}],limit:10},k=function(){var e=[{expression:"ga:pageviews",alias:"Pageviews"},{expression:"ga:uniquePageviews",alias:"Unique Pageviews"},{expression:"ga:bounceRate",alias:"Bounce rate"}];return window.googlesitekit.modules.analytics.adsenseLinked&&e.push({expression:"ga:adsenseRevenue",alias:"AdSense Revenue"},{expression:"ga:adsenseECPM",alias:"AdSense ECPM"}),{dimensions:["ga:pageTitle","ga:pagePath"].join(","),metrics:e,orderby:[{fieldName:"ga:pageviews",sortOrder:"DESCENDING"}],limit:10}}},17:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.ctaLabel,a=e.ctaLink;return React.createElement("header",{className:"googlesitekit-layout__header"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:"\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\t\t".concat(a?"mdc-layout-grid__cell--span-6-desktop":"mdc-layout-grid__cell--span-12-desktop","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--align-middle\n\t\t\t\t\t\t\t\t\t").concat(a?"":"mdc-layout-grid__cell--span-8-tablet","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\t\t")},React.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},t)),a&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "},React.createElement(f.a,{href:a,external:!0,inherit:!0},n)))))}}]),t}(m.Component);b.propTypes={title:h.a.string,ctaLabel:h.a.string,ctaLink:h.a.string},b.defaultProps={title:"",ctaLabel:"",ctaLink:""};var k=b,v=n(62),y=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLabel,n=e.ctaLink,a=e.footerContent;return React.createElement("footer",{className:"googlesitekit-layout__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n&&t&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:t,href:n,external:!0}),a))))}}]),t}(m.Component);y.propTypes={ctaLabel:h.a.string,ctaLink:h.a.string};var _=y,w=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.footer,a=e.children,i=e.title,o=e.headerCtaLabel,r=e.headerCtaLink,s=e.footerCtaLabel,c=e.footerCtaLink,l=e.footerContent,u=e.className,d=e.fill,g=e.relative;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-layout\n\t\t\t\t".concat(u&&u,"\n\t\t\t\t").concat(d?"googlesitekit-layout--fill":"","\n\t\t\t\t").concat(g?"googlesitekit-layout--relative":"","\n\t\t\t")},t&&React.createElement(k,{title:i,ctaLabel:o,ctaLink:r}),a,n&&React.createElement(_,{ctaLabel:s,ctaLink:c,footerContent:l}))}}]),t}(m.Component);w.propTypes={header:h.a.bool,footer:h.a.bool,children:h.a.node.isRequired,title:h.a.string,headerCtaLabel:h.a.string,headerCtaLink:h.a.string,footerCtaLabel:h.a.string,footerCtaLink:h.a.string,footerContent:h.a.node,className:h.a.string,fill:h.a.bool,relative:h.a.bool},w.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1};t.a=w},173:function(e,t,n){"use strict";var a={};n.r(a),n.d(a,"totalStats",(function(){return u})),n.d(a,"firstPostWin",(function(){return d})),n.d(a,"pageviewIncrease",(function(){return m})),n.d(a,"publishingWin",(function(){return p})),n.d(a,"trafficIncrease",(function(){return h}));var i=n(23),o=n.n(i),r=n(2),s=n(9),c=n(35),l=n(0),u=function(e,t){if(5>=parseInt(googlesitekit.admin.newSitePosts,10))return!1;if(!e||!e.rows)return!1;var n=[],a=Object(l.__)("Here are some high level stats","google-site-kit");if(e&&e.rows){var i=Object(c.extractSearchConsoleDashboardData)(e),o=i.totalClicks,s=i.totalClicksChange,u=i.totalImpressions,d=i.totalImpressionsChange,g=i.averageCTR,m=i.averageCTRChange;0<s&&0<d&&0<m&&(a="".concat(Object(l.__)("Last month was great!","google-site-kit"),". ").concat(a)),n=[{title:Object(l.__)("Total Clicks","google-site-kit"),datapoint:o,datapointUnit:"",change:s,changeDataUnit:"%",period:Object(l.__)("for month","google-site-kit")},{title:Object(l.__)("Total Impressions","google-site-kit"),datapoint:u,datapointUnit:"",change:d,changeDataUnit:"%",period:Object(l.__)("for month","google-site-kit")},{title:Object(l.__)("Average CTR","google-site-kit"),datapoint:g,datapointUnit:"%",change:m,changeDataUnit:"%",period:Object(l.__)("for month","google-site-kit")}]}var p=new Date,h=new Date(p.getFullYear(),p.getMonth()+1,0),f=Object(r.i)(p,h)+1;return{id:t,title:Object(l.__)("Welcome Back!","google-site-kit"),description:a,format:"large",winImage:"".concat(googlesitekit.admin.assetsRoot,"images/g-win.png"),blockData:n,type:"win-stats",dismissExpires:Object(r.o)("day")*f,showOnce:!0}},d=function(e){return!(1!==parseInt(googlesitekit.admin.newSitePosts,10))&&{id:e,title:Object(l.__)("Congrats on your first post!","google-site-kit"),format:"small",smallImage:"".concat(googlesitekit.admin.assetsRoot,"images/thumbs-up.png"),type:"win-success",showOnce:!0}},g=n(15),m=function(e,t){if(!googlesitekit.modules.analytics||!googlesitekit.modules.analytics.active)return!1;if(!e||!e.reports)return!1;var n=Object(g.calculateOverviewData)(e);if(!n)return!1;var a=n.totalPageViewsChange,i=n.totalPageViews;return!(10>a)&&{id:t,title:Object(l.__)("Increased page views!","google-site-kit"),description:Object(l.__)("Over the past 4 weeks","google-site-kit"),format:"large",logo:!1,winImage:"".concat(googlesitekit.admin.assetsRoot,"images/sun-small.png"),blockData:[{title:Object(l.__)("Total Page Views","google-site-kit"),datapoint:Object(r.r)(i),datapointUnit:""},{title:Object(l.__)("Increase","google-site-kit"),datapoint:a,datapointUnit:"%"}],type:"win-stats-increase",dismissExpires:Object(r.o)("month"),showOnce:!0}},p=function(e,t){if(!(5===parseInt(googlesitekit.admin.newSitePosts,10)))return!1;var n=Object(l.__)("That’s out of this world.","google-site-kit"),a=[];if(googlesitekit.modules["search-console"]&&googlesitekit.modules["search-console"].active&&e){var i=Object(c.extractSearchConsoleDashboardData)(e),o=i.totalClicks,s=i.totalImpressions,u=i.averageCTR;a=[{title:Object(l.__)("Total Impressions","google-site-kit"),datapoint:Object(r.t)(s),datapointUnit:""},{title:Object(l.__)("Total Clicks","google-site-kit"),datapoint:Object(r.t)(o),datapointUnit:""},{title:Object(l.__)("Average CTR","google-site-kit"),datapoint:u,datapointUnit:"%"}],n=Object(l.__)("That’s out of this world. Here are the combined stats for your posts","google-site-kit")}return{id:t,title:Object(l.__)("Congrats on five published posts","google-site-kit"),description:n,format:"large",winImage:"".concat(googlesitekit.admin.assetsRoot,"images/rocket.png"),blockData:a,type:"win-stats",showOnce:!0}},h=function(e,t){if(!googlesitekit.modules.analytics||!googlesitekit.modules.analytics.active)return!1;if(!e||!e[0])return!1;var n=Object(g.calculateOverviewData)(e);if(!n)return!1;var a=n.totalUsersChange,i=n.totalUsers;return!(10>a||100<a)&&{id:t,title:Object(l.__)("Congrats on more website visitors!","google-site-kit"),description:Object(l.__)("You had a record-high amount of visitors to your website yesterday.","google-site-kit"),dismiss:Object(l.__)("OK, Got it!","google-site-kit"),format:"large",winImage:"".concat(googlesitekit.admin.assetsRoot,"images/sun.png"),blockData:[{title:Object(l.__)("Site Visitors","google-site-kit"),datapoint:Object(r.t)(i),datapointUnit:""},{title:Object(l.__)("Increase","google-site-kit"),datapoint:a,datapointUnit:"%"}],type:"win-stats",dismissExpires:Object(r.o)("week"),showOnce:!0}},f=n(10);function b(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}var k=Object(r.k)("notification");"authentication_success"!==k&&"authentication_failure"!==k&&(Object(f.addFilter)("googlesitekit.winCallbacks","googlesitekit.publisherwinCallbacks",(function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(n,!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e,{},a)})),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){return e.push({identifier:"first-post-win"}),e}),1),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"publishing-win",withData:{type:s.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(r.o)("day"),context:"Dashboard"}};return e.push(t),e}),1),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"total-stats",withData:{type:s.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(r.o)("day"),context:"Dashboard"}};return e.push(t),e}),2),googlesitekit.modules.analytics.active&&(Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"pageview-increase",withData:{type:s.b,identifier:"analytics",datapoint:"reports",data:g.overviewReportDataDefaults,priority:1,maxAge:Object(r.o)("day"),context:"Dashboard"}};return e.push(t),e}),2),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"traffic-increase",withData:{type:s.b,identifier:"analytics",datapoint:"report",data:g.overviewReportDataDefaults,priority:1,maxAge:Object(r.o)("day"),context:"Dashboard"}};return e.push(t),e}),2)))},2:function(e,t,n){"use strict";var a,i=n(51),o=n.n(i),r=n(72),s=n.n(r),c=n(23),l=n.n(c),u=n(11),d=n.n(u),g=(n(1),n(12)),m=n(9),p=n(20),h=n(18),f=n.n(h),b=n(33),k=n.n(b),v=n(10),y=n(0),_=n(32),w=n(105),O=n(106),R=n(107),j=n(50),E=n(3),C=n.n(E),N=n(4),D=n.n(N),x=function(e){var t=window[e];if(!t)return!1;try{var n="__storage_test__";return t.setItem(n,n),t.removeItem(n),!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}},S=function(){function e(){C()(this,e)}return D()(e,[{key:"key",value:function(){return null}},{key:"getItem",value:function(){return null}},{key:"setItem",value:function(){}},{key:"removeItem",value:function(){}},{key:"clear",value:function(){}},{key:"length",get:function(){return 0}}]),e}(),A=function(){return a||(a=x("sessionStorage")?window.sessionStorage:x("localStorage")?window.localStorage:new S),a};function I(){Object(y.setLocaleData)(googlesitekit.locale,"google-site-kit")}function L(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(n,!0).forEach((function(t){l()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.d(t,"t",(function(){return M})),n.d(t,"r",(function(){return T})),n.d(t,"o",(function(){return U})),n.d(t,"s",(function(){return F})),n.d(t,"i",(function(){return q})),n.d(t,"b",(function(){return H})),n.d(t,"e",(function(){return G})),n.d(t,"u",(function(){return W})),n.d(t,"l",(function(){return B})),n.d(t,"f",(function(){return K})),n.d(t,"m",(function(){return z})),n.d(t,"z",(function(){return V})),n.d(t,"A",(function(){return Q})),n.d(t,"j",(function(){return J})),n.d(t,"a",(function(){return X})),n.d(t,"y",(function(){return $})),n.d(t,"w",(function(){return ee})),n.d(t,"d",(function(){return te})),n.d(t,"h",(function(){return ae})),n.d(t,"g",(function(){return ie})),n.d(t,"q",(function(){return oe})),n.d(t,"x",(function(){return re})),n.d(t,"c",(function(){return j.b})),n.d(t,"k",(function(){return j.c})),n.d(t,"v",(function(){return j.d})),n.d(t,"n",(function(){return A})),n.d(t,"p",(function(){return I}));var M=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t=Object(g.isUndefined)(e)?0:1e6<e?(e/=1e6).toFixed(1)+"M":1e3<e?99<(e/=1e3)?Math.round(e)+"K":e.toFixed(1)+"K":e,(Object(g.isNull)(e)||Object(g.isUndefined)(e)||isNaN(e))&&(t="",e=0),0===e)return t="0.00",n?new Intl.NumberFormat(navigator.language,{style:"currency",currency:n}).format(e):e;if(!1!==n&&""!==t){var a=new Intl.NumberFormat(navigator.language,{style:"currency",currency:n}).formatToParts(e),i=a.find((function(e){return"decimal"===e.type}));!Object(g.isUndefined)(i)&&!Object(g.isUndefined)(i.value)&&1e3>e&&(t=Number.isInteger(e)?e:e.replace(".",i.value));var o=a.find((function(e){return"currency"===e.type})),r=o?o.value:"";return"".concat(r).concat(t)}return t.toString()},T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t||(t=navigator.language),t=t.replace("_","-").toLocaleLowerCase(),new Intl.NumberFormat(t).format(e)},U=function(e){switch(e){case"minute":return 60;case"hour":return 3600;case"day":return 86400;case"week":return 604800;case"month":return 2592e3;case"year":return 31536e3}},F=function(e){if(e=parseInt(e,10),isNaN(e)||0===e)return"0.0s";var t={};return t.hours=Math.floor(e/60/60),t.minutes=Math.floor(e/60%60),t.seconds=Math.floor(e%60),((t.hours?t.hours+"h ":"")+(t.minutes?t.minutes+"m ":"")+(t.seconds?t.seconds+"s ":"")).trim()},q=function(e,t){var n=1e3*U("day"),a=e.getTime(),i=t.getTime();return Math.round(Math.abs(a-i)/n)},H=function(e,t){if("0"===e||0===e||isNaN(e))return"";var n=((t-e)/e*100).toFixed(1);return isNaN(n)||"Infinity"===n?"":n},G=function(e,t){return Object(g.map)(e,(function(e,n){return[e[0],e[t]||(0===n?"":0)]}))},W=function(){var e,t;return d.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,d.a.awrap(m.c.get(m.a,"user","authentication"));case 3:e=n.sent,t=e.grantedScopes.filter((function(t){return-1!==e.requiredScopes.indexOf(t)})),window.googlesitekit.setup=window.googlesitekit.setup||{},window.googlesitekit.setup.isAuthenticated=e.isAuthenticated,window.googlesitekit.setup.requiredScopes=e.requiredScopes,window.googlesitekit.setup.grantedScopes=e.grantedScopes,window.googlesitekit.setup.needReauthenticate=t.length<e.requiredScopes.length,n.next=14;break;case 12:n.prev=12,n.t0=n.catch(0);case 14:case"end":return n.stop()}}),null,null,[[0,12]])},B=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:googlesitekit,a=n.admin,i=a.connectURL,o=a.adminRoot,r=n.setup.needReauthenticate,s=n.modules[e].screenID,c="pagespeed-insights"===e?{notification:"authentication_success",reAuth:void 0}:{},l=Object(_.addQueryArgs)(o,P({page:e&&t&&s?s:"googlesitekit-dashboard",slug:e,reAuth:t},c));if(!r)return l;var u=encodeURIComponent(Object(_.getQueryString)(l));return l=o+"?"+u,Object(_.addQueryArgs)(i,{redirect:l,status:t})},K=function(e,t){return function(n){return function(a){return f.a.createElement(e,s()({},a,t,{OriginalComponent:n}))}}},z=function(e,t){var n=googlesitekit.admin.adminRoot;return e||(e="googlesitekit-dashboard"),t=P({page:e},t),Object(_.addQueryArgs)(n,t)},V=function(e){try{return JSON.parse(e)&&!!e}catch(e){return!1}},Q=function(e){return e.match(/^GTM-[a-zA-Z\d]{7}#x2F;)},J=function(e){var t,n,a,i,o;return d.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=googlesitekit.admin,n=t.homeURL,a=t.ampMode,i={tagverify:1,timestamp:Date.now()},r.next=4,d.a.awrap(Y(Object(_.addQueryArgs)(n,i),e));case 4:if((o=r.sent)||"secondary"!==a){r.next=9;break}return r.next=8,d.a.awrap(k()({path:"/wp/v2/posts?per_page=1"}).then((function(t){return t.slice(0,1).map((function(t){return d.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,d.a.awrap(Y(Object(_.addQueryArgs)(t.link,P({},i,{amp:1})),e));case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}))})).pop()})));case 8:o=r.sent;case 9:return r.abrupt("return",Promise.resolve(o||null));case 10:case"end":return r.stop()}}))},Y=function(e,t){var n;return d.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,d.a.awrap(fetch(e,{credentials:"omit"}).then((function(e){return e.text()})));case 3:return n=a.sent,a.abrupt("return",Z(n,t)||null);case 7:return a.prev=7,a.t0=a.catch(0),a.abrupt("return",null);case 10:case"end":return a.stop()}}),null,null,[[0,7]])},Z=function(e,t){var n=({adsense:w.default,analytics:O.default,tagmanager:R.default}[t]||[]).find((function(t){return t.test(e)}));return!!n&&n.exec(e)[1]},X=function(e,t,n){return e.setModuleActive(t,n).then((function(e){return window.googlesitekit.modules&&window.googlesitekit.modules[t]&&(window.googlesitekit.modules[t].active=e.active),Object(j.d)("".concat(t,"_setup"),e.active?"module_activate":"module_deactivate",t),new Promise((function(t){t(e)}))}))},$=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:googlesitekit,o=i.modules[e],r=o.settings,s=o.setupComplete,c=a||document.getElementById("confirm-changes-".concat(e));if(s&&c){var l=!!Object.keys(t).find((function(e){var a=t[e];return!Object(g.isEqual)(n[e],r[a])}));return a||(c.disabled=!l),l}},ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(v.addFilter)("googlesitekit.ErrorNotification","googlesitekit.ErrorNotification",K(e,t),1)},te=function(e){if(!e)return"";var t=e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)})).replace(/(\\)/g,"");return Object(g.unescape)(t)};function ne(){return Object(v.applyFilters)("googlesitekit.dateRange",Object(y.__)("Last 28 days","google-site-kit"))}function ae(){return ne().replace("Last ","")}function ie(){return e=ne(),Object(g.toLower)(Object(g.deburr)(Object(g.trim)(e.replace(/[\s./_]+/g,"-"),"-")));var e}function oe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"33",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"33",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(googlesitekit){var o=f.a.createElement(p.a,{id:e,width:n,height:a,className:i});return t?o=f.a.createElement(p.a,{id:"".concat(e,"-disabled"),width:n,height:a,className:i}):"pagespeed-insights"===e&&(o=f.a.createElement("img",{src:googlesitekit.admin.assetsRoot+"images/icon-pagespeed.png",width:n,alt:"",className:i})),o}}function re(e){var t={};return Object.keys(e).sort().forEach((function(n){var a=e[n];a&&"object"===o()(a)&&!Array.isArray(a)&&(a=re(a)),t[n]=a})),t}},20:function(e,t,n){"use strict";n(1);var a=n(8),i=n.n(a),o=function(e){var t=e.id,n=e.className,a=e.height,i=e.width,o="".concat(googlesitekit.admin.assetsRoot,"svg/svg.svg");return React.createElement("svg",{className:"svg".concat(" ",n),height:a,width:i},React.createElement("use",{xlinkHref:"".concat(o,"#").concat(t)}))};o.propTypes={id:i.a.string.isRequired,className:i.a.string,height:i.a.string,width:i.a.string},o.defaultProps={className:"",height:20,width:20},t.a=o},21:function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(12),h=n(10),f=n(54),b=16;function k(e){return Object(f.createHigherOrderComponent)((function(t){var n,a="core/with-filters/"+e;var o=function(o){function s(){var a;return i()(this,s),a=c()(this,u()(s).apply(this,arguments)),void 0===n&&(n=Object(h.applyFilters)(e,t)),a}return g()(s,o),r()(s,[{key:"componentDidMount",value:function(){s.instances.push(this),1===s.instances.length&&(Object(h.addAction)("hookRemoved",a,l),Object(h.addAction)("hookAdded",a,l))}},{key:"componentWillUnmount",value:function(){s.instances=Object(p.without)(s.instances,this),0===s.instances.length&&(Object(h.removeAction)("hookRemoved",a),Object(h.removeAction)("hookAdded",a))}},{key:"render",value:function(){return React.createElement(n,this.props)}}]),s}(m.Component);o.instances=[];var s=Object(p.debounce)((function(){n=Object(h.applyFilters)(e,t),o.instances.forEach((function(e){e.forceUpdate()}))}),b);function l(t){t===e&&s()}return o}),"withFilters")}},22:function(e,t,n){"use strict";var a=n(86),i=n.n(a);n.d(t,"l",(function(){return i.a})),n.d(t,"a",(function(){return a.HelperText})),n.d(t,"b",(function(){return a.Input}));var o=n(154);n.d(t,"h",(function(){return o.a}));var r=n(160);n.d(t,"e",(function(){return r.a}));var s=n(159);n.d(t,"g",(function(){return s.a}));var c=n(104),l=n.n(c);n.d(t,"k",(function(){return l.a})),n.d(t,"j",(function(){return c.Option}));var u=n(161);n.d(t,"i",(function(){return u.a}));var d=n(158);n.d(t,"d",(function(){return d.a}));var g=n(157);n.d(t,"c",(function(){return g.a}));var m=n(156);n.d(t,"f",(function(){return m.a}))},25:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(1),i=function(e){return function(t){return function(n){return Object(a.createElement)(a.Fragment,{},"",Object(a.createElement)(t,n),e)}}}},26:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(8),b=n.n(f),k=n(9),v=n(27),y=n(28);var _=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#F9BB2D",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"warning-title warning-desc"},React.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),React.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))},w=n(93),O=n(14),R=n(20),j=n(12),E=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={isClosed:!1},n.cardRef=Object(h.createRef)(),n.handleDismiss=n.handleDismiss.bind(g()(n)),0<n.props.dismissExpires&&n.expireDismiss(),n.props.showOnce&&k.c.setCache("notification::displayed::".concat(n.props.id),new Date),n}return p()(t,e),r()(t,[{key:"handleDismiss",value:function(e){var t=this,n=this.state.isClosed,a=this.cardRef.current;e.preventDefault(),this.setState({isClosed:!n}),setTimeout((function(){k.c.setCache("notification::dismissed::".concat(t.props.id),new Date),a.style.display="none";var e=new Event("notificationDismissed");document.dispatchEvent(e)}),350)}},{key:"expireDismiss",value:function(){var e=this.props,t=e.id,n=e.dismissExpires,a=k.c.getCache("notification::dismissed::".concat(t));if(a){var i=new Date(a);i.setSeconds(i.getSeconds()+parseInt(n,10)),i<new Date&&k.c.deleteCache("notification::dismissed::".concat(t))}}},{key:"render",value:function(){var e=this.state.isClosed,t=this.props,n=t.children,a=t.id,i=t.title,o=t.description,r=t.blockData,s=t.winImage,c=t.smallImage,l=t.format,u=t.learnMoreURL,d=t.learnMoreDescription,g=t.learnMoreLabel,m=t.ctaLink,p=t.ctaLabel,f=t.ctaTarget,b=t.type,E=t.dismiss,C=t.isDismissable,N=t.logo,D=t.module,x=t.moduleName,S=t.pageIndex;if(k.c.getCache("notification::dismissed::".concat(a)))return null;var A,I=e?"is-closed":"is-open",L="large"===l&&"win-stats-increase"===b,P="mdc-layout-grid__cell--span-12";"large"===l?(P="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-6-tablet mdc-layout-grid__cell--span-8-desktop ",L&&(P="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-5-tablet mdc-layout-grid__cell--span-8-desktop ")):"small"===l&&(P="mdc-layout-grid__cell--span-11-desktop mdc-layout-grid__cell--span-7-tablet mdc-layout-grid__cell--span-3-phone"),A="win-warning"===b?React.createElement(_,null):"win-error"===b?React.createElement(w.a,null):"";var M=React.createElement(h.Fragment,null,r&&React.createElement("div",{className:"mdc-layout-grid__inner"},Object(j.map)(r,(function(e,t){return React.createElement("div",{key:t,className:"mdc-layout-grid__cell ".concat(L?"mdc-layout-grid__cell--span-5-desktop":"mdc-layout-grid__cell--span-4-desktop")},React.createElement("div",{className:"googlesitekit-publisher-win__stats"},React.createElement(v.a,e)))})))),T=React.createElement(h.Fragment,null,React.createElement("h3",{className:"googlesitekit-heading-2 googlesitekit-publisher-win__title"},i),o&&React.createElement("div",{className:"googlesitekit-publisher-win__desc"},React.createElement("p",null,o,g&&React.createElement(h.Fragment,null," ",React.createElement(O.a,{href:u,external:!0,inherit:!0},g),d),S&&React.createElement("span",{className:"googlesitekit-publisher-win__detect"},S))),n),U=D?React.createElement(R.a,{id:D,height:"19",width:"19"}):React.createElement(R.a,{id:"logo-g",height:"34",width:"32"});return React.createElement("section",{ref:this.cardRef,className:"\n\t\t\t\tgooglesitekit-publisher-win\n\t\t\t\t".concat(l?"googlesitekit-publisher-win--".concat(l):"","\n\t\t\t\t").concat(b?"googlesitekit-publisher-win--".concat(b):"","\n\t\t\t\t").concat(I?"googlesitekit-publisher-win--".concat(I):"","\n\t\t\t")},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},N&&React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12 ".concat(L?"mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet":"")},React.createElement("div",{className:"googlesitekit-publisher-win__logo"},U),x&&React.createElement("div",{className:"googlesitekit-publisher-win__module-name"},x)),c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},React.createElement("img",{className:"googlesitekit-publisher-win__small-image",alt:"",src:c})),React.createElement("div",{className:"mdc-layout-grid__cell ".concat(P)},L?React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-5-desktop mdc-layout-grid__cell--span-8-tablet"},T),React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-7-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--align-bottom"},M)):React.createElement(h.Fragment,null,T,M),m&&React.createElement(y.a,{href:m,target:f},p),C&&E&&React.createElement(O.a,{onClick:this.handleDismiss},E)),s&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--order-1-phone mdc-layout-grid__cell--order-2-tablet mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},React.createElement("div",{className:"googlesitekit-publisher-win__image-large"},React.createElement("img",{alt:"",src:s}))),("win-error"===b||"win-warning"===b)&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},React.createElement("div",{className:"googlesitekit-publisher-win__icons"},A)))))}}]),t}(h.Component);E.propTypes={id:b.a.string.isRequired,title:b.a.string.isRequired,description:b.a.string,learnMoreURL:b.a.string,learnMoreDescription:b.a.string,learnMoreLabel:b.a.string,blockData:b.a.array,winImage:b.a.string,smallImage:b.a.string,format:b.a.string,ctaLink:b.a.string,ctaLabel:b.a.string,type:b.a.string,dismiss:b.a.string,isDismissable:b.a.bool,logo:b.a.bool,module:b.a.string,moduleName:b.a.string,pageIndex:b.a.string,dismissExpires:b.a.number,showOnce:b.a.bool},E.defaultProps={isDismissable:!0,dismissExpires:0,showOnce:!1};t.a=E},27:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(8),b=n.n(f),k=n(62),v=n(20),y=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).handleClick=n.handleClick.bind(g()(n)),n.handleKeyPress=n.handleKeyPress.bind(g()(n)),n}return p()(t,e),r()(t,[{key:"handleClick",value:function(){var e=this.props,t=e.stat;(0,e.handleStatSelection)(t)}},{key:"handleKeyPress",value:function(e){e.preventDefault();var t=this.props,n=t.stat,a=t.handleStatSelection;"Enter"!==e.key&&" "!==e.key||a(n)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.title,a=e.datapoint,i=e.datapointUnit,o=e.change,r=e.changeDataUnit,s=e.context,c=e.period,l=e.selected,u=e.handleStatSelection,d=e.source,g=e.sparkline,m=e.reverseArrowDirection,p="button"===s?"button":"",f=0<=o?"-positive":"-negative";return React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-data-block\n\t\t\t\t\tgooglesitekit-data-block--".concat(s,"\n\t\t\t\t\t").concat(l?"googlesitekit-data-block--selected":"","\n\t\t\t\t\t").concat(t,"\n\t\t\t\t"),tabIndex:"button"===s?"0":"-1",role:u&&p,onClick:u&&this.handleClick,onKeyPress:u&&this.handleKeyPress,"aria-label":u&&n,"aria-pressed":u&&l},React.createElement("div",{className:"googlesitekit-data-block__title-datapoint-wrapper"},React.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-data-block__title "},n),React.createElement("div",{className:"googlesitekit-data-block__datapoint"},"".concat(a).concat(i))),g&&React.createElement("div",{className:"googlesitekit-data-block__sparkline"},g),React.createElement("div",{className:"googlesitekit-data-block__change-source-wrapper"},React.createElement("div",{className:"\n\t\t\t\t\t\tgooglesitekit-data-block__change\n\t\t\t\t\t\tgooglesitekit-data-block__change--".concat(0<=o?"positive":"negative","\n\t\t\t\t\t")},""===o&&React.createElement(h.Fragment,null," "),o&&[React.createElement("span",{key:"arrow",className:"googlesitekit-data-block__arrow ".concat(m?"googlesitekit-data-block__arrow--reverse":"")},React.createElement(v.a,{id:"arrow".concat(f),height:"9",width:"9"})),React.createElement("span",{key:"values",className:"googlesitekit-data-block__value"},"".concat(Math.abs(o)).concat(r," ").concat(c))]),d&&React.createElement(k.a,{className:"googlesitekit-data-block__source",name:d.name,href:d.link})))}}]),t}(h.Component);y.propTypes={stat:b.a.number,onClick:b.a.func,className:b.a.string,title:b.a.string,datapoint:b.a.oneOfType([b.a.string,b.a.number]),datapointUnit:b.a.string,change:b.a.oneOfType([b.a.string,b.a.number]),changeDataUnit:b.a.string,context:b.a.string,period:b.a.string,selected:b.a.bool,handleStatSelection:b.a.func,reverseArrowDirection:b.a.bool},y.defaultProps={stat:null,onClick:null,className:"",title:"",datapoint:null,datapointUnit:"",change:null,changeDataUnit:"",context:"default",period:"",selected:!1,handleStatSelection:null,reverseArrowDirection:!1},t.a=y},28:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(22),h=n(8),f=n.n(h),b=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).buttonRef=Object(m.createRef)(),n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){new p.h(this.buttonRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.children,a=e.href,i=e.text,o=e.className,r=e.danger,s=e.disabled,c=e.target,l=e.id,u=e.icon,d=e.trailingIcon,g=e.ariaHaspopup,m=e.ariaExpanded,p=e.ariaControls,h=a?"a":"button";return React.createElement(h,{className:"\n\t\t\t\t\tmdc-button\n\t\t\t\t\t".concat(!i&&"mdc-button--raised","\n\t\t\t\t\t").concat(o&&o,"\n\t\t\t\t\t").concat(r?"mdc-button--danger":"","\n\t\t\t\t"),onClick:t,href:a,ref:this.buttonRef,disabled:s?"disabled":"",target:c||"_self",id:l,"aria-haspopup":g,"aria-expanded":m,"aria-controls":p},u&&u,React.createElement("span",{className:"mdc-button__label"},n),d&&d)}}]),t}(m.Component);b.propTypes={onClick:f.a.func,children:f.a.string.isRequired,href:f.a.string,text:f.a.bool,className:f.a.string,danger:f.a.bool,disabled:f.a.bool,icon:f.a.element,trailingIcon:f.a.element,ariaHaspopup:f.a.string,ariaExpanded:f.a.bool,ariaControls:f.a.string},b.defaultProps={onClick:null,href:null,text:!1,className:"",danger:!1,disabled:!1,icon:null,trailingIcon:null,ariaHaspopup:"",ariaExpanded:!1,ariaControls:""},t.a=b},31:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.small,a=e.compress,i=e.height,o=i?Math.round(i/2):null;return React.createElement("div",{role:"progressbar",className:"\n\t\t\t\t\tmdc-linear-progress\n\t\t\t\t\tmdc-linear-progress--indeterminate\n\t\t\t\t\t".concat(t||"","\n\t\t\t\t\t").concat(n?"mdc-linear-progress--small":"","\n\t\t\t\t\t").concat(a?"mdc-linear-progress--compress":"","\n\t\t\t\t"),style:{marginTop:o,marginBottom:o}},React.createElement("div",{className:"mdc-linear-progress__buffering-dots"}),React.createElement("div",{className:"mdc-linear-progress__buffer"}),React.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__primary-bar"},React.createElement("span",{className:"mdc-linear-progress__bar-inner"})),React.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__secondary-bar"},React.createElement("span",{className:"mdc-linear-progress__bar-inner"})))}}]),t}(m.Component);f.propTypes={className:h.a.string,small:h.a.bool,compress:h.a.bool},f.defaultProps={className:"",small:!1,compress:!1},t.a=f},34:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.description,a=e.ctaLink,i=e.ctaLabel,o=e.error,r=e.onClick;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-cta\n\t\t\t\t".concat(o?"googlesitekit-cta--error":"","\n\t\t\t")},t&&React.createElement("h3",{className:"googlesitekit-cta__title"},t),n&&React.createElement("p",{className:"googlesitekit-cta__description"},n),i&&React.createElement(f.a,{href:a,onClick:r,inverse:!o,caps:!0,arrow:!0},i))}}]),t}(m.Component);b.propTypes={title:h.a.string.isRequired,description:h.a.string,ctaLink:h.a.string,ctaLabel:h.a.string,error:h.a.bool,onClick:h.a.func},b.defaultProps={title:"",description:"",ctaLink:"",ctaLabel:"",error:!1,onClick:function(){}},t.a=b},35:function(e,t,n){"use strict";n.r(t),n.d(t,"extractSearchConsoleDashboardData",(function(){return r})),n.d(t,"isDataZeroSearchConsole",(function(){return s}));var a=n(2),i=n(12);function o(e){var t=[[{type:"string",label:"Day"},{type:"number",label:"Clicks"},{type:"number",label:"Impressions"},{type:"number",label:"CTR"},{type:"number",label:"Position"}]],n=0,o=0,r=0,s=0,c=e.length;Object(i.each)(e,(function(e){var a=new Date(e.keys[0]);t.push([a.getMonth()+1+"/"+a.getUTCDate(),e.clicks,e.impressions,e.ctr,e.position]),n+=e.clicks,o+=e.impressions,r+=e.ctr,s+=e.position}));var l=n,u=o;n=Object(a.t)(n),o=Object(a.t)(o);var d=(r/c*100).toFixed(1),g=r/c,m=(s/c).toFixed(1);return{dataMap:t,totalClicks:n,totalClicksRaw:l,totalImpressions:o,totalImpressionsRaw:u,averageCTR:d,averageCTRRaw:g,averagePosition:m}}var r=function(e){var t=Math.floor(e.length/2),n=o(e.slice(t)),i=o(e.slice(0,t));return{dataMap:n.dataMap,totalClicks:n.totalClicks,totalImpressions:n.totalImpressions,averageCTR:n.averageCTR,averagePosition:n.averagePosition,totalClicksChange:Object(a.b)(i.totalClicksRaw,n.totalClicksRaw),totalImpressionsChange:Object(a.b)(i.totalImpressionsRaw,n.totalImpressionsRaw),averageCTRChange:Object(a.b)(i.averageCTRRaw,n.averageCTRRaw),averagePositionChange:Object(a.b)(i.averagePosition,n.averagePosition)}},s=function(e){if(!e.length)return!0;var t=r(e),n=t.totalClicks,a=t.totalImpressions,i=t.averageCTR,o=t.averagePosition;return 0===parseInt(n)&&0===parseInt(a)&&0===parseInt(i)&&0===parseInt(o)}},43:function(e,t,n){"use strict";n(1);var a=n(0),i=n(14);t.a=function(){var e=Object(a.__)("Need help?","google-site-kit");return React.createElement(i.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},e)}},44:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(21),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){return null}}]),t}(m.Component),f=Object(p.a)("googlesitekit.ErrorNotification")(h),b=n(71),k=n(11),v=n.n(k),y=n(13),_=n.n(y),w=n(70),O=n(28),R=n(22),j=n(8),E=n.n(j),C=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).menuRef=Object(m.createRef)(),n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new R.f(this.menuRef.current),this.menu.open=e,this.menu.setDefaultFocusState(1)}},{key:"componentDidUpdate",value:function(e){var t=this.props.menuOpen;t!==e.menuOpen&&(this.menu.open=t)}},{key:"render",value:function(){var e=this.props,t=e.menuOpen,n=e.menuItems,a=e.onSelected,i=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:i,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},n.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:a.bind(null,t),onKeyDown:a.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(m.Component);C.propTypes={menuOpen:E.a.bool.isRequired,menuItems:E.a.array.isRequired,id:E.a.string.isRequired};var N=C,D=n(85),x=n(2),S=n(0),A=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},n.handleMenu=n.handleMenu.bind(_()(n)),n.handleMenuClose=n.handleMenuClose.bind(_()(n)),n.handleMenuItemSelect=n.handleMenuItemSelect.bind(_()(n)),n.handleDialog=n.handleDialog.bind(_()(n)),n.handleDialogClose=n.handleDialogClose.bind(_()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(_()(n)),n.menuButtonRef=Object(m.createRef)(),n.menuRef=Object(m.createRef)(),n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.removeEventListener("keyup",this.handleDialogClose)}},{key:"handleMenu",value:function(){var e=this.state.menuOpen;this.setState({menuOpen:!e})}},{key:"handleMenuClose",value:function(e){("keyup"!==e.type||27!==e.keyCode)&&"mouseup"!==e.type||this.menuButtonRef.current.buttonRef.current.contains(e.target)||this.menuRef.current.menuRef.current.contains(e.target)||this.setState({menuOpen:!1})}},{key:"handleMenuItemSelect",value:function(e,t){var n=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(n);break;default:this.handleMenu()}}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive,menuOpen:!1}}))}},{key:"handleDialogClose",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1,menuOpen:!1})}},{key:"handleUnlinkConfirm",value:function(){return v.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(x.c)(),document.location=Object(x.m)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,n=t.email,a=void 0===n?"":n,i=t.picture,o=void 0===i?"":i,r=e.proxyPermissionsURL,s=this.state,c=s.dialogActive,l=s.menuOpen;return React.createElement(m.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(O.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:o?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:o,alt:Object(S.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:l,ariaControls:"user-menu"},a),React.createElement(N,{ref:this.menuRef,menuOpen:l,menuItems:[Object(S.__)("Disconnect","google-site-kit")].concat(r?[Object(S.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(D.a,null,React.createElement(w.a,{dialogActive:c,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(S.__)("Disconnect","google-site-kit"),subtitle:Object(S.__)("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:Object(S.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(m.Component),I=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(m.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(b.a,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-phone mdc-layout-grid__cell--span-1-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e&&React.createElement(A,null))))),React.createElement(f,null))}}]),t}(m.Component);t.a=I},47:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(75),h=n(8),f=n.n(h),b=n(20),k=n(10),v=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.icon,a=e.iconWidth,i=e.iconHeight,o=e.iconID,r=e.className,s=e.status,c=e.statusText,l=e.fullWidth?"\n\t\t\tmdc-layout-grid__cell\n\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t":"\n\t\t\tmdc-layout-grid__cell\n\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\tmdc-layout-grid__cell--span-4-tablet\n\t\t\tmdc-layout-grid__cell--span-6-desktop\n\t\t\t",u=Object(k.applyFilters)("googlesitekit.showDateRangeSelector-".concat(o),!1),d=!(""===s&&!u);return React.createElement("header",{className:"googlesitekit-page-header"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:l},n&&React.createElement(b.a,{id:o,height:i,width:a,className:"googlesitekit-page-header__icon"}),React.createElement("h1",{className:"googlesitekit-page-header__title ".concat(r)},t)),d&&React.createElement("div",{className:"\n\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\tmdc-layout-grid__cell--align-bottom\n\t\t\t\t\t\t\tmdc-layout-grid__cell--align-right-tablet\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-tablet\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-6-desktop\n\t\t\t\t\t\t"},React.createElement("div",{className:"googlesitekit-page-header__details"},s&&React.createElement("span",{className:"\n\t\t\t\t\t\t\t\t\t\tgooglesitekit-page-header__status\n\t\t\t\t\t\t\t\t\t\tgooglesitekit-page-header__status--".concat(s,"\n\t\t\t\t\t\t\t\t\t")},c),u&&React.createElement("span",{className:"googlesitekit-page-header__range"},React.createElement(p.a,null))))))}}]),t}(m.Component);v.propTypes={title:f.a.string,icon:f.a.bool,iconID:f.a.string,iconWidth:f.a.string,iconHeight:f.a.string,className:f.a.string,status:f.a.string,statusText:f.a.string,fullWidth:f.a.bool},v.defaultProps={title:"",icon:!1,iconID:"",iconWidth:"",iconHeight:"",className:"googlesitekit-heading-3",status:"",statusText:"",fullWidth:!1},t.a=v},50:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return u}));var a=n(63),i=n.n(a),o=n(0),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=null,n=null,a=document.querySelector("#toplevel_page_googlesitekit-dashboard .googlesitekit-notifications-counter"),i=document.querySelector("#wp-admin-bar-google-site-kit .googlesitekit-notifications-counter");if(a&&i)return!1;if(t=document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"),n=document.querySelector("#wp-admin-bar-google-site-kit .ab-item"),null===t&&null===n)return!1;var r=document.createElement("span");r.setAttribute("class","googlesitekit-notifications-counter update-plugins count-".concat(e));var s=document.createElement("span");s.setAttribute("class","plugin-count"),s.setAttribute("aria-hidden","true"),s.textContent=e;var c=document.createElement("span");return c.setAttribute("class","screen-reader-text"),c.textContent=Object(o.sprintf)(Object(o._n)("%d notification","%d notifications",e,"google-site-kit"),e),r.appendChild(s),r.appendChild(c),t&&null===a&&t.appendChild(r),n&&null===i&&n.appendChild(r),r},s=function(){window.localStorage&&window.localStorage.clear(),window.sessionStorage&&window.sessionStorage.clear()},c=function(e){for(var t=location.search.substr(1).split("&"),n={},a=0;a<t.length;a++)n[t[a].split("=")[0]]=decodeURIComponent(t[a].split("=")[1]);return e?n.hasOwnProperty(e)?decodeURIComponent(n[e].replace(/\+/g," ")):"":n},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location,n=new URL(t.href);if(e)return n.searchParams&&n.searchParams.get?n.searchParams.get(e):c(e);var a={},o=!0,r=!1,s=void 0;try{for(var l,u=n.searchParams.entries()[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var d=i()(l.value,2),g=d[0],m=d[1];a[g]=m}}catch(e){r=!0,s=e}finally{try{o||null==u.return||u.return()}finally{if(r)throw s}}return a},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if("undefined"!=typeof gtag&&window.googlesitekitTrackingEnabled){var i=window._googlesitekitBase,o=i.referenceSiteURL,r=i.userIDHash,s=i.trackingID,c=i.isFirstAdmin;if(s){var l="/"===o.substring(o.length-1)?o.substring(0,o.length-1):o;return gtag("event",t,{send_to:s,event_category:e,event_label:n,event_value:a,dimension1:l,dimension2:c?"true":"false",dimension3:r})}}}},56:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(26),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){return React.createElement(p.a,this.props)}}]),t}(m.Component);t.a=h},57:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(21),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.a=Object(p.a)("googlesitekit.ModuleSettingsWarning")(h)},61:function(e,t,n){"use strict";var a=n(11),i=n.n(a),o=n(9),r=n(2),s=n(3),c=n.n(s),l=n(4),u=n.n(l),d=n(12),g=function(){function e(t){c()(this,e),this.wins=t,this.response=[]}return u()(e,[{key:"get",value:function(){var e,t=this;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return e=Object(d.filter)(this.wins.map((function(e){return!!e.withData&&(e.withData.callback=function(n){t.response[e.identifier]=n},e.withData)}))),n.next=3,i.a.awrap(o.c.combinedGetFromCache(e));case 3:return n.abrupt("return",this.response);case 4:case"end":return n.stop()}}),null,this)}}]),e}(),m=n(10);n.d(t,"g",(function(){return h})),n.d(t,"f",(function(){return f})),n.d(t,"c",(function(){return b})),n.d(t,"b",(function(){return y})),n.d(t,"d",(function(){return _})),n.d(t,"e",(function(){return w})),n.d(t,"a",(function(){return O}));var p=Object(m.applyFilters)("googlesitekit.winCallbacks",{}),h=function(){return Object(m.applyFilters)("googlesitekit.WinsNotificationsRequest",[])},f=function(){return Object(m.applyFilters)("googlesitekit.ModulesNotificationsRequest",[])};function b(){var e,t,n,a;return i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if((e=window.googlesitekit.setup).isSiteKitConnected&&(e.isAuthenticated||e.isVerified)){o.next=3;break}return o.abrupt("return",0);case 3:return t=0,o.next=6,i.a.awrap(y());case 6:return(n=o.sent)&&n.total&&(t+=n.total),o.next=10,i.a.awrap(_());case 10:return(a=o.sent)&&a.total&&(t+=a.total),t=Object(m.applyFilters)("googlesitekit.TotalNotifications",t),t=Math.max(0,Math.abs(t)),window.localStorage&&window.localStorage.setItem("googlesitekit::total-notifications",t),o.abrupt("return",t);case 16:case"end":return o.stop()}}))}var k=function(e){return e?e.length?e.filter((function(e){return!o.c.getCache("notification::dismissed::".concat(e.id))})):e:[]},v=function(e){var t=function(e){return Object.keys(e).slice(0,1).map((function(t){return e[t]}))};if(1>=Object.keys(e).length)return e;var n=Object.values(e).filter((function(e){var t=o.c.getCache("notification::displayed::".concat(e[0].id));if(t){var n=new Date(t),a=new Date,i=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()));if(n.setHours(0,0,0),i.setHours(0,0,0),n.getTime()===i.getTime())return!0;7<=Object(r.i)(n,i)&&o.c.deleteCache("notification::displayed::".concat(e[0].id))}return null===t})),a=null,i=[];return 0<Object.keys(n).length?(a=t(n),i[Object.keys(n)[0]]=a):(a=t(e),i[Object.keys(e)[0]]=a)};function y(){var e,t,n,a;return i.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return e={},t=0,s.next=4,i.a.awrap(f());case 4:return n=s.sent,a=[],n.map((function(e){var t;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:t=new Promise((function(t){var n,a;return i.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return n=e.identifier,s.t0=k,s.next=4,i.a.awrap(o.c.getNotifications(n,Object(r.o)("day")));case 4:s.t1=s.sent,a=(0,s.t0)(s.t1),t({identifier:n,notifications:a});case 7:case"end":return s.stop()}}))})),a.push(t);case 2:case"end":return n.stop()}}))})),s.next=9,i.a.awrap(Promise.all(a).then((function(n){n.forEach((function(n){n.notifications.length&&(t+=n.notifications.length,e[n.identifier]=n.notifications)}))})));case 9:return s.abrupt("return",{results:e,total:t});case 10:case"end":return s.stop()}}))}function _(){var e,t,n,a,o;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return e={},t=0,r.next=4,i.a.awrap(h());case 4:return n=r.sent,r.next=7,i.a.awrap(new g(n).get());case 7:return a=r.sent,o=[],n.map((function(e){var t;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:t=new Promise((function(t){var n,o,r,s,c;return i.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:n=e.identifier,o=e.callback||Object(d.camelCase)(n),r=null,s=[],e.withData?(c=a[n]||null,r=p[o](c,n)):r=p[o](n),s=k(s=r?[r]:[]),t({identifier:n,notifications:s});case 8:case"end":return i.stop()}}))})),o.push(t);case 2:case"end":return n.stop()}}))})),r.next=12,i.a.awrap(Promise.all(o).then((function(t){t.forEach((function(t){t.notifications.length&&(e[t.identifier]=t.notifications)}))})));case 12:return e=v(e),t=e.length||Object.keys(e).length||0,r.abrupt("return",{results:e,total:t});case 15:case"end":return r.stop()}}))}var w=function(e){var t=Math.abs(e.count)+1;return window.localStorage&&window.localStorage.setItem("googlesitekit::total-notifications",t),{count:t}},O=function(e){var t=Math.max(0,Math.abs(e.count)-1);return window.localStorage&&window.localStorage.setItem("googlesitekit::total-notifications",t),{count:t}}},62:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=n(0),k=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.name,n=e.href,a=e.className,i=e.external;return React.createElement("div",{className:"googlesitekit-source-link ".concat(a)},[Object(b.__)("Source:","google-site-kit")," ",React.createElement(f.a,{key:"link",href:n,external:i,inherit:!0},t)])}}]),t}(m.Component);k.propTypes={name:h.a.string,href:h.a.string,className:h.a.string,external:h.a.bool},k.defaultProps={name:"",href:"",className:"",external:!1},t.a=k},64:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.isSaving;return React.createElement("span",{className:"spinner",style:{display:e?"inline-block":"none",float:"none",marginTop:"0",visibility:"visible"}})}}]),t}(m.Component);t.a=p},65:function(e,t,n){"use strict";var a=n(11),i=n.n(a),o=n(3),r=n.n(o),s=n(4),c=n.n(s),l=n(5),u=n.n(l),d=n(6),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(2),b=n(9),k=n(34),v=n(8),y=n.n(v),_=n(56),w=n(0),O=function(e){function t(){return r()(this,t),u()(this,g()(t).apply(this,arguments))}return p()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,n=e.title,a=e.description,i=e.ctaLabel;return googlesitekit.permissions.canManageOptions?React.createElement(k.a,{title:n,description:a,onClick:t.setupAnalyticsClick,ctaLabel:i}):null}}],[{key:"setupAnalyticsClick",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.a.awrap(Object(f.a)(b.c,"analytics",!0));case 3:return e.next=5,i.a.awrap(Object(f.u)());case 5:window.location=Object(f.l)("analytics",!0),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),Object(f.w)(_.a,{id:"analytics-setup-error",title:Object(w.__)("Internal Server Error","google-site-kit"),description:e.t0.message,format:"small",type:"win-error"});case 11:case"end":return e.stop()}}),null,null,[[0,8]])}}]),t}(h.Component);O.propTypes={title:y.a.string,description:y.a.string,ctaLabel:y.a.string},O.defaultProps={title:Object(w.__)("Learn more about what visitors do on your site.","google-site-kit"),description:Object(w.__)("Connecting with Google Analytics to see unique vistors, goal completions, top pages and more.","google-site-kit"),ctaLabel:Object(w.__)("Set up Analytics","google-site-kit")},t.a=O},68:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r}));var a=n(18),i=n(1),o=i.Suspense?i.Suspense:a.Suspense,r=i.lazy?i.lazy:a.lazy},70:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(28),b=n(14),k=n(22),v=n(155),y=n.n(v),_=n(0),w=function(e){function t(){var e;return i()(this,t),(e=c()(this,u()(t).call(this))).state={attributes:[Object(_.__)("Audience overview","google-site-kit"),Object(_.__)("Top pages","google-site-kit"),Object(_.__)("Top acquisition sources","google-site-kit"),Object(_.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(m.createRef)(),e}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){new k.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,n=e.handleDialog,a=e.title,i=e.provides,o=e.handleConfirm,r=e.subtitle,s=e.confirmButton,c=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(y.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},a&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},a),r&&React.createElement("p",{className:"mdc-dialog__lead"},r),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},i&&i.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),c&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(_.__)("Note: ","google-site-kit")),c),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(f.a,{onClick:o,danger:!0},s||Object(_.__)("Disconnect","google-site-kit")),React.createElement(b.a,{className:"mdc-dialog__cancel-button",onClick:function(){return n()},inherit:!0},Object(_.__)("Cancel","google-site-kit"))))))))}}]),t}(m.Component);w.propTypes={dialogActive:h.a.bool,handleDialog:h.a.func,handleConfirm:h.a.func.isRequired,title:h.a.string,description:h.a.string,confirmButton:h.a.string},w.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=w},71:function(e,t,n){"use strict";n(1);var a=n(20),i=n(0);t.a=function(){return React.createElement("div",{className:"googlesitekit-logo","aria-hidden":"true"},React.createElement(a.a,{id:"logo-g",className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),React.createElement(a.a,{id:"logo-sitekit",className:"\n\t\t\t\t googlesitekit-logo__logo-sitekit\n\t\t\t\t",height:"26",width:"99"}),React.createElement("span",{className:"screen-reader-text"},Object(i.__)("Site Kit by Google Logo","google-site-kit")))}},73:function(e,t,n){"use strict";var a=n(1),i=n(3),o=n.n(i),r=n(4),s=n.n(r),c=n(5),l=n.n(c),u=n(6),d=n.n(u),g=n(7),m=n.n(g),p=n(2),h=n(26),f=n(11),b=n.n(f),k=n(13),v=n.n(k),y=n(12),_=n(9),w=n(56),O=n(57),R=n(0),j=n(14),E=function(e){function t(e){var n;return o()(this,t),(n=l()(this,d()(t).call(this,e))).setupModuleClick=n.setupModuleClick.bind(v()(n)),n}return m()(t,e),s()(t,[{key:"setupModuleClick",value:function(e){return b.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.setState({isSaving:!0}),t.next=4,b.a.awrap(Object(p.a)(_.c,e,!0));case 4:return t.next=6,b.a.awrap(Object(p.u)());case 6:window.location=Object(p.l)(e,!0),t.next=13;break;case 9:t.prev=9,t.t0=t.catch(0),Object(p.w)(w.a,{id:"setup-module-error",title:Object(R.__)("Internal Server Error","google-site-kit"),description:t.t0.message,format:"small",type:"win-error"}),this.setState({isSaving:!1});case 13:case"end":return t.stop()}}),null,this,[[0,9]])}},{key:"render",value:function(){var e=this,t=Object.values(window.googlesitekit.modules||{}).filter((function(e){return!e.internal})),n=t.filter((function(e){return e.active&&e.setupComplete})).reduce((function(e,t){return e[t.slug]=t.name,e}),{}),a=t.filter((function(e){return 0===e.required.length})).sort((function(e,t){return e.sort-t.sort}));return React.createElement("div",{className:"googlesitekit-modules-list"},Object(y.map)(a,(function(t){var a=!1,i="",o=t.slug,r=t.name,s=t.setupComplete,c=t.required;return 0<c.length&&c.forEach((function(e){n[e]&&(a=!0,i=n[e])})),React.createElement("div",{key:o,className:"\n\t\t\t\t\t\t\tgooglesitekit-modules-list__module\n\t\t\t\t\t\t\tgooglesitekit-modules-list__module--".concat(o,"\n\t\t\t\t\t\t\t").concat(a?"googlesitekit-modules-list__module--disabled":"","\n\t\t\t\t\t\t")},React.createElement("div",{className:"googlesitekit-settings-connect-module__wrapper"},React.createElement("div",{className:"googlesitekit-settings-connect-module__logo"},Object(p.q)(o,a)),React.createElement("h3",{className:"googlesitekit-settings-connect-module__title"},r)),React.createElement(O.a,{slug:o,context:"modules-list"}),s&&React.createElement("span",{className:"googlesitekit-settings-module__status"},React.createElement("span",{className:"googlesitekit-settings-module__status-icon googlesitekit-settings-module__status-icon--connected"},React.createElement("span",{className:"screen-reader-text"},Object(R.__)("Connected","google-site-kit"))),Object(R.__)("Connected","google-site-kit")),!s&&!a&&React.createElement(j.a,{arrow:!0,small:!0,inherit:!0,onClick:function(){e.setupModuleClick(o)}}," ",Object(R.__)("Connect Service","google-site-kit")),!s&&a&&React.createElement(j.a,{disabled:!0,small:!0,inherit:!0},Object(R.sprintf)(Object(R.__)("Enable %s to start setup","google-site-kit"),i)))})))}}]),t}(a.Component),C=n(10),N=function(e){function t(){return o()(this,t),l()(this,d()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=Object(p.k)("notification");if(!e||""===e)return null;var t={id:"connected-successfully",setupTitle:Object(R.__)("Site Kit","google-site-kit"),description:Object(R.__)("Now you’ll be able to see how your site is doing in search. To get even more detailed stats, activate more modules. Here are our recommendations for what to include in your Site Kit:","google-site-kit"),learnMore:{label:"",url:"",description:""}},n=googlesitekit.permissions.canManageOptions;switch(e){case"authentication_success":if(!n)return null;var i=Object(p.k)("slug");return i&&googlesitekit.modules[i]&&!googlesitekit.modules[i].active?null:(i&&googlesitekit.modules[i]&&(t.id="".concat(t.id,"-").concat(i),t.setupTitle=googlesitekit.modules[i].name,t.description=Object(R.__)("Here are some other services you can connect to see even more stats:","google-site-kit"),t=Object(C.applyFilters)("googlesitekit.SetupWinNotification-".concat(i),t)),React.createElement(a.Fragment,null,React.createElement(h.a,{id:t.id,title:Object(R.sprintf)(Object(R.__)("Congrats on completing the setup for %s!","google-site-kit"),t.setupTitle),description:t.description,handleDismiss:function(){},winImage:googlesitekit.admin.assetsRoot+"images/rocket.png",dismiss:Object(R.__)("OK, Got it!","google-site-kit"),format:"large",type:"win-success",learnMoreLabel:t.learnMore.label,learnMoreDescription:t.learnMore.description,learnMoreURL:t.learnMore.url},React.createElement(E,null))));case"authentication_failure":return React.createElement(a.Fragment,null,React.createElement(h.a,{id:"connection error",title:Object(R.__)("There was a problem connecting to Google!","google-site-kit"),description:"",handleDismiss:function(){},format:"small",type:"win-error"}))}}}]),t}(a.Component),D=n(61),x=function(e){function t(e){var n;return o()(this,t),(n=l()(this,d()(t).call(this,e))).state={data:!1},n}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){var e=this,t=Object(D.f)();t&&Object(D.b)(t).then((function(t){e.setState({data:t.results})}))}},{key:"render",value:function(){var e=this.state.data;if(0===Object.keys(e).length)return null;var t=[];return Object.keys(e).forEach((function(n){Object(y.each)(e[n],(function(e){t.push(React.createElement(h.a,{key:e.id,id:e.id,title:e.title||"",description:e.description||"",blockData:e.blockData||[],winImage:e.winImage?"".concat(googlesitekit.admin.assetsRoot,"images/").concat(e.winImage):"",format:e.format||"small",learnMoreURL:e.learnMoreURL||"",learnMoreDescription:e.learnMoreDescription||"",learnMoreLabel:e.learnMoreLabel||"",ctaLink:e.ctaURL||"",ctaLabel:e.ctaLabel||"",ctaTarget:e.ctaTarget||"",type:e.severity||"",dismiss:e.dismiss||Object(R.__)("OK, Got it!","google-site-kit"),isDismissable:e.isDismissable||!0,logo:e.logo||!0,module:n,moduleName:googlesitekit.modules[n].name,pageIndex:e.pageIndex||"",dismissExpires:e.dismissExpires||0,showOnce:e.showOnce||!1}))}))})),React.createElement(a.Fragment,null,t)}}]),t}(a.Component),S=function(e){function t(e){var n;return o()(this,t),(n=l()(this,d()(t).call(this,e))).state={data:!1},n}return m()(t,e),s()(t,[{key:"componentWillMount",value:function(){var e=this;Object(C.addAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications",(function(){Object(C.removeAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications");var t=Object(D.g)();t&&Object(D.d)(t).then((function(t){e.setState({data:t.results})}))}))}},{key:"render",value:function(){var e=this.state.data;if(0===Object.keys(e).length)return null;var t=[];return Object.keys(e).forEach((function(n){Object(y.each)(e[n],(function(e){t.push(React.createElement(h.a,{key:e.id,id:e.id,title:e.title||"",description:e.description||"",blockData:e.blockData||[],winImage:e.winImage||"",format:e.format||"small",learnMoreURL:e.learnMoreURL||"",learnMoreDescription:e.learnMoreDescription||"",learnMoreLabel:e.learnMoreLabel||"",ctaLink:e.ctaLink||"",ctaLabel:e.ctaLabel||"",type:e.severity||"",dismiss:e.dismiss||Object(R.__)("OK, Got it!","google-site-kit"),isDismissable:e.isDismissable||!0,logo:e.logo||!1,pageIndex:e.pageIndex||"",dismissExpires:e.dismissExpires||0,showOnce:e.showOnce||!1}))}))})),React.createElement(a.Fragment,null,t)}}]),t}(a.Component),A=n(88),I=n(25),L=window.googlesitekit.setup,P=Object(p.k)("notification"),M=Object(I.a)(React.createElement(N,null)),T=Object(I.a)(React.createElement(x,null)),U=Object(I.a)(React.createElement(S,null)),F=Object(I.a)(React.createElement(A.a,null));L.needReauthenticate&&Object(C.addFilter)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",F,1),"authentication_success"===P||"authentication_failure"===P?Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.SetupNotification",M,1):L.isAuthenticated&&L.isVerified&&(Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.ModulesNotification",T,1),Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.WinsNotification",U,1))},74:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(61),b=n(0),k=n(10),v=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={count:0},n.handleIncrement=n.handleIncrement.bind(g()(n)),n.handleDecrement=n.handleDecrement.bind(g()(n)),n}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this;Object(k.addAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications",(function(){Object(k.removeAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications"),Object(f.c)().then((function(t){e.setState({count:t})}))})),document.addEventListener("notificationDismissed",this.handleDecrement,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("notificationDismissed",this.handleDecrement)}},{key:"handleIncrement",value:function(){this.setState(f.e)}},{key:"handleDecrement",value:function(){this.setState(f.a)}},{key:"render",value:function(){var e=Object(b.sprintf)(Object(b._n)("%d notification","%d notifications",this.state.count,"google-site-kit"),this.state.count),t=React.createElement("span",{className:"googlesitekit-notifications-counter update-plugins count-".concat(this.state.count)},React.createElement("span",{className:"plugin-count","aria-hidden":"true"},this.state.count),React.createElement("span",{className:"screen-reader-text"},e));return Object(h.createPortal)(t,document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"))}}]),t}(h.Component);t.a=v},75:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(22),b=n(0),k=n(10),v=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={context:"Dashboard"},n.dateRangeHook="googlesitekit.dateRange",n.dateRangeHandlerHook="googlesitekit.dateRageHandler",n.dateRangeHookAddedHook="googlesitekit.dateRageHookAddedHandler",Object(k.addAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingDataForDateRangeSelector",(function(e){n.setState({context:e}),Object(k.removeAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingDataForDateRangeSelector")})),n.handleSelection=n.handleSelection.bind(g()(n)),n}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this;Object(k.addAction)("hookAdded",this.dateRangeHookAddedHook,(function(t){e.dateRangeHook===t&&e.forceUpdate()}))}},{key:"componentWillUnmount",value:function(){Object(k.removeAction)("hookAdded",this.dateRangeHookAddedHook)}},{key:"handleSelection",value:function(e,t){var n=this.state.context,a=t.getAttribute("data-value");return Object(k.removeFilter)(this.dateRangeHook,this.dateRangeHandlerHook),Object(k.addFilter)(this.dateRangeHook,this.dateRangeHandlerHook,(function(){return a})),Object(k.doAction)("googlesitekit.moduleDataReset"),Object(k.doAction)("googlesitekit.moduleLoaded",n),!1}},{key:"render",value:function(){var e=[Object(b.__)("Last 7 days","google-site-kit"),Object(b.__)("Last 14 days","google-site-kit"),Object(b.__)("Last 28 days","google-site-kit"),Object(b.__)("Last 90 days","google-site-kit")];return React.createElement(f.k,{enhanced:!0,className:"mdc-select--minimal",name:"time_period",label:"",onEnhancedChange:this.handleSelection,options:e,value:Object(k.applyFilters)(this.dateRangeHook,Object(b.__)("Last 28 days","google-site-kit"))})}}]),t}(h.Component);t.a=v},85:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).el=document.createElement("div"),n.root=document.querySelector(".googlesitekit-plugin")||document.body,n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(m.createPortal)(this.props.children,this.el)}}]),t}(m.Component)},87:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(22),b=n(8),k=n.n(b),v=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).formFieldRef=Object(h.createRef)(),n.checkboxRef=Object(h.createRef)(),n}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){new f.e(this.formFieldRef.current).input=new f.c(this.checkboxRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onChange,n=e.id,a=e.name,i=e.value,o=e.checked,r=e.disabled,s=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-checkbox\n\t\t\t\t\t\t".concat(r?"mdc-checkbox--disabled":"","\n\t\t\t\t\t"),ref:this.checkboxRef},React.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:n,name:a,value:i,checked:o,disabled:r,onChange:t}),React.createElement("div",{className:"mdc-checkbox__background"},React.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},React.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),React.createElement("div",{className:"mdc-checkbox__mixedmark"}))),React.createElement("label",{htmlFor:n},s))}}]),t}(h.Component);v.propTypes={onChange:k.a.func.isRequired,id:k.a.string.isRequired,name:k.a.string.isRequired,value:k.a.string.isRequired,checked:k.a.bool,disabled:k.a.bool,children:k.a.node.isRequired},v.defaultProps={checked:!1,disabled:!1};var y=v,_=n(33),w=n.n(_),O=n(0),R=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={scriptOnPage:!!window.googlesitekitTrackingEnabled,optIn:!!window.googlesitekitTrackingEnabled,error:!1},n.handleOptIn=n.handleOptIn.bind(g()(n)),n}return p()(t,e),r()(t,[{key:"handleOptIn",value:function(e){var t=this,n=e.target.checked,a={googlesitekit_tracking_optin:n};w()({path:"/wp/v2/settings",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(a),method:"POST"}).then((function(){if(window.googlesitekitTrackingEnabled=!!n,n&&!t.state.scriptOnPage){var e=window.document;if(!e)return;e.body.insertAdjacentHTML("beforeend",'\n\t\t\t\t\t\t<script async src="https://www.googletagmanager.com/gtag/js?id='.concat(googlesitekit.admin.trackingID,'"><\/script>\n\t\t\t\t\t')),e.body.insertAdjacentHTML("beforeend","\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\t\t\tgtag('config', '".concat(googlesitekit.admin.trackingID,"');\n\t\t\t\t\t\t<\/script>\n\t\t\t\t\t"))}t.setState({optIn:!!n,error:!1,scriptOnPage:!0})})).catch((function(n){t.setState({optIn:!e.target.checked,error:{errorCode:n.code,errorMsg:n.message}})}))}},{key:"render",value:function(){var e=this.state,t=e.optIn,n=e.error,a=this.props,i=a.id,o=a.name;return React.createElement("div",{className:"googlesitekit-opt-in"},React.createElement(y,{id:i,name:o,value:"1",checked:t,onChange:this.handleOptIn},Object(O.__)("Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with ","google-site-kit"),React.createElement("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer"},Object(O.__)("Google Privacy Policy","google-site-kit")),"."),n&&React.createElement("div",{className:"googlesitekit-error-text"},n.errorMsg))}}]),t}(h.Component);R.propTypes={id:k.a.string,name:k.a.string},R.defaultProps={id:"googlesitekit-opt-in",name:"optIn"};t.a=R},88:function(e,t,n){"use strict";n(1);var a=n(26),i=n(0);t.a=function(){var e=googlesitekit.admin.connectURL;return React.createElement(a.a,{id:"authentication error",title:Object(i.__)("Issue accessing data","google-site-kit"),description:Object(i.__)("You need to reauthenticate your Google account.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0,ctaLink:e,ctaLabel:Object(i.__)("Click here","google-site-kit")})}},9:function(e,t,n){"use strict";var a=n(11),i=n.n(a),o=n(23),r=n.n(o),s=n(51),c=n.n(s),l=n(88),u=(n(1),n(26)),d=n(0),g=function(){return React.createElement(u.a,{id:"permission error",title:Object(d.__)("Permissions issue accessing data","google-site-kit"),description:Object(d.__)("This account does not have access to the requested data.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0})},m=n(94),p=n.n(m),h=n(2),f=n(12),b=n(33),k=n.n(b),v=n(32),y=n(10);function _(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(n,!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.d(t,"a",(function(){return O})),n.d(t,"b",(function(){return R}));var O="core",R="modules",j=function(){googlesitekit.admin=googlesitekit.admin||{},"string"==typeof googlesitekit.admin.datacache&&(googlesitekit.admin.datacache=JSON.parse(googlesitekit.admin.datacache)),"object"!==c()(googlesitekit.admin.datacache)&&(googlesitekit.admin.datacache={})},E=function(e,t){var n=w({data:{}},e);return n.data=w({dateRange:t},n.data),n},C={maxRequests:10,init:function(){googlesitekit.initialized||(googlesitekit.initialized=!0,this.collectModuleData=this.collectModuleData.bind(this),googlesitekit.cache=[],Object(y.addAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingData",this.collectModuleData))},combinedGetFromCache:function(e){var t=this;return new Promise((function(n,a){try{var i=[],o=Object(h.g)();Object(f.each)(e,(function(e){var n=E(e,o);n.key=t.getCacheKey(n.type,n.identifier,n.datapoint,n.data);var a=t.getCache(n.key,n.maxAge);void 0!==a&&(i[n.key]=a,t.resolve(n,a))})),n(i)}catch(e){a()}}))},combinedGet:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=[],i=25,o=Object(h.g)();Object(f.each)(e,(function(e){var n=E(e,o);n.key=t.getCacheKey(n.type,n.identifier,n.datapoint,n.data);var r=t.getCache(n.key,n.maxAge);void 0!==r?(setTimeout((function(){t.resolve(n,r)}),i),i+=25):a.push(n)})),a=Object(f.sortBy)(a,"priority");var r=[],s=[],c={},l=!!a.find((function(e){return e.priority<10}));Object(f.each)(a,(function(e,t){!n&&10<=e.priority&&l?s.push(e):c[e.key]?c[e.key].push(t):(c[e.key]=[t],r.push(e))}));var u=10,d=r.slice(0,u),g=r.slice(u);if(g=g.concat(s),0!==d.length||0!==g.length){0<g.length&&0<this.maxRequests--?setTimeout((function(){t.combinedGet(g,!0)}),50):this.maxRequests=10;var m=null!==Object(h.k)("datacache");return k()({path:Object(v.addQueryArgs)("/google-site-kit/v1/data/",{datacache:m||void 0}),data:{request:d},method:"POST"}).then((function(e){Object(f.each)(e,(function(e,n){c[n]?(t.handleWPError(e),Object(f.each)(c[n],(function(n){var i=a[n];t.setCache(i.key,e),t.resolve(i,e)})),0===g.length&&Object(y.doAction)("googlesitekit.dataLoaded","api")):console.error("data_error","unknown response key "+n)}))})).catch((function(e){console.warn("Error caught during combinedGet",e)}))}Object(y.doAction)("googlesitekit.dataLoaded","cache")},handleWPError:function(e){var t=["code","data","message"],n=Object(f.intersection)(t,Object.keys(e));if(Object(f.isEqual)(t,n)){console.warn("WP Error in data response",e);var a=e.data;if(a.reason){var i=0;["authError","insufficientPermissions"].includes(a.reason)&&(Object(y.addFilter)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",Object(h.f)(l.a),1),i++),"forbidden"===a.reason&&(Object(y.addFilter)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",Object(h.f)(g),1),i++),i&&Object(y.addFilter)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease",(function(e){return Object(y.removeFilter)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease"),e+i}))}}},resolve:function(e,t){e&&"function"==typeof e.callback&&e.callback(t,e.datapoint)},setCache:function(e,t){if(void 0!==t&&(!t||"object"!==c()(t)||!t.error&&!t.errors)){j(),googlesitekit.admin.datacache[e]=Object(f.cloneDeep)(t);var n={value:t,date:Date.now()/1e3};Object(h.n)().setItem("googlesitekit_"+e,JSON.stringify(n))}},getCache:function(e,t){if(!googlesitekit.admin.nojscache){if(j(),void 0!==googlesitekit.admin.datacache[e])return googlesitekit.admin.datacache[e];var n=JSON.parse(Object(h.n)().getItem("googlesitekit_"+e));return n&&"object"===c()(n)&&n.date&&(!t||Date.now()/1e3-n.date<t)?(googlesitekit.admin.datacache[e]=Object(f.cloneDeep)(n.value),Object(f.cloneDeep)(googlesitekit.admin.datacache[e])):void 0}},deleteCache:function(e){j(),delete googlesitekit.admin.datacache[e],Object(h.n)().removeItem("googlesitekit_"+e)},invalidateCacheGroup:function(e,t,n){var a=this.getCacheKey(e,t,n);j(),Object.keys(googlesitekit.admin.datacache).forEach((function(e){0!==e.indexOf(a+"::")&&e!==a||delete googlesitekit.admin.datacache[e]})),Object.keys(Object(h.n)()).forEach((function(e){0!==e.indexOf("googlesitekit_"+a+"::")&&e!=="googlesitekit_"+a||Object(h.n)().removeItem(e)}))},collectModuleData:function(e,t){var n=Object(y.applyFilters)("googlesitekit.module"+e+"DataRequest",[],t);0!==n.length&&this.combinedGet(n)},get:function(e,t,n){var a=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=this.getCacheKey(e,t,n,i);if(!o){var s=this.getCache(r,3600);if(void 0!==s)return new Promise((function(e){e(s)}))}return k()({path:Object(v.addQueryArgs)("/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),i)}).then((function(e){return o||a.setCache(r,e),Promise.resolve(e)})).catch((function(e){return a.handleWPError(e),Promise.reject(e)}))},getNotifications:function(e){var t,n,a,o=arguments;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(t=o.length>1&&void 0!==o[1]?o[1]:0,n=[],e){r.next=4;break}return r.abrupt("return",n);case 4:if(a=this.getCacheKey("modules",e,"notifications"),(n=C.getCache(a,t))&&0!==n.length){r.next=11;break}return r.next=9,i.a.awrap(k()({path:"/google-site-kit/v1/modules/".concat(e,"/notifications/")}));case 9:n=r.sent,C.setCache(a,n);case 11:return r.abrupt("return",n);case 12:case"end":return r.stop()}}),null,this)},set:function(e,t,n,a){var i={};return i.data=a,k()({path:"/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),data:i,method:"POST"}).then((function(a){return C.invalidateCacheGroup(e,t,n),new Promise((function(e){e(a)}))}))},getCacheKey:function(e,t,n){for(var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=[],o=[e,t,n],r=0,s=o;r<s.length;r++){var l=s[r];if(!l||!l.length)break;i.push(l)}return 3===i.length&&a&&"object"===c()(a)&&Object.keys(a).length&&i.push(p()(JSON.stringify(Object(h.x)(a)))),i.join("::")},setModuleActive:function(e,t){return k()({path:"/google-site-kit/v1/modules/".concat(e),data:{active:t},method:"POST"}).then((function(e){return new Promise((function(t){t(e)}))})).catch((function(e){return Promise.reject(e)}))}};C.init();t.c=C},93:function(e,t,n){"use strict";n(1);t.a=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#EA4336",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"error-title error-desc"},React.createElement("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3zM12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1zm1 4h-2v-2h2v2z"}))}}}]);
dist/assets/js/googlesitekit-activation.js ADDED
@@ -0,0 +1 @@
1
+ !function(e){function t(t){for(var n,a,c=t[0],u=t[1],s=t[2],_=0,p=[];_<c.length;_++)a=c[_],o[a]&&p.push(o[a][0]),o[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(l&&l(t);p.length;)p.shift()();return i.push.apply(i,s||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,a=1;a<r.length;a++){var c=r[a];0!==o[c]&&(n=!1)}n&&(i.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var n={},o={8:0},i=[];function __webpack_require__(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="";var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var l=c;i.push([213,0,1]),r()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},12:function(e,t){e.exports=lodash},18:function(e,t){e.exports=React},213:function(e,t,r){"use strict";r.r(t);var n=r(1),o=r(36),i=r.n(o),a=r(10),c=r(2),u=(r(73),r(3)),l=r.n(u),s=r(4),_=r.n(s),p=r(5),g=r.n(p),d=r(6),f=r.n(d),b=r(7),k=r.n(b),m=r(0),v=r(8),w=r.n(v),h=r(28),y=r(71),R=r(87);function q(e){var t=e.buttonURL,r=e.onButtonClick,n=e.buttonLabel;return React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(y.a,null),React.createElement("h3",{className:"googlesitekit-heading-3 googlesitekit-activation__title"},Object(m.__)("Congratulations, the Site Kit plugin is now activated.","google-site-kit")),React.createElement("div",{className:"googlesitekit-opt-in googlesitekit-activation__opt-in"},React.createElement(R.a,null)),React.createElement(h.a,{id:"start-setup-link",className:"googlesitekit-start-setup googlesitekit-activation__button",href:t,onClick:r},n))))}q.propTypes={buttonURL:w.a.string.isRequired,onButtonClick:w.a.func,buttonLabel:w.a.string.isRequired};var O=r(26),j=r(74),x=function(e){function t(e){var r;return l()(this,t),(r=g()(this,f()(t).call(this,e))).state={hasError:!1},r}return k()(t,e),_()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){var e=this.state,t=e.hasError,r=e.error,o=e.info;if(t)return React.createElement(O.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:r.message,description:o.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"});var i=window._googlesitekitBase,a=i.proxySetupURL,u=i.splashURL,l=googlesitekit.permissions.canViewDashboard,s=googlesitekit.dashboardPermalink,_=a||u,p=Object(m.__)("Start setup","google-site-kit");return l&&(_=s,p=Object(m.__)("Go to Dashboard","google-site-kit")),React.createElement(n.Fragment,null,React.createElement(j.a,null),React.createElement(q,{buttonURL:_,buttonLabel:p,onButtonClick:function(){Object(c.v)("plugin_setup",a?"proxy_start_setup_banner":"goto_sitekit")}}))}}]),t}(n.Component);i()((function(){var e=document.getElementById("js-googlesitekit-activation");e&&(Object(c.p)(),Object(c.v)("plugin_setup","plugin_activated"),Object(n.render)(React.createElement(x,null),e),e.classList.remove("googlesitekit-activation--loading"),Object(a.doAction)("googlesitekit.moduleLoaded","Activation"))}))},32:function(e,t){e.exports=wp.url},33:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.domReady},49:function(e,t){e.exports=ReactDOM},54:function(e,t){e.exports=wp.compose}});
dist/assets/js/googlesitekit-admin.js CHANGED
@@ -1 +1 @@
1
- !function(e){function r(r){for(var o,i,u=r[0],a=r[1],c=r[2],l=0,s=[];l<u.length;l++)i=u[l],n[i]&&s.push(n[i][0]),n[i]=0;for(o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o]);for(p&&p(r);s.length;)s.shift()();return _.push.apply(_,c||[]),t()}function t(){for(var e,r=0;r<_.length;r++){for(var t=_[r],o=!0,i=1;i<t.length;i++){var u=t[i];0!==n[u]&&(o=!1)}o&&(_.splice(r--,1),e=__webpack_require__(__webpack_require__.s=t[0]))}return e}var o={},n={8:0},_=[];function __webpack_require__(r){if(o[r])return o[r].exports;var t=o[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,__webpack_require__),t.l=!0,t.exports}__webpack_require__.m=e,__webpack_require__.c=o,__webpack_require__.d=function(e,r,t){__webpack_require__.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,r){if(1&r&&(e=__webpack_require__(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(__webpack_require__.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)__webpack_require__.d(t,o,function(r){return e[r]}.bind(null,o));return t},__webpack_require__.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(r,"a",r),r},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.p="";var i=window.webpackJsonp=window.webpackJsonp||[],u=i.push.bind(i);i.push=r,i=i.slice();for(var a=0;a<i.length;a++)r(i[a]);var p=u;_.push([185,0,1]),t()}({0:function(e,r){e.exports=wp.i18n},1:function(e,r){e.exports=wp.element},10:function(e,r){e.exports=wp.hooks},11:function(e,r){e.exports=lodash},18:function(e,r){e.exports=React},185:function(e,r,t){"use strict";t.r(r);var o=t(2);if("toplevel_page_googlesitekit-dashboard"!==window.pagenow&&"site-kit_page_googlesitekit-splash"!==window.pagenow&&"admin_page_googlesitekit-splash"!==window.pagenow&&window.localStorage){var n=window.localStorage.getItem("googlesitekit::total-notifications")||0;Object(o.b)(n)}var _=document.querySelector("#wp-admin-bar-logout a");_||(_=document.querySelector(".sidebar__me-signout button")),_&&_.addEventListener("click",(function(){Object(o.d)()}))},35:function(e,r){e.exports=wp.apiFetch},36:function(e,r){e.exports=wp.url},50:function(e,r){e.exports=ReactDOM}});
1
+ !function(e){function r(r){for(var _,i,a=r[0],u=r[1],p=r[2],l=0,b=[];l<a.length;l++)i=a[l],n[i]&&b.push(n[i][0]),n[i]=0;for(_ in u)Object.prototype.hasOwnProperty.call(u,_)&&(e[_]=u[_]);for(c&&c(r);b.length;)b.shift()();return o.push.apply(o,p||[]),t()}function t(){for(var e,r=0;r<o.length;r++){for(var t=o[r],_=!0,i=1;i<t.length;i++){var a=t[i];0!==n[a]&&(_=!1)}_&&(o.splice(r--,1),e=__webpack_require__(__webpack_require__.s=t[0]))}return e}var _={},n={9:0},o=[];function __webpack_require__(r){if(_[r])return _[r].exports;var t=_[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,__webpack_require__),t.l=!0,t.exports}__webpack_require__.m=e,__webpack_require__.c=_,__webpack_require__.d=function(e,r,t){__webpack_require__.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,r){if(1&r&&(e=__webpack_require__(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(__webpack_require__.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var _ in e)__webpack_require__.d(t,_,function(r){return e[r]}.bind(null,_));return t},__webpack_require__.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(r,"a",r),r},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.p="";var i=window.webpackJsonp=window.webpackJsonp||[],a=i.push.bind(i);i.push=r,i=i.slice();for(var u=0;u<i.length;u++)r(i[u]);var c=a;o.push([195,0,1]),t()}({0:function(e,r){e.exports=wp.i18n},195:function(e,r,t){"use strict";t.r(r);var _=t(50);if("toplevel_page_googlesitekit-dashboard"!==window.pagenow&&"site-kit_page_googlesitekit-splash"!==window.pagenow&&"admin_page_googlesitekit-splash"!==window.pagenow&&window.localStorage){var n=window.localStorage.getItem("googlesitekit::total-notifications")||0;Object(_.a)(n)}var o=document.querySelector("#wp-admin-bar-logout a");o||(o=document.querySelector(".sidebar__me-signout button")),o&&o.addEventListener("click",(function(){Object(_.b)()}))}});
dist/assets/js/googlesitekit-adminbar-loader.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(t){for(var n,a,c=t[0],u=t[1],s=t[2],p=0,l=[];p<c.length;p++)a=c[p],o[a]&&l.push(o[a][0]),o[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(_&&_(t);l.length;)l.shift()();return i.push.apply(i,s||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,a=1;a<r.length;a++){var c=r[a];0!==o[c]&&(n=!1)}n&&(i.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var n={},o={9:0},i=[];function __webpack_require__(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,__webpack_require__.nc&&a.setAttribute("nonce",__webpack_require__.nc),a.src=function(e){return __webpack_require__.p+""+({4:"chunk-googlesitekit-adminbar"}[e]||e)+".js"}(e),i=function(t){a.onerror=a.onload=null,clearTimeout(c);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src,u=new Error("Loading chunk "+e+" failed.\n("+n+": "+i+")");u.type=n,u.request=i,r[1](u)}o[e]=void 0}};var c=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}return Promise.all(t)},__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var _=c;i.push([184,0,1]),r()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},11:function(e,t){e.exports=lodash},18:function(e,t){e.exports=React},184:function(e,t,r){"use strict";r.r(t);var n=r(2);window.googlesitekitAdminbar&&window.googlesitekitAdminbar.publicPath&&(r.p=window.googlesitekitAdminbar.publicPath);var o=!1;function i(){r.e(4).then(r.bind(null,208)).then((function(e){return e})).catch((function(){return new Error("Site Kit: An error occurred while loading the Adminbar component files.")})).then((function(e){try{e.init()}catch(e){console.error("Site Kit: An error occurred while loading the Adminbar components."),document.getElementById("js-googlesitekit-adminbar").classList.add("googlesitekit-adminbar--has-error")}document.getElementById("js-googlesitekit-adminbar").classList.remove("googlesitekit-adminbar--loading")}))}window.addEventListener("load",(function(){var e=document.getElementById("wp-admin-bar-google-site-kit"),t=!1;if(e&&window.localStorage){var r=window.localStorage.getItem("googlesitekit::total-notifications")||0;Object(n.b)(r);var a=function(){if(!o){if(window.googlesitekitTrackingEnabled)if("undefined"!=typeof gtag||t)Object(n.v)("admin_bar","page_stats_view");else{t=!0;var e=document.createElement("script");e.type="text/javascript",e.setAttribute("async","true"),e.onload=function(){window.gtag=function(){window.dataLayer.push(arguments)},Object(n.v)("admin_bar","page_stats_view")},e.setAttribute("src","https://www.googletagmanager.com/gtag/js?id=".concat(googlesitekit.admin.trackingID)),document.head.appendChild(e)}i(),o=!0}};"true"===Object(n.l)("googlesitekit_adminbar_open")?(a(),e.classList.add("hover")):e.addEventListener("mouseenter",a,!1)}}))},35:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.url},50:function(e,t){e.exports=ReactDOM},59:function(e,t){e.exports=wp.compose}});
1
+ !function(e){function t(t){for(var n,a,c=t[0],u=t[1],s=t[2],p=0,l=[];p<c.length;p++)a=c[p],o[a]&&l.push(o[a][0]),o[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(_&&_(t);l.length;)l.shift()();return i.push.apply(i,s||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,a=1;a<r.length;a++){var c=r[a];0!==o[c]&&(n=!1)}n&&(i.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var n={},o={10:0},i=[];function __webpack_require__(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,__webpack_require__.nc&&a.setAttribute("nonce",__webpack_require__.nc),a.src=function(e){return __webpack_require__.p+""+({4:"chunk-googlesitekit-adminbar"}[e]||e)+".js"}(e),i=function(t){a.onerror=a.onload=null,clearTimeout(c);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src,u=new Error("Loading chunk "+e+" failed.\n("+n+": "+i+")");u.type=n,u.request=i,r[1](u)}o[e]=void 0}};var c=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}return Promise.all(t)},__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var _=c;i.push([194,0,1]),r()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},12:function(e,t){e.exports=lodash},18:function(e,t){e.exports=React},194:function(e,t,r){"use strict";r.r(t);var n=r(50);window.googlesitekitAdminbar&&window.googlesitekitAdminbar.publicPath&&(r.p=window.googlesitekitAdminbar.publicPath);var o=!1;function i(){Promise.all([r.e(0),r.e(4)]).then(r.bind(null,216)).then((function(e){return e})).catch((function(){return new Error("Site Kit: An error occurred while loading the Adminbar component files.")})).then((function(e){try{e.init()}catch(e){console.error("Site Kit: An error occurred while loading the Adminbar components."),document.getElementById("js-googlesitekit-adminbar").classList.add("googlesitekit-adminbar--has-error")}document.getElementById("js-googlesitekit-adminbar").classList.remove("googlesitekit-adminbar--loading")}))}window.addEventListener("load",(function(){var e=document.getElementById("wp-admin-bar-google-site-kit"),t=!1;if(e&&window.localStorage){var r=window.localStorage.getItem("googlesitekit::total-notifications")||0;Object(n.a)(r);var a=function(){if(!o){var e=window._googlesitekitBase.trackingID;if(e){if(window.googlesitekitTrackingEnabled)if("undefined"!=typeof gtag||t)Object(n.d)("admin_bar","page_stats_view");else{t=!0;var r=document.createElement("script");r.type="text/javascript",r.setAttribute("async","true"),r.onload=function(){window.gtag=function(){window.dataLayer.push(arguments)},Object(n.d)("admin_bar","page_stats_view")},r.setAttribute("src","https://www.googletagmanager.com/gtag/js?id=".concat(e)),document.head.appendChild(r)}i(),o=!0}}};"true"===Object(n.c)("googlesitekit_adminbar_open")?(a(),e.classList.add("hover")):e.addEventListener("mouseenter",a,!1)}}))},32:function(e,t){e.exports=wp.url},33:function(e,t){e.exports=wp.apiFetch},49:function(e,t){e.exports=ReactDOM},54:function(e,t){e.exports=wp.compose}});
dist/assets/js/googlesitekit-api.js ADDED
@@ -0,0 +1 @@
1
+ !function(e){function r(r){for(var n,c,o=r[0],i=r[1],p=r[2],f=0,l=[];f<o.length;f++)c=o[f],a[c]&&l.push(a[c][0]),a[c]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(s&&s(r);l.length;)l.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,c=1;c<t.length;c++){var o=t[c];0!==a[o]&&(n=!1)}n&&(u.splice(r--,1),e=__webpack_require__(__webpack_require__.s=t[0]))}return e}var n={},a={11:0},u=[];function __webpack_require__(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,__webpack_require__),t.l=!0,t.exports}__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,r,t){__webpack_require__.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,r){if(1&r&&(e=__webpack_require__(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(__webpack_require__.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)__webpack_require__.d(t,n,function(r){return e[r]}.bind(null,n));return t},__webpack_require__.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(r,"a",r),r},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.p="";var c=window.webpackJsonp=window.webpackJsonp||[],o=c.push.bind(c);c.push=r,c=c.slice();for(var i=0;i<c.length;i++)r(c[i]);var s=o;u.push([212,0,1]),t()}({0:function(e,r){e.exports=wp.i18n},1:function(e,r){e.exports=wp.element},10:function(e,r){e.exports=wp.hooks},12:function(e,r){e.exports=lodash},18:function(e,r){e.exports=React},212:function(e,r,t){"use strict";t.r(r);var n={};t.r(n),t.d(n,"get",(function(){return m})),t.d(n,"set",(function(){return O})),t.d(n,"setUsingCache",(function(){return q})),t.d(n,"usingCache",(function(){return j})),t.d(n,"invalidateCache",(function(){return S}));var a=t(11),u=t.n(a),c=t(12),o=t(53),i=function(e){var r,t,n,a,c=arguments;return u.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return r=c.length>1&&void 0!==c[1]?c[1]:null,i.next=3,u.a.awrap(Object(o.b)());case 3:if(!(t=i.sent)){i.next=10;break}if(!(n=t.getItem("".concat(o.a).concat(e)))){i.next=10;break}if(!(a=JSON.parse(n)).timestamp||!(null===r||Math.round(Date.now()/1e3)-a.timestamp<r)){i.next=10;break}return i.abrupt("return",{cacheHit:!0,value:a.value});case 10:return i.abrupt("return",{cacheHit:!1,value:void 0});case 11:case"end":return i.stop()}}))},s=function(e,r){var t,n,a=arguments;return u.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return t=a.length>2&&void 0!==a[2]?a[2]:void 0,i.next=3,u.a.awrap(Object(o.b)());case 3:if(!(n=i.sent)){i.next=16;break}if(i.prev=5,Object(c.isEqual)(r,JSON.parse(JSON.stringify({value:r})).value)){i.next=8;break}return i.abrupt("return",!1);case 8:return n.setItem("".concat(o.a).concat(e),JSON.stringify({timestamp:t||Math.round(Date.now()/1e3),value:r})),i.abrupt("return",!0);case 12:return i.prev=12,i.t0=i.catch(5),window.console.warn("Encountered an unexpected storage error:",i.t0),i.abrupt("return",!1);case 16:return i.abrupt("return",!1);case 17:case"end":return i.stop()}}),null,null,[[5,12]])},p=function(e){var r;return u.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.a.awrap(Object(o.b)());case 2:if(!(r=t.sent)){t.next=13;break}return t.prev=4,r.removeItem("".concat(o.a).concat(e)),t.abrupt("return",!0);case 9:return t.prev=9,t.t0=t.catch(4),window.console.warn("Encountered an unexpected storage error:",t.t0),t.abrupt("return",!1);case 13:return t.abrupt("return",!1);case 14:case"end":return t.stop()}}),null,null,[[4,9]])},f=function(){var e,r,t,n;return u.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,u.a.awrap(Object(o.b)());case 2:if(!(e=a.sent)){a.next=14;break}for(a.prev=4,r=[],t=0;t<e.length;t++)0===(n=e.key(t)).indexOf(o.a)&&r.push(n.substring(o.a.length));return a.abrupt("return",r);case 10:return a.prev=10,a.t0=a.catch(4),window.console.warn("Encountered an unexpected storage error:",a.t0),a.abrupt("return",[]);case 14:return a.abrupt("return",[]);case 15:case"end":return a.stop()}}),null,null,[[4,10]])},l=t(103),d=t.n(l),_=t(94),b=t.n(_),v=t(33),w=t.n(v),h=t(32),x=t(2),g=function(e,r,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=[e,r,t].filter((function(e){return!!e&&e.length}));return 3===a.length&&n&&n.constructor===Object&&Object.keys(n).length&&a.push(b()(JSON.stringify(Object(x.x)(n)))),a.join("::")},k=function(e,r,t){var n,a,c,o,p,f,l,_,b,v,x,k,y,m,O,q=arguments;return u.a.async((function(S){for(;;)switch(S.prev=S.next){case 0:if(n=q.length>3&&void 0!==q[3]?q[3]:{},a=n.bodyParams,c=n.cacheTTL,o=void 0===c?3600:c,p=n.method,f=void 0===p?"GET":p,l=n.queryParams,_=n.useCache,b=void 0===_?void 0:_,d()(e,"`type` argument for requests is required."),d()(r,"`identifier` argument for requests is required."),d()(t,"`datapoint` argument for requests is required."),v="GET"===f&&(void 0!==b?b:j()),x=g(e,r,t,l),!v){S.next=14;break}return S.next=9,u.a.awrap(i(x,o));case 9:if(k=S.sent,y=k.cacheHit,m=k.value,!y){S.next=14;break}return S.abrupt("return",m);case 14:return S.prev=14,S.next=17,u.a.awrap(w()({data:a,method:f,path:Object(h.addQueryArgs)("/google-site-kit/v1/".concat(e,"/").concat(r,"/data/").concat(t),l)}));case 17:if(O=S.sent,!v){S.next=21;break}return S.next=21,u.a.awrap(s(x,O));case 21:return S.abrupt("return",O);case 24:throw S.prev=24,S.t0=S.catch(14),S.t0;case 27:case"end":return S.stop()}}),null,null,[[14,24]])},y=!0,m=function(e,r,t,n){var a,c,o,i,s,p=arguments;return u.a.async((function(u){for(;;)switch(u.prev=u.next){case 0:return a=p.length>4&&void 0!==p[4]?p[4]:{},c=a.cacheTTL,o=void 0===c?3600:c,i=a.useCache,s=void 0===i?void 0:i,u.abrupt("return",k(e,r,t,{cacheTTL:o,queryParams:n,useCache:s}));case 2:case"end":return u.stop()}}))},O=function(e,r,t,n){var a,c,o,i,s,p,f=arguments;return u.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:return a=f.length>4&&void 0!==f[4]?f[4]:{},c=a.method,o=void 0===c?"POST":c,i=a.queryParams,s=void 0===i?{}:i,l.next=3,u.a.awrap(k(e,r,t,{bodyParams:n,method:o,queryParams:s,useCache:!1}));case 3:return p=l.sent,l.next=6,u.a.awrap(S(e,r,t));case 6:return l.abrupt("return",p);case 7:case"end":return l.stop()}}))},q=function(e){return y=!!e},j=function(){return y},S=function(e,r,t){var n;return u.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return n=g(e,r,t),a.next=3,u.a.awrap(f());case 3:a.sent.forEach((function(e){0===e.indexOf(n)&&p(e)}));case 5:case"end":return a.stop()}}))};void 0===window.googlesitekit&&(window.googlesitekit={}),window.googlesitekit.api=n},32:function(e,r){e.exports=wp.url},33:function(e,r){e.exports=wp.apiFetch},49:function(e,r){e.exports=ReactDOM},53:function(e,r,t){"use strict";(function(e){t.d(r,"a",(function(){return c})),t.d(r,"b",(function(){return p}));var n,a=t(11),u=t.n(a),c=(t(95),"googlesitekit_"),o=["localStorage","sessionStorage"],i=[].concat(o),s=function(r){var t,n;return u.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:if(t=e[r]){a.next=3;break}return a.abrupt("return",!1);case 3:return a.prev=3,n="__storage_test__",t.setItem(n,n),t.removeItem(n),a.abrupt("return",!0);case 10:return a.prev=10,a.t0=a.catch(3),a.abrupt("return",a.t0 instanceof DOMException&&(22===a.t0.code||1014===a.t0.code||"QuotaExceededError"===a.t0.name||"NS_ERROR_DOM_QUOTA_REACHED"===a.t0.name)&&0!==t.length);case 13:case"end":return a.stop()}}),null,null,[[3,10]])},p=function(){var r,t,a,c,o,p;return u.a.async((function(f){for(;;)switch(f.prev=f.next){case 0:if(!(window.googlesitekit&&window.googlesitekit.admin&&window.googlesitekit.admin.nojscache)){f.next=2;break}return f.abrupt("return",null);case 2:if(void 0!==n){f.next=34;break}r=!0,t=!1,a=void 0,f.prev=6,c=i[Symbol.iterator]();case 8:if(r=(o=c.next()).done){f.next=19;break}if(p=o.value,!n){f.next=12;break}return f.abrupt("continue",16);case 12:return f.next=14,u.a.awrap(s(p));case 14:if(!f.sent){f.next=16;break}n=e[p];case 16:r=!0,f.next=8;break;case 19:f.next=25;break;case 21:f.prev=21,f.t0=f.catch(6),t=!0,a=f.t0;case 25:f.prev=25,f.prev=26,r||null==c.return||c.return();case 28:if(f.prev=28,!t){f.next=31;break}throw a;case 31:return f.finish(28);case 32:return f.finish(25);case 33:void 0===n&&(n=null);case 34:return f.abrupt("return",n);case 35:case"end":return f.stop()}}),null,null,[[6,21,25,33],[26,,28,32]])}}).call(this,t(163))}});
dist/assets/js/googlesitekit-dashboard-details.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(t){for(var a,i,o=t[0],c=t[1],s=t[2],_=0,d=[];_<o.length;_++)i=o[_],n[i]&&d.push(n[i][0]),n[i]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(e[a]=c[a]);for(u&&u(t);d.length;)d.shift()();return l.push.apply(l,s||[]),r()}function r(){for(var e,t=0;t<l.length;t++){for(var r=l[t],a=!0,i=1;i<r.length;i++){var o=r[i];0!==n[o]&&(a=!1)}a&&(l.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var a={},n={11:0},l=[];function __webpack_require__(t){if(a[t])return a[t].exports;var r=a[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.m=e,__webpack_require__.c=a,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)__webpack_require__.d(r,a,function(t){return e[t]}.bind(null,a));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="";var i=window.webpackJsonp=window.webpackJsonp||[],o=i.push.bind(i);i.push=t,i=i.slice();for(var c=0;c<i.length;c++)t(i[c]);var u=o;l.push([205,0,1]),r()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},11:function(e,t){e.exports=lodash},18:function(e,t){e.exports=React},205:function(e,t,r){"use strict";r.r(t);var a=r(3),n=r.n(a),l=r(4),i=r.n(l),o=r(5),c=r.n(o),u=r(6),s=r.n(u),_=r(7),d=r.n(_),p=r(1),m=r(26),g=r(39),f=r.n(g),h=r(0),b=r(10),k=r(21),y=function(e){function t(){return n()(this,t),c()(this,s()(t).apply(this,arguments))}return d()(t,e),i()(t,[{key:"render",value:function(){return null}}]),t}(p.Component),v=Object(k.a)("googlesitekit.DashboardDetailsModule")(y),w=function(e){function t(){return n()(this,t),c()(this,s()(t).apply(this,arguments))}return d()(t,e),i()(t,[{key:"render",value:function(){return React.createElement(v,{key:"googlesitekit-dashboard-details-module"})}}]),t}(p.Component),E=r(44),R=r(14),q=r(47),O=r(17),j=r(2),x=r(69),N=r(43),D=function(e){function t(e){var r;return n()(this,t),(r=c()(this,s()(t).call(this,e))).state={},r}return d()(t,e),i()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement(E.a,null),React.createElement("div",{className:"googlesitekit-module-page"},React.createElement("div",{className:"googlesitekit-dashboard-single-url"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-8-desktop "},React.createElement(R.a,{href:googlesitekit.dashboardPermalink,inherit:!0,back:!0,small:!0},Object(h.__)("Back to the Site Kit Dashboard","google-site-kit")),React.createElement(q.a,{title:Object(h.__)("Detailed Page Stats","google-site-kit"),className:" googlesitekit-heading-2 googlesitekit-dashboard-single-url__heading ",fullWidth:!0})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--align-right mdc-layout-grid__cell--align-bottom "},React.createElement(x.a,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(O.a,null,React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-dashboard-single-url__title "},Object(j.e)(googlesitekit.pageTitle)),React.createElement(R.a,{href:googlesitekit.permaLink,inherit:!0,external:!0},googlesitekit.permaLink)))))),React.createElement(w,null),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(N.a,null)))))))}}]),t}(p.Component),S=function(e){function t(e){var r;return n()(this,t),(r=c()(this,s()(t).call(this,e))).state={hasError:!1},Object(h.setLocaleData)(googlesitekit.locale,"google-site-kit"),r}return d()(t,e),i()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){var e=this.state,t=e.hasError,r=e.error,a=e.info;return t?React.createElement(m.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:r,description:a.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(D,null)}}]),t}(p.Component);f()((function(){var e=document.getElementById("js-googlesitekit-dashboard-details");null!==e&&(Object(p.render)(React.createElement(S,null),e),Object(b.doAction)("googlesitekit.moduleLoaded","Dashboard"))}))},35:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.url},39:function(e,t){e.exports=wp.domReady},50:function(e,t){e.exports=ReactDOM},59:function(e,t){e.exports=wp.compose}});
1
+ !function(e){function t(t){for(var a,i,o=t[0],c=t[1],s=t[2],_=0,d=[];_<o.length;_++)i=o[_],n[i]&&d.push(n[i][0]),n[i]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(e[a]=c[a]);for(u&&u(t);d.length;)d.shift()();return l.push.apply(l,s||[]),r()}function r(){for(var e,t=0;t<l.length;t++){for(var r=l[t],a=!0,i=1;i<r.length;i++){var o=r[i];0!==n[o]&&(a=!1)}a&&(l.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var a={},n={13:0},l=[];function __webpack_require__(t){if(a[t])return a[t].exports;var r=a[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.m=e,__webpack_require__.c=a,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)__webpack_require__.d(r,a,function(t){return e[t]}.bind(null,a));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="";var i=window.webpackJsonp=window.webpackJsonp||[],o=i.push.bind(i);i.push=t,i=i.slice();for(var c=0;c<i.length;c++)t(i[c]);var u=o;l.push([211,0,1]),r()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},12:function(e,t){e.exports=lodash},18:function(e,t){e.exports=React},211:function(e,t,r){"use strict";r.r(t);var a=r(3),n=r.n(a),l=r(4),i=r.n(l),o=r(5),c=r.n(o),u=r(6),s=r.n(u),_=r(7),d=r.n(_),p=r(1),m=r(26),g=(r(73),r(2)),f=r(36),h=r.n(f),b=r(10),k=r(21),y=function(e){function t(){return n()(this,t),c()(this,s()(t).apply(this,arguments))}return d()(t,e),i()(t,[{key:"render",value:function(){return null}}]),t}(p.Component),v=Object(k.a)("googlesitekit.DashboardDetailsModule")(y),w=function(e){function t(){return n()(this,t),c()(this,s()(t).apply(this,arguments))}return d()(t,e),i()(t,[{key:"render",value:function(){return React.createElement(v,{key:"googlesitekit-dashboard-details-module"})}}]),t}(p.Component),E=r(44),R=r(14),q=r(47),O=r(17),j=r(75),x=r(43),N=r(0),S=function(e){function t(e){var r;return n()(this,t),(r=c()(this,s()(t).call(this,e))).state={},r}return d()(t,e),i()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement(E.a,null),React.createElement("div",{className:"googlesitekit-module-page"},React.createElement("div",{className:"googlesitekit-dashboard-single-url"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-8-desktop "},React.createElement(R.a,{href:googlesitekit.dashboardPermalink,inherit:!0,back:!0,small:!0},Object(N.__)("Back to the Site Kit Dashboard","google-site-kit")),React.createElement(q.a,{title:Object(N.__)("Detailed Page Stats","google-site-kit"),className:" googlesitekit-heading-2 googlesitekit-dashboard-single-url__heading ",fullWidth:!0})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--align-right mdc-layout-grid__cell--align-bottom "},React.createElement(j.a,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(O.a,null,React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-dashboard-single-url__title "},Object(g.d)(googlesitekit.pageTitle)),React.createElement(R.a,{href:googlesitekit.permaLink,inherit:!0,external:!0},googlesitekit.permaLink)))))),React.createElement(w,null),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(x.a,null)))))))}}]),t}(p.Component),D=function(e){function t(e){var r;return n()(this,t),(r=c()(this,s()(t).call(this,e))).state={hasError:!1},r}return d()(t,e),i()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){var e=this.state,t=e.hasError,r=e.error,a=e.info;return t?React.createElement(m.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:r.message,description:a.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(S,null)}}]),t}(p.Component);h()((function(){var e=document.getElementById("js-googlesitekit-dashboard-details");e&&(Object(g.p)(),Object(p.render)(React.createElement(D,null),e),Object(b.doAction)("googlesitekit.moduleLoaded","Dashboard"))}))},32:function(e,t){e.exports=wp.url},33:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.domReady},49:function(e,t){e.exports=ReactDOM},54:function(e,t){e.exports=wp.compose}});
dist/assets/js/googlesitekit-dashboard-splash.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(t){for(var n,r,c=t[0],s=t[1],u=t[2],g=0,d=[];g<c.length;g++)r=c[g],i[r]&&d.push(i[r][0]),i[r]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);d.length;)d.shift()();return a.push.apply(a,u||[]),o()}function o(){for(var e,t=0;t<a.length;t++){for(var o=a[t],n=!0,r=1;r<o.length;r++){var c=o[r];0!==i[c]&&(n=!1)}n&&(a.splice(t--,1),e=__webpack_require__(__webpack_require__.s=o[0]))}return e}var n={},i={12:0},a=[];function __webpack_require__(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,__webpack_require__),o.l=!0,o.exports}__webpack_require__.e=function(e){var t=[],o=i[e];if(0!==o)if(o)t.push(o[2]);else{var n=new Promise((function(t,n){o=i[e]=[t,n]}));t.push(o[2]=n);var a,r=document.createElement("script");r.charset="utf-8",r.timeout=120,__webpack_require__.nc&&r.setAttribute("nonce",__webpack_require__.nc),r.src=function(e){return __webpack_require__.p+""+({5:"chunk-googlesitekit-setup-wizard",6:"chunk-googlesitekit-setup-wizard-proxy",7:"chunk-googlesitekit-setup-wrapper"}[e]||e)+".js"}(e),a=function(t){r.onerror=r.onload=null,clearTimeout(c);var o=i[e];if(0!==o){if(o){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src,s=new Error("Loading chunk "+e+" failed.\n("+n+": "+a+")");s.type=n,s.request=a,o[1](s)}i[e]=void 0}};var c=setTimeout((function(){a({type:"timeout",target:r})}),12e4);r.onerror=r.onload=a,document.head.appendChild(r)}return Promise.all(t)},__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,o){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(__webpack_require__.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(o,n,function(t){return e[t]}.bind(null,n));return o},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__.oe=function(e){throw console.error(e),e};var r=window.webpackJsonp=window.webpackJsonp||[],c=r.push.bind(r);r.push=t,r=r.slice();for(var s=0;s<r.length;s++)t(r[s]);var l=c;a.push([202,0,1]),o()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},11:function(e,t){e.exports=lodash},18:function(e,t){e.exports=React},202:function(e,t,o){"use strict";o.r(t);var n=o(3),i=o.n(n),a=o(4),r=o.n(a),c=o(5),s=o.n(c),l=o(6),u=o.n(l),g=o(7),d=o.n(g),p=o(1),_=o(2),m=o(26),h=o(39),k=o.n(h),b=o(0),f=o(10),y=o(13),v=o.n(y),w=o(29),R=o(81),E=o(8),j=o.n(E),O=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return d()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,o=e.description,n=e.buttonLabel,i=e.onButtonClick,a=n&&i,r="mdc-layout-grid__cell mdc-layout-grid__cell--span-".concat(a?"4":"8","-tablet mdc-layout-grid__cell--span-").concat(a?"6":"12","-desktop");return React.createElement("section",{className:"googlesitekit-splash-intro"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:r},React.createElement(R.a,null),React.createElement("h1",{className:"googlesitekit-splash-intro__title"},t),o&&React.createElement("p",{className:"googlesitekit-splash-intro__text"},o)),a&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-tablet mdc-layout-grid__cell--span-5-desktop mdc-layout-grid__cell--start-5-tablet mdc-layout-grid__cell--start-7-desktop mdc-layout-grid__cell--offset-1 "},React.createElement("div",{className:"googlesitekit-splash-intro__button"},React.createElement(w.a,{onClick:i},n))))))}}]),t}(p.Component);O.propTypes={title:j.a.string,description:j.a.string,buttonLabel:j.a.string,onButtonClick:j.a.func},O.defaultProps={title:Object(b.__)("Welcome to Site Kit.","google-site-kit")};var S=O,N=o(14),C=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return d()(t,e),r()(t,[{key:"render",value:function(){var e=googlesitekit.admin.assetsRoot+"images/",t=this.props,o=t.image,n=t.title,i=t.content,a=t.link,r=t.linkText,c=t.opposite;return React.createElement("div",{className:"googlesitekit-splash-service ".concat(c?"googlesitekit-splash-service--opposite":""),style:{backgroundImage:"url(".concat(e,"service-").concat(o,".jpg)")}},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"\n\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-5-tablet\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-7-desktop\n\t\t\t\t\t\t\t".concat(c?"mdc-layout-grid__cell--start-3-tablet mdc-layout-grid__cell--start-5-desktop mdc-layout-grid__cell--offset-5-tablet":"","\n\t\t\t\t\t\t")},React.createElement("div",{className:"googlesitekit-splash-service__content"},React.createElement("h3",{className:" googlesitekit-heading-2 googlesitekit-splash-service__title "},n),React.createElement("p",{className:"googlesitekit-splash-service__text"},i),React.createElement(N.a,{href:a,caps:!0,external:!0,arrow:!0},r))))))}}]),t}(p.Component);C.propTypes={image:j.a.string,title:j.a.string,content:j.a.string,link:j.a.string,linkText:j.a.string,opposite:j.a.bool},C.defaultProps={image:"",title:"",content:"",link:"",linkText:"",opposite:!1};var x=C,P=o(20),q=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return d()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.description,o=e.buttonLabel,n=e.onButtonClick;return React.createElement("section",{className:"googlesitekit-splash-outro"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-splash-outro__logo"},React.createElement(P.a,{id:"logo-g",height:"33",width:"29"})),React.createElement("h3",{className:" googlesitekit-heading-2 googlesitekit-splash-outro__title "},t),o&&n&&React.createElement("div",{className:"googlesitekit-splash-outro__button"},React.createElement(w.a,{onClick:n},o))))))}}]),t}(p.Component);q.propTypes={title:j.a.string,description:j.a.string,buttonLabel:j.a.string,onButtonClick:j.a.func},q.defaultProps={description:Object(b.__)("Bringing the best of Google tools to WordPress.","google-site-kit")};var L=q,W=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return d()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.icon,o=e.title,n=e.content;return React.createElement("div",{className:"googlesitekit-splash-module"},React.createElement("div",{className:"googlesitekit-splash-module__logo"},"pagespeed"===t?React.createElement("img",{alt:"PageSpeed Icon",src:googlesitekit.admin.assetsRoot+"images/icon-pagespeed.png"}):React.createElement(P.a,{id:t,width:"33",height:"33"})),React.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-splash-module__title "},o),React.createElement("p",{className:"googlesitekit-splash-module__text"},n))}}]),t}(p.Component);W.propTypes={icon:j.a.string,title:j.a.string,content:j.a.string},W.defaultProps={icon:"",title:"",content:""};var A=W,z=function(e){function t(e){var o;return i()(this,t),(o=s()(this,u()(t).call(this,e))).handleButtonClick=o.handleButtonClick.bind(v()(o)),o}return d()(t,e),r()(t,[{key:"handleButtonClick",value:function(e){e.preventDefault(),this.props.onButtonClick()}},{key:"render",value:function(){var e=this.props,t=e.introDescription,o=e.outroDescription,n=e.buttonLabel,i={searchConsole:{icon:"search-console",title:Object(b._x)("Search Console","Service name","google-site-kit"),content:Object(b.__)("Keep track of how people find you in Search, and how many of them visit your site.","google-site-kit")},analytics:{icon:"analytics",title:Object(b._x)("Analytics","Service name","google-site-kit"),content:Object(b.__)("Understand your customers better: track how they navigate across your site and evaluate the performance of your products or posts.","google-site-kit")},adsense:{icon:"adsense",title:Object(b._x)("AdSense","Service name","google-site-kit"),content:Object(b.__)("Make your content work for you -- earning money by placing ads on your site.","google-site-kit")},pagespeed:{icon:"pagespeed",title:Object(b._x)("PageSpeed","Service name","google-site-kit"),content:Object(b.__)("Analyze your site’s performance and get actionable tips to improve its speed across all devices.","google-site-kit")}},a={searchConsole:{image:"analytics",title:Object(b.__)("Get to know your customers.","google-site-kit"),content:Object(b.__)("Google Analytics gives you the free tools you need to analyze data for your business in one place.","google-site-kit"),link:"https://marketingplatform.google.com/about/analytics/",linkText:Object(b.__)("Learn More","google-site-kit")},analytics:{image:"search_console",title:Object(b.__)("You want to be found on the web. We want to help.","google-site-kit"),content:Object(b.__)("Track your site’s search performance with Google Search Console and browse around for more webmaster resources.","google-site-kit"),link:"https://search.google.com/search-console/about",linkText:Object(b._x)("Search Console","Service name","google-site-kit"),opposite:!0}};return React.createElement("div",{className:"googlesitekit-splash"},React.createElement(S,{description:t,buttonLabel:n,onButtonClick:this.handleButtonClick}),React.createElement("section",{className:"googlesitekit-splash__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h2",{className:" googlesitekit-splash__title googlesitekit-subheading-2 "},Object(b.__)("Powerful tools integrated into your WordPress dashboard.","google-site-kit"))),Object.keys(i).map((function(e){return React.createElement("div",{key:i[e].title,className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(A,{icon:i[e].icon,title:i[e].title,content:i[e].content}))})))),React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},Object.keys(a).map((function(e){return React.createElement("div",{key:a[e].title,className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(x,{image:a[e].image,title:a[e].title,content:a[e].content,link:a[e].link,linkText:a[e].linkText,opposite:a[e].opposite}))}))))),React.createElement(L,{description:o,buttonLabel:n,onButtonClick:this.handleButtonClick}))}}]),t}(p.Component),T=o(21),B=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return d()(t,e),r()(t,[{key:"render",value:function(){return null}}]),t}(p.Component),M=Object(T.a)("googlesitekit.DashboardSplashNotifications")(B),D=o(31),U=o(65),F=(o(158),o(161),1),G=2,I=function(e){function t(e){var o;i()(this,t),o=s()(this,u()(t).call(this,e));var n=googlesitekit.admin.connectURL,a=googlesitekit.setup,r=a.showModuleSetupWizard,c=a.isAuthenticated,l=a.isVerified,g=a.hasSearchConsoleProperty,d=googlesitekit.permissions,p=d.canAuthenticate,_=d.canSetup,m=d.canViewDashboard,h=d.canPublishPosts;return o.state={showAuthenticationSetupWizard:_&&(!c||!l||!g),showModuleSetupWizard:r,canViewDashboard:m,canPublishPosts:h,buttonMode:0,connectURL:n},p&&!c&&(o.state.buttonMode=F),!_||c&&l&&g||(o.state.buttonMode=G),o.openAuthenticationSetupWizard=o.openAuthenticationSetupWizard.bind(v()(o)),o.gotoConnectURL=o.gotoConnectURL.bind(v()(o)),o}return d()(t,e),r()(t,[{key:"openAuthenticationSetupWizard",value:function(){Object(_.v)("plugin_setup","setup_sitekit"),this.setState({showAuthenticationSetupWizard:!0})}},{key:"gotoConnectURL",value:function(){this.setState({showAuthenticationInstructionsWizard:!1,showAuthenticationSetupWizard:!1}),Object(_.v)("plugin_setup","connect_account"),document.location=this.state.connectURL}},{key:"render",value:function(){window.googlesitekit&&window.googlesitekit.publicPath&&(o.p=window.googlesitekit.publicPath);var e=googlesitekit.admin.proxySetupURL;if(!e&&!this.state.showAuthenticationSetupWizard&&!this.state.showModuleSetupWizard){var t,n,i,a;switch(this.state.buttonMode){case F:t=Object(b.__)("You’re one step closer to connecting Google services to your WordPress site.","google-site-kit"),n=Object(b.__)("Connecting your account only takes a few minutes. Faster than brewing a cup of coffee.","google-site-kit"),i=Object(b.__)("Connect your account","google-site-kit"),a=this.gotoConnectURL;break;case G:t=Object(b.__)("You’re one step closer to connecting Google services to your WordPress site.","google-site-kit"),n=Object(b.__)("Setup only takes a few minutes. Faster than brewing a cup of coffee.","google-site-kit"),i=Object(b.__)("Set Up Site Kit","google-site-kit"),a=this.openAuthenticationSetupWizard;break;default:t=this.state.canViewDashboard?Object(b.__)("Start gaining insights on how your site is performing in search by visiting the dashboard.","google-site-kit"):this.state.canPublishPosts?Object(b.__)("Start gaining insights on how your site is performing in search by editing one of your posts.","google-site-kit"):Object(b.__)("Start gaining insights on how your site is performing in search by viewing one of your published posts.","google-site-kit")}return React.createElement(p.Fragment,null,React.createElement(M,null),React.createElement(z,{introDescription:t,outroDescription:n,buttonLabel:i,onButtonClick:a}))}var r=null;return r=e?Object(U.b)((function(){return Promise.all([o.e(0),o.e(6)]).then(o.bind(null,209))})):this.state.showAuthenticationSetupWizard?Object(U.b)((function(){return Promise.all([o.e(0),o.e(5)]).then(o.bind(null,210))})):Object(U.b)((function(){return Promise.all([o.e(0),o.e(7)]).then(o.bind(null,156))})),React.createElement(U.a,{fallback:React.createElement(p.Fragment,null,React.createElement("div",{className:"googlesitekit-setup"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-setup__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(D.a,null))))))))))},React.createElement(r,null))}}]),t}(p.Component),V=o(89),K=function(e){function t(e){var o;return i()(this,t),(o=s()(this,u()(t).call(this,e))).state={hasError:!1},Object(b.setLocaleData)(googlesitekit.locale,"google-site-kit"),o}return d()(t,e),r()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){var e=this.state,t=e.hasError,o=e.error,n=e.info;return t?React.createElement(m.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:o,description:n.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(p.Fragment,null,React.createElement(V.a,null),React.createElement(I,null))}}]),t}(p.Component);k()((function(){googlesitekit.admin.resetSession&&Object(_.d)();var e=document.getElementById("js-googlesitekit-dashboard-splash");null!==e&&(Object(p.render)(React.createElement(K,null),e),Object(f.doAction)("googlesitekit.moduleLoaded","Splash"))}))},35:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.url},39:function(e,t){e.exports=wp.domReady},50:function(e,t){e.exports=ReactDOM},59:function(e,t){e.exports=wp.compose}});
1
+ !function(e){function t(t){for(var n,r,c=t[0],s=t[1],u=t[2],g=0,p=[];g<c.length;g++)r=c[g],i[r]&&p.push(i[r][0]),i[r]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);p.length;)p.shift()();return a.push.apply(a,u||[]),o()}function o(){for(var e,t=0;t<a.length;t++){for(var o=a[t],n=!0,r=1;r<o.length;r++){var c=o[r];0!==i[c]&&(n=!1)}n&&(a.splice(t--,1),e=__webpack_require__(__webpack_require__.s=o[0]))}return e}var n={},i={14:0},a=[];function __webpack_require__(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,__webpack_require__),o.l=!0,o.exports}__webpack_require__.e=function(e){var t=[],o=i[e];if(0!==o)if(o)t.push(o[2]);else{var n=new Promise((function(t,n){o=i[e]=[t,n]}));t.push(o[2]=n);var a,r=document.createElement("script");r.charset="utf-8",r.timeout=120,__webpack_require__.nc&&r.setAttribute("nonce",__webpack_require__.nc),r.src=function(e){return __webpack_require__.p+""+({5:"chunk-googlesitekit-setup-wizard",6:"chunk-googlesitekit-setup-wizard-proxy",7:"chunk-googlesitekit-setup-wrapper"}[e]||e)+".js"}(e),a=function(t){r.onerror=r.onload=null,clearTimeout(c);var o=i[e];if(0!==o){if(o){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src,s=new Error("Loading chunk "+e+" failed.\n("+n+": "+a+")");s.type=n,s.request=a,o[1](s)}i[e]=void 0}};var c=setTimeout((function(){a({type:"timeout",target:r})}),12e4);r.onerror=r.onload=a,document.head.appendChild(r)}return Promise.all(t)},__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,o){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(__webpack_require__.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(o,n,function(t){return e[t]}.bind(null,n));return o},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__.oe=function(e){throw console.error(e),e};var r=window.webpackJsonp=window.webpackJsonp||[],c=r.push.bind(r);r.push=t,r=r.slice();for(var s=0;s<r.length;s++)t(r[s]);var l=c;a.push([208,0,1]),o()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},12:function(e,t){e.exports=lodash},18:function(e,t){e.exports=React},208:function(e,t,o){"use strict";o.r(t);var n=o(3),i=o.n(n),a=o(4),r=o.n(a),c=o(5),s=o.n(c),l=o(6),u=o.n(l),g=o(7),p=o.n(g),d=o(1),_=o(2),m=o(26),h=(o(73),o(36)),k=o.n(h),b=o(10),f=o(13),y=o.n(f),v=o(0),w=o(28),R=o(71),E=o(8),j=o.n(E),O=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,o=e.description,n=e.buttonLabel,i=e.onButtonClick,a=n&&i,r="mdc-layout-grid__cell mdc-layout-grid__cell--span-".concat(a?"4":"8","-tablet mdc-layout-grid__cell--span-").concat(a?"6":"12","-desktop");return React.createElement("section",{className:"googlesitekit-splash-intro"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:r},React.createElement(R.a,null),React.createElement("h1",{className:"googlesitekit-splash-intro__title"},t),o&&React.createElement("p",{className:"googlesitekit-splash-intro__text"},o)),a&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-tablet mdc-layout-grid__cell--span-5-desktop mdc-layout-grid__cell--start-5-tablet mdc-layout-grid__cell--start-7-desktop mdc-layout-grid__cell--offset-1 "},React.createElement("div",{className:"googlesitekit-splash-intro__button"},React.createElement(w.a,{onClick:i},n))))))}}]),t}(d.Component);O.propTypes={title:j.a.string,description:j.a.string,buttonLabel:j.a.string,onButtonClick:j.a.func},O.defaultProps={title:Object(v.__)("Welcome to Site Kit.","google-site-kit")};var S=O,N=o(14),C=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=googlesitekit.admin.assetsRoot+"images/",t=this.props,o=t.image,n=t.title,i=t.content,a=t.link,r=t.linkText,c=t.opposite;return React.createElement("div",{className:"googlesitekit-splash-service ".concat(c?"googlesitekit-splash-service--opposite":""),style:{backgroundImage:"url(".concat(e,"service-").concat(o,".jpg)")}},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"\n\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-5-tablet\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-7-desktop\n\t\t\t\t\t\t\t".concat(c?"mdc-layout-grid__cell--start-3-tablet mdc-layout-grid__cell--start-5-desktop mdc-layout-grid__cell--offset-5-tablet":"","\n\t\t\t\t\t\t")},React.createElement("div",{className:"googlesitekit-splash-service__content"},React.createElement("h3",{className:" googlesitekit-heading-2 googlesitekit-splash-service__title "},n),React.createElement("p",{className:"googlesitekit-splash-service__text"},i),React.createElement(N.a,{href:a,caps:!0,external:!0,arrow:!0},r))))))}}]),t}(d.Component);C.propTypes={image:j.a.string,title:j.a.string,content:j.a.string,link:j.a.string,linkText:j.a.string,opposite:j.a.bool},C.defaultProps={image:"",title:"",content:"",link:"",linkText:"",opposite:!1};var x=C,P=o(20),q=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.description,o=e.buttonLabel,n=e.onButtonClick;return React.createElement("section",{className:"googlesitekit-splash-outro"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-splash-outro__logo"},React.createElement(P.a,{id:"logo-g",height:"33",width:"29"})),React.createElement("h3",{className:" googlesitekit-heading-2 googlesitekit-splash-outro__title "},t),o&&n&&React.createElement("div",{className:"googlesitekit-splash-outro__button"},React.createElement(w.a,{onClick:n},o))))))}}]),t}(d.Component);q.propTypes={title:j.a.string,description:j.a.string,buttonLabel:j.a.string,onButtonClick:j.a.func},q.defaultProps={description:Object(v.__)("Bringing the best of Google tools to WordPress.","google-site-kit")};var L=q,W=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.icon,o=e.title,n=e.content;return React.createElement("div",{className:"googlesitekit-splash-module"},React.createElement("div",{className:"googlesitekit-splash-module__logo"},"pagespeed"===t?React.createElement("img",{alt:"PageSpeed Icon",src:googlesitekit.admin.assetsRoot+"images/icon-pagespeed.png"}):React.createElement(P.a,{id:t,width:"33",height:"33"})),React.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-splash-module__title "},o),React.createElement("p",{className:"googlesitekit-splash-module__text"},n))}}]),t}(d.Component);W.propTypes={icon:j.a.string,title:j.a.string,content:j.a.string},W.defaultProps={icon:"",title:"",content:""};var A=W,z=function(e){function t(e){var o;return i()(this,t),(o=s()(this,u()(t).call(this,e))).handleButtonClick=o.handleButtonClick.bind(y()(o)),o}return p()(t,e),r()(t,[{key:"handleButtonClick",value:function(e){e.preventDefault(),this.props.onButtonClick()}},{key:"render",value:function(){var e=this.props,t=e.introDescription,o=e.outroDescription,n=e.buttonLabel,i={searchConsole:{icon:"search-console",title:Object(v._x)("Search Console","Service name","google-site-kit"),content:Object(v.__)("Keep track of how people find you in Search, and how many of them visit your site.","google-site-kit")},analytics:{icon:"analytics",title:Object(v._x)("Analytics","Service name","google-site-kit"),content:Object(v.__)("Understand your customers better: track how they navigate across your site and evaluate the performance of your products or posts.","google-site-kit")},adsense:{icon:"adsense",title:Object(v._x)("AdSense","Service name","google-site-kit"),content:Object(v.__)("Make your content work for you -- earning money by placing ads on your site.","google-site-kit")},pagespeed:{icon:"pagespeed",title:Object(v._x)("PageSpeed","Service name","google-site-kit"),content:Object(v.__)("Analyze your site’s performance and get actionable tips to improve its speed across all devices.","google-site-kit")}},a={searchConsole:{image:"analytics",title:Object(v.__)("Get to know your customers.","google-site-kit"),content:Object(v.__)("Google Analytics gives you the free tools you need to analyze data for your business in one place.","google-site-kit"),link:"https://marketingplatform.google.com/about/analytics/",linkText:Object(v.__)("Learn More","google-site-kit")},analytics:{image:"search_console",title:Object(v.__)("You want to be found on the web. We want to help.","google-site-kit"),content:Object(v.__)("Track your site’s search performance with Google Search Console and browse around for more webmaster resources.","google-site-kit"),link:"https://search.google.com/search-console/about",linkText:Object(v._x)("Search Console","Service name","google-site-kit"),opposite:!0}};return React.createElement("div",{className:"googlesitekit-splash"},React.createElement(S,{description:t,buttonLabel:n,onButtonClick:this.handleButtonClick}),React.createElement("section",{className:"googlesitekit-splash__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h2",{className:" googlesitekit-splash__title googlesitekit-subheading-2 "},Object(v.__)("Powerful tools integrated into your WordPress dashboard.","google-site-kit"))),Object.keys(i).map((function(e){return React.createElement("div",{key:i[e].title,className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(A,{icon:i[e].icon,title:i[e].title,content:i[e].content}))})))),React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},Object.keys(a).map((function(e){return React.createElement("div",{key:a[e].title,className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(x,{image:a[e].image,title:a[e].title,content:a[e].content,link:a[e].link,linkText:a[e].linkText,opposite:a[e].opposite}))}))))),React.createElement(L,{description:o,buttonLabel:n,onButtonClick:this.handleButtonClick}))}}]),t}(d.Component),T=o(21),B=function(e){function t(){return i()(this,t),s()(this,u()(t).apply(this,arguments))}return p()(t,e),r()(t,[{key:"render",value:function(){return null}}]),t}(d.Component),M=Object(T.a)("googlesitekit.DashboardSplashNotifications")(B),D=o(31),U=o(68),F=(o(173),1),G=2,I=function(e){function t(e){var o;i()(this,t),o=s()(this,u()(t).call(this,e));var n=googlesitekit.admin.connectURL,a=googlesitekit.setup,r=a.showModuleSetupWizard,c=a.isAuthenticated,l=a.isVerified,g=a.hasSearchConsoleProperty,p=googlesitekit.permissions,d=p.canAuthenticate,_=p.canSetup,m=p.canViewDashboard,h=p.canPublishPosts;return o.state={showAuthenticationSetupWizard:_&&(!c||!l||!g),showModuleSetupWizard:r,canViewDashboard:m,canPublishPosts:h,buttonMode:0,connectURL:n},d&&!c&&(o.state.buttonMode=F),!_||c&&l&&g||(o.state.buttonMode=G),o.openAuthenticationSetupWizard=o.openAuthenticationSetupWizard.bind(y()(o)),o.gotoConnectURL=o.gotoConnectURL.bind(y()(o)),o}return p()(t,e),r()(t,[{key:"openAuthenticationSetupWizard",value:function(){Object(_.v)("plugin_setup","setup_sitekit"),this.setState({showAuthenticationSetupWizard:!0})}},{key:"gotoConnectURL",value:function(){this.setState({showAuthenticationInstructionsWizard:!1,showAuthenticationSetupWizard:!1}),Object(_.v)("plugin_setup","connect_account"),document.location=this.state.connectURL}},{key:"render",value:function(){window.googlesitekit&&window.googlesitekit.publicPath&&(o.p=window.googlesitekit.publicPath);var e=googlesitekit.admin.proxySetupURL;if(!e&&!this.state.showAuthenticationSetupWizard&&!this.state.showModuleSetupWizard){var t,n,i,a;switch(this.state.buttonMode){case F:t=Object(v.__)("You’re one step closer to connecting Google services to your WordPress site.","google-site-kit"),n=Object(v.__)("Connecting your account only takes a few minutes. Faster than brewing a cup of coffee.","google-site-kit"),i=Object(v.__)("Connect your account","google-site-kit"),a=this.gotoConnectURL;break;case G:t=Object(v.__)("You’re one step closer to connecting Google services to your WordPress site.","google-site-kit"),n=Object(v.__)("Setup only takes a few minutes. Faster than brewing a cup of coffee.","google-site-kit"),i=Object(v.__)("Set Up Site Kit","google-site-kit"),a=this.openAuthenticationSetupWizard;break;default:t=this.state.canViewDashboard?Object(v.__)("Start gaining insights on how your site is performing in search by visiting the dashboard.","google-site-kit"):this.state.canPublishPosts?Object(v.__)("Start gaining insights on how your site is performing in search by editing one of your posts.","google-site-kit"):Object(v.__)("Start gaining insights on how your site is performing in search by viewing one of your published posts.","google-site-kit")}return React.createElement(d.Fragment,null,React.createElement(M,null),React.createElement(z,{introDescription:t,outroDescription:n,buttonLabel:i,onButtonClick:a}))}var r=null;return r=e?Object(U.b)((function(){return Promise.all([o.e(0),o.e(6)]).then(o.bind(null,217))})):this.state.showAuthenticationSetupWizard?Object(U.b)((function(){return Promise.all([o.e(0),o.e(5)]).then(o.bind(null,218))})):Object(U.b)((function(){return Promise.all([o.e(0),o.e(7)]).then(o.bind(null,172))})),React.createElement(U.a,{fallback:React.createElement(d.Fragment,null,React.createElement("div",{className:"googlesitekit-setup"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-setup__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(D.a,null))))))))))},React.createElement(r,null))}}]),t}(d.Component),V=o(74),K=function(e){function t(e){var o;return i()(this,t),(o=s()(this,u()(t).call(this,e))).state={hasError:!1},o}return p()(t,e),r()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){var e=this.state,t=e.hasError,o=e.error,n=e.info;return t?React.createElement(m.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:o.message,description:n.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(d.Fragment,null,React.createElement(V.a,null),React.createElement(I,null))}}]),t}(d.Component);k()((function(){googlesitekit.admin.resetSession&&Object(_.c)();var e=document.getElementById("js-googlesitekit-dashboard-splash");e&&(Object(_.p)(),Object(d.render)(React.createElement(K,null),e),Object(b.doAction)("googlesitekit.moduleLoaded","Splash"))}))},32:function(e,t){e.exports=wp.url},33:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.domReady},49:function(e,t){e.exports=ReactDOM},54:function(e,t){e.exports=wp.compose}});
dist/assets/js/googlesitekit-dashboard.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(t){for(var r,l,o=t[0],c=t[1],s=t[2],d=0,m=[];d<o.length;d++)l=o[d],a[l]&&m.push(a[l][0]),a[l]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);for(u&&u(t);m.length;)m.shift()();return i.push.apply(i,s||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,l=1;l<n.length;l++){var o=n[l];0!==a[o]&&(r=!1)}r&&(i.splice(t--,1),e=__webpack_require__(__webpack_require__.s=n[0]))}return e}var r={},a={10:0},i=[];function __webpack_require__(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=e,__webpack_require__.c=r,__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)__webpack_require__.d(n,r,function(t){return e[t]}.bind(null,r));return n},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="";var l=window.webpackJsonp=window.webpackJsonp||[],o=l.push.bind(l);l.push=t,l=l.slice();for(var c=0;c<l.length;c++)t(l[c]);var u=o;i.push([203,0,1]),n()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},11:function(e,t){e.exports=lodash},156:function(e,t,n){"use strict";n.r(t);var r=n(13),a=n.n(r),i=n(3),l=n.n(i),o=n(4),c=n.n(o),u=n(5),s=n.n(u),d=n(6),m=n.n(d),_=n(7),p=n.n(_),f=n(1),g=n(11),h=n(44),y=n(14),v=n(43),k=n(2),b=n(21),R=n(0),E=n(10),w=function(e){function t(){return l()(this,t),s()(this,m()(t).apply(this,arguments))}return p()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.children;return React.createElement(f.Fragment,null,e)}}]),t}(f.Component),S=function(e){function t(e){var n;l()(this,t),n=s()(this,m()(t).call(this,e));var r=googlesitekit.setup.moduleToSetup;return n.state={currentModule:r,refresh:!1},n.timeoutID=null,n.unfocusedTime=0,n.autoRefreshModules=Object(E.applyFilters)("googlesitekit.autoRefreshModules",[]),n.moduleRefresh=n.autoRefreshModules.find((function(e){return n.state.currentModule===e.identifier})),n.refreshStatus=n.refreshStatus.bind(a()(n)),n.startUnfocusedTimer=n.startUnfocusedTimer.bind(a()(n)),n}return p()(t,e),c()(t,[{key:"componentDidMount",value:function(){window.addEventListener("focus",this.refreshStatus),window.addEventListener("blur",this.startUnfocusedTimer)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("focus",this.refreshStatus),window.removeEventListener("blur",this.startUnfocusedTimer)}},{key:"startUnfocusedTimer",value:function(){var e=this;if(this.moduleRefresh){var t=!0;this.moduleRefresh.toRefresh&&(t=this.moduleRefresh.toRefresh()),t&&(this.timeoutID=window.setInterval((function(){e.unfocusedTime++}),1e3))}}},{key:"refreshStatus",value:function(){if(this.moduleRefresh){var e=this.moduleRefresh.idleTime||15,t=!0;this.moduleRefresh.toRefresh&&(t=this.moduleRefresh.toRefresh()),t&&(e<this.unfocusedTime&&this.setState({refresh:this.timeoutID}),window.clearTimeout(this.timeoutID),this.unfocusedTime=0,this.timeoutID=null)}}},{key:"render",value:function(){var e=this.state.currentModule,n=t.loadSetupModule(e),r=Object(k.n)("googlesitekit-settings",{});return React.createElement(f.Fragment,null,React.createElement(h.a,null),React.createElement("div",{className:"googlesitekit-setup"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("section",{className:"googlesitekit-setup__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("p",{className:" googlesitekit-setup__intro-title googlesitekit-overline "},Object(R.__)("Connect Service","google-site-kit")),n))),React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(y.a,{id:"setup-".concat(e,"-cancel"),href:r},Object(R.__)("Cancel","google-site-kit"))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--align-right "},React.createElement(v.a,null)))))))))))}}],[{key:"loadSetupModule",value:function(e){var n=Object(b.a)("googlesitekit.ModuleSetup-".concat(e))(w);return React.createElement(n,{finishSetup:t.finishSetup,onSettingsPage:!1,isEditing:!0})}},{key:"finishSetup",value:function(){var e={notification:"authentication_success"};googlesitekit.setup&&googlesitekit.setup.moduleToSetup&&(e.slug=googlesitekit.setup.moduleToSetup);var t=Object(k.n)("googlesitekit-dashboard",e);Object(g.delay)((function(){window.location.replace(t)}),500,"later")}}]),t}(f.Component);t.default=S},18:function(e,t){e.exports=React},203:function(e,t,n){"use strict";n.r(t);var r=n(3),a=n.n(r),i=n(4),l=n.n(i),o=n(5),c=n.n(o),u=n(6),s=n.n(u),d=n(7),m=n.n(d),_=n(1),p=n(2),f=n(26),g=n(156),h=n(44),y=n(69),v=n(47),k=(n(158),n(161),n(0)),b=n(21),R=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return null}}]),t}(_.Component),E=Object(b.a)("googlesitekit.DashboardModule")(R),w=n(43),S=n(18),O=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return React.createElement(S.Fragment,null,React.createElement(E,{key:"googlesitekit-dashboard-module"}),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(w.a,null)))}}]),t}(_.Component),j=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return React.createElement(_.Fragment,null,React.createElement(O,null))}}]),t}(_.Component),N=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return null}}]),t}(_.Component),q=Object(b.a)("googlesitekit.DashboardNotifications")(N),M=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return React.createElement(_.Fragment,null,React.createElement(h.a,null),React.createElement(q,null),React.createElement("div",{className:"googlesitekit-module-page"},React.createElement("div",{className:"googlesitekit-dashboard"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-10-desktop mdc-layout-grid__cell--span-6-tablet mdc-layout-grid__cell--span-2-phone "},React.createElement(v.a,{className:" googlesitekit-heading-2 googlesitekit-dashboard__heading ",title:Object(k.__)("Site Overview","google-site-kit")})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-desktop mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right "},React.createElement(y.a,null)),React.createElement(j,null))))))}}]),t}(_.Component),T=n(89),x=n(39),D=n.n(x),C=n(10),F=function(e){function t(e){var n;return a()(this,t),(n=c()(this,s()(t).call(this,e))).state={hasError:!1},Object(k.setLocaleData)(googlesitekit.locale,"google-site-kit"),n}return m()(t,e),l()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){if(window.googlesitekit.setup.showModuleSetupWizard)return React.createElement(g.default,null);var e=this.state,t=e.hasError,n=e.error,r=e.info;return t?React.createElement(f.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:n,description:r.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(_.Fragment,null,React.createElement(T.a,null),React.createElement(M,null))}}]),t}(_.Component);D()((function(){googlesitekit.admin.resetSession&&Object(p.d)();var e=document.getElementById("js-googlesitekit-dashboard");null!==e&&(Object(_.render)(React.createElement(F,null),e),Object(C.doAction)("googlesitekit.moduleLoaded","Dashboard"))}))},35:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.url},39:function(e,t){e.exports=wp.domReady},50:function(e,t){e.exports=ReactDOM},59:function(e,t){e.exports=wp.compose}});
1
+ !function(e){function t(t){for(var r,l,o=t[0],c=t[1],s=t[2],d=0,m=[];d<o.length;d++)l=o[d],a[l]&&m.push(a[l][0]),a[l]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);for(u&&u(t);m.length;)m.shift()();return i.push.apply(i,s||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,l=1;l<n.length;l++){var o=n[l];0!==a[o]&&(r=!1)}r&&(i.splice(t--,1),e=__webpack_require__(__webpack_require__.s=n[0]))}return e}var r={},a={12:0},i=[];function __webpack_require__(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=e,__webpack_require__.c=r,__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)__webpack_require__.d(n,r,function(t){return e[t]}.bind(null,r));return n},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="";var l=window.webpackJsonp=window.webpackJsonp||[],o=l.push.bind(l);l.push=t,l=l.slice();for(var c=0;c<l.length;c++)t(l[c]);var u=o;i.push([209,0,1]),n()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},12:function(e,t){e.exports=lodash},172:function(e,t,n){"use strict";n.r(t);var r=n(13),a=n.n(r),i=n(3),l=n.n(i),o=n(4),c=n.n(o),u=n(5),s=n.n(u),d=n(6),m=n.n(d),_=n(7),p=n.n(_),f=n(1),g=n(12),h=n(44),y=n(14),v=n(43),k=n(2),b=n(21),R=n(0),E=n(10),w=function(e){function t(){return l()(this,t),s()(this,m()(t).apply(this,arguments))}return p()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.children;return React.createElement(f.Fragment,null,e)}}]),t}(f.Component),S=function(e){function t(e){var n;l()(this,t),n=s()(this,m()(t).call(this,e));var r=googlesitekit.setup.moduleToSetup;return n.state={currentModule:r,refresh:!1},n.timeoutID=null,n.unfocusedTime=0,n.autoRefreshModules=Object(E.applyFilters)("googlesitekit.autoRefreshModules",[]),n.moduleRefresh=n.autoRefreshModules.find((function(e){return n.state.currentModule===e.identifier})),n.refreshStatus=n.refreshStatus.bind(a()(n)),n.startUnfocusedTimer=n.startUnfocusedTimer.bind(a()(n)),n}return p()(t,e),c()(t,[{key:"componentDidMount",value:function(){window.addEventListener("focus",this.refreshStatus),window.addEventListener("blur",this.startUnfocusedTimer)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("focus",this.refreshStatus),window.removeEventListener("blur",this.startUnfocusedTimer)}},{key:"startUnfocusedTimer",value:function(){var e=this;if(this.moduleRefresh){var t=!0;this.moduleRefresh.toRefresh&&(t=this.moduleRefresh.toRefresh()),t&&(this.timeoutID=window.setInterval((function(){e.unfocusedTime++}),1e3))}}},{key:"refreshStatus",value:function(){if(this.moduleRefresh){var e=this.moduleRefresh.idleTime||15,t=!0;this.moduleRefresh.toRefresh&&(t=this.moduleRefresh.toRefresh()),t&&(e<this.unfocusedTime&&this.setState({refresh:this.timeoutID}),window.clearTimeout(this.timeoutID),this.unfocusedTime=0,this.timeoutID=null)}}},{key:"render",value:function(){var e=this.state.currentModule,n=t.loadSetupModule(e),r=Object(k.m)("googlesitekit-settings",{});return React.createElement(f.Fragment,null,React.createElement(h.a,null),React.createElement("div",{className:"googlesitekit-setup"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("section",{className:"googlesitekit-setup__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("p",{className:" googlesitekit-setup__intro-title googlesitekit-overline "},Object(R.__)("Connect Service","google-site-kit")),n))),React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(y.a,{id:"setup-".concat(e,"-cancel"),href:r},Object(R.__)("Cancel","google-site-kit"))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--align-right "},React.createElement(v.a,null)))))))))))}}],[{key:"loadSetupModule",value:function(e){var n=Object(b.a)("googlesitekit.ModuleSetup-".concat(e))(w);return React.createElement(n,{finishSetup:t.finishSetup,onSettingsPage:!1,isEditing:!0})}},{key:"finishSetup",value:function(){var e={notification:"authentication_success"};googlesitekit.setup&&googlesitekit.setup.moduleToSetup&&(e.slug=googlesitekit.setup.moduleToSetup);var t=Object(k.m)("googlesitekit-dashboard",e);Object(g.delay)((function(){window.location.replace(t)}),500,"later")}}]),t}(f.Component);t.default=S},18:function(e,t){e.exports=React},209:function(e,t,n){"use strict";n.r(t);var r=n(3),a=n.n(r),i=n(4),l=n.n(i),o=n(5),c=n.n(o),u=n(6),s=n.n(u),d=n(7),m=n.n(d),_=n(1),p=n(2),f=n(26),g=n(172),h=n(44),y=n(75),v=n(47),k=(n(173),n(0)),b=n(21),R=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return null}}]),t}(_.Component),E=Object(b.a)("googlesitekit.DashboardModule")(R),w=n(43),S=n(18),O=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return React.createElement(S.Fragment,null,React.createElement(E,{key:"googlesitekit-dashboard-module"}),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(w.a,null)))}}]),t}(_.Component),j=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return React.createElement(_.Fragment,null,React.createElement(O,null))}}]),t}(_.Component),N=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return null}}]),t}(_.Component),q=Object(b.a)("googlesitekit.DashboardNotifications")(N),M=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return React.createElement(_.Fragment,null,React.createElement(h.a,null),React.createElement(q,null),React.createElement("div",{className:"googlesitekit-module-page"},React.createElement("div",{className:"googlesitekit-dashboard"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-10-desktop mdc-layout-grid__cell--span-6-tablet mdc-layout-grid__cell--span-2-phone "},React.createElement(v.a,{className:" googlesitekit-heading-2 googlesitekit-dashboard__heading ",title:Object(k.__)("Site Overview","google-site-kit")})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-desktop mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right "},React.createElement(y.a,null)),React.createElement(j,null))))))}}]),t}(_.Component),T=n(74),x=(n(73),n(36)),D=n.n(x),C=n(10),F=function(e){function t(e){var n;return a()(this,t),(n=c()(this,s()(t).call(this,e))).state={hasError:!1},n}return m()(t,e),l()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){if(window.googlesitekit.setup.showModuleSetupWizard)return React.createElement(g.default,null);var e=this.state,t=e.hasError,n=e.error,r=e.info;return t?React.createElement(f.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:n.message,description:r.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(_.Fragment,null,React.createElement(T.a,null),React.createElement(M,null))}}]),t}(_.Component);D()((function(){googlesitekit.admin.resetSession&&Object(p.c)();var e=document.getElementById("js-googlesitekit-dashboard");e&&(Object(p.p)(),Object(_.render)(React.createElement(F,null),e),Object(C.doAction)("googlesitekit.moduleLoaded","Dashboard"))}))},32:function(e,t){e.exports=wp.url},33:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.domReady},49:function(e,t){e.exports=ReactDOM},54:function(e,t){e.exports=wp.compose}});
dist/assets/js/googlesitekit-module.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(t){for(var n,a,c=t[0],u=t[1],_=t[2],s=0,p=[];s<c.length;s++)a=c[s],o[a]&&p.push(o[a][0]),o[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(l&&l(t);p.length;)p.shift()();return i.push.apply(i,_||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,a=1;a<r.length;a++){var c=r[a];0!==o[c]&&(n=!1)}n&&(i.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var n={},o={13:0},i=[];function __webpack_require__(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,__webpack_require__.nc&&a.setAttribute("nonce",__webpack_require__.nc),a.src=function(e){return __webpack_require__.p+""+({7:"chunk-googlesitekit-setup-wrapper"}[e]||e)+".js"}(e),i=function(t){a.onerror=a.onload=null,clearTimeout(c);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src,u=new Error("Loading chunk "+e+" failed.\n("+n+": "+i+")");u.type=n,u.request=i,r[1](u)}o[e]=void 0}};var c=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}return Promise.all(t)},__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var l=c;i.push([206,0,1]),r()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},11:function(e,t){e.exports=lodash},18:function(e,t){e.exports=React},206:function(e,t,r){"use strict";r.r(t);var n=r(3),o=r.n(n),i=r(4),a=r.n(i),c=r(5),u=r.n(c),l=r(6),_=r.n(l),s=r(7),p=r.n(s),d=r(1),f=r(31),m=r(26),g=(r(9),r(39)),b=r.n(g),w=r(0),k=r(10),h=r(65),v=r(21),y=function(e){function t(){return o()(this,t),u()(this,_()(t).apply(this,arguments))}return p()(t,e),a()(t,[{key:"render",value:function(){return null}}]),t}(d.Component),q=Object(v.a)("googlesitekit.ModuleApp-"+googlesitekitCurrentModule.slug)(y),E=function(e){function t(e){var r;o()(this,t),(r=u()(this,_()(t).call(this,e))).state={hasError:!1},Object(w.setLocaleData)(googlesitekit.locale,"google-site-kit");var n=googlesitekit.setup.showModuleSetupWizard;return r.state={showModuleSetupWizard:n},r}return p()(t,e),a()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){var e=this.state,t=e.hasError,n=e.error,o=e.info,i=e.showModuleSetupWizard;if(t)return React.createElement(m.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:n,description:o.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"});var a=googlesitekit.admin.currentAdminPage,c=Object(k.applyFilters)("googlesitekit.moduleHasSetupWizard",!0,a);if(i&&c){window.googlesitekit&&window.googlesitekit.publicPath&&(r.p=window.googlesitekit.publicPath);var u=Object(h.b)((function(){return Promise.all([r.e(0),r.e(7)]).then(r.bind(null,156))}));return React.createElement(h.a,{fallback:React.createElement(d.Fragment,null,React.createElement("div",{className:"googlesitekit-setup"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-setup__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,null))))))))))},React.createElement(u,null))}return React.createElement(q,null)}}]),t}(d.Component);b()((function(){var e=document.getElementById("js-googlesitekit-module");null!==e&&(Object(d.render)(React.createElement(E,null),e),Object(k.doAction)("googlesitekit.moduleLoaded","Single",googlesitekitCurrentModule))}))},35:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.url},39:function(e,t){e.exports=wp.domReady},50:function(e,t){e.exports=ReactDOM},59:function(e,t){e.exports=wp.compose}});
1
+ !function(e){function t(t){for(var n,a,c=t[0],u=t[1],_=t[2],s=0,p=[];s<c.length;s++)a=c[s],o[a]&&p.push(o[a][0]),o[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(l&&l(t);p.length;)p.shift()();return i.push.apply(i,_||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,a=1;a<r.length;a++){var c=r[a];0!==o[c]&&(n=!1)}n&&(i.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var n={},o={15:0},i=[];function __webpack_require__(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,__webpack_require__.nc&&a.setAttribute("nonce",__webpack_require__.nc),a.src=function(e){return __webpack_require__.p+""+({7:"chunk-googlesitekit-setup-wrapper"}[e]||e)+".js"}(e),i=function(t){a.onerror=a.onload=null,clearTimeout(c);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src,u=new Error("Loading chunk "+e+" failed.\n("+n+": "+i+")");u.type=n,u.request=i,r[1](u)}o[e]=void 0}};var c=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}return Promise.all(t)},__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var l=c;i.push([215,0,1]),r()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},12:function(e,t){e.exports=lodash},18:function(e,t){e.exports=React},215:function(e,t,r){"use strict";r.r(t);var n=r(3),o=r.n(n),i=r(4),a=r.n(i),c=r(5),u=r.n(c),l=r(6),_=r.n(l),s=r(7),p=r.n(s),d=r(1),f=r(31),m=r(26),g=(r(9),r(73),r(2)),b=r(36),w=r.n(b),k=r(10),h=r(68),v=r(21),y=function(e){function t(){return o()(this,t),u()(this,_()(t).apply(this,arguments))}return p()(t,e),a()(t,[{key:"render",value:function(){return null}}]),t}(d.Component),q=Object(v.a)("googlesitekit.ModuleApp-"+googlesitekitCurrentModule.slug)(y),E=function(e){function t(e){var r;o()(this,t),(r=u()(this,_()(t).call(this,e))).state={hasError:!1};var n=googlesitekit.setup.showModuleSetupWizard;return r.state={showModuleSetupWizard:n},r}return p()(t,e),a()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){var e=this.state,t=e.hasError,n=e.error,o=e.info,i=e.showModuleSetupWizard;if(t)return React.createElement(m.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:n.message,description:o.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"});var a=googlesitekit.admin.currentAdminPage,c=Object(k.applyFilters)("googlesitekit.moduleHasSetupWizard",!0,a);if(i&&c){window.googlesitekit&&window.googlesitekit.publicPath&&(r.p=window.googlesitekit.publicPath);var u=Object(h.b)((function(){return Promise.all([r.e(0),r.e(7)]).then(r.bind(null,172))}));return React.createElement(h.a,{fallback:React.createElement(d.Fragment,null,React.createElement("div",{className:"googlesitekit-setup"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-setup__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,null))))))))))},React.createElement(u,null))}return React.createElement(q,null)}}]),t}(d.Component);w()((function(){var e=document.getElementById("js-googlesitekit-module");e&&(Object(g.p)(),Object(d.render)(React.createElement(E,null),e),Object(k.doAction)("googlesitekit.moduleLoaded","Single",googlesitekitCurrentModule))}))},32:function(e,t){e.exports=wp.url},33:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.domReady},49:function(e,t){e.exports=ReactDOM},54:function(e,t){e.exports=wp.compose}});
dist/assets/js/googlesitekit-settings.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(t){for(var i,c,l=t[0],s=t[1],d=t[2],g=0,u=[];g<l.length;g++)c=l[g],n[c]&&u.push(n[c][0]),n[c]=0;for(i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i]);for(r&&r(t);u.length;)u.shift()();return o.push.apply(o,d||[]),a()}function a(){for(var e,t=0;t<o.length;t++){for(var a=o[t],i=!0,c=1;c<a.length;c++){var l=a[c];0!==n[l]&&(i=!1)}i&&(o.splice(t--,1),e=__webpack_require__(__webpack_require__.s=a[0]))}return e}var i={},n={14:0},o=[];function __webpack_require__(t){if(i[t])return i[t].exports;var a=i[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,__webpack_require__),a.l=!0,a.exports}__webpack_require__.m=e,__webpack_require__.c=i,__webpack_require__.d=function(e,t,a){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(__webpack_require__.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)__webpack_require__.d(a,i,function(t){return e[t]}.bind(null,i));return a},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="";var c=window.webpackJsonp=window.webpackJsonp||[],l=c.push.bind(c);c.push=t,c=c.slice();for(var s=0;s<c.length;s++)t(c[s]);var r=l;o.push([201,0,1]),a()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},11:function(e,t){e.exports=lodash},144:function(e,t,a){"use strict";var i=a(3),n=a.n(i),o=a(4),c=a.n(o),l=a(5),s=a.n(l),r=a(6),d=a.n(r),g=a(13),u=a.n(g),m=a(7),_=a.n(m),p=a(1),h=a(22),v=a(8),k=a.n(v),f=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).formFieldRef=Object(p.createRef)(),a.checkboxRef=Object(p.createRef)(),a}return _()(t,e),c()(t,[{key:"componentDidMount",value:function(){new h.e(this.formFieldRef.current).input=new h.c(this.checkboxRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onChange,a=e.id,i=e.name,n=e.value,o=e.checked,c=e.disabled,l=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-checkbox\n\t\t\t\t\t\t".concat(c?"mdc-checkbox--disabled":"","\n\t\t\t\t\t"),ref:this.checkboxRef},React.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:a,name:i,value:n,checked:o,disabled:c,onChange:t}),React.createElement("div",{className:"mdc-checkbox__background"},React.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},React.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),React.createElement("div",{className:"mdc-checkbox__mixedmark"}))),React.createElement("label",{htmlFor:a},l))}}]),t}(p.Component);f.propTypes={onChange:k.a.func.isRequired,id:k.a.string.isRequired,name:k.a.string.isRequired,value:k.a.string.isRequired,checked:k.a.bool,disabled:k.a.bool,children:k.a.node.isRequired},f.defaultProps={checked:!1,disabled:!1};var b=f,y=a(35),E=a.n(y),R=a(0),O=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).state={scriptOnPage:!!window.googlesitekitTrackingEnabled,optIn:!!window.googlesitekitTrackingEnabled,error:!1},a.handleOptIn=a.handleOptIn.bind(u()(a)),a}return _()(t,e),c()(t,[{key:"handleOptIn",value:function(e){var t=this,a=e.target.checked,i={googlesitekit_tracking_optin:a};E()({path:"/wp/v2/settings",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(i),method:"POST"}).then((function(){if(window.googlesitekitTrackingEnabled=!!a,a&&!t.state.scriptOnPage){var e=window.document;if(!e)return;e.body.insertAdjacentHTML("beforeend",'\n\t\t\t\t\t\t<script async src="https://www.googletagmanager.com/gtag/js?id='.concat(googlesitekit.admin.trackingID,'"><\/script>\n\t\t\t\t\t')),e.body.insertAdjacentHTML("beforeend","\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\t\t\tgtag('config', '".concat(googlesitekit.admin.trackingID,"');\n\t\t\t\t\t\t<\/script>\n\t\t\t\t\t"))}t.setState({optIn:!!a,error:!1,scriptOnPage:!0})})).catch((function(a){t.setState({optIn:!e.target.checked,error:{errorCode:a.code,errorMsg:a.message}})}))}},{key:"render",value:function(){var e=this.state,t=e.optIn,a=e.error,i=this.props,n=i.id,o=i.name;return React.createElement("div",{className:"googlesitekit-opt-in"},React.createElement(b,{id:n,name:o,value:"1",checked:t,onChange:this.handleOptIn},Object(R.__)("Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with ","google-site-kit"),React.createElement("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer"},Object(R.__)("Google Privacy Policy","google-site-kit")),"."),a&&React.createElement("div",{className:"googlesitekit-error-text"},a.errorMsg))}}]),t}(p.Component);O.propTypes={id:k.a.string,name:k.a.string},O.defaultProps={id:"googlesitekit-opt-in",name:"optIn"};t.a=O},146:function(e,t,a){"use strict";a.d(t,"a",(function(){return O}));var i=a(12),n=a.n(i),o=a(3),c=a.n(o),l=a(4),s=a.n(l),r=a(5),d=a.n(r),g=a(6),u=a.n(g),m=a(13),_=a.n(m),p=a(7),h=a.n(p),v=a(1),k=a(9),f=a(2),b=a(67),y=a(0),E=a(14),R=a(80),O=function(e){function t(e){var a;return c()(this,t),(a=d()(this,u()(t).call(this,e))).state={dialogActive:!1},a.handleDialog=a.handleDialog.bind(_()(a)),a.handleUnlinkConfirm=a.handleUnlinkConfirm.bind(_()(a)),a.handleCloseModal=a.handleCloseModal.bind(_()(a)),a}return h()(t,e),s()(t,[{key:"componentDidMount",value:function(){window.addEventListener("keyup",this.handleCloseModal,!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keyup",this.handleCloseModal)}},{key:"handleUnlinkConfirm",value:function(){return n.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.a.awrap(k.c.set(k.a,"site","reset"));case 2:Object(f.d)(),this.handleDialog(),document.location=Object(f.n)("googlesitekit-splash",{notification:"reset_success"});case 5:case"end":return e.stop()}}),null,this)}},{key:"handleCloseModal",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1})}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive}}))}},{key:"render",value:function(){var e=this,t=this.props.children,a=this.state.dialogActive;return React.createElement(v.Fragment,null,React.createElement(E.a,{className:"googlesitekit-reset-button",onClick:function(){return e.setState({dialogActive:!0})},inherit:!0},t||Object(y.__)("Reset Site Kit","google-site-kit")),React.createElement(R.a,null,React.createElement(b.a,{dialogActive:a,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(y.__)("Reset Site Kit","google-site-kit"),subtitle:Object(y.__)("Resetting this site will remove access to all services. After disconnecting, you will need to re-authorize your access to restore service.","google-site-kit"),confirmButton:Object(y.__)("Reset","google-site-kit"),provides:[]})))}}]),t}(v.Component)},18:function(e,t){e.exports=React},201:function(e,t,a){"use strict";a.r(t);var i=a(3),n=a.n(i),o=a(4),c=a.n(o),l=a(5),s=a.n(l),r=a(6),d=a.n(r),g=a(7),u=a.n(g),m=a(1),_=a(13),p=a.n(_),h=a(27),v=a.n(h),k=a(17),f=a(26),b=a(2),y=a(11),E=a(0),R=a(10),O=a(12),w=a.n(O),j=a(8),N=a.n(j),S=a(14),C=a(29),M=a(9),x=a(20),D=a(62),A=a(53),T=a(54),q=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).state={isSaving:!1,active:e.active},a.activateOrDeactivate=a.activateOrDeactivate.bind(p()(a)),a}return u()(t,e),c()(t,[{key:"activateOrDeactivate",value:function(){var e,t;return w.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e=this.state.active,t=this.props.slug,this.setState({isSaving:!0}),a.next=6,w.a.awrap(Object(b.a)(M.c,t,!e));case 6:return a.next=8,w.a.awrap(Object(b.u)());case 8:window.location=Object(b.m)(t,!0),a.next=15;break;case 11:a.prev=11,a.t0=a.catch(0),Object(b.w)(T.a,{id:"activate-module-error",title:Object(E.__)("Internal Server Error","google-site-kit"),description:a.t0.message,format:"small",type:"win-error"}),this.setState({isSaving:!1});case 15:case"end":return a.stop()}}),null,this,[[0,11]])}},{key:"render",value:function(){var e=this.state.isSaving,t=this.props,a=t.slug,i=t.name,n=t.description,o=t.showLink,c=!1,l=googlesitekit.modules;l[a].required.length&&l[a].required.forEach((function(e){l[e].setupComplete||(c=!0)}));return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-settings-connect-module\n\t\t\t\tgooglesitekit-settings-connect-module--".concat(a,"\n\t\t\t\t").concat(c?"googlesitekit-settings-connect-module--disabled":"","\n\t\t\t"),key:a},React.createElement("div",{className:"googlesitekit-settings-connect-module__switch"},React.createElement(D.a,{isSaving:e})),React.createElement("div",{className:"googlesitekit-settings-connect-module__logo"},c?Object(b.q)("".concat(a,"-disabled")):Object(b.q)(a)),React.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-settings-connect-module__title "},i),React.createElement("p",{className:"googlesitekit-settings-connect-module__text"},n),React.createElement(A.a,{slug:a,context:"modules-list"}),Object(R.applyFilters)("googlesitekit.SetupModuleShowLink",o,a)&&React.createElement("p",{className:"googlesitekit-settings-connect-module__cta"},React.createElement(S.a,{onClick:this.activateOrDeactivate,href:"",inherit:!0,disabled:c,arrow:!0},c?Object(E.sprintf)(Object(E.__)("Setup Analytics to gain access to %s","google-site-kit"),i):Object(E.sprintf)(Object(E.__)("Set up %s","google-site-kit"),i))))}}]),t}(m.Component);q.propTypes={slug:N.a.string,name:N.a.string,description:N.a.string,homepage:N.a.string,active:N.a.bool,onActive:N.a.func},q.defaultProps={slug:"",name:"",description:"",homepage:"",active:!1};var P=q,I=a(67),F=function(e){function t(){return n()(this,t),s()(this,d()(t).apply(this,arguments))}return u()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component),L=a(21),U=function(e){function t(){return n()(this,t),s()(this,d()(t).apply(this,arguments))}return u()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.slug;return React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(A.a,{slug:e,context:"settings"}),Object(E.__)("Setup incomplete: ","google-site-kit"),React.createElement(S.a,{className:"googlesitekit-settings-module__edit-button",onClick:function(){window.location=Object(b.m)(e,!0)},inherit:!0},Object(E.__)("continue module setup","google-site-kit")))}}]),t}(m.Component),B=Object(L.a)("googlesitekit.ModuleSetupIncomplete")(U),K=function(e){function t(){return n()(this,t),s()(this,d()(t).apply(this,arguments))}return u()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.compress;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-overlay\n\t\t\t\t".concat(e?"googlesitekit-overlay--compress":"","\n\t\t\t")},React.createElement("div",{className:"googlesitekit-overlay__wrapper"},React.createElement("div",{className:"googlesitekit-overlay__icon"},React.createElement(x.a,{id:"lock",width:"22",height:"30"})),React.createElement("h3",{className:" googlesitekit-heading-2 googlesitekit-overlay__title "},Object(E.__)("Section locked while editing","google-site-kit"))))}}]),t}(m.Component);K.propTypes={compress:N.a.bool},K.defaultProps={compress:!1};var G=K,H=function(e){function t(e){var a;n()(this,t),a=s()(this,d()(t).call(this,e));var i=e.slug,o=googlesitekit.modules[i].setupComplete;return a.state={isSaving:!1,active:e.active,setupComplete:o,dialogActive:!1},a.deactivate=a.deactivate.bind(p()(a)),a.activateOrDeactivate=a.activateOrDeactivate.bind(p()(a)),a.handleDialog=a.handleDialog.bind(p()(a)),a.handleCloseModal=a.handleCloseModal.bind(p()(a)),a.handleConfirmRemoveModule=a.handleConfirmRemoveModule.bind(p()(a)),a}return u()(t,e),c()(t,[{key:"componentDidMount",value:function(){window.addEventListener("keyup",this.handleCloseModal,!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keyup",this.handleCloseModal)}},{key:"activateOrDeactivate",value:function(){var e,t;return w.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e=this.state.active,t=!e,this.setState({isSaving:!0}),a.next=6,w.a.awrap(Object(b.a)(M.c,this.props.slug,t));case 6:return a.next=8,w.a.awrap(Object(b.u)());case 8:!1===t&&M.c.invalidateCacheGroup(M.b,this.props.slug),this.setState({isSaving:!1,active:t}),window.location=Object(b.m)(this.props.slug,!1),a.next=17;break;case 13:a.prev=13,a.t0=a.catch(0),Object(b.w)(T.a,{id:"activate-module-error",title:Object(E.__)("Internal Server Error","google-site-kit"),description:a.t0.message,format:"small",type:"win-error"}),this.setState({isSaving:!1});case 17:case"end":return a.stop()}}),null,this,[[0,13]])}},{key:"deactivate",value:function(){this.props.autoActivate||this.activateOrDeactivate()}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive}}))}},{key:"handleConfirmRemoveModule",value:function(){this.deactivate()}},{key:"handleCloseModal",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1})}},{key:"getDependentModules",value:function(){var e=this.props.slug,t=googlesitekit.modules,a={};return t[e].dependants&&t[e].dependants.forEach((function(e){t[e]&&(a[e]=t[e])})),a}},{key:"render",value:function(){var e=this.state,t=e.active,a=e.setupComplete,i=e.dialogActive,n=this.props,o=n.name,c=n.slug,l=n.homepage,s=n.isEditing,r=n.isOpen,d=n.handleAccordion,g=n.handleEdit,u=n.description,_=n.hasSettings,p=n.autoActivate,h=n.provides,v=n.isSaving,k=n.screenID,f=n.error,O="".concat(c,"-module"),w=Object(R.applyFilters)("googlesitekit.Connected-".concat(c),a),j=w?"googlesitekit-settings-module__status-icon--connected":"googlesitekit-settings-module__status-icon--not-connected",N=Object(E.sprintf)(Object(E.__)("By disconnecting the %s module from Site Kit, you will no longer have access to:","google-site-kit"),o),M=v==="".concat(c,"-module"),A=Object(L.a)("googlesitekit.ModuleSettingsDetails-".concat(c))(F),T=0<Object(y.filter)(s,(function(e){return e})).length,q=Object(y.map)(this.getDependentModules(),"name").join(", "),U="pagespeed-insights"===c,K=Object(E.__)("Close","google-site-kit");return _&&a&&(M?K=Object(E.__)("Saving...","google-site-kit"):!1===U&&(K=Object(E.__)("Confirm Changes","google-site-kit"))),React.createElement(m.Fragment,null,t?React.createElement("div",{className:"\n\t\t\t\t\t\t\tgooglesitekit-settings-module\n\t\t\t\t\t\t\tgooglesitekit-settings-module--".concat(c,"\n\t\t\t\t\t\t\tgooglesitekit-settings-module--active\n\t\t\t\t\t\t\t").concat(f&&T&&s[O]?"googlesitekit-settings-module--error":"","\n\t\t\t\t\t\t"),key:O},T&&!s[O]&&React.createElement(G,{compress:!r}),React.createElement("button",{className:"\n\t\t\t\t\t\t\t\tgooglesitekit-settings-module__header\n\t\t\t\t\t\t\t\t".concat(r?"googlesitekit-settings-module__header--open":"","\n\t\t\t\t\t\t\t"),id:"googlesitekit-settings-module__header--".concat(c),type:"button",role:"tab","aria-selected":!!r,"aria-expanded":!!r,"aria-controls":"googlesitekit-settings-module__content--".concat(c),onClick:d.bind(null,c)},f&&T&&s[O]&&React.createElement("div",{className:"googlesitekit-settings-module__error"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},Object(E.__)("Error:","google-site-kit")," ",f.errorMsg)))),React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement("h3",{className:" googlesitekit-heading-4 googlesitekit-settings-module__title "},Object(b.q)(c,!1,"24","26","googlesitekit-settings-module__title-icon"),o)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "},React.createElement("p",{className:"googlesitekit-settings-module__status"},w?Object(E.sprintf)(Object(E.__)("%s is connected","google-site-kit"),o):Object(E.sprintf)(Object(E.__)("%s is not connected","google-site-kit"),o),React.createElement("span",{className:"googlesitekit-settings-module__status-icon ".concat(j," ")},React.createElement("span",{className:"screen-reader-text"},w?Object(E.__)("Connected","google-site-kit"):Object(E.__)("Not Connected","google-site-kit")))))))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tgooglesitekit-settings-module__content\n\t\t\t\t\t\t\t\t".concat(r?"googlesitekit-settings-module__content--open":"","\n\t\t\t\t\t\t\t"),id:"googlesitekit-settings-module__content--".concat(c),role:"tabpanel","aria-hidden":!r,"aria-labelledby":"googlesitekit-settings-module__header--".concat(c)},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},a&&React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(A,{module:O,isEditing:s[O],isOpen:r}))),_&&!a&&React.createElement(B,{screenID:k,slug:c}))),React.createElement("footer",{className:"googlesitekit-settings-module__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},s[O]||M?React.createElement(m.Fragment,null,React.createElement(C.a,{onClick:function(){return g(O,a?"confirm":"cancel",U)},disabled:M,id:_&&a?"confirm-changes-".concat(c):"close-".concat(c)},K),React.createElement(D.a,{isSaving:M}),_&&React.createElement(S.a,{className:"googlesitekit-settings-module__footer-cancel",onClick:function(){return g(O,"cancel")},inherit:!0},Object(E.__)("Cancel","google-site-kit"))):_&&React.createElement(S.a,{className:"googlesitekit-settings-module__edit-button",onClick:function(){g(O,"edit")},inherit:!0},Object(E.__)("Edit","google-site-kit"),React.createElement(x.a,{className:"googlesitekit-settings-module__edit-button-icon",id:"pencil",width:"10",height:"10"}))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-desktop "},s[O]&&!p&&React.createElement(S.a,{className:"googlesitekit-settings-module__remove-button",onClick:this.handleDialog,inherit:!0,danger:!0},Object(E.sprintf)(Object(E.__)("Disconnect %s from Site Kit","google-site-kit"),o),React.createElement(x.a,{className:"googlesitekit-settings-module__remove-button-icon",id:"trash",width:"13",height:"13"})),!s[O]&&React.createElement(S.a,{href:l,className:"googlesitekit-settings-module__cta-button",inherit:!0,external:!0},Object(E.sprintf)(Object(E.__)("See full details in %s","google-site-kit"),o))))))),React.createElement(I.a,{dialogActive:i,handleDialog:this.handleDialog,title:Object(E.sprintf)(Object(E.__)("Disconnect %s from Site Kit?","google-site-kit"),o),subtitle:N,onKeyPress:this.handleCloseModal,provides:h,handleConfirm:this.handleConfirmRemoveModule,dependentModules:!!q&&Object(E.sprintf)(Object(E.__)("these active modules depend on %s and will also be disconnected: ","google-site-kit"),o)+q})):React.createElement(m.Fragment,null,React.createElement(P,{key:"".concat(c,"-module"),slug:c,name:o,description:u,active:t,showLink:!0})))}}]),t}(m.Component);H.propTypes={name:N.a.string,slug:N.a.string,homepage:N.a.string,isEditing:N.a.object,handleEdit:N.a.func,handleDialog:N.a.func,autoActivate:N.a.bool,hasSettings:N.a.bool,required:N.a.array,active:N.a.bool},H.defaultProps={name:"",slug:"",homepage:"",isEditing:{},handleEdit:null,handleDialog:null,active:!1};var J=H;function W(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function z(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?W(a,!0).forEach((function(t){v()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):W(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var Q=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).state={error:!1,isEditing:{},openModules:{},isSaving:!1},a.mapToModule=a.mapToModule.bind(p()(a)),a.updateModulesList=a.updateModulesList.bind(p()(a)),a.handleButtonAction=a.handleButtonAction.bind(p()(a)),a.handleAccordion=a.handleAccordion.bind(p()(a)),a}return u()(t,e),c()(t,[{key:"componentDidMount",value:function(){googlesitekit.editmodule&&googlesitekit.modules[googlesitekit.editmodule].active&&this.handleButtonAction("".concat(googlesitekit.editmodule,"-module"),"edit")}},{key:"updateModulesList",value:function(){this.forceUpdate()}},{key:"handleAccordion",value:function(e,t){t.target.closest(".googlesitekit-settings-module__header").focus(),this.setState((function(t){return{openModules:v()({},e,!t.openModules[e])}}))}},{key:"handleButtonAction",value:function(e,t){var a=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("confirm"===t){var n=Object(R.applyFilters)("googlekit.SettingsConfirmed",!1,e);if(i)return void this.setState((function(t){return{isSaving:!1,error:!1,isEditing:z({},t.isEditing,v()({},e,!t.isEditing[e]))}}));if(this.setState({isSaving:e}),!n)return void Object(b.d)();n.then((function(){Object(b.d)(),a.setState((function(t){return{isSaving:!1,error:!1,isEditing:z({},t.isEditing,v()({},e,!t.isEditing[e]))}}))})).catch((function(e){a.setState({isSaving:!1,error:{errorCode:e.code,errorMsg:e.message}})}))}else this.setState((function(t){return{isEditing:z({},t.isEditing,v()({},e,!t.isEditing[e])),error:!1}}))}},{key:"settingsModuleComponent",value:function(e,t){var a=googlesitekit.modules[e.slug].provides,i=this.state,n=i.isEditing,o=i.openModules,c=i.error,l=o[e.slug]||!1;return React.createElement(J,{key:e.slug+"-module",slug:e.slug,name:e.name,description:e.description,homepage:e.homepage,learnmore:e.learnMore,active:e.active,hasSettings:e.hasSettings,autoActivate:e.autoActivate,updateModulesList:this.updateModulesList,handleEdit:this.handleButtonAction,handleConfirm:!0,isEditing:n,isOpen:l,handleAccordion:this.handleAccordion,handleDialog:this.handleDialog,provides:a,isSaving:t,screenID:e.screenID,error:c})}},{key:"mapToModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=this.state.isSaving;return t?Object(y.map)(e,function(e){return React.createElement(m.Fragment,{key:e.slug+"-module-wrapper"},this.settingsModuleComponent(e,a))}.bind(this)):Object(y.map)(e,function(e){return React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-4",key:e.slug+"-module-wrapper"},this.settingsModuleComponent(e,a))}.bind(this))}},{key:"render",value:function(){var e=this.state.isEditing,t=this.props.activeTab,a=0<Object(y.filter)(e,(function(e){return e})).length;if(!window.googlesitekit||!window.googlesitekit.modules)return null;var i=Object(y.filter)(window.googlesitekit.modules,(function(e){return!e.internal})),n=this.mapToModule(Object(y.sortBy)(Object(y.filter)(i,(function(e){return e.active})),"sort"),!0),o=this.mapToModule(Object(y.sortBy)(Object(y.filter)(i,{active:!1}),"sort")),c=0<o.length;return React.createElement(m.Fragment,null,0<n.length&&0===t&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,null,n)),1===t&&c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,{header:!0,title:Object(E.__)("Connect More Services to Gain More Insights","google-site-kit"),relative:!0},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},0<o.length&&o)),a&&React.createElement(G,null))),1===t&&!c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{id:"no-more-modules",title:Object(E.__)("Congrats, you’ve connected all services!","google-site-kit"),description:Object(E.__)("We’re working on adding new services to Site Kit by Google all the time, so please check back in the future.","google-site-kit"),format:"small",smallImage:"".concat(googlesitekit.admin.assetsRoot,"images/thumbs-up.png"),type:"win-success"})))}}]),t}(m.Component),V=a(44),X=a(47),Y=a(70),Z=a.n(Y),$=a(167),ee=a.n($),te=a(144),ae=a(146),ie=function(e){function t(){var e;n()(this,t),e=s()(this,d()(t).call(this));var a=googlesitekit.admin.userData,i=a.email,o=void 0===i?"":i,c=a.picture,l=void 0===c?"":c,r=a.name,g=void 0===r?"":r;return e.state={data:{email:o,img:l,user:g}},e}return u()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,null,React.createElement("div",{className:" googlesitekit-settings-module googlesitekit-settings-module--active "},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement("h3",{className:" googlesitekit-heading-4 googlesitekit-settings-module__title "},Object(E.__)("Plugin Status","google-site-kit"))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "}),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("p",{className:"googlesitekit-settings-module__status"},Object(E.__)("Site Kit is connected","google-site-kit"),React.createElement("span",{className:" googlesitekit-settings-module__status-icon googlesitekit-settings-module__status-icon--connected "},React.createElement("span",{className:"screen-reader-text"},Object(E.__)("Connected","google-site-kit")))))))),React.createElement("footer",{className:"googlesitekit-settings-module__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(ae.a,null)))))))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,{header:!0,title:Object(E.__)("Tracking","google-site-kit"),className:"googlesitekit-settings-meta",fill:!0},React.createElement("div",{className:" googlesitekit-settings-module googlesitekit-settings-module--active "},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item googlesitekit-settings-module__meta-item--nomargin "},React.createElement(te.a,null))))))))))}}]),t}(m.Component),ne=a(43),oe=function(e){function t(e){var a;n()(this,t),a=s()(this,d()(t).call(this,e));var i=window.location.hash.replace("#","");return a.state={activeTab:i?Number(i):0},a.handleTabUpdate=a.handleTabUpdate.bind(p()(a)),a}return u()(t,e),c()(t,[{key:"handleTabUpdate",value:function(e){var t=-1===e?0:e;window.location.hash=t,this.setState({activeTab:t})}},{key:"render",value:function(){var e=this.state.activeTab;return React.createElement(m.Fragment,null,React.createElement(V.a,null),React.createElement("div",{className:"googlesitekit-module-page"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(X.a,{title:Object(E.__)("Settings","google-site-kit")})),React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(k.a,null,React.createElement(ee.a,{activeIndex:e,handleActiveIndexUpdate:this.handleTabUpdate},React.createElement(Z.a,null,React.createElement("span",{className:"mdc-tab__text-label"},Object(E.__)("Connected Services","google-site-kit"))),React.createElement(Z.a,null,React.createElement("span",{className:"mdc-tab__text-label"},Object(E.__)("Connect More Services","google-site-kit"))),React.createElement(Z.a,null,React.createElement("span",{className:"mdc-tab__text-label"},Object(E.__)("Admin Settings","google-site-kit")))))),(0===e||1===e)&&React.createElement(Q,{activeTab:e}),2===e&&React.createElement(m.Fragment,null,React.createElement(ie,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(ne.a,null))))))}}]),t}(m.Component),ce=a(39),le=a.n(ce),se=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).state={hasError:!1},Object(E.setLocaleData)(googlesitekit.locale,"google-site-kit"),a}return u()(t,e),c()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){var e=this.state,t=e.hasError,a=e.error,i=e.info;return t?React.createElement(f.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:a,description:i.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(oe,null)}}]),t}(m.Component);le()((function(){var e=document.getElementById("googlesitekit-settings-wrapper");null!==e&&(Object(m.render)(React.createElement(se,null),e),Object(R.doAction)("googlesitekit.moduleLoaded","Settings"))}))},35:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.url},39:function(e,t){e.exports=wp.domReady},50:function(e,t){e.exports=ReactDOM},59:function(e,t){e.exp