From 00c428917374fd1932442f2be5c2511a44065ad7 Mon Sep 17 00:00:00 2001 From: ajayadav09 Date: Wed, 13 Nov 2024 18:50:03 +0530 Subject: [PATCH] updated build files --- build/index.asset.php | 2 +- build/index.css | 416 +-- build/index.js | 5795 +---------------------------------------- 3 files changed, 3 insertions(+), 6210 deletions(-) diff --git a/build/index.asset.php b/build/index.asset.php index d4415b0..f442f30 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '033c632e9f51012327de'); + array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '868ae9d5607045463515'); diff --git a/build/index.css b/build/index.css index babc2aa..d7953dc 100644 --- a/build/index.css +++ b/build/index.css @@ -1,415 +1 @@ -/*!************************************************************************************************************************************************************************************************************************************!*\ - !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!./styles.scss ***! - \************************************************************************************************************************************************************************************************************************************/ -#nfd-help-center { - box-sizing: border-box; -} -#nfd-help-center .nfd-hc-modal { - padding-bottom: 32px; -} -#nfd-help-center .nfd-hc-modal h4, -#nfd-help-center .nfd-hc-modal h3 { - margin: 0; -} -#nfd-help-center .nfd-hc-modal__header { - background-color: #fff; - display: flex; - justify-content: space-between; - align-items: center; - position: sticky; - width: 350px; - height: 48px; - top: 0; - left: 0; - border-bottom: 1px solid #dddfe0; -} -#nfd-help-center .nfd-hc-modal__header__heading { - font-size: 20px; - line-height: 24px; - font-weight: 400; - color: #394150; - padding-top: 4px; -} -#nfd-help-center .nfd-hc-modal__header__heading__icon { - margin-right: 12px; - margin-left: 12px; - vertical-align: middle; -} -#nfd-help-center .nfd-hc-modal__header__close-button { - border: 0; - background: none; - margin-right: 1px; -} -#nfd-help-center .helpcenter-intro { - padding: 12px; - display: flex; - justify-content: flex-start; - align-items: stretch; -} -#nfd-help-center .helpcenter-intro__text { - padding: 0 8px; -} -#nfd-help-center * { - box-sizing: border-box; -} -.nfd-plugin-sidebar .nfd-help-center .feedback-container .feedback-button { - padding-left: 6px; - padding-right: 6px; -} -.nfd-plugin-sidebar .nfd-help-center .feedback-container .feedback-question { - padding-top: 8px; -} -.nfd-help-center { - position: relative; - height: calc(100vh - 332px); - overflow-y: auto; - z-index: 10; -} -.nfd-help-center p { - font-size: 14px; -} -.nfd-help-center p br { - content: ""; - display: block; - margin-bottom: 5px; /* Adjust this value as per your requirements */ -} -.nfd-help-center h4, -.nfd-help-center h3 { - margin: 0; -} -.nfd-help-center .launch-help-center { - text-align: center; -} -.nfd-help-center .launch-help-center .launch-description { - margin: 24px 0; -} -.nfd-help-center .launch-help-center .launch-action { - display: flex; - justify-content: center; - align-items: center; -} -.nfd-help-center .launch-help-center button { - width: 146px; - height: 36px; - background-color: #196bde; - border: 1px solid #196bde; - color: #ffffff; - cursor: grab; -} -.nfd-help-center .launch-help-center p { - font-size: 18px; -} -.nfd-help-center .launch-help-center a { - margin-top: 16px; - display: block; - cursor: grab; -} -.nfd-help-center .suggestions-container .section-header { - margin-bottom: 8px !important; -} -.nfd-help-center .suggestions-container .video .description, -.nfd-help-center .suggestions-container .article .description { - line-height: 1.2em; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; - margin: 8px 0; -} -.nfd-help-center .suggestions-container .video:hover, -.nfd-help-center .suggestions-container .article:hover { - background: rgba(57, 172, 229, 0.1); -} -.nfd-help-center .suggestion[data-variant=video] iframe { - height: 146px; - width: 248px; -} -.nfd-help-center .helpcenter-input-wrapper { - border-top: 1px solid #E2E8F0; - height: 254px; - position: fixed; - bottom: 0; - width: 356px; - background: #fff; - z-index: 1; -} -.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper { - padding: 0 12px; -} -.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .search-container { - display: flex; - height: 42px; - border-radius: 8px; - padding-right: 5px; - background-color: #F0F3F5; - margin: 16px 0px 0px; -} -.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .search-container input { - border: none; - background-color: #F0F3F5; - font-size: 13px; - line-height: 19px; - padding-left: 10px; - width: 100%; - padding-right: 30px; - color: #7A889D; -} -.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .search-container input:focus { - outline: none; - box-shadow: none; -} -.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .search-container button { - box-shadow: none; - padding-top: 3px; - background-color: #F0F3F5; - border: none; - background: transparent; - cursor: pointer; - position: absolute; - right: 15px; - top: 25px; -} -.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .attribute { - display: flex; - justify-content: flex-end; - margin-top: 0px; - padding-left: 2px; - padding-right: 2px; - color: #394150; -} -.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .attribute .hc-input-counter { - margin: 5px 0; -} -.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .attribute span { - font-weight: 500; - font-size: 12px; - line-height: 14px; - text-align: right; - color: #394150; -} -.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .multisearch-loader { - display: flex; - justify-content: center; -} -.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper { - padding: 8px 12px 8px 12px; -} -.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__text { - padding: 8px 0; -} -.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__telephone { - margin-bottom: 12px; -} -.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__telephone span { - margin-right: 8px; - vertical-align: text-top; -} -.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__telephone span a { - text-decoration: none; - color: #196CDF; -} -.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__chat { - margin-bottom: 12px; -} -.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__chat span { - margin-right: 8px; - vertical-align: text-top; -} -.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__chat span a { - text-decoration: none; - color: #196CDF; -} -.nfd-help-center .suggestions-wrapper { - padding: 0 12px; - position: fixed; - width: 356px; - bottom: 254px; - background: white; -} -.nfd-help-center .suggestions-wrapper .algoliaResult { - border-radius: 24px; - display: flex; - margin-bottom: 8px; - padding: 10px 16px; - box-shadow: 0 0 0 1px #DDDFE0; - transition: box-shadow 0.2s ease; - box-sizing: border-box; - cursor: pointer; - position: relative; - justify-content: space-between; - color: #394150; -} -.nfd-help-center .suggestions-wrapper .algoliaResult p { - margin: 0; -} -.nfd-help-center .suggestions-wrapper .algoliaResult .svg { - display: flex; - align-items: center; - justify-content: center; - transform: translateX(0); - transition: transform 0.2s ease; -} -.nfd-help-center .suggestions-wrapper .algoliaResult:hover { - box-shadow: 0 0 0 2px #3575d3; -} -.nfd-help-center .suggestions-wrapper .algoliaResult:hover .svg { - transform: translateX(2px); -} -.nfd-help-center .feedback-container { - display: flex; - justify-content: space-between; - padding: 15px 12px; -} -.nfd-help-center .feedback-container button { - border-radius: 20px; - border-color: #B2BCC2; - border-width: 1px; - padding-top: 5%; - padding-bottom: 5%; - cursor: pointer; - box-shadow: none; -} -.nfd-help-center .feedback-container .feedback-button { - padding-left: 13px; - padding-right: 13px; - padding-bottom: 6px; - padding-top: 6px; - flex-shrink: 0; - white-space: nowrap; -} -.nfd-help-center .feedback-container .feedback-button .feedback-button-emoji { - margin-right: 5px; -} -.nfd-help-center .feedback-container .button-icon { - height: 20px; - width: 20px; - margin-right: 4px; -} -.nfd-help-center .feedback-container .yes { - border-bottom-right-radius: 0px; - border-top-right-radius: 0px; - border-right-width: 0px; -} -.nfd-help-center .feedback-container .no { - border-bottom-left-radius: 0px; - border-top-left-radius: 0px; -} -.nfd-help-center .feedback-container .selected-yes { - background: #E6FFF4; - padding-bottom: 4.4px; - padding-top: 5.8px; -} -.nfd-help-center .feedback-container .selected-no { - background-color: #FFDCDC; - padding-bottom: 4.4px; - padding-top: 5.8px; -} -.nfd-help-center .feedback-container .icon { - cursor: pointer; - display: flex; - align-items: center; -} -.nfd-help-center .hc-results-container .helpcenter-results { - padding: 0 12px; -} -.nfd-help-center .hc-results-container .helpcenter-question-block { - display: flex; - align-items: center; - font-size: 13px; - line-height: 19px; - padding: 8px 12px; - background: #F4F8FC; - gap: 8px; -} -.nfd-help-center .hc-results-container .helpcenter-question-block .helpcenter-question__user-avatar { - height: 24px; -} -.nfd-help-center .hc-results-container .helpcenter-result-block { - display: flex; - align-items: stretch; - gap: 8px; - padding: 12px; - /* Reset default styles */ - /* Standardize list items */ -} -.nfd-help-center .hc-results-container .helpcenter-result-block ul, .nfd-help-center .hc-results-container .helpcenter-result-block ol { - margin: 0; - padding: 0; - list-style-position: inside; -} -.nfd-help-center .hc-results-container .helpcenter-result-block li { - margin: 0; - padding: 0; -} -.nfd-help-center .hc-results-container .helpcenter-result-block__aistars { - padding-top: 12px; -} -.help-container { - width: 356px; - height: 100vh; - overflow: hidden; - position: fixed; - right: 0; - background: #ffffff; - display: block !important; - border: 1px solid #DCDCDC; - box-shadow: -5px 0px 36px rgba(0, 0, 0, 0.25); - z-index: 100; -} -.wpcontent-container { - display: flex; -} -@media screen and (min-width: 1814px) { - .toplevel_page_bluehost .wpcontent-container { - display: flex; - } - .toplevel_page_bluehost .wpcontent-container #wpbody { - flex: 1; - } - .toplevel_page_bluehost .wpcontent-container #wpbody #bwa-app { - margin-left: 20px !important; - } - .toplevel_page_bluehost .wpcontent-container #wpbody #bwa-app #bluehost-logo-wrap { - padding: 14px 0 0 12px; - } -} -body:is(.page, .post-php, .post-new-php) #wp-admin-bar-help-center { - display: none; -} -.mobile #wpadminbar ul#wp-admin-bar-root-default li { - width: 40px !important; -} -.mobile #wpadminbar li#wp-admin-bar-help-center { - display: block; -} -.icon-button { - cursor: pointer; -} -.loading-cursor { - display: inline-block; - width: 10px; - height: 2px; - background-color: black; - margin-left: 5px; - animation: blip 1s infinite; - margin-top: 30px; -} -@keyframes blip { - 0% { - opacity: 1; - } - 50% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -.hc-input-error-message { - color: rgb(255, 126, 126); - font-size: 12px; - margin: 5px 0 0 0; -} - -/*# sourceMappingURL=index.css.map*/ \ No newline at end of file +#nfd-help-center{box-sizing:border-box}#nfd-help-center .nfd-hc-modal{padding-bottom:32px}#nfd-help-center .nfd-hc-modal h3,#nfd-help-center .nfd-hc-modal h4{margin:0}#nfd-help-center .nfd-hc-modal__header{align-items:center;background-color:#fff;border-bottom:1px solid #dddfe0;display:flex;height:48px;justify-content:space-between;left:0;position:sticky;top:0;width:350px}#nfd-help-center .nfd-hc-modal__header__heading{color:#394150;font-size:20px;font-weight:400;line-height:24px;padding-top:4px}#nfd-help-center .nfd-hc-modal__header__heading__icon{margin-left:12px;margin-right:12px;vertical-align:middle}#nfd-help-center .nfd-hc-modal__header__close-button{background:none;border:0;margin-right:1px}#nfd-help-center .helpcenter-intro{align-items:stretch;display:flex;justify-content:flex-start;padding:12px}#nfd-help-center .helpcenter-intro__text{padding:0 8px}#nfd-help-center *{box-sizing:border-box}.nfd-plugin-sidebar .nfd-help-center .feedback-container .feedback-button{padding-left:6px;padding-right:6px}.nfd-plugin-sidebar .nfd-help-center .feedback-container .feedback-question{padding-top:8px}.nfd-help-center{height:calc(100vh - 332px);overflow-y:auto;position:relative;z-index:10}.nfd-help-center p{font-size:14px}.nfd-help-center p br{content:"";display:block;margin-bottom:5px}.nfd-help-center h3,.nfd-help-center h4{margin:0}.nfd-help-center .launch-help-center{text-align:center}.nfd-help-center .launch-help-center .launch-description{margin:24px 0}.nfd-help-center .launch-help-center .launch-action{align-items:center;display:flex;justify-content:center}.nfd-help-center .launch-help-center button{background-color:#196bde;border:1px solid #196bde;color:#fff;cursor:grab;height:36px;width:146px}.nfd-help-center .launch-help-center p{font-size:18px}.nfd-help-center .launch-help-center a{cursor:grab;display:block;margin-top:16px}.nfd-help-center .suggestions-container .section-header{margin-bottom:8px!important}.nfd-help-center .suggestions-container .article .description,.nfd-help-center .suggestions-container .video .description{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;line-height:1.2em;margin:8px 0;overflow:hidden;text-overflow:ellipsis}.nfd-help-center .suggestions-container .article:hover,.nfd-help-center .suggestions-container .video:hover{background:rgba(57,172,229,.1)}.nfd-help-center .suggestion[data-variant=video] iframe{height:146px;width:248px}.nfd-help-center .helpcenter-input-wrapper{background:#fff;border-top:1px solid #e2e8f0;bottom:0;height:254px;position:fixed;width:356px;z-index:1}.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper{padding:0 12px}.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .search-container{background-color:#f0f3f5;border-radius:8px;display:flex;height:42px;margin:16px 0 0;padding-right:5px}.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .search-container input{background-color:#f0f3f5;border:none;color:#7a889d;font-size:13px;line-height:19px;padding-left:10px;padding-right:30px;width:100%}.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .search-container input:focus{box-shadow:none;outline:none}.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .search-container button{background-color:#f0f3f5;background:transparent;border:none;box-shadow:none;cursor:pointer;padding-top:3px;position:absolute;right:15px;top:25px}.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .attribute{color:#394150;display:flex;justify-content:flex-end;margin-top:0;padding-left:2px;padding-right:2px}.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .attribute .hc-input-counter{margin:5px 0}.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .attribute span{color:#394150;font-size:12px;font-weight:500;line-height:14px;text-align:right}.nfd-help-center .helpcenter-input-wrapper .search-container__wrapper .multisearch-loader{display:flex;justify-content:center}.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper{padding:8px 12px}.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__text{padding:8px 0}.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__telephone{margin-bottom:12px}.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__telephone span{margin-right:8px;vertical-align:text-top}.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__telephone span a{color:#196cdf;text-decoration:none}.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__chat{margin-bottom:12px}.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__chat span{margin-right:8px;vertical-align:text-top}.nfd-help-center .helpcenter-input-wrapper .helpcenter-supportinfo__wrapper .helpcenter-supportinfo__chat span a{color:#196cdf;text-decoration:none}.nfd-help-center .suggestions-wrapper{background:#fff;bottom:254px;padding:0 12px;position:fixed;width:356px}.nfd-help-center .suggestions-wrapper .algoliaResult{border-radius:24px;box-shadow:0 0 0 1px #dddfe0;box-sizing:border-box;color:#394150;cursor:pointer;display:flex;justify-content:space-between;margin-bottom:8px;padding:10px 16px;position:relative;transition:box-shadow .2s ease}.nfd-help-center .suggestions-wrapper .algoliaResult p{margin:0}.nfd-help-center .suggestions-wrapper .algoliaResult .svg{align-items:center;display:flex;justify-content:center;transform:translateX(0);transition:transform .2s ease}.nfd-help-center .suggestions-wrapper .algoliaResult:hover{box-shadow:0 0 0 2px #3575d3}.nfd-help-center .suggestions-wrapper .algoliaResult:hover .svg{transform:translateX(2px)}.nfd-help-center .feedback-container{display:flex;justify-content:space-between;padding:15px 12px}.nfd-help-center .feedback-container button{border-color:#b2bcc2;border-radius:20px;border-width:1px;box-shadow:none;cursor:pointer;padding-bottom:5%;padding-top:5%}.nfd-help-center .feedback-container .feedback-button{flex-shrink:0;padding:6px 13px;white-space:nowrap}.nfd-help-center .feedback-container .feedback-button .feedback-button-emoji{margin-right:5px}.nfd-help-center .feedback-container .button-icon{height:20px;margin-right:4px;width:20px}.nfd-help-center .feedback-container .yes{border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.nfd-help-center .feedback-container .no{border-bottom-left-radius:0;border-top-left-radius:0}.nfd-help-center .feedback-container .selected-yes{background:#e6fff4;padding-bottom:4.4px;padding-top:5.8px}.nfd-help-center .feedback-container .selected-no{background-color:#ffdcdc;padding-bottom:4.4px;padding-top:5.8px}.nfd-help-center .feedback-container .icon{align-items:center;cursor:pointer;display:flex}.nfd-help-center .hc-results-container .helpcenter-results{padding:0 12px}.nfd-help-center .hc-results-container .helpcenter-question-block{align-items:center;background:#f4f8fc;display:flex;font-size:13px;gap:8px;line-height:19px;padding:8px 12px}.nfd-help-center .hc-results-container .helpcenter-question-block .helpcenter-question__user-avatar{height:24px}.nfd-help-center .hc-results-container .helpcenter-result-block{align-items:stretch;display:flex;gap:8px;padding:12px}.nfd-help-center .hc-results-container .helpcenter-result-block ol,.nfd-help-center .hc-results-container .helpcenter-result-block ul{list-style-position:inside;margin:0;padding:0}.nfd-help-center .hc-results-container .helpcenter-result-block li{margin:0;padding:0}.nfd-help-center .hc-results-container .helpcenter-result-block__aistars{padding-top:12px}.help-container{background:#fff;border:1px solid #dcdcdc;box-shadow:-5px 0 36px rgba(0,0,0,.25);display:block!important;height:100vh;overflow:hidden;position:fixed;right:0;width:356px;z-index:100}.wpcontent-container{display:flex}@media screen and (min-width:1814px){.toplevel_page_bluehost .wpcontent-container{display:flex}.toplevel_page_bluehost .wpcontent-container #wpbody{flex:1}.toplevel_page_bluehost .wpcontent-container #wpbody #bwa-app{margin-left:20px!important}.toplevel_page_bluehost .wpcontent-container #wpbody #bwa-app #bluehost-logo-wrap{padding:14px 0 0 12px}}body:is(.page,.post-php,.post-new-php) #wp-admin-bar-help-center{display:none}.mobile #wpadminbar ul#wp-admin-bar-root-default li{width:40px!important}.mobile #wpadminbar li#wp-admin-bar-help-center{display:block}.icon-button{cursor:pointer}.loading-cursor{animation:blip 1s infinite;background-color:#000;display:inline-block;height:2px;margin-left:5px;margin-top:30px;width:10px}@keyframes blip{0%{opacity:1}50%{opacity:0}to{opacity:1}}.hc-input-error-message{color:#ff7e7e;font-size:12px;margin:5px 0 0} diff --git a/build/index.js b/build/index.js index 4e3d582..8ae81b0 100644 --- a/build/index.js +++ b/build/index.js @@ -1,5794 +1 @@ -/******/ (function() { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/hiive/data/namespace.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/@newfold-labs/js-utility-ui-analytics/src/hiive/data/namespace.js ***! - \****************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ namespace: function() { return /* binding */ namespace; } -/* harmony export */ }); -const namespace = { - urls: { - single: undefined, - batch: undefined, - }, - queue: { - events: [], - threshold: 100, - }, - debounce: { - time: undefined, - instance: undefined, - }, -}; - - -/***/ }), - -/***/ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/hiive/events/HiiveEvent.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/@newfold-labs/js-utility-ui-analytics/src/hiive/events/HiiveEvent.js ***! - \*******************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ HiiveEvent: function() { return /* binding */ HiiveEvent; } -/* harmony export */ }); -/** - * Defines the structure of a Hiive analytics event. - * - * @class HiiveEvent - */ -class HiiveEvent { - /** - * Constructor for the HiiveEvent class. - * - * @param {string} category The category of the event (This actual value will depend on the URL you are reporting to). - * @param {string} action The action that triggered the event (The actual value will depend on the URL you are reporting to). - * @param {Object} data Data related to the event. - * @param {string} namespace The namespace that the event belongs to. - */ - constructor( category, action, data, namespace ) { - this.category = category; - this.action = action; - this.data = data; - this.namespace = namespace; - } -} - - -/***/ }), - -/***/ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/hiive/events/index.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/@newfold-labs/js-utility-ui-analytics/src/hiive/events/index.js ***! - \**************************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ HiiveEvent: function() { return /* reexport safe */ _HiiveEvent__WEBPACK_IMPORTED_MODULE_0__.HiiveEvent; } -/* harmony export */ }); -/* harmony import */ var _HiiveEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./HiiveEvent */ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/hiive/events/HiiveEvent.js"); -// Exports related to Hiive events. - - - -/***/ }), - -/***/ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/hiive/index.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/@newfold-labs/js-utility-ui-analytics/src/hiive/index.js ***! - \*******************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ HiiveAnalytics: function() { return /* binding */ HiiveAnalytics; }, -/* harmony export */ HiiveEvent: function() { return /* reexport safe */ _events__WEBPACK_IMPORTED_MODULE_1__.HiiveEvent; } -/* harmony export */ }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./events */ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/hiive/events/index.js"); -/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../store */ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/index.js"); -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3__); - - - - - -/** - * Determines whether Hiive analytics have been initialized or not for a particular namespace. - * - * @param {string} namespace The namespace the check. - * @return {boolean} whether Hiive analytics have been initialized or not for a particular namespace. - */ -const initialized = ( namespace ) => { - if ( window?.nfdUIAnalytics?.hiive ) { - return namespace in window.nfdUIAnalytics.hiive; - } - return false; -}; - -/** - * Validates that the parameter is an instance of HiiveEvent. - * - * @param {Object} event Any valid JS Object. - * @return {boolean} whether the param is a valid HiiveEvent instance or not. - */ -const validate = ( event ) => { - if ( ! ( event instanceof _events__WEBPACK_IMPORTED_MODULE_1__.HiiveEvent ) ) { - return false; - } - - return true; -}; - -/** - * Initializes the module to send out Hiive analytics events. - * - * @param {Object} param0 Data to initialize Hiive analytics. - * @param {Object} param0.settings Settings that define the behavior of HiiveAnalytics. - * @param {Object} param0.settings.debounce Settings related to the debounce. - * @param {number} param0.settings.debounce.time The interval that must pass once an event has been tracked after which a batch request gets placed automatically to the batch URL. - * @param {Object} param0.settings.queue Settings related to the Hiive events queue. - * @param {number} param0.settings.queue.threshold The limit that the number of events in the queue must cross after which a batch request gets placed automatically to the batch URL. - * @param {Object} param0.urls Contains URL's to report analytics. - * @param {string} param0.urls.single The URL that can handle a single event. - * @param {string} param0.urls.batch The URL that can handle an array of events. - * @param {string} param0.namespace The namespace to initialize. - * @return {boolean} Whether the module was initialized or not. - */ -const initialize = async ( { - namespace, - urls: { single, batch } = {}, - settings: { debounce: { time } = {}, queue: { threshold = 100 } = {} } = {}, -} ) => { - if ( ! namespace ) { - return false; - } - - // If the module is already initialized then skip initialization. - if ( initialized( namespace ) ) { - return true; - } - - // If no reporting URL's are defined then fail initialization. - if ( ! ( single || batch ) ) { - return false; - } - - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).initializeNamespace( namespace ); - - // Update Redux store with all the required data. - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).updateHiiveUrls( - { - single, - batch, - }, - namespace - ); - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).updateHiiveDebounceTime( time, namespace ); - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).updateHiiveEventsQueueThreshold( threshold, namespace ); - - // This helps us quickly determine whether Hiive analytics have been enabled. - if ( window.nfdUIAnalytics?.hiive ) { - window.nfdUIAnalytics.hiive[ namespace ] = true; - } else { - window.nfdUIAnalytics = { - hiive: { - [ namespace ]: true, - }, - }; - } - - return true; -}; - -/** - * Tracks the event by putting it in a queue. - * - * @param {HiiveEvent} event The event object to track. - * @return {boolean} whether the event has been successfully queued for tracking or not. - */ -const track = ( event ) => { - // Do not perform any activity if the module has not been initialized or the event is not valid. - if ( ! ( validate( event ) && initialized( event.namespace ) ) ) { - return false; - } - const namespace = event.namespace; - delete event.namespace; - // Add the event to a queue of tracked events. - const events = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).getHiiveEventsQueue( namespace ); - events.push( event ); - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).updateHiiveEventsQueue( events, namespace ); - - // If the number of events in the queue have crossed the threshold then dispatch all of them. - const threshold = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).getHiiveEventsQueueThreshold( namespace ); - if ( threshold && threshold < events.length ) { - dispatchEvents( namespace ); - } - - // Reset the debounce setTimeout instance. - resetDebounceInstance( namespace ); - - return true; -}; - -/** - * Reports the event to urls.single defined during initialization. - * - * @param {HiiveEvent} event The event object to send. - * @return {Promise} whether the event has been successfully sent or not. - */ -const send = async ( event ) => { - // Do not perform any activity if the module has not been initialized or the event is not valid. - if ( ! ( validate( event ) && initialized( event.namespace ) ) ) { - return false; - } - - const namespace = event.namespace; - delete event.namespace; - - const url = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).getHiiveSingleUrl( namespace ); - if ( ! url ) { - return false; - } - - try { - await _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default()( { - url, - method: 'POST', - data: event, - } ); - } catch ( error ) { - console.error( error ); - return false; - } -}; - -/** - * Reports all the queued events to urls.batch defined during initialization. - * - * @param {string} namespace The namespace whose events must be dispatched. - * @return {Promise} whether or not all the events were sent to the batchUrl successfully. - */ -const dispatchEvents = async ( namespace ) => { - if ( ! namespace || ! initialized( namespace ) ) { - return false; - } - - const url = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).getHiiveBatchUrl( namespace ); - if ( ! url ) { - return false; - } - - // If there are no events to report then return. - const events = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).getHiiveEventsQueue( namespace ); - if ( 0 === events.length ) { - return true; - } - - // Rare case: Do this so that any other dispatchEvents calls do not dispatch redundant data. - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).updateHiiveEventsQueue( [], namespace ); - - try { - await _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_3___default()( { - url, - method: 'POST', - data: events, - } ); - } catch ( error ) { - // [TODO] Figure out a better error handling method and clear the queue. - console.error( error ); - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).updateHiiveEventsQueue( events, namespace ); - } - - return true; -}; - -/** - * Resets the debounce instance countdown. - * - * @param {string} namespace The namespace in which the debounce instance should be reset. - * @return {boolean} whether the reset occurred successfully or not. - */ -const resetDebounceInstance = ( namespace ) => { - if ( ! namespace ) { - return false; - } - - const debounce = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).getHiiveDebounce( namespace ); - - if ( ! debounce.time ) { - return false; - } - - clearInterval( debounce.instance ); - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).updateHiiveDebounceInstance( - setTimeout( () => { - dispatchEvents( namespace ); - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).updateHiiveDebounceInstance( - undefined, - namespace - ); - }, debounce.time ), - namespace - ); - return true; -}; - -/** - * Disables the debounce. - * - * @param {string} namespace The namespace in which the debounce instance should be disabled. - * @return {boolean} whether the debounce has been successfully disabled or not. - */ -const disableDebounce = ( namespace ) => { - if ( ! namespace ) { - return false; - } - - const debounce = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).getHiiveDebounce( namespace ); - if ( debounce.instance ) { - clearInterval( debounce.instance ); - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).updateHiiveDebounceInstance( undefined, namespace ); - (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)( _store__WEBPACK_IMPORTED_MODULE_2__.store ).updateHiiveDebounceTime( undefined, namespace ); - } - return true; -}; - -const HiiveAnalytics = { - initialize, - initialized, - validate, - track, - send, - dispatchEvents, - disableDebounce, -}; - - - -/***/ }), - -/***/ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@newfold-labs/js-utility-ui-analytics/src/index.js ***! - \*************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ HiiveAnalytics: function() { return /* reexport safe */ _hiive__WEBPACK_IMPORTED_MODULE_0__.HiiveAnalytics; }, -/* harmony export */ HiiveEvent: function() { return /* reexport safe */ _hiive__WEBPACK_IMPORTED_MODULE_0__.HiiveEvent; } -/* harmony export */ }); -/* harmony import */ var _hiive__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hiive */ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/hiive/index.js"); -// Exports for the Hiive Platform. - - - -/***/ }), - -/***/ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/actions.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/actions.js ***! - \*********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ initializeNamespace: function() { return /* binding */ initializeNamespace; }, -/* harmony export */ updateHiiveDebounceInstance: function() { return /* binding */ updateHiiveDebounceInstance; }, -/* harmony export */ updateHiiveDebounceTime: function() { return /* binding */ updateHiiveDebounceTime; }, -/* harmony export */ updateHiiveEventsQueue: function() { return /* binding */ updateHiiveEventsQueue; }, -/* harmony export */ updateHiiveEventsQueueThreshold: function() { return /* binding */ updateHiiveEventsQueueThreshold; }, -/* harmony export */ updateHiiveUrls: function() { return /* binding */ updateHiiveUrls; } -/* harmony export */ }); -/** - * Initialize a Hiive Event namespace. - * - * @param {string} namespace The namespace to be initialized. - * @return {Object} Type of action to perform with data. - */ -function initializeNamespace( namespace ) { - return { - type: 'INITIALIZE_NAMESPACE', - namespace, - }; -} - -/** - * Update the Hiive URLs. - * - * @param {Object} urls The Hiive URLs. - * @param {string} namespace The namespace in which the URL's must be updated. - * @return {Object} Type of action to perform with data. - */ -function updateHiiveUrls( urls, namespace ) { - return { - type: 'UPDATE_HIIVE_URLS', - urls, - namespace, - }; -} - -/** - * Update the Hiive events queue. - * - * @param {Array} events An array of events to be queued. - * @param {string} namespace The namespace in which the queue must be updated. - * @return {Object} Type of action to perform with data. - */ -function updateHiiveEventsQueue( events, namespace ) { - return { - type: 'UPDATE_HIIVE_EVENTS_QUEUE', - events, - namespace, - }; -} - -/** - * - * @param {number} threshold The threshold for the queue. - * @param {string} namespace The namespace in which the threshold must be updated. - * @return {Object} Type of action to perform with data. - */ -function updateHiiveEventsQueueThreshold( threshold, namespace ) { - return { - type: 'UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD', - threshold, - namespace, - }; -} - -/** - * Update the Hiive events dispatch debounce time. - * - * @param {number} debounceTime The time to wait. - * @param {string} namespace The namespace in which the debounce time must be updated. - * @return {Object} Type of action to perform with data. - */ -function updateHiiveDebounceTime( debounceTime, namespace ) { - return { - type: 'UPDATE_HIIVE_DEBOUNCE_TIME', - debounceTime, - namespace, - }; -} - -/** - * Updates the Hiive debounce instance. - * - * @param {Object} instance A setTimeout instance of the debounce. - * @param {string} namespace The namespace in which the debounce instance must be updated. - * @return {Object} Type of action to perform with data. - */ -function updateHiiveDebounceInstance( instance, namespace ) { - return { - type: 'UPDATE_HIIVE_DEBOUNCE_INSTANCE', - instance, - namespace, - }; -} - - -/***/ }), - -/***/ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/constants.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/constants.js ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ STORE_NAME: function() { return /* binding */ STORE_NAME; } -/* harmony export */ }); -/** - * The name for the Redux store of this package. - */ -const STORE_NAME = 'newfold/ui-analytics'; - - -/***/ }), - -/***/ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/index.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/index.js ***! - \*******************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ nfdUIAnalyticsStoreConfig: function() { return /* binding */ nfdUIAnalyticsStoreConfig; }, -/* harmony export */ store: function() { return /* binding */ store; } -/* harmony export */ }); -/* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reducer */ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/reducer.js"); -/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./actions */ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/actions.js"); -/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectors */ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/selectors.js"); -/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/constants.js"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); - - - - - - - -/** - * The Redux store configuration. - */ -const nfdUIAnalyticsStoreConfig = { - reducer: _reducer__WEBPACK_IMPORTED_MODULE_0__["default"], - actions: _actions__WEBPACK_IMPORTED_MODULE_1__, - selectors: _selectors__WEBPACK_IMPORTED_MODULE_2__, -}; - -const store = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.createReduxStore)( _constants__WEBPACK_IMPORTED_MODULE_3__.STORE_NAME, nfdUIAnalyticsStoreConfig ); -(0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.register)( store ); - - -/***/ }), - -/***/ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/reducer.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/reducer.js ***! - \*********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ hiive: function() { return /* binding */ hiive; } -/* harmony export */ }); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _hiive_data_namespace__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../hiive/data/namespace */ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/hiive/data/namespace.js"); - - - - -/** - * A reducer for Hiive related actions. - * - * @param {Object} state The current state of the store. - * @param {Object} action The action to be performed to change the state. - * @return {Object} state The new state of the store after the action is performed. - */ -const hiive = ( state, action ) => { - switch ( action.type ) { - case 'INITIALIZE_NAMESPACE': { - return { - ...state, - [ action.namespace ]: _hiive_data_namespace__WEBPACK_IMPORTED_MODULE_1__.namespace, - }; - } - case 'UPDATE_HIIVE_URLS': - return { - ...state, - [ action.namespace ]: { - ...state[ action.namespace ], - urls: { - single: action.urls.single, - batch: action.urls.batch, - }, - }, - }; - case 'UPDATE_HIIVE_EVENTS_QUEUE': - return { - ...state, - [ action.namespace ]: { - ...state[ action.namespace ], - queue: { - events: action.events, - threshold: state[ action.namespace ].queue.threshold, - }, - }, - }; - case 'UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD': { - return { - ...state, - [ action.namespace ]: { - ...state[ action.namespace ], - queue: { - events: state[ action.namespace ].queue.events, - threshold: action.threshold, - }, - }, - }; - } - case 'UPDATE_HIIVE_DEBOUNCE_TIME': - return { - ...state, - [ action.namespace ]: { - ...state[ action.namespace ], - debounce: { - time: action.debounceTime, - instance: state[ action.namespace ].debounce.instance, - }, - }, - }; - case 'UPDATE_HIIVE_DEBOUNCE_INSTANCE': - return { - ...state, - [ action.namespace ]: { - ...state[ action.namespace ], - debounce: { - time: state[ action.namespace ].debounce.time, - instance: action.instance, - }, - }, - }; - } - return state; -}; - -/** - * Combines all the reducers in this file. - */ -/* harmony default export */ __webpack_exports__["default"] = ((0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.combineReducers)( { - hiive, -} )); - - -/***/ }), - -/***/ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/selectors.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/@newfold-labs/js-utility-ui-analytics/src/store/selectors.js ***! - \***********************************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ getHiiveBatchUrl: function() { return /* binding */ getHiiveBatchUrl; }, -/* harmony export */ getHiiveDebounce: function() { return /* binding */ getHiiveDebounce; }, -/* harmony export */ getHiiveEventsQueue: function() { return /* binding */ getHiiveEventsQueue; }, -/* harmony export */ getHiiveEventsQueueThreshold: function() { return /* binding */ getHiiveEventsQueueThreshold; }, -/* harmony export */ getHiiveSingleUrl: function() { return /* binding */ getHiiveSingleUrl; } -/* harmony export */ }); -/** - * Retrieves all the queued Hiive events. - * - * @param {Object} state The current state of the redux store. - * @param {string} namespace The namespace from which the events must be retrieved. - * @return {Array} events An array of events that are queued. - */ -function getHiiveEventsQueue( state, namespace ) { - return state.hiive[ namespace ]?.queue.events; -} - -/** - * - * @param {*} state The current state of the redux store. - * @param {string} namespace The namespace from which the threshold must be read. - * @return {Array} threshold Threshold of the queue. - */ -function getHiiveEventsQueueThreshold( state, namespace ) { - return state.hiive[ namespace ]?.queue.threshold; -} - -/** - * Retrieves the default Hiive URL. - * - * @param {Object} state The current state of the redux store. - * @param {string} namespace The namespace from which the single URL must be read. - * @return {string} The default URL in the store. - */ -function getHiiveSingleUrl( state, namespace ) { - return state.hiive[ namespace ]?.urls.single; -} - -/** - * Retrieves the batch Hiive URL. - * - * @param {*} state The current state of the redux store. - * @param {string} namespace The namespace from which the batch URL must be read. - * @return {string} The batch URL in the store. - */ -function getHiiveBatchUrl( state, namespace ) { - return state.hiive[ namespace ]?.urls.batch; -} - -/** - * Retrieves debounce data. - * - * @param {Object} state The current state of the redux store. - * @param {string} namespace The namespace from which the Hiive debounce must be read. - * @return {Object} The debounce data. - */ -function getHiiveDebounce( state, namespace ) { - return state.hiive[ namespace ]?.debounce; -} - - -/***/ }), - -/***/ "./node_modules/@newfold-labs/wp-module-ai/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@newfold-labs/wp-module-ai/index.js ***! - \**********************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": function() { return /* reexport safe */ _lib_moduleAI__WEBPACK_IMPORTED_MODULE_0__["default"]; } -/* harmony export */ }); -/* harmony import */ var _lib_moduleAI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/moduleAI */ "./node_modules/@newfold-labs/wp-module-ai/lib/moduleAI.js"); - - - - - -/***/ }), - -/***/ "./node_modules/@newfold-labs/wp-module-ai/lib/core/AISearch.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@newfold-labs/wp-module-ai/lib/core/AISearch.js ***! - \**********************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__); - - -const base = "newfold-ai/v1"; - -const AISearch = { - getSearchResult: (userPrompt, identifier, extra) => - _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({ - path: base + "/search", - method: "POST", - data: { - user_prompt: userPrompt, - identifier: identifier, - extra: extra, - }, - }), - getDefaultSearchResult: () => _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({ - path: base + "/search/default", - method: "POST", - }) -}; - -/* harmony default export */ __webpack_exports__["default"] = (AISearch); - - -/***/ }), - -/***/ "./node_modules/@newfold-labs/wp-module-ai/lib/moduleAI.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@newfold-labs/wp-module-ai/lib/moduleAI.js ***! - \*****************************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _core_AISearch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/AISearch */ "./node_modules/@newfold-labs/wp-module-ai/lib/core/AISearch.js"); - - -const moduleAI = { - search: _core_AISearch__WEBPACK_IMPORTED_MODULE_0__["default"], -} - -/* harmony default export */ __webpack_exports__["default"] = (moduleAI); - - -/***/ }), - -/***/ "./src/icons/ai-stars.svg": -/*!********************************!*\ - !*** ./src/icons/ai-stars.svg ***! - \********************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ReactComponent: function() { return /* binding */ SvgAiStars; } -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -var _path; -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -var SvgAiStars = function SvgAiStars(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ - width: 22, - height: 22, - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { - d: "M8.563 14.904 7.75 17.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L1 11l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L7.75 4.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L14.5 11l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM17.009 7.715 16.75 8.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L13 5l1.036-.259a3.375 3.375 0 0 0 2.455-2.456l.259-1.035.259 1.035a3.375 3.375 0 0 0 2.456 2.456L20.5 5l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM15.644 19.567l-.394 1.183-.394-1.183a2.25 2.25 0 0 0-1.423-1.423l-1.183-.394 1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z", - stroke: "#330A55", - strokeWidth: 1.5, - strokeLinecap: "round", - strokeLinejoin: "round" - }))); -}; - -/* harmony default export */ __webpack_exports__["default"] = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHZpZXdCb3g9IjAgMCAyMiAyMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTguNTYzMiAxNC45MDM4TDcuNzUgMTcuNzVMNi45MzY4IDE0LjkwMzhDNi41MDk2OCAxMy40MDg5IDUuMzQxMTIgMTIuMjQwMyAzLjg0NjE5IDExLjgxMzJMMSAxMUwzLjg0NjE5IDEwLjE4NjhDNS4zNDExMyA5Ljc1OTY4IDYuNTA5NjggOC41OTExMiA2LjkzNjggNy4wOTYxOUw3Ljc1IDQuMjVMOC41NjMyIDcuMDk2MTlDOC45OTAzMiA4LjU5MTEzIDEwLjE1ODkgOS43NTk2OCAxMS42NTM4IDEwLjE4NjhMMTQuNSAxMUwxMS42NTM4IDExLjgxMzJDMTAuMTU4OSAxMi4yNDAzIDguOTkwMzIgMTMuNDA4OSA4LjU2MzIgMTQuOTAzOFoiIHN0cm9rZT0iIzMzMEE1NSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTcuMDA4OSA3LjcxNDU0TDE2Ljc1IDguNzVMMTYuNDkxMSA3LjcxNDU0QzE2LjE4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svg": -/*!***********************************!*\ - !*** ./src/icons/chat-bubble.svg ***! - \***********************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ReactComponent: function() { return /* binding */ SvgChatBubble; } -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -var _path; -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -var SvgChatBubble = function SvgChatBubble(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ - width: 20, - height: 20, - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { - d: "M7.188 8.125a.312.312 0 1 1-.625 0 .312.312 0 0 1 .625 0Zm0 0h-.313m3.438 0a.312.312 0 1 1-.625 0 .312.312 0 0 1 .624 0Zm0 0H10m3.438 0a.312.312 0 1 1-.625 0 .312.312 0 0 1 .624 0Zm0 0h-.313m-11.25 2.508c0 1.334.936 2.495 2.256 2.69.905.133 1.82.235 2.744.307v3.87l3.486-3.486a.95.95 0 0 1 .649-.276 40.256 40.256 0 0 0 4.859-.415c1.32-.194 2.256-1.356 2.256-2.69V5.617c0-1.334-.936-2.495-2.256-2.69A40.326 40.326 0 0 0 10 2.5c-1.994 0-3.953.146-5.869.428-1.32.194-2.256 1.355-2.256 2.69v5.015Z", - stroke: "#0F172A", - strokeWidth: 1.5, - strokeLinecap: "round", - strokeLinejo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yLjgxMTE4IDEzLjEyODQgNC4xMzEyMiAxMy4zMjI1QzUuMDM2MzEgMTMuNDU1NSA1Ljk1MTI2IDEzLjU1ODMgNi44NzUgMTMuNjI5N1YxNy41TDEwLjM2MTIgMTQuMDEzOEMxMC41MzM1IDEzLjg0MTUgMTAuNzY2MSAxMy43NDM1IDExLjAwOTcgMTMuNzM3NUMxMi42NTYgMTMuNjk2NyAxNC4yNzc2IDEzLjU1NjUgMTUuODY4NyAxMy4zMjI2QzE3LjE4ODggMTMuMTI4NSAxOC4xMjUgMTEuOTY3MSAxOC4xMjUgMTAuNjMyOVY1LjYxNzEzQzE4LjEyNSA0LjI4Mjg4IDE3LjE4ODggMy4xMjE1MiAxNS44Njg3IDIuOTI3NDVDMTMuOTUzNCAyLjY0NTg0IDExLjk5MzggMi41IDEwLjAwMDIgMi41QzguMDA2NDcgMi41IDYuMDQ2NzYgMi42NDU4NyA0LjEzMTIyIDIuOTI3NTJDMi44MTExOCAzLjEyMTYxIDEuODc1IDQuMjgyOTcgMS44NzUgNS42MTcyVjEwLjYzMjhaIiBzdHJva2U9IiMwRjE3MkEiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+Cg=="); - -/***/ }), - -/***/ "./src/icons/close.svg": -/*!*****************************!*\ - !*** ./src/icons/close.svg ***! - \*****************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ReactComponent: function() { return /* binding */ SvgClose; } -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -var _g, _defs; -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -var SvgClose = function SvgClose(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ - width: 24, - height: 24, - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", { - clipPath: "url(#close_svg__a)" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", { - clipPath: "url(#close_svg__b)" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "m12 13.06 3.712 3.713 1.06-1.06L13.06 12l3.713-3.712-1.061-1.06-3.713 3.711-3.712-3.712-1.06 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061Z", - fill: "#1E1E1E" - })))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", { - id: "close_svg__a" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", { - width: 24, - height: 24, - rx: 2, - fill: "#fff" - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", { - id: "close_svg__b" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", { - width: 24, - height: 24, - rx: 2, - fill: "#fff" - }))))); -}; - -/* harmony default export */ __webpack_exports__["default"] = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzYwNF8zMDE3KSI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMV82MDRfMzAxNykiPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTExLjk5OTUgMTMuMDYwN0wxNS43MTE4IDE2Ljc3M0wxNi43NzI1IDE1LjcxMjNMMTMuMDYwMiAxMkwxNi43NzI1IDguMjg3NzJMMTUuNzExOSA3LjIyNzA2TDExLjk5OTUgMTAuOTM5NEw4LjI4NzIyIDcuMjI3MDVMNy4yMjY1NiA4LjI4NzcxTDEwLjkzODkgMTJMNy4yMjY1NyAxNS43MTIzTDguMjg3MjMgMTYuNzczTDExLjk5OTUgMTMuMDYwN1oiIGZpbGw9IiMxRTFFMUUiLz4KPC9nPgo8L2c+CjxkZWZzPgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzYwNF8zMDE3Ij4KPHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiByeD0iMiIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPGNsaXBQYXRoIGlkPSJjbGlwMV82MDRfMzAxNyI+CjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgcng9IjIiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="); - -/***/ }), - -/***/ "./src/icons/go.svg": -/*!**************************!*\ - !*** ./src/icons/go.svg ***! - \**************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ReactComponent: function() { return /* binding */ SvgGo; } -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -var SvgGo = function SvgGo(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ - height: 12, - width: 12, - xmlns: "http://www.w3.org/2000/svg", - viewBox: "-13.63 -13.63 254.36 254.36", - xmlSpace: "preserve", - fill: "#1D1D1F", - stroke: "#394150" - }, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { - style: { - fill: "#010002" - }, - d: "m152.835 39.285-5.902 5.898 64.18 64.19H0v8.35h211.124l-64.191 64.179 5.902 5.909 74.261-74.261z" - })); -}; - -/* harmony default export */ __webpack_exports__["default"] = ("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEycHgiIHdpZHRoPSIxMnB4IiB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiCiAgICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgICB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmlld0JveD0iLTEzLjYzIC0xMy42MyAyNTQuMzYgMjU0LjM2IgogICAgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgZmlsbD0iIzFEMUQxRiIgc3Ryb2tlPSIjMzk0MTUwIj48ZyBpZD0iU1ZHUmVwb19iZ0NhcnJpZXIiIHN0cm9rZS13aWR0aD0iMCI+PC9nPjxnIGlkPSJTVkdSZXBvX3RyYWNlckNhcnJpZXIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PC9nPjxnIGlkPSJTVkdSZXBvX2ljb25DYXJyaWVyIj4gPGc+IDxnPiA8cG9seWdvbiBzdHlsZT0iZmlsbDojMDEwMDAyOyIgcG9pbnRzPSIxNTIuODM1LDM5LjI4NSAxNDYuOTMzLDQ1LjE4MyAyMTEuMTEzLDEwOS4zNzMgMCwxMDkuMzczIDAsMTE3LjcyMyAyMTEuMTI0LDExNy43MjMgMTQ2LjkzMywxODEuOTAyIDE1Mi44MzUsMTg3LjgxMSAyMjcuMDk2LDExMy41NSAiPjwvcG9seWdvbj4gPC9nPiA8L2c+IDwvZz48L3N2Zz4="); - -/***/ }), - -/***/ "./src/icons/help-plugin-sidebar-icon.svg": -/*!************************************************!*\ - !*** ./src/icons/help-plugin-sidebar-icon.svg ***! - \************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ReactComponent: function() { return /* binding */ SvgHelpPluginSidebarIcon; } -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -var _path; -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -var SvgHelpPluginSidebarIcon = function SvgHelpPluginSidebarIcon(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ - style: { - verticalAlign: "middle", - cursor: "pointer" - }, - width: 22, - height: 22, - viewBox: "0 1 36 37", - xmlns: "http://www.w3.org/2000/svg" - }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M18 .902c-9.941 0-18 8.059-18 18s8.059 18 18 18h15.366A2.634 2.634 0 0 0 36 34.268V18.902c0-9.941-8.059-18-18-18Zm-.913 17.877c-.336.588-.504 1.286-.504 2.092v.832h3.326v-.404c0-.587.101-1.075.303-1.461.218-.387.613-.849 1.184-1.386.723-.689 1.269-1.344 1.638-1.966.37-.621.555-1.369.555-2.243 0-.89-.236-1.696-.706-2.419-.454-.739-1.092-1.319-1.915-1.739-.823-.42-1.764-.63-2.823-.63-1.41 0-2.587.395-3.528 1.185-.924.773-1.545 1.697-1.864 2.772l2.898 1.21a3.278 3.278 0 0 1 .907-1.462c.437-.403.991-.605 1.663-.605.638 0 1.15.185 1.537.555.387.352.58.79.58 1.31 0 .437-.118.823-.353 1.16-.218.335-.58.73-1.084 1.184-.856.756-1.461 1.428-1.814 2.015Zm-.428 8.644c.436.42.957.63 1.562.63.605 0 1.117-.21 1.537-.63.42-.437.63-.957.63-1.562 0-.605-.21-1.117-.63-1.538-.42-.42-.932-.63-1.537-.63-.605 0-1.126.21-1.562.63-.42.42-.63.933-.63 1.538 0 .604.21 1.125.63 1.562Z" - }))); -}; - -/* harmony default export */ __webpack_exports__["default"] = ("data:image/svg+xml;base64,PHN2ZyBzdHlsZT0idmVydGljYWwtYWxpZ246IG1pZGRsZTsgY3Vyc29yOiBwb2ludGVyIiB3aWR0aD0iMjIiIGhlaWdodD0iMjIiIHZpZXdCb3g9IjAgMSAzNiAzNyIKICAgIGZpbGw9IiMwMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIKICAgICAgICBkPSJNMTggMC45MDE4NTVDOC4wNTg4OCAwLjkwMTg1NSAwIDguOTYwNzMgMCAxOC45MDE5QzAgMjguODQzIDguMDU4ODggMzYuOTAxOSAxOCAzNi45MDE5SDMzLjM2NTlDMzQuODIwNyA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TkxIDIwLjMzNzggMTQuNDE5OUMyMC4zMzc4IDE0Ljg1NjcgMjAuMjIwMiAxNS4yNDMxIDE5Ljk4NSAxNS41NzkxQzE5Ljc2NjYgMTUuOTE1MSAxOS40MDU0IDE2LjMwOTkgMTguOTAxNCAxNi43NjM1QzE4LjA0NDYgMTcuNTE5NSAxNy40Mzk4IDE4LjE5MTUgMTcuMDg3IDE4Ljc3OTVaTTE2LjY1ODYgMjcuNDIzMUMxNy4wOTU0IDI3Ljg0MzEgMTcuNjE2MiAyOC4wNTMxIDE4LjIyMSAyOC4wNTMxQzE4LjgyNTggMjguMDUzMSAxOS4zMzgyIDI3Ljg0MzEgMTkuNzU4MiAyNy40MjMxQzIwLjE3ODIgMjYuOTg2MyAyMC4zODgyIDI2LjQ2NTUgMjAuMzg4MiAyNS44NjA3QzIwLjM4ODIgMjUuMjU1OSAyMC4xNzgyIDI0Ljc0MzUgMTkuNzU4MiAyNC4zMjM1QzE5LjMzODIgMjMuOTAzNSAxOC44MjU4IDIzLjY5MzUgMTguMjIxIDIzLjY5MzVDMTcuNjE2MiAyMy42OTM1IDE3LjA5NTQgMjMuOTAzNSAxNi42NTg2IDI0LjMyMzVDMTYuMjM4NiAyNC43NDM1IDE2LjAyODYgMjUuMjU1OSAxNi4wMjg2IDI1Ljg2MDdDMTYuMDI4NiAyNi40NjU1IDE2LjIzODYgMjYuOTg2MyAxNi42NTg2IDI3LjQyMzFaIgogICAgICAgIC8+Cjwvc3ZnPg=="); - -/***/ }), - -/***/ "./src/icons/helpcenter-icon.svg": -/*!***************************************!*\ - !*** ./src/icons/helpcenter-icon.svg ***! - \***************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ReactComponent: function() { return /* binding */ SvgHelpcenterIcon; } -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -var _path, _path2; -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -var SvgHelpcenterIcon = function SvgHelpcenterIcon(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ - width: 24, - height: 24, - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { - d: "M.5 12C.5 5.649 5.649.5 12 .5S23.5 5.649 23.5 12v10.244c0 .694-.562 1.256-1.256 1.256H12C5.649 23.5.5 18.351.5 12Z", - fill: "#394150", - stroke: "#394150" - })), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11h9.39c.89 0 1.61-.72 1.61-1.61V12c0-6.075-4.925-11-11-11Zm-.609 10.918c-.224.392-.336.857-.336 1.395v.554h2.218v-.269c0-.392.067-.716.202-.974.145-.258.408-.566.79-.924.48-.46.845-.896 1.091-1.31.246-.415.37-.913.37-1.496 0-.593-.157-1.13-.47-1.612a3.127 3.127 0 0 0-1.277-1.16c-.55-.28-1.176-.42-1.882-.42-.94 0-1.725.264-2.352.79-.616.515-1.03 1.131-1.243 1.848l1.932.806c.123-.392.325-.716.605-.974.29-.269.66-.403 1.108-.403.426 0 .768.123 1.025.37.258.235.386.526.386.873 0 .291-.078.549-.235.773-.145.224-.386.487-.722.79-.571.503-.975.951-1.21 1.343Zm-.285 5.763c.29.28.638.42 1.041.42.403 0 .745-.14 1.025-.42.28-.291.42-.639.42-1.042s-.14-.745-.42-1.025c-.28-.28-.622-.42-1.025-.42-.403 0-.75.14-1.041.42-.28.28-.42.622-.42 1.025 0 .403.14.75.42 1.042Z", - fill: "#fff" - }))); -}; - -/* harmony default export */ __webpack_exports__["default"] = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IkZyYW1lIDE1MTMxIj4KPHBhdGggaWQ9IlJlY3RhbmdsZSA5MTM4IiBkPSJNMC41IDEyQzAuNSA1LjY0ODczIDUuNjQ4NzMgMC41IDEyIDAuNUMxOC4zNTEzIDAuNSAyMy41IDUuNjQ4NzMgMjMuNSAxMlYyMi4yNDM5QzIzLjUgMjIuOTM3NiAyMi45Mzc2IDIzLjUgMjIuMjQzOSAyMy41SDEyQzUuNjQ4NzMgMjMuNSAwLjUgMTguMzUxMyAwLjUgMTJaIiBmaWxsPSIjMzk0MTUwIiBzdHJva2U9IiMzOTQxNTAiLz4KPHBhdGggaWQ9IlN1YnRyYWN0IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEyIDFDNS45MjQ4NyAxIDEgNS45MjQ4NyAxIDEyQzEgMTguMDc1MSA1LjkyNDg3IDIzIDEyIDIzSDIxLjM5MDJDMjIuMjc5MyAyMyAyMyAyMi4yNzkzIDIzIDIxLjM5MDJWMTJDMjMgNS45MjQ4NyAxOC4wNzUxIDEgMTIgMVpNMTEuMzkxMyAxMS45MTg0QzExLjE2NzMgMTIuMzEwNCAxMS4wNTUzIDEyLjc3NTIgMTEuMDU1MyAxMy4zMTI4VjEzLjg2NzJIMTMuMjcyOVYxMy41OTg0QzEzLjI3MjkgMTMuMjA2NCAxMy4zNDAxIDEyLjg4MTYgMTMuN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E4LjEwMDggMTIuMTQ3MyAxOC4xMDA4QzEyLjU1MDUgMTguMTAwOCAxMi44OTIxIDE3Ljk2MDggMTMuMTcyMSAxNy42ODA4QzEzLjQ1MjEgMTcuMzg5NiAxMy41OTIxIDE3LjA0MjQgMTMuNTkyMSAxNi42MzkyQzEzLjU5MjEgMTYuMjM2IDEzLjQ1MjEgMTUuODk0NCAxMy4xNzIxIDE1LjYxNDRDMTIuODkyMSAxNS4zMzQ0IDEyLjU1MDUgMTUuMTk0NCAxMi4xNDczIDE1LjE5NDRDMTEuNzQ0MSAxNS4xOTQ0IDExLjM5NjkgMTUuMzM0NCAxMS4xMDU3IDE1LjYxNDRDMTAuODI1NyAxNS44OTQ0IDEwLjY4NTcgMTYuMjM2IDEwLjY4NTcgMTYuNjM5MkMxMC42ODU3IDE3LjA0MjQgMTAuODI1NyAxNy4zODk2IDExLjEwNTcgMTcuNjgwOFoiIGZpbGw9IndoaXRlIi8+CjwvZz4KPC9zdmc+Cg=="); - -/***/ }), - -/***/ "./src/icons/paper-airplane.svg": -/*!**************************************!*\ - !*** ./src/icons/paper-airplane.svg ***! - \**************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ReactComponent: function() { return /* binding */ SvgPaperAirplane; } -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -var _path; -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -var SvgPaperAirplane = function SvgPaperAirplane(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ - width: 20, - height: 20, - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { - d: "M5 10 2.723 2.604A49.806 49.806 0 0 1 17.904 10a49.808 49.808 0 0 1-15.18 7.396L4.999 10Zm0 0h6.25", - stroke: "#7A889D", - strokeWidth: 1.5, - strokeLinecap: "round", - strokeLinejoin: "round" - }))); -}; - -/* harmony default export */ __webpack_exports__["default"] = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQuOTk5NCAxMEwyLjcyMzYzIDIuNjAzNzZDOC4yMzYyNCA0LjIwNTE0IDEzLjM1NiA2LjczIDE3LjkwNDIgOS45OTk3OEMxMy4zNTYgMTMuMjY5NiA4LjIzNjMgMTUuNzk0NSAyLjcyMzcxIDE3LjM5Nkw0Ljk5OTQgMTBaTTQuOTk5NCAxMEwxMS4yNDk2IDEwIiBzdHJva2U9IiM3QTg4OUQiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+Cg=="); - -/***/ }), - -/***/ "./src/icons/phone.svg": -/*!*****************************!*\ - !*** ./src/icons/phone.svg ***! - \*****************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ReactComponent: function() { return /* binding */ SvgPhone; } -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -var _path; -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -var SvgPhone = function SvgPhone(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ - width: 18, - height: 17, - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { - d: "M1.688 4.563c0 6.213 5.036 11.25 11.25 11.25h1.687c.932 0 1.688-.756 1.688-1.688v-1.029a.844.844 0 0 0-.64-.818l-3.317-.83a.844.844 0 0 0-.88.313l-.727.97a.796.796 0 0 1-.907.285 9.026 9.026 0 0 1-5.358-5.358.796.796 0 0 1 .285-.907l.97-.727a.844.844 0 0 0 .313-.88l-.83-3.317a.844.844 0 0 0-.818-.64H3.375c-.932 0-1.688.756-1.688 1.688v1.688Z", - stroke: "#0F172A", - strokeWidth: 1.5, - strokeLinecap: "round", - strokeLinejoin: "round" - }))); -}; - -/* harmony default export */ __webpack_exports__["default"] = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTciIHZpZXdCb3g9IjAgMCAxOCAxNyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEuNjg3NSA0LjU2MjVDMS42ODc1IDEwLjc3NTcgNi43MjQzIDE1LjgxMjUgMTIuOTM3NSAxNS44MTI1SDE0LjYyNUMxNS41NTcgMTUuODEyNSAxNi4zMTI1IDE1LjA1NyAxNi4zMTI1IDE0LjEyNVYxMy4wOTYzQzE2LjMxMjUgMTIuNzA5MSAxNi4wNDkgMTIuMzcxNiAxNS42NzM0IDEyLjI3NzdMMTIuMzU2IDExLjQ0ODRDMTIuMDI2NyAxMS4zNjYgMTEuNjggMTEuNDg5MSAxMS40NzY0IDExLjc2MDdMMTAuNzQ4NyAxMi43MzA5QzEwLjUzNzUgMTMuMDEyNSAxMC4xNzIzIDEzLjEzNyA5Ljg0MTc2IDEzLjAxNTlDNy4zNjE1NCAxMi4xMDc0IDUuMzkyNjIgMTAuMTM4NSA0LjQ4NDA3IDcuNjU4MjRDNC4zNjMgNy4zMjc3NCA0LjQ4NzUyIDYuOTYyNDkgNC43NjkxIDYuNzUxM0w1LjczOTMyIDYuMDIzNjRDNi4wMTA5IDUuODE5OTUgNi4xMzM5NiA1LjQ3MzM0IDYuMDUxNjIgNS4xNDRMNS4yMjIyOCAxLjgyNjYxQzUuMTI4MzggMS40NTEgNC43OTA4OSAxLjE4NzUgNC40MDM3MiAxLjE4NzVIMy4zNzVDMi40NDMwMiAxLjE4NzUgMS42ODc1IDEuOTQzMDIgMS42ODc1IDIuODc1VjQuNTYyNVoiIHN0cm9rZT0iIzBGMTcyQSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K"); - -/***/ }), - -/***/ "./src/icons/user-avatar.svg": -/*!***********************************!*\ - !*** ./src/icons/user-avatar.svg ***! - \***********************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ReactComponent: function() { return /* binding */ SvgUserAvatar; } -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -var _rect, _defs; -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -var SvgUserAvatar = function SvgUserAvatar(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({ - width: 24, - height: 24, - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - xmlnsXlink: "http://www.w3.org/1999/xlink" - }, props), _rect || (_rect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", { - width: 24, - height: 24, - rx: 2, - fill: "url(#user-avatar_svg__a)" - })), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("pattern", { - id: "user-avatar_svg__a", - patternContentUnits: "objectBoundingBox", - width: 1, - height: 1 - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("use", { - xlinkHref: "#user-avatar_svg__b", - transform: "scale(.0052)" - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("image", { - id: "user-avatar_svg__b", - width: 192, - height: 192, - xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAIAAADdvvtQAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAwKADAAQAAAABAAAAwAAAAABNOznKAAAgAUlEQVR4Ae3d6bbsRrEt4GNs4NB3xsbYxtuYYQbv/wx+A/hBN0xj0xyD6Xuw77fW3IR1VcpapapUSbW38odWKpQZGTFjZmRKpVX1zFtvvfU/e9kROBeBj53bce+3I3CHwE6gnQcXIbAT6CL49s47gXYOXITATqCL4Ns77wTaOXARAjuBLoJv7/zc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7YlBH346Mcv1LvfyaqychEA6rmNDYCdGAUmeEZhK0bktYtDPUhl89fs71dtLEXXgJAhUCFbfG7nV6USdW9cxANLLSp6epMLSsPx2Cvu6dPu7clnNda/m1tJ6sXzl6M91wSsuYuSBo341AGVue9Ngq1Mlxrk3cm9vlJtr38usMPQmExWGJJ4o9lzAmLsHxm+DHlo3EOaFxlIesYudN7JaDPTMQK33fEfsMpu4GMvXW2JPyM7pM6llaODcTtPxaWo9A4I1jvt/CPjrfdd+yZy5ujwk0VBeXznCMEp/Ax4I8fpirZK71N9S+FxRz9WCPuGBP3pVwi0MDPs3V04K6WwZikI8ymDuybEjNoRGjZnWp1b4aXLnSsvPKZnQZTnQUYQqZ+ujsoiVK7KAlHiY6xYNQQQAmS8dxd1XHERgGQoCE6Xj7WVe7ZSBWsgx70IUFTlOZZY3G5/WaO8pT216AhMnPtfTCuSeBvHQyDEwxaSisei8HSuFeaSEwgnoUplavE+XdCMTK5Mazc08sTr490forNBuhf4UR+w5xiKcwdXSqG4GyuLIsFsfEC8nUF8qnVtuQLuoIJFi99tE9CWR7fxikwxmQNkOvhr1a8mGbvX46AjWHA6xjbpY7E+gwbK3At0zP/aEvkgqN2IfmrcZH5HPHPaKqy6VDZLqovZqS2J8HP7BVSDwWEqkuNnTLQF54Y1mRpm7H5lp56wGb6+912gfVwtYk93+rXYbuRiAvKw0NCtmHklG9nBnJ99PuCCTrONIMdmUUrEtG7EagvHIbK+vI1rnGpe/cXsu1P8OF5Yy5RDNgy5ctEsirAtwrE/cl7JJgL9G3ZqZKZnuXUbq9zmFfVgaF7GVxyffKighUOPoS6KOoX+ibfRnLFHqGx5baylWjBuk7Eq542rJzRZPOG3oIbO6Uz9Mz6tWNQDIQrHMXZv0yjFNlNN6Dp2d0eVDn3mCEwHC5GF2ae/r/AF9lfZHsN/E/AAAAAElFTkSuQmCC" - })))); -}; - -/* harmony default export */ __webpack_exports__["default"] = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGh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FoTW5QdGZUQ3VTZUJ2SFF5REV3eGFTaXNlaThIU3VGZWFTRXdnbm9VcGxhdkUrWGRDTVRLNU1hemMwOHNUcjQ5MGZvck5CdWhmNFVSK3c1eGlLY3dkWFNxRzRHeXVMSXNGc2ZFQzhuVUY4cW5WdHVRTHVvSUpGaTk5dEU5Q1dSN2Z4aWt3eG1RTmtPdmhyMWE4bUdidlg0NkFqV0hBNnhqYnBZN0UrZ3diSzNBdDB6UC9hRXZrZ3FOMklmbXJjWkg1SFBIUGFLcXk2VkRaTHFvdlpxUzJKOEhQN0JWU0R3V0Vxa3VOblRMUUY1NFkxbVJwbTdINWxwNTZ3R2I2KzkxMmdmVnd0WWs5MytyWFlidVJpQXZLdzBOQ3RtSGtsRzluQm5KOTlQdUNDVHJPTklNZG1VVXJFdEc3RWFndkhJYksrdkkxcm5HcGUvY1hzdTFQOE9GNVl5NVJETmd5NWN0RXNpckF0d3JFL2NsN0pKZ0w5RzNacVpLWm51WFVicTl6bUZmVmdhRjdHVnh5ZmZLaWdoVU9Qb1M2S09vWCtpYmZSbkxGSHFHeDViYXlsV2pCdWs3RXE1NDJySnpSWlBPRzNvSWJPNlV6OU16NnRXTlFESVFySE1YWnYweWpGTmxOTjZEcDJkMGVWRG4zbUNFd0hDNUdGMmFlL3IvQUY5bGZaSHNOL0UvQUFBQUFFbEZUa1N1UW1DQyIvPgo8L2RlZnM+Cjwvc3ZnPgo="); - -/***/ }), - -/***/ "./src/components/Feedback.js": -/*!************************************!*\ - !*** ./src/components/Feedback.js ***! - \************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* 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 _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "./src/utils.js"); - - - - -const Feedback = ({ - postId, - source -}) => { - const [status, setStatus] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(''); - const [hasSubmitted, setHasSubmitted] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false); - const [showThanksMessage, setShowThanksMessage] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false); - const yesButtonRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); - const noButtonRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); - const postFeedback = async () => { - if (status === 'helpful' || status === 'notHelpful') { - _utils__WEBPACK_IMPORTED_MODULE_3__.InteractionAPIs.postFeedback(postId, status); - _utils__WEBPACK_IMPORTED_MODULE_3__.Analytics.sendEvent('help_feedback_submitted', { - label_key: 'type', - type: status === 'helpful' ? 'positive' : 'negative', - source, - post_id: postId, - page: window.location.href.toString() - }); - } - }; - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { - setStatus(''); - noButtonRef.current.className = 'feedback-button no'; - yesButtonRef.current.className = 'feedback-button yes'; - }, [postId]); - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { - postFeedback(); - if (status === 'helpful' || status === 'notHelpful') { - setHasSubmitted(true); - setShowThanksMessage(true); - const timeout = setTimeout(() => { - setShowThanksMessage(false); - }, 3000); - return () => clearTimeout(timeout); - } - }, [status]); - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "feedback-container" - }, !hasSubmitted && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "feedback-question" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Did this result help you?', 'wp-module-help-center'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "icon" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", { - ref: yesButtonRef, - onClick: () => { - setStatus('helpful'); - }, - className: "feedback-button yes" - }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Yes', 'wp-module-help-center')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", { - onClick: () => { - setStatus('notHelpful'); - }, - ref: noButtonRef, - className: "feedback-button no" - }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No', 'wp-module-help-center')))), hasSubmitted && showThanksMessage && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "thanks-message" - }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Thanks for the feedback!', 'wp-module-help-center'))); -}; -/* harmony default export */ __webpack_exports__["default"] = (Feedback); - -/***/ }), - -/***/ "./src/components/HelpCenter.js": -/*!**************************************!*\ - !*** ./src/components/HelpCenter.js ***! - \**************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _SearchResults__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SearchResults */ "./src/components/SearchResults.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "./src/utils.js"); -/* harmony import */ var _HelpCenterIntro__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./HelpCenterIntro */ "./src/components/HelpCenterIntro.js"); - - - - - -const HelpCenter = props => { - const [visible, setVisible] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false); - const [helpEnabled, setHelpEnabled] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false); - const getHelpStatus = async () => { - try { - const response = await _utils__WEBPACK_IMPORTED_MODULE_3__.CapabilityAPI.getHelpCenterCapability(); - setHelpEnabled(response); - } catch (exception) { - setHelpEnabled(false); - } - }; - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { - getHelpStatus(); - }, []); - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { - const updateVisibility = () => { - setVisible(_utils__WEBPACK_IMPORTED_MODULE_3__.LocalStorageUtils.getHelpVisible()); - }; - - // Add the event listener on component mount - window.addEventListener('storage', updateVisibility); - - // Remove the event listener when the component unmounts - return () => { - window.removeEventListener('storage', updateVisibility); - }; - }, []); - if (!helpEnabled || !visible) { - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null); - } - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "nfd-help-center", - id: "helpcenterResultsWrapper" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_HelpCenterIntro__WEBPACK_IMPORTED_MODULE_4__["default"], null), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_SearchResults__WEBPACK_IMPORTED_MODULE_2__["default"], { - refresh: props.refresh - })); -}; -/* harmony default export */ __webpack_exports__["default"] = (HelpCenter); - -/***/ }), - -/***/ "./src/components/HelpCenterIntro.js": -/*!*******************************************!*\ - !*** ./src/components/HelpCenterIntro.js ***! - \*******************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* 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 _icons_ai_stars_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icons/ai-stars.svg */ "./src/icons/ai-stars.svg"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ "./src/utils.js"); - -/* eslint-disable react-hooks/rules-of-hooks */ - - - - -const HelpCenterIntro = () => { - const [startReveal, setStartReveal] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false); - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { - // Get the stored results from localStorage using LocalStorageUtils - const storedResults = _utils__WEBPACK_IMPORTED_MODULE_4__.LocalStorageUtils.getResultInfo(); - - // Check if the length of the stored results is <= 0 - if (storedResults.length <= 0) { - // If true, enable reveal effect - setStartReveal(true); - } else { - // Always ensure startReveal is set, even if it's false - setStartReveal(false); - } - }, []); - const introText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Hi! I’m your WordPress AI assistant.

Ask me how to do things in WordPress and I’ll provide step by step instructions.

I’m still learning so I don’t have all the answers just yet.', 'wp-module-help-center'); - - // const revealedIntro = useRevealText( introText, 50, startReveal ); - const { - displayedText: revealedIntro - } = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.useRevealText)(introText || '', 50, startReveal); - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "helpcenter-intro" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icons_ai_stars_svg__WEBPACK_IMPORTED_MODULE_3__.ReactComponent, null)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "helpcenter-intro__text", - dangerouslySetInnerHTML: { - __html: revealedIntro - } - })); -}; -/* harmony default export */ __webpack_exports__["default"] = (HelpCenterIntro); - -/***/ }), - -/***/ "./src/components/Modal.js": -/*!*********************************!*\ - !*** ./src/components/Modal.js ***! - \*********************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* 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 _icons_close_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icons/close.svg */ "./src/icons/close.svg"); -/* harmony import */ var _icons_helpcenter_icon_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../icons/helpcenter-icon.svg */ "./src/icons/helpcenter-icon.svg"); -/* harmony import */ var _HelpCenter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./HelpCenter */ "./src/components/HelpCenter.js"); -/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! .. */ "./src/index.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils */ "./src/utils.js"); - - - -// - - - - - -const Modal = ({ - onClose -}) => { - const [brand, setBrand] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(''); - const [refresh, setRefresh] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false); - const getBrand = async () => { - const brandRetrieved = await _utils__WEBPACK_IMPORTED_MODULE_7__.CapabilityAPI.getBrand(); - setBrand(brandRetrieved.toLowerCase()); - }; - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { - const helpVisible = _utils__WEBPACK_IMPORTED_MODULE_7__.LocalStorageUtils.getHelpVisible(); - (0,___WEBPACK_IMPORTED_MODULE_6__.toggleHelp)(helpVisible); - getBrand(); - }, []); - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "nfd-hc-modal" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "nfd-hc-modal__header" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h3", { - className: "nfd-hc-modal__header__heading" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { - className: "nfd-hc-modal__header__heading__icon" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icons_helpcenter_icon_svg__WEBPACK_IMPORTED_MODULE_4__.ReactComponent, null)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Help with WordPress', 'wp-module-help-center'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", { - className: "nfd-hc-modal__header__close-button", - onClick: () => { - onClose(); - setRefresh(!refresh); - } - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "nfd-hc-modal__header__close-button__icon-button" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icons_close_svg__WEBPACK_IMPORTED_MODULE_3__.ReactComponent, null)))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_HelpCenter__WEBPACK_IMPORTED_MODULE_5__["default"], { - closeHelp: () => { - onClose(); - setRefresh(!refresh); - }, - refresh: refresh, - brand: brand - })); -}; -/* harmony default export */ __webpack_exports__["default"] = (Modal); - -/***/ }), - -/***/ "./src/components/NoResults.js": -/*!*************************************!*\ - !*** ./src/components/NoResults.js ***! - \*************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* 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__); - - -const NoResults = () => { - const resourceLink = window?.nfdHelpCenter?.resourceLink || '#'; // Fallback if resourceLink is not defined - - // Define the content with a placeholder for the link - const contentWithLink = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('You can try searching our Resource center. though to see if there’s a helpful article or video on that subject.', 'wp-module-help-center'); - - // Replace the {link} placeholder with the actual link - const formattedContent = contentWithLink.replace('{link}', resourceLink); - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sorry, I don’t have any information on that topic yet.', 'wp-module-help-center')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { - dangerouslySetInnerHTML: { - __html: formattedContent - } - })); -}; -/* harmony default export */ __webpack_exports__["default"] = (NoResults); - -/***/ }), - -/***/ "./src/components/ResultContent.js": -/*!*****************************************!*\ - !*** ./src/components/ResultContent.js ***! - \*****************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ResultContent: function() { return /* binding */ ResultContent; } -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _Feedback__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Feedback */ "./src/components/Feedback.js"); -/* harmony import */ var _NoResults__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./NoResults */ "./src/components/NoResults.js"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ "./src/utils.js"); -/* harmony import */ var _icons_user_avatar_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../icons/user-avatar.svg */ "./src/icons/user-avatar.svg"); -/* harmony import */ var _icons_ai_stars_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../icons/ai-stars.svg */ "./src/icons/ai-stars.svg"); -/* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! marked */ "./node_modules/marked/lib/marked.esm.js"); - - - - - - - - -const ResultContent = ({ - content, - noResult, - postId, - source, - showFeedbackSection, - questionBlock, - isLoading, - loadingQuery, - loadingIndex, - index, - isNewResult, - searchInput -}) => { - const isNewEntry = isNewResult && index === _utils__WEBPACK_IMPORTED_MODULE_4__.LocalStorageUtils.getResultInfo().length - 1; - const responseRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(null); - const [shouldReveal, setShouldReveal] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false); - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => { - if (isNewEntry && responseRef.current || isLoading) { - adjustHeightAndScroll(); - } - }, [isNewEntry, isLoading]); - const adjustHeightAndScroll = () => { - const viewportHeight = window.innerHeight; - const minHeight = viewportHeight - 332; - responseRef.current.style.minHeight = `${minHeight}px`; - const helpcenterResultsWrapper = document.getElementById('helpcenterResultsWrapper'); - const scrollDistance = helpcenterResultsWrapper.scrollHeight; - helpcenterResultsWrapper.scrollBy({ - top: scrollDistance, - left: 0, - behavior: 'smooth' - }); - setShouldReveal(true); - }; - - /* Parse the html in string to a document node, replace the

tags with a fragment and line break */ - const processContentForMarkdown = textToDisplay => { - if (textToDisplay) { - // eslint-disable-next-line no-undef - const parser = new DOMParser(); - const doc = parser.parseFromString(textToDisplay, 'text/html'); - const paragraphElements = doc.querySelectorAll('p'); - paragraphElements.forEach(p => { - // Create a DocumentFragment to hold the content and
tags - const fragment = document.createDocumentFragment(); - - // Append all child nodes of the

to the fragment - while (p.firstChild) { - fragment.appendChild(p.firstChild); - } - const br1 = document.createElement('br'); - const br2 = document.createElement('br'); - fragment.appendChild(br1); - fragment.appendChild(br2); - - // Replace the

element with the fragment - p.parentNode.replaceChild(fragment, p); - }); - const updatedContent = doc.body.innerHTML; - return updatedContent; - } - return ''; - }; - const { - displayedText: textToDisplay, - isComplete: revealComplete - } = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.useRevealText)(content || '', 50, shouldReveal); - const htmlContent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useMemo)(() => { - const processedHTMLContent = processContentForMarkdown(textToDisplay); - const markedContent = processedHTMLContent ? (0,marked__WEBPACK_IMPORTED_MODULE_7__.marked)(processedHTMLContent) : ''; - return markedContent; - }, [textToDisplay]); - function renderContentOrLoading() { - if (isLoading && loadingQuery === questionBlock && loadingIndex === index && source === 'ai') { - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "loading-cursor" - }); - } else if (content && content.length > 0) { - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { - className: "helpcenter-results", - dangerouslySetInnerHTML: { - __html: htmlContent - } - }); - } - return null; - } - function shouldShowFeedback() { - return !noResult && showFeedbackSection && content && revealComplete && content.length > 0; - } - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - ref: responseRef, - className: "helpcenter-response-block" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "helpcenter-question-block" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "helpcenter-question__user-avatar" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icons_user_avatar_svg__WEBPACK_IMPORTED_MODULE_5__.ReactComponent, null)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, noResult && isNewEntry ? searchInput : questionBlock)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "helpcenter-result-block" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "helpcenter-result-block__aistars" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icons_ai_stars_svg__WEBPACK_IMPORTED_MODULE_6__.ReactComponent, null)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, noResult && isNewEntry ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_NoResults__WEBPACK_IMPORTED_MODULE_2__["default"], null) : renderContentOrLoading())), shouldShowFeedback() && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Feedback__WEBPACK_IMPORTED_MODULE_1__["default"], { - postId: postId, - source: source - }))); -}; - -/***/ }), - -/***/ "./src/components/SearchInput.js": -/*!***************************************!*\ - !*** ./src/components/SearchInput.js ***! - \***************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); -/* 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 _icons_paper_airplane_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icons/paper-airplane.svg */ "./src/icons/paper-airplane.svg"); -/* harmony import */ var _icons_phone_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../icons/phone.svg */ "./src/icons/phone.svg"); -/* harmony import */ var _icons_chat_bubble_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../icons/chat-bubble.svg */ "./src/icons/chat-bubble.svg"); - - - - - - -const SearchInput = ({ - searchInput, - setSearchInput, - populateSearchResult, - debouncedResults, - setNoResult, - getAIResult -}) => { - const [error, setError] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(''); - const validateInput = () => { - if (!searchInput.trim()) { - setError((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Please enter a specific search term to get results.', 'wp-module-help-center')); - return false; - } - setError(''); - return true; - }; - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "helpcenter-input-wrapper" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "search-container__wrapper" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "search-container" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", { - type: "text", - id: "search-input-box", - value: searchInput, - maxLength: "144", - placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Ask about WordPress', 'wp-module-help-center'), - onChange: e => { - setError(''); - setSearchInput(e.target.value); - populateSearchResult('', undefined, e.target.value); - setNoResult(false); - debouncedResults(e.target.value); - }, - onKeyDown: async e => { - if (e.key === 'Enter' && validateInput()) { - await getAIResult(); - } - } - }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", { - onClick: async () => { - if (validateInput()) { - await getAIResult(); - } - } - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icons_paper_airplane_svg__WEBPACK_IMPORTED_MODULE_3__.ReactComponent, null))), error && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { - className: "hc-input-error-message" - }, error), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "attribute" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { - className: "hc-input-counter" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, searchInput ? searchInput.length : 0, "/144")))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "helpcenter-supportinfo__wrapper" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h4", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Account Support', 'wp-module-help-center')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "helpcenter-supportinfo__text" - }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('If you need help with your Bluehost account, contact our support team:', 'wp-module-help-center')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "helpcenter-supportinfo__telephone" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icons_phone_svg__WEBPACK_IMPORTED_MODULE_4__.ReactComponent, null)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", { - href: "tel:8884014678", - "aria-label": "Call 888-401-4678" - }, "888-401-4678"))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "helpcenter-supportinfo__chat" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icons_chat_bubble_svg__WEBPACK_IMPORTED_MODULE_5__.ReactComponent, null)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", { - href: "https://www.bluehost.com/contact", - "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Chat with support', 'wp-module-help-center'), - target: "_blank", - rel: "noreferrer" - }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Chat with support', 'wp-module-help-center'))))))); -}; -/* harmony default export */ __webpack_exports__["default"] = (SearchInput); - -/***/ }), - -/***/ "./src/components/SearchResultSuggestions.js": -/*!***************************************************!*\ - !*** ./src/components/SearchResultSuggestions.js ***! - \***************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ SearchResultSuggestions: function() { return /* binding */ SearchResultSuggestions; } -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _icons_go_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../icons/go.svg */ "./src/icons/go.svg"); - -/* eslint-disable jsx-a11y/no-static-element-interactions */ -/* eslint-disable jsx-a11y/click-events-have-key-events */ - -const SearchResultSuggestions = ({ - searchTitle, - onGo -}) => { - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "algoliaResult", - onClick: onGo - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, searchTitle), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "svg" - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icons_go_svg__WEBPACK_IMPORTED_MODULE_1__.ReactComponent, null)))); -}; - -/***/ }), - -/***/ "./src/components/SearchResults.js": -/*!*****************************************!*\ - !*** ./src/components/SearchResults.js ***! - \*****************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash"); -/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _newfold_labs_wp_module_ai__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @newfold-labs/wp-module-ai */ "./node_modules/@newfold-labs/wp-module-ai/index.js"); -/* harmony import */ var _SearchResultSuggestions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SearchResultSuggestions */ "./src/components/SearchResultSuggestions.js"); -/* harmony import */ var _ResultContent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ResultContent */ "./src/components/ResultContent.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils */ "./src/utils.js"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); -/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_8__); -/* harmony import */ var _SearchInput__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./SearchInput */ "./src/components/SearchInput.js"); - -/* eslint-disable no-shadow */ - - - - - - - - - -const SearchResults = props => { - const [isLoading, setIsLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false); - const [noResult, setNoResult] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false); - const [searchInput, setSearchInput] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(''); - const [resultContent, setResultContent] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)([]); - const [postId, setPostId] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(); - const [source, setSource] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)('kb'); - const [multiResults, setMultiResults] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)({}); - const [showSuggestions, setShowSuggestions] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(true); - const [loadingQuery, setLoadingQuery] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(null); - const [loadingIndex, setLoadingIndex] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(null); - const [isNewResult, setIsNewResult] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false); - const populateSearchResult = (resultContent, postId, searchInput) => { - const resultContentFormatted = resultContent.replace(/\n/g, '
'); - // Retrieve existing results from local storage and using the updated persistResult method to store the result - _utils__WEBPACK_IMPORTED_MODULE_6__.LocalStorageUtils.persistResult(resultContentFormatted, postId, searchInput); - // Add new result to existing results and retrieve all results from local storage - const updatedResults = _utils__WEBPACK_IMPORTED_MODULE_6__.LocalStorageUtils.getResultInfo(); - setResultContent(updatedResults); - setPostId(postId); - _utils__WEBPACK_IMPORTED_MODULE_6__.LocalStorageUtils.persistSearchInput(searchInput); - if (postId) { - setIsNewResult(true); - } - if (postId) { - _utils__WEBPACK_IMPORTED_MODULE_6__.Analytics.sendEvent('help_search', { - label_key: 'term', - term: searchInput, - page: window.location.href.toString() - }); - } - }; - const fetchMultiSearchResults = async (query, brand) => { - try { - const response = await _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_8___default()({ - path: '/newfold-multi-search/v1/multi_search', - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - query, - brand - }) - }); - return response; - } catch (error) { - // eslint-disable-next-line no-console - console.error('Error fetching multi-search results:', error); - return {}; - } - }; - const fetchInitialData = async () => { - try { - // Populate the results from local storage if they exist - const savedResults = _utils__WEBPACK_IMPORTED_MODULE_6__.LocalStorageUtils.getResultInfo(); - if (savedResults) { - setResultContent(savedResults); - setIsNewResult(false); - } - const savedInput = _utils__WEBPACK_IMPORTED_MODULE_6__.LocalStorageUtils.getSearchInput(); - const input = savedInput || ''; - setSearchInput(input); - const brand = await _utils__WEBPACK_IMPORTED_MODULE_6__.CapabilityAPI.getBrand(); - const multiSearchResults = await fetchMultiSearchResults(input, brand); - setMultiResults({ - hits: multiSearchResults?.results?.[0]?.grouped_hits - }); - } catch (error) { - // eslint-disable-next-line no-console - console.error('Error fetching initial data:', error); - } - }; - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => { - setSearchInput(''); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [props.refresh]); - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => { - fetchInitialData(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - const getResultMatches = (query, tokensMatched, fieldsMatched) => { - const tokensPerQuery = tokensMatched / query.split(/\s+/).length; - return fieldsMatched >= 1 && tokensPerQuery >= 0.99; - }; - const checkAndPopulateResult = (hits, searchInput) => { - if (hits?.length > 0) { - const resultMatches = getResultMatches(searchInput, hits[0]?.text_match_info?.tokens_matched, hits[0]?.text_match_info?.fields_matched); - if (resultMatches) { - populateSearchResult(hits[0].document.post_content, hits[0].document.post_id || hits[0].document.id, searchInput); - return true; - } - } - return false; - }; - const getAIResult = async () => { - setIsLoading(true); - setShowSuggestions(false); - setLoadingQuery(searchInput); - setLoadingIndex(resultContent.length); - try { - // Check existing multiResults - let hits = multiResults?.hits?.[0]?.hits; - if (checkAndPopulateResult(hits, searchInput)) return; - - // Make a new multi-search API call if no match is found - const brand = await _utils__WEBPACK_IMPORTED_MODULE_6__.CapabilityAPI.getBrand(); - const multiSearchResults = await fetchMultiSearchResults(searchInput, brand); - hits = multiSearchResults?.results?.[0]?.grouped_hits?.[0]?.hits; - if (checkAndPopulateResult(hits, searchInput)) return; - setSource('ai'); - const result = await _newfold_labs_wp_module_ai__WEBPACK_IMPORTED_MODULE_3__["default"].search.getSearchResult(searchInput, 'helpcenter'); - if (result.result[0]) { - populateSearchResult(result.result[0].text, result.post_id, searchInput); - } else { - setNoResult(true); - } - } catch (exception) { - // eslint-disable-next-line no-console - console.error('An error occurred:', exception); - setNoResult(true); - setIsNewResult(true); // to display no result error only for the upcoming result. - } finally { - setLoadingQuery(null); - setIsLoading(false); - setLoadingIndex(null); - setShowSuggestions(false); - } - }; - const debouncedResults = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => { - return (0,lodash__WEBPACK_IMPORTED_MODULE_1__.debounce)(async query => { - if (!query || query.length === 0) { - setMultiResults({}); - return; - } - setShowSuggestions(true); - try { - const brand = await _utils__WEBPACK_IMPORTED_MODULE_6__.CapabilityAPI.getBrand(); - const multiSearchResults = await fetchMultiSearchResults(query, brand); - if (multiSearchResults?.results?.[0]?.grouped_hits) { - setMultiResults({ - hits: multiSearchResults?.results?.[0]?.grouped_hits - }); - } - } catch (error) { - // eslint-disable-next-line no-console - console.error('Error fetching debounced results:', error); - } - }, 500); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - // Clear any debounce problems - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => { - debouncedResults.cancel(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - const handleSuggestionsClick = (result, postTitle) => { - setSearchInput(postTitle); - setShowSuggestions(false); - populateSearchResult(result?.hits[0]?.document?.post_content, result?.hits[0]?.document?.id, postTitle); - }; - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "hc-results-container" - }, resultContent?.length > 0 && resultContent.map((result, index) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_ResultContent__WEBPACK_IMPORTED_MODULE_5__.ResultContent, { - key: index, - content: result.resultContent, - noResult: noResult, - postId: result.postId, - source: source, - showFeedbackSection: !result.resultContent.includes('do not possess the answer'), - questionBlock: result.searchInput, - isLoading: isLoading, - loadingQuery: loadingQuery, - loadingIndex: loadingIndex, - index: index, - isNewResult: isNewResult, - searchInput: searchInput - })), isLoading && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_ResultContent__WEBPACK_IMPORTED_MODULE_5__.ResultContent, { - key: "loading", - content: null, - noResult: false, - postId: null, - source: "ai", - showFeedbackSection: false, - questionBlock: loadingQuery, - isLoading: isLoading, - loadingQuery: loadingQuery, - loadingIndex: loadingIndex, - index: resultContent.length, - isNewResult: isNewResult, - searchInput: searchInput - })), showSuggestions && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - className: "suggestions-wrapper" - }, multiResults?.hits?.length > 0 && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("b", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Common Topics', 'wp-module-help-center'))), multiResults?.hits?.map((result, index) => { - const el = document.createElement('span'); - el.setAttribute('display', 'none'); - el.innerHTML = result?.group_key; - const postTitle = el.textContent || el.innerText; - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_SearchResultSuggestions__WEBPACK_IMPORTED_MODULE_4__.SearchResultSuggestions, { - key: index, - searchTitle: postTitle, - onGo: () => { - handleSuggestionsClick(result, postTitle); - } - })); - })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_SearchInput__WEBPACK_IMPORTED_MODULE_9__["default"], { - searchInput: searchInput, - setSearchInput: setSearchInput, - populateSearchResult: populateSearchResult, - debouncedResults: debouncedResults, - setNoResult: setNoResult, - getAIResult: getAIResult - })); -}; -/* harmony default export */ __webpack_exports__["default"] = (SearchResults); - -/***/ }), - -/***/ "./src/index.js": -/*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ toggleHelp: function() { return /* binding */ toggleHelp; } -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! regenerator-runtime/runtime */ "./node_modules/regenerator-runtime/runtime.js"); -/* harmony import */ var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); -/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); -/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _newfold_labs_js_utility_ui_analytics__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @newfold-labs/js-utility-ui-analytics */ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/index.js"); -/* harmony import */ var _components_Modal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/Modal */ "./src/components/Modal.js"); -/* harmony import */ var _icons_help_plugin_sidebar_icon_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./icons/help-plugin-sidebar-icon.svg */ "./src/icons/help-plugin-sidebar-icon.svg"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ "./src/utils.js"); -/* harmony import */ var _styles_scss__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../styles.scss */ "./styles.scss"); - -// eslint-disable-next-line import/no-extraneous-dependencies - - - -// - - -// - - - - -_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_4___default()(() => { - // Run only once DOM is ready, else this won't work. - if (window?.nfdHelpCenter?.restUrl) { - _newfold_labs_js_utility_ui_analytics__WEBPACK_IMPORTED_MODULE_5__.HiiveAnalytics.initialize({ - namespace: 'wonder_help', - urls: { - single: window.nfdHelpCenter.restUrl + '/newfold-data/v1/events' - } - }); - } -}); -const wpContentContainer = document.getElementById('wpcontent'); -const toggleHelp = visible => { - wpContentContainer.classList.toggle('wpcontent-container', visible); - const nfdHelpContainer = document.getElementById('nfd-help-center'); - nfdHelpContainer.classList.toggle('help-container', visible); - _utils__WEBPACK_IMPORTED_MODULE_8__.LocalStorageUtils.updateHelpVisible(visible); - window.dispatchEvent(new Event('storage')); -}; -const toggleHelpViaLocalStorage = () => { - const helpVisible = _utils__WEBPACK_IMPORTED_MODULE_8__.LocalStorageUtils.getHelpVisible(); - if (Object.is(helpVisible, undefined)) { - toggleHelp(true); - _utils__WEBPACK_IMPORTED_MODULE_8__.Analytics.sendEvent('help_sidebar_opened', { - page: window.location.href.toString() - }); - return; - } - if (!helpVisible) { - _utils__WEBPACK_IMPORTED_MODULE_8__.Analytics.sendEvent('help_sidebar_opened', { - page: window.location.href.toString() - }); - } - toggleHelp(!helpVisible); -}; -window.newfoldEmbeddedHelp = { - toggleNFDLaunchedEmbeddedHelp: () => { - toggleHelpViaLocalStorage(); - }, - renderEmbeddedHelp: () => { - const helpContainer = document.createElement('div'); - helpContainer.id = 'nfd-help-center'; - helpContainer.style.display = 'none'; - wpContentContainer.appendChild(helpContainer); - const DOM_TARGET = document.getElementById('nfd-help-center'); - if (null !== DOM_TARGET) { - if ('undefined' !== _wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createRoot) { - // WP 6.2+ only - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createRoot)(DOM_TARGET).render((0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_Modal__WEBPACK_IMPORTED_MODULE_6__["default"], { - onClose: () => { - toggleHelp(false); - } - })); - } else if ('undefined' !== _wordpress_element__WEBPACK_IMPORTED_MODULE_2__.render) { - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.render)((0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_Modal__WEBPACK_IMPORTED_MODULE_6__["default"], { - onClose: () => { - toggleHelp(false); - } - }), DOM_TARGET); - } - } - } -}; - -//For rendering embedded help in Add, edit and View Pages -/* Using the subscribe from the store to keep the UI persistent */ -const unsubscribe = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.subscribe)(() => { - const wrapper = document.getElementById('nfd-help-menu-button-wrapper'); - if (wrapper) { - unsubscribe(); // Unsubscribe from the state changes - return; - } - _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_4___default()(() => { - const editorToolbarSettings = document.querySelector('.edit-post-header__settings'); - if (!editorToolbarSettings) { - return; - } - - // Create wrapper to fill with the button - const buttonWrapper = document.createElement('div'); - buttonWrapper.id = 'nfd-help-menu-button-wrapper'; - buttonWrapper.classList.add('nfd-help-menu-button-wrapper'); - const moreMenuDropdown = editorToolbarSettings.querySelector('.components-dropdown-menu.interface-more-menu-dropdown'); - if (moreMenuDropdown) { - editorToolbarSettings.insertBefore(buttonWrapper, moreMenuDropdown); - } else { - editorToolbarSettings.appendChild(buttonWrapper); - } - const helpMenuButton = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", { - className: "components-button has-icon", - onClick: () => { - window.newfoldEmbeddedHelp.toggleNFDLaunchedEmbeddedHelp(); - } - }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_icons_help_plugin_sidebar_icon_svg__WEBPACK_IMPORTED_MODULE_7__.ReactComponent, null)); - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.render)(helpMenuButton, document.getElementById('nfd-help-menu-button-wrapper')); - }); -}); -window.newfoldEmbeddedHelp.renderEmbeddedHelp(); - -/* The method added to the window object can be used to open the help center pop and enter the text/query clicked */ - -window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery = function (selectedText, launchByElement) { - const helpVisible = _utils__WEBPACK_IMPORTED_MODULE_8__.LocalStorageUtils.getHelpVisible(); - _utils__WEBPACK_IMPORTED_MODULE_8__.LocalStorageUtils.persistSearchInput(selectedText); - if (helpVisible !== 'true' && launchByElement) { - window.newfoldEmbeddedHelp.renderEmbeddedHelp(); // Ensure this is called to update the UI - toggleHelp(true); - } - const isElementVisible = element => { - const style = window.getComputedStyle(element); - return style.display !== 'none' && style.visibility !== 'hidden'; - }; - - // Create the Enter key event in advance - // eslint-disable-next-line no-undef - const enterKey = new KeyboardEvent('keydown', { - bubbles: true, - // Allow the event to bubble up - cancelable: true, - // Allow the event to be cancellable - key: 'Enter', - // Specify which key is pressed - code: 'Enter', - // Physical key code - keyCode: 13 // Deprecated but included for compatibility - }); - - const targetElement = document.getElementById('nfd-help-center'); - const maxAttempts = 5; - let attempts = 0; - const searchInterval = setInterval(() => { - attempts++; - if (targetElement && isElementVisible(targetElement)) { - const searchInput = document.getElementById('search-input-box'); - searchInput.value = selectedText; - searchInput.focus(); - searchInput.setSelectionRange(searchInput.value.length, searchInput.value.length); - // Dispatch the pre-created Enter key event to the input - searchInput.dispatchEvent(enterKey); - clearInterval(searchInterval); - } else if (attempts >= maxAttempts) { - clearInterval(searchInterval); - } - }, 500); -}; - -/* Detect click event on the calling element and checking if the clicked element has a specific data attribute name nfdhelpcenterquery */ -document.addEventListener('click', event => { - try { - if (event.target?.dataset?.nfdhelpcenterquery && event.target.dataset.nfdhelpcenterquery.trim() !== '') { - window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery(event.target.dataset.nfdhelpcenterquery, true); - } - } catch (error) { - // eslint-disable-next-line no-console - console.error('Error launching help center via query:', error); - } -}); - -/***/ }), - -/***/ "./src/utils.js": -/*!**********************!*\ - !*** ./src/utils.js ***! - \**********************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Analytics: function() { return /* binding */ Analytics; }, -/* harmony export */ CapabilityAPI: function() { return /* binding */ CapabilityAPI; }, -/* harmony export */ InteractionAPIs: function() { return /* binding */ InteractionAPIs; }, -/* harmony export */ LocalStorageUtils: function() { return /* binding */ LocalStorageUtils; }, -/* harmony export */ OnboardingAPIs: function() { return /* binding */ OnboardingAPIs; }, -/* harmony export */ isValidJSON: function() { return /* binding */ isValidJSON; }, -/* harmony export */ useRevealText: function() { return /* binding */ useRevealText; } -/* harmony export */ }); -/* harmony import */ var _newfold_labs_js_utility_ui_analytics__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @newfold-labs/js-utility-ui-analytics */ "./node_modules/@newfold-labs/js-utility-ui-analytics/src/index.js"); -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); -/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); -/* eslint-disable no-undef */ - - - -const base = 'nfd-help-center/v1'; -const onboardingBase = 'newfold-onboarding/v1'; -const InteractionAPIs = { - postFeedback: (postId, status) => _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ - path: base + '/feedback', - method: 'POST', - data: { - post_id: postId, - status - } - }) -}; -const OnboardingAPIs = { - getFlowData: () => _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ - path: onboardingBase + '/flow', - method: 'GET' - }) -}; -const CapabilityAPI = { - getHelpCenterCapability: () => { - return ( - // get the help center capability from newfold runtime - window.NewfoldRuntime?.capabilities?.canAccessHelpCenter || false - ); - }, - getBrand: () => { - // get the brand name from newfold runtime - const brand = window.NewfoldRuntime?.plugin?.brand || 'wordpress'; - // add region if HostGator - if (brand.includes('hostgator') && window.NewfoldRuntime?.plugin?.region) { - return brand + '-' + window.NewfoldRuntime?.plugin?.region; - } - return brand; - } -}; - -// A wrapper to get and set things more easily -const LocalStorageUtils = { - updateHelpVisible: visible => { - localStorage.setItem('helpVisible', visible ? 'true' : 'false'); - }, - getHelpVisible: () => { - return localStorage.getItem('helpVisible') === 'true'; - }, - persistResult: (resultContent, postId, searchInput) => { - // Only store the result if resultContent has a value - if (!resultContent || resultContent.trim() === '') { - return; - } - - // Retrieve existing results or initialize as an empty array - const existingResults = LocalStorageUtils.getResultInfo(); - - // Create a new result object - const newResult = { - searchInput, - resultContent, - postId - }; - - // Add new result to the array - existingResults.push(newResult); - - // Store the updated array back in local storage - localStorage.setItem('helpResultContent', JSON.stringify(existingResults)); - }, - persistSearchInput: searchInput => { - localStorage.setItem('searchInput', searchInput); - }, - clear: () => { - localStorage.removeItem('helpResultContent'); - localStorage.removeItem('helpPostId'); - localStorage.removeItem('searchInput'); - }, - // Update getResultInfo to retrieve all results - getResultInfo: () => { - const results = localStorage.getItem('helpResultContent'); - return results && isValidJSON(results) ? JSON.parse(results) : []; - }, - getSearchInput: () => { - return localStorage.getItem('searchInput'); - }, - getFeatureFlag(flagName) { - return localStorage.getItem(flagName); - }, - setFeatureFlag(flagName, value) { - localStorage.setItem(flagName, value); - } -}; -const Analytics = { - sendEvent: (action, data) => { - const hiiveEvent = new _newfold_labs_js_utility_ui_analytics__WEBPACK_IMPORTED_MODULE_0__.HiiveEvent('wonder_help', action, data, 'wonder_help'); - _newfold_labs_js_utility_ui_analytics__WEBPACK_IMPORTED_MODULE_0__.HiiveAnalytics.send(hiiveEvent); - } -}; -const useRevealText = (text, speed = 100, startReveal = false) => { - const [displayedText, setDisplayedText] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(''); - const [isComplete, setIsComplete] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false); - (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => { - if (!text) { - setDisplayedText(''); - setIsComplete(false); - return; - } - - // Only trigger the reveal effect if startReveal is true - if (startReveal) { - // Split text and filter out empty strings - const words = text.trim().split(' ').filter(Boolean); - let index = 0; - - // Initialize with the first word - setDisplayedText(words[0]); - setIsComplete(false); - const intervalId = setInterval(() => { - if (index < words.length - 1) { - index++; - setDisplayedText(prev => prev + ' ' + words[index]); - } else { - clearInterval(intervalId); - setIsComplete(true); - } - }, speed); - return () => clearInterval(intervalId); - } - setDisplayedText(text); - setIsComplete(true); - }, [text, speed, startReveal]); - return { - displayedText, - isComplete - }; -}; -const isValidJSON = json => { - try { - JSON.parse(json); - return true; - } catch (e) { - return false; - } -}; - -/***/ }), - -/***/ "./styles.scss": -/*!*********************!*\ - !*** ./styles.scss ***! - \*********************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }), - -/***/ "./node_modules/regenerator-runtime/runtime.js": -/*!*****************************************************!*\ - !*** ./node_modules/regenerator-runtime/runtime.js ***! - \*****************************************************/ -/***/ (function(module) { - -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -var runtime = (function (exports) { - "use strict"; - - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }; - var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - - function define(obj, key, value) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - return obj[key]; - } - try { - // IE 8 has a broken Object.defineProperty that only works on DOM objects. - define({}, ""); - } catch (err) { - define = function(obj, key, value) { - return obj[key] = value; - }; - } - - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); - - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }); - - return generator; - } - exports.wrap = wrap; - - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; - - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; - - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - - // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - var IteratorPrototype = {}; - define(IteratorPrototype, iteratorSymbol, function () { - return this; - }); - - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - if (NativeIteratorPrototype && - NativeIteratorPrototype !== Op && - hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - - var Gp = GeneratorFunctionPrototype.prototype = - Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = GeneratorFunctionPrototype; - defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }); - defineProperty( - GeneratorFunctionPrototype, - "constructor", - { value: GeneratorFunction, configurable: true } - ); - GeneratorFunction.displayName = define( - GeneratorFunctionPrototype, - toStringTagSymbol, - "GeneratorFunction" - ); - - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - define(prototype, method, function(arg) { - return this._invoke(method, arg); - }); - }); - } - - exports.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; - - exports.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - define(genFun, toStringTagSymbol, "GeneratorFunction"); - } - genFun.prototype = Object.create(Gp); - return genFun; - }; - - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - exports.awrap = function(arg) { - return { __await: arg }; - }; - - function AsyncIterator(generator, PromiseImpl) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value && - typeof value === "object" && - hasOwn.call(value, "__await")) { - return PromiseImpl.resolve(value.__await).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } - - return PromiseImpl.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. - result.value = unwrapped; - resolve(result); - }, function(error) { - // If a rejected Promise was yielded, throw the rejection back - // into the async generator function so it can be handled there. - return invoke("throw", error, resolve, reject); - }); - } - } - - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new PromiseImpl(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : callInvokeWithMethodAndArg(); - } - - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - defineProperty(this, "_invoke", { value: enqueue }); - } - - defineIteratorMethods(AsyncIterator.prototype); - define(AsyncIterator.prototype, asyncIteratorSymbol, function () { - return this; - }); - exports.AsyncIterator = AsyncIterator; - - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { - if (PromiseImpl === void 0) PromiseImpl = Promise; - - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList), - PromiseImpl - ); - - return exports.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); - }; - - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } - - // Be forgiving, per GeneratorResume behavior specified since ES2015: - // ES2015 spec, step 3: https://262.ecma-international.org/6.0/#sec-generatorresume - // Latest spec, step 2: https://tc39.es/ecma262/#sec-generatorresume - return doneResult(); - } - - context.method = method; - context.arg = arg; - - while (true) { - var delegate = context.delegate; - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - - context.dispatchException(context.arg); - - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } - - state = GenStateExecuting; - - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; - - if (record.arg === ContinueSentinel) { - continue; - } - - return { - value: record.arg, - done: context.done - }; - - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - context.method = "throw"; - context.arg = record.arg; - } - } - }; - } - - // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - function maybeInvokeDelegate(delegate, context) { - var methodName = context.method; - var method = delegate.iterator[methodName]; - if (method === undefined) { - // A .throw or .return when the delegate iterator has no .throw - // method, or a missing .next method, always terminate the - // yield* loop. - context.delegate = null; - - // Note: ["return"] must be used for ES3 parsing compatibility. - if (methodName === "throw" && delegate.iterator["return"]) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined; - maybeInvokeDelegate(delegate, context); - - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - if (methodName !== "return") { - context.method = "throw"; - context.arg = new TypeError( - "The iterator does not provide a '" + methodName + "' method"); - } - - return ContinueSentinel; - } - - var record = tryCatch(method, delegate.iterator, context.arg); - - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - - var info = record.arg; - - if (! info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; - - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; - - // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined; - } - - } else { - // Re-yield the result returned by the delegate method. - return info; - } - - // The delegate iterator is finished, so forget it and continue with - // the outer generator. - context.delegate = null; - return ContinueSentinel; - } - - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); - - define(Gp, toStringTagSymbol, "Generator"); - - // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - define(Gp, iteratorSymbol, function() { - return this; - }); - - define(Gp, "toString", function() { - return "[object Generator]"; - }); - - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; - - if (1 in locs) { - entry.catchLoc = locs[1]; - } - - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - - this.tryEntries.push(entry); - } - - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - - exports.keys = function(val) { - var object = Object(val); - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); - - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } - - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable != null) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - - if (typeof iterable.next === "function") { - return iterable; - } - - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - - next.value = undefined; - next.done = true; - - return next; - }; - - return next.next = next; - } - } - - throw new TypeError(typeof iterable + " is not iterable"); - } - exports.values = values; - - function doneResult() { - return { value: undefined, done: true }; - } - - Context.prototype = { - constructor: Context, - - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; - - this.method = "next"; - this.arg = undefined; - - this.tryEntries.forEach(resetTryEntry); - - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } - } - }, - - stop: function() { - this.done = true; - - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - - return this.rval; - }, - - dispatchException: function(exception) { - if (this.done) { - throw exception; - } - - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = "next"; - context.arg = undefined; - } - - return !! caught; - } - - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - - return this.complete(record); - }, - - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = this.arg = record.arg; - this.method = "return"; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - - return ContinueSentinel; - }, - - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } - - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, - - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - - if (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined; - } - - return ContinueSentinel; - } - }; - - // Regardless of whether this script is executing as a CommonJS module - // or not, return the runtime object so that we can declare the variable - // regeneratorRuntime in the outer scope, which allows this module to be - // injected easily by `bin/regenerator --include-runtime script.js`. - return exports; - -}( - // If this script is executing as a CommonJS module, use module.exports - // as the regeneratorRuntime namespace. Otherwise create a new empty - // object. Either way, the resulting object will be used to initialize - // the regeneratorRuntime variable at the top of this file. - true ? module.exports : 0 -)); - -try { - regeneratorRuntime = runtime; -} catch (accidentalStrictMode) { - // This module should not be running in strict mode, so the above - // assignment should always work unless something is misconfigured. Just - // in case runtime.js accidentally runs in strict mode, in modern engines - // we can explicitly access globalThis. In older engines we can escape - // strict mode using a global Function call. This could conceivably fail - // if a Content Security Policy forbids using Function, but in that case - // the proper solution is to fix the accidental strict mode problem. If - // you've misconfigured your bundler to force strict mode and applied a - // CSP to forbid Function, and you're not willing to fix either of those - // problems, please detail your unique predicament in a GitHub issue. - if (typeof globalThis === "object") { - globalThis.regeneratorRuntime = runtime; - } else { - Function("r", "regeneratorRuntime = r")(runtime); - } -} - - -/***/ }), - -/***/ "react": -/*!************************!*\ - !*** external "React" ***! - \************************/ -/***/ (function(module) { - -"use strict"; -module.exports = window["React"]; - -/***/ }), - -/***/ "lodash": -/*!*************************!*\ - !*** external "lodash" ***! - \*************************/ -/***/ (function(module) { - -"use strict"; -module.exports = window["lodash"]; - -/***/ }), - -/***/ "@wordpress/api-fetch": -/*!**********************************!*\ - !*** external ["wp","apiFetch"] ***! - \**********************************/ -/***/ (function(module) { - -"use strict"; -module.exports = window["wp"]["apiFetch"]; - -/***/ }), - -/***/ "@wordpress/data": -/*!******************************!*\ - !*** external ["wp","data"] ***! - \******************************/ -/***/ (function(module) { - -"use strict"; -module.exports = window["wp"]["data"]; - -/***/ }), - -/***/ "@wordpress/dom-ready": -/*!**********************************!*\ - !*** external ["wp","domReady"] ***! - \**********************************/ -/***/ (function(module) { - -"use strict"; -module.exports = window["wp"]["domReady"]; - -/***/ }), - -/***/ "@wordpress/element": -/*!*********************************!*\ - !*** external ["wp","element"] ***! - \*********************************/ -/***/ (function(module) { - -"use strict"; -module.exports = window["wp"]["element"]; - -/***/ }), - -/***/ "@wordpress/i18n": -/*!******************************!*\ - !*** external ["wp","i18n"] ***! - \******************************/ -/***/ (function(module) { - -"use strict"; -module.exports = window["wp"]["i18n"]; - -/***/ }), - -/***/ "./node_modules/marked/lib/marked.esm.js": -/*!***********************************************!*\ - !*** ./node_modules/marked/lib/marked.esm.js ***! - \***********************************************/ -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Hooks: function() { return /* binding */ _Hooks; }, -/* harmony export */ Lexer: function() { return /* binding */ _Lexer; }, -/* harmony export */ Marked: function() { return /* binding */ Marked; }, -/* harmony export */ Parser: function() { return /* binding */ _Parser; }, -/* harmony export */ Renderer: function() { return /* binding */ _Renderer; }, -/* harmony export */ TextRenderer: function() { return /* binding */ _TextRenderer; }, -/* harmony export */ Tokenizer: function() { return /* binding */ _Tokenizer; }, -/* harmony export */ defaults: function() { return /* binding */ _defaults; }, -/* harmony export */ getDefaults: function() { return /* binding */ _getDefaults; }, -/* harmony export */ lexer: function() { return /* binding */ lexer; }, -/* harmony export */ marked: function() { return /* binding */ marked; }, -/* harmony export */ options: function() { return /* binding */ options; }, -/* harmony export */ parse: function() { return /* binding */ parse; }, -/* harmony export */ parseInline: function() { return /* binding */ parseInline; }, -/* harmony export */ parser: function() { return /* binding */ parser; }, -/* harmony export */ setOptions: function() { return /* binding */ setOptions; }, -/* harmony export */ use: function() { return /* binding */ use; }, -/* harmony export */ walkTokens: function() { return /* binding */ walkTokens; } -/* harmony export */ }); -/** - * marked v14.0.0 - a markdown parser - * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed) - * https://github.com/markedjs/marked - */ - -/** - * DO NOT EDIT THIS FILE - * The code in this file is generated from files in ./src/ - */ - -/** - * Gets the original marked default options. - */ -function _getDefaults() { - return { - async: false, - breaks: false, - extensions: null, - gfm: true, - hooks: null, - pedantic: false, - renderer: null, - silent: false, - tokenizer: null, - walkTokens: null, - }; -} -let _defaults = _getDefaults(); -function changeDefaults(newDefaults) { - _defaults = newDefaults; -} - -/** - * Helpers - */ -const escapeTest = /[&<>"']/; -const escapeReplace = new RegExp(escapeTest.source, 'g'); -const escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/; -const escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g'); -const escapeReplacements = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', -}; -const getEscapeReplacement = (ch) => escapeReplacements[ch]; -function escape$1(html, encode) { - if (encode) { - if (escapeTest.test(html)) { - return html.replace(escapeReplace, getEscapeReplacement); - } - } - else { - if (escapeTestNoEncode.test(html)) { - return html.replace(escapeReplaceNoEncode, getEscapeReplacement); - } - } - return html; -} -const caret = /(^|[^\[])\^/g; -function edit(regex, opt) { - let source = typeof regex === 'string' ? regex : regex.source; - opt = opt || ''; - const obj = { - replace: (name, val) => { - let valSource = typeof val === 'string' ? val : val.source; - valSource = valSource.replace(caret, '$1'); - source = source.replace(name, valSource); - return obj; - }, - getRegex: () => { - return new RegExp(source, opt); - }, - }; - return obj; -} -function cleanUrl(href) { - try { - href = encodeURI(href).replace(/%25/g, '%'); - } - catch { - return null; - } - return href; -} -const noopTest = { exec: () => null }; -function splitCells(tableRow, count) { - // ensure that every cell-delimiting pipe has a space - // before it to distinguish it from an escaped pipe - const row = tableRow.replace(/\|/g, (match, offset, str) => { - let escaped = false; - let curr = offset; - while (--curr >= 0 && str[curr] === '\\') - escaped = !escaped; - if (escaped) { - // odd number of slashes means | is escaped - // so we leave it alone - return '|'; - } - else { - // add space before unescaped | - return ' |'; - } - }), cells = row.split(/ \|/); - let i = 0; - // First/last cell in a row cannot be empty if it has no leading/trailing pipe - if (!cells[0].trim()) { - cells.shift(); - } - if (cells.length > 0 && !cells[cells.length - 1].trim()) { - cells.pop(); - } - if (count) { - if (cells.length > count) { - cells.splice(count); - } - else { - while (cells.length < count) - cells.push(''); - } - } - for (; i < cells.length; i++) { - // leading or trailing whitespace is ignored per the gfm spec - cells[i] = cells[i].trim().replace(/\\\|/g, '|'); - } - return cells; -} -/** - * Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). - * /c*$/ is vulnerable to REDOS. - * - * @param str - * @param c - * @param invert Remove suffix of non-c chars instead. Default falsey. - */ -function rtrim(str, c, invert) { - const l = str.length; - if (l === 0) { - return ''; - } - // Length of suffix matching the invert condition. - let suffLen = 0; - // Step left until we fail to match the invert condition. - while (suffLen < l) { - const currChar = str.charAt(l - suffLen - 1); - if (currChar === c && !invert) { - suffLen++; - } - else if (currChar !== c && invert) { - suffLen++; - } - else { - break; - } - } - return str.slice(0, l - suffLen); -} -function findClosingBracket(str, b) { - if (str.indexOf(b[1]) === -1) { - return -1; - } - let level = 0; - for (let i = 0; i < str.length; i++) { - if (str[i] === '\\') { - i++; - } - else if (str[i] === b[0]) { - level++; - } - else if (str[i] === b[1]) { - level--; - if (level < 0) { - return i; - } - } - } - return -1; -} - -function outputLink(cap, link, raw, lexer) { - const href = link.href; - const title = link.title ? escape$1(link.title) : null; - const text = cap[1].replace(/\\([\[\]])/g, '$1'); - if (cap[0].charAt(0) !== '!') { - lexer.state.inLink = true; - const token = { - type: 'link', - raw, - href, - title, - text, - tokens: lexer.inlineTokens(text), - }; - lexer.state.inLink = false; - return token; - } - return { - type: 'image', - raw, - href, - title, - text: escape$1(text), - }; -} -function indentCodeCompensation(raw, text) { - const matchIndentToCode = raw.match(/^(\s+)(?:```)/); - if (matchIndentToCode === null) { - return text; - } - const indentToCode = matchIndentToCode[1]; - return text - .split('\n') - .map(node => { - const matchIndentInNode = node.match(/^\s+/); - if (matchIndentInNode === null) { - return node; - } - const [indentInNode] = matchIndentInNode; - if (indentInNode.length >= indentToCode.length) { - return node.slice(indentToCode.length); - } - return node; - }) - .join('\n'); -} -/** - * Tokenizer - */ -class _Tokenizer { - options; - rules; // set by the lexer - lexer; // set by the lexer - constructor(options) { - this.options = options || _defaults; - } - space(src) { - const cap = this.rules.block.newline.exec(src); - if (cap && cap[0].length > 0) { - return { - type: 'space', - raw: cap[0], - }; - } - } - code(src) { - const cap = this.rules.block.code.exec(src); - if (cap) { - const text = cap[0].replace(/^ {1,4}/gm, ''); - return { - type: 'code', - raw: cap[0], - codeBlockStyle: 'indented', - text: !this.options.pedantic - ? rtrim(text, '\n') - : text, - }; - } - } - fences(src) { - const cap = this.rules.block.fences.exec(src); - if (cap) { - const raw = cap[0]; - const text = indentCodeCompensation(raw, cap[3] || ''); - return { - type: 'code', - raw, - lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2], - text, - }; - } - } - heading(src) { - const cap = this.rules.block.heading.exec(src); - if (cap) { - let text = cap[2].trim(); - // remove trailing #s - if (/#$/.test(text)) { - const trimmed = rtrim(text, '#'); - if (this.options.pedantic) { - text = trimmed.trim(); - } - else if (!trimmed || / $/.test(trimmed)) { - // CommonMark requires space before trailing #s - text = trimmed.trim(); - } - } - return { - type: 'heading', - raw: cap[0], - depth: cap[1].length, - text, - tokens: this.lexer.inline(text), - }; - } - } - hr(src) { - const cap = this.rules.block.hr.exec(src); - if (cap) { - return { - type: 'hr', - raw: rtrim(cap[0], '\n'), - }; - } - } - blockquote(src) { - const cap = this.rules.block.blockquote.exec(src); - if (cap) { - let lines = rtrim(cap[0], '\n').split('\n'); - let raw = ''; - let text = ''; - const tokens = []; - while (lines.length > 0) { - let inBlockquote = false; - const currentLines = []; - let i; - for (i = 0; i < lines.length; i++) { - // get lines up to a continuation - if (/^ {0,3}>/.test(lines[i])) { - currentLines.push(lines[i]); - inBlockquote = true; - } - else if (!inBlockquote) { - currentLines.push(lines[i]); - } - else { - break; - } - } - lines = lines.slice(i); - const currentRaw = currentLines.join('\n'); - const currentText = currentRaw - // precede setext continuation with 4 spaces so it isn't a setext - .replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, '\n $1') - .replace(/^ {0,3}>[ \t]?/gm, ''); - raw = raw ? `${raw}\n${currentRaw}` : currentRaw; - text = text ? `${text}\n${currentText}` : currentText; - // parse blockquote lines as top level tokens - // merge paragraphs if this is a continuation - const top = this.lexer.state.top; - this.lexer.state.top = true; - this.lexer.blockTokens(currentText, tokens, true); - this.lexer.state.top = top; - // if there is no continuation then we are done - if (lines.length === 0) { - break; - } - const lastToken = tokens[tokens.length - 1]; - if (lastToken?.type === 'code') { - // blockquote continuation cannot be preceded by a code block - break; - } - else if (lastToken?.type === 'blockquote') { - // include continuation in nested blockquote - const oldToken = lastToken; - const newText = oldToken.raw + '\n' + lines.join('\n'); - const newToken = this.blockquote(newText); - tokens[tokens.length - 1] = newToken; - raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw; - text = text.substring(0, text.length - oldToken.text.length) + newToken.text; - break; - } - else if (lastToken?.type === 'list') { - // include continuation in nested list - const oldToken = lastToken; - const newText = oldToken.raw + '\n' + lines.join('\n'); - const newToken = this.list(newText); - tokens[tokens.length - 1] = newToken; - raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw; - text = text.substring(0, text.length - oldToken.raw.length) + newToken.raw; - lines = newText.substring(tokens[tokens.length - 1].raw.length).split('\n'); - continue; - } - } - return { - type: 'blockquote', - raw, - tokens, - text, - }; - } - } - list(src) { - let cap = this.rules.block.list.exec(src); - if (cap) { - let bull = cap[1].trim(); - const isordered = bull.length > 1; - const list = { - type: 'list', - raw: '', - ordered: isordered, - start: isordered ? +bull.slice(0, -1) : '', - loose: false, - items: [], - }; - bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`; - if (this.options.pedantic) { - bull = isordered ? bull : '[*+-]'; - } - // Get next list item - const itemRegex = new RegExp(`^( {0,3}${bull})((?:[\t ][^\\n]*)?(?:\\n|$))`); - let endsWithBlankLine = false; - // Check if current bullet point can start a new List Item - while (src) { - let endEarly = false; - let raw = ''; - let itemContents = ''; - if (!(cap = itemRegex.exec(src))) { - break; - } - if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?) - break; - } - raw = cap[0]; - src = src.substring(raw.length); - let line = cap[2].split('\n', 1)[0].replace(/^\t+/, (t) => ' '.repeat(3 * t.length)); - let nextLine = src.split('\n', 1)[0]; - let blankLine = !line.trim(); - let indent = 0; - if (this.options.pedantic) { - indent = 2; - itemContents = line.trimStart(); - } - else if (blankLine) { - indent = cap[1].length + 1; - } - else { - indent = cap[2].search(/[^ ]/); // Find first non-space char - indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent - itemContents = line.slice(indent); - indent += cap[1].length; - } - if (blankLine && /^ *$/.test(nextLine)) { // Items begin with at most one blank line - raw += nextLine + '\n'; - src = src.substring(nextLine.length + 1); - endEarly = true; - } - if (!endEarly) { - const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`); - const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`); - const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`); - const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`); - // Check if following lines should be included in List Item - while (src) { - const rawLine = src.split('\n', 1)[0]; - nextLine = rawLine; - // Re-align to follow commonmark nesting rules - if (this.options.pedantic) { - nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' '); - } - // End list item if found code fences - if (fencesBeginRegex.test(nextLine)) { - break; - } - // End list item if found start of new heading - if (headingBeginRegex.test(nextLine)) { - break; - } - // End list item if found start of new bullet - if (nextBulletRegex.test(nextLine)) { - break; - } - // Horizontal rule found - if (hrRegex.test(src)) { - break; - } - if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) { // Dedent if possible - itemContents += '\n' + nextLine.slice(indent); - } - else { - // not enough indentation - if (blankLine) { - break; - } - // paragraph continuation unless last line was a different block level element - if (line.search(/[^ ]/) >= 4) { // indented code block - break; - } - if (fencesBeginRegex.test(line)) { - break; - } - if (headingBeginRegex.test(line)) { - break; - } - if (hrRegex.test(line)) { - break; - } - itemContents += '\n' + nextLine; - } - if (!blankLine && !nextLine.trim()) { // Check if current line is blank - blankLine = true; - } - raw += rawLine + '\n'; - src = src.substring(rawLine.length + 1); - line = nextLine.slice(indent); - } - } - if (!list.loose) { - // If the previous item ended with a blank line, the list is loose - if (endsWithBlankLine) { - list.loose = true; - } - else if (/\n *\n *$/.test(raw)) { - endsWithBlankLine = true; - } - } - let istask = null; - let ischecked; - // Check for task list items - if (this.options.gfm) { - istask = /^\[[ xX]\] /.exec(itemContents); - if (istask) { - ischecked = istask[0] !== '[ ] '; - itemContents = itemContents.replace(/^\[[ xX]\] +/, ''); - } - } - list.items.push({ - type: 'list_item', - raw, - task: !!istask, - checked: ischecked, - loose: false, - text: itemContents, - tokens: [], - }); - list.raw += raw; - } - // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic - list.items[list.items.length - 1].raw = list.items[list.items.length - 1].raw.trimEnd(); - list.items[list.items.length - 1].text = list.items[list.items.length - 1].text.trimEnd(); - list.raw = list.raw.trimEnd(); - // Item child tokens handled here at end because we needed to have the final item to trim it first - for (let i = 0; i < list.items.length; i++) { - this.lexer.state.top = false; - list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []); - if (!list.loose) { - // Check if list should be loose - const spacers = list.items[i].tokens.filter(t => t.type === 'space'); - const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => /\n.*\n/.test(t.raw)); - list.loose = hasMultipleLineBreaks; - } - } - // Set all items to loose if list is loose - if (list.loose) { - for (let i = 0; i < list.items.length; i++) { - list.items[i].loose = true; - } - } - return list; - } - } - html(src) { - const cap = this.rules.block.html.exec(src); - if (cap) { - const token = { - type: 'html', - block: true, - raw: cap[0], - pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style', - text: cap[0], - }; - return token; - } - } - def(src) { - const cap = this.rules.block.def.exec(src); - if (cap) { - const tag = cap[1].toLowerCase().replace(/\s+/g, ' '); - const href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline.anyPunctuation, '$1') : ''; - const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3]; - return { - type: 'def', - tag, - raw: cap[0], - href, - title, - }; - } - } - table(src) { - const cap = this.rules.block.table.exec(src); - if (!cap) { - return; - } - if (!/[:|]/.test(cap[2])) { - // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading - return; - } - const headers = splitCells(cap[1]); - const aligns = cap[2].replace(/^\||\| *$/g, '').split('|'); - const rows = cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : []; - const item = { - type: 'table', - raw: cap[0], - header: [], - align: [], - rows: [], - }; - if (headers.length !== aligns.length) { - // header and align columns must be equal, rows can be different. - return; - } - for (const align of aligns) { - if (/^ *-+: *$/.test(align)) { - item.align.push('right'); - } - else if (/^ *:-+: *$/.test(align)) { - item.align.push('center'); - } - else if (/^ *:-+ *$/.test(align)) { - item.align.push('left'); - } - else { - item.align.push(null); - } - } - for (let i = 0; i < headers.length; i++) { - item.header.push({ - text: headers[i], - tokens: this.lexer.inline(headers[i]), - header: true, - align: item.align[i], - }); - } - for (const row of rows) { - item.rows.push(splitCells(row, item.header.length).map((cell, i) => { - return { - text: cell, - tokens: this.lexer.inline(cell), - header: false, - align: item.align[i], - }; - })); - } - return item; - } - lheading(src) { - const cap = this.rules.block.lheading.exec(src); - if (cap) { - return { - type: 'heading', - raw: cap[0], - depth: cap[2].charAt(0) === '=' ? 1 : 2, - text: cap[1], - tokens: this.lexer.inline(cap[1]), - }; - } - } - paragraph(src) { - const cap = this.rules.block.paragraph.exec(src); - if (cap) { - const text = cap[1].charAt(cap[1].length - 1) === '\n' - ? cap[1].slice(0, -1) - : cap[1]; - return { - type: 'paragraph', - raw: cap[0], - text, - tokens: this.lexer.inline(text), - }; - } - } - text(src) { - const cap = this.rules.block.text.exec(src); - if (cap) { - return { - type: 'text', - raw: cap[0], - text: cap[0], - tokens: this.lexer.inline(cap[0]), - }; - } - } - escape(src) { - const cap = this.rules.inline.escape.exec(src); - if (cap) { - return { - type: 'escape', - raw: cap[0], - text: escape$1(cap[1]), - }; - } - } - tag(src) { - const cap = this.rules.inline.tag.exec(src); - if (cap) { - if (!this.lexer.state.inLink && /^/i.test(cap[0])) { - this.lexer.state.inLink = false; - } - if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.lexer.state.inRawBlock = true; - } - else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.lexer.state.inRawBlock = false; - } - return { - type: 'html', - raw: cap[0], - inLink: this.lexer.state.inLink, - inRawBlock: this.lexer.state.inRawBlock, - block: false, - text: cap[0], - }; - } - } - link(src) { - const cap = this.rules.inline.link.exec(src); - if (cap) { - const trimmedUrl = cap[2].trim(); - if (!this.options.pedantic && /^$/.test(trimmedUrl))) { - return; - } - // ending angle bracket cannot be escaped - const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\'); - if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) { - return; - } - } - else { - // find closing parenthesis - const lastParenIndex = findClosingBracket(cap[2], '()'); - if (lastParenIndex > -1) { - const start = cap[0].indexOf('!') === 0 ? 5 : 4; - const linkLen = start + cap[1].length + lastParenIndex; - cap[2] = cap[2].substring(0, lastParenIndex); - cap[0] = cap[0].substring(0, linkLen).trim(); - cap[3] = ''; - } - } - let href = cap[2]; - let title = ''; - if (this.options.pedantic) { - // split pedantic href and title - const link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); - if (link) { - href = link[1]; - title = link[3]; - } - } - else { - title = cap[3] ? cap[3].slice(1, -1) : ''; - } - href = href.trim(); - if (/^$/.test(trimmedUrl))) { - // pedantic allows starting angle bracket without ending angle bracket - href = href.slice(1); - } - else { - href = href.slice(1, -1); - } - } - return outputLink(cap, { - href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href, - title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title, - }, cap[0], this.lexer); - } - } - reflink(src, links) { - let cap; - if ((cap = this.rules.inline.reflink.exec(src)) - || (cap = this.rules.inline.nolink.exec(src))) { - const linkString = (cap[2] || cap[1]).replace(/\s+/g, ' '); - const link = links[linkString.toLowerCase()]; - if (!link) { - const text = cap[0].charAt(0); - return { - type: 'text', - raw: text, - text, - }; - } - return outputLink(cap, link, cap[0], this.lexer); - } - } - emStrong(src, maskedSrc, prevChar = '') { - let match = this.rules.inline.emStrongLDelim.exec(src); - if (!match) - return; - // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well - if (match[3] && prevChar.match(/[\p{L}\p{N}]/u)) - return; - const nextChar = match[1] || match[2] || ''; - if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) { - // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below) - const lLength = [...match[0]].length - 1; - let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0; - const endReg = match[0][0] === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd; - endReg.lastIndex = 0; - // Clip maskedSrc to same section of string as src (move to lexer?) - maskedSrc = maskedSrc.slice(-1 * src.length + lLength); - while ((match = endReg.exec(maskedSrc)) != null) { - rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6]; - if (!rDelim) - continue; // skip single * in __abc*abc__ - rLength = [...rDelim].length; - if (match[3] || match[4]) { // found another Left Delim - delimTotal += rLength; - continue; - } - else if (match[5] || match[6]) { // either Left or Right Delim - if (lLength % 3 && !((lLength + rLength) % 3)) { - midDelimTotal += rLength; - continue; // CommonMark Emphasis Rules 9-10 - } - } - delimTotal -= rLength; - if (delimTotal > 0) - continue; // Haven't found enough closing delimiters - // Remove extra characters. *a*** -> *a* - rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); - // char length can be >1 for unicode characters; - const lastCharLength = [...match[0]][0].length; - const raw = src.slice(0, lLength + match.index + lastCharLength + rLength); - // Create `em` if smallest delimiter has odd char count. *a*** - if (Math.min(lLength, rLength) % 2) { - const text = raw.slice(1, -1); - return { - type: 'em', - raw, - text, - tokens: this.lexer.inlineTokens(text), - }; - } - // Create 'strong' if smallest delimiter has even char count. **a*** - const text = raw.slice(2, -2); - return { - type: 'strong', - raw, - text, - tokens: this.lexer.inlineTokens(text), - }; - } - } - } - codespan(src) { - const cap = this.rules.inline.code.exec(src); - if (cap) { - let text = cap[2].replace(/\n/g, ' '); - const hasNonSpaceChars = /[^ ]/.test(text); - const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text); - if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { - text = text.substring(1, text.length - 1); - } - text = escape$1(text, true); - return { - type: 'codespan', - raw: cap[0], - text, - }; - } - } - br(src) { - const cap = this.rules.inline.br.exec(src); - if (cap) { - return { - type: 'br', - raw: cap[0], - }; - } - } - del(src) { - const cap = this.rules.inline.del.exec(src); - if (cap) { - return { - type: 'del', - raw: cap[0], - text: cap[2], - tokens: this.lexer.inlineTokens(cap[2]), - }; - } - } - autolink(src) { - const cap = this.rules.inline.autolink.exec(src); - if (cap) { - let text, href; - if (cap[2] === '@') { - text = escape$1(cap[1]); - href = 'mailto:' + text; - } - else { - text = escape$1(cap[1]); - href = text; - } - return { - type: 'link', - raw: cap[0], - text, - href, - tokens: [ - { - type: 'text', - raw: text, - text, - }, - ], - }; - } - } - url(src) { - let cap; - if (cap = this.rules.inline.url.exec(src)) { - let text, href; - if (cap[2] === '@') { - text = escape$1(cap[0]); - href = 'mailto:' + text; - } - else { - // do extended autolink path validation - let prevCapZero; - do { - prevCapZero = cap[0]; - cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? ''; - } while (prevCapZero !== cap[0]); - text = escape$1(cap[0]); - if (cap[1] === 'www.') { - href = 'http://' + cap[0]; - } - else { - href = cap[0]; - } - } - return { - type: 'link', - raw: cap[0], - text, - href, - tokens: [ - { - type: 'text', - raw: text, - text, - }, - ], - }; - } - } - inlineText(src) { - const cap = this.rules.inline.text.exec(src); - if (cap) { - let text; - if (this.lexer.state.inRawBlock) { - text = cap[0]; - } - else { - text = escape$1(cap[0]); - } - return { - type: 'text', - raw: cap[0], - text, - }; - } - } -} - -/** - * Block-Level Grammar - */ -const newline = /^(?: *(?:\n|$))+/; -const blockCode = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/; -const fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/; -const hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/; -const heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/; -const bullet = /(?:[*+-]|\d{1,9}[.)])/; -const lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/) - .replace(/bull/g, bullet) // lists can interrupt - .replace(/blockCode/g, / {4}/) // indented code blocks can interrupt - .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt - .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt - .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt - .replace(/html/g, / {0,3}<[^\n>]+>\n/) // block html can interrupt - .getRegex(); -const _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/; -const blockText = /^[^\n]+/; -const _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/; -const def = edit(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/) - .replace('label', _blockLabel) - .replace('title', /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/) - .getRegex(); -const list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/) - .replace(/bull/g, bullet) - .getRegex(); -const _tag = 'address|article|aside|base|basefont|blockquote|body|caption' - + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' - + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' - + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' - + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title' - + '|tr|track|ul'; -const _comment = /|$))/; -const html = edit('^ {0,3}(?:' // optional indentation - + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) - + '|comment[^\\n]*(\\n+|$)' // (2) - + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3) - + '|\\n*|$)' // (4) - + '|\\n*|$)' // (5) - + '|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6) - + '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag - + '|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag - + ')', 'i') - .replace('comment', _comment) - .replace('tag', _tag) - .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) - .getRegex(); -const paragraph = edit(_paragraph) - .replace('hr', hr) - .replace('heading', ' {0,3}#{1,6}(?:\\s|$)') - .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs - .replace('|table', '') - .replace('blockquote', ' {0,3}>') - .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') - .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|textarea|!--)') - .replace('tag', _tag) // pars can be interrupted by type (6) html blocks - .getRegex(); -const blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/) - .replace('paragraph', paragraph) - .getRegex(); -/** - * Normal Block Grammar - */ -const blockNormal = { - blockquote, - code: blockCode, - def, - fences, - heading, - hr, - html, - lheading, - list, - newline, - paragraph, - table: noopTest, - text: blockText, -}; -/** - * GFM Block Grammar - */ -const gfmTable = edit('^ *([^\\n ].*)\\n' // Header - + ' {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)' // Align - + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)') // Cells - .replace('hr', hr) - .replace('heading', ' {0,3}#{1,6}(?:\\s|$)') - .replace('blockquote', ' {0,3}>') - .replace('code', ' {4}[^\\n]') - .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') - .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|textarea|!--)') - .replace('tag', _tag) // tables can be interrupted by type (6) html blocks - .getRegex(); -const blockGfm = { - ...blockNormal, - table: gfmTable, - paragraph: edit(_paragraph) - .replace('hr', hr) - .replace('heading', ' {0,3}#{1,6}(?:\\s|$)') - .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs - .replace('table', gfmTable) // interrupt paragraphs with table - .replace('blockquote', ' {0,3}>') - .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') - .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|textarea|!--)') - .replace('tag', _tag) // pars can be interrupted by type (6) html blocks - .getRegex(), -}; -/** - * Pedantic grammar (original John Gruber's loose markdown specification) - */ -const blockPedantic = { - ...blockNormal, - html: edit('^ *(?:comment *(?:\\n|\\s*$)' - + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag - + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') - .replace('comment', _comment) - .replace(/tag/g, '(?!(?:' - + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' - + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' - + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b') - .getRegex(), - def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, - heading: /^(#{1,6})(.*)(?:\n+|$)/, - fences: noopTest, // fences not supported - lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - paragraph: edit(_paragraph) - .replace('hr', hr) - .replace('heading', ' *#{1,6} *[^\n]') - .replace('lheading', lheading) - .replace('|table', '') - .replace('blockquote', ' {0,3}>') - .replace('|fences', '') - .replace('|list', '') - .replace('|html', '') - .replace('|tag', '') - .getRegex(), -}; -/** - * Inline-Level Grammar - */ -const escape = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/; -const inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/; -const br = /^( {2,}|\\)\n(?!\s*$)/; -const inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\ -const blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g; -const emStrongLDelim = edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, 'u') - .replace(/punct/g, _punctuation) - .getRegex(); -const emStrongRDelimAst = edit('^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)' // Skip orphan inside strong - + '|[^*]+(?=[^*])' // Consume to delim - + '|(?!\\*)[punct](\\*+)(?=[\\s]|$)' // (1) #*** can only be a Right Delimiter - + '|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)' // (2) a***#, a*** can only be a Right Delimiter - + '|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])' // (3) #***a, ***a can only be Left Delimiter - + '|[\\s](\\*+)(?!\\*)(?=[punct])' // (4) ***# can only be Left Delimiter - + '|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])' // (5) #***# can be either Left or Right Delimiter - + '|[^punct\\s](\\*+)(?=[^punct\\s])', 'gu') // (6) a***a can be either Left or Right Delimiter - .replace(/punct/g, _punctuation) - .getRegex(); -// (6) Not allowed for _ -const emStrongRDelimUnd = edit('^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)' // Skip orphan inside strong - + '|[^_]+(?=[^_])' // Consume to delim - + '|(?!_)[punct](_+)(?=[\\s]|$)' // (1) #___ can only be a Right Delimiter - + '|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)' // (2) a___#, a___ can only be a Right Delimiter - + '|(?!_)[punct\\s](_+)(?=[^punct\\s])' // (3) #___a, ___a can only be Left Delimiter - + '|[\\s](_+)(?!_)(?=[punct])' // (4) ___# can only be Left Delimiter - + '|(?!_)[punct](_+)(?!_)(?=[punct])', 'gu') // (5) #___# can be either Left or Right Delimiter - .replace(/punct/g, _punctuation) - .getRegex(); -const anyPunctuation = edit(/\\([punct])/, 'gu') - .replace(/punct/g, _punctuation) - .getRegex(); -const autolink = edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/) - .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/) - .replace('email', /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/) - .getRegex(); -const _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex(); -const tag = edit('^comment' - + '|^' // self-closing tag - + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag - + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. - + '|^' // declaration, e.g. - + '|^') // CDATA section - .replace('comment', _inlineComment) - .replace('attribute', /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/) - .getRegex(); -const _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/; -const link = edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/) - .replace('label', _inlineLabel) - .replace('href', /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/) - .replace('title', /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/) - .getRegex(); -const reflink = edit(/^!?\[(label)\]\[(ref)\]/) - .replace('label', _inlineLabel) - .replace('ref', _blockLabel) - .getRegex(); -const nolink = edit(/^!?\[(ref)\](?:\[\])?/) - .replace('ref', _blockLabel) - .getRegex(); -const reflinkSearch = edit('reflink|nolink(?!\\()', 'g') - .replace('reflink', reflink) - .replace('nolink', nolink) - .getRegex(); -/** - * Normal Inline Grammar - */ -const inlineNormal = { - _backpedal: noopTest, // only used for GFM url - anyPunctuation, - autolink, - blockSkip, - br, - code: inlineCode, - del: noopTest, - emStrongLDelim, - emStrongRDelimAst, - emStrongRDelimUnd, - escape, - link, - nolink, - punctuation, - reflink, - reflinkSearch, - tag, - text: inlineText, - url: noopTest, -}; -/** - * Pedantic Inline Grammar - */ -const inlinePedantic = { - ...inlineNormal, - link: edit(/^!?\[(label)\]\((.*?)\)/) - .replace('label', _inlineLabel) - .getRegex(), - reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) - .replace('label', _inlineLabel) - .getRegex(), -}; -/** - * GFM Inline Grammar - */ -const inlineGfm = { - ...inlineNormal, - escape: edit(escape).replace('])', '~|])').getRegex(), - url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, 'i') - .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/) - .getRegex(), - _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, - del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/, - text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\ { - return leading + ' '.repeat(tabs.length); - }); - } - let token; - let lastToken; - let cutSrc; - while (src) { - if (this.options.extensions - && this.options.extensions.block - && this.options.extensions.block.some((extTokenizer) => { - if (token = extTokenizer.call({ lexer: this }, src, tokens)) { - src = src.substring(token.raw.length); - tokens.push(token); - return true; - } - return false; - })) { - continue; - } - // newline - if (token = this.tokenizer.space(src)) { - src = src.substring(token.raw.length); - if (token.raw.length === 1 && tokens.length > 0) { - // if there's a single \n as a spacer, it's terminating the last line, - // so move it there so that we don't get unnecessary paragraph tags - tokens[tokens.length - 1].raw += '\n'; - } - else { - tokens.push(token); - } - continue; - } - // code - if (token = this.tokenizer.code(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - // An indented code block cannot interrupt a paragraph. - if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } - else { - tokens.push(token); - } - continue; - } - // fences - if (token = this.tokenizer.fences(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // heading - if (token = this.tokenizer.heading(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // hr - if (token = this.tokenizer.hr(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // blockquote - if (token = this.tokenizer.blockquote(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // list - if (token = this.tokenizer.list(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // html - if (token = this.tokenizer.html(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // def - if (token = this.tokenizer.def(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.raw; - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } - else if (!this.tokens.links[token.tag]) { - this.tokens.links[token.tag] = { - href: token.href, - title: token.title, - }; - } - continue; - } - // table (gfm) - if (token = this.tokenizer.table(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // lheading - if (token = this.tokenizer.lheading(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // top-level paragraph - // prevent paragraph consuming extensions by clipping 'src' to extension start - cutSrc = src; - if (this.options.extensions && this.options.extensions.startBlock) { - let startIndex = Infinity; - const tempSrc = src.slice(1); - let tempStart; - this.options.extensions.startBlock.forEach((getStartIndex) => { - tempStart = getStartIndex.call({ lexer: this }, tempSrc); - if (typeof tempStart === 'number' && tempStart >= 0) { - startIndex = Math.min(startIndex, tempStart); - } - }); - if (startIndex < Infinity && startIndex >= 0) { - cutSrc = src.substring(0, startIndex + 1); - } - } - if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) { - lastToken = tokens[tokens.length - 1]; - if (lastParagraphClipped && lastToken?.type === 'paragraph') { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue.pop(); - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } - else { - tokens.push(token); - } - lastParagraphClipped = (cutSrc.length !== src.length); - src = src.substring(token.raw.length); - continue; - } - // text - if (token = this.tokenizer.text(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && lastToken.type === 'text') { - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - this.inlineQueue.pop(); - this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; - } - else { - tokens.push(token); - } - continue; - } - if (src) { - const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); - if (this.options.silent) { - console.error(errMsg); - break; - } - else { - throw new Error(errMsg); - } - } - } - this.state.top = true; - return tokens; - } - inline(src, tokens = []) { - this.inlineQueue.push({ src, tokens }); - return tokens; - } - /** - * Lexing/Compiling - */ - inlineTokens(src, tokens = []) { - let token, lastToken, cutSrc; - // String with links masked to avoid interference with em and strong - let maskedSrc = src; - let match; - let keepPrevChar, prevChar; - // Mask out reflinks - if (this.tokens.links) { - const links = Object.keys(this.tokens.links); - if (links.length > 0) { - while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) { - if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex); - } - } - } - } - // Mask out other blocks - while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); - } - // Mask out escaped characters - while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) { - maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex); - } - while (src) { - if (!keepPrevChar) { - prevChar = ''; - } - keepPrevChar = false; - // extensions - if (this.options.extensions - && this.options.extensions.inline - && this.options.extensions.inline.some((extTokenizer) => { - if (token = extTokenizer.call({ lexer: this }, src, tokens)) { - src = src.substring(token.raw.length); - tokens.push(token); - return true; - } - return false; - })) { - continue; - } - // escape - if (token = this.tokenizer.escape(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // tag - if (token = this.tokenizer.tag(src)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && token.type === 'text' && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } - else { - tokens.push(token); - } - continue; - } - // link - if (token = this.tokenizer.link(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // reflink, nolink - if (token = this.tokenizer.reflink(src, this.tokens.links)) { - src = src.substring(token.raw.length); - lastToken = tokens[tokens.length - 1]; - if (lastToken && token.type === 'text' && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } - else { - tokens.push(token); - } - continue; - } - // em & strong - if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // code - if (token = this.tokenizer.codespan(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // br - if (token = this.tokenizer.br(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // del (gfm) - if (token = this.tokenizer.del(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // autolink - if (token = this.tokenizer.autolink(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // url (gfm) - if (!this.state.inLink && (token = this.tokenizer.url(src))) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } - // text - // prevent inlineText consuming extensions by clipping 'src' to extension start - cutSrc = src; - if (this.options.extensions && this.options.extensions.startInline) { - let startIndex = Infinity; - const tempSrc = src.slice(1); - let tempStart; - this.options.extensions.startInline.forEach((getStartIndex) => { - tempStart = getStartIndex.call({ lexer: this }, tempSrc); - if (typeof tempStart === 'number' && tempStart >= 0) { - startIndex = Math.min(startIndex, tempStart); - } - }); - if (startIndex < Infinity && startIndex >= 0) { - cutSrc = src.substring(0, startIndex + 1); - } - } - if (token = this.tokenizer.inlineText(cutSrc)) { - src = src.substring(token.raw.length); - if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started - prevChar = token.raw.slice(-1); - } - keepPrevChar = true; - lastToken = tokens[tokens.length - 1]; - if (lastToken && lastToken.type === 'text') { - lastToken.raw += token.raw; - lastToken.text += token.text; - } - else { - tokens.push(token); - } - continue; - } - if (src) { - const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); - if (this.options.silent) { - console.error(errMsg); - break; - } - else { - throw new Error(errMsg); - } - } - } - return tokens; - } -} - -/** - * Renderer - */ -class _Renderer { - options; - parser; // set by the parser - constructor(options) { - this.options = options || _defaults; - } - space(token) { - return ''; - } - code({ text, lang, escaped }) { - const langString = (lang || '').match(/^\S*/)?.[0]; - const code = text.replace(/\n$/, '') + '\n'; - if (!langString) { - return '

'
-                + (escaped ? code : escape$1(code, true))
-                + '
\n'; - } - return '
'
-            + (escaped ? code : escape$1(code, true))
-            + '
\n'; - } - blockquote({ tokens }) { - const body = this.parser.parse(tokens); - return `
\n${body}
\n`; - } - html({ text }) { - return text; - } - heading({ tokens, depth }) { - return `${this.parser.parseInline(tokens)}\n`; - } - hr(token) { - return '
\n'; - } - list(token) { - const ordered = token.ordered; - const start = token.start; - let body = ''; - for (let j = 0; j < token.items.length; j++) { - const item = token.items[j]; - body += this.listitem(item); - } - const type = ordered ? 'ol' : 'ul'; - const startAttr = (ordered && start !== 1) ? (' start="' + start + '"') : ''; - return '<' + type + startAttr + '>\n' + body + '\n'; - } - listitem(item) { - let itemBody = ''; - if (item.task) { - const checkbox = this.checkbox({ checked: !!item.checked }); - if (item.loose) { - if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') { - item.tokens[0].text = checkbox + ' ' + item.tokens[0].text; - if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') { - item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text; - } - } - else { - item.tokens.unshift({ - type: 'text', - raw: checkbox + ' ', - text: checkbox + ' ', - }); - } - } - else { - itemBody += checkbox + ' '; - } - } - itemBody += this.parser.parse(item.tokens, !!item.loose); - return `
  • ${itemBody}
  • \n`; - } - checkbox({ checked }) { - return ''; - } - paragraph({ tokens }) { - return `

    ${this.parser.parseInline(tokens)}

    \n`; - } - table(token) { - let header = ''; - // header - let cell = ''; - for (let j = 0; j < token.header.length; j++) { - cell += this.tablecell(token.header[j]); - } - header += this.tablerow({ text: cell }); - let body = ''; - for (let j = 0; j < token.rows.length; j++) { - const row = token.rows[j]; - cell = ''; - for (let k = 0; k < row.length; k++) { - cell += this.tablecell(row[k]); - } - body += this.tablerow({ text: cell }); - } - if (body) - body = `${body}`; - return '\n' - + '\n' - + header - + '\n' - + body - + '
    \n'; - } - tablerow({ text }) { - return `\n${text}\n`; - } - tablecell(token) { - const content = this.parser.parseInline(token.tokens); - const type = token.header ? 'th' : 'td'; - const tag = token.align - ? `<${type} align="${token.align}">` - : `<${type}>`; - return tag + content + `\n`; - } - /** - * span level renderer - */ - strong({ tokens }) { - return `${this.parser.parseInline(tokens)}`; - } - em({ tokens }) { - return `${this.parser.parseInline(tokens)}`; - } - codespan({ text }) { - return `${text}`; - } - br(token) { - return '
    '; - } - del({ tokens }) { - return `${this.parser.parseInline(tokens)}`; - } - link({ href, title, tokens }) { - const text = this.parser.parseInline(tokens); - const cleanHref = cleanUrl(href); - if (cleanHref === null) { - return text; - } - href = cleanHref; - let out = '
    '; - return out; - } - image({ href, title, text }) { - const cleanHref = cleanUrl(href); - if (cleanHref === null) { - return text; - } - href = cleanHref; - let out = `${text} { - const tokens = genericToken[childTokens].flat(Infinity); - values = values.concat(this.walkTokens(tokens, callback)); - }); - } - else if (genericToken.tokens) { - values = values.concat(this.walkTokens(genericToken.tokens, callback)); - } - } - } - } - return values; - } - use(...args) { - const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} }; - args.forEach((pack) => { - // copy options to new object - const opts = { ...pack }; - // set async to true if it was set to true before - opts.async = this.defaults.async || opts.async || false; - // ==-- Parse "addon" extensions --== // - if (pack.extensions) { - pack.extensions.forEach((ext) => { - if (!ext.name) { - throw new Error('extension name required'); - } - if ('renderer' in ext) { // Renderer extensions - const prevRenderer = extensions.renderers[ext.name]; - if (prevRenderer) { - // Replace extension with func to run new extension but fall back if false - extensions.renderers[ext.name] = function (...args) { - let ret = ext.renderer.apply(this, args); - if (ret === false) { - ret = prevRenderer.apply(this, args); - } - return ret; - }; - } - else { - extensions.renderers[ext.name] = ext.renderer; - } - } - if ('tokenizer' in ext) { // Tokenizer Extensions - if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) { - throw new Error("extension level must be 'block' or 'inline'"); - } - const extLevel = extensions[ext.level]; - if (extLevel) { - extLevel.unshift(ext.tokenizer); - } - else { - extensions[ext.level] = [ext.tokenizer]; - } - if (ext.start) { // Function to check for start of token - if (ext.level === 'block') { - if (extensions.startBlock) { - extensions.startBlock.push(ext.start); - } - else { - extensions.startBlock = [ext.start]; - } - } - else if (ext.level === 'inline') { - if (extensions.startInline) { - extensions.startInline.push(ext.start); - } - else { - extensions.startInline = [ext.start]; - } - } - } - } - if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens - extensions.childTokens[ext.name] = ext.childTokens; - } - }); - opts.extensions = extensions; - } - // ==-- Parse "overwrite" extensions --== // - if (pack.renderer) { - const renderer = this.defaults.renderer || new _Renderer(this.defaults); - for (const prop in pack.renderer) { - if (!(prop in renderer)) { - throw new Error(`renderer '${prop}' does not exist`); - } - if (['options', 'parser'].includes(prop)) { - // ignore options property - continue; - } - const rendererProp = prop; - const rendererFunc = pack.renderer[rendererProp]; - const prevRenderer = renderer[rendererProp]; - // Replace renderer with func to run extension, but fall back if false - renderer[rendererProp] = (...args) => { - let ret = rendererFunc.apply(renderer, args); - if (ret === false) { - ret = prevRenderer.apply(renderer, args); - } - return ret || ''; - }; - } - opts.renderer = renderer; - } - if (pack.tokenizer) { - const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults); - for (const prop in pack.tokenizer) { - if (!(prop in tokenizer)) { - throw new Error(`tokenizer '${prop}' does not exist`); - } - if (['options', 'rules', 'lexer'].includes(prop)) { - // ignore options, rules, and lexer properties - continue; - } - const tokenizerProp = prop; - const tokenizerFunc = pack.tokenizer[tokenizerProp]; - const prevTokenizer = tokenizer[tokenizerProp]; - // Replace tokenizer with func to run extension, but fall back if false - // @ts-expect-error cannot type tokenizer function dynamically - tokenizer[tokenizerProp] = (...args) => { - let ret = tokenizerFunc.apply(tokenizer, args); - if (ret === false) { - ret = prevTokenizer.apply(tokenizer, args); - } - return ret; - }; - } - opts.tokenizer = tokenizer; - } - // ==-- Parse Hooks extensions --== // - if (pack.hooks) { - const hooks = this.defaults.hooks || new _Hooks(); - for (const prop in pack.hooks) { - if (!(prop in hooks)) { - throw new Error(`hook '${prop}' does not exist`); - } - if (prop === 'options') { - // ignore options property - continue; - } - const hooksProp = prop; - const hooksFunc = pack.hooks[hooksProp]; - const prevHook = hooks[hooksProp]; - if (_Hooks.passThroughHooks.has(prop)) { - // @ts-expect-error cannot type hook function dynamically - hooks[hooksProp] = (arg) => { - if (this.defaults.async) { - return Promise.resolve(hooksFunc.call(hooks, arg)).then(ret => { - return prevHook.call(hooks, ret); - }); - } - const ret = hooksFunc.call(hooks, arg); - return prevHook.call(hooks, ret); - }; - } - else { - // @ts-expect-error cannot type hook function dynamically - hooks[hooksProp] = (...args) => { - let ret = hooksFunc.apply(hooks, args); - if (ret === false) { - ret = prevHook.apply(hooks, args); - } - return ret; - }; - } - } - opts.hooks = hooks; - } - // ==-- Parse WalkTokens extensions --== // - if (pack.walkTokens) { - const walkTokens = this.defaults.walkTokens; - const packWalktokens = pack.walkTokens; - opts.walkTokens = function (token) { - let values = []; - values.push(packWalktokens.call(this, token)); - if (walkTokens) { - values = values.concat(walkTokens.call(this, token)); - } - return values; - }; - } - this.defaults = { ...this.defaults, ...opts }; - }); - return this; - } - setOptions(opt) { - this.defaults = { ...this.defaults, ...opt }; - return this; - } - lexer(src, options) { - return _Lexer.lex(src, options ?? this.defaults); - } - parser(tokens, options) { - return _Parser.parse(tokens, options ?? this.defaults); - } - parseMarkdown(lexer, parser) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const parse = (src, options) => { - const origOpt = { ...options }; - const opt = { ...this.defaults, ...origOpt }; - const throwError = this.onError(!!opt.silent, !!opt.async); - // throw error if an extension set async to true but parse was called with async: false - if (this.defaults.async === true && origOpt.async === false) { - return throwError(new Error('marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.')); - } - // throw error in case of non string input - if (typeof src === 'undefined' || src === null) { - return throwError(new Error('marked(): input parameter is undefined or null')); - } - if (typeof src !== 'string') { - return throwError(new Error('marked(): input parameter is of type ' - + Object.prototype.toString.call(src) + ', string expected')); - } - if (opt.hooks) { - opt.hooks.options = opt; - } - if (opt.async) { - return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src) - .then(src => lexer(src, opt)) - .then(tokens => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens) - .then(tokens => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens) - .then(tokens => parser(tokens, opt)) - .then(html => opt.hooks ? opt.hooks.postprocess(html) : html) - .catch(throwError); - } - try { - if (opt.hooks) { - src = opt.hooks.preprocess(src); - } - let tokens = lexer(src, opt); - if (opt.hooks) { - tokens = opt.hooks.processAllTokens(tokens); - } - if (opt.walkTokens) { - this.walkTokens(tokens, opt.walkTokens); - } - let html = parser(tokens, opt); - if (opt.hooks) { - html = opt.hooks.postprocess(html); - } - return html; - } - catch (e) { - return throwError(e); - } - }; - return parse; - } - onError(silent, async) { - return (e) => { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if (silent) { - const msg = '

    An error occurred:

    '
    -                    + escape$1(e.message + '', true)
    -                    + '
    '; - if (async) { - return Promise.resolve(msg); - } - return msg; - } - if (async) { - return Promise.reject(e); - } - throw e; - }; - } -} - -const markedInstance = new Marked(); -function marked(src, opt) { - return markedInstance.parse(src, opt); -} -/** - * Sets the default options. - * - * @param options Hash of options - */ -marked.options = - marked.setOptions = function (options) { - markedInstance.setOptions(options); - marked.defaults = markedInstance.defaults; - changeDefaults(marked.defaults); - return marked; - }; -/** - * Gets the original marked default options. - */ -marked.getDefaults = _getDefaults; -marked.defaults = _defaults; -/** - * Use Extension - */ -marked.use = function (...args) { - markedInstance.use(...args); - marked.defaults = markedInstance.defaults; - changeDefaults(marked.defaults); - return marked; -}; -/** - * Run callback for every token - */ -marked.walkTokens = function (tokens, callback) { - return markedInstance.walkTokens(tokens, callback); -}; -/** - * Compiles markdown to HTML without enclosing `p` tag. - * - * @param src String of markdown source to be compiled - * @param options Hash of options - * @return String of compiled HTML - */ -marked.parseInline = markedInstance.parseInline; -/** - * Expose - */ -marked.Parser = _Parser; -marked.parser = _Parser.parse; -marked.Renderer = _Renderer; -marked.TextRenderer = _TextRenderer; -marked.Lexer = _Lexer; -marked.lexer = _Lexer.lex; -marked.Tokenizer = _Tokenizer; -marked.Hooks = _Hooks; -marked.parse = marked; -const options = marked.options; -const setOptions = marked.setOptions; -const use = marked.use; -const walkTokens = marked.walkTokens; -const parseInline = marked.parseInline; -const parse = marked; -const parser = _Parser.parse; -const lexer = _Lexer.lex; - - -//# sourceMappingURL=marked.esm.js.map - - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ !function() { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function() { return module['default']; } : -/******/ function() { return module; }; -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ !function() { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = function(exports, definition) { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ !function() { -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -/******/ }(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ !function() { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ }(); -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module is referenced by other modules so it can't be inlined -/******/ var __webpack_exports__ = __webpack_require__("./src/index.js"); -/******/ -/******/ })() -; -//# sourceMappingURL=index.js.map \ No newline at end of file +!function(){var e={666:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},i=l.iterator||"@@iterator",o=l.asyncIterator||"@@asyncIterator",a=l.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var l=t&&t.prototype instanceof k?t:k,i=Object.create(l.prototype),o=new L(r||[]);return s(i,"_invoke",{value:I(e,n,o)}),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var p="suspendedStart",d="suspendedYield",g="executing",f="completed",m={};function k(){}function w(){}function b(){}var x={};c(x,i,(function(){return this}));var y=Object.getPrototypeOf,E=y&&y(y(N([])));E&&E!==n&&r.call(E,i)&&(x=E);var v=b.prototype=k.prototype=Object.create(x);function A(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(s,l,i,o){var a=h(e[s],e,l);if("throw"!==a.type){var c=a.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,o)}),(function(e){n("throw",e,i,o)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,o)}))}o(a.arg)}var l;s(this,"_invoke",{value:function(e,r){function s(){return new t((function(t,s){n(e,r,t,s)}))}return l=l?l.then(s,s):s()}})}function I(e,n,r){var s=p;return function(l,i){if(s===g)throw new Error("Generator is already running");if(s===f){if("throw"===l)throw i;return{value:t,done:!0}}for(r.method=l,r.arg=i;;){var o=r.delegate;if(o){var a=R(o,r);if(a){if(a===m)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(s===p)throw s=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);s=g;var c=h(e,n,r);if("normal"===c.type){if(s=r.done?f:d,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(s=f,r.method="throw",r.arg=c.arg)}}}function R(e,n){var r=n.method,s=e.iterator[r];if(s===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,R(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var l=h(s,e.iterator,n.arg);if("throw"===l.type)return n.method="throw",n.arg=l.arg,n.delegate=null,m;var i=l.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function z(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function N(e){if(null!=e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,l=function n(){for(;++s=0;--l){var i=this.tryEntries[l],o=i.completion;if("root"===i.tryLoc)return s("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev=0;--n){var s=this.tryEntries[n];if(s.tryLoc<=this.prev&&r.call(s,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),z(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var s=r.arg;z(n)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){"use strict";n.d(r,{z:function(){return Tt}});var e={};n.r(e),n.d(e,{initializeNamespace:function(){return h},updateHiiveDebounceInstance:function(){return m},updateHiiveDebounceTime:function(){return f},updateHiiveEventsQueue:function(){return d},updateHiiveEventsQueueThreshold:function(){return g},updateHiiveUrls:function(){return p}});var t={};n.r(t),n.d(t,{getHiiveBatchUrl:function(){return x},getHiiveDebounce:function(){return y},getHiiveEventsQueue:function(){return k},getHiiveEventsQueueThreshold:function(){return w},getHiiveSingleUrl:function(){return b}});var s=window.React,l=(n(666),window.wp.element),i=window.wp.data,o=window.wp.domReady,a=n.n(o);class c{constructor(e,t,n,r){this.category=e,this.action=t,this.data=n,this.namespace=r}}const u={urls:{single:void 0,batch:void 0},queue:{events:[],threshold:100},debounce:{time:void 0,instance:void 0}};function h(e){return{type:"INITIALIZE_NAMESPACE",namespace:e}}function p(e,t){return{type:"UPDATE_HIIVE_URLS",urls:e,namespace:t}}function d(e,t){return{type:"UPDATE_HIIVE_EVENTS_QUEUE",events:e,namespace:t}}function g(e,t){return{type:"UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD",threshold:e,namespace:t}}function f(e,t){return{type:"UPDATE_HIIVE_DEBOUNCE_TIME",debounceTime:e,namespace:t}}function m(e,t){return{type:"UPDATE_HIIVE_DEBOUNCE_INSTANCE",instance:e,namespace:t}}function k(e,t){return e.hiive[t]?.queue.events}function w(e,t){return e.hiive[t]?.queue.threshold}function b(e,t){return e.hiive[t]?.urls.single}function x(e,t){return e.hiive[t]?.urls.batch}function y(e,t){return e.hiive[t]?.debounce}const E={reducer:(0,i.combineReducers)({hiive:(e,t)=>{switch(t.type){case"INITIALIZE_NAMESPACE":return{...e,[t.namespace]:u};case"UPDATE_HIIVE_URLS":return{...e,[t.namespace]:{...e[t.namespace],urls:{single:t.urls.single,batch:t.urls.batch}}};case"UPDATE_HIIVE_EVENTS_QUEUE":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:t.events,threshold:e[t.namespace].queue.threshold}}};case"UPDATE_HIIVE_EVENTS_QUEUE_THRESHOLD":return{...e,[t.namespace]:{...e[t.namespace],queue:{events:e[t.namespace].queue.events,threshold:t.threshold}}};case"UPDATE_HIIVE_DEBOUNCE_TIME":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:t.debounceTime,instance:e[t.namespace].debounce.instance}}};case"UPDATE_HIIVE_DEBOUNCE_INSTANCE":return{...e,[t.namespace]:{...e[t.namespace],debounce:{time:e[t.namespace].debounce.time,instance:t.instance}}}}return e}}),actions:e,selectors:t},v=(0,i.createReduxStore)("newfold/ui-analytics",E);(0,i.register)(v);var A=window.wp.apiFetch,S=n.n(A);const I=e=>!!window?.nfdUIAnalytics?.hiive&&e in window.nfdUIAnalytics.hiive,R=async e=>{if(!(e=>e instanceof c)(e)||!I(e.namespace))return!1;const t=e.namespace;delete e.namespace;const n=(0,i.select)(v).getHiiveSingleUrl(t);if(!n)return!1;try{await S()({url:n,method:"POST",data:e})}catch(e){return console.error(e),!1}};var T,z,L=window.wp.i18n;function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;tS()({path:U+"/search",method:"POST",data:{user_prompt:e,identifier:t,extra:n}}),getDefaultSearchResult:()=>S()({path:U+"/search/default",method:"POST"})};function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"algoliaResult",onClick:t},(0,s.createElement)("p",null,e),(0,s.createElement)("div",{className:"svg"},(0,s.createElement)(B,null)))),D=()=>{const e=window.NewfoldRuntime?.plugin?.brand||"wordpress";return e.includes("hostgator")&&window.NewfoldRuntime?.plugin?.region?e+"-"+window.NewfoldRuntime?.plugin?.region:e},F={updateHelpVisible:e=>{localStorage.setItem("helpVisible",e?"true":"false")},getHelpVisible:()=>"true"===localStorage.getItem("helpVisible"),persistResult:(e,t,n)=>{if(!e||""===e.trim())return;const r=F.getResultInfo(),s={searchInput:n,resultContent:e,postId:t};r.push(s),localStorage.setItem("helpResultContent",JSON.stringify(r))},persistSearchInput:e=>{localStorage.setItem("searchInput",e)},clear:()=>{localStorage.removeItem("helpResultContent"),localStorage.removeItem("helpPostId"),localStorage.removeItem("searchInput")},getResultInfo:()=>{const e=localStorage.getItem("helpResultContent");return e&&G(e)?JSON.parse(e):[]},getSearchInput:()=>localStorage.getItem("searchInput"),getFeatureFlag(e){return localStorage.getItem(e)},setFeatureFlag(e,t){localStorage.setItem(e,t)}},M=(e,t)=>{const n=new c("wonder_help",e,t,"wonder_help");R(n)},Z=(e,t=100,n=!1)=>{const[r,s]=(0,l.useState)(""),[i,o]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{if(!e)return s(""),void o(!1);if(n){const n=e.trim().split(" ").filter(Boolean);let r=0;s(n[0]),o(!1);const l=setInterval((()=>{re+" "+n[r]))):(clearInterval(l),o(!0))}),t);return()=>clearInterval(l)}s(e),o(!0)}),[e,t,n]),{displayedText:r,isComplete:i}},G=e=>{try{return JSON.parse(e),!0}catch(e){return!1}};var Y,W,J=({postId:e,source:t})=>{const[n,r]=(0,l.useState)(""),[i,o]=(0,l.useState)(!1),[a,c]=(0,l.useState)(!1),u=(0,l.useRef)(null),h=(0,l.useRef)(null);return(0,l.useEffect)((()=>{r(""),h.current.className="feedback-button no",u.current.className="feedback-button yes"}),[e]),(0,l.useEffect)((()=>{if((async()=>{"helpful"!==n&&"notHelpful"!==n||(((e,t)=>{S()({path:"nfd-help-center/v1/feedback",method:"POST",data:{post_id:e,status:t}})})(e,n),M("help_feedback_submitted",{label_key:"type",type:"helpful"===n?"positive":"negative",source:t,post_id:e,page:window.location.href.toString()}))})(),"helpful"===n||"notHelpful"===n){o(!0),c(!0);const e=setTimeout((()=>{c(!1)}),3e3);return()=>clearTimeout(e)}}),[n]),(0,s.createElement)("div",{className:"feedback-container"},!i&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"feedback-question"},(0,s.createElement)("p",null,(0,L.__)("Did this result help you?","wp-module-help-center"))),(0,s.createElement)("div",{className:"icon"},(0,s.createElement)("button",{ref:u,onClick:()=>{r("helpful")},className:"feedback-button yes"},(0,L.__)("Yes","wp-module-help-center")),(0,s.createElement)("button",{onClick:()=>{r("notHelpful")},ref:h,className:"feedback-button no"},(0,L.__)("No","wp-module-help-center")))),i&&a&&(0,s.createElement)("div",{className:"thanks-message"},(0,L.__)("Thanks for the feedback!","wp-module-help-center")))},X=()=>{const e=window?.nfdHelpCenter?.resourceLink||"#",t=(0,L.__)('You can try searching our
    Resource center. though to see if there’s a helpful article or video on that subject.',"wp-module-help-center").replace("{link}",e);return(0,s.createElement)("div",null,(0,s.createElement)("p",null,(0,L.__)("Sorry, I don’t have any information on that topic yet.","wp-module-help-center")),(0,s.createElement)("p",{dangerouslySetInnerHTML:{__html:t}}))};function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t"']/,ie=new RegExp(le.source,"g"),oe=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ae=new RegExp(oe.source,"g"),ce={"&":"&","<":"<",">":">",'"':""","'":"'"},ue=e=>ce[e];function he(e,t){if(t){if(le.test(e))return e.replace(ie,ue)}else if(oe.test(e))return e.replace(ae,ue);return e}const pe=/(^|[^\[])\^/g;function de(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(pe,"$1"),n=n.replace(e,s),r},getRegex:()=>new RegExp(n,t)};return r}function ge(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const fe={exec:()=>null};function me(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,s=t;for(;--s>=0&&"\\"===n[s];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ke(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=ke(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ke(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=ke(t[0],"\n").split("\n"),n="",r="";const s=[];for(;e.length>0;){let t=!1;const l=[];let i;for(i=0;i/.test(e[i]))l.push(e[i]),t=!0;else{if(t)break;l.push(e[i])}e=e.slice(i);const o=l.join("\n"),a=o.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");n=n?`${n}\n${o}`:o,r=r?`${r}\n${a}`:a;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(a,s,!0),this.lexer.state.top=c,0===e.length)break;const u=s[s.length-1];if("code"===u?.type)break;if("blockquote"===u?.type){const t=u,l=t.raw+"\n"+e.join("\n"),i=this.blockquote(l);s[s.length-1]=i,n=n.substring(0,n.length-t.raw.length)+i.raw,r=r.substring(0,r.length-t.text.length)+i.text;break}if("list"!==u?.type);else{const t=u,l=t.raw+"\n"+e.join("\n"),i=this.list(l);s[s.length-1]=i,n=n.substring(0,n.length-u.raw.length)+i.raw,r=r.substring(0,r.length-t.raw.length)+i.raw,e=l.substring(s[s.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:s,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const l=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let i=!1;for(;e;){let n=!1,r="",o="";if(!(t=l.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let a=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=!a.trim(),h=0;if(this.options.pedantic?(h=2,o=a.trimStart()):u?h=t[1].length+1:(h=t[2].search(/[^ ]/),h=h>4?1:h,o=a.slice(h),h+=t[1].length),u&&/^ *$/.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),s=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),l=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;e;){const i=e.split("\n",1)[0];if(c=i,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),s.test(c))break;if(l.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=h||!c.trim())o+="\n"+c.slice(h);else{if(u)break;if(a.search(/[^ ]/)>=4)break;if(s.test(a))break;if(l.test(a))break;if(n.test(a))break;o+="\n"+c}u||c.trim()||(u=!0),r+=i+"\n",e=e.substring(i.length+1),a=c.slice(h)}}s.loose||(i?s.loose=!0:/\n *\n *$/.test(r)&&(i=!0));let p,d=null;this.options.gfm&&(d=/^\[[ xX]\] /.exec(o),d&&(p="[ ] "!==d[0],o=o.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:r,task:!!d,checked:p,loose:!1,text:o,tokens:[]}),s.raw+=r}s.items[s.items.length-1].raw=s.items[s.items.length-1].raw.trimEnd(),s.items[s.items.length-1].text=s.items[s.items.length-1].text.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));s.loose=n}if(s.loose)for(let e=0;e$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=me(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?l.align.push("right"):/^ *:-+: *$/.test(e)?l.align.push("center"):/^ *:-+ *$/.test(e)?l.align.push("left"):l.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:l.align[t]}))));return l}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:he(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=ke(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),we(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return we(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(!r[3]||!n.match(/[\p{L}\p{N}]/u))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){const n=[...r[0]].length-1;let s,l,i=n,o=0;const a="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=a.exec(t));){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(l=[...s].length,r[3]||r[4]){i+=l;continue}if((r[5]||r[6])&&n%3&&!((n+l)%3)){o+=l;continue}if(i-=l,i>0)continue;l=Math.min(l,l+i+o);const t=[...r[0]][0].length,a=e.slice(0,n+r.index+t+l);if(Math.min(n,l)%2){const e=a.slice(1,-1);return{type:"em",raw:a,text:e,tokens:this.lexer.inlineTokens(e)}}const c=a.slice(2,-2);return{type:"strong",raw:a,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=he(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=he(t[1]),n="mailto:"+e):(e=he(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=he(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=he(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:he(t[0]),{type:"text",raw:t[0],text:e}}}}const xe=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ye=/(?:[*+-]|\d{1,9}[.)])/,Ee=de(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ye).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ve=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ae=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Se=de(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Ae).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ie=de(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ye).getRegex(),Re="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Te=/|$))/,ze=de("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Te).replace("tag",Re).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le=de(ve).replace("hr",xe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Re).getRegex(),Ne={blockquote:de(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Le).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:Se,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:xe,html:ze,lheading:Ee,list:Ie,newline:/^(?: *(?:\n|$))+/,paragraph:Le,table:fe,text:/^[^\n]+/},je=de("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",xe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Re).getRegex(),Ce={...Ne,table:je,paragraph:de(ve).replace("hr",xe).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Re).getRegex()},_e={...Ne,html:de("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Te).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:de(ve).replace("hr",xe).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ee).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},He=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Oe=/^( {2,}|\\)\n(?!\s*$)/,Pe="\\p{P}\\p{S}",Ue=de(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Pe).getRegex(),Qe=de(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Pe).getRegex(),Ve=de("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Pe).getRegex(),Be=de("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Pe).getRegex(),qe=de(/\\([punct])/,"gu").replace(/punct/g,Pe).getRegex(),De=de(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Fe=de(Te).replace("(?:--\x3e|$)","--\x3e").getRegex(),Me=de("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Fe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ze=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ge=de(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Ze).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ye=de(/^!?\[(label)\]\[(ref)\]/).replace("label",Ze).replace("ref",Ae).getRegex(),We=de(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ae).getRegex(),Je={_backpedal:fe,anyPunctuation:qe,autolink:De,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:Oe,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:fe,emStrongLDelim:Qe,emStrongRDelimAst:Ve,emStrongRDelimUnd:Be,escape:He,link:Ge,nolink:We,punctuation:Ue,reflink:Ye,reflinkSearch:de("reflink|nolink(?!\\()","g").replace("reflink",Ye).replace("nolink",We).getRegex(),tag:Me,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),1===r.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?t.push(r):(s.raw+="\n"+r.raw,s.text+="\n"+r.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.list(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.def(e))e=e.substring(r.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}):(s.raw+="\n"+r.raw,s.text+="\n"+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else{if(l=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(l=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(l)))s=t[t.length-1],n&&"paragraph"===s?.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(r),n=l.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(r);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,s,l,i,o,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(l=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(l=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(l=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,l.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(i||(o=""),i=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,o))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(s=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(s))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),i=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class rt{options;parser;constructor(e){this.options=e||re}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(/^\S*/)?.[0],s=e.replace(/\n$/,"")+"\n";return r?'
    '+(n?s:he(s,!0))+"
    \n":"
    "+(n?s:he(s,!0))+"
    \n"}blockquote({tokens:e}){return`
    \n${this.parser.parse(e)}
    \n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)}\n`}hr(e){return"
    \n"}list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t\n"+r+"\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • \n`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    \n`}table(e){let t="",n="";for(let t=0;t${r}`),"\n\n"+t+"\n"+r+"
    \n"}tablerow({text:e}){return`\n${e}\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`\n`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),s=ge(e);if(null===s)return r;let l='
    ",l}image({href:e,title:t,text:n}){const r=ge(e);if(null===r)return n;let s=`${n}{const s=e[r].flat(1/0);n=n.concat(this.walkTokens(s,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new rt(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,s=e.renderer[r],l=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=l.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new be(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,s=e.tokenizer[r],l=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=l.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new it;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,s=e.hooks[r],l=t[r];it.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>l.call(t,e)));const n=s.call(t,e);return l.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=l.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return nt.lex(e,t??this.defaults)}parser(e,t){return lt.parse(e,t??this.defaults)}parseMarkdown(e,t){return(n,r)=>{const s={...r},l={...this.defaults,...s},i=this.onError(!!l.silent,!!l.async);if(!0===this.defaults.async&&!1===s.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==n)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(l.hooks&&(l.hooks.options=l),l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(n):n).then((t=>e(t,l))).then((e=>l.hooks?l.hooks.processAllTokens(e):e)).then((e=>l.walkTokens?Promise.all(this.walkTokens(e,l.walkTokens)).then((()=>e)):e)).then((e=>t(e,l))).then((e=>l.hooks?l.hooks.postprocess(e):e)).catch(i);try{l.hooks&&(n=l.hooks.preprocess(n));let r=e(n,l);l.hooks&&(r=l.hooks.processAllTokens(r)),l.walkTokens&&this.walkTokens(r,l.walkTokens);let s=t(r,l);return l.hooks&&(s=l.hooks.postprocess(s)),s}catch(e){return i(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+he(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function at(e,t){return ot.parse(e,t)}at.options=at.setOptions=function(e){return ot.setOptions(e),at.defaults=ot.defaults,se(at.defaults),at},at.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},at.defaults=re,at.use=function(...e){return ot.use(...e),at.defaults=ot.defaults,se(at.defaults),at},at.walkTokens=function(e,t){return ot.walkTokens(e,t)},at.parseInline=ot.parseInline,at.Parser=lt,at.parser=lt.parse,at.Renderer=rt,at.TextRenderer=st,at.Lexer=nt,at.lexer=nt.lex,at.Tokenizer=be,at.Hooks=it,at.parse=at,at.options,at.setOptions,at.use,at.walkTokens,at.parseInline,lt.parse,nt.lex;const ct=({content:e,noResult:t,postId:n,source:r,showFeedbackSection:i,questionBlock:o,isLoading:a,loadingQuery:c,loadingIndex:u,index:h,isNewResult:p,searchInput:d})=>{const g=p&&h===F.getResultInfo().length-1,f=(0,l.useRef)(null),[m,k]=(0,l.useState)(!1);(0,l.useEffect)((()=>{(g&&f.current||a)&&w()}),[g,a]);const w=()=>{const e=window.innerHeight-332;f.current.style.minHeight=`${e}px`;const t=document.getElementById("helpcenterResultsWrapper"),n=t.scrollHeight;t.scrollBy({top:n,left:0,behavior:"smooth"}),k(!0)},{displayedText:b,isComplete:x}=Z(e||"",50,m),y=(0,l.useMemo)((()=>{const e=(e=>{if(e){const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll("p").forEach((e=>{const t=document.createDocumentFragment();for(;e.firstChild;)t.appendChild(e.firstChild);const n=document.createElement("br"),r=document.createElement("br");t.appendChild(n),t.appendChild(r),e.parentNode.replaceChild(t,e)})),t.body.innerHTML}return""})(b);return e?at(e):""}),[b]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{ref:f,className:"helpcenter-response-block"},(0,s.createElement)("div",{className:"helpcenter-question-block"},(0,s.createElement)("div",{className:"helpcenter-question__user-avatar"},(0,s.createElement)(ee,null)),(0,s.createElement)("div",null,t&&g?d:o)),(0,s.createElement)("div",{className:"helpcenter-result-block"},(0,s.createElement)("div",{className:"helpcenter-result-block__aistars"},(0,s.createElement)(ne,null)),(0,s.createElement)("div",null,t&&g?(0,s.createElement)(X,null):a&&c===o&&u===h&&"ai"===r?(0,s.createElement)("div",{className:"loading-cursor"}):e&&e.length>0?(0,s.createElement)("p",{className:"helpcenter-results",dangerouslySetInnerHTML:{__html:y}}):null)),!t&&i&&e&&x&&e.length>0&&(0,s.createElement)(J,{postId:n,source:r})))};var ut;function ht(){return ht=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const[a,c]=(0,l.useState)(""),u=()=>e.trim()?(c(""),!0):(c((0,L.__)("Please enter a specific search term to get results.","wp-module-help-center")),!1);return(0,s.createElement)("div",{className:"helpcenter-input-wrapper"},(0,s.createElement)("div",{className:"search-container__wrapper"},(0,s.createElement)("div",{className:"search-container"},(0,s.createElement)("input",{type:"text",id:"search-input-box",value:e,maxLength:"144",placeholder:(0,L.__)("Ask about WordPress","wp-module-help-center"),onChange:e=>{c(""),t(e.target.value),n("",void 0,e.target.value),i(!1),r(e.target.value)},onKeyDown:async e=>{"Enter"===e.key&&u()&&await o()}}),(0,s.createElement)("button",{onClick:async()=>{u()&&await o()}},(0,s.createElement)(dt,null))),a&&(0,s.createElement)("p",{className:"hc-input-error-message"},a),(0,s.createElement)("div",{className:"attribute"},(0,s.createElement)("p",{className:"hc-input-counter"},(0,s.createElement)("span",null,e?e.length:0,"/144")))),(0,s.createElement)("div",{className:"helpcenter-supportinfo__wrapper"},(0,s.createElement)("div",null,(0,s.createElement)("h4",null,(0,L.__)("Account Support","wp-module-help-center")),(0,s.createElement)("div",{className:"helpcenter-supportinfo__text"},(0,L.__)("If you need help with your Bluehost account, contact our support team:","wp-module-help-center")),(0,s.createElement)("div",{className:"helpcenter-supportinfo__telephone"},(0,s.createElement)("span",null,(0,s.createElement)(mt,null)),(0,s.createElement)("span",null,(0,s.createElement)("a",{href:"tel:8884014678","aria-label":"Call 888-401-4678"},"888-401-4678"))),(0,s.createElement)("div",{className:"helpcenter-supportinfo__chat"},(0,s.createElement)("span",null,(0,s.createElement)(bt,null)),(0,s.createElement)("span",null,(0,s.createElement)("a",{href:"https://www.bluehost.com/contact","aria-label":(0,L.__)("Chat with support","wp-module-help-center"),target:"_blank",rel:"noreferrer"},(0,L.__)("Chat with support","wp-module-help-center")))))))},yt=e=>{const[t,n]=(0,l.useState)(!1),[r,i]=(0,l.useState)(!1),[o,a]=(0,l.useState)(""),[c,u]=(0,l.useState)([]),[h,p]=(0,l.useState)(),[d,g]=(0,l.useState)("kb"),[f,m]=(0,l.useState)({}),[k,w]=(0,l.useState)(!0),[b,x]=(0,l.useState)(null),[y,E]=(0,l.useState)(null),[v,A]=(0,l.useState)(!1),I=(e,t,n)=>{const r=e.replace(/\n/g,"
    ");F.persistResult(r,t,n);const s=F.getResultInfo();u(s),p(t),F.persistSearchInput(n),t&&A(!0),t&&M("help_search",{label_key:"term",term:n,page:window.location.href.toString()})},R=async(e,t)=>{try{return await S()({path:"/newfold-multi-search/v1/multi_search",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,brand:t})})}catch(e){return console.error("Error fetching multi-search results:",e),{}}};(0,l.useEffect)((()=>{a("")}),[e.refresh]),(0,l.useEffect)((()=>{(async()=>{try{const e=F.getResultInfo();e&&(u(e),A(!1));const t=F.getSearchInput()||"";a(t);const n=await D(),r=await R(t,n);m({hits:r?.results?.[0]?.grouped_hits})}catch(e){console.error("Error fetching initial data:",e)}})()}),[]);const T=(e,t)=>!!(e?.length>0&&((e,t,n)=>{const r=t/e.split(/\s+/).length;return n>=1&&r>=.99})(t,e[0]?.text_match_info?.tokens_matched,e[0]?.text_match_info?.fields_matched))&&(I(e[0].document.post_content,e[0].document.post_id||e[0].document.id,t),!0),z=(0,l.useMemo)((()=>(0,P.debounce)((async e=>{if(e&&0!==e.length){w(!0);try{const t=await D(),n=await R(e,t);n?.results?.[0]?.grouped_hits&&m({hits:n?.results?.[0]?.grouped_hits})}catch(e){console.error("Error fetching debounced results:",e)}}else m({})}),500)),[]);return(0,l.useEffect)((()=>{z.cancel()}),[]),(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"hc-results-container"},c?.length>0&&c.map(((e,n)=>(0,s.createElement)(ct,{key:n,content:e.resultContent,noResult:r,postId:e.postId,source:d,showFeedbackSection:!e.resultContent.includes("do not possess the answer"),questionBlock:e.searchInput,isLoading:t,loadingQuery:b,loadingIndex:y,index:n,isNewResult:v,searchInput:o}))),t&&(0,s.createElement)(ct,{key:"loading",content:null,noResult:!1,postId:null,source:"ai",showFeedbackSection:!1,questionBlock:b,isLoading:t,loadingQuery:b,loadingIndex:y,index:c.length,isNewResult:v,searchInput:o})),k&&(0,s.createElement)("div",{className:"suggestions-wrapper"},f?.hits?.length>0&&(0,s.createElement)("p",null,(0,s.createElement)("b",null,(0,L.__)("Common Topics","wp-module-help-center"))),f?.hits?.map(((e,t)=>{const n=document.createElement("span");n.setAttribute("display","none"),n.innerHTML=e?.group_key;const r=n.textContent||n.innerText;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(q,{key:t,searchTitle:r,onGo:()=>{((e,t)=>{a(t),w(!1),I(e?.hits[0]?.document?.post_content,e?.hits[0]?.document?.id,t)})(e,r)}}))}))),(0,s.createElement)(xt,{searchInput:o,setSearchInput:a,populateSearchResult:I,debouncedResults:z,setNoResult:i,getAIResult:async()=>{n(!0),w(!1),x(o),E(c.length);try{let e=f?.hits?.[0]?.hits;if(T(e,o))return;const t=await D(),n=await R(o,t);if(e=n?.results?.[0]?.grouped_hits?.[0]?.hits,T(e,o))return;g("ai");const r=await Q.getSearchResult(o,"helpcenter");r.result[0]?I(r.result[0].text,r.post_id,o):i(!0)}catch(e){console.error("An error occurred:",e),i(!0),A(!0)}finally{x(null),n(!1),E(null),w(!1)}}}))},Et=()=>{const[e,t]=(0,l.useState)(!1);(0,l.useEffect)((()=>{F.getResultInfo().length<=0?t(!0):t(!1)}),[]);const n=(0,L.__)("Hi! I’m your WordPress AI assistant.

    Ask me how to do things in WordPress and I’ll provide step by step instructions.

    I’m still learning so I don’t have all the answers just yet.","wp-module-help-center"),{displayedText:r}=Z(n||"",50,e);return(0,s.createElement)("div",{className:"helpcenter-intro"},(0,s.createElement)("div",null,(0,s.createElement)(ne,null)),(0,s.createElement)("div",{className:"helpcenter-intro__text",dangerouslySetInnerHTML:{__html:r}}))},vt=e=>{const[t,n]=(0,l.useState)(!1),[r,i]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{(async()=>{try{const e=await(window.NewfoldRuntime?.capabilities?.canAccessHelpCenter||!1);i(e)}catch(e){i(!1)}})()}),[]),(0,l.useEffect)((()=>{const e=()=>{n(F.getHelpVisible())};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}),[]),r&&t?(0,s.createElement)("div",{className:"nfd-help-center",id:"helpcenterResultsWrapper"},(0,s.createElement)(Et,null),(0,s.createElement)(yt,{refresh:e.refresh})):(0,s.createElement)(s.Fragment,null)},At=({onClose:e})=>{const[t,n]=(0,l.useState)(""),[r,i]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{const e=!window.newfoldHelpCenter?.closeOnLoad&&F.getHelpVisible();Tt(e),(async()=>{const e=await D();n(e.toLowerCase())})()}),[]),(0,s.createElement)("div",{className:"nfd-hc-modal"},(0,s.createElement)("div",{className:"nfd-hc-modal__header"},(0,s.createElement)("h3",{className:"nfd-hc-modal__header__heading"},(0,s.createElement)("span",{className:"nfd-hc-modal__header__heading__icon"},(0,s.createElement)(O,null)),(0,s.createElement)("span",null,(0,L.__)("Help with WordPress","wp-module-help-center"))),(0,s.createElement)("button",{className:"nfd-hc-modal__header__close-button",onClick:()=>{e(),i(!r)}},(0,s.createElement)("div",{className:"nfd-hc-modal__header__close-button__icon-button"},(0,s.createElement)(_,null)))),(0,s.createElement)(vt,{closeHelp:()=>{e(),i(!r)},refresh:r,brand:t}))};function St(){return St=Object.assign?Object.assign.bind():function(e){for(var t=1;t{window?.nfdHelpCenter?.restUrl&&(async({namespace:e,urls:{single:t,batch:n}={},settings:{debounce:{time:r}={},queue:{threshold:s=100}={}}={}})=>{!e||!I(e)&&(!t&&!n||((0,i.dispatch)(v).initializeNamespace(e),(0,i.dispatch)(v).updateHiiveUrls({single:t,batch:n},e),(0,i.dispatch)(v).updateHiiveDebounceTime(r,e),(0,i.dispatch)(v).updateHiiveEventsQueueThreshold(s,e),window.nfdUIAnalytics?.hiive?window.nfdUIAnalytics.hiive[e]=!0:window.nfdUIAnalytics={hiive:{[e]:!0}}))})({namespace:"wonder_help",urls:{single:window.nfdHelpCenter.restUrl+"/newfold-data/v1/events"}})}));const Rt=document.getElementById("wpcontent"),Tt=e=>{Rt.classList.toggle("wpcontent-container",e),document.getElementById("nfd-help-center").classList.toggle("help-container",e),F.updateHelpVisible(e),window.dispatchEvent(new Event("storage"))};window.newfoldEmbeddedHelp={toggleNFDLaunchedEmbeddedHelp:()=>{(()=>{const e=F.getHelpVisible();if(Object.is(e,void 0))return Tt(!0),void M("help_sidebar_opened",{page:window.location.href.toString()});e||M("help_sidebar_opened",{page:window.location.href.toString()}),Tt(!e)})()},renderEmbeddedHelp:()=>{const e=document.createElement("div");e.id="nfd-help-center",e.style.display="none",Rt.appendChild(e);const t=document.getElementById("nfd-help-center");null!==t&&("undefined"!==l.createRoot?(0,l.createRoot)(t).render((0,s.createElement)(At,{onClose:()=>{Tt(!1)}})):"undefined"!==l.render&&(0,l.render)((0,s.createElement)(At,{onClose:()=>{Tt(!1)}}),t))}};const zt=(0,i.subscribe)((()=>{document.getElementById("nfd-help-menu-button-wrapper")?zt():a()((()=>{const e=document.querySelector(".edit-post-header__settings");if(!e)return;const t=document.createElement("div");t.id="nfd-help-menu-button-wrapper",t.classList.add("nfd-help-menu-button-wrapper");const n=e.querySelector(".components-dropdown-menu.interface-more-menu-dropdown");n?e.insertBefore(t,n):e.appendChild(t);const r=(0,s.createElement)("button",{className:"components-button has-icon",onClick:()=>{window.newfoldEmbeddedHelp.toggleNFDLaunchedEmbeddedHelp()}},(0,s.createElement)(It,null));(0,l.render)(r,document.getElementById("nfd-help-menu-button-wrapper"))}))}));window.newfoldEmbeddedHelp.renderEmbeddedHelp(),window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery=function(e,t){const n=F.getHelpVisible();F.persistSearchInput(e),"true"!==n&&t&&(window.newfoldEmbeddedHelp.renderEmbeddedHelp(),Tt(!0));const r=new KeyboardEvent("keydown",{bubbles:!0,cancelable:!0,key:"Enter",code:"Enter",keyCode:13}),s=document.getElementById("nfd-help-center");let l=0;const i=setInterval((()=>{if(l++,s&&(e=>{const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility})(s)){const t=document.getElementById("search-input-box");t.value=e,t.focus(),t.setSelectionRange(t.value.length,t.value.length),t.dispatchEvent(r),clearInterval(i)}else l>=5&&clearInterval(i)}),500)},document.addEventListener("click",(e=>{try{e.target?.dataset?.nfdhelpcenterquery&&""!==e.target.dataset.nfdhelpcenterquery.trim()&&window.newfoldEmbeddedHelp.launchNFDEmbeddedHelpQuery(e.target.dataset.nfdhelpcenterquery,!0)}catch(e){console.error("Error launching help center via query:",e)}}))}()}(); \ No newline at end of file