(globalThis["__googlesitekit_webpackJsonp"] = globalThis["__googlesitekit_webpackJsonp"] || []).push([["googlesitekit-vendor-lazy-pdf"],{

/***/ "./svg/icons/audience-metric-icon-cities.svg?pdf"
/*!*******************************************************!*\
  !*** ./svg/icons/audience-metric-icon-cities.svg?pdf ***!
  \*******************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAudienceMetricIconCities = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 20 20"
}, props), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
  fill: props.color,
  d: "M10.0003 18.3332C9.80588 18.3332 9.63921 18.2776 9.50033 18.1665C9.36144 18.0554 9.25727 17.9096 9.18783 17.729C8.92394 16.9512 8.5906 16.2221 8.18783 15.5415C7.79894 14.8609 7.25033 14.0623 6.54199 13.1457C5.83366 12.229 5.25727 11.354 4.81283 10.5207C4.38227 9.68734 4.16699 8.68039 4.16699 7.49984C4.16699 5.87484 4.72949 4.49984 5.85449 3.37484C6.99338 2.23595 8.37533 1.6665 10.0003 1.6665C11.6253 1.6665 13.0003 2.23595 14.1253 3.37484C15.2642 4.49984 15.8337 5.87484 15.8337 7.49984C15.8337 8.76373 15.5906 9.81928 15.1045 10.6665C14.6323 11.4998 14.0837 12.3262 13.4587 13.1457C12.7087 14.1457 12.1392 14.979 11.7503 15.6457C11.3753 16.2984 11.0628 16.9929 10.8128 17.729C10.7434 17.9234 10.6323 18.0762 10.4795 18.1873C10.3406 18.2846 10.1809 18.3332 10.0003 18.3332ZM10.0003 15.354C10.2364 14.8818 10.5003 14.4165 10.792 13.9582C11.0975 13.4998 11.542 12.8887 12.1253 12.1248C12.7225 11.3471 13.2087 10.6318 13.5837 9.979C13.9725 9.31234 14.167 8.48595 14.167 7.49984C14.167 6.34706 13.7573 5.36789 12.9378 4.56234C12.1323 3.74289 11.1531 3.33317 10.0003 3.33317C8.84755 3.33317 7.86144 3.74289 7.04199 4.56234C6.23644 5.36789 5.83366 6.34706 5.83366 7.49984C5.83366 8.48595 6.02116 9.31234 6.39616 9.979C6.78505 10.6318 7.2781 11.3471 7.87533 12.1248C8.45866 12.8887 8.89616 13.4998 9.18783 13.9582C9.49338 14.4165 9.76421 14.8818 10.0003 15.354ZM10.0003 9.58317C10.5837 9.58317 11.0767 9.38178 11.4795 8.979C11.8823 8.57623 12.0837 8.08317 12.0837 7.49984C12.0837 6.9165 11.8823 6.42345 11.4795 6.02067C11.0767 5.61789 10.5837 5.4165 10.0003 5.4165C9.41699 5.4165 8.92394 5.61789 8.52116 6.02067C8.11838 6.42345 7.91699 6.9165 7.91699 7.49984C7.91699 8.08317 8.11838 8.57623 8.52116 8.979C8.92394 9.38178 9.41699 9.58317 10.0003 9.58317Z"
}));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceMetricIconCities);

/***/ },

/***/ "./svg/icons/audience-metric-icon-pages-per-visit.svg?pdf"
/*!****************************************************************!*\
  !*** ./svg/icons/audience-metric-icon-pages-per-visit.svg?pdf ***!
  \****************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAudienceMetricIconPagesPerVisit = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 20 20"
}, props), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
  fill: props.color,
  d: "M13.1253 16.6668H3.33366C2.87533 16.6668 2.47949 16.5071 2.14616 16.1877C1.82671 15.8543 1.66699 15.4585 1.66699 15.0002V5.00016C1.66699 4.54183 1.82671 4.15294 2.14616 3.8335C2.47949 3.50016 2.87533 3.3335 3.33366 3.3335H16.667C17.1253 3.3335 17.5142 3.50016 17.8337 3.8335C18.167 4.15294 18.3337 4.54183 18.3337 5.00016V15.0002C18.3337 15.4585 18.167 15.8543 17.8337 16.1877C17.5142 16.5071 17.1253 16.6668 16.667 16.6668H15.5003L11.5837 12.7502C11.292 12.9446 10.9725 13.0904 10.6253 13.1877C10.292 13.2849 9.94477 13.3335 9.58366 13.3335C8.54199 13.3335 7.6531 12.9724 6.91699 12.2502C6.19477 11.5141 5.83366 10.6252 5.83366 9.5835C5.83366 8.54183 6.19477 7.65988 6.91699 6.93766C7.6531 6.20155 8.54199 5.8335 9.58366 5.8335C10.6253 5.8335 11.5073 6.20155 12.2295 6.93766C12.9656 7.65988 13.3337 8.54183 13.3337 9.5835C13.3337 9.9585 13.285 10.3127 13.1878 10.646C13.0906 10.9793 12.9448 11.2918 12.7503 11.5835L16.167 15.0002H16.667V5.00016H3.33366V15.0002H11.4587L13.1253 16.6668ZM9.58366 11.6668C10.167 11.6668 10.66 11.4654 11.0628 11.0627C11.4656 10.6599 11.667 10.1668 11.667 9.5835C11.667 9.00016 11.4656 8.50711 11.0628 8.10433C10.66 7.70155 10.167 7.50016 9.58366 7.50016C9.00033 7.50016 8.50727 7.70155 8.10449 8.10433C7.70171 8.50711 7.50033 9.00016 7.50033 9.5835C7.50033 10.1668 7.70171 10.6599 8.10449 11.0627C8.50727 11.4654 9.00033 11.6668 9.58366 11.6668ZM3.33366 15.0002V5.00016V15.0002Z"
}));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceMetricIconPagesPerVisit);

/***/ },

/***/ "./svg/icons/audience-metric-icon-pageviews.svg?pdf"
/*!**********************************************************!*\
  !*** ./svg/icons/audience-metric-icon-pageviews.svg?pdf ***!
  \**********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAudienceMetricIconPageviews = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 20 20"
}, props), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
  fill: props.color,
  d: "M4.16667 17.5C3.70833 17.5 3.3125 17.3403 2.97917 17.0208C2.65972 16.6875 2.5 16.2917 2.5 15.8333V4.16667C2.5 3.70833 2.65972 3.31945 2.97917 3C3.3125 2.66667 3.70833 2.5 4.16667 2.5H15.8333C16.2917 2.5 16.6806 2.66667 17 3C17.3333 3.31945 17.5 3.70833 17.5 4.16667V15.8333C17.5 16.2917 17.3333 16.6875 17 17.0208C16.6806 17.3403 16.2917 17.5 15.8333 17.5H4.16667ZM4.16667 15.8333H15.8333V5.83333H4.16667V15.8333ZM10 14.1667C8.86111 14.1667 7.84028 13.8611 6.9375 13.25C6.04861 12.625 5.40278 11.8194 5 10.8333C5.40278 9.84722 6.04861 9.04861 6.9375 8.4375C7.84028 7.8125 8.86111 7.5 10 7.5C11.1389 7.5 12.1528 7.8125 13.0417 8.4375C13.9444 9.04861 14.5972 9.84722 15 10.8333C14.5972 11.8194 13.9444 12.625 13.0417 13.25C12.1528 13.8611 11.1389 14.1667 10 14.1667ZM10 12.9167C10.7778 12.9167 11.4861 12.7361 12.125 12.375C12.7639 12 13.2639 11.4861 13.625 10.8333C13.2639 10.1806 12.7639 9.67361 12.125 9.3125C11.4861 8.9375 10.7778 8.75 10 8.75C9.22222 8.75 8.51389 8.9375 7.875 9.3125C7.23611 9.67361 6.73611 10.1806 6.375 10.8333C6.73611 11.4861 7.23611 12 7.875 12.375C8.51389 12.7361 9.22222 12.9167 10 12.9167ZM10 12.0833C9.65278 12.0833 9.35417 11.9653 9.10417 11.7292C8.86806 11.4792 8.75 11.1806 8.75 10.8333C8.75 10.4861 8.86806 10.1944 9.10417 9.95833C9.35417 9.70833 9.65278 9.58333 10 9.58333C10.3472 9.58333 10.6389 9.70833 10.875 9.95833C11.125 10.1944 11.25 10.4861 11.25 10.8333C11.25 11.1806 11.125 11.4792 10.875 11.7292C10.6389 11.9653 10.3472 12.0833 10 12.0833Z"
}));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceMetricIconPageviews);

/***/ },

/***/ "./svg/icons/audience-metric-icon-top-content.svg?pdf"
/*!************************************************************!*\
  !*** ./svg/icons/audience-metric-icon-top-content.svg?pdf ***!
  \************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAudienceMetricIconTopContent = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 20 20"
}, props), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
  fill: props.color,
  d: "M3.33366 16.6668C2.87533 16.6668 2.47949 16.5071 2.14616 16.1877C1.82671 15.8543 1.66699 15.4585 1.66699 15.0002V5.00016C1.66699 4.54183 1.82671 4.15294 2.14616 3.8335C2.47949 3.50016 2.87533 3.3335 3.33366 3.3335H16.667C17.1253 3.3335 17.5142 3.50016 17.8337 3.8335C18.167 4.15294 18.3337 4.54183 18.3337 5.00016V15.0002C18.3337 15.4585 18.167 15.8543 17.8337 16.1877C17.5142 16.5071 17.1253 16.6668 16.667 16.6668H3.33366ZM3.33366 15.0002H12.0837V12.0835H3.33366V15.0002ZM13.7503 15.0002H16.667V7.50016H13.7503V15.0002ZM3.33366 10.4168H12.0837V7.50016H3.33366V10.4168Z"
}));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceMetricIconTopContent);

/***/ },

/***/ "./svg/icons/audience-metric-icon-visitors.svg?pdf"
/*!*********************************************************!*\
  !*** ./svg/icons/audience-metric-icon-visitors.svg?pdf ***!
  \*********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAudienceMetricIconVisitors = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 20 20"
}, props), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
  fill: props.color,
  d: "M0.833008 16.6668V14.3335C0.833008 13.8613 0.951063 13.4307 1.18717 13.0418C1.43717 12.6391 1.76356 12.3335 2.16634 12.1252C3.02745 11.6946 3.90245 11.3752 4.79134 11.1668C5.68023 10.9446 6.58301 10.8335 7.49967 10.8335C8.41634 10.8335 9.31912 10.9446 10.208 11.1668C11.0969 11.3752 11.9719 11.6946 12.833 12.1252C13.2358 12.3335 13.5552 12.6391 13.7913 13.0418C14.0413 13.4307 14.1663 13.8613 14.1663 14.3335V16.6668H0.833008ZM15.833 16.6668V14.1668C15.833 13.5557 15.6594 12.9724 15.3122 12.4168C14.9788 11.8474 14.4997 11.3613 13.8747 10.9585C14.583 11.0418 15.2497 11.1877 15.8747 11.396C16.4997 11.5904 17.083 11.8335 17.6247 12.1252C18.1247 12.4029 18.5066 12.7154 18.7705 13.0627C19.0344 13.396 19.1663 13.7641 19.1663 14.1668V16.6668H15.833ZM7.49967 10.0002C6.58301 10.0002 5.79829 9.67377 5.14551 9.021C4.49273 8.36822 4.16634 7.5835 4.16634 6.66683C4.16634 5.75016 4.49273 4.96544 5.14551 4.31266C5.79829 3.65989 6.58301 3.3335 7.49967 3.3335C8.41634 3.3335 9.20106 3.65989 9.85384 4.31266C10.5066 4.96544 10.833 5.75016 10.833 6.66683C10.833 7.5835 10.5066 8.36822 9.85384 9.021C9.20106 9.67377 8.41634 10.0002 7.49967 10.0002ZM15.833 6.66683C15.833 7.5835 15.5066 8.36822 14.8538 9.021C14.2011 9.67377 13.4163 10.0002 12.4997 10.0002C12.3469 10.0002 12.1525 9.98627 11.9163 9.9585C11.6802 9.91683 11.4858 9.87516 11.333 9.8335C11.708 9.38905 11.9927 8.896 12.1872 8.35433C12.3955 7.81266 12.4997 7.25016 12.4997 6.66683C12.4997 6.0835 12.3955 5.521 12.1872 4.97933C11.9927 4.43766 11.708 3.94461 11.333 3.50016C11.5275 3.43072 11.7219 3.38905 11.9163 3.37516C12.1108 3.34738 12.3052 3.3335 12.4997 3.3335C13.4163 3.3335 14.2011 3.65989 14.8538 4.31266C15.5066 4.96544 15.833 5.75016 15.833 6.66683ZM2.49967 15.0002H12.4997V14.3335C12.4997 14.1807 12.458 14.0418 12.3747 13.9168C12.3052 13.7918 12.208 13.6946 12.083 13.6252C11.333 13.2502 10.5761 12.9724 9.81217 12.7918C9.04829 12.5974 8.27745 12.5002 7.49967 12.5002C6.7219 12.5002 5.95106 12.5974 5.18717 12.7918C4.42329 12.9724 3.66634 13.2502 2.91634 13.6252C2.79134 13.6946 2.68717 13.7918 2.60384 13.9168C2.5344 14.0418 2.49967 14.1807 2.49967 14.3335V15.0002ZM7.49967 8.3335C7.95801 8.3335 8.3469 8.17377 8.66634 7.85433C8.99967 7.521 9.16634 7.12516 9.16634 6.66683C9.16634 6.2085 8.99967 5.81961 8.66634 5.50016C8.3469 5.16683 7.95801 5.00016 7.49967 5.00016C7.04134 5.00016 6.64551 5.16683 6.31217 5.50016C5.99273 5.81961 5.83301 6.2085 5.83301 6.66683C5.83301 7.12516 5.99273 7.521 6.31217 7.85433C6.64551 8.17377 7.04134 8.3335 7.49967 8.3335Z"
}));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceMetricIconVisitors);

/***/ },

/***/ "./svg/icons/audience-metric-icon-visits-per-visitor.svg?pdf"
/*!*******************************************************************!*\
  !*** ./svg/icons/audience-metric-icon-visits-per-visitor.svg?pdf ***!
  \*******************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAudienceMetricIconVisitsPerVisitor = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 20 20"
}, props), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
  fill: props.color,
  d: "M10 17.5C8.95833 17.5 7.97917 17.3056 7.0625 16.9167C6.15972 16.5139 5.36806 15.9792 4.6875 15.3125C4.02083 14.6319 3.48611 13.8403 3.08333 12.9375C2.69444 12.0208 2.5 11.0417 2.5 10C2.5 8.95833 2.69444 7.98611 3.08333 7.08333C3.48611 6.16667 4.02083 5.375 4.6875 4.70833C5.36806 4.02778 6.15972 3.49306 7.0625 3.10417C7.97917 2.70139 8.95833 2.5 10 2.5C11.1389 2.5 12.2153 2.74306 13.2292 3.22917C14.2569 3.71528 15.125 4.40278 15.8333 5.29167V3.33333H17.5V8.33333H12.5V6.66667H14.7917C14.2222 5.88889 13.5208 5.27778 12.6875 4.83333C11.8542 4.38889 10.9583 4.16667 10 4.16667C8.375 4.16667 6.99306 4.73611 5.85417 5.875C4.72917 7 4.16667 8.375 4.16667 10C4.16667 11.625 4.72917 13.0069 5.85417 14.1458C6.99306 15.2708 8.375 15.8333 10 15.8333C11.4583 15.8333 12.7292 15.3611 13.8125 14.4167C14.9097 13.4722 15.5556 12.2778 15.75 10.8333H17.4583C17.25 12.7361 16.4306 14.3264 15 15.6042C13.5833 16.8681 11.9167 17.5 10 17.5ZM12.3333 13.5L9.16667 10.3333V5.83333H10.8333V9.66667L13.5 12.3333L12.3333 13.5Z"
}));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceMetricIconVisitsPerVisitor);

/***/ },

/***/ "./svg/icons/chevron-right.svg?pdf"
/*!*****************************************!*\
  !*** ./svg/icons/chevron-right.svg?pdf ***!
  \*****************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgChevronRight = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 10 10"
}, props), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
  fill: props.color,
  d: "M3.34374 9.16666L2.60416 8.42708L6.03124 5L2.60416 1.57291L3.34374 0.833328L7.51041 5L3.34374 9.16666Z"
}));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgChevronRight);

/***/ },

/***/ "./svg/icons/nav-content-icon.svg?pdf"
/*!********************************************!*\
  !*** ./svg/icons/nav-content-icon.svg?pdf ***!
  \********************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
var _Path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgNavContentIcon = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: props.color,
  viewBox: "0 0 20 20"
}, props), _Path || (_Path = /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
  d: "M10.953 8.464h2.12c.22 0 .41-.081.573-.243a.785.785 0 0 0 .243-.574.782.782 0 0 0-.243-.573.782.782 0 0 0-.574-.244h-2.12a.785.785 0 0 0-.573.244.784.784 0 0 0-.243.573c0 .22.081.412.243.574a.787.787 0 0 0 .574.243Zm0 4.706h2.12c.22 0 .41-.082.573-.244a.782.782 0 0 0 .243-.573.785.785 0 0 0-.243-.574.784.784 0 0 0-.574-.243h-2.12c-.22 0-.41.081-.573.243a.787.787 0 0 0-.243.574c0 .22.081.411.243.573a.785.785 0 0 0 .574.244ZM6.79 9.32h1.712c.22 0 .411-.082.573-.244a.782.782 0 0 0 .244-.573V6.79a.782.782 0 0 0-.244-.573.784.784 0 0 0-.573-.243H6.79a.784.784 0 0 0-.573.243.784.784 0 0 0-.243.573v1.712c0 .22.081.411.243.573a.782.782 0 0 0 .573.244Zm0 4.704h1.712c.22 0 .411-.08.573-.242a.782.782 0 0 0 .244-.573v-1.712a.782.782 0 0 0-.244-.573.782.782 0 0 0-.573-.244H6.79a.782.782 0 0 0-.573.244.784.784 0 0 0-.243.573v1.712c0 .22.081.411.243.573a.784.784 0 0 0 .573.242ZM4.633 17c-.453 0-.839-.159-1.157-.476A1.577 1.577 0 0 1 3 15.367V4.633c0-.453.159-.839.476-1.157A1.577 1.577 0 0 1 4.633 3h10.734c.453 0 .839.159 1.157.476.317.318.476.704.476 1.157v10.734c0 .453-.159.839-.476 1.157a1.578 1.578 0 0 1-1.157.476H4.633Zm0-1.633h10.734V4.633H4.633v10.734Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNavContentIcon);

/***/ },

/***/ "./svg/icons/nav-key-metrics-icon.svg?pdf"
/*!************************************************!*\
  !*** ./svg/icons/nav-key-metrics-icon.svg?pdf ***!
  \************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
var _Rect, _Rect2, _Rect3, _Rect4;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgNavKeyMetricsIcon = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: props.color,
  viewBox: "0 0 20 20"
}, props), _Rect || (_Rect = /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Rect, {
  width: 5.833,
  height: 5.833,
  x: 3,
  y: 3,
  rx: 1.167
})), _Rect2 || (_Rect2 = /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Rect, {
  width: 5.833,
  height: 5.833,
  x: 11.167,
  y: 3,
  rx: 1.167
})), _Rect3 || (_Rect3 = /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Rect, {
  width: 5.833,
  height: 5.833,
  x: 3,
  y: 11.167,
  rx: 1.167
})), _Rect4 || (_Rect4 = /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Rect, {
  width: 5.833,
  height: 5.833,
  x: 11.167,
  y: 11.167,
  rx: 1.167
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNavKeyMetricsIcon);

/***/ },

/***/ "./svg/icons/nav-monetization-icon.svg?pdf"
/*!*************************************************!*\
  !*** ./svg/icons/nav-monetization-icon.svg?pdf ***!
  \*************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
var _Path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgNavMonetizationIcon = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: props.color,
  viewBox: "0 0 20 20"
}, props), _Path || (_Path = /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
  d: "M2.313 14.375a.836.836 0 0 1-.25-.615c0-.243.083-.447.25-.614l3.75-3.75c.5-.5 1.1-.75 1.803-.75.7 0 1.295.25 1.78.75l.958.958a.777.777 0 0 0 .574.229c.229 0 .42-.076.572-.229l3.604-3.604h-1.228a.843.843 0 0 1-.615-.26.843.843 0 0 1-.26-.615.84.84 0 0 1 .26-.615.843.843 0 0 1 .615-.26h3.333c.236 0 .44.087.614.26a.84.84 0 0 1 .26.615v3.333a.843.843 0 0 1-.26.615.843.843 0 0 1-.614.26.84.84 0 0 1-.614-.26.841.841 0 0 1-.261-.615V7.979l-3.625 3.604c-.5.5-1.101.75-1.803.75-.7 0-1.295-.25-1.78-.75l-.98-.979a.752.752 0 0 0-.552-.229.748.748 0 0 0-.551.229L3.52 14.375a.823.823 0 0 1-.603.25.824.824 0 0 1-.606-.25Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNavMonetizationIcon);

/***/ },

/***/ "./svg/icons/nav-speed-icon.svg?pdf"
/*!******************************************!*\
  !*** ./svg/icons/nav-speed-icon.svg?pdf ***!
  \******************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
var _Path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgNavSpeedIcon = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: props.color,
  viewBox: "0 0 20 20"
}, props), _Path || (_Path = /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
  d: "M8.668 12.938c.333.32.774.482 1.323.489.548.007.954-.19 1.218-.594l3.417-5.125c.139-.208.118-.402-.063-.583-.18-.18-.374-.202-.583-.063l-5.167 3.396c-.403.25-.61.642-.624 1.177-.014.535.146.97.479 1.303Zm-4.334 3.729c-.32 0-.618-.07-.895-.209a1.473 1.473 0 0 1-.646-.625 8.493 8.493 0 0 1-.834-1.989 8.207 8.207 0 0 1-.291-2.198c0-1.139.219-2.212.656-3.219a8.486 8.486 0 0 1 1.792-2.646A8.447 8.447 0 0 1 6.772 3.99a8.056 8.056 0 0 1 3.229-.657c.625 0 1.23.063 1.812.188a7.328 7.328 0 0 1 1.688.583.762.762 0 0 1 .458.604c.042.278-.041.535-.25.771a.821.821 0 0 1-.489.261.952.952 0 0 1-.573-.073 6.361 6.361 0 0 0-2.646-.584c-1.82 0-3.371.642-4.656 1.927-1.285 1.285-1.927 2.83-1.927 4.636 0 .57.083 1.135.25 1.698a7.43 7.43 0 0 0 .666 1.573h11.334a6.07 6.07 0 0 0 .687-1.615 6.768 6.768 0 0 0 .229-1.74c0-.43-.052-.87-.156-1.322a5.414 5.414 0 0 0-.469-1.282.82.82 0 0 1-.073-.583.874.874 0 0 1 .303-.479c.236-.18.486-.243.75-.188.263.056.458.216.583.48a9.51 9.51 0 0 1 .594 1.604 6.57 6.57 0 0 1 .218 1.708 8.518 8.518 0 0 1-.26 2.281 7.92 7.92 0 0 1-.844 2.052 1.451 1.451 0 0 1-.667.625c-.291.14-.59.209-.895.209H4.334Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNavSpeedIcon);

/***/ },

/***/ "./svg/icons/nav-traffic-icon.svg?pdf"
/*!********************************************!*\
  !*** ./svg/icons/nav-traffic-icon.svg?pdf ***!
  \********************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
var _Path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgNavTrafficIcon = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: props.color,
  viewBox: "0 0 20 20"
}, props), _Path || (_Path = /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
  d: "M4.94 17a1.39 1.39 0 0 1-1.02-.418 1.39 1.39 0 0 1-.418-1.022V8.226c0-.403.14-.743.418-1.022a1.388 1.388 0 0 1 1.02-.418c.403 0 .744.14 1.022.418.279.279.418.62.418 1.022v7.334c0 .403-.14.744-.418 1.022A1.39 1.39 0 0 1 4.94 17Zm5.077-.002a1.39 1.39 0 0 1-1.022-.417 1.39 1.39 0 0 1-.418-1.022l-.016-11.12c0-.402.14-.743.418-1.021A1.39 1.39 0 0 1 10.001 3c.403 0 .743.14 1.022.418.278.278.418.619.418 1.02l.015 11.12c0 .403-.14.744-.418 1.023a1.39 1.39 0 0 1-1.021.418Zm5.045.002a1.39 1.39 0 0 1-1.022-.418 1.39 1.39 0 0 1-.418-1.022v-3.62c0-.403.14-.744.418-1.022a1.39 1.39 0 0 1 1.022-.418c.402 0 .742.14 1.02.418.279.278.418.619.418 1.021v3.621c0 .403-.14.744-.418 1.022a1.388 1.388 0 0 1-1.02.418Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNavTrafficIcon);

/***/ },

/***/ "./svg/icons/star-fill.svg?pdf"
/*!*************************************!*\
  !*** ./svg/icons/star-fill.svg?pdf ***!
  \*************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgStarFill = props => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 24 24"
}, props), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
  fill: props.color,
  d: "M5.825 22L8.15 14.4L2 10H9.6L12 2L14.4 10H22L15.85 14.4L18.175 22L12 17.3L5.825 22Z"
}));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgStarFill);

/***/ },

/***/ "./js/components/KeyMetrics/KeyMetricsPDF.tsx"
/*!****************************************************!*\
  !*** ./js/components/KeyMetrics/KeyMetricsPDF.tsx ***!
  \****************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");

/**
 * KeyMetricsPDF component for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */

const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__.createPDFStyles)({
  container: {
    flexDirection: 'row',
    flexWrap: 'wrap'
  },
  tile: {
    // Four tiles per row, so the grid wraps to a new row every four tiles.
    width: '25%',
    marginBottom: 24
  },
  tileInner: {
    // Fills the tile's height so its card stretches to the row's tallest tile,
    // giving every tile in a row a uniform height as on the dashboard. The
    // margin is a small gutter between the grid columns.
    flexGrow: 1,
    marginRight: 24
  }
});
const KeyMetricsPDF = ({
  data
}) => {
  const {
    tiles = []
  } = data || {};
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
    style: styles.container
  }, tiles.map(tile => {
    const TileComponent = tile.TileComponent;
    return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
      key: tile.slug,
      style: styles.tile
    }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
      style: styles.tileInner
    }, /*#__PURE__*/React.createElement(TileComponent, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
      title: tile.title
    }, tile.data))));
  }));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (KeyMetricsPDF);

/***/ },

/***/ "./js/components/pdf-export/PDFExportOrchestrator.tsx"
/*!************************************************************!*\
  !*** ./js/components/pdf-export/PDFExportOrchestrator.tsx ***!
  \************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_googlesitekit_datastore_pdf_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/pdf/constants */ "./js/googlesitekit/datastore/pdf/constants.ts");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/widgets/datastore/constants */ "./js/googlesitekit/widgets/datastore/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./constants */ "./js/components/pdf-export/constants.ts");
/* harmony import */ var _extract_pdf_section_anchors__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./extract-pdf-section-anchors */ "./js/components/pdf-export/extract-pdf-section-anchors.ts");
/* harmony import */ var _measure_pdf_content_height__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./measure-pdf-content-height */ "./js/components/pdf-export/measure-pdf-content-height.ts");
/* harmony import */ var _pdf_fonts_react__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./pdf-fonts-react */ "./js/components/pdf-export/pdf-fonts-react.ts");
/* harmony import */ var _pdf_icons__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./pdf-icons */ "./js/components/pdf-export/pdf-icons.tsx");
/* harmony import */ var _pdf_scale__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _pdf_theme__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _pdf_utils__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./pdf-utils */ "./js/components/pdf-export/pdf-utils.ts");
/* harmony import */ var _pdf_widget_eligibility__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./pdf-widget-eligibility */ "./js/components/pdf-export/pdf-widget-eligibility.ts");
/* harmony import */ var _shared_react_pdf_components_DashboardReport__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./shared-react-pdf-components/DashboardReport */ "./js/components/pdf-export/shared-react-pdf-components/DashboardReport.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");

/**
 * PDF export orchestrator: drives the MVP export pipeline.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



















const STAGE_IDLE = 'IDLE';
const STAGE_LOADING = 'LOADING';
const STAGE_BUILDING = 'BUILDING';
const STAGE_COMPLETE = 'COMPLETE';
const STAGE_ERROR = 'ERROR';
const VALID_TRANSITIONS = {
  [STAGE_IDLE]: [STAGE_LOADING],
  [STAGE_LOADING]: [STAGE_BUILDING, STAGE_ERROR, STAGE_IDLE],
  [STAGE_BUILDING]: [STAGE_COMPLETE, STAGE_ERROR, STAGE_IDLE],
  [STAGE_COMPLETE]: [],
  [STAGE_ERROR]: []
};
const LOADING_TIMEOUT_MS = 45 * 1000;
const BUILDING_TIMEOUT_MS = 30 * 1000;
const COMPLETE_UNMOUNT_DELAY_MS = 2 * 1000;
const BLOB_REVOKE_DELAY_MS = 30 * 1000;
// Progress budget reserved for the data-loading stage; BUILDING fills the rest.
const LOADING_PROGRESS_MAX = 90;
const initialState = {
  stage: STAGE_IDLE
};

/**
 * Validates and applies stage transitions for the export state machine.
 *
 * @since 1.181.0
 *
 * @param state  Current reducer state.
 * @param action Dispatched action with a `nextStage` payload.
 * @return Next state, unchanged when the transition is invalid.
 */
function reducer(state, action) {
  if (action.type === 'TRANSITION') {
    const allowed = VALID_TRANSITIONS[state.stage];
    if (!allowed.includes(action.nextStage)) {
      return state;
    }
    return {
      stage: action.nextStage
    };
  }
  return state;
}

/**
 * Determines whether the given error is an `AbortError` DOMException.
 *
 * @since 1.181.0
 *
 * @param error The caught value.
 * @return `true` when the error is an AbortError.
 */
function isAbortError(error) {
  return error instanceof DOMException && error.name === 'AbortError';
}

/**
 * Throws an `AbortError` when the signal has been aborted.
 *
 * `getData` swallows abort and resolves normally, so the orchestrator cannot
 * rely on its return value to detect cancellation: it must check the signal
 * after every await.
 *
 * @since 1.181.0
 *
 * @param  signal The abort signal to check.
 * @return {void}
 */
function throwIfAborted(signal) {
  if (signal.aborted) {
    throw new DOMException('Aborted', 'AbortError');
  }
}

/**
 * Returns a promise that resolves on the next animation frame, or rejects
 * if the signal is aborted before the frame fires.
 *
 * @since 1.181.0
 *
 * @param signal Abort signal to observe.
 * @return Resolves on the next frame, rejects on abort.
 */
function nextFrame(signal) {
  return new Promise((resolve, reject) => {
    if (signal.aborted) {
      reject(new DOMException('Aborted', 'AbortError'));
      return;
    }
    function onAbort() {
      globalThis.cancelAnimationFrame(frameID);
      reject(new DOMException('Aborted', 'AbortError'));
    }
    const frameID = globalThis.requestAnimationFrame(() => {
      signal.removeEventListener('abort', onAbort);
      resolve();
    });
    signal.addEventListener('abort', onAbort, {
      once: true
    });
  });
}
const PDFExportOrchestrator = ({
  onComplete
}) => {
  const [, dispatch] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useReducer)(reducer, initialState);
  // `@wordpress/data` types `useRegistry()` as `Function`, which does not
  // overlap with Site Kit's `Registry` type, so TypeScript needs the
  // `unknown` step between the two.
  const registry = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useRegistry)();
  const {
    setStatus,
    setProgress,
    setBlob,
    clearExport,
    clearCancelRequest
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_pdf_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_PDF);
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER);
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const viewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_10__["default"])();
  const cancelRequested = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_pdf_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_PDF).isCancelRequested(), []);
  const siteName = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getSiteName(), []);
  const referenceSiteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getReferenceSiteURL(), []);
  const dateRange = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getDateRange(), []);
  const dashboardURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getGoLinkURL('dashboard'), []);
  // A golink with this key opens the Site Kit dashboard with the email
  // reporting setup panel. The key is registered in
  // `Email_Reporting::register()`.
  const emailReportingSetupURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getGoLinkURL('manage-subscription-email-reporting'), []);
  const selectedContextSlugs = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_pdf_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_PDF).getSelectedContextSlugs() || [], []);
  const selectedWidgetSlugs = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_pdf_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_PDF).getSelectedWidgetSlugs() || [], []);
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getDateRangeDates({
    compare: true,
    // The PDF reporting period excludes the current day, so end the
    // range on the day before the reference date.
    referenceDate: (0,_js_util__WEBPACK_IMPORTED_MODULE_11__.getPreviousDate)(select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getReferenceDate(), 1)
  }), []);
  const viewableModules = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => viewOnly ? select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getViewableModules() : undefined, [viewOnly]);
  const abortControllerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
  const stageTimeoutRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
  const completeTimeoutRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
  const revokeTimeoutRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
  const timeoutAbortRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(false);
  const userCancelRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(false);
  const onCompleteRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)(onComplete);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    onCompleteRef.current = onComplete;
  }, [onComplete]);
  const clearStageTimeout = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    if (stageTimeoutRef.current !== null) {
      clearTimeout(stageTimeoutRef.current);
      stageTimeoutRef.current = null;
    }
  }, []);
  const armStageTimeout = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(durationMS => {
    clearStageTimeout();
    stageTimeoutRef.current = setTimeout(() => {
      stageTimeoutRef.current = null;
      timeoutAbortRef.current = true;
      abortControllerRef.current?.abort();
    }, durationMS);
  }, [clearStageTimeout]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if (cancelRequested) {
      userCancelRef.current = true;
      abortControllerRef.current?.abort();
      clearCancelRequest();
    }
  }, [cancelRequested, clearCancelRequest]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    const controller = new AbortController();
    abortControllerRef.current = controller;
    const {
      signal
    } = controller;
    function beforeUnloadHandler(event) {
      event.preventDefault();
      // Most browsers ignore the string, but assigning it keeps the legacy contract.
      event.returnValue = '';
    }
    globalThis.addEventListener('beforeunload', beforeUnloadHandler);
    const reportSiteName = typeof siteName === 'string' ? siteName : '';
    const referenceName = reportSiteName.length > 0 ? reportSiteName : referenceSiteURL || '';
    const resolvedDateRange = typeof dateRange === 'string' ? dateRange : undefined;

    // Resolve the lazy component chunk up-front and fetch widget data.
    // @react-pdf does not honour Suspense, so the document tree must hold
    // a concrete component before rendering starts.
    async function resolveWidgetData(widget) {
      let Component = widget.pdf.Component;
      if (typeof Component.preload === 'function') {
        const loadedModule = await Component.preload();
        throwIfAborted(signal);
        Component = loadedModule.default;
      }
      const result = await widget.pdf.getData({
        registry,
        dates,
        signal,
        viewOnly,
        // The same module visibility the area discovery used, so a
        // loader that composes several modules' tiles (Key Metrics) can
        // keep only the tiles the user can view, as the dashboard does.
        viewableModules
      });
      throwIfAborted(signal);
      return {
        Component,
        data: result?.data ?? null,
        chartImages: result?.chartImages
      };
    }

    /**
     * Saves the `pdf-export-downloaded` slug to WordPress user meta.
     *
     * @since n.e.x.t
     *
     * @return {Promise<void>} A promise that resolves after the save.
     */
    async function recordDownload() {
      const dismissedItems = await registry.resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getDismissedItems();
      if (!dismissedItems?.includes(_constants__WEBPACK_IMPORTED_MODULE_12__.PDF_EXPORT_DOWNLOADED_ITEM_SLUG)) {
        await dismissItem(_constants__WEBPACK_IMPORTED_MODULE_12__.PDF_EXPORT_DOWNLOADED_ITEM_SLUG);
      }
    }
    async function run() {
      let currentStage = STAGE_LOADING;
      const eventCategory = `${viewContext}_pdf_generation`;
      try {
        dispatch({
          type: 'TRANSITION',
          nextStage: STAGE_LOADING
        });
        setStatus('progress');
        setProgress(0);
        armStageTimeout(LOADING_TIMEOUT_MS);
        // Yield a frame so the progress snackbar paints before loading.
        await nextFrame(signal);

        // Discovery: walk the registry inline (the orchestrator owns the
        // contexts → areas → widgets walk; there is no centralised
        // PDF-aware selector). `selectedContextSlugs`,
        // `selectedWidgetSlugs`, `dates` and `viewableModules` are
        // snapshotted once above. Nothing below re-reads reactive state.
        const {
          resolveSelect
        } = registry;
        // `Registry` types `select` as `Function`. Narrow it to
        // `Select` so `isActivePDFWidget` can take it.
        const select = registry.select;

        // Wait for modules to load, or `isModuleConnected` returns
        // `undefined` and `isActivePDFWidget` drops every widget
        // that needs a module from the report.
        await resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES).getModules();
        throwIfAborted(signal);
        const widgetsSelect = select(_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_WIDGETS);
        const discoveredAreas = [];
        // An area can be assigned to more than one context; track the
        // slugs already discovered so a shared area is not rendered (and
        // chipped) twice when multiple of its contexts are selected.
        const discoveredAreaSlugs = new Set();
        // An area can hold several PDF widgets. Export only the ones the
        // user kept checked, not every widget in the area.
        const selectedWidgetSlugSet = new Set(selectedWidgetSlugs);

        // Reorder the selected contexts into the dashboard's order, so
        // the report's sections follow that order, not the stored order.
        const selectedContextSlugSet = new Set(selectedContextSlugs);
        const orderedSelectedContextSlugs = _constants__WEBPACK_IMPORTED_MODULE_12__.ORDERED_MAIN_DASHBOARD_CONTEXTS.filter(contextSlug => selectedContextSlugSet.has(contextSlug));
        orderedSelectedContextSlugs.forEach(contextSlug => {
          const contextAreas = widgetsSelect.getWidgetAreas(contextSlug) || [];
          contextAreas.forEach(area => {
            if (discoveredAreaSlugs.has(area.slug)) {
              return;
            }
            const pdfWidgets = widgetsSelect.getWidgets(area.slug, {
              modules: viewableModules || undefined
            }).filter(widget => (0,_pdf_widget_eligibility__WEBPACK_IMPORTED_MODULE_20__.isActivePDFWidget)(widget, select)).filter(widget => selectedWidgetSlugSet.has(widget.slug));
            if (pdfWidgets.length === 0) {
              return;
            }
            discoveredAreaSlugs.add(area.slug);
            discoveredAreas.push({
              areaSlug: area.slug,
              areaContextSlug: contextSlug,
              areaTitle: area.pdfReportTitle || area.pdfTitle || area.title || '',
              widgets: pdfWidgets
            });
          });
        });
        const flatWidgets = discoveredAreas.flatMap(area => area.widgets);
        if (flatWidgets.length === 0) {
          throw new Error('No PDF-capable widgets to export.');
        }

        /**
         * Loading: resolve each widget's data sequentially. The report
         * skips a failing widget, and the export only errors when
         * every widget fails.
         */
        const loaded = new Map();
        let failureCount = 0;
        for (let index = 0; index < flatWidgets.length; index++) {
          const widget = flatWidgets[index];
          try {
            loaded.set(widget.slug, await resolveWidgetData(widget));
          } catch (error) {
            if (isAbortError(error)) {
              throw error;
            }
            failureCount++;
            loaded.set(widget.slug, {
              Component: null,
              data: null,
              chartImages: undefined
            });
          }
          setProgress(Math.round((index + 1) / flatWidgets.length * LOADING_PROGRESS_MAX));
        }
        if (failureCount === flatWidgets.length) {
          throw new Error('All PDF widgets failed to load.');
        }
        throwIfAborted(signal);
        currentStage = STAGE_BUILDING;
        dispatch({
          type: 'TRANSITION',
          nextStage: STAGE_BUILDING
        });
        armStageTimeout(BUILDING_TIMEOUT_MS);
        (0,_pdf_fonts_react__WEBPACK_IMPORTED_MODULE_15__.registerPDFFonts)();
        throwIfAborted(signal);

        // Group the discovered areas by dashboard context, so a context
        // with more than one area renders as one section under one chip,
        // not a chip per area. Traffic is the case, since it holds the
        // traffic charts and the audience tiles. The `Map` keeps the
        // first-seen order.
        const contextGroups = new Map();
        discoveredAreas.forEach(area => {
          const group = contextGroups.get(area.areaContextSlug) ?? {
            title: '',
            widgets: []
          };

          // The title comes from the first area that has one. The areas
          // of a PDF context share the same `pdfTitle`, so this is the
          // context's title.
          if (!group.title && area.areaTitle) {
            group.title = area.areaTitle;
          }
          group.widgets.push(...area.widgets);
          contextGroups.set(area.areaContextSlug, group);
        });
        const areas = Array.from(contextGroups, ([contextSlug, group]) => ({
          areaSlug: contextSlug,
          areaTitle: group.title,
          widgets: group.widgets.map(widget => {
            const entry = loaded.get(widget.slug);
            return {
              slug: widget.slug,
              label: widget.pdf.label,
              Component: entry?.Component ?? null,
              data: entry?.data ?? null,
              chartImages: entry?.chartImages
            };
          })
        }));

        // One header chip per context, in context order, with the icon
        // from the context slug.
        const sections = Array.from(contextGroups, ([contextSlug, group]) => ({
          slug: contextSlug,
          label: group.title,
          Icon: _pdf_icons__WEBPACK_IMPORTED_MODULE_16__.SECTION_ICONS[contextSlug]
        }));
        const filename = (0,_pdf_utils__WEBPACK_IMPORTED_MODULE_19__.getPDFFilename)(referenceName, resolvedDateRange);
        const reportProps = {
          siteName: reportSiteName,
          siteURL: referenceSiteURL || '',
          dashboardURL: dashboardURL || '',
          dateRange: {
            startDate: dates.startDate,
            endDate: dates.endDate
          },
          sections,
          helpCenterURL: 'https://sitekit.withgoogle.com/support/?doc=get-support',
          privacyPolicyURL: 'https://policies.google.com/privacy',
          areas,
          emailReportingSetupURL
        };

        /*
         * The report renders twice: a discarded measurement pass
         * captures the content height and the sections' absolute
         * positions via `onRender`, then the final pass renders the
         * page bounded to the measured height, with the header chips'
         * anchor targets pinned at those positions.
         */
        let measuredHeight = 0;
        let sectionAnchors = [];
        // `@react-pdf` runs `onRender` inside its own render
        // pipeline, so an error thrown there may never leave
        // `toBlob()`. Capture it and rethrow it here instead.
        let measureError = null;
        await (0,_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.pdf)(/*#__PURE__*/React.createElement(_shared_react_pdf_components_DashboardReport__WEBPACK_IMPORTED_MODULE_21__["default"], (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, reportProps, {
          pageHeight: _pdf_theme__WEBPACK_IMPORTED_MODULE_18__.PDF_MEASURE_PAGE_HEIGHT,
          onRender: layout => {
            try {
              measuredHeight = (0,_measure_pdf_content_height__WEBPACK_IMPORTED_MODULE_14__["default"])(layout);
              sectionAnchors = (0,_extract_pdf_section_anchors__WEBPACK_IMPORTED_MODULE_13__["default"])(layout);
            } catch (error) {
              measureError = error;
            }
          }
        }))).toBlob();
        throwIfAborted(signal);
        if (measureError) {
          throw measureError;
        }
        if (measuredHeight <= 0) {
          throw new Error('The PDF measurement pass produced no layout.');
        }
        const finalPageHeight = Math.min(measuredHeight + _pdf_scale__WEBPACK_IMPORTED_MODULE_17__.PDF_PAGE_BOTTOM_PADDING, _pdf_theme__WEBPACK_IMPORTED_MODULE_18__.PDF_MEASURE_PAGE_HEIGHT);
        const blob = await (0,_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.pdf)(/*#__PURE__*/React.createElement(_shared_react_pdf_components_DashboardReport__WEBPACK_IMPORTED_MODULE_21__["default"], (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, reportProps, {
          pageHeight: finalPageHeight,
          sectionAnchors: sectionAnchors
        }))).toBlob();
        throwIfAborted(signal);
        const blobURL = URL.createObjectURL(blob);
        setBlob({
          url: blobURL,
          filename
        });
        (0,_pdf_utils__WEBPACK_IMPORTED_MODULE_19__.triggerDownload)(blobURL, filename);
        revokeTimeoutRef.current = setTimeout(() => {
          revokeTimeoutRef.current = null;
          URL.revokeObjectURL(blobURL);
        }, BLOB_REVOKE_DELAY_MS);
        clearStageTimeout();
        dispatch({
          type: 'TRANSITION',
          nextStage: STAGE_COMPLETE
        });
        (0,_js_util__WEBPACK_IMPORTED_MODULE_11__.trackEvent)(eventCategory, 'pdf_generation_complete', selectedContextSlugs.join(','));
        setStatus('success');

        // `recordDownload` saves `pdf-export-downloaded` in WordPress
        // user meta, and this call sits inside the export's `try`.
        // Awaiting it would report a finished export as an error
        // whenever that save failed.
        recordDownload().catch(() => null);
        completeTimeoutRef.current = setTimeout(() => {
          completeTimeoutRef.current = null;
          onCompleteRef.current();
        }, COMPLETE_UNMOUNT_DELAY_MS);
      } catch (error) {
        clearStageTimeout();

        // User cancel and teardown (unmount/navigate) are both silent
        // (IDLE). Only a user cancel fires a tracking event; teardown
        // aborts are not intentional user actions.
        if (isAbortError(error) && !timeoutAbortRef.current) {
          if (userCancelRef.current) {
            (0,_js_util__WEBPACK_IMPORTED_MODULE_11__.trackEvent)(eventCategory, 'pdf_generation_cancel', currentStage.toLowerCase());
          }
          dispatch({
            type: 'TRANSITION',
            nextStage: STAGE_IDLE
          });
          clearExport();
          onCompleteRef.current();
          return;
        }

        // Stop any request that is still running, so it ends now
        // instead of finishing in the background after the user sees
        // the error. On the stage-timeout path, `abort()` already ran,
        // so this call does nothing.
        abortControllerRef.current?.abort();
        const errorLabel = timeoutAbortRef.current ? `${currentStage.toLowerCase()}_timeout` : currentStage.toLowerCase();
        (0,_js_util__WEBPACK_IMPORTED_MODULE_11__.trackEvent)(eventCategory, 'pdf_generation_error', errorLabel);
        dispatch({
          type: 'TRANSITION',
          nextStage: STAGE_ERROR
        });
        setStatus('error');
        onCompleteRef.current();
      }
    }
    run();
    return () => {
      globalThis.removeEventListener('beforeunload', beforeUnloadHandler);
      clearStageTimeout();
      if (completeTimeoutRef.current !== null) {
        clearTimeout(completeTimeoutRef.current);
        completeTimeoutRef.current = null;
      }
      if (revokeTimeoutRef.current !== null) {
        clearTimeout(revokeTimeoutRef.current);
        revokeTimeoutRef.current = null;
      }
      controller.abort();
    };
    // Runs once on mount. Site and user data are read at start, not re-fetched mid-export.
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);
  return null;
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFExportOrchestrator);

/***/ },

/***/ "./js/components/pdf-export/constants.ts"
/*!***********************************************!*\
  !*** ./js/components/pdf-export/constants.ts ***!
  \***********************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ORDERED_MAIN_DASHBOARD_CONTEXTS: () => (/* binding */ ORDERED_MAIN_DASHBOARD_CONTEXTS),
/* harmony export */   PDF_DOWNLOAD_PANEL_OPENED_KEY: () => (/* binding */ PDF_DOWNLOAD_PANEL_OPENED_KEY),
/* harmony export */   PDF_EXPORT_DOWNLOADED_ITEM_SLUG: () => (/* binding */ PDF_EXPORT_DOWNLOADED_ITEM_SLUG),
/* harmony export */   PDF_EXPORT_DOWNLOADED_SURVEY_TRIGGER_ID: () => (/* binding */ PDF_EXPORT_DOWNLOADED_SURVEY_TRIGGER_ID),
/* harmony export */   PDF_EXPORT_INCOMPLETE_SURVEY_TRIGGER_ID: () => (/* binding */ PDF_EXPORT_INCOMPLETE_SURVEY_TRIGGER_ID),
/* harmony export */   PDF_EXPORT_NOT_USED_SURVEY_TRIGGER_ID: () => (/* binding */ PDF_EXPORT_NOT_USED_SURVEY_TRIGGER_ID),
/* harmony export */   PDF_EXPORT_PANEL_OPENED_ITEM_SLUG: () => (/* binding */ PDF_EXPORT_PANEL_OPENED_ITEM_SLUG),
/* harmony export */   PDF_INTRODUCTION_OVERLAY_NOTIFICATION: () => (/* binding */ PDF_INTRODUCTION_OVERLAY_NOTIFICATION)
/* harmony export */ });
/* harmony import */ var _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-contexts */ "./js/googlesitekit/widgets/default-contexts.js");
/**
 * PDF Generation constants.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */

const PDF_DOWNLOAD_PANEL_OPENED_KEY = 'pdfDownloadPanelOpened';
const PDF_INTRODUCTION_OVERLAY_NOTIFICATION = 'pdf_introduction_overlay_notification';

/**
 * The dashboard asks for the survey written for a user who never opened the
 * PDF export panel.
 *
 * The survey service holds that survey under this ID.
 *
 * @since n.e.x.t
 */
const PDF_EXPORT_NOT_USED_SURVEY_TRIGGER_ID = 'view_pdf_export_not_used';

/**
 * The dashboard asks for the survey written for a user who opened the PDF
 * export panel and never downloaded a report.
 *
 * The survey service holds that survey under this ID.
 *
 * @since n.e.x.t
 */
const PDF_EXPORT_INCOMPLETE_SURVEY_TRIGGER_ID = 'view_pdf_export_incomplete';

/**
 * The dashboard asks for the survey written for a user who downloaded at
 * least one PDF report.
 *
 * The survey service holds that survey under this ID.
 *
 * @since n.e.x.t
 */
const PDF_EXPORT_DOWNLOADED_SURVEY_TRIGGER_ID = 'view_pdf_export_downloaded';

/**
 * The PDF export panel saves this slug to WordPress user meta the first time
 * a user opens the panel.
 *
 * The `core/pdf` data store holds the export state in memory, and this slug
 * persists. The survey trigger component reads the slug to pick a survey.
 *
 * @since n.e.x.t
 */
const PDF_EXPORT_PANEL_OPENED_ITEM_SLUG = 'pdf-export-panel-opened';

/**
 * The export saves this slug to WordPress user meta the first time a user
 * downloads a PDF report.
 *
 * @since n.e.x.t
 */
const PDF_EXPORT_DOWNLOADED_ITEM_SLUG = 'pdf-export-downloaded';

/**
 * Main-dashboard context slugs in the dashboard's own order.
 *
 * The PDF report renders one section per selected context, in this order.
 * Both the selection panel and the export orchestrator read this list, so the
 * exported section order always follows the dashboard's order, whatever order
 * the user selected the widgets in.
 *
 * @since 1.184.0
 */
const ORDERED_MAIN_DASHBOARD_CONTEXTS = [_js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_0__.CONTEXT_MAIN_DASHBOARD_KEY_METRICS, _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_0__.CONTEXT_MAIN_DASHBOARD_SITE_GOALS, _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_0__.CONTEXT_MAIN_DASHBOARD_TRAFFIC, _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_0__.CONTEXT_MAIN_DASHBOARD_CONTENT, _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_0__.CONTEXT_MAIN_DASHBOARD_SPEED, _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_0__.CONTEXT_MAIN_DASHBOARD_MONETIZATION];

/***/ },

/***/ "./js/components/pdf-export/extract-pdf-section-anchors.ts"
/*!*****************************************************************!*\
  !*** ./js/components/pdf-export/extract-pdf-section-anchors.ts ***!
  \*****************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   PDF_SECTION_ID_PREFIX: () => (/* binding */ PDF_SECTION_ID_PREFIX),
/* harmony export */   "default": () => (/* binding */ extractPDFSectionAnchors)
/* harmony export */ });
/**
 * Extracts section anchor positions from a `@react-pdf/renderer` layout.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */

const PDF_SECTION_ID_PREFIX = 'section-';
function walk(node, parentTop, anchors) {
  const relativeTop = typeof node.box?.top === 'number' ? node.box.top : 0;
  const top = parentTop + relativeTop;
  const id = node.props?.id;
  if (typeof id === 'string' && id.startsWith(PDF_SECTION_ID_PREFIX)) {
    anchors.push({
      id,
      top
    });
  }
  if (Array.isArray(node.children)) {
    node.children.forEach(child => walk(child, top, anchors));
  }
}

/**
 * Collects each section node's `id` and absolute top from the measurement
 * pass layout.
 *
 * `@react-pdf` registers a named destination from a node's parent-relative
 * top, so an `id` deep in the tree lands the viewer too high. The final
 * render pass instead places zero-size anchors directly on the page, at the
 * absolute tops this function reads by summing each node's offset down the
 * tree.
 *
 * Returns an empty list when the layout holds no section nodes; the shape
 * itself is guarded by `measurePDFContentHeight`, which runs on the same
 * layout first.
 *
 * @since n.e.x.t
 *
 * @param layout The value passed to the `Document` `onRender` callback.
 * @return The section anchors in document order.
 */
function extractPDFSectionAnchors(layout) {
  const layoutData = layout?._INTERNAL__LAYOUT__DATA_;
  const children = layoutData?.children;
  const page = Array.isArray(children) ? children[0] : undefined;
  if (!page) {
    return [];
  }
  const anchors = [];
  walk(page, 0, anchors);
  return anchors;
}

/***/ },

/***/ "./js/components/pdf-export/formatDateString.ts"
/*!******************************************************!*\
  !*** ./js/components/pdf-export/formatDateString.ts ***!
  \******************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   formatDateString: () => (/* binding */ formatDateString)
/* harmony export */ });
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/**
 * Date string formatting helper for PDF export.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */


/**
 * Formats a `YYYY-MM-DD` date as a localized short date, e.g. "Jan 1, 2021".
 *
 * Returns an empty string for missing/invalid input: `stringToDate` throws on a
 * non-`YYYY-MM-DD` string, which would otherwise abort the whole PDF render.
 *
 * @since 1.182.0
 * @since 1.184.0 Moved from `PDFHeader` to a shared helper for use in other PDF components.
 *
 * @param dateString The date in `YYYY-MM-DD` format.
 * @return The localized date, or an empty string.
 */
function formatDateString(dateString) {
  if (!(0,_js_util__WEBPACK_IMPORTED_MODULE_0__.isValidDateString)(dateString)) {
    return '';
  }
  return new Intl.DateTimeFormat((0,_js_util__WEBPACK_IMPORTED_MODULE_0__.getLocale)(), {
    month: 'short',
    day: 'numeric',
    year: 'numeric'
  }).format((0,_js_util__WEBPACK_IMPORTED_MODULE_0__.stringToDate)(dateString));
}

/***/ },

/***/ "./js/components/pdf-export/getPDFTileChange.ts"
/*!******************************************************!*\
  !*** ./js/components/pdf-export/getPDFTileChange.ts ***!
  \******************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getPDFTileChange),
/* harmony export */   getPDFChangeType: () => (/* binding */ getPDFChangeType)
/* harmony export */ });
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/**
 * PDF tile change helper.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */



/** A tile's period-over-period change, pre-formatted for the change badge. */

/**
 * Gets a change badge's `PDFChangeType` from a numeric change value.
 *
 * @since n.e.x.t
 *
 * @param {number} change The change value.
 * @return {string} The change's type (`'positive'`, `'negative'`, or `'noChange'`).
 */
function getPDFChangeType(change) {
  if (change < 0) {
    return 'negative';
  }
  return change === 0 ? 'noChange' : 'positive';
}

/**
 * Computes a Key Metrics PDF tile's change badge fields from its current and
 * previous values, mirroring the dashboard's `ChangeBadge`.
 *
 * The change is the relative difference by default, or the absolute difference
 * when `isAbsolute` is set (used for metrics that are themselves percentages, so
 * the badge shows a point difference rather than a percentage of a percentage).
 * The result is `undefined` when the change can't be computed (e.g. the previous
 * value is zero), which hides the badge.
 *
 * @since n.e.x.t
 *
 * @param {number}  previousValue        The previous period's value.
 * @param {number}  currentValue         The current period's value.
 * @param {Object}  [options]            Options.
 * @param {boolean} [options.isAbsolute] Whether to use the absolute rather than relative change. Defaults to `false`.
 * @return {PDFTileChange} The formatted change and its direction.
 */
function getPDFTileChange(previousValue, currentValue, {
  isAbsolute = false
} = {}) {
  const change = isAbsolute ? currentValue - previousValue : (0,_js_util__WEBPACK_IMPORTED_MODULE_0__.calculateChange)(previousValue, currentValue);
  if (change === null || change === undefined) {
    return {};
  }
  return {
    change: (0,_js_util__WEBPACK_IMPORTED_MODULE_0__.numFmt)(change, {
      style: 'percent',
      signDisplay: 'exceptZero',
      maximumFractionDigits: 1
    }),
    changeType: getPDFChangeType(change)
  };
}

/***/ },

/***/ "./js/components/pdf-export/measure-pdf-content-height.ts"
/*!****************************************************************!*\
  !*** ./js/components/pdf-export/measure-pdf-content-height.ts ***!
  \****************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ measurePDFContentHeight)
/* harmony export */ });
/**
 * Measures the rendered content height of a `@react-pdf/renderer` layout.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const SHAPE_ERROR = '@react-pdf/renderer internal layout shape unrecognised: expected layout._INTERNAL__LAYOUT__DATA_.children[0].children[].box.{top,height}. Did the package version change?';

/**
 * Reads the bottom edge of the lowest node on the first rendered page.
 *
 * The layout comes from the `onRender` callback of a `@react-pdf/renderer`
 * `Document`. Its `_INTERNAL__LAYOUT__DATA_` value is undocumented, so the
 * function throws when the expected shape is absent rather than sizing the
 * page from a bad value: a clean export failure the user can retry, not a
 * broken PDF.
 *
 * @since n.e.x.t
 *
 * @param layout The value passed to the `Document` `onRender` callback.
 * @return The content height in points.
 */
function measurePDFContentHeight(layout) {
  const layoutData = layout?._INTERNAL__LAYOUT__DATA_;
  if (!layoutData || !Array.isArray(layoutData.children)) {
    throw new Error(SHAPE_ERROR);
  }
  const page = layoutData.children[0];
  if (!page || !Array.isArray(page.children)) {
    throw new Error(SHAPE_ERROR);
  }
  const children = page.children;
  if (children.length === 0) {
    throw new Error(SHAPE_ERROR);
  }
  let maxBottom = 0;
  for (const child of children) {
    const {
      box
    } = child;
    if (!box || typeof box.top !== 'number' || typeof box.height !== 'number') {
      throw new Error(SHAPE_ERROR);
    }
    maxBottom = Math.max(maxBottom, box.top + box.height);
  }
  if (maxBottom <= 0) {
    throw new Error(SHAPE_ERROR);
  }
  return maxBottom;
}

/***/ },

/***/ "./js/components/pdf-export/pdf-fonts-react.ts"
/*!*****************************************************!*\
  !*** ./js/components/pdf-export/pdf-fonts-react.ts ***!
  \*****************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   registerPDFFonts: () => (/* binding */ registerPDFFonts)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _fonts_google_sans_display_medium_ttf__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fonts/google-sans-display-medium.ttf */ "./js/components/pdf-export/fonts/google-sans-display-medium.ttf");
/* harmony import */ var _fonts_google_sans_display_regular_ttf__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fonts/google-sans-display-regular.ttf */ "./js/components/pdf-export/fonts/google-sans-display-regular.ttf");
/* harmony import */ var _fonts_google_sans_text_medium_ttf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fonts/google-sans-text-medium.ttf */ "./js/components/pdf-export/fonts/google-sans-text-medium.ttf");
/* harmony import */ var _fonts_google_sans_text_regular_ttf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fonts/google-sans-text-regular.ttf */ "./js/components/pdf-export/fonts/google-sans-text-regular.ttf");
/* harmony import */ var _pdf_theme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/**
 * PDF font registration for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */





let fontsRegistered = false;

/**
 * Registers Site Kit's brand fonts with @react-pdf/renderer.
 *
 * Embeds Google Sans Display (400, 500) and Google Sans Text (400, 500) so
 * the generated PDF renders in the dashboard's typography. The font binaries are
 * emitted as hashed static assets by webpack and fetched by @react-pdf at
 * render time (not when this function runs), so the dashboard's page load is
 * unaffected. Registration is idempotent for the lifetime of the session.
 *
 * Errors are intentionally not caught: a failure propagates so the orchestrator
 * transitions to its ERROR stage rather than silently rendering in a fallback
 * typeface.
 *
 * @since 1.182.0
 * @since 1.183.0 Added the Google Sans Display medium (500) weight.
 *
 * @return The display font family name.
 */
function registerPDFFonts() {
  if (fontsRegistered) {
    return _pdf_theme__WEBPACK_IMPORTED_MODULE_5__.PDF_FONT_FAMILY_DISPLAY;
  }
  _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Font.register({
    family: _pdf_theme__WEBPACK_IMPORTED_MODULE_5__.PDF_FONT_FAMILY_DISPLAY,
    fonts: [{
      src: _fonts_google_sans_display_regular_ttf__WEBPACK_IMPORTED_MODULE_2__,
      fontWeight: 400
    }, {
      src: _fonts_google_sans_display_medium_ttf__WEBPACK_IMPORTED_MODULE_1__,
      fontWeight: 500
    }]
  });
  _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Font.register({
    family: _pdf_theme__WEBPACK_IMPORTED_MODULE_5__.PDF_FONT_FAMILY_TEXT,
    fonts: [{
      src: _fonts_google_sans_text_regular_ttf__WEBPACK_IMPORTED_MODULE_4__,
      fontWeight: 400
    }, {
      src: _fonts_google_sans_text_medium_ttf__WEBPACK_IMPORTED_MODULE_3__,
      fontWeight: 500
    }]
  });

  // Disable hyphenation so words wrap whole rather than being split.
  _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Font.registerHyphenationCallback(word => [word]);
  fontsRegistered = true;
  return _pdf_theme__WEBPACK_IMPORTED_MODULE_5__.PDF_FONT_FAMILY_DISPLAY;
}

/***/ },

/***/ "./js/components/pdf-export/pdf-icons.tsx"
/*!************************************************!*\
  !*** ./js/components/pdf-export/pdf-icons.tsx ***!
  \************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   LOGO_G_ASPECT_RATIO: () => (/* binding */ LOGO_G_ASPECT_RATIO),
/* harmony export */   PDFAudienceMetricIconCities: () => (/* binding */ PDFAudienceMetricIconCities),
/* harmony export */   PDFAudienceMetricIconPagesPerVisit: () => (/* binding */ PDFAudienceMetricIconPagesPerVisit),
/* harmony export */   PDFAudienceMetricIconPageviews: () => (/* binding */ PDFAudienceMetricIconPageviews),
/* harmony export */   PDFAudienceMetricIconTopContent: () => (/* binding */ PDFAudienceMetricIconTopContent),
/* harmony export */   PDFAudienceMetricIconVisitors: () => (/* binding */ PDFAudienceMetricIconVisitors),
/* harmony export */   PDFAudienceMetricIconVisitsPerVisitor: () => (/* binding */ PDFAudienceMetricIconVisitsPerVisitor),
/* harmony export */   PDFChevronRight: () => (/* binding */ PDFChevronRight),
/* harmony export */   PDFLogoG: () => (/* binding */ PDFLogoG),
/* harmony export */   PDFNavContentIcon: () => (/* binding */ PDFNavContentIcon),
/* harmony export */   PDFNavKeyMetricsIcon: () => (/* binding */ PDFNavKeyMetricsIcon),
/* harmony export */   PDFNavMonetizationIcon: () => (/* binding */ PDFNavMonetizationIcon),
/* harmony export */   PDFNavSpeedIcon: () => (/* binding */ PDFNavSpeedIcon),
/* harmony export */   PDFNavTrafficIcon: () => (/* binding */ PDFNavTrafficIcon),
/* harmony export */   PDFStarFill: () => (/* binding */ PDFStarFill),
/* harmony export */   SECTION_ICONS: () => (/* binding */ SECTION_ICONS)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _images_logo_g_png__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/images/logo-g.png */ "./images/logo-g.png");
/* harmony import */ var _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-contexts */ "./js/googlesitekit/widgets/default-contexts.js");
/* harmony import */ var _svg_icons_audience_metric_icon_cities_svg_pdf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/icons/audience-metric-icon-cities.svg?pdf */ "./svg/icons/audience-metric-icon-cities.svg?pdf");
/* harmony import */ var _svg_icons_audience_metric_icon_pages_per_visit_svg_pdf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/svg/icons/audience-metric-icon-pages-per-visit.svg?pdf */ "./svg/icons/audience-metric-icon-pages-per-visit.svg?pdf");
/* harmony import */ var _svg_icons_audience_metric_icon_pageviews_svg_pdf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/svg/icons/audience-metric-icon-pageviews.svg?pdf */ "./svg/icons/audience-metric-icon-pageviews.svg?pdf");
/* harmony import */ var _svg_icons_audience_metric_icon_top_content_svg_pdf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/svg/icons/audience-metric-icon-top-content.svg?pdf */ "./svg/icons/audience-metric-icon-top-content.svg?pdf");
/* harmony import */ var _svg_icons_audience_metric_icon_visitors_svg_pdf__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/svg/icons/audience-metric-icon-visitors.svg?pdf */ "./svg/icons/audience-metric-icon-visitors.svg?pdf");
/* harmony import */ var _svg_icons_audience_metric_icon_visits_per_visitor_svg_pdf__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/svg/icons/audience-metric-icon-visits-per-visitor.svg?pdf */ "./svg/icons/audience-metric-icon-visits-per-visitor.svg?pdf");
/* harmony import */ var _svg_icons_chevron_right_svg_pdf__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/svg/icons/chevron-right.svg?pdf */ "./svg/icons/chevron-right.svg?pdf");
/* harmony import */ var _svg_icons_nav_content_icon_svg_pdf__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/svg/icons/nav-content-icon.svg?pdf */ "./svg/icons/nav-content-icon.svg?pdf");
/* harmony import */ var _svg_icons_nav_key_metrics_icon_svg_pdf__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/svg/icons/nav-key-metrics-icon.svg?pdf */ "./svg/icons/nav-key-metrics-icon.svg?pdf");
/* harmony import */ var _svg_icons_nav_monetization_icon_svg_pdf__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/svg/icons/nav-monetization-icon.svg?pdf */ "./svg/icons/nav-monetization-icon.svg?pdf");
/* harmony import */ var _svg_icons_nav_speed_icon_svg_pdf__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/svg/icons/nav-speed-icon.svg?pdf */ "./svg/icons/nav-speed-icon.svg?pdf");
/* harmony import */ var _svg_icons_nav_traffic_icon_svg_pdf__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/svg/icons/nav-traffic-icon.svg?pdf */ "./svg/icons/nav-traffic-icon.svg?pdf");
/* harmony import */ var _svg_icons_star_fill_svg_pdf__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/svg/icons/star-fill.svg?pdf */ "./svg/icons/star-fill.svg?pdf");
/* harmony import */ var _pdf_scale__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _pdf_theme__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Shared icons for the PDF export (@react-pdf/renderer).
 *
 * `@react-pdf` can't render the dashboard's SVGR icons, so each icon here
 * imports its source `assets/svg/icons/*.svg` file with `?pdf`. The build draws
 * that file with `@react-pdf/renderer` primitives, so an edit to the SVG also
 * changes the PDF icon.
 *
 * The Google "G" is the one icon that comes in as an image. The letter needs a
 * mask and a conic gradient that `@react-pdf/renderer` can't draw.
 *
 * Each export adds a `PDF` prefix to the dashboard icon's name.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */

















/** The default icon size in pixels, before it scales to page points. */
const PDF_ICON_SIZE = 20;

/**
 * Wraps a source SVG file, imported with `?pdf`, as a PDF report icon.
 *
 * @since 1.184.0
 *
 * @param SvgFile      The SVG file's component, from a `?pdf` import.
 * @param defaultColor Optional. The color to draw when the caller sets none. Defaults to `SURFACES_ON_SURFACE_VARIANT`, the muted color the dashboard draws these icons in.
 * @return An icon that takes a `size` in pixels and a `color`.
 */
function createPDFIcon(SvgFile, defaultColor = _pdf_theme__WEBPACK_IMPORTED_MODULE_17__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT) {
  return function Icon({
    size = PDF_ICON_SIZE,
    color = defaultColor
  }) {
    return /*#__PURE__*/React.createElement(SvgFile, {
      width: (0,_pdf_scale__WEBPACK_IMPORTED_MODULE_16__.scalePDFValue)(size),
      height: (0,_pdf_scale__WEBPACK_IMPORTED_MODULE_16__.scalePDFValue)(size),
      color: color
    });
  };
}

/**
 * Creates a PDF report icon from an image.
 *
 * The icon uses `size` as the height, and multiplies `size` by `aspectRatio` for
 * the width. The image keeps its proportions at any size.
 *
 * @since n.e.x.t
 *
 * @param {string} src         The image's URL, from a `.png` import.
 * @param {number} aspectRatio The image's width divided by its height.
 * @return {PDFIcon} An icon that takes a `size` in pixels. It ignores `color`.
 */
function createPDFImageIcon(src, aspectRatio) {
  return function Icon({
    size = PDF_ICON_SIZE
  }) {
    return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Image, {
      src: src,
      style: {
        width: (0,_pdf_scale__WEBPACK_IMPORTED_MODULE_16__.scalePDFValue)(size * aspectRatio),
        height: (0,_pdf_scale__WEBPACK_IMPORTED_MODULE_16__.scalePDFValue)(size)
      }
    });
  };
}
const PDFAudienceMetricIconVisitors = createPDFIcon(_svg_icons_audience_metric_icon_visitors_svg_pdf__WEBPACK_IMPORTED_MODULE_7__["default"]);
const PDFAudienceMetricIconVisitsPerVisitor = createPDFIcon(_svg_icons_audience_metric_icon_visits_per_visitor_svg_pdf__WEBPACK_IMPORTED_MODULE_8__["default"]);
const PDFAudienceMetricIconPagesPerVisit = createPDFIcon(_svg_icons_audience_metric_icon_pages_per_visit_svg_pdf__WEBPACK_IMPORTED_MODULE_4__["default"]);
const PDFAudienceMetricIconPageviews = createPDFIcon(_svg_icons_audience_metric_icon_pageviews_svg_pdf__WEBPACK_IMPORTED_MODULE_5__["default"]);
const PDFAudienceMetricIconCities = createPDFIcon(_svg_icons_audience_metric_icon_cities_svg_pdf__WEBPACK_IMPORTED_MODULE_3__["default"]);
const PDFAudienceMetricIconTopContent = createPDFIcon(_svg_icons_audience_metric_icon_top_content_svg_pdf__WEBPACK_IMPORTED_MODULE_6__["default"]);
const PDFNavKeyMetricsIcon = createPDFIcon(_svg_icons_nav_key_metrics_icon_svg_pdf__WEBPACK_IMPORTED_MODULE_11__["default"], _pdf_theme__WEBPACK_IMPORTED_MODULE_17__.PDF_COLORS.SURFACES_ON_SURFACE);
const PDFNavTrafficIcon = createPDFIcon(_svg_icons_nav_traffic_icon_svg_pdf__WEBPACK_IMPORTED_MODULE_14__["default"], _pdf_theme__WEBPACK_IMPORTED_MODULE_17__.PDF_COLORS.SURFACES_ON_SURFACE);
const PDFNavContentIcon = createPDFIcon(_svg_icons_nav_content_icon_svg_pdf__WEBPACK_IMPORTED_MODULE_10__["default"], _pdf_theme__WEBPACK_IMPORTED_MODULE_17__.PDF_COLORS.SURFACES_ON_SURFACE);
const PDFNavSpeedIcon = createPDFIcon(_svg_icons_nav_speed_icon_svg_pdf__WEBPACK_IMPORTED_MODULE_13__["default"], _pdf_theme__WEBPACK_IMPORTED_MODULE_17__.PDF_COLORS.SURFACES_ON_SURFACE);
const PDFNavMonetizationIcon = createPDFIcon(_svg_icons_nav_monetization_icon_svg_pdf__WEBPACK_IMPORTED_MODULE_12__["default"], _pdf_theme__WEBPACK_IMPORTED_MODULE_17__.PDF_COLORS.SURFACES_ON_SURFACE);

/**
 * Gives the Google "G" its width from its height and keeps the letter from stretching.
 *
 * @since n.e.x.t
 */
const LOGO_G_ASPECT_RATIO = 23.599 / 24.1136;
const PDFLogoG = createPDFImageIcon(_images_logo_g_png__WEBPACK_IMPORTED_MODULE_1__, LOGO_G_ASPECT_RATIO);
const PDFStarFill = createPDFIcon(_svg_icons_star_fill_svg_pdf__WEBPACK_IMPORTED_MODULE_15__["default"], _pdf_theme__WEBPACK_IMPORTED_MODULE_17__.PDF_COLORS.VIOLET_V_600);
const PDFChevronRight = createPDFIcon(_svg_icons_chevron_right_svg_pdf__WEBPACK_IMPORTED_MODULE_9__["default"], _pdf_theme__WEBPACK_IMPORTED_MODULE_17__.PDF_COLORS.CONTENT_SECONDARY);

/**
 * Maps a dashboard context slug to its section icon.
 *
 * The map covers the main-dashboard contexts that draw an icon in the report.
 * Site goals has no entry, so `PDFChip` renders its chip with a label only.
 *
 * @since n.e.x.t
 */
const SECTION_ICONS = {
  [_js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_KEY_METRICS]: PDFNavKeyMetricsIcon,
  [_js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_TRAFFIC]: PDFNavTrafficIcon,
  [_js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_CONTENT]: PDFNavContentIcon,
  [_js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_SPEED]: PDFNavSpeedIcon,
  [_js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_MONETIZATION]: PDFNavMonetizationIcon
};

/***/ },

/***/ "./js/components/pdf-export/pdf-scale.ts"
/*!***********************************************!*\
  !*** ./js/components/pdf-export/pdf-scale.ts ***!
  \***********************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   PDF_FIGMA_CONTENT_WIDTH: () => (/* binding */ PDF_FIGMA_CONTENT_WIDTH),
/* harmony export */   PDF_PAGE_BOTTOM_PADDING: () => (/* binding */ PDF_PAGE_BOTTOM_PADDING),
/* harmony export */   PDF_PAGE_PADDING: () => (/* binding */ PDF_PAGE_PADDING),
/* harmony export */   PDF_PAGE_WIDTH: () => (/* binding */ PDF_PAGE_WIDTH),
/* harmony export */   PDF_SCALE: () => (/* binding */ PDF_SCALE),
/* harmony export */   PDF_SCALED_PROPERTIES: () => (/* binding */ PDF_SCALED_PROPERTIES),
/* harmony export */   createPDFStyles: () => (/* binding */ createPDFStyles),
/* harmony export */   scalePDFValue: () => (/* binding */ scalePDFValue)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/**
 * Shared scale and style helpers for the PDF report (@react-pdf/renderer).
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/** Width of the PDF page, in points. */
const PDF_PAGE_WIDTH = 612;

/** Padding from the page edge to the report content, in points. */
const PDF_PAGE_PADDING = 24;

/** Width of the report content in the Figma design, in pixels. */
const PDF_FIGMA_CONTENT_WIDTH = 1133;

/**
 * Scale from a Figma content pixel to a PDF page content point.
 *
 * The Figma content is wider than the PDF page, so multiplying a Figma length
 * by this scale gives its length on the PDF page. The scale is the PDF page
 * content width (`PDF_PAGE_WIDTH - 2 * PDF_PAGE_PADDING`) divided by the Figma
 * content width.
 */
const PDF_SCALE = (PDF_PAGE_WIDTH - 2 * PDF_PAGE_PADDING) / PDF_FIGMA_CONTENT_WIDTH;

/**
 * The padding under the footer links, in points.
 *
 * The Figma design sets the padding to 44 frame pixels, and `scalePDFValue`
 * converts that length to points. The final page height is the measured
 * height plus the padding.
 *
 * @since 1.185.0
 */
const PDF_PAGE_BOTTOM_PADDING = scalePDFValue(44);

/**
 * Style properties whose numeric value is a length.
 *
 * `createPDFStyles` multiplies these values by `PDF_SCALE`. Every other
 * property, such as a color, font family, line height, weight, or flex ratio,
 * keeps its value.
 */
const PDF_SCALED_PROPERTIES = new Set([
// Text.
'fontSize', 'letterSpacing',
// Margin.
'margin', 'marginHorizontal', 'marginVertical', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft',
// Padding.
'padding', 'paddingHorizontal', 'paddingVertical', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft',
// Size.
'width', 'height', 'minWidth', 'maxWidth', 'minHeight', 'maxHeight',
// Position.
'top', 'right', 'bottom', 'left',
// Gap.
'gap', 'rowGap', 'columnGap',
// Border width.
'borderWidth', 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth',
// Border radius.
'borderRadius', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius',
// Flex.
'flexBasis']);

/**
 * Scales one Figma frame length to a page point value.
 *
 * Use it for a length that a widget sets outside a style object, such as an
 * `Svg` width or height.
 *
 * @since 1.183.0
 *
 * @param {number} value The length, in Figma frame pixels.
 * @return {number} The length, in page points.
 */
function scalePDFValue(value) {
  return value * PDF_SCALE;
}

/**
 * Builds scaled @react-pdf styles from Figma frame sizes.
 *
 * A widget writes each style with the sizes from the Figma frame. Each length
 * property in `PDF_SCALED_PROPERTIES` with a numeric value is multiplied by
 * `PDF_SCALE`. A non-numeric value (such as `'100%'`) and every other property
 * keep their values. The scaled styles are passed to `StyleSheet.create`.
 *
 * @since 1.183.0
 *
 * @param {Object} styles Named styles with sizes from the Figma frame.
 * @return {Object} The named styles with each length scaled to points.
 */
function createPDFStyles(styles) {
  const scaledStyles = {};
  for (const [name, style] of Object.entries(styles)) {
    const scaledStyle = {};
    for (const [property, value] of Object.entries(style)) {
      scaledStyle[property] = PDF_SCALED_PROPERTIES.has(property) && typeof value === 'number' ? value * PDF_SCALE : value;
    }
    scaledStyles[name] = scaledStyle;
  }
  return _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.StyleSheet.create(scaledStyles);
}

/***/ },

/***/ "./js/components/pdf-export/pdf-theme.ts"
/*!***********************************************!*\
  !*** ./js/components/pdf-export/pdf-theme.ts ***!
  \***********************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   PDF_COLORS: () => (/* binding */ PDF_COLORS),
/* harmony export */   PDF_FONT_FAMILY_DISPLAY: () => (/* binding */ PDF_FONT_FAMILY_DISPLAY),
/* harmony export */   PDF_FONT_FAMILY_TEXT: () => (/* binding */ PDF_FONT_FAMILY_TEXT),
/* harmony export */   PDF_MEASURE_PAGE_HEIGHT: () => (/* binding */ PDF_MEASURE_PAGE_HEIGHT),
/* harmony export */   PIE_CHART_COLORS: () => (/* binding */ PIE_CHART_COLORS)
/* harmony export */ });
/**
 * Shared theme constants for the PDF export (@react-pdf/renderer).
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * The `@react-pdf` family name for display and headline text.
 *
 * `registerPDFFonts()` registers Google Sans Display under it, at regular
 * 400 and medium 500.
 *
 * @since 1.182.0
 */
const PDF_FONT_FAMILY_DISPLAY = 'GoogleSansDisplay';

/**
 * The `@react-pdf` family name for title, body, and label text.
 *
 * `registerPDFFonts()` registers Google Sans Text under it, at regular 400
 * and medium 500.
 *
 * @since 1.182.0
 */
const PDF_FONT_FAMILY_TEXT = 'GoogleSansText';

/**
 * The page height, in points, for the measurement render pass.
 *
 * Tall enough to hold any report on one page without pagination, while
 * staying under the PDF specification's hard page-size limit.
 *
 * @since 1.185.0
 */
const PDF_MEASURE_PAGE_HEIGHT = 14400;

/**
 * Shared colors for the PDF report.
 *
 * `@react-pdf` builds the PDF from JavaScript values and can't read the
 * dashboard's CSS. So each color lives here as a copy: the key is a Sass
 * token name from `assets/sass/config/_variables-mui3.scss`, and the value
 * is that token's hex.
 *
 * @since 1.183.0
 */
const PDF_COLORS = {
  SURFACES_ON_SURFACE: '#161b18',
  // $c-surfaces-on-surface
  SURFACES_ON_SURFACE_VARIANT: '#6c726e',
  // $c-surfaces-on-surface-variant
  CONTENT_SECONDARY: '#108080',
  // $c-content-secondary
  SURFACES_SURFACE_1: '#ebeef0',
  // $c-surfaces-surface-1
  SURFACES_BACKGROUND: '#f3f5f7',
  // $c-surfaces-background
  SURFACES_SURFACE: '#ffffff',
  // $c-surfaces-surface
  GREEN_G_50: '#d8ffc0',
  // $c-green-g-50
  UTILITY_ON_SUCCESS_CONTAINER: '#1f4c04',
  // $c-utility-on-success-container
  UTILITY_ERROR_CONTAINER: '#ffded3',
  // $c-utility-error-container
  UTILITY_ON_ERROR_CONTAINER: '#7a1e00',
  // $c-utility-on-error-container
  SURFACES_INVERSE_ON_SURFACE: '#ebeef0',
  // $c-surfaces-inverse-on-surface
  NEUTRAL_N_700: '#333935',
  // $c-neutral-n-700
  VIOLET_V_50: '#e3d1ff',
  // $c-violet-v-50
  VIOLET_V_600: '#462083',
  // $c-violet-v-600
  YELLOW_Y_50: '#ffe4b1',
  // $c-yellow-y-50
  YELLOW_Y_500: '#895a00',
  // $c-yellow-y-500
  YELLOW_Y_600: '#684500',
  // $c-yellow-y-600
  UTILITY_WARNING_CONTAINER: '#ffe4b1',
  // $c-utility-warning-container
  BLUE_B_400: '#6380b8',
  // $c-blue-b-400
  TEAL_T_300: '#4bbbbb',
  // $c-teal-t-300
  SITE_KIT_SK_500: '#3c7251',
  // $c-site-kit-sk-500
  VIOLET_V_300: '#8e68cb',
  // $c-violet-v-300
  YELLOW_Y_100: '#fece72',
  // $c-yellow-y-100
  VIOLET_V_200: '#a983e6',
  // $c-violet-v-200
  BLUE_B_100: '#bed4ff',
  // $c-blue-b-100
  PINK_P_200: '#ee92da',
  // $c-pink-p-200
  RED_R_200: '#ff9b7a' // $c-red-r-200
};

/**
 * Donut chart colors for the PDF report, in slice order.
 *
 * Each slice and its legend row read the same color from this list, so they
 * always match. The list matches the dashboard's donut colors, so each donut
 * looks the same in the dashboard and the PDF.
 *
 * @since 1.184.0
 */
const PIE_CHART_COLORS = [PDF_COLORS.YELLOW_Y_100, PDF_COLORS.VIOLET_V_200, PDF_COLORS.BLUE_B_100, PDF_COLORS.PINK_P_200, PDF_COLORS.RED_R_200];

/***/ },

/***/ "./js/components/pdf-export/pdf-typography.ts"
/*!****************************************************!*\
  !*** ./js/components/pdf-export/pdf-typography.ts ***!
  \****************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   PDF_TYPOGRAPHY: () => (/* binding */ PDF_TYPOGRAPHY)
/* harmony export */ });
/* harmony import */ var _pdf_scale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _pdf_theme__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/**
 * Scaled typography styles for the PDF export (@react-pdf/renderer).
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */



/**
 * The typography in pixels, before the page scale.
 *
 * `@react-pdf` can't read the dashboard's CSS, so each entry copies
 * `$typography-settings` and `$typography-font-families` from
 * `assets/sass/components/global/_googlesitekit-typography.scss`. The PDF
 * text then reads the same as the dashboard.
 */
const UNSCALED_TYPOGRAPHY = {
  display: {
    small: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_DISPLAY,
      fontSize: 38,
      fontWeight: 400,
      letterSpacing: 0,
      lineHeight: 1.158
    },
    medium: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_DISPLAY,
      fontSize: 46,
      fontWeight: 400,
      letterSpacing: 0,
      lineHeight: 1.13
    },
    large: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_DISPLAY,
      fontSize: 58,
      fontWeight: 400,
      letterSpacing: -0.25,
      lineHeight: 1.1
    }
  },
  headline: {
    small: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_DISPLAY,
      fontSize: 22,
      fontWeight: 400,
      letterSpacing: 0,
      lineHeight: 1.27
    },
    medium: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_DISPLAY,
      fontSize: 28,
      fontWeight: 400,
      letterSpacing: 0,
      lineHeight: 1.286
    },
    large: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_DISPLAY,
      fontSize: 32,
      fontWeight: 400,
      letterSpacing: 0,
      lineHeight: 1.25
    }
  },
  title: {
    small: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
      fontSize: 14,
      fontWeight: 500,
      letterSpacing: -0.1,
      lineHeight: 1.14
    },
    medium: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
      fontSize: 16,
      fontWeight: 500,
      letterSpacing: 0.1,
      lineHeight: 1.25
    },
    large: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
      fontSize: 18,
      fontWeight: 500,
      letterSpacing: 0,
      lineHeight: 1.33
    }
  },
  body: {
    small: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
      fontSize: 12,
      fontWeight: 400,
      letterSpacing: 0.2,
      lineHeight: 1.33
    },
    medium: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
      fontSize: 14,
      fontWeight: 400,
      letterSpacing: 0.25,
      lineHeight: 1.43
    },
    large: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
      fontSize: 16,
      fontWeight: 400,
      letterSpacing: 0.5,
      lineHeight: 1.5
    }
  },
  label: {
    small: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
      fontSize: 12,
      fontWeight: 500,
      letterSpacing: 0.2,
      lineHeight: 1.33
    },
    medium: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
      fontSize: 14,
      fontWeight: 500,
      letterSpacing: 0,
      lineHeight: 1.43
    },
    large: {
      fontFamily: _pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
      fontSize: 16,
      fontWeight: 500,
      letterSpacing: 0,
      lineHeight: 1.5
    }
  }
};

/**
 * Complete text styles for each typography type and size.
 *
 * Each entry holds the font family, size, weight, letter spacing, and line
 * height, ready to apply to a `<Text>`. The PDF page is measured in points
 * and is narrower than the dashboard's pixel values assume, so
 * `createPDFStyles` scales the font size and letter spacing down to page
 * points. The line height is a ratio and the weight is a keyword, so both
 * apply as they are.
 *
 * This lives apart from `pdf-theme.ts` because building it calls
 * `createPDFStyles`, which imports `@react-pdf/renderer`. Keeping it here means
 * the plain constants in `pdf-theme.ts` can be imported by eagerly-loaded code
 * (such as the widgets' `getPDFData` loaders) without pulling `@react-pdf` into
 * the initial vendor chunk.
 *
 * @since 1.183.0
 */
const PDF_TYPOGRAPHY = {
  display: (0,_pdf_scale__WEBPACK_IMPORTED_MODULE_0__.createPDFStyles)(UNSCALED_TYPOGRAPHY.display),
  headline: (0,_pdf_scale__WEBPACK_IMPORTED_MODULE_0__.createPDFStyles)(UNSCALED_TYPOGRAPHY.headline),
  title: (0,_pdf_scale__WEBPACK_IMPORTED_MODULE_0__.createPDFStyles)(UNSCALED_TYPOGRAPHY.title),
  body: (0,_pdf_scale__WEBPACK_IMPORTED_MODULE_0__.createPDFStyles)(UNSCALED_TYPOGRAPHY.body),
  label: (0,_pdf_scale__WEBPACK_IMPORTED_MODULE_0__.createPDFStyles)(UNSCALED_TYPOGRAPHY.label)
};

/***/ },

/***/ "./js/components/pdf-export/pdf-utils.ts"
/*!***********************************************!*\
  !*** ./js/components/pdf-export/pdf-utils.ts ***!
  \***********************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getPDFFilename: () => (/* binding */ getPDFFilename),
/* harmony export */   triggerDownload: () => (/* binding */ triggerDownload)
/* harmony export */ });
/**
 * PDF export utilities.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Sanitizes a free-form string into a lowercase, hyphen-separated slug
 * suitable for use inside a filename.
 *
 * @since 1.181.0
 *
 * @param value Input string. Empty and non-string values become an empty slug.
 * @return The sanitized slug.
 */
function slugify(value) {
  if (typeof value !== 'string' || value.length === 0) {
    return '';
  }
  const withoutScheme = value.replace(/^[a-z][a-z0-9+\-.]*:\/\//i, '');
  return withoutScheme.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
}

/**
 * Returns the current date as `YYYY-MM-DD` using the local timezone.
 *
 * @since 1.181.0
 *
 * @param [now] Optional date instance, defaults to `new Date()`.
 * @return The formatted date.
 */
function getISODate(
// The filename's date stamp is the actual generation moment, not the
// dashboard's analytics reference date.
// eslint-disable-next-line sitekit/no-direct-date
now = new Date()) {
  const year = now.getFullYear();
  const month = String(now.getMonth() + 1).padStart(2, '0');
  const day = String(now.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
}

/**
 * Builds a sanitized PDF filename for the dashboard export.
 *
 * The result is `site-kit-<site>-<dateRange>-<date>.pdf` when a date range
 * is supplied, or `site-kit-<site>-<date>.pdf` otherwise. The site and date
 * range are passed through `slugify` so the filename is filesystem-safe on
 * every supported OS.
 *
 * @since 1.181.0
 *
 * @param siteName    Site name or URL.
 * @param [dateRange] Optional date range slug, e.g. `last-28-days`.
 * @param [now]       Optional date instance, defaults to `new Date()`.
 * @return The composed filename.
 */
function getPDFFilename(siteName, dateRange,
// The filename's date stamp is the actual generation moment, not the
// dashboard's analytics reference date.
// eslint-disable-next-line sitekit/no-direct-date
now = new Date()) {
  const siteSlug = slugify(siteName) || 'report';
  const rangeSlug = slugify(dateRange);
  const date = getISODate(now);
  const segments = ['site-kit', siteSlug];
  if (rangeSlug) {
    segments.push(rangeSlug);
  }
  segments.push(date);
  return `${segments.join('-')}.pdf`;
}

/**
 * Triggers a browser download for the given blob URL by creating a temporary
 * anchor element with the `download` attribute, clicking it programmatically,
 * and removing it from the DOM.
 *
 * @since 1.181.0
 *
 * @param  url      Blob URL pointing to the generated file.
 * @param  filename Suggested filename for the downloaded file.
 * @return {void}
 */
function triggerDownload(url, filename) {
  const link = globalThis.document.createElement('a');
  link.href = url;
  link.download = filename;
  link.rel = 'noopener';
  link.style.display = 'none';
  globalThis.document.body.appendChild(link);
  link.click();
  globalThis.document.body.removeChild(link);
}

/***/ },

/***/ "./js/components/pdf-export/pdf-widget-eligibility.ts"
/*!************************************************************!*\
  !*** ./js/components/pdf-export/pdf-widget-eligibility.ts ***!
  \************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isActivePDFWidget: () => (/* binding */ isActivePDFWidget)
/* harmony export */ });
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_util_widget_modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/widgets/util/widget-modules */ "./js/googlesitekit/widgets/util/widget-modules.js");
/**
 * PDF export widget eligibility helpers.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */




/**
 * A registry widget that declares a PDF export configuration.
 *
 * @since 1.183.0
 */

/**
 * Determines whether a registry widget declares a PDF export configuration.
 *
 * @since 1.183.0
 *
 * @param widget Registry widget.
 * @return `true` when the widget has a `pdf` config.
 */
function hasPDFConfig(widget) {
  return !!widget.pdf;
}

/**
 * Determines whether a widget should be included in the PDF export.
 *
 * A widget is eligible when it declares a `pdf` config, every module it
 * needs is connected, and its optional `pdf.isActive` returns `true`.
 * The sections selection panel and the orchestrator both use this
 * function, so the panel and the report always show the same widgets.
 *
 * On the Site Kit dashboard, the `whenActive` HOC keeps a disconnected
 * module's widgets off the screen. The PDF export skips that HOC, so this
 * function checks the modules instead. Without that check, `getData` would
 * run for a disconnected module, and the API would reject the request with
 * the "Module must be active to request data" error.
 *
 * @since 1.183.0
 * @since 1.184.0 Require every module in `widget.modules` to be connected.
 *
 * @param widget Registry widget.
 * @param select Registry `select` function.
 * @return `true` when the widget should appear in the PDF.
 */
function isActivePDFWidget(widget, select) {
  if (!hasPDFConfig(widget)) {
    return false;
  }
  if (widget.pdf.isActive && !widget.pdf.isActive(select)) {
    return false;
  }

  // `isModuleConnected` returns `undefined` while modules load and `null`
  // for an unknown module, so only `true` counts as connected.
  return (0,_js_googlesitekit_widgets_util_widget_modules__WEBPACK_IMPORTED_MODULE_1__.normalizeWidgetModules)(widget.modules ?? []).every(slug => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.CORE_MODULES).isModuleConnected(slug) === true);
}

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/DashboardReport.tsx"
/*!**********************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/DashboardReport.tsx ***!
  \**********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_pdf_export_formatDateString__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/formatDateString */ "./js/components/pdf-export/formatDateString.ts");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFFooter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFFooter */ "./js/components/pdf-export/shared-react-pdf-components/PDFFooter.tsx");
/* harmony import */ var _js_util_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util/i18n */ "./js/util/i18n.js");
/* harmony import */ var _PDFEmailReportingNotice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PDFEmailReportingNotice */ "./js/components/pdf-export/shared-react-pdf-components/PDFEmailReportingNotice.tsx");
/* harmony import */ var _PDFHeader__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./PDFHeader */ "./js/components/pdf-export/shared-react-pdf-components/PDFHeader.tsx");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * DashboardReport: minimal `react-pdf` Document used by the MVP export.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */









/**
 * Formats a date range for the document title, e.g. "Jan 1, 2021 - Jan 28, 2021".
 *
 * @since 1.184.0
 *
 * @param dateRange           The report date range.
 * @param dateRange.startDate The first day of the range, as `YYYY-MM-DD`.
 * @param dateRange.endDate   The last day of the range, as `YYYY-MM-DD`.
 * @return The localized date range, or an empty string when neither date is valid.
 */
function formatDocumentDateRange(dateRange) {
  const startDate = (0,_js_components_pdf_export_formatDateString__WEBPACK_IMPORTED_MODULE_2__.formatDateString)(dateRange.startDate);
  const endDate = (0,_js_components_pdf_export_formatDateString__WEBPACK_IMPORTED_MODULE_2__.formatDateString)(dateRange.endDate);
  return startDate && endDate ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: Report start date. 2: Report end date. */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%1$s - %2$s', 'google-site-kit'), startDate, endDate) : startDate || endDate;
}
const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__.createPDFStyles)({
  page: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_FONT_FAMILY_TEXT,
    fontSize: 12,
    backgroundColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.SURFACES_BACKGROUND
  },
  body: {
    flexGrow: 1,
    // The report body owns the spacing between areas, so no area or widget
    // sets its own outer margin.
    gap: 50
  },
  // Gap between the widgets inside one area.
  widgets: {
    gap: 30
  },
  // Gap below an area title and above its first widget.
  areaTitle: {
    marginBottom: 20
  }
});

/**
 * A report widget whose component chunk loaded, ready to render.
 */

/**
 * Determines whether a report widget has content to render.
 *
 * A widget without a component failed to load, and a widget without data has
 * an empty or failed report behind it. The report skips both.
 *
 * @since 1.183.0
 *
 * @param widget A loaded report widget entry.
 * @return `true` when the widget has content to render.
 */
function isRenderableWidget(widget) {
  return Boolean(widget.Component && widget.data);
}
const DashboardReport = ({
  siteName,
  siteURL,
  dashboardURL,
  dateRange,
  sections,
  helpCenterURL,
  privacyPolicyURL,
  pageHeight = _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_MEASURE_PAGE_HEIGHT,
  onRender,
  sectionAnchors,
  areas = [],
  emailReportingSetupURL
}) => {
  /**
   * An area renders only the widgets with content. The report skips an area
   * where no widget has content, and the header shows no chip for it, so
   * the report holds no empty section.
   */
  const renderableAreas = areas.map(area => ({
    ...area,
    widgets: area.widgets.filter(isRenderableWidget)
  })).filter(({
    widgets
  }) => widgets.length > 0);
  const renderableAreaSlugs = new Set(renderableAreas.map(({
    areaSlug
  }) => areaSlug));
  const renderableSections = sections.filter(({
    slug
  }) => renderableAreaSlugs.has(slug));
  let title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Site Kit Dashboard Report', 'google-site-kit');
  if (siteName) {
    const formattedDateRange = formatDocumentDateRange(dateRange);
    title = formattedDateRange ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: Site name. 2: Report date range. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%1$s: Site Kit report (%2$s)', 'google-site-kit'), siteName, formattedDateRange) : siteName;
  }
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Document, {
    title: title,
    author: siteName,
    subject: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Site Kit report', 'google-site-kit'),
    keywords: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Site Kit, Google, report', 'google-site-kit'),
    language: (0,_js_util_i18n__WEBPACK_IMPORTED_MODULE_6__.getLocale)(),
    pageMode: "useOutlines",
    onRender: onRender
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Page, {
    size: [_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__.PDF_PAGE_WIDTH, pageHeight],
    style: [styles.page, {
      padding: _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__.PDF_PAGE_PADDING,
      paddingBottom: _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__.PDF_PAGE_BOTTOM_PADDING
    }],
    wrap: false
  }, (sectionAnchors || []).map(({
    id,
    top
  }) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    key: id,
    id: id,
    style: {
      position: 'absolute',
      top,
      left: 0,
      width: 0,
      height: 0
    }
  })), /*#__PURE__*/React.createElement(_PDFHeader__WEBPACK_IMPORTED_MODULE_8__["default"], {
    siteURL: siteURL,
    dashboardURL: dashboardURL,
    dateRange: dateRange,
    sections: renderableSections
  }), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.body
  }, renderableAreas.length === 0 && /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_9__["default"], {
    size: "small",
    style: {
      color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT
    }
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No report data available.', 'google-site-kit')), renderableAreas.map(({
    areaSlug,
    areaTitle,
    widgets
  }) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    key: `section-${areaSlug}`,
    id: sectionAnchors ? undefined : `section-${areaSlug}`
    // react-pdf's types have a bug that prevents passing a `bookmark` prop, so we use a spread to bypass it.
    // See: https://github.com/diegomura/react-pdf/issues/1979#issuecomment-1231391616
    ,
    bookmark: areaTitle
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_9__["default"], {
    type: "headline",
    style: styles.areaTitle
  }, areaTitle), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.widgets
  }, widgets.map(({
    slug,
    Component,
    data,
    chartImages
  }) => /*#__PURE__*/React.createElement(Component, {
    key: slug,
    data: data,
    chartImages: chartImages
  })))))), /*#__PURE__*/React.createElement(_PDFEmailReportingNotice__WEBPACK_IMPORTED_MODULE_7__["default"], {
    emailReportingSetupURL: emailReportingSetupURL
  }), /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFFooter__WEBPACK_IMPORTED_MODULE_5__["default"], {
    dashboardURL: dashboardURL,
    helpCenterURL: helpCenterURL,
    privacyPolicyURL: privacyPolicyURL
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DashboardReport);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFBadge.tsx"
/*!***************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFBadge.tsx ***!
  \***************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * A rounded pill badge for the PDF report, colored by its caller.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */


const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  badge: {
    borderRadius: 100,
    paddingVertical: 4,
    paddingHorizontal: 8
  }
});
const PDFBadge = ({
  label,
  backgroundColor,
  color,
  style
}) => {
  const baseStyle = [styles.badge, {
    backgroundColor
  }];
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: style ? baseStyle.concat(style) : baseStyle
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_2__["default"], {
    type: "label",
    size: "small",
    style: {
      color
    }
  }, label));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFBadge);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFButton.tsx"
/*!****************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFButton.tsx ***!
  \****************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * A button for the PDF report, wrapped in a link so it works in the PDF.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */


const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  link: {
    textDecoration: 'none'
  },
  button: {
    borderRadius: 100,
    paddingVertical: 6,
    paddingHorizontal: 16
  }
});
const PDFButton = ({
  href,
  backgroundColor,
  labelColor,
  children
}) => {
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Link, {
    src: href,
    style: styles.link
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: [styles.button, {
      backgroundColor
    }]
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_2__["default"], {
    type: "label",
    style: {
      color: labelColor
    }
  }, children)));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFButton);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFCard.tsx"
/*!**************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFCard.tsx ***!
  \**************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * A white card that holds one section of the PDF report.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */


const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  card: {
    backgroundColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_SURFACE,
    borderRadius: 16,
    paddingVertical: 18,
    paddingHorizontal: 24
  }
});
const PDFCard = ({
  style,
  children
}) => {
  const baseStyles = [styles.card];
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: style ? baseStyles.concat(style) : styles.card
  }, children);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFCard);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFChangeBadge.tsx"
/*!*********************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFChangeBadge.tsx ***!
  \*********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFBadge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PDFBadge */ "./js/components/pdf-export/shared-react-pdf-components/PDFBadge.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * A badge that shows a metric's change, colored for a rise or a fall.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */


const BADGE_COLORS = {
  positive: {
    backgroundColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_0__.PDF_COLORS.GREEN_G_50,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_0__.PDF_COLORS.UTILITY_ON_SUCCESS_CONTAINER
  },
  negative: {
    backgroundColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_0__.PDF_COLORS.UTILITY_ERROR_CONTAINER,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_0__.PDF_COLORS.UTILITY_ON_ERROR_CONTAINER
  },
  noChange: {
    backgroundColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_0__.PDF_COLORS.SURFACES_INVERSE_ON_SURFACE,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_0__.PDF_COLORS.NEUTRAL_N_700
  }
};
const PDFChangeBadge = ({
  change,
  changeType = 'positive'
}) => {
  const {
    backgroundColor,
    color
  } = BADGE_COLORS[changeType];
  return /*#__PURE__*/React.createElement(_PDFBadge__WEBPACK_IMPORTED_MODULE_1__["default"], {
    label: change,
    backgroundColor: backgroundColor,
    color: color
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFChangeBadge);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFChip.tsx"
/*!**************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFChip.tsx ***!
  \**************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * A pill-shaped chip with a label and an optional icon.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */



const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  chip: {
    flexDirection: 'row',
    alignItems: 'center',
    borderWidth: 1,
    borderColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_SURFACE_1,
    borderRadius: 100,
    paddingVertical: 8,
    paddingHorizontal: 12
  },
  label: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_FONT_FAMILY_DISPLAY,
    letterSpacing: 0.5
  },
  labelWithIcon: {
    marginLeft: 4
  }
});
const PDFChip = ({
  label,
  Icon
}) => {
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.chip
  }, Icon && /*#__PURE__*/React.createElement(Icon, {
    size: 20,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_ON_SURFACE
  }), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_3__["default"], {
    type: "label",
    size: "small",
    style: [styles.label, ...(Icon ? [styles.labelWithIcon] : [])]
  }, label));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFChip);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFEmailReportingNotice.tsx"
/*!******************************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFEmailReportingNotice.tsx ***!
  \******************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-icons */ "./js/components/pdf-export/pdf-icons.tsx");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PDFButton */ "./js/components/pdf-export/shared-react-pdf-components/PDFButton.tsx");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFEmailReportingNotice: Email Reporting setup notice for the PDF report.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





const noticeTextColor = {
  color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.VIOLET_V_600
};
const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__.createPDFStyles)({
  container: {
    flexDirection: 'row',
    alignItems: 'center',
    // The notice renders outside the report body's `gap` spacing, so it
    // sets its own top margin.
    marginTop: 59,
    backgroundColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.VIOLET_V_50,
    borderRadius: 16,
    paddingVertical: 14,
    paddingHorizontal: 24
  },
  textColumn: {
    flexGrow: 1,
    flexShrink: 1,
    marginLeft: 16,
    marginRight: 60
  },
  button: {
    flexShrink: 0
  }
});
const PDFEmailReportingNotice = ({
  emailReportingSetupURL
}) => {
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.container
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_2__.PDFStarFill, {
    size: 24
  }), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.textColumn
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_6__["default"], {
    type: "label",
    style: noticeTextColor
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Get your site’s most important insights delivered to your inbox', 'google-site-kit')), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_6__["default"], {
    style: noticeTextColor
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Stay updated with a summary of your site’s performance, key trends, and tailored metrics sent directly to your inbox.', 'google-site-kit')), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_6__["default"], {
    style: noticeTextColor
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This feature is available exclusively to Site Kit users.', 'google-site-kit'))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.button
  }, /*#__PURE__*/React.createElement(_PDFButton__WEBPACK_IMPORTED_MODULE_5__["default"], {
    href: emailReportingSetupURL,
    backgroundColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.VIOLET_V_600,
    labelColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.SURFACES_SURFACE
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Set up email reports', 'google-site-kit'))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFEmailReportingNotice);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFFooter.tsx"
/*!****************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFFooter.tsx ***!
  \****************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFLink__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PDFLink */ "./js/components/pdf-export/shared-react-pdf-components/PDFLink.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFFooter: the footer links of the PDF report.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__.createPDFStyles)({
  footer: {
    flexDirection: 'row',
    flexWrap: 'wrap',
    justifyContent: 'center',
    alignItems: 'flex-start',
    columnGap: 49.5,
    rowGap: 4,
    // The footer renders outside the report body's `gap` spacing, so it
    // sets its own top margin.
    marginTop: 44
  },
  link: {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT
  }
});
const PDFFooter = ({
  dashboardURL,
  helpCenterURL,
  privacyPolicyURL
}) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
  style: styles.footer
}, /*#__PURE__*/React.createElement(_PDFLink__WEBPACK_IMPORTED_MODULE_4__["default"], {
  href: dashboardURL,
  type: "label",
  size: "small",
  style: styles.link
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('View dashboard', 'google-site-kit')), /*#__PURE__*/React.createElement(_PDFLink__WEBPACK_IMPORTED_MODULE_4__["default"], {
  href: helpCenterURL,
  type: "label",
  size: "small",
  style: styles.link
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Help center', 'google-site-kit')), /*#__PURE__*/React.createElement(_PDFLink__WEBPACK_IMPORTED_MODULE_4__["default"], {
  href: privacyPolicyURL,
  type: "label",
  size: "small",
  style: styles.link
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Privacy Policy', 'google-site-kit')));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFFooter);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFHeader.tsx"
/*!****************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFHeader.tsx ***!
  \****************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_pdf_export_formatDateString__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/formatDateString */ "./js/components/pdf-export/formatDateString.ts");
/* harmony import */ var _js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-icons */ "./js/components/pdf-export/pdf-icons.tsx");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFChip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PDFChip */ "./js/components/pdf-export/shared-react-pdf-components/PDFChip.tsx");
/* harmony import */ var _PDFLink__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PDFLink */ "./js/components/pdf-export/shared-react-pdf-components/PDFLink.tsx");
/* harmony import */ var _PDFSiteKitLogo__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./PDFSiteKitLogo */ "./js/components/pdf-export/shared-react-pdf-components/PDFSiteKitLogo.tsx");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFHeader: report header strip rendered with @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */









/**
 * Extracts the host (e.g. "www.example.com") from the reference site URL for
 * display as the header's site address.
 *
 * @since 1.182.0
 *
 * @param siteURL The reference site URL.
 * @return The host, or the original value when it cannot be parsed.
 */
function getSiteHost(siteURL) {
  try {
    return new URL(siteURL).host;
  } catch {
    return siteURL;
  }
}

/**
 * The page adds padding around its content. The header uses negative margins
 * to pull its white background to the page edges. It then uses matching
 * padding to keep its text at the page margin.
 */
const headerFullWidthOffsets = {
  marginTop: -_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_4__.PDF_PAGE_PADDING,
  marginHorizontal: -_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_4__.PDF_PAGE_PADDING,
  paddingHorizontal: _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_4__.PDF_PAGE_PADDING
};
const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_4__.createPDFStyles)({
  header: {
    backgroundColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_5__.PDF_COLORS.SURFACES_SURFACE,
    marginBottom: 24,
    paddingTop: 16,
    paddingBottom: 11
  },
  topRow: {
    flexDirection: 'row',
    alignItems: 'center',
    marginBottom: 29
  },
  divider: {
    width: 1,
    height: 39,
    backgroundColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_5__.PDF_COLORS.SURFACES_SURFACE_1,
    marginHorizontal: 22
  },
  titleBlock: {
    flexGrow: 1,
    flexShrink: 1
  },
  siteBlock: {
    flexShrink: 0,
    marginLeft: 16,
    alignItems: 'flex-end'
  },
  chipRow: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'space-between'
  },
  chips: {
    flexDirection: 'row',
    flexWrap: 'wrap',
    flexGrow: 1,
    flexShrink: 1,
    rowGap: 8
  },
  chipWrapper: {
    marginRight: 24
  },
  chipLink: {
    textDecoration: 'none'
  },
  viewDashboard: {
    flexShrink: 0,
    marginLeft: 8
  },
  viewDashboardLink: {
    // Gap between the "View dashboard in Site Kit" text and its chevron icon.
    marginRight: 4
  }
});
const PDFHeader = ({
  siteURL,
  dashboardURL,
  dateRange,
  sections
}) => {
  const startDate = (0,_js_components_pdf_export_formatDateString__WEBPACK_IMPORTED_MODULE_2__.formatDateString)(dateRange.startDate);
  const endDate = (0,_js_components_pdf_export_formatDateString__WEBPACK_IMPORTED_MODULE_2__.formatDateString)(dateRange.endDate);
  /** Avoid a dangling " - " when one (or both) of the dates is invalid. */
  const formattedDateRange = startDate && endDate ? `${startDate} - ${endDate}` : startDate || endDate;
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: [styles.header, headerFullWidthOffsets]
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.topRow
  }, /*#__PURE__*/React.createElement(_PDFSiteKitLogo__WEBPACK_IMPORTED_MODULE_8__["default"], null), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.divider
  }), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.titleBlock
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_9__["default"], {
    style: {
      color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_5__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT
    }
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Your site's performance", 'google-site-kit')), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_9__["default"], {
    type: "headline",
    size: "small"
  }, formattedDateRange)), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.siteBlock
  }, /*#__PURE__*/React.createElement(_PDFLink__WEBPACK_IMPORTED_MODULE_7__["default"], {
    href: dashboardURL,
    style: {
      color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_5__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT
    }
  }, getSiteHost(siteURL)))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.chipRow
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.chips
  }, sections.map(({
    slug,
    label,
    Icon
  }) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    key: slug,
    style: styles.chipWrapper
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Link, {
    src: `#section-${slug}`,
    style: styles.chipLink
  }, /*#__PURE__*/React.createElement(_PDFChip__WEBPACK_IMPORTED_MODULE_6__["default"], {
    label: label,
    Icon: Icon
  }))))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.viewDashboard
  }, /*#__PURE__*/React.createElement(_PDFLink__WEBPACK_IMPORTED_MODULE_7__["default"], {
    href: dashboardURL,
    type: "label",
    style: styles.viewDashboardLink,
    trailingIcon: /*#__PURE__*/React.createElement(_js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_3__.PDFChevronRight, {
      size: 10
    })
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('View dashboard in Site Kit', 'google-site-kit')))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFHeader);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFLink.tsx"
/*!**************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFLink.tsx ***!
  \**************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * A text link for the PDF report, with an optional trailing icon. With no URL,
 * the text renders plain.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */



const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  link: {
    flexDirection: 'row',
    alignItems: 'center',
    textDecoration: 'none'
  }
});
const PDFLink = ({
  href,
  type,
  size,
  trailingIcon,
  style,
  children
}) => {
  if (!href) {
    return /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_3__["default"], {
      type: type,
      size: size,
      style: style
    }, children);
  }
  const linkColor = {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.CONTENT_SECONDARY
  };
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Link, {
    src: href,
    style: styles.link
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_3__["default"], {
    type: type,
    size: size,
    style: style ? [linkColor].concat(style) : linkColor
  }, children), trailingIcon);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFLink);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFMetricChartTile.tsx"
/*!*************************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFMetricChartTile.tsx ***!
  \*************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFCard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PDFCard */ "./js/components/pdf-export/shared-react-pdf-components/PDFCard.tsx");
/* harmony import */ var _PDFChangeBadge__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PDFChangeBadge */ "./js/components/pdf-export/shared-react-pdf-components/PDFChangeBadge.tsx");
/* harmony import */ var _PDFSvg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PDFSvg */ "./js/components/pdf-export/shared-react-pdf-components/PDFSvg.tsx");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");

/**
 * PDFMetricChartTile: a metric tile with a line chart image for the PDF report.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */






const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__.createPDFStyles)({
  headerRow: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'flex-end'
  },
  headerLeft: {
    flexGrow: 1,
    flexShrink: 1
  },
  headerRight: {
    alignItems: 'flex-end'
  },
  title: {
    marginBottom: 1
  },
  changeLabel: {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT,
    marginTop: 4,
    textAlign: 'right'
  },
  legendRow: {
    flexDirection: 'row',
    gap: 18,
    marginTop: 7,
    marginBottom: 0
  },
  legendItem: {
    flexDirection: 'row',
    alignItems: 'center',
    gap: 8
  },
  legendLabel: {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT
  },
  chart: {
    width: '100%',
    height: 133,
    // Keep the chart at its drawn aspect ratio, 506 by 133, so it never
    // stretches when the card width rounds off.
    objectFit: 'contain',
    marginTop: 7
  }
});
const LegendSwatch = ({
  color,
  dashed = false
}) => {
  return /*#__PURE__*/React.createElement(_PDFSvg__WEBPACK_IMPORTED_MODULE_7__["default"], {
    width: 24,
    height: 2,
    viewBox: "0 0 16 2"
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.Line, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
    x1: "0",
    y1: "1",
    x2: "16",
    y2: "1",
    stroke: color,
    strokeWidth: 2
  }, dashed ? {
    strokeDasharray: '3 2'
  } : {})));
};
const PDFMetricChartTile = ({
  title,
  value,
  valueSize = 'medium',
  change,
  changeDirection,
  changeLabel,
  currentLabel,
  previousLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Previous period', 'google-site-kit'),
  color,
  chartImage
}) => {
  // Without a chart image the tile returns null, and no placeholder takes
  // its place.
  if (!chartImage) {
    return null;
  }
  return /*#__PURE__*/React.createElement(_PDFCard__WEBPACK_IMPORTED_MODULE_5__["default"], null, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
    style: styles.headerRow
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
    style: styles.headerLeft
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_8__["default"], {
    type: "title",
    size: "small",
    style: styles.title
  }, title), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_8__["default"], {
    type: "headline",
    size: valueSize
  }, value)), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
    style: styles.headerRight
  }, change !== undefined && change !== null && changeDirection && /*#__PURE__*/React.createElement(_PDFChangeBadge__WEBPACK_IMPORTED_MODULE_6__["default"], {
    change: change,
    changeType: changeDirection === 'down' ? 'negative' : 'positive'
  }), changeLabel && /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_8__["default"], {
    size: "small",
    style: styles.changeLabel
  }, changeLabel))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
    style: styles.legendRow
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
    style: styles.legendItem
  }, /*#__PURE__*/React.createElement(LegendSwatch, {
    color: color
  }), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_8__["default"], {
    size: "small",
    style: styles.legendLabel
  }, currentLabel)), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
    style: styles.legendItem
  }, /*#__PURE__*/React.createElement(LegendSwatch, {
    color: color,
    dashed: true
  }), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_8__["default"], {
    size: "small",
    style: styles.legendLabel
  }, previousLabel))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.Image, {
    src: chartImage,
    style: styles.chart
  }));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFMetricChartTile);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFMetricTile.tsx"
/*!********************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFMetricTile.tsx ***!
  \********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFChangeBadge__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PDFChangeBadge */ "./js/components/pdf-export/shared-react-pdf-components/PDFChangeBadge.tsx");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFMetricTile component for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */




const tileStyles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  container: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'flex-end'
  },
  metric: {
    flexDirection: 'column'
  },
  title: {
    marginBottom: 1
  },
  aside: {
    flexDirection: 'column',
    alignItems: 'flex-end'
  },
  changeLabel: {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT,
    marginTop: 4
  }
});
const PDFMetricTile = ({
  title,
  value,
  change,
  changeType = 'positive',
  changeLabel
}) => {
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: tileStyles.container
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: tileStyles.metric
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_4__["default"], {
    type: "title",
    size: "small",
    style: tileStyles.title
  }, title), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_4__["default"], {
    type: "headline"
  }, value)), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: tileStyles.aside
  }, !!change && /*#__PURE__*/React.createElement(_PDFChangeBadge__WEBPACK_IMPORTED_MODULE_3__["default"], {
    change: change,
    changeType: changeType
  }), !!changeLabel && /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_4__["default"], {
    size: "small",
    style: tileStyles.changeLabel
  }, changeLabel)));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFMetricTile);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFMetricTileTable.tsx"
/*!*************************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFMetricTileTable.tsx ***!
  \*************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFCard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PDFCard */ "./js/components/pdf-export/shared-react-pdf-components/PDFCard.tsx");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFMetricTileTable component for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */




const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  // Matches the dashboard tile's `min-height: 150px`, and fills the grid cell so
  // every tile in a row shares the tallest tile's height.
  card: {
    minHeight: 150,
    flexGrow: 1
  },
  // 12px / 400 / on-surface-variant, matching the dashboard tile heading.
  title: {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT
  },
  // The ranked list sits 12px below the heading, as on the dashboard.
  table: {
    flexDirection: 'column',
    marginTop: 12
  },
  // One entry: the label on the left, its metric on the right. The rows need no
  // padding of their own; the 1.33 line height spaces them as the design does.
  row: {
    flexDirection: 'row',
    justifyContent: 'space-between'
  },
  // A label the dashboard renders as a link keeps that link colour.
  primaryLink: {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.CONTENT_SECONDARY
  },
  // The metric hugs the right edge and is never truncated.
  metric: {
    flexShrink: 0
  }
});

/** One ranked entry: a primary label and its formatted metric. */

const PDFMetricTileTable = ({
  title,
  rows,
  limit,
  linked = false
}) => {
  const visibleRows = typeof limit === 'number' ? rows.slice(0, limit) : rows;
  return /*#__PURE__*/React.createElement(_PDFCard__WEBPACK_IMPORTED_MODULE_3__["default"], {
    style: styles.card
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_4__["default"], {
    type: "body",
    size: "small",
    style: styles.title
  }, title), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.table
  }, visibleRows.map((row, index) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    key: index,
    style: styles.row
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_4__["default"], {
    type: "body",
    size: "small",
    style: linked ? styles.primaryLink : undefined,
    truncateContent: true
  }, row.primary), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_4__["default"], {
    type: "body",
    size: "small",
    style: styles.metric
  }, row.metric)))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFMetricTileTable);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFMetricTileText.tsx"
/*!************************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFMetricTileText.tsx ***!
  \************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFCard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PDFCard */ "./js/components/pdf-export/shared-react-pdf-components/PDFCard.tsx");
/* harmony import */ var _PDFChangeBadge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PDFChangeBadge */ "./js/components/pdf-export/shared-react-pdf-components/PDFChangeBadge.tsx");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFMetricTileText component for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */





const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  // Matches the dashboard tile's `min-height: 150px`, and fills the grid cell so
  // every tile in a row shares the tallest tile's height.
  card: {
    minHeight: 150,
    flexGrow: 1
  },
  // 12px / 400 / on-surface-variant, matching the dashboard tile heading.
  title: {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT
  },
  // The primary text value, e.g. "Organic Search", 4px below the title. Unlike
  // the numeric tile this is a text label, so it uses the title type rather than
  // the large headline value.
  value: {
    marginTop: 4
  },
  // 14px / on-surface, e.g. "of 1,234 total visitors".
  subtext: {
    marginTop: 2
  },
  // The badge is a pill, so a row wrapper keeps it hugging its content instead
  // of stretching to the card width. It sits 12px below the sub-text.
  badgeRow: {
    flexDirection: 'row',
    marginTop: 12
  }
});
/**
 * Mirrors the dashboard's `MetricTileText`: it shares the full-card layout of
 * `PDFNumericMetricTile`, but its value is a text label (e.g. a traffic source
 * name) rather than a large formatted number.
 *
 * @since n.e.x.t
 *
 * @param {Object} props            Component props.
 * @param {string} props.title      Title.
 * @param {string} props.value      Value.
 * @param {string} props.subtext    Optional subtext.
 * @param {string} props.change     Optional change for the badge.
 * @param {string} props.changeType The change's direction.
 * @return               The PDF-rendered tile text.
 */
const PDFMetricTileText = ({
  title,
  value,
  subtext,
  change,
  changeType = 'positive'
}) => {
  return /*#__PURE__*/React.createElement(_PDFCard__WEBPACK_IMPORTED_MODULE_3__["default"], {
    style: styles.card
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: "body",
    size: "small",
    style: styles.title
  }, title), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: "title",
    size: "medium",
    style: styles.value
  }, value), !!subtext && /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    style: styles.subtext
  }, subtext), !!change && /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.badgeRow
  }, /*#__PURE__*/React.createElement(_PDFChangeBadge__WEBPACK_IMPORTED_MODULE_4__["default"], {
    change: change,
    changeType: changeType
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFMetricTileText);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFNumericMetricTile.tsx"
/*!***************************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFNumericMetricTile.tsx ***!
  \***************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFCard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PDFCard */ "./js/components/pdf-export/shared-react-pdf-components/PDFCard.tsx");
/* harmony import */ var _PDFChangeBadge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PDFChangeBadge */ "./js/components/pdf-export/shared-react-pdf-components/PDFChangeBadge.tsx");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFNumericMetricTile component for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */





const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  // Matches the dashboard tile's `min-height: 150px`, and fills the grid cell so
  // every tile in a row shares the tallest tile's height.
  card: {
    minHeight: 150,
    flexGrow: 1
  },
  // 12px / 400 / on-surface-variant, matching the dashboard tile heading.
  title: {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT
  },
  // 28px / line-height 36 / on-surface, the prominent metric value, 4px below
  // the title.
  value: {
    marginTop: 4
  },
  // 14px / on-surface, e.g. "of 1,234 total visitors".
  subtext: {
    marginTop: 2
  },
  // The badge is a pill, so a row wrapper keeps it hugging its content instead
  // of stretching to the card width. It sits 12px below the description.
  badgeRow: {
    flexDirection: 'row',
    marginTop: 12
  }
});
const PDFNumericMetricTile = ({
  title,
  value,
  subtext,
  change,
  changeType = 'positive'
}) => {
  return /*#__PURE__*/React.createElement(_PDFCard__WEBPACK_IMPORTED_MODULE_3__["default"], {
    style: styles.card
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: "body",
    size: "small",
    style: styles.title
  }, title), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: "headline",
    size: "medium",
    style: styles.value
  }, value), !!subtext && /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    style: styles.subtext
  }, subtext), !!change && /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.badgeRow
  }, /*#__PURE__*/React.createElement(_PDFChangeBadge__WEBPACK_IMPORTED_MODULE_4__["default"], {
    change: change,
    changeType: changeType
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFNumericMetricTile);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFPartialDataBadge.tsx"
/*!**************************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFPartialDataBadge.tsx ***!
  \**************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFBadge__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PDFBadge */ "./js/components/pdf-export/shared-react-pdf-components/PDFBadge.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * The "Partial data" badge for the PDF report.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  badge: {
    paddingVertical: 6,
    paddingHorizontal: 10
  }
});
const PDFPartialDataBadge = () => {
  return /*#__PURE__*/React.createElement(_PDFBadge__WEBPACK_IMPORTED_MODULE_3__["default"], {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Partial data', 'google-site-kit'),
    backgroundColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.UTILITY_WARNING_CONTAINER,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.YELLOW_Y_600,
    style: styles.badge
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFPartialDataBadge);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFPieChartTile.tsx"
/*!**********************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFPieChartTile.tsx ***!
  \**********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFPieChartTile component for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */


const tileStyles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  title: {
    marginBottom: 16
  },
  body: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'space-between'
  },
  legend: {
    flexDirection: 'column',
    width: 184
  },
  legendRow: {
    flexDirection: 'row',
    alignItems: 'center',
    marginBottom: 13
  },
  swatch: {
    width: 12,
    height: 12,
    borderRadius: 6,
    marginRight: 6
  },
  label: {
    flexGrow: 1,
    flexShrink: 1
  },
  percentage: {
    marginLeft: 6,
    textAlign: 'right'
  },
  chart: {
    width: 145.7,
    height: 145.7,
    marginRight: 24
  }
});
const PDFPieChartTile = ({
  title,
  rows,
  chartImage
}) => {
  // Without a donut image the tile returns null, and no placeholder takes
  // its place.
  if (!chartImage) {
    return null;
  }
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, null, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_2__["default"], {
    type: "title",
    size: "small",
    style: tileStyles.title
  }, title), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: tileStyles.body
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: tileStyles.legend
  }, rows.map(({
    label,
    percentage,
    color
  }) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    key: label,
    style: tileStyles.legendRow
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: {
      ...tileStyles.swatch,
      backgroundColor: color
    }
  }), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_2__["default"], {
    size: "small",
    style: tileStyles.label
  }, label), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_2__["default"], {
    type: "label",
    size: "small",
    style: tileStyles.percentage
  }, percentage)))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Image, {
    src: chartImage,
    style: tileStyles.chart
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFPieChartTile);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFSiteKitLogo.tsx"
/*!*********************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFSiteKitLogo.tsx ***!
  \*********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-icons */ "./js/components/pdf-export/pdf-icons.tsx");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFSiteKitLogo: Site Kit brand mark rendered with @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */



const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__.createPDFStyles)({
  logo: {
    flexDirection: 'row',
    alignItems: 'center',
    flexShrink: 0
  },
  wordmark: {
    // Gap between the "G" mark and the "Site Kit" wordmark.
    marginLeft: 7
  }
});
const PDFSiteKitLogo = () => {
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.logo
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_1__.PDFLogoG, {
    size: 24
  }), /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_3__["default"], {
    type: "headline",
    size: "small",
    style: styles.wordmark
  }, "Site Kit"));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFSiteKitLogo);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFSvg.tsx"
/*!*************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFSvg.tsx ***!
  \*************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Shared SVG wrapper for the PDF report.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */

const PDFSvg = ({
  width,
  height,
  viewBox,
  children
}) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, {
  width: (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.scalePDFValue)(width),
  height: (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.scalePDFValue)(height),
  viewBox: viewBox
}, children);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFSvg);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFTable.tsx"
/*!***************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFTable.tsx ***!
  \***************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ PDFTable)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFTable: shared table for PDF report widgets (@react-pdf/renderer).
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */



const ROW_PADDING_HORIZONTAL = 24;
const DEFAULT_COLUMN_GAP = 40;
const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  headerRow: {
    flexDirection: 'row',
    borderBottomWidth: 1,
    borderBottomColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_SURFACE_1,
    paddingBottom: 16,
    paddingHorizontal: ROW_PADDING_HORIZONTAL
  },
  bodyRow: {
    paddingHorizontal: ROW_PADDING_HORIZONTAL
  },
  bodyRowContent: {
    flexDirection: 'row',
    alignItems: 'flex-start',
    borderBottomWidth: 1,
    borderBottomColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_SURFACE_1,
    paddingVertical: 8
  },
  bodyRowContentLast: {
    borderBottomWidth: 0
  },
  rightAlign: {
    textAlign: 'right'
  }
});
/**
 * Builds the style for one column cell.
 *
 * Returns a fixed width when the column sets one, or an equal share of the row
 * when it does not.
 *
 * @since 1.182.0
 *
 * @param column Column definition for the cell.
 * @return The width or flex style for the cell.
 */
function getCellStyle(column) {
  return column.width !== undefined ? {
    width: column.width
  } : {
    flex: 1
  };
}

// `FC` can't take the generic `Row` type, so PDFTable is a function declaration
// instead of an `FC< Props >` component.
function PDFTable({
  columns,
  rows,
  columnGap = DEFAULT_COLUMN_GAP
}) {
  const scaledColumnGap = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.scalePDFValue)(columnGap);
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, null, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: [styles.headerRow, {
      columnGap: scaledColumnGap
    }]
  }, columns.map((column, columnIndex) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    key: columnIndex,
    style: getCellStyle(column)
  }, /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_3__["default"], {
    type: "title",
    size: "small",
    style: column.align === 'right' ? styles.rightAlign : undefined
  }, column.header)))), rows.map((row, rowIndex) => {
    const isLastRow = rowIndex === rows.length - 1;
    return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
      key: rowIndex,
      style: styles.bodyRow
    }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
      style: isLastRow ? [styles.bodyRowContent, {
        columnGap: scaledColumnGap
      }, styles.bodyRowContentLast] : [styles.bodyRowContent, {
        columnGap: scaledColumnGap
      }]
    }, columns.map((column, columnIndex) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
      key: columnIndex,
      style: getCellStyle(column)
    }, column.cell ? column.cell(row) : /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_3__["default"], {
      style: column.align === 'right' ? styles.rightAlign : undefined
    }, column.format ? column.format(row) : '')))));
  }));
}

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFTableSection.tsx"
/*!**********************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFTableSection.tsx ***!
  \**********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ PDFTableSection)
/* harmony export */ });
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _PDFTable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PDFTable */ "./js/components/pdf-export/shared-react-pdf-components/PDFTable.tsx");
/* harmony import */ var _PDFWidgetSection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PDFWidgetSection */ "./js/components/pdf-export/shared-react-pdf-components/PDFWidgetSection.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFTableSection: a heading, a card, and a table for a PDF widget.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */



const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_0__.createPDFStyles)({
  // The card removes its horizontal padding so the table fills the width,
  // and keeps the vertical padding.
  card: {
    paddingVertical: 16,
    paddingHorizontal: 0
  }
});
// `FC` can't take the generic `Row` type, so PDFTableSection is a function
// declaration instead of an `FC< Props >` component.
function PDFTableSection({
  heading,
  columns,
  rows,
  columnGap
}) {
  // Without rows the section returns null, and no placeholder takes its
  // place.
  if (rows.length === 0) {
    return null;
  }
  return /*#__PURE__*/React.createElement(_PDFWidgetSection__WEBPACK_IMPORTED_MODULE_2__["default"], {
    heading: heading,
    cardStyle: styles.card
  }, /*#__PURE__*/React.createElement(_PDFTable__WEBPACK_IMPORTED_MODULE_1__["default"], {
    columns: columns,
    rows: rows,
    columnGap: columnGap
  }));
}

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx"
/*!********************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx ***!
  \********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _js_components_pdf_export_pdf_typography__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-typography */ "./js/components/pdf-export/pdf-typography.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Shared text component for the PDF report, mirroring the dashboard
 * `Typography` component.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */



const truncationStyles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  box: {
    flexGrow: 1,
    flexShrink: 1,
    flexBasis: 0,
    marginRight: 20
  },
  value: {
    textOverflow: 'ellipsis'
  }
});
const PDFTypography = ({
  type = 'body',
  size = 'medium',
  style,
  maxLines,
  truncateContent = false,
  children
}) => {
  const baseStyles = [_js_components_pdf_export_pdf_typography__WEBPACK_IMPORTED_MODULE_3__.PDF_TYPOGRAPHY[type][size], {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_ON_SURFACE
  }];

  // `@react-pdf/renderer` reads `maxLines` off the text's style, not as a
  // prop, so it is merged into the styles rather than passed to `Text`.
  if (typeof maxLines === 'number') {
    baseStyles.push({
      maxLines
    });
  } else if (truncateContent) {
    baseStyles.push({
      maxLines: 1
    });
  }
  if (truncateContent) {
    baseStyles.push(truncationStyles.value);
  }
  const text = /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: style ? baseStyles.concat(style) : baseStyles
  }, children);
  if (!truncateContent) {
    return text;
  }
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: truncationStyles.box
  }, text);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFTypography);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFWidgetSection.tsx"
/*!***********************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFWidgetSection.tsx ***!
  \***********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _PDFCard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PDFCard */ "./js/components/pdf-export/shared-react-pdf-components/PDFCard.tsx");
/* harmony import */ var _PDFTypography__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFWidgetSection: widget heading + white card wrapper for the PDF report.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */



const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  heading: {
    marginBottom: 15
  }
});
const PDFWidgetSection = ({
  heading,
  cardStyle,
  bookmark,
  children
}) => {
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View
  // react-pdf's types have a bug that prevents passing a `bookmark` prop, so we use a spread to bypass it.
  // See: https://github.com/diegomura/react-pdf/issues/1979#issuecomment-1231391616
  , {
    bookmark
  }, !!heading && /*#__PURE__*/React.createElement(_PDFTypography__WEBPACK_IMPORTED_MODULE_3__["default"], {
    size: "large",
    style: styles.heading
  }, heading), /*#__PURE__*/React.createElement(_PDFCard__WEBPACK_IMPORTED_MODULE_2__["default"], {
    style: cardStyle
  }, children));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFWidgetSection);

/***/ },

/***/ "./js/googlesitekit/datastore/pdf/constants.ts"
/*!*****************************************************!*\
  !*** ./js/googlesitekit/datastore/pdf/constants.ts ***!
  \*****************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CORE_PDF: () => (/* binding */ CORE_PDF)
/* harmony export */ });
/**
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const CORE_PDF = 'core/pdf';

/***/ },

/***/ "./js/modules/adsense/components/dashboard/DashboardTopEarningPagesWidgetGA4/indexPDF.tsx"
/*!************************************************************************************************!*\
  !*** ./js/modules/adsense/components/dashboard/DashboardTopEarningPagesWidgetGA4/indexPDF.tsx ***!
  \************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFLink__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFLink */ "./js/components/pdf-export/shared-react-pdf-components/PDFLink.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTable */ "./js/components/pdf-export/shared-react-pdf-components/PDFTable.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFWidgetSection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFWidgetSection */ "./js/components/pdf-export/shared-react-pdf-components/PDFWidgetSection.tsx");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * DashboardTopEarningPagesWidgetGA4 PDF component for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */







const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__.createPDFStyles)({
  // The table owns the row padding, so the card drops its horizontal padding
  // and keeps the vertical padding, matching PDFTableSection.
  card: {
    paddingVertical: 16,
    paddingHorizontal: 0
  },
  pageCell: {
    flexDirection: 'row',
    columnGap: 4
  },
  rank: {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__.PDF_COLORS.SURFACES_ON_SURFACE
  }
});
const DashboardTopEarningPagesWidgetGA4PDF = ({
  data
}) => {
  const topEarningPagesData = data;
  const rows = topEarningPagesData?.rows ?? [];
  const titles = topEarningPagesData?.titles ?? {};
  const links = topEarningPagesData?.links ?? {};
  const currencyCode = topEarningPagesData?.currencyCode ?? '';

  // The report's first dimension is `pagePath`, so the first dimension value is
  // the page path, and the first metric value is its earnings.
  const tableRows = rows.map((row, index) => {
    const pagePath = row.dimensionValues?.[0]?.value ?? '';
    return {
      rank: index + 1,
      title: titles[pagePath] ?? '',
      serviceURL: links[pagePath] ?? '',
      earnings: row.metricValues?.[0]?.value ?? ''
    };
  });
  if (tableRows.length === 0) {
    return null;
  }
  const heading = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Top earning pages', 'google-site-kit');
  const columns = [{
    // The page title column has no header, matching the dashboard widget.
    header: '',
    // Shows the page title with the row rank to its left. The title
    // links to the page's Analytics report, like the dashboard widget.
    cell: row => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
      style: styles.pageCell
    }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_6__["default"], {
      style: styles.rank
    }, `${row.rank}.`), /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_6__["default"], {
      truncateContent: true
    }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFLink__WEBPACK_IMPORTED_MODULE_4__["default"], {
      href: row.serviceURL
    }, row.title)))
  }, {
    header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Earnings', 'google-site-kit'),
    // 15% of the row, aligned right like the dashboard widget.
    width: '15%',
    align: 'right',
    format: row => (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(row.earnings, {
      style: 'currency',
      currency: currencyCode
    })
  }];
  return /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFWidgetSection__WEBPACK_IMPORTED_MODULE_7__["default"], {
    heading: heading,
    cardStyle: styles.card
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTable__WEBPACK_IMPORTED_MODULE_5__["default"], {
    columns: columns,
    rows: tableRows,
    columnGap: 4
  }));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DashboardTopEarningPagesWidgetGA4PDF);

/***/ },

/***/ "./js/modules/adsense/components/module/ModuleOverviewWidget/ModuleOverviewWidgetPDF.tsx"
/*!***********************************************************************************************!*\
  !*** ./js/modules/adsense/components/module/ModuleOverviewWidget/ModuleOverviewWidgetPDF.tsx ***!
  \***********************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFMetricChartTile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFMetricChartTile */ "./js/components/pdf-export/shared-react-pdf-components/PDFMetricChartTile.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");

/**
 * ModuleOverviewWidgetPDF component for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__.createPDFStyles)({
  heading: {
    marginBottom: 15
  },
  grid: {
    flexDirection: 'row',
    flexWrap: 'wrap',
    justifyContent: 'space-between',
    rowGap: 24
  },
  cell: {
    width: '48.94%'
  }
});

/**
 * Formats a currency metric total with the report's currency code.
 *
 * With no currency code, the value falls back to a plain grouped number, so
 * the card never shows the wrong currency.
 *
 * @since 1.184.0
 *
 * @param total        The metric total.
 * @param currencyCode Currency code from the AdSense report, if any.
 * @return The formatted value.
 */
function formatCurrencyValue(total, currencyCode) {
  return currencyCode ? (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.numFmt)(total, currencyCode) : (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.numFmt)(total, {
    style: 'decimal'
  });
}
/** The cards render in the 2x2 grid in this order. */
const CARDS = [{
  key: 'estimatedEarnings',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Earnings', 'google-site-kit'),
  color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.BLUE_B_400,
  formatValue: formatCurrencyValue
}, {
  key: 'pageRPM',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Page RPM', 'google-site-kit'),
  color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.TEAL_T_300,
  formatValue: formatCurrencyValue
}, {
  key: 'impressions',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Impressions', 'google-site-kit'),
  color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.SITE_KIT_SK_500,
  formatValue: total => (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.numFmt)(total, {
    style: 'decimal'
  })
}, {
  key: 'pageCTR',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Page CTR', 'google-site-kit'),
  color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.VIOLET_V_300,
  formatValue: total => (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.numFmt)(total, '%')
}];

/**
 * Builds the change badge props from a metric's period-over-period change ratio.
 *
 * @since 1.184.0
 *
 * @param metric The metric data, if any.
 * @return Props for the change badge, empty when there's no change to show.
 */
function getChangeProps(metric) {
  const change = metric?.change;
  if (typeof change !== 'number') {
    return {};
  }
  return {
    change: (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.numFmt)(Math.abs(change), {
      style: 'percent',
      maximumFractionDigits: 1
    }),
    changeDirection: change >= 0 ? 'up' : 'down'
  };
}
const ModuleOverviewWidgetPDF = ({
  data,
  chartImages
}) => {
  // With no data the widget returns null, and nothing renders in its place.
  if (!data) {
    return null;
  }
  const {
    dateRangeLength,
    currencyCode,
    metrics
  } = data;
  const changeLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %d: number of days in the comparison period */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Vs. prev. %d days', 'google-site-kit'), dateRangeLength);
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, null, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_6__["default"], {
    size: "large",
    style: styles.heading
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Earning performance over time', 'google-site-kit')), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
    style: styles.grid
  }, CARDS.map(({
    key,
    title,
    color,
    formatValue
  }) => {
    const metric = metrics[key];
    const chartImage = chartImages?.[key];

    // The widget skips a card whose metric has no data or failed
    // to render. The loader returns null data when every card is
    // empty, so the heading never sits above an empty grid.
    if (!chartImage) {
      return null;
    }
    return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
      key: key,
      style: styles.cell
    }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFMetricChartTile__WEBPACK_IMPORTED_MODULE_5__["default"], (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
      title: title,
      value: formatValue(metric?.total || 0, currencyCode),
      valueSize: "large",
      changeLabel: changeLabel,
      currentLabel: title,
      color: color,
      chartImage: chartImage
    }, getChangeProps(metric))));
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ModuleOverviewWidgetPDF);

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceMetricRow.tsx"
/*!************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceMetricRow.tsx ***!
  \************************************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_getPDFTileChange__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/getPDFTileChange */ "./js/components/pdf-export/getPDFTileChange.ts");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFChangeBadge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFChangeBadge */ "./js/components/pdf-export/shared-react-pdf-components/PDFChangeBadge.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Metric row for the Your visitor groups PDF audience card.
 *
 * `PDFYourVisitorGroupsTile` renders one row per audience metric.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */






const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__.createPDFStyles)({
  // Each metric row is inset from the card edges and draws a divider below it.
  row: {
    flexDirection: 'row',
    alignItems: 'center',
    marginHorizontal: 24,
    paddingVertical: 12,
    borderBottomWidth: 1,
    borderBottomColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__.PDF_COLORS.SURFACES_SURFACE_1
  },
  iconColumn: {
    width: 52,
    alignItems: 'center',
    marginRight: 4
  },
  body: {
    flex: 1
  },
  metricValue: {
    lineHeight: 32 / 28
  },
  metricLabel: {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT
  }
});

/**
 * Builds the change chip's props from a metric's period-over-period change.
 *
 * The chip matches the dashboard's `ChangeBadge`. There's no chip when the
 * change can't be calculated. `signDisplay: 'exceptZero'` adds a leading
 * `+` or `-` sign to every non-zero change, based on the difference between
 * the current and previous values.
 *
 * @since 1.184.0
 *
 * @param metric The metric with its current and previous value.
 * @return Props for the change chip, or `null` to hide it.
 */
function getChangeChip(metric) {
  const change = (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.calculateChange)(metric.previous, metric.current);
  if (change === null) {
    return null;
  }
  return {
    change: (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.numFmt)(change, {
      style: 'percent',
      signDisplay: 'exceptZero',
      maximumFractionDigits: 1
    }),
    changeType: (0,_js_components_pdf_export_getPDFTileChange__WEBPACK_IMPORTED_MODULE_1__.getPDFChangeType)(change)
  };
}
const PDFAudienceMetricRow = ({
  Icon,
  label,
  value,
  metric
}) => {
  const chip = getChangeChip(metric);
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.row
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.iconColumn
  }, /*#__PURE__*/React.createElement(Icon, null)), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.body
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: "headline",
    size: "medium",
    style: styles.metricValue
  }, value), /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    size: "medium",
    style: styles.metricLabel
  }, label)), chip && /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFChangeBadge__WEBPACK_IMPORTED_MODULE_4__["default"], {
    change: chip.change,
    changeType: chip.changeType
  }));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFAudienceMetricRow);

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFYourVisitorGroups.tsx"
/*!************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFYourVisitorGroups.tsx ***!
  \************************************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _PDFYourVisitorGroupsTile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PDFYourVisitorGroupsTile */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFYourVisitorGroupsTile.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Your visitor groups PDF widget: the row of audience cards.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */



const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__.createPDFStyles)({
  heading: {
    marginBottom: 15
  },
  row: {
    flexDirection: 'row',
    // Stretch every card to the tallest card's height, for equal-height
    // columns.
    alignItems: 'stretch'
  },
  card: {
    // Equal-width columns: every card grows and shrinks from a zero basis.
    flexGrow: 1,
    flexShrink: 1,
    flexBasis: 0
  },
  cardGap: {
    width: 24
  }
});
const PDFYourVisitorGroups = ({
  data
}) => {
  const audienceData = data;
  const audiences = audienceData?.audiences || [];

  // With no audiences the widget renders nothing, with no placeholder.
  if (audiences.length === 0) {
    return null;
  }
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, null, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_4__["default"], {
    size: "large",
    style: styles.heading
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Your visitor groups', 'google-site-kit')), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.row
  }, audiences.map((audience, index) => /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
    key: audience.audienceResourceName
  }, index > 0 && /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.cardGap
  }), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.card
  }, /*#__PURE__*/React.createElement(_PDFYourVisitorGroupsTile__WEBPACK_IMPORTED_MODULE_5__["default"], {
    audienceName: audience.audienceName,
    metrics: audience.metrics,
    topCities: audience.topCities,
    topContent: audience.topContent,
    isAudiencePartialData: audience.isAudiencePartialData,
    isTopContentPartialData: audience.isTopContentPartialData
  }))))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFYourVisitorGroups);

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFYourVisitorGroupsTile.tsx"
/*!****************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFYourVisitorGroupsTile.tsx ***!
  \****************************************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-icons */ "./js/components/pdf-export/pdf-icons.tsx");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFCard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFCard */ "./js/components/pdf-export/shared-react-pdf-components/PDFCard.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFLink__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFLink */ "./js/components/pdf-export/shared-react-pdf-components/PDFLink.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFPartialDataBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFPartialDataBadge */ "./js/components/pdf-export/shared-react-pdf-components/PDFPartialDataBadge.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _PDFAudienceMetricRow__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./PDFAudienceMetricRow */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceMetricRow.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Audience card for the Your visitor groups PDF widget.
 *
 * `PDFYourVisitorGroups` renders one card per configured GA4 audience.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */









const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__.createPDFStyles)({
  // The dashboard tile gives the card no padding, so the header sets its own
  // inset and its bottom divider reaches both card edges.
  card: {
    paddingVertical: 0,
    paddingHorizontal: 0
  },
  // The header holds the audience name and a full-width bottom divider. The
  // divider sits on the header's full-width box, so it meets both card edges
  // while the name stays inset.
  header: {
    paddingVertical: 25,
    paddingHorizontal: 25,
    borderBottomWidth: 1,
    borderBottomColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.SURFACES_SURFACE_1
  },
  // A row that keeps a title on the left and its Partial data badge on the
  // right, both vertically centered, like the dashboard tile.
  badgeRow: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'space-between'
  },
  // Each section is inset from the card edges and draws a divider below it.
  row: {
    flexDirection: 'row',
    alignItems: 'center',
    marginHorizontal: 24,
    paddingVertical: 12,
    borderBottomWidth: 1,
    borderBottomColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.SURFACES_SURFACE_1
  },
  // The last row drops its divider, so the card ends on content.
  lastRow: {
    borderBottomWidth: 0
  },
  iconColumn: {
    width: 52,
    alignItems: 'center',
    marginRight: 4
  },
  body: {
    flex: 1
  },
  sectionTitle: {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT
  },
  topContentTitle: {
    marginBottom: 10
  },
  citiesRow: {
    flexDirection: 'row',
    marginTop: 12
  },
  city: {
    flex: 1
  },
  cityName: {
    // A long city name truncates to one line with an ellipsis. `@react-pdf`
    // wraps text by default, so `maxLines` caps it at one line.
    maxLines: 1,
    textOverflow: 'ellipsis'
  },
  cityPercentage: {
    marginTop: 2
  },
  contentRow: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    marginBottom: 6
  },
  // The title fills the row remainder before the pageviews count.
  contentTitle: {
    flex: 1,
    marginRight: 30
  },
  // A long title truncates to one line with an ellipsis. `@react-pdf`
  // wraps text by default, so `maxLines` caps it at one line.
  contentTitleText: {
    maxLines: 1,
    textOverflow: 'ellipsis'
  }
});
const PDFYourVisitorGroupsTile = ({
  audienceName,
  metrics,
  topCities,
  topContent,
  isAudiencePartialData,
  isTopContentPartialData
}) => {
  const metricRows = [{
    Icon: _js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_2__.PDFAudienceMetricIconVisitors,
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Visitors', 'google-site-kit'),
    value: (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.numFmt)(metrics.visitors.current),
    metric: metrics.visitors
  }, {
    Icon: _js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_2__.PDFAudienceMetricIconVisitsPerVisitor,
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Visits per visitor', 'google-site-kit'),
    value: (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.numFmt)(metrics.visitsPerVisitor.current),
    metric: metrics.visitsPerVisitor
  }, {
    Icon: _js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_2__.PDFAudienceMetricIconPagesPerVisit,
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Pages per visit', 'google-site-kit'),
    value: (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.numFmt)(metrics.pagesPerVisit.current, {
      style: 'decimal',
      maximumFractionDigits: 2
    }),
    metric: metrics.pagesPerVisit
  }, {
    Icon: _js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_2__.PDFAudienceMetricIconPageviews,
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: a percentage value such as "33.3%". */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%s of total pageviews', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.numFmt)(metrics.pageviews.percentageOfTotalPageViews, {
      style: 'percent',
      maximumFractionDigits: 1
    })),
    value: (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.numFmt)(metrics.pageviews.current),
    metric: metrics.pageviews
  }];
  return /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFCard__WEBPACK_IMPORTED_MODULE_5__["default"], {
    style: styles.card
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: [styles.header, styles.badgeRow]
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_8__["default"], {
    type: "title",
    size: "small"
  }, audienceName), isAudiencePartialData && /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFPartialDataBadge__WEBPACK_IMPORTED_MODULE_7__["default"], null)), metricRows.map(row => /*#__PURE__*/React.createElement(_PDFAudienceMetricRow__WEBPACK_IMPORTED_MODULE_10__["default"], {
    key: row.label,
    Icon: row.Icon,
    label: row.label,
    value: row.value,
    metric: row.metric
  })), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.row
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.iconColumn
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_2__.PDFAudienceMetricIconCities, null)), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.body
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_8__["default"], {
    size: "medium",
    style: styles.sectionTitle
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cities with the most visitors', 'google-site-kit')), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.citiesRow
  }, topCities.map(city => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    key: city.name,
    style: styles.city
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_8__["default"], {
    type: "title",
    size: "small",
    style: styles.cityName
  }, city.name), /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_8__["default"], {
    size: "medium",
    style: styles.cityPercentage
  }, (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.numFmt)(city.percentage, {
    style: 'percent',
    maximumFractionDigits: 1
  }))))))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: [styles.row, styles.lastRow]
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.iconColumn
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_pdf_icons__WEBPACK_IMPORTED_MODULE_2__.PDFAudienceMetricIconTopContent, null)), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.body
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: [styles.badgeRow]
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_8__["default"], {
    size: "medium",
    style: [styles.sectionTitle, styles.topContentTitle]
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Top content by pageviews', 'google-site-kit')), isTopContentPartialData && /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFPartialDataBadge__WEBPACK_IMPORTED_MODULE_7__["default"], null)), !topContent.length && /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_8__["default"], {
    size: "small"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No data to show yet', 'google-site-kit')), topContent.map(content => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    key: content.title,
    style: styles.contentRow
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.contentTitle
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFLink__WEBPACK_IMPORTED_MODULE_6__["default"], {
    href: content.serviceURL,
    size: "small",
    style: styles.contentTitleText
  }, content.title)), /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_8__["default"], {
    size: "small"
  }, (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.numFmt)(content.pageviews)))))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFYourVisitorGroupsTile);

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/indexPDF.tsx"
/*!***********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/indexPDF.tsx ***!
  \***********************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_pdf_export_getPDFTileChange__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/getPDFTileChange */ "./js/components/pdf-export/getPDFTileChange.ts");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFCard__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFCard */ "./js/components/pdf-export/shared-react-pdf-components/PDFCard.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFMetricTile__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFMetricTile */ "./js/components/pdf-export/shared-react-pdf-components/PDFMetricTile.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFPieChartTile__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFPieChartTile */ "./js/components/pdf-export/shared-react-pdf-components/PDFPieChartTile.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * DashboardAllTrafficWidgetGA4 PDF component for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */








const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_4__.createPDFStyles)({
  heading: {
    marginBottom: 15
  },
  row: {
    flexDirection: 'row',
    alignItems: 'stretch'
  },
  rowSpacing: {
    marginTop: 24
  },
  card: {
    flexGrow: 1,
    flexShrink: 1,
    flexBasis: 0
  },
  cardGap: {
    width: 24
  },
  chart: {
    width: '100%',
    // Fit the line chart to the card width without stretching it.
    height: 133,
    objectFit: 'contain',
    marginTop: 7
  }
});

/**
 * Builds the legend rows for a breakdown donut.
 *
 * Pairs each segment with its color by index, and formats its share as a
 * percentage. The color order matches the donut, because both read
 * `PIE_CHART_COLORS` in the same slice order.
 *
 * @since 1.183.0
 *
 * @param breakdown Ordered `{ label, percentage }` rows, or `null`.
 * @return Legend rows of `{ label, percentage, color }`.
 */
function buildLegendRows(breakdown) {
  return (breakdown || []).map(({
    label,
    percentage
  }, index) => ({
    label,
    percentage: (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.numFmt)(percentage, {
      style: 'percent',
      maximumFractionDigits: 1
    }),
    // A breakdown has at most 5 rows, so each row maps to one of the 5 colors.
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_5__.PIE_CHART_COLORS[index]
  }));
}
const DashboardAllTrafficWidgetGA4PDF = ({
  data,
  chartImages
}) => {
  const trafficData = data;
  const trafficChartImages = chartImages;

  // Without data the widget returns null, and no placeholder takes its place.
  if (!trafficData) {
    return null;
  }
  const {
    totalsReport,
    graphReport,
    channelBreakdown,
    locationBreakdown,
    deviceBreakdown
  } = trafficData;
  const [current, previous] = totalsReport?.totals || [];
  const currentValue = Number(current?.metricValues?.[0]?.value);
  const previousValue = Number(previous?.metricValues?.[0]?.value);
  const change = (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.calculateChange)(previousValue, currentValue);
  const changeText = typeof change === 'number' ? (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.numFmt)(change, {
    style: 'percent',
    signDisplay: 'exceptZero',
    maximumFractionDigits: 1
  }) : undefined;
  const graphRowCount = graphReport?.rows?.length || 0;
  const comparisonLabel = graphRowCount > 0 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %d: number of days in the comparison period */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Vs. prev. %d days', 'google-site-kit'), graphRowCount) : undefined;
  const formattedValue = (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.numFmt)(currentValue || 0);
  const lineChartImage = trafficChartImages?.lineChart;

  // A breakdown whose report or donut render failed adds no card, and no
  // placeholder takes its place.
  const breakdownTiles = [{
    key: 'channels',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Visitors by channels', 'google-site-kit'),
    rows: channelBreakdown,
    chartImage: trafficChartImages?.channelChart
  }, {
    key: 'locations',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Visitors by locations', 'google-site-kit'),
    rows: locationBreakdown,
    chartImage: trafficChartImages?.locationChart
  }, {
    key: 'devices',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Visitors by devices', 'google-site-kit'),
    rows: deviceBreakdown,
    chartImage: trafficChartImages?.deviceChart
  }].filter(({
    rows,
    chartImage
  }) => !!(rows?.length && chartImage));

  // Every card that renders, in dashboard order: the All visitors tile
  // first, then the surviving breakdown donuts.
  const cards = [{
    key: 'all-visitors',
    content: /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFMetricTile__WEBPACK_IMPORTED_MODULE_7__["default"], {
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('All visitors', 'google-site-kit'),
      value: formattedValue,
      change: changeText,
      changeType: typeof change === 'number' ? (0,_js_components_pdf_export_getPDFTileChange__WEBPACK_IMPORTED_MODULE_3__.getPDFChangeType)(change) : undefined,
      changeLabel: comparisonLabel
    }), lineChartImage && /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Image, {
      src: lineChartImage,
      style: styles.chart
    }))
  }, ...breakdownTiles.map(({
    key,
    title,
    rows,
    chartImage
  }) => ({
    key,
    content: /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFPieChartTile__WEBPACK_IMPORTED_MODULE_8__["default"], {
      title: title,
      rows: buildLegendRows(rows),
      chartImage: chartImage
    })
  }))];

  // Pair the cards into rows of two, so the grid fills row by row with the
  // cards that have data instead of leaving holes where the others were.
  const cardRows = [];
  for (let index = 0; index < cards.length; index += 2) {
    cardRows.push(cards.slice(index, index + 2));
  }
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, null, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_9__["default"], {
    size: "large",
    style: styles.heading
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Your site traffic over time', 'google-site-kit')), cardRows.map(([leftCard, rightCard], rowIndex) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    key: leftCard.key,
    style: rowIndex === 0 ? styles.row : [styles.row, styles.rowSpacing]
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFCard__WEBPACK_IMPORTED_MODULE_6__["default"], {
    style: styles.card
  }, leftCard.content), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.cardGap
  }), rightCard ? /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFCard__WEBPACK_IMPORTED_MODULE_6__["default"], {
    style: styles.card
  }, rightCard.content) :
  /*#__PURE__*/
  // An invisible spacer holds a lone card at its half
  // width, so the card keeps the two-column size.
  React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.card
  }))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DashboardAllTrafficWidgetGA4PDF);

/***/ },

/***/ "./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/ModulePopularPagesWidgetGA4PDF.tsx"
/*!*****************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/ModulePopularPagesWidgetGA4PDF.tsx ***!
  \*****************************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFLink__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFLink */ "./js/components/pdf-export/shared-react-pdf-components/PDFLink.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTableSection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTableSection */ "./js/components/pdf-export/shared-react-pdf-components/PDFTableSection.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * ModulePopularPagesWidgetGA4 PDF component for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





// Maximum URL characters shown in the Title column before the ellipsis.
const MAX_URL_LENGTH = 70;
const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__.createPDFStyles)({
  titleCell: {
    flexDirection: 'row'
  },
  rank: {
    minWidth: 20,
    marginRight: 8
  },
  titleGroup: {
    flex: 1
  }
});
const ModulePopularPagesWidgetGA4PDF = ({
  data
}) => {
  const heading = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Top content over time', 'google-site-kit');
  const popularPagesData = data;
  const rows = popularPagesData?.rows ?? [];
  const titles = popularPagesData?.titles ?? {};
  const links = popularPagesData?.links ?? {};
  const tableRows = rows.map((row, index) => {
    const url = row.dimensionValues?.[0]?.value ?? '';
    const {
      titleURL = '',
      permaLink = ''
    } = links[url] ?? {};
    const displayURL = url.length > MAX_URL_LENGTH ? `${url.slice(0, MAX_URL_LENGTH)}…` : url;
    return {
      rank: index + 1,
      title: titles[url] ?? '',
      displayURL,
      titleURL,
      permaLink,
      pageviews: row.metricValues?.[0]?.value ?? '',
      sessions: row.metricValues?.[1]?.value ?? '',
      engagementRate: row.metricValues?.[2]?.value ?? '',
      sessionDuration: row.metricValues?.[3]?.value ?? ''
    };
  });
  const columns = [{
    header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Title', 'google-site-kit'),
    // 42.8% of the 1084px row, about 464px.
    width: '42.8%',
    // Shows the page title above its URL, with the row rank to the
    // left. The title links to the page's Analytics report for an
    // administrator and to its entity dashboard for a view-only user,
    // like the dashboard widget, and the URL links to the page itself.
    // When a row has no link, `PDFLink` renders the line as plain text
    // instead of as a link.
    cell: row => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
      style: styles.titleCell
    }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
      style: styles.rank
    }, `${row.rank}.`), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
      style: styles.titleGroup
    }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFLink__WEBPACK_IMPORTED_MODULE_3__["default"], {
      href: row.titleURL
    }, row.title), /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFLink__WEBPACK_IMPORTED_MODULE_3__["default"], {
      href: row.permaLink,
      size: "small"
    }, row.displayURL)))
  }, {
    header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Pageviews', 'google-site-kit'),
    // 6.46% of the 1084px row, about 70px.
    width: '6.46%',
    align: 'right',
    format: row => (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.numFmt)(row.pageviews, {
      style: 'decimal'
    })
  }, {
    header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sessions', 'google-site-kit'),
    // 10.15% of the 1084px row, about 110px.
    width: '10.15%',
    align: 'right',
    format: row => (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.numFmt)(row.sessions, {
      style: 'decimal'
    })
  }, {
    header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Engaged sessions', 'google-site-kit'),
    // 15.5% of the 1084px row, about 168px.
    width: '15.5%',
    align: 'right',
    // The "Engaged sessions" column shows the engagement rate metric,
    // formatted as a percentage.
    format: row => (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.numFmt)(row.engagementRate, '%')
  }, {
    header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Session duration', 'google-site-kit'),
    // 10.33% of the 1084px row, about 112px.
    width: '10.33%',
    align: 'right',
    // numFmt with 's' renders seconds as Xm Ys (for example 1m 38s or
    // 51s).
    format: row => (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.numFmt)(row.sessionDuration, 's')
  }];
  return /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTableSection__WEBPACK_IMPORTED_MODULE_4__["default"], {
    heading: heading,
    columns: columns,
    rows: tableRows
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ModulePopularPagesWidgetGA4PDF);

/***/ },

/***/ "./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/MetricRow.tsx"
/*!***************************************************************************************************!*\
  !*** ./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/MetricRow.tsx ***!
  \***************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MetricRow)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _MetricValueCell__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MetricValueCell */ "./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/MetricValueCell.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * DashboardPageSpeedWidget PDF MetricRow component.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */




const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_1__.createPDFStyles)({
  metricRow: {
    flexDirection: 'row',
    alignItems: 'center',
    columnGap: 24,
    paddingVertical: 12,
    borderBottomWidth: 1,
    borderBottomColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_SURFACE_1
  },
  metricRowLast: {
    borderBottomWidth: 0
  },
  metricLabelGroup: {
    flex: 1
  },
  metricDescription: {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT,
    marginTop: 6
  }
});
function MetricRow({
  title,
  description,
  mobileMetric,
  desktopMetric,
  isLast
}) {
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: isLast ? [styles.metricRow, styles.metricRowLast] : styles.metricRow
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.metricLabelGroup
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_3__["default"], {
    type: "title"
  }, title), /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_3__["default"], {
    size: "small",
    style: styles.metricDescription
  }, description)), /*#__PURE__*/React.createElement(_MetricValueCell__WEBPACK_IMPORTED_MODULE_4__["default"], {
    metric: mobileMetric
  }), /*#__PURE__*/React.createElement(_MetricValueCell__WEBPACK_IMPORTED_MODULE_4__["default"], {
    metric: desktopMetric
  }));
}

/***/ },

/***/ "./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/MetricSection.tsx"
/*!*******************************************************************************************************!*\
  !*** ./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/MetricSection.tsx ***!
  \*******************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MetricSection)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _MetricValueCell__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MetricValueCell */ "./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/MetricValueCell.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * DashboardPageSpeedWidget PDF MetricSection component.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */




const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__.createPDFStyles)({
  headerRow: {
    flexDirection: 'row',
    alignItems: 'center',
    columnGap: 24,
    padding: 24,
    borderBottomWidth: 1,
    borderBottomColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.SURFACES_SURFACE_1
  },
  headerTitleCell: {
    flex: 1
  },
  headerStrategyCell: {
    width: _MetricValueCell__WEBPACK_IMPORTED_MODULE_6__.STRATEGY_COLUMN_WIDTH,
    alignItems: 'flex-start'
  },
  list: {
    paddingHorizontal: 24,
    paddingBottom: 16
  }
});
function MetricSection({
  title,
  children
}) {
  return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.headerRow
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.headerTitleCell
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: "title",
    size: "small"
  }, title)), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.headerStrategyCell
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: "title",
    size: "small"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Mobile', 'google-site-kit'))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.headerStrategyCell
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: "title",
    size: "small"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Desktop', 'google-site-kit')))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.list
  }, children));
}

/***/ },

/***/ "./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/MetricValueCell.tsx"
/*!*********************************************************************************************************!*\
  !*** ./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/MetricValueCell.tsx ***!
  \*********************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   STRATEGY_COLUMN_WIDTH: () => (/* binding */ STRATEGY_COLUMN_WIDTH),
/* harmony export */   "default": () => (/* binding */ MetricValueCell)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFBadge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFBadge */ "./js/components/pdf-export/shared-react-pdf-components/PDFBadge.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _js_modules_pagespeed_insights_util_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/pagespeed-insights/util/constants */ "./js/modules/pagespeed-insights/util/constants.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * DashboardPageSpeedWidget PDF MetricValueCell component.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */






/**
 * The header cells and the value cells share this width, so the two strategy
 * columns line up down the card.
 */
const STRATEGY_COLUMN_WIDTH = 253;
const SCORE_BADGE_COLORS = {
  fast: {
    background: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__.PDF_COLORS.GREEN_G_50,
    text: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__.PDF_COLORS.UTILITY_ON_SUCCESS_CONTAINER
  },
  average: {
    background: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__.PDF_COLORS.YELLOW_Y_50,
    text: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__.PDF_COLORS.YELLOW_Y_500
  },
  slow: {
    background: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__.PDF_COLORS.UTILITY_ERROR_CONTAINER,
    text: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_3__.PDF_COLORS.UTILITY_ON_ERROR_CONTAINER
  }
};
const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__.createPDFStyles)({
  valueCell: {
    width: STRATEGY_COLUMN_WIDTH,
    alignItems: 'flex-start'
  },
  badge: {
    marginTop: 6,
    paddingVertical: 3,
    paddingHorizontal: 10
  }
});

/**
 * Maps a score category to the pill's colors. Fast maps to the green pair,
 * slow to the red pair, and any other category to the yellow pair.
 *
 * @since 1.183.0
 *
 * @param category The metric's score category from the report.
 * @return The pill's background and text colors.
 */
function getBadgeColors(category) {
  switch (category) {
    case _js_modules_pagespeed_insights_util_constants__WEBPACK_IMPORTED_MODULE_6__.CATEGORY_FAST:
      return SCORE_BADGE_COLORS.fast;
    case _js_modules_pagespeed_insights_util_constants__WEBPACK_IMPORTED_MODULE_6__.CATEGORY_SLOW:
      return SCORE_BADGE_COLORS.slow;
    default:
      return SCORE_BADGE_COLORS.average;
  }
}

/**
 * Maps a score category to the pill's translated label. Fast reads "Good",
 * slow reads "Poor", and any other category reads "Needs improvement".
 *
 * @since 1.183.0
 *
 * @param category The metric's score category from the report.
 * @return The pill's translated label.
 */
function getCategoryLabel(category) {
  switch (category) {
    case _js_modules_pagespeed_insights_util_constants__WEBPACK_IMPORTED_MODULE_6__.CATEGORY_FAST:
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Good', 'google-site-kit');
    case _js_modules_pagespeed_insights_util_constants__WEBPACK_IMPORTED_MODULE_6__.CATEGORY_SLOW:
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Poor', 'google-site-kit');
    default:
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Needs improvement', 'google-site-kit');
  }
}
function MetricValueCell({
  metric
}) {
  if (!metric) {
    // A missing metric renders an empty cell. The fixed width keeps the
    // other strategy's column in place.
    return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
      style: styles.valueCell
    });
  }
  const badgeColors = getBadgeColors(metric.category);
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.valueCell
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: "title"
  }, metric.displayValue), /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFBadge__WEBPACK_IMPORTED_MODULE_4__["default"], {
    label: getCategoryLabel(metric.category),
    backgroundColor: badgeColors.background,
    color: badgeColors.text,
    style: styles.badge
  }));
}

/***/ },

/***/ "./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/SpeedMetricSections.tsx"
/*!*************************************************************************************************************!*\
  !*** ./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/SpeedMetricSections.tsx ***!
  \*************************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SpeedMetricSections)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFCard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFCard */ "./js/components/pdf-export/shared-react-pdf-components/PDFCard.tsx");
/* harmony import */ var _MetricRow__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MetricRow */ "./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/MetricRow.tsx");
/* harmony import */ var _MetricSection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MetricSection */ "./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/MetricSection.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * DashboardPageSpeedWidget PDF SpeedMetricSections component.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */




const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__.createPDFStyles)({
  // The section header and the metric rows own the padding, so the card
  // sets none and its radius wraps both.
  card: {
    padding: 0
  },
  secondCard: {
    padding: 0,
    marginTop: 15
  }
});
function SpeedMetricSections({
  mobile,
  desktop
}) {
  const hasField = mobile?.field !== null && mobile?.field !== undefined ? true : desktop?.field !== null && desktop?.field !== undefined;
  return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFCard__WEBPACK_IMPORTED_MODULE_3__["default"], {
    style: styles.card
  }, /*#__PURE__*/React.createElement(_MetricSection__WEBPACK_IMPORTED_MODULE_5__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Lab data', 'google-site-kit')
  }, /*#__PURE__*/React.createElement(_MetricRow__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('Largest Contentful Paint', 'core web vitals name', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Time it takes for the page to load', 'google-site-kit'),
    mobileMetric: mobile?.lab.largestContentfulPaint,
    desktopMetric: desktop?.lab.largestContentfulPaint
  }), /*#__PURE__*/React.createElement(_MetricRow__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('Cumulative Layout Shift', 'core web vitals name', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('How stable the elements on the page are', 'google-site-kit'),
    mobileMetric: mobile?.lab.cumulativeLayoutShift,
    desktopMetric: desktop?.lab.cumulativeLayoutShift
  }), /*#__PURE__*/React.createElement(_MetricRow__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Total Blocking Time', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('How long people had to wait after the page loaded before they could click something', 'google-site-kit'),
    mobileMetric: mobile?.lab.totalBlockingTime,
    desktopMetric: desktop?.lab.totalBlockingTime,
    isLast: true
  }))), hasField && /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFCard__WEBPACK_IMPORTED_MODULE_3__["default"], {
    style: styles.secondCard
  }, /*#__PURE__*/React.createElement(_MetricSection__WEBPACK_IMPORTED_MODULE_5__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Real user data', 'google-site-kit')
  }, /*#__PURE__*/React.createElement(_MetricRow__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('Largest Contentful Paint', 'core web vitals name', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Time it takes for the page to load', 'google-site-kit'),
    mobileMetric: mobile?.field?.largestContentfulPaint,
    desktopMetric: desktop?.field?.largestContentfulPaint
  }), /*#__PURE__*/React.createElement(_MetricRow__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('Cumulative Layout Shift', 'core web vitals name', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('How stable the elements on the page are', 'google-site-kit'),
    mobileMetric: mobile?.field?.cumulativeLayoutShift,
    desktopMetric: desktop?.field?.cumulativeLayoutShift
  }), /*#__PURE__*/React.createElement(_MetricRow__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('Interaction to Next Paint', 'core web vitals name', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('How quickly your page responds when people interact with it', 'google-site-kit'),
    mobileMetric: mobile?.field?.interactionToNextPaint,
    desktopMetric: desktop?.field?.interactionToNextPaint,
    isLast: true
  }))));
}

/***/ },

/***/ "./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/indexPDF.tsx"
/*!**************************************************************************************************!*\
  !*** ./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/indexPDF.tsx ***!
  \**************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _SpeedMetricSections__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SpeedMetricSections */ "./js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeedWidget/SpeedMetricSections.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * DashboardPageSpeedWidget PDF component for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__.createPDFStyles)({
  heading: {
    marginBottom: 15
  }
});
const DashboardPageSpeedWidgetPDF = ({
  data
}) => {
  const speedData = data;

  // Without data the widget returns null, and no placeholder takes its place.
  if (!speedData || !speedData.mobile && !speedData.desktop) {
    return null;
  }
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, null, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_3__["default"], {
    size: "large",
    style: styles.heading
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Your site performance', 'google-site-kit')), /*#__PURE__*/React.createElement(_SpeedMetricSections__WEBPACK_IMPORTED_MODULE_4__["default"], {
    mobile: speedData.mobile,
    desktop: speedData.desktop
  }));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DashboardPageSpeedWidgetPDF);

/***/ },

/***/ "./js/modules/search-console/components/dashboard/DashboardPopularKeywordsWidget/DashboardPopularKeywordsWidgetPDF.tsx"
/*!*****************************************************************************************************************************!*\
  !*** ./js/modules/search-console/components/dashboard/DashboardPopularKeywordsWidget/DashboardPopularKeywordsWidgetPDF.tsx ***!
  \*****************************************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFLink__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFLink */ "./js/components/pdf-export/shared-react-pdf-components/PDFLink.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTableSection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTableSection */ "./js/components/pdf-export/shared-react-pdf-components/PDFTableSection.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * DashboardPopularKeywordsWidget PDF component for `@react-pdf/renderer`.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_2__.createPDFStyles)({
  queryCell: {
    flexDirection: 'row'
  },
  rank: {
    minWidth: 20,
    marginRight: 8
  }
});
const DashboardPopularKeywordsWidgetPDF = ({
  data
}) => {
  const heading = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Top search queries for your site', 'google-site-kit');
  const popularKeywordsData = data;
  const rows = popularKeywordsData?.rows ?? [];
  const links = popularKeywordsData?.links ?? {};

  // The query report has one dimension, so the first key is the query.
  const tableRows = rows.map((row, index) => {
    const query = row.keys?.[0] ?? '';
    return {
      rank: index + 1,
      query,
      queryURL: links[query] ?? '',
      clicks: row.clicks,
      impressions: row.impressions
    };
  });
  const columns = [{
    header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Search query', 'google-site-kit'),
    // 66.7% of the 1084px row (723px).
    width: '66.7%',
    // Show the rank number before the query. The query links to its
    // Search Console report, like the dashboard widget.
    cell: row => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
      style: styles.queryCell
    }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
      style: styles.rank
    }, `${row.rank}.`), /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_5__["default"], {
      truncateContent: true
    }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFLink__WEBPACK_IMPORTED_MODULE_3__["default"], {
      href: row.queryURL
    }, row.query)))
  }, {
    header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Clicks', 'google-site-kit'),
    // 3.69% of the 1084px row (40px).
    width: '3.69%',
    align: 'right',
    format: row => (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.numFmt)(row.clicks, {
      style: 'decimal'
    })
  }, {
    header: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Impressions', 'google-site-kit'),
    // 28.87% of the 1084px row (313px).
    width: '28.87%',
    align: 'right',
    format: row => (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.numFmt)(row.impressions, {
      style: 'decimal'
    })
  }];
  return /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTableSection__WEBPACK_IMPORTED_MODULE_4__["default"], {
    heading: heading,
    columns: columns,
    rows: tableRows,
    columnGap: 8
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DashboardPopularKeywordsWidgetPDF);

/***/ },

/***/ "./js/modules/search-console/components/dashboard/SearchFunnelWidgetGA4/indexPDF.tsx"
/*!*******************************************************************************************!*\
  !*** ./js/modules/search-console/components/dashboard/SearchFunnelWidgetGA4/indexPDF.tsx ***!
  \*******************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-scale */ "./js/components/pdf-export/pdf-scale.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFMetricChartTile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFMetricChartTile */ "./js/components/pdf-export/shared-react-pdf-components/PDFMetricChartTile.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFTypography */ "./js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");

/**
 * SearchFunnelWidgetGA4 PDF component for @react-pdf/renderer.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





const styles = (0,_js_components_pdf_export_pdf_scale__WEBPACK_IMPORTED_MODULE_3__.createPDFStyles)({
  heading: {
    marginBottom: 15
  },
  grid: {
    flexDirection: 'row',
    flexWrap: 'wrap',
    justifyContent: 'space-between',
    rowGap: 24
  },
  cell: {
    width: '48.94%'
  }
});
/** The cards render in the 2x2 grid in this order. */
const CARDS = [{
  key: 'impressions',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Total impressions', 'google-site-kit'),
  currentLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Impressions', 'google-site-kit'),
  color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.BLUE_B_400
}, {
  key: 'clicks',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Total clicks', 'google-site-kit'),
  currentLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Clicks', 'google-site-kit'),
  color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.TEAL_T_300
}, {
  key: 'uniqueVisitors',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Unique visitors from Search', 'google-site-kit'),
  currentLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Unique visitors', 'google-site-kit'),
  color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.SITE_KIT_SK_500
}, {
  key: 'keyEvents',
  title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Key events', 'google-site-kit'),
  currentLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Key events', 'google-site-kit'),
  color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_COLORS.VIOLET_V_300
}];

/**
 * Derives the change chip props from a metric's period-over-period change ratio.
 *
 * @since 1.183.0
 *
 * @param metric The metric data, if any.
 * @return Props for the change chip (empty when the change is unavailable).
 */
function getChangeProps(metric) {
  const change = metric?.change;
  if (typeof change !== 'number') {
    return {};
  }
  return {
    change: (change > 0 ? '+' : '') + (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.numFmt)(change, {
      style: 'percent',
      maximumFractionDigits: 1
    }),
    changeDirection: change >= 0 ? 'up' : 'down'
  };
}
const SearchFunnelWidgetGA4PDF = ({
  data,
  chartImages
}) => {
  // Without data the widget returns null, and no placeholder takes its place.
  if (!data) {
    return null;
  }
  const {
    dateRangeLength,
    metrics
  } = data;
  const changeLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %d: number of days in the comparison period */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Vs. prev. %d days', 'google-site-kit'), dateRangeLength);
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, null, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFTypography__WEBPACK_IMPORTED_MODULE_6__["default"], {
    size: "large",
    style: styles.heading
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Search traffic over time', 'google-site-kit')), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
    style: styles.grid
  }, CARDS.map(({
    key,
    title,
    currentLabel,
    color
  }) => {
    const metric = metrics[key];
    const chartImage = chartImages?.[key];

    // The widget skips a card whose metric failed. The loader
    // fails the whole widget when every card fails, so the
    // heading never renders above an empty grid.
    if (!chartImage) {
      return null;
    }
    return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_1__.View, {
      key: key,
      style: styles.cell
    }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFMetricChartTile__WEBPACK_IMPORTED_MODULE_5__["default"], (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
      title: title,
      value: (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.numFmt)(metric?.total || 0),
      changeLabel: changeLabel,
      currentLabel: currentLabel,
      color: color,
      chartImage: chartImage
    }, getChangeProps(metric))));
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchFunnelWidgetGA4PDF);

/***/ },

/***/ "./js/googlesitekit/datastore/user/constants.js"
/*!******************************************************!*\
  !*** ./js/googlesitekit/datastore/user/constants.js ***!
  \******************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CORE_USER: () => (/* binding */ CORE_USER),
/* harmony export */   DISCONNECTED_REASON_CONNECTED_URL_MISMATCH: () => (/* binding */ DISCONNECTED_REASON_CONNECTED_URL_MISMATCH),
/* harmony export */   EMAIL_REPORT_FREQUENCIES: () => (/* binding */ EMAIL_REPORT_FREQUENCIES),
/* harmony export */   ERROR_CODE_ADBLOCKER_ACTIVE: () => (/* binding */ ERROR_CODE_ADBLOCKER_ACTIVE),
/* harmony export */   FORM_TEMPORARY_PERSIST_PERMISSION_ERROR: () => (/* binding */ FORM_TEMPORARY_PERSIST_PERMISSION_ERROR),
/* harmony export */   GLOBAL_SURVEYS_TIMEOUT_SLUG: () => (/* binding */ GLOBAL_SURVEYS_TIMEOUT_SLUG),
/* harmony export */   INITIAL_SETUP_NOTIFICATION_TIMEOUT_SLUG: () => (/* binding */ INITIAL_SETUP_NOTIFICATION_TIMEOUT_SLUG),
/* harmony export */   KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT: () => (/* binding */ KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT),
/* harmony export */   KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE: () => (/* binding */ KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE),
/* harmony export */   KM_ANALYTICS_LEAST_ENGAGING_PAGES: () => (/* binding */ KM_ANALYTICS_LEAST_ENGAGING_PAGES),
/* harmony export */   KM_ANALYTICS_MOST_ENGAGING_PAGES: () => (/* binding */ KM_ANALYTICS_MOST_ENGAGING_PAGES),
/* harmony export */   KM_ANALYTICS_NEW_VISITORS: () => (/* binding */ KM_ANALYTICS_NEW_VISITORS),
/* harmony export */   KM_ANALYTICS_PAGES_PER_VISIT: () => (/* binding */ KM_ANALYTICS_PAGES_PER_VISIT),
/* harmony export */   KM_ANALYTICS_POPULAR_AUTHORS: () => (/* binding */ KM_ANALYTICS_POPULAR_AUTHORS),
/* harmony export */   KM_ANALYTICS_POPULAR_CONTENT: () => (/* binding */ KM_ANALYTICS_POPULAR_CONTENT),
/* harmony export */   KM_ANALYTICS_POPULAR_PRODUCTS: () => (/* binding */ KM_ANALYTICS_POPULAR_PRODUCTS),
/* harmony export */   KM_ANALYTICS_RETURNING_VISITORS: () => (/* binding */ KM_ANALYTICS_RETURNING_VISITORS),
/* harmony export */   KM_ANALYTICS_TOP_CATEGORIES: () => (/* binding */ KM_ANALYTICS_TOP_CATEGORIES),
/* harmony export */   KM_ANALYTICS_TOP_CITIES: () => (/* binding */ KM_ANALYTICS_TOP_CITIES),
/* harmony export */   KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART: () => (/* binding */ KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART),
/* harmony export */   KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS: () => (/* binding */ KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS),
/* harmony export */   KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES: () => (/* binding */ KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES),
/* harmony export */   KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE: () => (/* binding */ KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE),
/* harmony export */   KM_ANALYTICS_TOP_COUNTRIES: () => (/* binding */ KM_ANALYTICS_TOP_COUNTRIES),
/* harmony export */   KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES: () => (/* binding */ KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES),
/* harmony export */   KM_ANALYTICS_TOP_PAGES_DRIVING_LEADS: () => (/* binding */ KM_ANALYTICS_TOP_PAGES_DRIVING_LEADS),
/* harmony export */   KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES: () => (/* binding */ KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES),
/* harmony export */   KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES: () => (/* binding */ KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES),
/* harmony export */   KM_ANALYTICS_TOP_TRAFFIC_SOURCE: () => (/* binding */ KM_ANALYTICS_TOP_TRAFFIC_SOURCE),
/* harmony export */   KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART: () => (/* binding */ KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART),
/* harmony export */   KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_LEADS: () => (/* binding */ KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_LEADS),
/* harmony export */   KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES: () => (/* binding */ KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES),
/* harmony export */   KM_ANALYTICS_VISITS_PER_VISITOR: () => (/* binding */ KM_ANALYTICS_VISITS_PER_VISITOR),
/* harmony export */   KM_ANALYTICS_VISIT_LENGTH: () => (/* binding */ KM_ANALYTICS_VISIT_LENGTH),
/* harmony export */   KM_SEARCH_CONSOLE_POPULAR_KEYWORDS: () => (/* binding */ KM_SEARCH_CONSOLE_POPULAR_KEYWORDS),
/* harmony export */   PERMISSION_AUTHENTICATE: () => (/* binding */ PERMISSION_AUTHENTICATE),
/* harmony export */   PERMISSION_DELEGATE_MODULE_SHARING_MANAGEMENT: () => (/* binding */ PERMISSION_DELEGATE_MODULE_SHARING_MANAGEMENT),
/* harmony export */   PERMISSION_MANAGE_MODULE_SHARING_OPTIONS: () => (/* binding */ PERMISSION_MANAGE_MODULE_SHARING_OPTIONS),
/* harmony export */   PERMISSION_MANAGE_OPTIONS: () => (/* binding */ PERMISSION_MANAGE_OPTIONS),
/* harmony export */   PERMISSION_READ_SHARED_MODULE_DATA: () => (/* binding */ PERMISSION_READ_SHARED_MODULE_DATA),
/* harmony export */   PERMISSION_SETUP: () => (/* binding */ PERMISSION_SETUP),
/* harmony export */   PERMISSION_UPDATE_PLUGINS: () => (/* binding */ PERMISSION_UPDATE_PLUGINS),
/* harmony export */   PERMISSION_VIEW_DASHBOARD: () => (/* binding */ PERMISSION_VIEW_DASHBOARD),
/* harmony export */   PERMISSION_VIEW_MODULE_DETAILS: () => (/* binding */ PERMISSION_VIEW_MODULE_DETAILS),
/* harmony export */   PERMISSION_VIEW_POSTS_INSIGHTS: () => (/* binding */ PERMISSION_VIEW_POSTS_INSIGHTS),
/* harmony export */   PERMISSION_VIEW_SHARED_DASHBOARD: () => (/* binding */ PERMISSION_VIEW_SHARED_DASHBOARD),
/* harmony export */   WELCOME_GATHERING_DATA_DISMISSED_ITEM_SLUG: () => (/* binding */ WELCOME_GATHERING_DATA_DISMISSED_ITEM_SLUG),
/* harmony export */   WELCOME_WITH_TOUR_DISMISSED_ITEM_SLUG: () => (/* binding */ WELCOME_WITH_TOUR_DISMISSED_ITEM_SLUG),
/* harmony export */   allKeyMetricsTileWidgets: () => (/* binding */ allKeyMetricsTileWidgets),
/* harmony export */   keyMetricsGA4Widgets: () => (/* binding */ keyMetricsGA4Widgets)
/* harmony export */ });
/**
 * `core/user` data store: constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const CORE_USER = 'core/user';
const DISCONNECTED_REASON_CONNECTED_URL_MISMATCH = 'connected_url_mismatch';
const GLOBAL_SURVEYS_TIMEOUT_SLUG = '__global';
const FORM_TEMPORARY_PERSIST_PERMISSION_ERROR = 'temporary_persist_permission_error';
const ERROR_CODE_ADBLOCKER_ACTIVE = 'adblocker_active';

// Email Report Frequency options.
const EMAIL_REPORT_FREQUENCIES = ['weekly', 'monthly', 'quarterly'];

// Permissions list.
const PERMISSION_AUTHENTICATE = 'googlesitekit_authenticate';
const PERMISSION_SETUP = 'googlesitekit_setup';
const PERMISSION_VIEW_POSTS_INSIGHTS = 'googlesitekit_view_posts_insights';
const PERMISSION_VIEW_DASHBOARD = 'googlesitekit_view_dashboard';
const PERMISSION_VIEW_SHARED_DASHBOARD = 'googlesitekit_view_shared_dashboard';
const PERMISSION_VIEW_MODULE_DETAILS = 'googlesitekit_view_module_details';
const PERMISSION_MANAGE_OPTIONS = 'googlesitekit_manage_options';
const PERMISSION_READ_SHARED_MODULE_DATA = 'googlesitekit_read_shared_module_data';
const PERMISSION_MANAGE_MODULE_SHARING_OPTIONS = 'googlesitekit_manage_module_sharing_options';
const PERMISSION_DELEGATE_MODULE_SHARING_MANAGEMENT = 'googlesitekit_delegate_module_sharing_management';
const PERMISSION_UPDATE_PLUGINS = 'googlesitekit_update_plugins';

// Key Metrics Widgets
const KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT = 'kmAnalyticsAdSenseTopEarningContent';
const KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE = 'kmAnalyticsEngagedTrafficSource';
const KM_ANALYTICS_LEAST_ENGAGING_PAGES = 'kmAnalyticsLeastEngagingPages';
const KM_ANALYTICS_NEW_VISITORS = 'kmAnalyticsNewVisitors';
const KM_ANALYTICS_POPULAR_AUTHORS = 'kmAnalyticsPopularAuthors';
const KM_ANALYTICS_POPULAR_CONTENT = 'kmAnalyticsPopularContent';
const KM_ANALYTICS_POPULAR_PRODUCTS = 'kmAnalyticsPopularProducts';
const KM_ANALYTICS_RETURNING_VISITORS = 'kmAnalyticsReturningVisitors';
const KM_ANALYTICS_TOP_CITIES = 'kmAnalyticsTopCities';
const KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS = 'kmAnalyticsTopCitiesDrivingLeads';
const KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART = 'kmAnalyticsTopCitiesDrivingAddToCart';
const KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES = 'kmAnalyticsTopCitiesDrivingPurchases';
const KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES = 'kmAnalyticsTopDeviceDrivingPurchases';
const KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE = 'kmAnalyticsTopConvertingTrafficSource';
const KM_ANALYTICS_TOP_COUNTRIES = 'kmAnalyticsTopCountries';
const KM_ANALYTICS_TOP_PAGES_DRIVING_LEADS = 'kmAnalyticsTopPagesDrivingLeads';
const KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES = 'kmAnalyticsTopRecentTrendingPages';
const KM_ANALYTICS_TOP_TRAFFIC_SOURCE = 'kmAnalyticsTopTrafficSource';
const KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART = 'kmAnalyticsTopTrafficSourceDrivingAddToCart';
const KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_LEADS = 'kmAnalyticsTopTrafficSourceDrivingLeads';
const KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES = 'kmAnalyticsTopTrafficSourceDrivingPurchases';
const KM_ANALYTICS_PAGES_PER_VISIT = 'kmAnalyticsPagesPerVisit';
const KM_ANALYTICS_VISIT_LENGTH = 'kmAnalyticsVisitLength';
const KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES = 'kmAnalyticsTopReturningVisitorPages';
const KM_SEARCH_CONSOLE_POPULAR_KEYWORDS = 'kmSearchConsolePopularKeywords';
const KM_ANALYTICS_VISITS_PER_VISITOR = 'kmAnalyticsVisitsPerVisitor';
const KM_ANALYTICS_MOST_ENGAGING_PAGES = 'kmAnalyticsMostEngagingPages';
const KM_ANALYTICS_TOP_CATEGORIES = 'kmAnalyticsTopCategories';
const keyMetricsGA4Widgets = [KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT, KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE, KM_ANALYTICS_LEAST_ENGAGING_PAGES, KM_ANALYTICS_NEW_VISITORS, KM_ANALYTICS_POPULAR_AUTHORS, KM_ANALYTICS_POPULAR_CONTENT, KM_ANALYTICS_POPULAR_PRODUCTS, KM_ANALYTICS_RETURNING_VISITORS, KM_ANALYTICS_TOP_CATEGORIES, KM_ANALYTICS_TOP_CITIES, KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS, KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART, KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES, KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES, KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE, KM_ANALYTICS_TOP_COUNTRIES, KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES, KM_ANALYTICS_TOP_TRAFFIC_SOURCE, KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART, KM_ANALYTICS_PAGES_PER_VISIT, KM_ANALYTICS_VISIT_LENGTH, KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES, KM_ANALYTICS_VISITS_PER_VISITOR, KM_ANALYTICS_MOST_ENGAGING_PAGES, KM_ANALYTICS_TOP_CATEGORIES];
const allKeyMetricsTileWidgets = [...keyMetricsGA4Widgets, KM_SEARCH_CONSOLE_POPULAR_KEYWORDS];
const WELCOME_WITH_TOUR_DISMISSED_ITEM_SLUG = 'welcome-modal-with-tour';
const WELCOME_GATHERING_DATA_DISMISSED_ITEM_SLUG = 'welcome-modal-gathering-data';
const INITIAL_SETUP_NOTIFICATION_TIMEOUT_SLUG = 'initial-setup-notification-timeout';

/***/ },

/***/ "./js/googlesitekit/widgets/datastore/constants.js"
/*!*********************************************************!*\
  !*** ./js/googlesitekit/widgets/datastore/constants.js ***!
  \*********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CORE_WIDGETS: () => (/* binding */ CORE_WIDGETS),
/* harmony export */   WIDGET_AREA_STYLES: () => (/* binding */ WIDGET_AREA_STYLES),
/* harmony export */   WIDGET_WIDTHS: () => (/* binding */ WIDGET_WIDTHS)
/* harmony export */ });
/**
 * `core/widgets` data store: constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const WIDGET_AREA_STYLES = {
  BOXES: 'boxes',
  COMPOSITE: 'composite'
};
const WIDGET_WIDTHS = {
  QUARTER: 'quarter',
  HALF: 'half',
  FULL: 'full'
};
const CORE_WIDGETS = 'core/widgets';

/***/ },

/***/ "./js/googlesitekit/widgets/default-contexts.js"
/*!******************************************************!*\
  !*** ./js/googlesitekit/widgets/default-contexts.js ***!
  \******************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CONTEXT_ENTITY_DASHBOARD_CONTENT: () => (/* binding */ CONTEXT_ENTITY_DASHBOARD_CONTENT),
/* harmony export */   CONTEXT_ENTITY_DASHBOARD_MONETIZATION: () => (/* binding */ CONTEXT_ENTITY_DASHBOARD_MONETIZATION),
/* harmony export */   CONTEXT_ENTITY_DASHBOARD_SPEED: () => (/* binding */ CONTEXT_ENTITY_DASHBOARD_SPEED),
/* harmony export */   CONTEXT_ENTITY_DASHBOARD_TRAFFIC: () => (/* binding */ CONTEXT_ENTITY_DASHBOARD_TRAFFIC),
/* harmony export */   CONTEXT_MAIN_DASHBOARD_CONTENT: () => (/* binding */ CONTEXT_MAIN_DASHBOARD_CONTENT),
/* harmony export */   CONTEXT_MAIN_DASHBOARD_KEY_METRICS: () => (/* binding */ CONTEXT_MAIN_DASHBOARD_KEY_METRICS),
/* harmony export */   CONTEXT_MAIN_DASHBOARD_MONETIZATION: () => (/* binding */ CONTEXT_MAIN_DASHBOARD_MONETIZATION),
/* harmony export */   CONTEXT_MAIN_DASHBOARD_SITE_GOALS: () => (/* binding */ CONTEXT_MAIN_DASHBOARD_SITE_GOALS),
/* harmony export */   CONTEXT_MAIN_DASHBOARD_SPEED: () => (/* binding */ CONTEXT_MAIN_DASHBOARD_SPEED),
/* harmony export */   CONTEXT_MAIN_DASHBOARD_TRAFFIC: () => (/* binding */ CONTEXT_MAIN_DASHBOARD_TRAFFIC),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Widgets API default contexts
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Main dashboard
const CONTEXT_MAIN_DASHBOARD_KEY_METRICS = 'mainDashboardKeyMetrics';
const CONTEXT_MAIN_DASHBOARD_SITE_GOALS = 'mainDashboardSiteGoals';
const CONTEXT_MAIN_DASHBOARD_TRAFFIC = 'mainDashboardTraffic';
const CONTEXT_MAIN_DASHBOARD_CONTENT = 'mainDashboardContent';
const CONTEXT_MAIN_DASHBOARD_SPEED = 'mainDashboardSpeed';
const CONTEXT_MAIN_DASHBOARD_MONETIZATION = 'mainDashboardMonetization';
// Entity dashboard
const CONTEXT_ENTITY_DASHBOARD_TRAFFIC = 'entityDashboardTraffic';
const CONTEXT_ENTITY_DASHBOARD_CONTENT = 'entityDashboardContent';
const CONTEXT_ENTITY_DASHBOARD_SPEED = 'entityDashboardSpeed';
const CONTEXT_ENTITY_DASHBOARD_MONETIZATION = 'entityDashboardMonetization';
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  // Main dashboard
  CONTEXT_MAIN_DASHBOARD_KEY_METRICS,
  CONTEXT_MAIN_DASHBOARD_SITE_GOALS,
  CONTEXT_MAIN_DASHBOARD_TRAFFIC,
  CONTEXT_MAIN_DASHBOARD_CONTENT,
  CONTEXT_MAIN_DASHBOARD_SPEED,
  CONTEXT_MAIN_DASHBOARD_MONETIZATION,
  // Entity dashboard
  CONTEXT_ENTITY_DASHBOARD_TRAFFIC,
  CONTEXT_ENTITY_DASHBOARD_CONTENT,
  CONTEXT_ENTITY_DASHBOARD_SPEED,
  CONTEXT_ENTITY_DASHBOARD_MONETIZATION
});

/***/ },

/***/ "./js/googlesitekit/widgets/util/widget-modules.js"
/*!*********************************************************!*\
  !*** ./js/googlesitekit/widgets/util/widget-modules.js ***!
  \*********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   normalizeWidgetModules: () => (/* binding */ normalizeWidgetModules)
/* harmony export */ });
/**
 * Widget's modules utility.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Normalizes widget's modules by converting it to an array and filtering out all non-string values.
 *
 * @since 1.71.0
 *
 * @param {string|Array.<string>} modules Widget's mdoules.
 * @return {Array.<string>} Widget's modules list.
 */
function normalizeWidgetModules(modules) {
  return (Array.isArray(modules) ? modules : [modules]).filter(module => typeof module === 'string' && module.length > 0);
}

/***/ },

/***/ "./js/modules/pagespeed-insights/util/constants.js"
/*!*********************************************************!*\
  !*** ./js/modules/pagespeed-insights/util/constants.js ***!
  \*********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CATEGORY_AVERAGE: () => (/* binding */ CATEGORY_AVERAGE),
/* harmony export */   CATEGORY_FAST: () => (/* binding */ CATEGORY_FAST),
/* harmony export */   CATEGORY_SLOW: () => (/* binding */ CATEGORY_SLOW)
/* harmony export */ });
/**
 * PageSpeed Insights - Component constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Performance categories.
const CATEGORY_FAST = 'fast';
const CATEGORY_AVERAGE = 'average';
const CATEGORY_SLOW = 'slow';

/***/ },

/***/ "./images/logo-g.png"
/*!***************************!*\
  !*** ./images/logo-g.png ***!
  \***************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
module.exports = __webpack_require__.p + "images/logo-g-df27315b36d77ae03ea2.png";

/***/ },

/***/ "./js/components/pdf-export/fonts/google-sans-display-medium.ttf"
/*!***********************************************************************!*\
  !*** ./js/components/pdf-export/fonts/google-sans-display-medium.ttf ***!
  \***********************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
module.exports = __webpack_require__.p + "fonts/google-sans-display-medium-b41b7e0618b540110582.ttf";

/***/ },

/***/ "./js/components/pdf-export/fonts/google-sans-display-regular.ttf"
/*!************************************************************************!*\
  !*** ./js/components/pdf-export/fonts/google-sans-display-regular.ttf ***!
  \************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
module.exports = __webpack_require__.p + "fonts/google-sans-display-regular-67843392439f681fdbfd.ttf";

/***/ },

/***/ "./js/components/pdf-export/fonts/google-sans-text-medium.ttf"
/*!********************************************************************!*\
  !*** ./js/components/pdf-export/fonts/google-sans-text-medium.ttf ***!
  \********************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
module.exports = __webpack_require__.p + "fonts/google-sans-text-medium-53980445227ada4764a7.ttf";

/***/ },

/***/ "./js/components/pdf-export/fonts/google-sans-text-regular.ttf"
/*!*********************************************************************!*\
  !*** ./js/components/pdf-export/fonts/google-sans-text-regular.ttf ***!
  \*********************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
module.exports = __webpack_require__.p + "fonts/google-sans-text-regular-0d01ceaea2903216c4ee.ttf";

/***/ },

/***/ "?69d4"
/*!************************!*\
  !*** buffer (ignored) ***!
  \************************/
() {

/* (ignored) */

/***/ },

/***/ "?1709"
/*!************************!*\
  !*** crypto (ignored) ***!
  \************************/
() {

/* (ignored) */

/***/ }

}]);
//# sourceMappingURL=googlesitekit-vendor-lazy-pdf.js.map