PluginProbe
Gutenberg / 23.2.1
Gutenberg v23.2.1
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / build / scripts / customize-widgets / index.js

index.js in Gutenberg 23.2.1, at build/scripts/customize-widgets/index.js

3,036 lines 109.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var wp;
2 (wp ||= {}).customizeWidgets = (() => {
3 var __create = Object.create;
4 var __defProp = Object.defineProperty;
5 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6 var __getOwnPropNames = Object.getOwnPropertyNames;
7 var __getProtoOf = Object.getPrototypeOf;
8 var __hasOwnProp = Object.prototype.hasOwnProperty;
9 var __commonJS = (cb, mod) => function __require() {
10 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11 };
12 var __export = (target, all) => {
13 for (var name in all)
14 __defProp(target, name, { get: all[name], enumerable: true });
15 };
16 var __copyProps = (to, from, except, desc) => {
17 if (from && typeof from === "object" || typeof from === "function") {
18 for (let key of __getOwnPropNames(from))
19 if (!__hasOwnProp.call(to, key) && key !== except)
20 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21 }
22 return to;
23 };
24 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25 // If the importer is in node compatibility mode or this is not an ESM
26 // file that has been converted to a CommonJS file using a Babel-
27 // compatible transform (i.e. "__esModule" has not been set), then set
28 // "default" to the CommonJS "module.exports" for node compatibility.
29 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30 mod
31 ));
32 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
34 // package-external:@wordpress/element
35 var require_element = __commonJS({
36 "package-external:@wordpress/element"(exports, module) {
37 module.exports = window.wp.element;
38 }
39 });
40
41 // package-external:@wordpress/block-library
42 var require_block_library = __commonJS({
43 "package-external:@wordpress/block-library"(exports, module) {
44 module.exports = window.wp.blockLibrary;
45 }
46 });
47
48 // package-external:@wordpress/widgets
49 var require_widgets = __commonJS({
50 "package-external:@wordpress/widgets"(exports, module) {
51 module.exports = window.wp.widgets;
52 }
53 });
54
55 // package-external:@wordpress/blocks
56 var require_blocks = __commonJS({
57 "package-external:@wordpress/blocks"(exports, module) {
58 module.exports = window.wp.blocks;
59 }
60 });
61
62 // package-external:@wordpress/data
63 var require_data = __commonJS({
64 "package-external:@wordpress/data"(exports, module) {
65 module.exports = window.wp.data;
66 }
67 });
68
69 // package-external:@wordpress/preferences
70 var require_preferences = __commonJS({
71 "package-external:@wordpress/preferences"(exports, module) {
72 module.exports = window.wp.preferences;
73 }
74 });
75
76 // package-external:@wordpress/components
77 var require_components = __commonJS({
78 "package-external:@wordpress/components"(exports, module) {
79 module.exports = window.wp.components;
80 }
81 });
82
83 // package-external:@wordpress/i18n
84 var require_i18n = __commonJS({
85 "package-external:@wordpress/i18n"(exports, module) {
86 module.exports = window.wp.i18n;
87 }
88 });
89
90 // package-external:@wordpress/block-editor
91 var require_block_editor = __commonJS({
92 "package-external:@wordpress/block-editor"(exports, module) {
93 module.exports = window.wp.blockEditor;
94 }
95 });
96
97 // package-external:@wordpress/compose
98 var require_compose = __commonJS({
99 "package-external:@wordpress/compose"(exports, module) {
100 module.exports = window.wp.compose;
101 }
102 });
103
104 // package-external:@wordpress/hooks
105 var require_hooks = __commonJS({
106 "package-external:@wordpress/hooks"(exports, module) {
107 module.exports = window.wp.hooks;
108 }
109 });
110
111 // vendor-external:react/jsx-runtime
112 var require_jsx_runtime = __commonJS({
113 "vendor-external:react/jsx-runtime"(exports, module) {
114 module.exports = window.ReactJSXRuntime;
115 }
116 });
117
118 // package-external:@wordpress/core-data
119 var require_core_data = __commonJS({
120 "package-external:@wordpress/core-data"(exports, module) {
121 module.exports = window.wp.coreData;
122 }
123 });
124
125 // package-external:@wordpress/media-utils
126 var require_media_utils = __commonJS({
127 "package-external:@wordpress/media-utils"(exports, module) {
128 module.exports = window.wp.mediaUtils;
129 }
130 });
131
132 // package-external:@wordpress/keycodes
133 var require_keycodes = __commonJS({
134 "package-external:@wordpress/keycodes"(exports, module) {
135 module.exports = window.wp.keycodes;
136 }
137 });
138
139 // package-external:@wordpress/primitives
140 var require_primitives = __commonJS({
141 "package-external:@wordpress/primitives"(exports, module) {
142 module.exports = window.wp.primitives;
143 }
144 });
145
146 // package-external:@wordpress/keyboard-shortcuts
147 var require_keyboard_shortcuts = __commonJS({
148 "package-external:@wordpress/keyboard-shortcuts"(exports, module) {
149 module.exports = window.wp.keyboardShortcuts;
150 }
151 });
152
153 // vendor-external:react
154 var require_react = __commonJS({
155 "vendor-external:react"(exports, module) {
156 module.exports = window.React;
157 }
158 });
159
160 // package-external:@wordpress/private-apis
161 var require_private_apis = __commonJS({
162 "package-external:@wordpress/private-apis"(exports, module) {
163 module.exports = window.wp.privateApis;
164 }
165 });
166
167 // node_modules/fast-deep-equal/es6/index.js
168 var require_es6 = __commonJS({
169 "node_modules/fast-deep-equal/es6/index.js"(exports, module) {
170 "use strict";
171 module.exports = function equal(a, b) {
172 if (a === b) return true;
173 if (a && b && typeof a == "object" && typeof b == "object") {
174 if (a.constructor !== b.constructor) return false;
175 var length, i, keys;
176 if (Array.isArray(a)) {
177 length = a.length;
178 if (length != b.length) return false;
179 for (i = length; i-- !== 0; )
180 if (!equal(a[i], b[i])) return false;
181 return true;
182 }
183 if (a instanceof Map && b instanceof Map) {
184 if (a.size !== b.size) return false;
185 for (i of a.entries())
186 if (!b.has(i[0])) return false;
187 for (i of a.entries())
188 if (!equal(i[1], b.get(i[0]))) return false;
189 return true;
190 }
191 if (a instanceof Set && b instanceof Set) {
192 if (a.size !== b.size) return false;
193 for (i of a.entries())
194 if (!b.has(i[0])) return false;
195 return true;
196 }
197 if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
198 length = a.length;
199 if (length != b.length) return false;
200 for (i = length; i-- !== 0; )
201 if (a[i] !== b[i]) return false;
202 return true;
203 }
204 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
205 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
206 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
207 keys = Object.keys(a);
208 length = keys.length;
209 if (length !== Object.keys(b).length) return false;
210 for (i = length; i-- !== 0; )
211 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
212 for (i = length; i-- !== 0; ) {
213 var key = keys[i];
214 if (!equal(a[key], b[key])) return false;
215 }
216 return true;
217 }
218 return a !== a && b !== b;
219 };
220 }
221 });
222
223 // package-external:@wordpress/is-shallow-equal
224 var require_is_shallow_equal = __commonJS({
225 "package-external:@wordpress/is-shallow-equal"(exports, module) {
226 module.exports = window.wp.isShallowEqual;
227 }
228 });
229
230 // package-external:@wordpress/dom
231 var require_dom = __commonJS({
232 "package-external:@wordpress/dom"(exports, module) {
233 module.exports = window.wp.dom;
234 }
235 });
236
237 // packages/customize-widgets/build-module/index.mjs
238 var index_exports = {};
239 __export(index_exports, {
240 initialize: () => initialize,
241 store: () => store
242 });
243 var import_element18 = __toESM(require_element(), 1);
244 var import_block_library2 = __toESM(require_block_library(), 1);
245 var import_widgets5 = __toESM(require_widgets(), 1);
246 var import_blocks2 = __toESM(require_blocks(), 1);
247 var import_data17 = __toESM(require_data(), 1);
248 var import_preferences4 = __toESM(require_preferences(), 1);
249
250 // packages/customize-widgets/build-module/components/customize-widgets/index.mjs
251 var import_element17 = __toESM(require_element(), 1);
252 var import_components8 = __toESM(require_components(), 1);
253
254 // packages/customize-widgets/build-module/components/error-boundary/index.mjs
255 var import_element = __toESM(require_element(), 1);
256 var import_i18n = __toESM(require_i18n(), 1);
257 var import_components = __toESM(require_components(), 1);
258 var import_block_editor = __toESM(require_block_editor(), 1);
259 var import_compose = __toESM(require_compose(), 1);
260 var import_hooks = __toESM(require_hooks(), 1);
261 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
262 function CopyButton({ text, children }) {
263 const ref = (0, import_compose.useCopyToClipboard)(text);
264 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Button, { size: "compact", variant: "secondary", ref, children });
265 }
266 var ErrorBoundary = class extends import_element.Component {
267 constructor() {
268 super(...arguments);
269 this.state = {
270 error: null
271 };
272 }
273 componentDidCatch(error) {
274 this.setState({ error });
275 (0, import_hooks.doAction)("editor.ErrorBoundary.errorLogged", error);
276 }
277 render() {
278 const { error } = this.state;
279 if (!error) {
280 return this.props.children;
281 }
282 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
283 import_block_editor.Warning,
284 {
285 className: "customize-widgets-error-boundary",
286 actions: [
287 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: error.stack, children: (0, import_i18n.__)("Copy Error") }, "copy-error")
288 ],
289 children: (0, import_i18n.__)("The editor has encountered an unexpected error.")
290 }
291 );
292 }
293 };
294
295 // packages/customize-widgets/build-module/components/sidebar-block-editor/index.mjs
296 var import_compose3 = __toESM(require_compose(), 1);
297 var import_core_data = __toESM(require_core_data(), 1);
298 var import_data12 = __toESM(require_data(), 1);
299 var import_element14 = __toESM(require_element(), 1);
300 var import_block_editor8 = __toESM(require_block_editor(), 1);
301 var import_media_utils = __toESM(require_media_utils(), 1);
302 var import_preferences3 = __toESM(require_preferences(), 1);
303 var import_block_library = __toESM(require_block_library(), 1);
304
305 // packages/customize-widgets/build-module/components/block-inspector-button/index.mjs
306 var import_element2 = __toESM(require_element(), 1);
307 var import_i18n2 = __toESM(require_i18n(), 1);
308 var import_components2 = __toESM(require_components(), 1);
309 var import_data = __toESM(require_data(), 1);
310 var import_block_editor2 = __toESM(require_block_editor(), 1);
311 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
312 function BlockInspectorButton({ inspector, closeMenu, ...props }) {
313 const selectedBlockClientId = (0, import_data.useSelect)(
314 (select) => select(import_block_editor2.store).getSelectedBlockClientId(),
315 []
316 );
317 const selectedBlock = (0, import_element2.useMemo)(
318 () => document.getElementById(`block-${selectedBlockClientId}`),
319 [selectedBlockClientId]
320 );
321 return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
322 import_components2.MenuItem,
323 {
324 onClick: () => {
325 inspector.open({
326 returnFocusWhenClose: selectedBlock
327 });
328 closeMenu();
329 },
330 ...props,
331 children: (0, import_i18n2.__)("Show more settings")
332 }
333 );
334 }
335 var block_inspector_button_default = BlockInspectorButton;
336
337 // node_modules/clsx/dist/clsx.mjs
338 function r(e) {
339 var t, f, n = "";
340 if ("string" == typeof e || "number" == typeof e) n += e;
341 else if ("object" == typeof e) if (Array.isArray(e)) {
342 var o = e.length;
343 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
344 } else for (f in e) e[f] && (n && (n += " "), n += f);
345 return n;
346 }
347 function clsx() {
348 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
349 return n;
350 }
351 var clsx_default = clsx;
352
353 // packages/customize-widgets/build-module/components/header/index.mjs
354 var import_components6 = __toESM(require_components(), 1);
355 var import_block_editor4 = __toESM(require_block_editor(), 1);
356 var import_element7 = __toESM(require_element(), 1);
357 var import_keycodes3 = __toESM(require_keycodes(), 1);
358 var import_i18n7 = __toESM(require_i18n(), 1);
359
360 // packages/icons/build-module/library/close-small.mjs
361 var import_primitives = __toESM(require_primitives(), 1);
362 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
363 var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) });
364
365 // packages/icons/build-module/library/external.mjs
366 var import_primitives2 = __toESM(require_primitives(), 1);
367 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
368 var external_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.Path, { d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) });
369
370 // packages/icons/build-module/library/more-vertical.mjs
371 var import_primitives3 = __toESM(require_primitives(), 1);
372 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
373 var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) });
374
375 // packages/icons/build-module/library/plus.mjs
376 var import_primitives4 = __toESM(require_primitives(), 1);
377 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
378 var plus_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) });
379
380 // packages/icons/build-module/library/redo.mjs
381 var import_primitives5 = __toESM(require_primitives(), 1);
382 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
383 var redo_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.Path, { d: "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z" }) });
384
385 // packages/icons/build-module/library/undo.mjs
386 var import_primitives6 = __toESM(require_primitives(), 1);
387 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
388 var undo_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.Path, { d: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z" }) });
389
390 // packages/customize-widgets/build-module/components/inserter/index.mjs
391 var import_i18n3 = __toESM(require_i18n(), 1);
392 var import_block_editor3 = __toESM(require_block_editor(), 1);
393 var import_components3 = __toESM(require_components(), 1);
394 var import_compose2 = __toESM(require_compose(), 1);
395 var import_data4 = __toESM(require_data(), 1);
396
397 // packages/customize-widgets/build-module/store/index.mjs
398 var import_data3 = __toESM(require_data(), 1);
399
400 // packages/customize-widgets/build-module/store/reducer.mjs
401 var import_data2 = __toESM(require_data(), 1);
402 function blockInserterPanel(state = false, action) {
403 switch (action.type) {
404 case "SET_IS_INSERTER_OPENED":
405 return action.value;
406 }
407 return state;
408 }
409 var reducer_default = (0, import_data2.combineReducers)({
410 blockInserterPanel
411 });
412
413 // packages/customize-widgets/build-module/store/selectors.mjs
414 var selectors_exports = {};
415 __export(selectors_exports, {
416 __experimentalGetInsertionPoint: () => __experimentalGetInsertionPoint,
417 isInserterOpened: () => isInserterOpened
418 });
419 var EMPTY_INSERTION_POINT = {
420 rootClientId: void 0,
421 insertionIndex: void 0
422 };
423 function isInserterOpened(state) {
424 return !!state.blockInserterPanel;
425 }
426 function __experimentalGetInsertionPoint(state) {
427 if (typeof state.blockInserterPanel === "boolean") {
428 return EMPTY_INSERTION_POINT;
429 }
430 return state.blockInserterPanel;
431 }
432
433 // packages/customize-widgets/build-module/store/actions.mjs
434 var actions_exports = {};
435 __export(actions_exports, {
436 setIsInserterOpened: () => setIsInserterOpened
437 });
438 function setIsInserterOpened(value) {
439 return {
440 type: "SET_IS_INSERTER_OPENED",
441 value
442 };
443 }
444
445 // packages/customize-widgets/build-module/store/constants.mjs
446 var STORE_NAME = "core/customize-widgets";
447
448 // packages/customize-widgets/build-module/store/index.mjs
449 var storeConfig = {
450 reducer: reducer_default,
451 selectors: selectors_exports,
452 actions: actions_exports
453 };
454 var store = (0, import_data3.createReduxStore)(STORE_NAME, storeConfig);
455 (0, import_data3.register)(store);
456
457 // packages/customize-widgets/build-module/components/inserter/index.mjs
458 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
459 function Inserter({ setIsOpened }) {
460 const inserterTitleId = (0, import_compose2.useInstanceId)(
461 Inserter,
462 "customize-widget-layout__inserter-panel-title"
463 );
464 const insertionPoint = (0, import_data4.useSelect)(
465 (select) => select(store).__experimentalGetInsertionPoint(),
466 []
467 );
468 return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
469 "div",
470 {
471 className: "customize-widgets-layout__inserter-panel",
472 "aria-labelledby": inserterTitleId,
473 children: [
474 /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "customize-widgets-layout__inserter-panel-header", children: [
475 /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
476 "h2",
477 {
478 id: inserterTitleId,
479 className: "customize-widgets-layout__inserter-panel-header-title",
480 children: (0, import_i18n3.__)("Add a block")
481 }
482 ),
483 /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
484 import_components3.Button,
485 {
486 size: "small",
487 icon: close_small_default,
488 onClick: () => setIsOpened(false),
489 "aria-label": (0, import_i18n3.__)("Close inserter")
490 }
491 )
492 ] }),
493 /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "customize-widgets-layout__inserter-panel-content", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
494 import_block_editor3.__experimentalLibrary,
495 {
496 rootClientId: insertionPoint.rootClientId,
497 __experimentalInsertionIndex: insertionPoint.insertionIndex,
498 showInserterHelpPanel: true,
499 onSelect: () => setIsOpened(false)
500 }
501 ) })
502 ]
503 }
504 );
505 }
506 var inserter_default = Inserter;
507
508 // packages/customize-widgets/build-module/components/more-menu/index.mjs
509 var import_components5 = __toESM(require_components(), 1);
510 var import_element6 = __toESM(require_element(), 1);
511 var import_i18n6 = __toESM(require_i18n(), 1);
512 var import_keycodes2 = __toESM(require_keycodes(), 1);
513 var import_keyboard_shortcuts3 = __toESM(require_keyboard_shortcuts(), 1);
514 var import_preferences = __toESM(require_preferences(), 1);
515
516 // node_modules/@base-ui/utils/esm/useRefWithInit.js
517 var React = __toESM(require_react(), 1);
518 var UNINITIALIZED = {};
519 function useRefWithInit(init, initArg) {
520 const ref = React.useRef(UNINITIALIZED);
521 if (ref.current === UNINITIALIZED) {
522 ref.current = init(initArg);
523 }
524 return ref;
525 }
526
527 // node_modules/@base-ui/utils/esm/warn.js
528 var set;
529 if (true) {
530 set = /* @__PURE__ */ new Set();
531 }
532 function warn(...messages) {
533 if (true) {
534 const messageKey = messages.join(" ");
535 if (!set.has(messageKey)) {
536 set.add(messageKey);
537 console.warn(`Base UI: ${messageKey}`);
538 }
539 }
540 }
541
542 // node_modules/@base-ui/react/esm/internals/useRenderElement.js
543 var React4 = __toESM(require_react(), 1);
544
545 // node_modules/@base-ui/utils/esm/useMergedRefs.js
546 function useMergedRefs(a, b, c, d) {
547 const forkRef = useRefWithInit(createForkRef).current;
548 if (didChange(forkRef, a, b, c, d)) {
549 update(forkRef, [a, b, c, d]);
550 }
551 return forkRef.callback;
552 }
553 function useMergedRefsN(refs) {
554 const forkRef = useRefWithInit(createForkRef).current;
555 if (didChangeN(forkRef, refs)) {
556 update(forkRef, refs);
557 }
558 return forkRef.callback;
559 }
560 function createForkRef() {
561 return {
562 callback: null,
563 cleanup: null,
564 refs: []
565 };
566 }
567 function didChange(forkRef, a, b, c, d) {
568 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
569 }
570 function didChangeN(forkRef, newRefs) {
571 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
572 }
573 function update(forkRef, refs) {
574 forkRef.refs = refs;
575 if (refs.every((ref) => ref == null)) {
576 forkRef.callback = null;
577 return;
578 }
579 forkRef.callback = (instance) => {
580 if (forkRef.cleanup) {
581 forkRef.cleanup();
582 forkRef.cleanup = null;
583 }
584 if (instance != null) {
585 const cleanupCallbacks = Array(refs.length).fill(null);
586 for (let i = 0; i < refs.length; i += 1) {
587 const ref = refs[i];
588 if (ref == null) {
589 continue;
590 }
591 switch (typeof ref) {
592 case "function": {
593 const refCleanup = ref(instance);
594 if (typeof refCleanup === "function") {
595 cleanupCallbacks[i] = refCleanup;
596 }
597 break;
598 }
599 case "object": {
600 ref.current = instance;
601 break;
602 }
603 default:
604 }
605 }
606 forkRef.cleanup = () => {
607 for (let i = 0; i < refs.length; i += 1) {
608 const ref = refs[i];
609 if (ref == null) {
610 continue;
611 }
612 switch (typeof ref) {
613 case "function": {
614 const cleanupCallback = cleanupCallbacks[i];
615 if (typeof cleanupCallback === "function") {
616 cleanupCallback();
617 } else {
618 ref(null);
619 }
620 break;
621 }
622 case "object": {
623 ref.current = null;
624 break;
625 }
626 default:
627 }
628 }
629 };
630 }
631 };
632 }
633
634 // node_modules/@base-ui/utils/esm/getReactElementRef.js
635 var React3 = __toESM(require_react(), 1);
636
637 // node_modules/@base-ui/utils/esm/reactVersion.js
638 var React2 = __toESM(require_react(), 1);
639 var majorVersion = parseInt(React2.version, 10);
640 function isReactVersionAtLeast(reactVersionToCheck) {
641 return majorVersion >= reactVersionToCheck;
642 }
643
644 // node_modules/@base-ui/utils/esm/getReactElementRef.js
645 function getReactElementRef(element) {
646 if (!/* @__PURE__ */ React3.isValidElement(element)) {
647 return null;
648 }
649 const reactElement = element;
650 const propsWithRef = reactElement.props;
651 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
652 }
653
654 // node_modules/@base-ui/utils/esm/mergeObjects.js
655 function mergeObjects(a, b) {
656 if (a && !b) {
657 return a;
658 }
659 if (!a && b) {
660 return b;
661 }
662 if (a || b) {
663 return {
664 ...a,
665 ...b
666 };
667 }
668 return void 0;
669 }
670
671 // node_modules/@base-ui/utils/esm/empty.js
672 var EMPTY_ARRAY = Object.freeze([]);
673 var EMPTY_OBJECT = Object.freeze({});
674
675 // node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js
676 function getStateAttributesProps(state, customMapping) {
677 const props = {};
678 for (const key in state) {
679 const value = state[key];
680 if (customMapping?.hasOwnProperty(key)) {
681 const customProps = customMapping[key](value);
682 if (customProps != null) {
683 Object.assign(props, customProps);
684 }
685 continue;
686 }
687 if (value === true) {
688 props[`data-${key.toLowerCase()}`] = "";
689 } else if (value) {
690 props[`data-${key.toLowerCase()}`] = value.toString();
691 }
692 }
693 return props;
694 }
695
696 // node_modules/@base-ui/react/esm/utils/resolveClassName.js
697 function resolveClassName(className, state) {
698 return typeof className === "function" ? className(state) : className;
699 }
700
701 // node_modules/@base-ui/react/esm/utils/resolveStyle.js
702 function resolveStyle(style, state) {
703 return typeof style === "function" ? style(state) : style;
704 }
705
706 // node_modules/@base-ui/react/esm/merge-props/mergeProps.js
707 var EMPTY_PROPS = {};
708 function mergeProps(a, b, c, d, e) {
709 if (!c && !d && !e && !a) {
710 return createInitialMergedProps(b);
711 }
712 let merged = createInitialMergedProps(a);
713 if (b) {
714 merged = mergeInto(merged, b);
715 }
716 if (c) {
717 merged = mergeInto(merged, c);
718 }
719 if (d) {
720 merged = mergeInto(merged, d);
721 }
722 if (e) {
723 merged = mergeInto(merged, e);
724 }
725 return merged;
726 }
727 function mergePropsN(props) {
728 if (props.length === 0) {
729 return EMPTY_PROPS;
730 }
731 if (props.length === 1) {
732 return createInitialMergedProps(props[0]);
733 }
734 let merged = createInitialMergedProps(props[0]);
735 for (let i = 1; i < props.length; i += 1) {
736 merged = mergeInto(merged, props[i]);
737 }
738 return merged;
739 }
740 function createInitialMergedProps(inputProps) {
741 if (isPropsGetter(inputProps)) {
742 return {
743 ...resolvePropsGetter(inputProps, EMPTY_PROPS)
744 };
745 }
746 return copyInitialProps(inputProps);
747 }
748 function mergeInto(merged, inputProps) {
749 if (isPropsGetter(inputProps)) {
750 return resolvePropsGetter(inputProps, merged);
751 }
752 return mutablyMergeInto(merged, inputProps);
753 }
754 function copyInitialProps(inputProps) {
755 const copiedProps = {
756 ...inputProps
757 };
758 for (const propName in copiedProps) {
759 const propValue = copiedProps[propName];
760 if (isEventHandler(propName, propValue)) {
761 copiedProps[propName] = wrapEventHandler(propValue);
762 }
763 }
764 return copiedProps;
765 }
766 function mutablyMergeInto(mergedProps, externalProps) {
767 if (!externalProps) {
768 return mergedProps;
769 }
770 for (const propName in externalProps) {
771 const externalPropValue = externalProps[propName];
772 switch (propName) {
773 case "style": {
774 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
775 break;
776 }
777 case "className": {
778 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
779 break;
780 }
781 default: {
782 if (isEventHandler(propName, externalPropValue)) {
783 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
784 } else {
785 mergedProps[propName] = externalPropValue;
786 }
787 }
788 }
789 }
790 return mergedProps;
791 }
792 function isEventHandler(key, value) {
793 const code0 = key.charCodeAt(0);
794 const code1 = key.charCodeAt(1);
795 const code2 = key.charCodeAt(2);
796 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
797 }
798 function isPropsGetter(inputProps) {
799 return typeof inputProps === "function";
800 }
801 function resolvePropsGetter(inputProps, previousProps) {
802 if (isPropsGetter(inputProps)) {
803 return inputProps(previousProps);
804 }
805 return inputProps ?? EMPTY_PROPS;
806 }
807 function mergeEventHandlers(ourHandler, theirHandler) {
808 if (!theirHandler) {
809 return ourHandler;
810 }
811 if (!ourHandler) {
812 return wrapEventHandler(theirHandler);
813 }
814 return (...args) => {
815 const event = args[0];
816 if (isSyntheticEvent(event)) {
817 const baseUIEvent = event;
818 makeEventPreventable(baseUIEvent);
819 const result2 = theirHandler(...args);
820 if (!baseUIEvent.baseUIHandlerPrevented) {
821 ourHandler?.(...args);
822 }
823 return result2;
824 }
825 const result = theirHandler(...args);
826 ourHandler?.(...args);
827 return result;
828 };
829 }
830 function wrapEventHandler(handler) {
831 if (!handler) {
832 return handler;
833 }
834 return (...args) => {
835 const event = args[0];
836 if (isSyntheticEvent(event)) {
837 makeEventPreventable(event);
838 }
839 return handler(...args);
840 };
841 }
842 function makeEventPreventable(event) {
843 event.preventBaseUIHandler = () => {
844 event.baseUIHandlerPrevented = true;
845 };
846 return event;
847 }
848 function mergeClassNames(ourClassName, theirClassName) {
849 if (theirClassName) {
850 if (ourClassName) {
851 return theirClassName + " " + ourClassName;
852 }
853 return theirClassName;
854 }
855 return ourClassName;
856 }
857 function isSyntheticEvent(event) {
858 return event != null && typeof event === "object" && "nativeEvent" in event;
859 }
860
861 // node_modules/@base-ui/react/esm/internals/useRenderElement.js
862 var import_react = __toESM(require_react(), 1);
863 function useRenderElement(element, componentProps, params = {}) {
864 const renderProp = componentProps.render;
865 const outProps = useRenderElementProps(componentProps, params);
866 if (params.enabled === false) {
867 return null;
868 }
869 const state = params.state ?? EMPTY_OBJECT;
870 return evaluateRenderProp(element, renderProp, outProps, state);
871 }
872 function useRenderElementProps(componentProps, params = {}) {
873 const {
874 className: classNameProp,
875 style: styleProp,
876 render: renderProp
877 } = componentProps;
878 const {
879 state = EMPTY_OBJECT,
880 ref,
881 props,
882 stateAttributesMapping,
883 enabled = true
884 } = params;
885 const className = enabled ? resolveClassName(classNameProp, state) : void 0;
886 const style = enabled ? resolveStyle(styleProp, state) : void 0;
887 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;
888 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
889 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
890 if (typeof document !== "undefined") {
891 if (!enabled) {
892 useMergedRefs(null, null);
893 } else if (Array.isArray(ref)) {
894 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
895 } else {
896 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
897 }
898 }
899 if (!enabled) {
900 return EMPTY_OBJECT;
901 }
902 if (className !== void 0) {
903 outProps.className = mergeClassNames(outProps.className, className);
904 }
905 if (style !== void 0) {
906 outProps.style = mergeObjects(outProps.style, style);
907 }
908 return outProps;
909 }
910 function resolveRenderFunctionProps(props) {
911 if (Array.isArray(props)) {
912 return mergePropsN(props);
913 }
914 return mergeProps(void 0, props);
915 }
916 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
917 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
918 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
919 function evaluateRenderProp(element, render, props, state) {
920 if (render) {
921 if (typeof render === "function") {
922 if (true) {
923 warnIfRenderPropLooksLikeComponent(render);
924 }
925 return render(props, state);
926 }
927 const mergedProps = mergeProps(props, render.props);
928 mergedProps.ref = props.ref;
929 let newElement = render;
930 if (newElement?.$$typeof === REACT_LAZY_TYPE) {
931 const children = React4.Children.toArray(render);
932 newElement = children[0];
933 }
934 if (true) {
935 if (!/* @__PURE__ */ React4.isValidElement(newElement)) {
936 throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n"));
937 }
938 }
939 return /* @__PURE__ */ React4.cloneElement(newElement, mergedProps);
940 }
941 if (element) {
942 if (typeof element === "string") {
943 return renderTag(element, props);
944 }
945 }
946 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
947 }
948 function warnIfRenderPropLooksLikeComponent(renderFn) {
949 const functionName = renderFn.name;
950 if (functionName.length === 0) {
951 return;
952 }
953 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
954 return;
955 }
956 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
957 return;
958 }
959 warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
960 }
961 function renderTag(Tag, props) {
962 if (Tag === "button") {
963 return /* @__PURE__ */ (0, import_react.createElement)("button", {
964 type: "button",
965 ...props,
966 key: props.key
967 });
968 }
969 if (Tag === "img") {
970 return /* @__PURE__ */ (0, import_react.createElement)("img", {
971 alt: "",
972 ...props,
973 key: props.key
974 });
975 }
976 return /* @__PURE__ */ React4.createElement(Tag, props);
977 }
978
979 // node_modules/@base-ui/react/esm/use-render/useRender.js
980 function useRender(params) {
981 return useRenderElement(params.defaultTagName ?? "div", params, params);
982 }
983
984 // packages/ui/build-module/visually-hidden/visually-hidden.mjs
985 var import_element3 = __toESM(require_element(), 1);
986 var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
987 function getRuntime() {
988 const globalScope = globalThis;
989 if (globalScope.__wpStyleRuntime) {
990 return globalScope.__wpStyleRuntime;
991 }
992 globalScope.__wpStyleRuntime = {
993 documents: /* @__PURE__ */ new Map(),
994 styles: /* @__PURE__ */ new Map(),
995 injectedStyles: /* @__PURE__ */ new WeakMap()
996 };
997 if (typeof document !== "undefined") {
998 registerDocument(document);
999 }
1000 return globalScope.__wpStyleRuntime;
1001 }
1002 function documentContainsStyleHash(targetDocument, hash) {
1003 if (!targetDocument.head) {
1004 return false;
1005 }
1006 for (const style of targetDocument.head.querySelectorAll(
1007 `style[${STYLE_HASH_ATTRIBUTE}]`
1008 )) {
1009 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
1010 return true;
1011 }
1012 }
1013 return false;
1014 }
1015 function injectStyle(targetDocument, hash, css) {
1016 if (!targetDocument.head) {
1017 return;
1018 }
1019 const runtime = getRuntime();
1020 let injectedStyles = runtime.injectedStyles.get(targetDocument);
1021 if (!injectedStyles) {
1022 injectedStyles = /* @__PURE__ */ new Set();
1023 runtime.injectedStyles.set(targetDocument, injectedStyles);
1024 }
1025 if (injectedStyles.has(hash)) {
1026 return;
1027 }
1028 if (documentContainsStyleHash(targetDocument, hash)) {
1029 injectedStyles.add(hash);
1030 return;
1031 }
1032 const style = targetDocument.createElement("style");
1033 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
1034 style.appendChild(targetDocument.createTextNode(css));
1035 targetDocument.head.appendChild(style);
1036 injectedStyles.add(hash);
1037 }
1038 function registerDocument(targetDocument) {
1039 const runtime = getRuntime();
1040 runtime.documents.set(
1041 targetDocument,
1042 (runtime.documents.get(targetDocument) ?? 0) + 1
1043 );
1044 for (const [hash, css] of runtime.styles) {
1045 injectStyle(targetDocument, hash, css);
1046 }
1047 return () => {
1048 const count = runtime.documents.get(targetDocument);
1049 if (count === void 0) {
1050 return;
1051 }
1052 if (count <= 1) {
1053 runtime.documents.delete(targetDocument);
1054 return;
1055 }
1056 runtime.documents.set(targetDocument, count - 1);
1057 };
1058 }
1059 function registerStyle(hash, css) {
1060 const runtime = getRuntime();
1061 runtime.styles.set(hash, css);
1062 for (const targetDocument of runtime.documents.keys()) {
1063 injectStyle(targetDocument, hash, css);
1064 }
1065 }
1066 if (typeof process === "undefined" || true) {
1067 registerStyle("c46e8cb841", "@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}");
1068 }
1069 var style_default = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
1070 var VisuallyHidden = (0, import_element3.forwardRef)(
1071 function VisuallyHidden2({ render, ...restProps }, ref) {
1072 const element = useRender({
1073 render,
1074 ref,
1075 props: mergeProps(
1076 { className: style_default["visually-hidden"] },
1077 restProps,
1078 {
1079 // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it.
1080 "data-visually-hidden": ""
1081 }
1082 )
1083 });
1084 return element;
1085 }
1086 );
1087
1088 // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/index.mjs
1089 var import_components4 = __toESM(require_components(), 1);
1090 var import_i18n5 = __toESM(require_i18n(), 1);
1091 var import_keyboard_shortcuts2 = __toESM(require_keyboard_shortcuts(), 1);
1092 var import_data6 = __toESM(require_data(), 1);
1093 var import_element5 = __toESM(require_element(), 1);
1094
1095 // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/config.mjs
1096 var import_i18n4 = __toESM(require_i18n(), 1);
1097 var textFormattingShortcuts = [
1098 {
1099 keyCombination: { modifier: "primary", character: "b" },
1100 description: (0, import_i18n4.__)("Make the selected text bold.")
1101 },
1102 {
1103 keyCombination: { modifier: "primary", character: "i" },
1104 description: (0, import_i18n4.__)("Make the selected text italic.")
1105 },
1106 {
1107 keyCombination: { modifier: "primary", character: "k" },
1108 description: (0, import_i18n4.__)("Convert the selected text into a link.")
1109 },
1110 {
1111 keyCombination: { modifier: "primaryShift", character: "k" },
1112 description: (0, import_i18n4.__)("Remove a link.")
1113 },
1114 {
1115 keyCombination: { character: "[[" },
1116 description: (0, import_i18n4.__)("Insert a link to a post or page.")
1117 },
1118 {
1119 keyCombination: { modifier: "primary", character: "u" },
1120 description: (0, import_i18n4.__)("Underline the selected text.")
1121 },
1122 {
1123 keyCombination: { modifier: "access", character: "d" },
1124 description: (0, import_i18n4.__)("Strikethrough the selected text.")
1125 },
1126 {
1127 keyCombination: { modifier: "access", character: "x" },
1128 description: (0, import_i18n4.__)("Make the selected text inline code.")
1129 },
1130 {
1131 keyCombination: {
1132 modifier: "access",
1133 character: "0"
1134 },
1135 aliases: [
1136 {
1137 modifier: "access",
1138 character: "7"
1139 }
1140 ],
1141 description: (0, import_i18n4.__)("Convert the current heading to a paragraph.")
1142 },
1143 {
1144 keyCombination: { modifier: "access", character: "1-6" },
1145 description: (0, import_i18n4.__)(
1146 "Convert the current paragraph or heading to a heading of level 1 to 6."
1147 )
1148 },
1149 {
1150 keyCombination: { modifier: "primaryShift", character: "SPACE" },
1151 description: (0, import_i18n4.__)("Add non breaking space.")
1152 }
1153 ];
1154
1155 // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs
1156 var import_element4 = __toESM(require_element(), 1);
1157 var import_keycodes = __toESM(require_keycodes(), 1);
1158 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
1159 function KeyCombination({ keyCombination, forceAriaLabel }) {
1160 const shortcut = keyCombination.modifier ? import_keycodes.displayShortcutList[keyCombination.modifier](
1161 keyCombination.character
1162 ) : keyCombination.character;
1163 const ariaLabel = keyCombination.modifier ? import_keycodes.shortcutAriaLabel[keyCombination.modifier](
1164 keyCombination.character
1165 ) : keyCombination.character;
1166 return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1167 "kbd",
1168 {
1169 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination",
1170 "aria-label": forceAriaLabel || ariaLabel,
1171 children: (Array.isArray(shortcut) ? shortcut : [shortcut]).map(
1172 (character, index) => {
1173 if (character === "+") {
1174 return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_element4.Fragment, { children: character }, index);
1175 }
1176 return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1177 "kbd",
1178 {
1179 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key",
1180 children: character
1181 },
1182 index
1183 );
1184 }
1185 )
1186 }
1187 );
1188 }
1189 function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) {
1190 return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1191 /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-description", children: description }),
1192 /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-term", children: [
1193 /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1194 KeyCombination,
1195 {
1196 keyCombination,
1197 forceAriaLabel: ariaLabel
1198 }
1199 ),
1200 aliases.map((alias, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1201 KeyCombination,
1202 {
1203 keyCombination: alias,
1204 forceAriaLabel: ariaLabel
1205 },
1206 index
1207 ))
1208 ] })
1209 ] });
1210 }
1211 var shortcut_default = Shortcut;
1212
1213 // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs
1214 var import_data5 = __toESM(require_data(), 1);
1215 var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1);
1216 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
1217 function DynamicShortcut({ name }) {
1218 const { keyCombination, description, aliases } = (0, import_data5.useSelect)(
1219 (select) => {
1220 const {
1221 getShortcutKeyCombination,
1222 getShortcutDescription,
1223 getShortcutAliases
1224 } = select(import_keyboard_shortcuts.store);
1225 return {
1226 keyCombination: getShortcutKeyCombination(name),
1227 aliases: getShortcutAliases(name),
1228 description: getShortcutDescription(name)
1229 };
1230 },
1231 [name]
1232 );
1233 if (!keyCombination) {
1234 return null;
1235 }
1236 return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1237 shortcut_default,
1238 {
1239 keyCombination,
1240 description,
1241 aliases
1242 }
1243 );
1244 }
1245 var dynamic_shortcut_default = DynamicShortcut;
1246
1247 // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/index.mjs
1248 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
1249 var ShortcutList = ({ shortcuts }) => (
1250 /*
1251 * Disable reason: The `list` ARIA role is redundant but
1252 * Safari+VoiceOver won't announce the list otherwise.
1253 */
1254 /* eslint-disable jsx-a11y/no-redundant-roles */
1255 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1256 "ul",
1257 {
1258 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-list",
1259 role: "list",
1260 children: shortcuts.map((shortcut, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1261 "li",
1262 {
1263 className: "customize-widgets-keyboard-shortcut-help-modal__shortcut",
1264 children: typeof shortcut === "string" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(dynamic_shortcut_default, { name: shortcut }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(shortcut_default, { ...shortcut })
1265 },
1266 index
1267 ))
1268 }
1269 )
1270 );
1271 var ShortcutSection = ({ title, shortcuts, className }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1272 "section",
1273 {
1274 className: clsx_default(
1275 "customize-widgets-keyboard-shortcut-help-modal__section",
1276 className
1277 ),
1278 children: [
1279 !!title && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { className: "customize-widgets-keyboard-shortcut-help-modal__section-title", children: title }),
1280 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ShortcutList, { shortcuts })
1281 ]
1282 }
1283 );
1284 var ShortcutCategorySection = ({
1285 title,
1286 categoryName,
1287 additionalShortcuts = []
1288 }) => {
1289 const categoryShortcuts = (0, import_data6.useSelect)(
1290 (select) => {
1291 return select(import_keyboard_shortcuts2.store).getCategoryShortcuts(
1292 categoryName
1293 );
1294 },
1295 [categoryName]
1296 );
1297 return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1298 ShortcutSection,
1299 {
1300 title,
1301 shortcuts: categoryShortcuts.concat(additionalShortcuts)
1302 }
1303 );
1304 };
1305 function KeyboardShortcutHelpModal({
1306 isModalActive,
1307 toggleModal
1308 }) {
1309 const { registerShortcut } = (0, import_data6.useDispatch)(import_keyboard_shortcuts2.store);
1310 (0, import_element5.useEffect)(() => {
1311 registerShortcut({
1312 name: "core/customize-widgets/keyboard-shortcuts",
1313 category: "main",
1314 description: (0, import_i18n5.__)("Display these keyboard shortcuts."),
1315 keyCombination: {
1316 modifier: "access",
1317 character: "h"
1318 }
1319 });
1320 }, [registerShortcut]);
1321 (0, import_keyboard_shortcuts2.useShortcut)("core/customize-widgets/keyboard-shortcuts", toggleModal);
1322 if (!isModalActive) {
1323 return null;
1324 }
1325 return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1326 import_components4.Modal,
1327 {
1328 className: "customize-widgets-keyboard-shortcut-help-modal",
1329 title: (0, import_i18n5.__)("Keyboard shortcuts"),
1330 onRequestClose: toggleModal,
1331 children: [
1332 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1333 ShortcutSection,
1334 {
1335 className: "customize-widgets-keyboard-shortcut-help-modal__main-shortcuts",
1336 shortcuts: ["core/customize-widgets/keyboard-shortcuts"]
1337 }
1338 ),
1339 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1340 ShortcutCategorySection,
1341 {
1342 title: (0, import_i18n5.__)("Global shortcuts"),
1343 categoryName: "global"
1344 }
1345 ),
1346 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1347 ShortcutCategorySection,
1348 {
1349 title: (0, import_i18n5.__)("Selection shortcuts"),
1350 categoryName: "selection"
1351 }
1352 ),
1353 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1354 ShortcutCategorySection,
1355 {
1356 title: (0, import_i18n5.__)("Block shortcuts"),
1357 categoryName: "block",
1358 additionalShortcuts: [
1359 {
1360 keyCombination: { character: "/" },
1361 description: (0, import_i18n5.__)(
1362 "Change the block type after adding a new paragraph."
1363 ),
1364 /* translators: The forward-slash character. e.g. '/'. */
1365 ariaLabel: (0, import_i18n5.__)("Forward-slash")
1366 }
1367 ]
1368 }
1369 ),
1370 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1371 ShortcutSection,
1372 {
1373 title: (0, import_i18n5.__)("Text formatting"),
1374 shortcuts: textFormattingShortcuts
1375 }
1376 )
1377 ]
1378 }
1379 );
1380 }
1381
1382 // packages/customize-widgets/build-module/components/more-menu/index.mjs
1383 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
1384 function MoreMenu() {
1385 const [
1386 isKeyboardShortcutsModalActive,
1387 setIsKeyboardShortcutsModalVisible
1388 ] = (0, import_element6.useState)(false);
1389 const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive);
1390 (0, import_keyboard_shortcuts3.useShortcut)(
1391 "core/customize-widgets/keyboard-shortcuts",
1392 toggleKeyboardShortcutsModal
1393 );
1394 return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1395 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1396 import_components5.ToolbarDropdownMenu,
1397 {
1398 icon: more_vertical_default,
1399 label: (0, import_i18n6.__)("Options"),
1400 popoverProps: {
1401 placement: "bottom-end",
1402 className: "more-menu-dropdown__content"
1403 },
1404 toggleProps: {
1405 tooltipPosition: "bottom",
1406 size: "compact"
1407 },
1408 children: () => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1409 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_components5.MenuGroup, { label: (0, import_i18n6._x)("View", "noun"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1410 import_preferences.PreferenceToggleMenuItem,
1411 {
1412 scope: "core/customize-widgets",
1413 name: "fixedToolbar",
1414 label: (0, import_i18n6.__)("Top toolbar"),
1415 info: (0, import_i18n6.__)(
1416 "Access all block and document tools in a single place"
1417 ),
1418 messageActivated: (0, import_i18n6.__)(
1419 "Top toolbar activated"
1420 ),
1421 messageDeactivated: (0, import_i18n6.__)(
1422 "Top toolbar deactivated"
1423 )
1424 }
1425 ) }),
1426 /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_components5.MenuGroup, { label: (0, import_i18n6.__)("Tools"), children: [
1427 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1428 import_components5.MenuItem,
1429 {
1430 onClick: () => {
1431 setIsKeyboardShortcutsModalVisible(true);
1432 },
1433 shortcut: import_keycodes2.displayShortcut.access("h"),
1434 children: (0, import_i18n6.__)("Keyboard shortcuts")
1435 }
1436 ),
1437 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1438 import_preferences.PreferenceToggleMenuItem,
1439 {
1440 scope: "core/customize-widgets",
1441 name: "welcomeGuide",
1442 label: (0, import_i18n6.__)("Welcome Guide")
1443 }
1444 ),
1445 /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1446 import_components5.MenuItem,
1447 {
1448 role: "menuitem",
1449 icon: external_default,
1450 href: (0, import_i18n6.__)(
1451 "https://wordpress.org/documentation/article/block-based-widgets-editor/"
1452 ),
1453 target: "_blank",
1454 rel: "noopener",
1455 children: [
1456 (0, import_i18n6.__)("Help"),
1457 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(VisuallyHidden, {
1458 render: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", {}),
1459 /* translators: accessibility text */
1460 children: (0, import_i18n6.__)("(opens in a new tab)")
1461 })
1462 ]
1463 }
1464 )
1465 ] }),
1466 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_components5.MenuGroup, { label: (0, import_i18n6.__)("Preferences"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1467 import_preferences.PreferenceToggleMenuItem,
1468 {
1469 scope: "core/customize-widgets",
1470 name: "keepCaretInsideBlock",
1471 label: (0, import_i18n6.__)(
1472 "Contain text cursor inside block"
1473 ),
1474 info: (0, import_i18n6.__)(
1475 "Aids screen readers by stopping text caret from leaving blocks."
1476 ),
1477 messageActivated: (0, import_i18n6.__)(
1478 "Contain text cursor inside block activated"
1479 ),
1480 messageDeactivated: (0, import_i18n6.__)(
1481 "Contain text cursor inside block deactivated"
1482 )
1483 }
1484 ) })
1485 ] })
1486 }
1487 ),
1488 /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1489 KeyboardShortcutHelpModal,
1490 {
1491 isModalActive: isKeyboardShortcutsModalActive,
1492 toggleModal: toggleKeyboardShortcutsModal
1493 }
1494 )
1495 ] });
1496 }
1497
1498 // packages/customize-widgets/build-module/components/header/index.mjs
1499 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
1500 function Header({
1501 sidebar,
1502 inserter,
1503 isInserterOpened: isInserterOpened2,
1504 setIsInserterOpened: setIsInserterOpened2,
1505 isFixedToolbarActive
1506 }) {
1507 const [[hasUndo, hasRedo], setUndoRedo] = (0, import_element7.useState)([
1508 sidebar.hasUndo(),
1509 sidebar.hasRedo()
1510 ]);
1511 const shortcut = (0, import_keycodes3.isAppleOS)() ? import_keycodes3.displayShortcut.primaryShift("z") : import_keycodes3.displayShortcut.primary("y");
1512 (0, import_element7.useEffect)(() => {
1513 return sidebar.subscribeHistory(() => {
1514 setUndoRedo([sidebar.hasUndo(), sidebar.hasRedo()]);
1515 });
1516 }, [sidebar]);
1517 return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
1518 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1519 "div",
1520 {
1521 className: clsx_default("customize-widgets-header", {
1522 "is-fixed-toolbar-active": isFixedToolbarActive
1523 }),
1524 children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1525 import_block_editor4.NavigableToolbar,
1526 {
1527 className: "customize-widgets-header-toolbar",
1528 "aria-label": (0, import_i18n7.__)("Document tools"),
1529 children: [
1530 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1531 import_components6.ToolbarButton,
1532 {
1533 icon: !(0, import_i18n7.isRTL)() ? undo_default : redo_default,
1534 label: (0, import_i18n7.__)("Undo"),
1535 shortcut: import_keycodes3.displayShortcut.primary("z"),
1536 disabled: !hasUndo,
1537 onClick: sidebar.undo,
1538 className: "customize-widgets-editor-history-button undo-button"
1539 }
1540 ),
1541 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1542 import_components6.ToolbarButton,
1543 {
1544 icon: !(0, import_i18n7.isRTL)() ? redo_default : undo_default,
1545 label: (0, import_i18n7.__)("Redo"),
1546 shortcut,
1547 disabled: !hasRedo,
1548 onClick: sidebar.redo,
1549 className: "customize-widgets-editor-history-button redo-button"
1550 }
1551 ),
1552 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1553 import_components6.ToolbarButton,
1554 {
1555 className: "customize-widgets-header-toolbar__inserter-toggle",
1556 isPressed: isInserterOpened2,
1557 variant: "primary",
1558 icon: plus_default,
1559 label: (0, import_i18n7._x)(
1560 "Add block",
1561 "Generic label for block inserter button"
1562 ),
1563 onClick: () => {
1564 setIsInserterOpened2((isOpen) => !isOpen);
1565 }
1566 }
1567 ),
1568 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MoreMenu, {})
1569 ]
1570 }
1571 )
1572 }
1573 ),
1574 (0, import_element7.createPortal)(
1575 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(inserter_default, { setIsOpened: setIsInserterOpened2 }),
1576 inserter.contentContainer[0]
1577 )
1578 ] });
1579 }
1580 var header_default = Header;
1581
1582 // packages/customize-widgets/build-module/components/inserter/use-inserter.mjs
1583 var import_element8 = __toESM(require_element(), 1);
1584 var import_data7 = __toESM(require_data(), 1);
1585 function useInserter(inserter) {
1586 const isInserterOpened2 = (0, import_data7.useSelect)(
1587 (select) => select(store).isInserterOpened(),
1588 []
1589 );
1590 const { setIsInserterOpened: setIsInserterOpened2 } = (0, import_data7.useDispatch)(store);
1591 (0, import_element8.useEffect)(() => {
1592 if (isInserterOpened2) {
1593 inserter.open();
1594 } else {
1595 inserter.close();
1596 }
1597 }, [inserter, isInserterOpened2]);
1598 return [
1599 isInserterOpened2,
1600 (0, import_element8.useCallback)(
1601 (updater) => {
1602 let isOpen = updater;
1603 if (typeof updater === "function") {
1604 isOpen = updater(
1605 (0, import_data7.select)(store).isInserterOpened()
1606 );
1607 }
1608 setIsInserterOpened2(isOpen);
1609 },
1610 [setIsInserterOpened2]
1611 )
1612 ];
1613 }
1614
1615 // packages/customize-widgets/build-module/components/sidebar-block-editor/sidebar-editor-provider.mjs
1616 var import_block_editor6 = __toESM(require_block_editor(), 1);
1617
1618 // packages/customize-widgets/build-module/components/sidebar-block-editor/use-sidebar-block-editor.mjs
1619 var import_es6 = __toESM(require_es6(), 1);
1620 var import_element9 = __toESM(require_element(), 1);
1621 var import_is_shallow_equal = __toESM(require_is_shallow_equal(), 1);
1622 var import_widgets2 = __toESM(require_widgets(), 1);
1623
1624 // packages/customize-widgets/build-module/utils.mjs
1625 var import_blocks = __toESM(require_blocks(), 1);
1626 var import_widgets = __toESM(require_widgets(), 1);
1627 function settingIdToWidgetId(settingId) {
1628 const matches = settingId.match(/^widget_(.+)(?:\[(\d+)\])$/);
1629 if (matches) {
1630 const idBase = matches[1];
1631 const number = parseInt(matches[2], 10);
1632 return `${idBase}-${number}`;
1633 }
1634 return settingId;
1635 }
1636 function blockToWidget(block, existingWidget = null) {
1637 let widget;
1638 const isValidLegacyWidgetBlock = block.name === "core/legacy-widget" && (block.attributes.id || block.attributes.instance);
1639 if (isValidLegacyWidgetBlock) {
1640 if (block.attributes.id) {
1641 widget = {
1642 id: block.attributes.id
1643 };
1644 } else {
1645 const { encoded, hash, raw, ...rest } = block.attributes.instance;
1646 widget = {
1647 idBase: block.attributes.idBase,
1648 instance: {
1649 ...existingWidget?.instance,
1650 // Required only for the customizer.
1651 is_widget_customizer_js_value: true,
1652 encoded_serialized_instance: encoded,
1653 instance_hash_key: hash,
1654 raw_instance: raw,
1655 ...rest
1656 }
1657 };
1658 }
1659 } else {
1660 const instance = {
1661 content: (0, import_blocks.serialize)(block)
1662 };
1663 widget = {
1664 idBase: "block",
1665 widgetClass: "WP_Widget_Block",
1666 instance: {
1667 raw_instance: instance
1668 }
1669 };
1670 }
1671 const { form, rendered, ...restExistingWidget } = existingWidget || {};
1672 return {
1673 ...restExistingWidget,
1674 ...widget
1675 };
1676 }
1677 function widgetToBlock({ id, idBase, number, instance }) {
1678 let block;
1679 const {
1680 encoded_serialized_instance: encoded,
1681 instance_hash_key: hash,
1682 raw_instance: raw,
1683 ...rest
1684 } = instance;
1685 if (idBase === "block") {
1686 const parsedBlocks = (0, import_blocks.parse)(raw.content ?? "", {
1687 __unstableSkipAutop: true
1688 });
1689 block = parsedBlocks.length ? parsedBlocks[0] : (0, import_blocks.createBlock)("core/paragraph", {});
1690 } else if (number) {
1691 block = (0, import_blocks.createBlock)("core/legacy-widget", {
1692 idBase,
1693 instance: {
1694 encoded,
1695 hash,
1696 raw,
1697 ...rest
1698 }
1699 });
1700 } else {
1701 block = (0, import_blocks.createBlock)("core/legacy-widget", {
1702 id
1703 });
1704 }
1705 return (0, import_widgets.addWidgetIdToBlock)(block, id);
1706 }
1707
1708 // packages/customize-widgets/build-module/components/sidebar-block-editor/use-sidebar-block-editor.mjs
1709 function widgetsToBlocks(widgets) {
1710 return widgets.map((widget) => widgetToBlock(widget));
1711 }
1712 function useSidebarBlockEditor(sidebar) {
1713 const [blocks, setBlocks] = (0, import_element9.useState)(
1714 () => widgetsToBlocks(sidebar.getWidgets())
1715 );
1716 (0, import_element9.useEffect)(() => {
1717 return sidebar.subscribe((prevWidgets, nextWidgets) => {
1718 setBlocks((prevBlocks) => {
1719 const prevWidgetsMap = new Map(
1720 prevWidgets.map((widget) => [widget.id, widget])
1721 );
1722 const prevBlocksMap = new Map(
1723 prevBlocks.map((block) => [
1724 (0, import_widgets2.getWidgetIdFromBlock)(block),
1725 block
1726 ])
1727 );
1728 const nextBlocks = nextWidgets.map((nextWidget) => {
1729 const prevWidget = prevWidgetsMap.get(nextWidget.id);
1730 if (prevWidget && prevWidget === nextWidget) {
1731 return prevBlocksMap.get(nextWidget.id);
1732 }
1733 return widgetToBlock(nextWidget);
1734 });
1735 if ((0, import_is_shallow_equal.isShallowEqual)(prevBlocks, nextBlocks)) {
1736 return prevBlocks;
1737 }
1738 return nextBlocks;
1739 });
1740 });
1741 }, [sidebar]);
1742 const onChangeBlocks = (0, import_element9.useCallback)(
1743 (nextBlocks) => {
1744 setBlocks((prevBlocks) => {
1745 if ((0, import_is_shallow_equal.isShallowEqual)(prevBlocks, nextBlocks)) {
1746 return prevBlocks;
1747 }
1748 const prevBlocksMap = new Map(
1749 prevBlocks.map((block) => [
1750 (0, import_widgets2.getWidgetIdFromBlock)(block),
1751 block
1752 ])
1753 );
1754 const nextWidgets = nextBlocks.map((nextBlock) => {
1755 const widgetId = (0, import_widgets2.getWidgetIdFromBlock)(nextBlock);
1756 if (widgetId && prevBlocksMap.has(widgetId)) {
1757 const prevBlock = prevBlocksMap.get(widgetId);
1758 const prevWidget = sidebar.getWidget(widgetId);
1759 if ((0, import_es6.default)(nextBlock, prevBlock) && prevWidget) {
1760 return prevWidget;
1761 }
1762 return blockToWidget(nextBlock, prevWidget);
1763 }
1764 return blockToWidget(nextBlock);
1765 });
1766 if ((0, import_is_shallow_equal.isShallowEqual)(sidebar.getWidgets(), nextWidgets)) {
1767 return prevBlocks;
1768 }
1769 const addedWidgetIds = sidebar.setWidgets(nextWidgets);
1770 return nextBlocks.reduce(
1771 (updatedNextBlocks, nextBlock, index) => {
1772 const addedWidgetId = addedWidgetIds[index];
1773 if (addedWidgetId !== null) {
1774 if (updatedNextBlocks === nextBlocks) {
1775 updatedNextBlocks = nextBlocks.slice();
1776 }
1777 updatedNextBlocks[index] = (0, import_widgets2.addWidgetIdToBlock)(
1778 nextBlock,
1779 addedWidgetId
1780 );
1781 }
1782 return updatedNextBlocks;
1783 },
1784 nextBlocks
1785 );
1786 });
1787 },
1788 [sidebar]
1789 );
1790 return [blocks, onChangeBlocks, onChangeBlocks];
1791 }
1792
1793 // packages/customize-widgets/build-module/components/focus-control/use-blocks-focus-control.mjs
1794 var import_element11 = __toESM(require_element(), 1);
1795 var import_data8 = __toESM(require_data(), 1);
1796 var import_block_editor5 = __toESM(require_block_editor(), 1);
1797 var import_widgets3 = __toESM(require_widgets(), 1);
1798
1799 // packages/customize-widgets/build-module/components/focus-control/index.mjs
1800 var import_element10 = __toESM(require_element(), 1);
1801 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
1802 var FocusControlContext = (0, import_element10.createContext)();
1803 FocusControlContext.displayName = "FocusControlContext";
1804 function FocusControl({ api, sidebarControls, children }) {
1805 const [focusedWidgetIdRef, setFocusedWidgetIdRef] = (0, import_element10.useState)({
1806 current: null
1807 });
1808 const focusWidget = (0, import_element10.useCallback)(
1809 (widgetId) => {
1810 for (const sidebarControl of sidebarControls) {
1811 const widgets = sidebarControl.setting.get();
1812 if (widgets.includes(widgetId)) {
1813 sidebarControl.sectionInstance.expand({
1814 // Schedule it after the complete callback so that
1815 // it won't be overridden by the "Back" button focus.
1816 completeCallback() {
1817 setFocusedWidgetIdRef({ current: widgetId });
1818 }
1819 });
1820 break;
1821 }
1822 }
1823 },
1824 [sidebarControls]
1825 );
1826 (0, import_element10.useEffect)(() => {
1827 function handleFocus(settingId) {
1828 const widgetId = settingIdToWidgetId(settingId);
1829 focusWidget(widgetId);
1830 }
1831 let previewBound = false;
1832 function handleReady() {
1833 api.previewer.preview.bind(
1834 "focus-control-for-setting",
1835 handleFocus
1836 );
1837 previewBound = true;
1838 }
1839 api.previewer.bind("ready", handleReady);
1840 return () => {
1841 api.previewer.unbind("ready", handleReady);
1842 if (previewBound) {
1843 api.previewer.preview.unbind(
1844 "focus-control-for-setting",
1845 handleFocus
1846 );
1847 }
1848 };
1849 }, [api, focusWidget]);
1850 const context = (0, import_element10.useMemo)(
1851 () => [focusedWidgetIdRef, focusWidget],
1852 [focusedWidgetIdRef, focusWidget]
1853 );
1854 return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FocusControlContext.Provider, { value: context, children });
1855 }
1856 var useFocusControl = () => (0, import_element10.useContext)(FocusControlContext);
1857
1858 // packages/customize-widgets/build-module/components/focus-control/use-blocks-focus-control.mjs
1859 function useBlocksFocusControl(blocks) {
1860 const { selectBlock } = (0, import_data8.useDispatch)(import_block_editor5.store);
1861 const [focusedWidgetIdRef] = useFocusControl();
1862 const blocksRef = (0, import_element11.useRef)(blocks);
1863 (0, import_element11.useEffect)(() => {
1864 blocksRef.current = blocks;
1865 }, [blocks]);
1866 (0, import_element11.useEffect)(() => {
1867 if (focusedWidgetIdRef.current) {
1868 const focusedBlock = blocksRef.current.find(
1869 (block) => (0, import_widgets3.getWidgetIdFromBlock)(block) === focusedWidgetIdRef.current
1870 );
1871 if (focusedBlock) {
1872 selectBlock(focusedBlock.clientId);
1873 const blockNode = document.querySelector(
1874 `[data-block="${focusedBlock.clientId}"]`
1875 );
1876 blockNode?.focus();
1877 }
1878 }
1879 }, [focusedWidgetIdRef, selectBlock]);
1880 }
1881
1882 // packages/customize-widgets/build-module/lock-unlock.mjs
1883 var import_private_apis = __toESM(require_private_apis(), 1);
1884 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
1885 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
1886 "@wordpress/customize-widgets"
1887 );
1888
1889 // packages/customize-widgets/build-module/components/sidebar-block-editor/sidebar-editor-provider.mjs
1890 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
1891 var { ExperimentalBlockEditorProvider } = unlock(import_block_editor6.privateApis);
1892 function SidebarEditorProvider({
1893 sidebar,
1894 settings,
1895 children
1896 }) {
1897 const [blocks, onInput, onChange] = useSidebarBlockEditor(sidebar);
1898 useBlocksFocusControl(blocks);
1899 return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1900 ExperimentalBlockEditorProvider,
1901 {
1902 value: blocks,
1903 onInput,
1904 onChange,
1905 settings,
1906 useSubRegistry: false,
1907 children
1908 }
1909 );
1910 }
1911
1912 // packages/customize-widgets/build-module/components/welcome-guide/index.mjs
1913 var import_i18n8 = __toESM(require_i18n(), 1);
1914 var import_components7 = __toESM(require_components(), 1);
1915 var import_data9 = __toESM(require_data(), 1);
1916 var import_preferences2 = __toESM(require_preferences(), 1);
1917 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
1918 function WelcomeGuide({ sidebar }) {
1919 const { toggle } = (0, import_data9.useDispatch)(import_preferences2.store);
1920 const isEntirelyBlockWidgets = sidebar.getWidgets().every((widget) => widget.id.startsWith("block-"));
1921 return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "customize-widgets-welcome-guide", children: [
1922 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "customize-widgets-welcome-guide__image__wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("picture", { children: [
1923 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1924 "source",
1925 {
1926 srcSet: "https://s.w.org/images/block-editor/welcome-editor.svg",
1927 media: "(prefers-reduced-motion: reduce)"
1928 }
1929 ),
1930 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1931 "img",
1932 {
1933 className: "customize-widgets-welcome-guide__image",
1934 src: "https://s.w.org/images/block-editor/welcome-editor.gif",
1935 width: "312",
1936 height: "240",
1937 alt: ""
1938 }
1939 )
1940 ] }) }),
1941 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { className: "customize-widgets-welcome-guide__heading", children: (0, import_i18n8.__)("Welcome to block Widgets") }),
1942 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "customize-widgets-welcome-guide__text", children: isEntirelyBlockWidgets ? (0, import_i18n8.__)(
1943 "Your theme provides different \u201Cblock\u201D areas for you to add and edit content.\xA0Try adding a search bar, social icons, or other types of blocks here and see how they\u2019ll look on your site."
1944 ) : (0, import_i18n8.__)(
1945 "You can now add any block to your site\u2019s widget areas. Don\u2019t worry, all of your favorite widgets still work flawlessly."
1946 ) }),
1947 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1948 import_components7.Button,
1949 {
1950 size: "compact",
1951 variant: "primary",
1952 onClick: () => toggle("core/customize-widgets", "welcomeGuide"),
1953 children: (0, import_i18n8.__)("Got it")
1954 }
1955 ),
1956 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("hr", { className: "customize-widgets-welcome-guide__separator" }),
1957 !isEntirelyBlockWidgets && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "customize-widgets-welcome-guide__more-info", children: [
1958 (0, import_i18n8.__)("Want to stick with the old widgets?"),
1959 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("br", {}),
1960 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1961 import_components7.ExternalLink,
1962 {
1963 href: (0, import_i18n8.__)(
1964 "https://wordpress.org/plugins/classic-widgets/"
1965 ),
1966 children: (0, import_i18n8.__)("Get the Classic Widgets plugin.")
1967 }
1968 )
1969 ] }),
1970 /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "customize-widgets-welcome-guide__more-info", children: [
1971 (0, import_i18n8.__)("New to the block editor?"),
1972 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("br", {}),
1973 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1974 import_components7.ExternalLink,
1975 {
1976 href: (0, import_i18n8.__)(
1977 "https://wordpress.org/documentation/article/wordpress-block-editor/"
1978 ),
1979 children: (0, import_i18n8.__)("Here's a detailed guide.")
1980 }
1981 )
1982 ] })
1983 ] });
1984 }
1985
1986 // packages/customize-widgets/build-module/components/keyboard-shortcuts/index.mjs
1987 var import_element12 = __toESM(require_element(), 1);
1988 var import_keyboard_shortcuts4 = __toESM(require_keyboard_shortcuts(), 1);
1989 var import_keycodes4 = __toESM(require_keycodes(), 1);
1990 var import_data10 = __toESM(require_data(), 1);
1991 var import_i18n9 = __toESM(require_i18n(), 1);
1992 function KeyboardShortcuts({ undo, redo, save }) {
1993 (0, import_keyboard_shortcuts4.useShortcut)("core/customize-widgets/undo", (event) => {
1994 undo();
1995 event.preventDefault();
1996 });
1997 (0, import_keyboard_shortcuts4.useShortcut)("core/customize-widgets/redo", (event) => {
1998 redo();
1999 event.preventDefault();
2000 });
2001 (0, import_keyboard_shortcuts4.useShortcut)("core/customize-widgets/save", (event) => {
2002 event.preventDefault();
2003 save();
2004 });
2005 return null;
2006 }
2007 function KeyboardShortcutsRegister() {
2008 const { registerShortcut, unregisterShortcut } = (0, import_data10.useDispatch)(
2009 import_keyboard_shortcuts4.store
2010 );
2011 (0, import_element12.useEffect)(() => {
2012 registerShortcut({
2013 name: "core/customize-widgets/undo",
2014 category: "global",
2015 description: (0, import_i18n9.__)("Undo your last changes."),
2016 keyCombination: {
2017 modifier: "primary",
2018 character: "z"
2019 }
2020 });
2021 registerShortcut({
2022 name: "core/customize-widgets/redo",
2023 category: "global",
2024 description: (0, import_i18n9.__)("Redo your last undo."),
2025 keyCombination: {
2026 modifier: "primaryShift",
2027 character: "z"
2028 },
2029 // Disable on Apple OS because it conflicts with the browser's
2030 // history shortcut. It's a fine alias for both Windows and Linux.
2031 // Since there's no conflict for Ctrl+Shift+Z on both Windows and
2032 // Linux, we keep it as the default for consistency.
2033 aliases: (0, import_keycodes4.isAppleOS)() ? [] : [
2034 {
2035 modifier: "primary",
2036 character: "y"
2037 }
2038 ]
2039 });
2040 registerShortcut({
2041 name: "core/customize-widgets/save",
2042 category: "global",
2043 description: (0, import_i18n9.__)("Save your changes."),
2044 keyCombination: {
2045 modifier: "primary",
2046 character: "s"
2047 }
2048 });
2049 return () => {
2050 unregisterShortcut("core/customize-widgets/undo");
2051 unregisterShortcut("core/customize-widgets/redo");
2052 unregisterShortcut("core/customize-widgets/save");
2053 };
2054 }, [registerShortcut]);
2055 return null;
2056 }
2057 KeyboardShortcuts.Register = KeyboardShortcutsRegister;
2058 var keyboard_shortcuts_default = KeyboardShortcuts;
2059
2060 // packages/customize-widgets/build-module/components/block-appender/index.mjs
2061 var import_element13 = __toESM(require_element(), 1);
2062 var import_block_editor7 = __toESM(require_block_editor(), 1);
2063 var import_data11 = __toESM(require_data(), 1);
2064 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
2065 function BlockAppender(props) {
2066 const ref = (0, import_element13.useRef)();
2067 const isBlocksListEmpty = (0, import_data11.useSelect)(
2068 (select) => select(import_block_editor7.store).getBlockCount() === 0
2069 );
2070 (0, import_element13.useEffect)(() => {
2071 if (isBlocksListEmpty && ref.current) {
2072 const { ownerDocument } = ref.current;
2073 if (!ownerDocument.activeElement || ownerDocument.activeElement === ownerDocument.body) {
2074 ref.current.focus();
2075 }
2076 }
2077 }, [isBlocksListEmpty]);
2078 return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_block_editor7.ButtonBlockAppender, { ...props, ref });
2079 }
2080
2081 // packages/customize-widgets/build-module/components/sidebar-block-editor/index.mjs
2082 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
2083 var { ExperimentalBlockCanvas: BlockCanvas } = unlock(
2084 import_block_editor8.privateApis
2085 );
2086 var { BlockKeyboardShortcuts } = unlock(import_block_library.privateApis);
2087 function SidebarBlockEditor({
2088 blockEditorSettings,
2089 sidebar,
2090 inserter,
2091 inspector
2092 }) {
2093 const [isInserterOpened2, setIsInserterOpened2] = useInserter(inserter);
2094 const isMediumViewport = (0, import_compose3.useViewportMatch)("small");
2095 const {
2096 hasUploadPermissions,
2097 isFixedToolbarActive,
2098 keepCaretInsideBlock,
2099 isWelcomeGuideActive
2100 } = (0, import_data12.useSelect)((select) => {
2101 const { get } = select(import_preferences3.store);
2102 return {
2103 hasUploadPermissions: select(import_core_data.store).canUser("create", {
2104 kind: "postType",
2105 name: "attachment"
2106 }) ?? true,
2107 isFixedToolbarActive: !!get(
2108 "core/customize-widgets",
2109 "fixedToolbar"
2110 ),
2111 keepCaretInsideBlock: !!get(
2112 "core/customize-widgets",
2113 "keepCaretInsideBlock"
2114 ),
2115 isWelcomeGuideActive: !!get(
2116 "core/customize-widgets",
2117 "welcomeGuide"
2118 )
2119 };
2120 }, []);
2121 const settings = (0, import_element14.useMemo)(() => {
2122 let mediaUploadBlockEditor;
2123 if (hasUploadPermissions) {
2124 mediaUploadBlockEditor = ({ onError, ...argumentsObject }) => {
2125 (0, import_media_utils.uploadMedia)({
2126 wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,
2127 onError: ({ message }) => onError(message),
2128 ...argumentsObject
2129 });
2130 };
2131 }
2132 return {
2133 ...blockEditorSettings,
2134 __experimentalSetIsInserterOpened: setIsInserterOpened2,
2135 mediaUpload: mediaUploadBlockEditor,
2136 hasFixedToolbar: isFixedToolbarActive || !isMediumViewport,
2137 keepCaretInsideBlock,
2138 editorTool: "edit",
2139 __unstableHasCustomAppender: true
2140 };
2141 }, [
2142 hasUploadPermissions,
2143 blockEditorSettings,
2144 isFixedToolbarActive,
2145 isMediumViewport,
2146 keepCaretInsideBlock,
2147 setIsInserterOpened2
2148 ]);
2149 if (isWelcomeGuideActive) {
2150 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WelcomeGuide, { sidebar });
2151 }
2152 return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
2153 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(keyboard_shortcuts_default.Register, {}),
2154 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(BlockKeyboardShortcuts, {}),
2155 /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(SidebarEditorProvider, { sidebar, settings, children: [
2156 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2157 keyboard_shortcuts_default,
2158 {
2159 undo: sidebar.undo,
2160 redo: sidebar.redo,
2161 save: sidebar.save
2162 }
2163 ),
2164 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2165 header_default,
2166 {
2167 sidebar,
2168 inserter,
2169 isInserterOpened: isInserterOpened2,
2170 setIsInserterOpened: setIsInserterOpened2,
2171 isFixedToolbarActive: isFixedToolbarActive || !isMediumViewport
2172 }
2173 ),
2174 (isFixedToolbarActive || !isMediumViewport) && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_block_editor8.BlockToolbar, { hideDragHandle: true }),
2175 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2176 BlockCanvas,
2177 {
2178 shouldIframe: false,
2179 styles: settings.defaultEditorStyles,
2180 height: "100%",
2181 children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_block_editor8.BlockList, { renderAppender: BlockAppender })
2182 }
2183 ),
2184 (0, import_element14.createPortal)(
2185 // This is a temporary hack to prevent button component inside <BlockInspector>
2186 // from submitting form when type="button" is not specified.
2187 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("form", { onSubmit: (event) => event.preventDefault(), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_block_editor8.BlockInspector, {}) }),
2188 inspector.contentContainer[0]
2189 )
2190 ] }),
2191 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_block_editor8.__unstableBlockSettingsMenuFirstItem, { children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2192 block_inspector_button_default,
2193 {
2194 inspector,
2195 closeMenu: onClose
2196 }
2197 ) })
2198 ] });
2199 }
2200
2201 // packages/customize-widgets/build-module/components/sidebar-controls/index.mjs
2202 var import_element15 = __toESM(require_element(), 1);
2203 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
2204 var SidebarControlsContext = (0, import_element15.createContext)();
2205 SidebarControlsContext.displayName = "SidebarControlsContext";
2206 function SidebarControls({
2207 sidebarControls,
2208 activeSidebarControl,
2209 children
2210 }) {
2211 const context = (0, import_element15.useMemo)(
2212 () => ({
2213 sidebarControls,
2214 activeSidebarControl
2215 }),
2216 [sidebarControls, activeSidebarControl]
2217 );
2218 return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SidebarControlsContext.Provider, { value: context, children });
2219 }
2220 function useSidebarControls() {
2221 const { sidebarControls } = (0, import_element15.useContext)(SidebarControlsContext);
2222 return sidebarControls;
2223 }
2224 function useActiveSidebarControl() {
2225 const { activeSidebarControl } = (0, import_element15.useContext)(SidebarControlsContext);
2226 return activeSidebarControl;
2227 }
2228
2229 // packages/customize-widgets/build-module/components/customize-widgets/use-clear-selected-block.mjs
2230 var import_element16 = __toESM(require_element(), 1);
2231 var import_data13 = __toESM(require_data(), 1);
2232 var import_block_editor9 = __toESM(require_block_editor(), 1);
2233 function useClearSelectedBlock(sidebarControl, popoverRef) {
2234 const { hasSelectedBlock, hasMultiSelection } = (0, import_data13.useSelect)(import_block_editor9.store);
2235 const { clearSelectedBlock } = (0, import_data13.useDispatch)(import_block_editor9.store);
2236 (0, import_element16.useEffect)(() => {
2237 if (popoverRef.current && sidebarControl) {
2238 let handleClearSelectedBlock = function(element) {
2239 if (
2240 // 1. Make sure there are blocks being selected.
2241 (hasSelectedBlock() || hasMultiSelection()) && // 2. The element should exist in the DOM (not deleted).
2242 element && ownerDocument.contains(element) && // 3. It should also not exist in the container, the popover, nor the dialog.
2243 !container.contains(element) && !popoverRef.current.contains(element) && !element.closest('[role="dialog"]') && // 4. The inspector should not be opened.
2244 !inspector.expanded()
2245 ) {
2246 clearSelectedBlock();
2247 }
2248 }, handleMouseDown = function(event) {
2249 handleClearSelectedBlock(event.target);
2250 }, handleBlur = function() {
2251 handleClearSelectedBlock(ownerDocument.activeElement);
2252 };
2253 const inspector = sidebarControl.inspector;
2254 const container = sidebarControl.container[0];
2255 const ownerDocument = container.ownerDocument;
2256 const ownerWindow = ownerDocument.defaultView;
2257 ownerDocument.addEventListener("mousedown", handleMouseDown);
2258 ownerWindow.addEventListener("blur", handleBlur);
2259 return () => {
2260 ownerDocument.removeEventListener(
2261 "mousedown",
2262 handleMouseDown
2263 );
2264 ownerWindow.removeEventListener("blur", handleBlur);
2265 };
2266 }
2267 }, [
2268 popoverRef,
2269 sidebarControl,
2270 hasSelectedBlock,
2271 hasMultiSelection,
2272 clearSelectedBlock
2273 ]);
2274 }
2275
2276 // packages/customize-widgets/build-module/components/customize-widgets/index.mjs
2277 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
2278 function CustomizeWidgets({
2279 api,
2280 sidebarControls,
2281 blockEditorSettings
2282 }) {
2283 const [activeSidebarControl, setActiveSidebarControl] = (0, import_element17.useState)(null);
2284 const parentContainer = document.getElementById(
2285 "customize-theme-controls"
2286 );
2287 const popoverRef = (0, import_element17.useRef)();
2288 useClearSelectedBlock(activeSidebarControl, popoverRef);
2289 (0, import_element17.useEffect)(() => {
2290 const unsubscribers = sidebarControls.map(
2291 (sidebarControl) => sidebarControl.subscribe((expanded) => {
2292 if (expanded) {
2293 setActiveSidebarControl(sidebarControl);
2294 }
2295 })
2296 );
2297 return () => {
2298 unsubscribers.forEach((unsubscriber) => unsubscriber());
2299 };
2300 }, [sidebarControls]);
2301 const activeSidebar = activeSidebarControl && (0, import_element17.createPortal)(
2302 /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2303 SidebarBlockEditor,
2304 {
2305 blockEditorSettings,
2306 sidebar: activeSidebarControl.sidebarAdapter,
2307 inserter: activeSidebarControl.inserter,
2308 inspector: activeSidebarControl.inspector
2309 },
2310 activeSidebarControl.id
2311 ) }),
2312 activeSidebarControl.container[0]
2313 );
2314 const popover = parentContainer && (0, import_element17.createPortal)(
2315 /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "customize-widgets-popover", ref: popoverRef, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components8.Popover.Slot, {}) }),
2316 parentContainer
2317 );
2318 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components8.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2319 SidebarControls,
2320 {
2321 sidebarControls,
2322 activeSidebarControl,
2323 children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(FocusControl, { api, sidebarControls, children: [
2324 activeSidebar,
2325 popover
2326 ] })
2327 }
2328 ) });
2329 }
2330
2331 // packages/customize-widgets/build-module/controls/sidebar-section.mjs
2332 var import_i18n10 = __toESM(require_i18n(), 1);
2333
2334 // packages/customize-widgets/build-module/controls/inspector-section.mjs
2335 function getInspectorSection() {
2336 const {
2337 wp: { customize }
2338 } = window;
2339 return class InspectorSection extends customize.Section {
2340 constructor(id, options) {
2341 super(id, options);
2342 this.parentSection = options.parentSection;
2343 this.returnFocusWhenClose = null;
2344 this._isOpen = false;
2345 }
2346 get isOpen() {
2347 return this._isOpen;
2348 }
2349 set isOpen(value) {
2350 this._isOpen = value;
2351 this.triggerActiveCallbacks();
2352 }
2353 ready() {
2354 this.contentContainer[0].classList.add(
2355 "customize-widgets-layout__inspector"
2356 );
2357 }
2358 isContextuallyActive() {
2359 return this.isOpen;
2360 }
2361 onChangeExpanded(expanded, args) {
2362 super.onChangeExpanded(expanded, args);
2363 if (this.parentSection && !args.unchanged) {
2364 if (expanded) {
2365 this.parentSection.collapse({
2366 manualTransition: true
2367 });
2368 } else {
2369 this.parentSection.expand({
2370 manualTransition: true,
2371 completeCallback: () => {
2372 if (this.returnFocusWhenClose && !this.contentContainer[0].contains(
2373 this.returnFocusWhenClose
2374 )) {
2375 this.returnFocusWhenClose.focus();
2376 }
2377 }
2378 });
2379 }
2380 }
2381 }
2382 open({ returnFocusWhenClose } = {}) {
2383 this.isOpen = true;
2384 this.returnFocusWhenClose = returnFocusWhenClose;
2385 this.expand({
2386 allowMultiple: true
2387 });
2388 }
2389 close() {
2390 this.collapse({
2391 allowMultiple: true
2392 });
2393 }
2394 collapse(options) {
2395 this.isOpen = false;
2396 super.collapse(options);
2397 }
2398 triggerActiveCallbacks() {
2399 this.active.callbacks.fireWith(this.active, [false, true]);
2400 }
2401 };
2402 }
2403
2404 // packages/customize-widgets/build-module/controls/sidebar-section.mjs
2405 var getInspectorSectionId = (sidebarId) => `widgets-inspector-${sidebarId}`;
2406 function getSidebarSection() {
2407 const {
2408 wp: { customize }
2409 } = window;
2410 const reduceMotionMediaQuery = window.matchMedia(
2411 "(prefers-reduced-motion: reduce)"
2412 );
2413 let isReducedMotion = reduceMotionMediaQuery.matches;
2414 reduceMotionMediaQuery.addEventListener("change", (event) => {
2415 isReducedMotion = event.matches;
2416 });
2417 return class SidebarSection extends customize.Section {
2418 ready() {
2419 const InspectorSection = getInspectorSection();
2420 this.inspector = new InspectorSection(
2421 getInspectorSectionId(this.id),
2422 {
2423 title: (0, import_i18n10.__)("Block Settings"),
2424 parentSection: this,
2425 customizeAction: [
2426 (0, import_i18n10.__)("Customizing"),
2427 (0, import_i18n10.__)("Widgets"),
2428 this.params.title
2429 ].join(" \u25B8 ")
2430 }
2431 );
2432 customize.section.add(this.inspector);
2433 this.contentContainer[0].classList.add(
2434 "customize-widgets__sidebar-section"
2435 );
2436 }
2437 hasSubSectionOpened() {
2438 return this.inspector.expanded();
2439 }
2440 onChangeExpanded(expanded, _args) {
2441 const controls = this.controls();
2442 const args = {
2443 ..._args,
2444 completeCallback() {
2445 controls.forEach((control) => {
2446 control.onChangeSectionExpanded?.(expanded, args);
2447 });
2448 _args.completeCallback?.();
2449 }
2450 };
2451 if (args.manualTransition) {
2452 if (expanded) {
2453 this.contentContainer.addClass(["busy", "open"]);
2454 this.contentContainer.removeClass("is-sub-section-open");
2455 this.contentContainer.closest(".wp-full-overlay").addClass("section-open");
2456 } else {
2457 this.contentContainer.addClass([
2458 "busy",
2459 "is-sub-section-open"
2460 ]);
2461 this.contentContainer.closest(".wp-full-overlay").addClass("section-open");
2462 this.contentContainer.removeClass("open");
2463 }
2464 const handleTransitionEnd = () => {
2465 this.contentContainer.removeClass("busy");
2466 args.completeCallback();
2467 };
2468 if (isReducedMotion) {
2469 handleTransitionEnd();
2470 } else {
2471 this.contentContainer.one(
2472 "transitionend",
2473 handleTransitionEnd
2474 );
2475 }
2476 } else {
2477 super.onChangeExpanded(expanded, args);
2478 }
2479 }
2480 };
2481 }
2482
2483 // packages/customize-widgets/build-module/controls/sidebar-control.mjs
2484 var import_data15 = __toESM(require_data(), 1);
2485
2486 // packages/customize-widgets/build-module/components/sidebar-block-editor/sidebar-adapter.mjs
2487 var { wp } = window;
2488 function parseWidgetId(widgetId) {
2489 const matches = widgetId.match(/^(.+)-(\d+)$/);
2490 if (matches) {
2491 return {
2492 idBase: matches[1],
2493 number: parseInt(matches[2], 10)
2494 };
2495 }
2496 return { idBase: widgetId };
2497 }
2498 function widgetIdToSettingId(widgetId) {
2499 const { idBase, number } = parseWidgetId(widgetId);
2500 if (number) {
2501 return `widget_${idBase}[${number}]`;
2502 }
2503 return `widget_${idBase}`;
2504 }
2505 function debounce(leading, callback, timeout) {
2506 let isLeading = false;
2507 let timerID;
2508 function debounced(...args) {
2509 const result = (isLeading ? callback : leading).apply(this, args);
2510 isLeading = true;
2511 clearTimeout(timerID);
2512 timerID = setTimeout(() => {
2513 isLeading = false;
2514 }, timeout);
2515 return result;
2516 }
2517 debounced.cancel = () => {
2518 isLeading = false;
2519 clearTimeout(timerID);
2520 };
2521 return debounced;
2522 }
2523 var SidebarAdapter = class {
2524 constructor(setting, api) {
2525 this.setting = setting;
2526 this.api = api;
2527 this.locked = false;
2528 this.widgetsCache = /* @__PURE__ */ new WeakMap();
2529 this.subscribers = /* @__PURE__ */ new Set();
2530 this.history = [
2531 this._getWidgetIds().map(
2532 (widgetId) => this.getWidget(widgetId)
2533 )
2534 ];
2535 this.historyIndex = 0;
2536 this.historySubscribers = /* @__PURE__ */ new Set();
2537 this._debounceSetHistory = debounce(
2538 this._pushHistory,
2539 this._replaceHistory,
2540 1e3
2541 );
2542 this.setting.bind(this._handleSettingChange.bind(this));
2543 this.api.bind("change", this._handleAllSettingsChange.bind(this));
2544 this.undo = this.undo.bind(this);
2545 this.redo = this.redo.bind(this);
2546 this.save = this.save.bind(this);
2547 }
2548 subscribe(callback) {
2549 this.subscribers.add(callback);
2550 return () => {
2551 this.subscribers.delete(callback);
2552 };
2553 }
2554 getWidgets() {
2555 return this.history[this.historyIndex];
2556 }
2557 _emit(...args) {
2558 for (const callback of this.subscribers) {
2559 callback(...args);
2560 }
2561 }
2562 _getWidgetIds() {
2563 return this.setting.get();
2564 }
2565 _pushHistory() {
2566 this.history = [
2567 ...this.history.slice(0, this.historyIndex + 1),
2568 this._getWidgetIds().map(
2569 (widgetId) => this.getWidget(widgetId)
2570 )
2571 ];
2572 this.historyIndex += 1;
2573 this.historySubscribers.forEach((listener) => listener());
2574 }
2575 _replaceHistory() {
2576 this.history[this.historyIndex] = this._getWidgetIds().map(
2577 (widgetId) => this.getWidget(widgetId)
2578 );
2579 }
2580 _handleSettingChange() {
2581 if (this.locked) {
2582 return;
2583 }
2584 const prevWidgets = this.getWidgets();
2585 this._pushHistory();
2586 this._emit(prevWidgets, this.getWidgets());
2587 }
2588 _handleAllSettingsChange(setting) {
2589 if (this.locked) {
2590 return;
2591 }
2592 if (!setting.id.startsWith("widget_")) {
2593 return;
2594 }
2595 const widgetId = settingIdToWidgetId(setting.id);
2596 if (!this.setting.get().includes(widgetId)) {
2597 return;
2598 }
2599 const prevWidgets = this.getWidgets();
2600 this._pushHistory();
2601 this._emit(prevWidgets, this.getWidgets());
2602 }
2603 _createWidget(widget) {
2604 const widgetModel = wp.customize.Widgets.availableWidgets.findWhere({
2605 id_base: widget.idBase
2606 });
2607 let number = widget.number;
2608 if (widgetModel.get("is_multi") && !number) {
2609 widgetModel.set(
2610 "multi_number",
2611 widgetModel.get("multi_number") + 1
2612 );
2613 number = widgetModel.get("multi_number");
2614 }
2615 const settingId = number ? `widget_${widget.idBase}[${number}]` : `widget_${widget.idBase}`;
2616 const settingArgs = {
2617 transport: wp.customize.Widgets.data.selectiveRefreshableWidgets[widgetModel.get("id_base")] ? "postMessage" : "refresh",
2618 previewer: this.setting.previewer
2619 };
2620 const setting = this.api.create(
2621 settingId,
2622 settingId,
2623 "",
2624 settingArgs
2625 );
2626 setting.set(widget.instance);
2627 const widgetId = settingIdToWidgetId(settingId);
2628 return widgetId;
2629 }
2630 _removeWidget(widget) {
2631 const settingId = widgetIdToSettingId(widget.id);
2632 const setting = this.api(settingId);
2633 if (setting) {
2634 const instance = setting.get();
2635 this.widgetsCache.delete(instance);
2636 }
2637 this.api.remove(settingId);
2638 }
2639 _updateWidget(widget) {
2640 const prevWidget = this.getWidget(widget.id);
2641 if (prevWidget === widget) {
2642 return widget.id;
2643 }
2644 if (prevWidget.idBase && widget.idBase && prevWidget.idBase === widget.idBase) {
2645 const settingId = widgetIdToSettingId(widget.id);
2646 this.api(settingId).set(widget.instance);
2647 return widget.id;
2648 }
2649 this._removeWidget(widget);
2650 return this._createWidget(widget);
2651 }
2652 getWidget(widgetId) {
2653 if (!widgetId) {
2654 return null;
2655 }
2656 const { idBase, number } = parseWidgetId(widgetId);
2657 const settingId = widgetIdToSettingId(widgetId);
2658 const setting = this.api(settingId);
2659 if (!setting) {
2660 return null;
2661 }
2662 const instance = setting.get();
2663 if (this.widgetsCache.has(instance)) {
2664 return this.widgetsCache.get(instance);
2665 }
2666 const widget = {
2667 id: widgetId,
2668 idBase,
2669 number,
2670 instance
2671 };
2672 this.widgetsCache.set(instance, widget);
2673 return widget;
2674 }
2675 _updateWidgets(nextWidgets) {
2676 this.locked = true;
2677 const addedWidgetIds = [];
2678 const nextWidgetIds = nextWidgets.map((nextWidget) => {
2679 if (nextWidget.id && this.getWidget(nextWidget.id)) {
2680 addedWidgetIds.push(null);
2681 return this._updateWidget(nextWidget);
2682 }
2683 const widgetId = this._createWidget(nextWidget);
2684 addedWidgetIds.push(widgetId);
2685 return widgetId;
2686 });
2687 const deletedWidgets = this.getWidgets().filter(
2688 (widget) => !nextWidgetIds.includes(widget.id)
2689 );
2690 deletedWidgets.forEach((widget) => this._removeWidget(widget));
2691 this.setting.set(nextWidgetIds);
2692 this.locked = false;
2693 return addedWidgetIds;
2694 }
2695 setWidgets(nextWidgets) {
2696 const addedWidgetIds = this._updateWidgets(nextWidgets);
2697 this._debounceSetHistory();
2698 return addedWidgetIds;
2699 }
2700 /**
2701 * Undo/Redo related features
2702 */
2703 hasUndo() {
2704 return this.historyIndex > 0;
2705 }
2706 hasRedo() {
2707 return this.historyIndex < this.history.length - 1;
2708 }
2709 _seek(historyIndex) {
2710 const currentWidgets = this.getWidgets();
2711 this.historyIndex = historyIndex;
2712 const widgets = this.history[this.historyIndex];
2713 this._updateWidgets(widgets);
2714 this._emit(currentWidgets, this.getWidgets());
2715 this.historySubscribers.forEach((listener) => listener());
2716 this._debounceSetHistory.cancel();
2717 }
2718 undo() {
2719 if (!this.hasUndo()) {
2720 return;
2721 }
2722 this._seek(this.historyIndex - 1);
2723 }
2724 redo() {
2725 if (!this.hasRedo()) {
2726 return;
2727 }
2728 this._seek(this.historyIndex + 1);
2729 }
2730 subscribeHistory(listener) {
2731 this.historySubscribers.add(listener);
2732 return () => {
2733 this.historySubscribers.delete(listener);
2734 };
2735 }
2736 save() {
2737 this.api.previewer.save();
2738 }
2739 };
2740
2741 // packages/customize-widgets/build-module/controls/inserter-outer-section.mjs
2742 var import_keycodes5 = __toESM(require_keycodes(), 1);
2743 var import_dom = __toESM(require_dom(), 1);
2744 var import_data14 = __toESM(require_data(), 1);
2745 function getInserterOuterSection() {
2746 const {
2747 wp: { customize }
2748 } = window;
2749 const OuterSection = customize.OuterSection;
2750 customize.OuterSection = class extends OuterSection {
2751 onChangeExpanded(expanded, args) {
2752 if (expanded) {
2753 customize.section.each((section) => {
2754 if (section.params.type === "outer" && section.id !== this.id) {
2755 if (section.expanded()) {
2756 section.collapse();
2757 }
2758 }
2759 });
2760 }
2761 return super.onChangeExpanded(expanded, args);
2762 }
2763 };
2764 customize.sectionConstructor.outer = customize.OuterSection;
2765 return class InserterOuterSection extends customize.OuterSection {
2766 constructor(...args) {
2767 super(...args);
2768 this.params.type = "outer";
2769 this.activeElementBeforeExpanded = null;
2770 const ownerWindow = this.contentContainer[0].ownerDocument.defaultView;
2771 ownerWindow.addEventListener(
2772 "keydown",
2773 (event) => {
2774 if (this.expanded() && (event.keyCode === import_keycodes5.ESCAPE || event.code === "Escape") && !event.defaultPrevented) {
2775 event.preventDefault();
2776 event.stopPropagation();
2777 (0, import_data14.dispatch)(store).setIsInserterOpened(
2778 false
2779 );
2780 }
2781 },
2782 // Use capture mode to make this run before other event listeners.
2783 true
2784 );
2785 this.contentContainer.addClass("widgets-inserter");
2786 this.isFromInternalAction = false;
2787 this.expanded.bind(() => {
2788 if (!this.isFromInternalAction) {
2789 (0, import_data14.dispatch)(store).setIsInserterOpened(
2790 this.expanded()
2791 );
2792 }
2793 this.isFromInternalAction = false;
2794 });
2795 }
2796 open() {
2797 if (!this.expanded()) {
2798 const contentContainer = this.contentContainer[0];
2799 this.activeElementBeforeExpanded = contentContainer.ownerDocument.activeElement;
2800 this.isFromInternalAction = true;
2801 this.expand({
2802 completeCallback() {
2803 const searchBox = import_dom.focus.tabbable.find(contentContainer)[1];
2804 if (searchBox) {
2805 searchBox.focus();
2806 }
2807 }
2808 });
2809 }
2810 }
2811 close() {
2812 if (this.expanded()) {
2813 const contentContainer = this.contentContainer[0];
2814 const activeElement = contentContainer.ownerDocument.activeElement;
2815 this.isFromInternalAction = true;
2816 this.collapse({
2817 completeCallback() {
2818 if (contentContainer.contains(activeElement)) {
2819 if (this.activeElementBeforeExpanded) {
2820 this.activeElementBeforeExpanded.focus();
2821 }
2822 }
2823 }
2824 });
2825 }
2826 }
2827 };
2828 }
2829
2830 // packages/customize-widgets/build-module/controls/sidebar-control.mjs
2831 var getInserterId = (controlId) => `widgets-inserter-${controlId}`;
2832 function getSidebarControl() {
2833 const {
2834 wp: { customize }
2835 } = window;
2836 return class SidebarControl extends customize.Control {
2837 constructor(...args) {
2838 super(...args);
2839 this.subscribers = /* @__PURE__ */ new Set();
2840 }
2841 ready() {
2842 const InserterOuterSection = getInserterOuterSection();
2843 this.inserter = new InserterOuterSection(
2844 getInserterId(this.id),
2845 {}
2846 );
2847 customize.section.add(this.inserter);
2848 this.sectionInstance = customize.section(this.section());
2849 this.inspector = this.sectionInstance.inspector;
2850 this.sidebarAdapter = new SidebarAdapter(this.setting, customize);
2851 }
2852 subscribe(callback) {
2853 this.subscribers.add(callback);
2854 return () => {
2855 this.subscribers.delete(callback);
2856 };
2857 }
2858 onChangeSectionExpanded(expanded, args) {
2859 if (!args.unchanged) {
2860 if (!expanded) {
2861 (0, import_data15.dispatch)(store).setIsInserterOpened(
2862 false
2863 );
2864 }
2865 this.subscribers.forEach(
2866 (subscriber) => subscriber(expanded, args)
2867 );
2868 }
2869 }
2870 };
2871 }
2872
2873 // packages/customize-widgets/build-module/filters/move-to-sidebar.mjs
2874 var import_block_editor10 = __toESM(require_block_editor(), 1);
2875 var import_compose4 = __toESM(require_compose(), 1);
2876 var import_data16 = __toESM(require_data(), 1);
2877 var import_hooks2 = __toESM(require_hooks(), 1);
2878 var import_widgets4 = __toESM(require_widgets(), 1);
2879 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
2880 var withMoveToSidebarToolbarItem = (0, import_compose4.createHigherOrderComponent)(
2881 (BlockEdit) => (props) => {
2882 let widgetId = (0, import_widgets4.getWidgetIdFromBlock)(props);
2883 const sidebarControls = useSidebarControls();
2884 const activeSidebarControl = useActiveSidebarControl();
2885 const hasMultipleSidebars = sidebarControls?.length > 1;
2886 const blockName = props.name;
2887 const clientId = props.clientId;
2888 const canInsertBlockInSidebar = (0, import_data16.useSelect)(
2889 (select) => {
2890 return select(import_block_editor10.store).canInsertBlockType(
2891 blockName,
2892 ""
2893 );
2894 },
2895 [blockName]
2896 );
2897 const block = (0, import_data16.useSelect)(
2898 (select) => select(import_block_editor10.store).getBlock(clientId),
2899 [clientId]
2900 );
2901 const { removeBlock } = (0, import_data16.useDispatch)(import_block_editor10.store);
2902 const [, focusWidget] = useFocusControl();
2903 function moveToSidebar(sidebarControlId) {
2904 const newSidebarControl = sidebarControls.find(
2905 (sidebarControl) => sidebarControl.id === sidebarControlId
2906 );
2907 if (widgetId) {
2908 const oldSetting = activeSidebarControl.setting;
2909 const newSetting = newSidebarControl.setting;
2910 oldSetting(oldSetting().filter((id) => id !== widgetId));
2911 newSetting([...newSetting(), widgetId]);
2912 } else {
2913 const sidebarAdapter = newSidebarControl.sidebarAdapter;
2914 removeBlock(clientId);
2915 const addedWidgetIds = sidebarAdapter.setWidgets([
2916 ...sidebarAdapter.getWidgets(),
2917 blockToWidget(block)
2918 ]);
2919 widgetId = addedWidgetIds.reverse().find((id) => !!id);
2920 }
2921 focusWidget(widgetId);
2922 }
2923 return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
2924 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(BlockEdit, { ...props }, "edit"),
2925 hasMultipleSidebars && canInsertBlockInSidebar && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_block_editor10.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2926 import_widgets4.MoveToWidgetArea,
2927 {
2928 widgetAreas: sidebarControls.map(
2929 (sidebarControl) => ({
2930 id: sidebarControl.id,
2931 name: sidebarControl.params.label,
2932 description: sidebarControl.params.description
2933 })
2934 ),
2935 currentWidgetAreaId: activeSidebarControl?.id,
2936 onSelect: moveToSidebar
2937 }
2938 ) })
2939 ] });
2940 },
2941 "withMoveToSidebarToolbarItem"
2942 );
2943 (0, import_hooks2.addFilter)(
2944 "editor.BlockEdit",
2945 "core/customize-widgets/block-edit",
2946 withMoveToSidebarToolbarItem
2947 );
2948
2949 // packages/customize-widgets/build-module/filters/replace-media-upload.mjs
2950 var import_hooks3 = __toESM(require_hooks(), 1);
2951 var import_media_utils2 = __toESM(require_media_utils(), 1);
2952 var replaceMediaUpload = () => import_media_utils2.MediaUpload;
2953 (0, import_hooks3.addFilter)(
2954 "editor.MediaUpload",
2955 "core/edit-widgets/replace-media-upload",
2956 replaceMediaUpload
2957 );
2958
2959 // packages/customize-widgets/build-module/filters/wide-widget-display.mjs
2960 var import_compose5 = __toESM(require_compose(), 1);
2961 var import_hooks4 = __toESM(require_hooks(), 1);
2962 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
2963 var { wp: wp2 } = window;
2964 var withWideWidgetDisplay = (0, import_compose5.createHigherOrderComponent)(
2965 (BlockEdit) => (props) => {
2966 const { idBase } = props.attributes;
2967 const isWide = wp2.customize.Widgets.data.availableWidgets.find(
2968 (widget) => widget.id_base === idBase
2969 )?.is_wide ?? false;
2970 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(BlockEdit, { ...props, isWide }, "edit");
2971 },
2972 "withWideWidgetDisplay"
2973 );
2974 (0, import_hooks4.addFilter)(
2975 "editor.BlockEdit",
2976 "core/customize-widgets/wide-widget-display",
2977 withWideWidgetDisplay
2978 );
2979
2980 // packages/customize-widgets/build-module/index.mjs
2981 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
2982 var { wp: wp3 } = window;
2983 var DISABLED_BLOCKS = [
2984 "core/more",
2985 "core/block",
2986 "core/freeform",
2987 "core/template-part"
2988 ];
2989 var ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
2990 function initialize(editorName, blockEditorSettings) {
2991 (0, import_data17.dispatch)(import_preferences4.store).setDefaults("core/customize-widgets", {
2992 fixedToolbar: false,
2993 welcomeGuide: true
2994 });
2995 (0, import_data17.dispatch)(import_blocks2.store).reapplyBlockTypeFilters();
2996 const coreBlocks = (0, import_block_library2.__experimentalGetCoreBlocks)().filter((block) => {
2997 return !(DISABLED_BLOCKS.includes(block.name) || block.name.startsWith("core/post") || block.name.startsWith("core/query") || block.name.startsWith("core/site") || block.name.startsWith("core/navigation") || block.name.startsWith("core/term"));
2998 });
2999 (0, import_block_library2.registerCoreBlocks)(coreBlocks);
3000 (0, import_widgets5.registerLegacyWidgetBlock)();
3001 if (true) {
3002 (0, import_block_library2.__experimentalRegisterExperimentalCoreBlocks)({
3003 enableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS
3004 });
3005 }
3006 (0, import_widgets5.registerLegacyWidgetVariations)(blockEditorSettings);
3007 (0, import_widgets5.registerWidgetGroupBlock)();
3008 (0, import_blocks2.setFreeformContentHandlerName)("core/html");
3009 const SidebarControl = getSidebarControl(blockEditorSettings);
3010 wp3.customize.sectionConstructor.sidebar = getSidebarSection();
3011 wp3.customize.controlConstructor.sidebar_block_editor = SidebarControl;
3012 const container = document.createElement("div");
3013 document.body.appendChild(container);
3014 wp3.customize.bind("ready", () => {
3015 const sidebarControls = [];
3016 wp3.customize.control.each((control) => {
3017 if (control instanceof SidebarControl) {
3018 sidebarControls.push(control);
3019 }
3020 });
3021 (0, import_element18.createRoot)(container).render(
3022 /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_element18.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3023 CustomizeWidgets,
3024 {
3025 api: wp3.customize,
3026 sidebarControls,
3027 blockEditorSettings
3028 }
3029 ) })
3030 );
3031 });
3032 }
3033 return __toCommonJS(index_exports);
3034 })();
3035 //# sourceMappingURL=index.js.map
3036