/******/ (() => { // webpackBootstrap
/******/ // The require scope
/******/ var __webpack_require__ = {};
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/************************************************************************/
var __webpack_exports__ = {};
__webpack_require__.d(__webpack_exports__, {
"default": () => (/* binding */ build_module)
// UNUSED EXPORTS: attrs, fromMatch, next, regexp, replace, string
;// ./node_modules/memize/dist/index.js
* @property {number} [maxSize] Maximum size of the cache.
* @typedef MemizeCacheNode
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
* @property {?MemizeCacheNode|undefined} [next] Next node.
* @property {Array<*>} args Function arguments for cache
* @property {*} val Function result.
* Properties of the enhanced function for controlling cache.
* @typedef MemizeMemoizedFunction
* @property {()=>void} clear Clear the cache.
* Accepts a function to be memoized, and returns a new memoized function, with
* @template {(...args: any[]) => any} F
* @param {F} fn Function to memoize.
* @param {MemizeOptions} [options] Options object.
* @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
function memize(fn, options) {
/** @type {?MemizeCacheNode|undefined} */
/** @type {?MemizeCacheNode|undefined} */
function memoized(/* ...args */) {
searchCache: while (node) {
// Perform a shallow equality test to confirm that whether the node
// under test is a candidate for the arguments passed. Two arrays
// are shallowly equal if their length matches and each entry is
// strictly equal between the two sets. Avoid abstracting to a
// function which could incur an arguments leaking deoptimization.
// Check whether node arguments match arguments length
if (node.args.length !== arguments.length) {
// Check whether node arguments match arguments values
for (i = 0; i < len; i++) {
if (node.args[i] !== arguments[i]) {
// At this point we can assume we've found a match
// Surface matched node to head if not already
// As tail, shift to previous. Must only shift if not also
// head, since if both head and tail, there is no previous.
// Adjust siblings to point to each other. If node was tail,
// this also handles new tail's empty `next` assignment.
/** @type {MemizeCacheNode} */ (node.prev).next = node.next;
node.next.prev = node.prev;
/** @type {MemizeCacheNode} */ (head).prev = node;
// No cached value found. Continue to insertion phase:
// Create a copy of arguments (avoid leaking deoptimization)
for (i = 0; i < len; i++) {
// Generate the result from original function
val: fn.apply(null, args),
// Don't need to check whether node is already head, since it would
// have been returned above already if it was
// Shift existing head down list
// If no head, follows that there's no tail (at initial or reset)
// Trim tail if we're reached max size and are pending cache insertion
if (size === /** @type {MemizeOptions} */ (options).maxSize) {
tail = /** @type {MemizeCacheNode} */ (tail).prev;
/** @type {MemizeCacheNode} */ (tail).next = null;
memoized.clear = function () {
// Ignore reason: There's not a clear solution to create an intersection of
// the function with additional properties, where the goal is to retain the
// function signature of the incoming argument and add control properties
;// ./node_modules/@wordpress/shortcode/build-module/index.js
* Find the next matching shortcode.
* @param {string} tag Shortcode tag.
* @param {string} text Text to search.
* @param {number} index Index to start search from.
* @return {import('./types').ShortcodeMatch | undefined} Matched information.
function next(tag, text, index = 0) {
const match = re.exec(text);
// If we matched an escaped shortcode, try again.
if ('[' === match[1] && ']' === match[7]) {
return next(tag, text, re.lastIndex);
shortcode: fromMatch(match)
// If we matched a leading `[`, strip it from the match and increment the
result.content = result.content.slice(1);
// If we matched a trailing `]`, strip it from the match.
result.content = result.content.slice(0, -1);
* Replace matching shortcodes in a block of text.
* @param {string} tag Shortcode tag.
* @param {string} text Text to search.
* @param {import('./types').ReplaceCallback} callback Function to process the match and return
* @return {string} Text with shortcodes replaced.
function replace(tag, text, callback) {
return text.replace(regexp(tag), function (match, left, $3, attrs, slash, content, closing, right) {
// If both extra brackets exist, the shortcode has been properly
if (left === '[' && right === ']') {
// Create the match object and pass it through the callback.
const result = callback(fromMatch(arguments));
// Make sure to return any of the extra brackets if they weren't used to
return result || result === '' ? left + result + right : match;
* Generate a string from shortcode parameters.
* Creates a shortcode instance and returns a string.
* Accepts the same `options` as the `shortcode()` constructor, containing a
* `tag` string, a string or object of `attrs`, a boolean indicating whether to
* format the shortcode using a `single` tag, and a `content` string.
* @param {Object} options
* @return {string} String representation of the shortcode.
function string(options) {
return new shortcode(options).string();
* Generate a RegExp to identify a shortcode.
* The base regex is functionally equivalent to the one found in
* `get_shortcode_regex()` in `wp-includes/shortcodes.php`.
* 1. An extra `[` to allow for escaping shortcodes with double `[[]]`
* 3. The shortcode argument list
* 4. The self closing `/`
* 5. The content of a shortcode when it wraps some content.
* 7. An extra `]` to allow for escaping shortcodes with double `[[]]`
* @param {string} tag Shortcode tag.
* @return {RegExp} Shortcode RegExp.
return new RegExp('\\[(\\[?)(' + tag + ')(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)', 'g');
* Parse shortcode attributes.
* Shortcodes accept many types of attributes. These can chiefly be divided into
* named and numeric attributes:
* Named attributes are assigned on a key/value basis, while numeric attributes
* are treated as an array.
* Named attributes can be formatted as either `name="value"`, `name='value'`,
* or `name=value`. Numeric attributes can be formatted as `"value"` or just
* @param {string} text Serialised shortcode attributes.
* @return {import('./types').ShortcodeAttrs} Parsed shortcode attributes.
const attrs = memize(text => {
// This regular expression is reused from `shortcode_parse_atts()` in
// `wp-includes/shortcodes.php`.
// 1. An attribute name, that corresponds to...
// 2. a value in double quotes.
// 3. An attribute name, that corresponds to...
// 4. a value in single quotes.
// 5. An attribute name, that corresponds to...
// 7. A numeric attribute in double quotes.
// 8. A numeric attribute in single quotes.
// 9. An unquoted numeric attribute.
const pattern = /([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;
// Map zero-width spaces to actual spaces.
text = text.replace(/[\u00a0\u200b]/g, ' ');
// Match and normalize attributes.
while (match = pattern.exec(text)) {
named[match[1].toLowerCase()] = match[2];
named[match[3].toLowerCase()] = match[4];
named[match[5].toLowerCase()] = match[6];
* Generate a Shortcode Object from a RegExp match.
* Accepts a `match` object from calling `regexp.exec()` on a `RegExp` generated
* by `regexp()`. `match` can also be set to the `arguments` from a callback
* passed to `regexp.replace()`.
* @param {import('./types').Match} match Match array.
* @return {InstanceType<import('./types').shortcode>} Shortcode instance.
function fromMatch(match) {
* Creates a shortcode instance.
* To access a raw representation of a shortcode, pass an `options` object,
* containing a `tag` string, a string or object of `attrs`, a string indicating
* the `type` of the shortcode ('single', 'self-closing', or 'closed'), and a
* @type {import('./types').shortcode} Shortcode instance.
const shortcode = Object.assign(function (options) {
// Ensure we have a correctly formatted `attrs` object.
const attributeTypes = ['named', 'numeric'];
// Parse a string of attributes.
if (typeof attributes === 'string') {
this.attrs = attrs(attributes);
// Identify a correctly formatted `attrs` object.
} else if (attributes.length === attributeTypes.length && attributeTypes.every((t, key) => t === attributes[key])) {
// Handle a flat object of attributes.
Object.entries(attributes).forEach(([key, value]) => {
Object.assign(shortcode.prototype, {
* Get a shortcode attribute.
* Automatically detects whether `attr` is named or numeric and routes it
* @param {(number|string)} attr Attribute key.
* @return {string} Attribute value.
return this.attrs[typeof attr === 'number' ? 'numeric' : 'named'][attr];
* Set a shortcode attribute.
* Automatically detects whether `attr` is named or numeric and routes it
* @param {(number|string)} attr Attribute key.
* @param {string} value Attribute value.
* @return {InstanceType< import('./types').shortcode >} Shortcode instance.
this.attrs[typeof attr === 'number' ? 'numeric' : 'named'][attr] = value;
* Transform the shortcode into a string.
* @return {string} String representation of the shortcode.
let text = '[' + this.tag;
this.attrs.numeric.forEach(value => {
text += ' "' + value + '"';
Object.entries(this.attrs.named).forEach(([name, value]) => {
text += ' ' + name + '="' + value + '"';