: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"
/* harmony default export */ const library_pencil = (pencil);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js
/* harmony default export */ const edit = (library_pencil);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js
const linkOff = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"
/* harmony default export */ const link_off = (linkOff);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/copy-small.js
const copySmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"
/* harmony default export */ const copy_small = (copySmall);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/viewer-slot.js
} = (0,external_wp_components_namespaceObject.createSlotFill)('BlockEditorLinkControlViewer');
/* harmony default export */ const viewer_slot = ((/* unused pure expression or super */ null && (ViewerSlot)));
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-rich-url-data.js
function use_rich_url_data_reducer(state, action) {
richData: action.richData
throw new Error(`Unexpected action type ${action.type}`);
function useRemoteUrlData(url) {
const [state, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(use_rich_url_data_reducer, {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
fetchRichUrlData: getSettings().__experimentalFetchRichUrlData
(0,external_wp_element_namespaceObject.useEffect)(() => {
// Only make the request if we have an actual URL
// and the fetching util is available. In some editors
// there may not be such a util.
if (url?.length && fetchRichUrlData && typeof AbortController !== 'undefined') {
const controller = new window.AbortController();
const signal = controller.signal;
// Avoid setting state on unmounted component
// Cleanup: when the URL changes the abort the current request.
/* harmony default export */ const use_rich_url_data = (useRemoteUrlData);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/link-preview.js
hasUnlinkControl = false,
const showIconLabels = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_preferences_namespaceObject.store).get('core', 'showIconLabels'), []);
// Avoid fetching if rich previews are not desired.
const showRichPreviews = hasRichPreviews ? value?.url : null;
} = use_rich_url_data(showRichPreviews);
// Rich data may be an empty object so test for that.
const hasRichData = richData && Object.keys(richData).length;
const displayURL = value && (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(value.url), 24) || '';
// url can be undefined if the href attribute is unset
const isEmptyURL = !value?.url?.length;
const displayTitle = !isEmptyURL && (0,external_wp_dom_namespaceObject.__unstableStripHTML)(richData?.title || value?.title || displayURL);
icon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
icon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
icon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(value.url, () => {
createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Link copied to clipboard.'), {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Currently selected'),
className: dist_clsx('block-editor-link-control__search-item', {
'is-fetching': !!isFetching,
'is-url-title': displayTitle === displayURL
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "block-editor-link-control__search-item-top",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", {
className: "block-editor-link-control__search-item-header",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: dist_clsx('block-editor-link-control__search-item-icon', {
'is-image': richData?.icon
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "block-editor-link-control__search-item-details",
children: !isEmptyURL ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
className: "block-editor-link-control__search-item-title",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, {
}), value?.url && displayTitle !== displayURL && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "block-editor-link-control__search-item-info",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, {
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "block-editor-link-control__search-item-error-notice",
children: (0,external_wp_i18n_namespaceObject.__)('Link is empty')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
label: (0,external_wp_i18n_namespaceObject.__)('Edit link'),
}), hasUnlinkControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
label: (0,external_wp_i18n_namespaceObject.__)('Remove link'),
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
label: (0,external_wp_i18n_namespaceObject.sprintf)(
// Translators: %s is a placeholder for the link URL and an optional colon, (if a Link URL is present).
(0,external_wp_i18n_namespaceObject.__)('Copy link%s'),
// Ends up looking like "Copy link: https://example.com".
isEmptyURL || showIconLabels ? '' : ': ' + value.url),
__experimentalIsFocusable: true,
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewerSlot, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/settings.js
const settings_noop = () => {};
const LinkControlSettings = ({
onChange = settings_noop,
if (!settings || !settings.length) {
const handleSettingChange = setting => newValue => {
const theSettings = settings.map(setting => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
__nextHasNoMarginBottom: true,
className: "block-editor-link-control__setting",
onChange: handleSettingChange(setting),
checked: value ? !!value[setting.id] : false,
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", {
className: "block-editor-link-control__settings",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
children: (0,external_wp_i18n_namespaceObject.__)('Currently selected link settings')
/* harmony default export */ const link_control_settings = (LinkControlSettings);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-create-page.js
function useCreatePage(handleCreatePage) {
const cancelableCreateSuggestion = (0,external_wp_element_namespaceObject.useRef)();
const [isCreatingPage, setIsCreatingPage] = (0,external_wp_element_namespaceObject.useState)(false);
const [errorMessage, setErrorMessage] = (0,external_wp_element_namespaceObject.useState)(null);
const createPage = async function (suggestionTitle) {
// Make cancellable in order that we can avoid setting State
// if the component unmounts during the call to `createSuggestion`
cancelableCreateSuggestion.current = makeCancelable(
// Using Promise.resolve to allow createSuggestion to return a
// non-Promise based value.
Promise.resolve(handleCreatePage(suggestionTitle)));
return await cancelableCreateSuggestion.current.promise;
if (error && error.isCanceled) {
return; // bail if canceled to avoid setting state
setErrorMessage(error.message || (0,external_wp_i18n_namespaceObject.__)('An unknown error occurred during creation. Please try again.'));
setIsCreatingPage(false);
* Handles cancelling any pending Promises that have been made cancelable.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (cancelableCreateSuggestion.current) {
cancelableCreateSuggestion.current.cancel();
* Creates a wrapper around a promise which allows it to be programmatically
* See: https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html
* @param {Promise} promise the Promise to make cancelable
const makeCancelable = promise => {
let hasCanceled_ = false;
const wrappedPromise = new Promise((resolve, reject) => {
promise.then(val => hasCanceled_ ? reject({
}) : resolve(val), error => hasCanceled_ ? reject({
// EXTERNAL MODULE: ./node_modules/fast-deep-equal/index.js
var fast_deep_equal = __webpack_require__(5215);
var fast_deep_equal_default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-internal-value.js
function useInternalValue(value) {
const [internalValue, setInternalValue] = (0,external_wp_element_namespaceObject.useState)(value || {});
const [previousValue, setPreviousValue] = (0,external_wp_element_namespaceObject.useState)(value);
// If the value prop changes, update the internal state.
// - https://github.com/WordPress/gutenberg/pull/51387#issuecomment-1722927384.
// - https://react.dev/reference/react/useState#storing-information-from-previous-renders.
if (!fast_deep_equal_default()(value, previousValue)) {
const setInternalURLInputValue = nextValue => {
const setInternalTextInputValue = nextValue => {
const createSetInternalSettingValueHandler = settingsKeys => nextValue => {
// Only apply settings values which are defined in the settings prop.
const settingsUpdates = Object.keys(nextValue).reduce((acc, key) => {
if (settingsKeys.includes(key)) {
acc[key] = nextValue[key];
return [internalValue, setInternalValue, setInternalURLInputValue, setInternalTextInputValue, createSetInternalSettingValueHandler];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/index.js
* Default properties associated with a link control value.
* @typedef WPLinkControlDefaultValue
* @property {string} url Link URL.
* @property {string=} title Link title.
* @property {boolean=} opensInNewTab Whether link should open in a new browser
* tab. This value is only assigned if not
* providing a custom `settings` prop.
/* eslint-disable jsdoc/valid-types */
* Custom settings values associated with a link.