"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _i18n = require("@wordpress/i18n");
var _components = require("@wordpress/components");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

function GoogleFontsConfirmDialog() {
  const handleConfirm = () => {
    // eslint-disable-next-line no-undef
    window.localStorage.setItem('wp-font-library-google-fonts-permission', 'true');
    window.dispatchEvent(new Event('storage'));
  };
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    className: "font-library__google-fonts-confirm",
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Card, {
      children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.CardBody, {
        children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHeading, {
          level: 2,
          children: (0, _i18n.__)('Connect to Google Fonts')
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalSpacer, {
          margin: 6
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
          as: "p",
          children: (0, _i18n.__)('To install fonts from Google you must give permission to connect directly to Google servers. The fonts you install will be downloaded from Google and stored on your site. Your site will then use these locally-hosted fonts.')
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalSpacer, {
          margin: 3
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
          as: "p",
          children: (0, _i18n.__)('You can alternatively upload files directly on the Upload tab.')
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalSpacer, {
          margin: 6
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
          __next40pxDefaultSize: true,
          variant: "primary",
          onClick: handleConfirm,
          children: (0, _i18n.__)('Allow access to Google Fonts')
        })]
      })
    })
  });
}
var _default = exports.default = GoogleFontsConfirmDialog;
//# sourceMappingURL=google-fonts-confirm-dialog.js.map