dvadf
list-reusable-blocks.js 0000644 00000073714 15144410747 0011153 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* 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__ = {};
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// ./node_modules/tslib/tslib.es6.mjs
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
return __assign.apply(this, arguments);
}
function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
};
function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
/** @deprecated */
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
function __classPrivateFieldIn(state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
}
function __addDisposableResource(env, value, async) {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose, inner;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
if (async) inner = dispose;
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
env.stack.push({ value: value, dispose: dispose, async: async });
}
else if (async) {
env.stack.push({ async: true });
}
return value;
}
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
function __disposeResources(env) {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
var r, s = 0;
function next() {
while (r = env.stack.pop()) {
try {
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
if (r.dispose) {
var result = r.dispose.call(r.value);
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
}
else s |= 1;
}
catch (e) {
fail(e);
}
}
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
if (env.hasError) throw env.error;
}
return next();
}
function __rewriteRelativeImportExtension(path, preserveJsx) {
if (typeof path === "string" && /^\.\.?\//.test(path)) {
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
});
}
return path;
}
/* harmony default export */ const tslib_es6 = ({
__extends,
__assign,
__rest,
__decorate,
__param,
__esDecorate,
__runInitializers,
__propKey,
__setFunctionName,
__metadata,
__awaiter,
__generator,
__createBinding,
__exportStar,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__addDisposableResource,
__disposeResources,
__rewriteRelativeImportExtension,
});
;// ./node_modules/lower-case/dist.es2015/index.js
/**
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
*/
var SUPPORTED_LOCALE = {
tr: {
regexp: /\u0130|\u0049|\u0049\u0307/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
az: {
regexp: /\u0130/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
lt: {
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
map: {
I: "\u0069\u0307",
J: "\u006A\u0307",
Į: "\u012F\u0307",
Ì: "\u0069\u0307\u0300",
Í: "\u0069\u0307\u0301",
Ĩ: "\u0069\u0307\u0303",
},
},
};
/**
* Localized lower case.
*/
function localeLowerCase(str, locale) {
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
if (lang)
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
return lowerCase(str);
}
/**
* Lower case as a function.
*/
function lowerCase(str) {
return str.toLowerCase();
}
;// ./node_modules/no-case/dist.es2015/index.js
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
// Remove all non-word characters.
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
/**
* Normalize the string into something other libraries can manipulate easier.
*/
function noCase(input, options) {
if (options === void 0) { options = {}; }
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;
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
var start = 0;
var end = result.length;
// Trim the delimiter from around the output string.
while (result.charAt(start) === "\0")
start++;
while (result.charAt(end - 1) === "\0")
end--;
// Transform each token independently.
return result.slice(start, end).split("\0").map(transform).join(delimiter);
}
/**
* Replace `re` in the input string with the replacement value.
*/
function replace(input, re, value) {
if (re instanceof RegExp)
return input.replace(re, value);
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
}
;// ./node_modules/dot-case/dist.es2015/index.js
function dotCase(input, options) {
if (options === void 0) { options = {}; }
return noCase(input, __assign({ delimiter: "." }, options));
}
;// ./node_modules/param-case/dist.es2015/index.js
function paramCase(input, options) {
if (options === void 0) { options = {}; }
return dotCase(input, __assign({ delimiter: "-" }, options));
}
;// external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// external ["wp","blob"]
const external_wp_blob_namespaceObject = window["wp"]["blob"];
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/export.js
async function exportReusableBlock(id) {
const postType = await external_wp_apiFetch_default()({ path: `/wp/v2/types/wp_block` });
const post = await external_wp_apiFetch_default()({
path: `/wp/v2/${postType.rest_base}/${id}?context=edit`
});
const title = post.title.raw;
const content = post.content.raw;
const syncStatus = post.wp_pattern_sync_status;
const fileContent = JSON.stringify(
{
__file: "wp_block",
title,
content,
syncStatus
},
null,
2
);
const fileName = paramCase(title) + ".json";
(0,external_wp_blob_namespaceObject.downloadBlob)(fileName, fileContent, "application/json");
}
var export_default = exportReusableBlock;
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/file.js
function readTextFile(file) {
const reader = new window.FileReader();
return new Promise((resolve) => {
reader.onload = () => {
resolve(reader.result);
};
reader.readAsText(file);
});
}
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/import.js
async function importReusableBlock(file) {
const fileContent = await readTextFile(file);
let parsedContent;
try {
parsedContent = JSON.parse(fileContent);
} catch (e) {
throw new Error("Invalid JSON file");
}
if (parsedContent.__file !== "wp_block" || !parsedContent.title || !parsedContent.content || typeof parsedContent.title !== "string" || typeof parsedContent.content !== "string" || parsedContent.syncStatus && typeof parsedContent.syncStatus !== "string") {
throw new Error("Invalid pattern JSON file");
}
const postType = await external_wp_apiFetch_default()({ path: `/wp/v2/types/wp_block` });
const reusableBlock = await external_wp_apiFetch_default()({
path: `/wp/v2/${postType.rest_base}`,
data: {
title: parsedContent.title,
content: parsedContent.content,
status: "publish",
meta: parsedContent.syncStatus === "unsynced" ? { wp_pattern_sync_status: parsedContent.syncStatus } : void 0
},
method: "POST"
});
return reusableBlock;
}
var import_default = importReusableBlock;
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-form/index.js
function ImportForm({ instanceId, onUpload }) {
const inputId = "list-reusable-blocks-import-form-" + instanceId;
const formRef = (0,external_wp_element_namespaceObject.useRef)();
const [isLoading, setIsLoading] = (0,external_wp_element_namespaceObject.useState)(false);
const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null);
const [file, setFile] = (0,external_wp_element_namespaceObject.useState)(null);
const onChangeFile = (event) => {
setFile(event.target.files[0]);
setError(null);
};
const onSubmit = (event) => {
event.preventDefault();
if (!file) {
return;
}
setIsLoading({ isLoading: true });
import_default(file).then((reusableBlock) => {
if (!formRef) {
return;
}
setIsLoading(false);
onUpload(reusableBlock);
}).catch((errors) => {
if (!formRef) {
return;
}
let uiMessage;
switch (errors.message) {
case "Invalid JSON file":
uiMessage = (0,external_wp_i18n_namespaceObject.__)("Invalid JSON file");
break;
case "Invalid pattern JSON file":
uiMessage = (0,external_wp_i18n_namespaceObject.__)("Invalid pattern JSON file");
break;
default:
uiMessage = (0,external_wp_i18n_namespaceObject.__)("Unknown error");
}
setIsLoading(false);
setError(uiMessage);
});
};
const onDismissError = () => {
setError(null);
};
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
"form",
{
className: "list-reusable-blocks-import-form",
onSubmit,
ref: formRef,
children: [
error && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "error", onRemove: () => onDismissError(), children: error }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
"label",
{
htmlFor: inputId,
className: "list-reusable-blocks-import-form__label",
children: (0,external_wp_i18n_namespaceObject.__)("File")
}
),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { id: inputId, type: "file", onChange: onChangeFile }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
type: "submit",
isBusy: isLoading,
accessibleWhenDisabled: true,
disabled: !file || isLoading,
variant: "secondary",
className: "list-reusable-blocks-import-form__button",
children: (0,external_wp_i18n_namespaceObject._x)("Import", "button label")
}
)
]
}
);
}
var import_form_default = (0,external_wp_compose_namespaceObject.withInstanceId)(ImportForm);
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-dropdown/index.js
function ImportDropdown({ onUpload }) {
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Dropdown,
{
popoverProps: { placement: "bottom-start" },
contentClassName: "list-reusable-blocks-import-dropdown__content",
renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "compact",
className: "list-reusable-blocks-import-dropdown__button",
"aria-expanded": isOpen,
onClick: onToggle,
variant: "primary",
children: (0,external_wp_i18n_namespaceObject.__)("Import from JSON")
}
),
renderContent: ({ onClose }) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(import_form_default, { onUpload: (0,external_wp_compose_namespaceObject.pipe)(onClose, onUpload) })
}
);
}
var import_dropdown_default = ImportDropdown;
;// ./node_modules/@wordpress/list-reusable-blocks/build-module/index.js
document.body.addEventListener("click", (event) => {
if (!event.target.classList.contains("wp-list-reusable-blocks__export")) {
return;
}
event.preventDefault();
export_default(event.target.dataset.id);
});
document.addEventListener("DOMContentLoaded", () => {
const button = document.querySelector(".page-title-action");
if (!button) {
return;
}
const showNotice = () => {
const notice = document.createElement("div");
notice.className = "notice notice-success is-dismissible";
notice.innerHTML = `<p>${(0,external_wp_i18n_namespaceObject.__)("Pattern imported successfully!")}</p>`;
const headerEnd = document.querySelector(".wp-header-end");
if (!headerEnd) {
return;
}
headerEnd.parentNode.insertBefore(notice, headerEnd);
};
const container = document.createElement("div");
container.className = "list-reusable-blocks__container";
button.parentNode.insertBefore(container, button);
(0,external_wp_element_namespaceObject.createRoot)(container).render(
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(import_dropdown_default, { onUpload: showNotice }) })
);
});
(window.wp = window.wp || {}).listReusableBlocks = __webpack_exports__;
/******/ })()
; development/react-refresh-runtime.js 0000644 00000057135 15144410747 0013661 0 ustar 00 /*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/react-refresh/cjs/react-refresh-runtime.development.js":
/*!*****************************************************************************!*\
!*** ./node_modules/react-refresh/cjs/react-refresh-runtime.development.js ***!
\*****************************************************************************/
/***/ ((__unused_webpack_module, exports) => {
eval("/**\n * @license React\n * react-refresh-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n'use strict';\n\n// ATTENTION\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\n\nvar PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // We never remove these associations.\n// It's OK to reference families, but use WeakMap/Set for types.\n\nvar allFamiliesByID = new Map();\nvar allFamiliesByType = new PossiblyWeakMap();\nvar allSignaturesByType = new PossiblyWeakMap(); // This WeakMap is read by React, so we only put families\n// that have actually been edited here. This keeps checks fast.\n// $FlowIssue\n\nvar updatedFamiliesByType = new PossiblyWeakMap(); // This is cleared on every performReactRefresh() call.\n// It is an array of [Family, NextType] tuples.\n\nvar pendingUpdates = []; // This is injected by the renderer via DevTools global hook.\n\nvar helpersByRendererID = new Map();\nvar helpersByRoot = new Map(); // We keep track of mounted roots so we can schedule updates.\n\nvar mountedRoots = new Set(); // If a root captures an error, we remember it so we can retry on edit.\n\nvar failedRoots = new Set(); // In environments that support WeakMap, we also remember the last element for every root.\n// It needs to be weak because we do this even for roots that failed to mount.\n// If there is no WeakMap, we won't attempt to do retrying.\n// $FlowIssue\n\nvar rootElements = // $FlowIssue\ntypeof WeakMap === 'function' ? new WeakMap() : null;\nvar isPerformingRefresh = false;\n\nfunction computeFullKey(signature) {\n if (signature.fullKey !== null) {\n return signature.fullKey;\n }\n\n var fullKey = signature.ownKey;\n var hooks;\n\n try {\n hooks = signature.getCustomHooks();\n } catch (err) {\n // This can happen in an edge case, e.g. if expression like Foo.useSomething\n // depends on Foo which is lazily initialized during rendering.\n // In that case just assume we'll have to remount.\n signature.forceReset = true;\n signature.fullKey = fullKey;\n return fullKey;\n }\n\n for (var i = 0; i < hooks.length; i++) {\n var hook = hooks[i];\n\n if (typeof hook !== 'function') {\n // Something's wrong. Assume we need to remount.\n signature.forceReset = true;\n signature.fullKey = fullKey;\n return fullKey;\n }\n\n var nestedHookSignature = allSignaturesByType.get(hook);\n\n if (nestedHookSignature === undefined) {\n // No signature means Hook wasn't in the source code, e.g. in a library.\n // We'll skip it because we can assume it won't change during this session.\n continue;\n }\n\n var nestedHookKey = computeFullKey(nestedHookSignature);\n\n if (nestedHookSignature.forceReset) {\n signature.forceReset = true;\n }\n\n fullKey += '\\n---\\n' + nestedHookKey;\n }\n\n signature.fullKey = fullKey;\n return fullKey;\n}\n\nfunction haveEqualSignatures(prevType, nextType) {\n var prevSignature = allSignaturesByType.get(prevType);\n var nextSignature = allSignaturesByType.get(nextType);\n\n if (prevSignature === undefined && nextSignature === undefined) {\n return true;\n }\n\n if (prevSignature === undefined || nextSignature === undefined) {\n return false;\n }\n\n if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) {\n return false;\n }\n\n if (nextSignature.forceReset) {\n return false;\n }\n\n return true;\n}\n\nfunction isReactClass(type) {\n return type.prototype && type.prototype.isReactComponent;\n}\n\nfunction canPreserveStateBetween(prevType, nextType) {\n if (isReactClass(prevType) || isReactClass(nextType)) {\n return false;\n }\n\n if (haveEqualSignatures(prevType, nextType)) {\n return true;\n }\n\n return false;\n}\n\nfunction resolveFamily(type) {\n // Only check updated types to keep lookups fast.\n return updatedFamiliesByType.get(type);\n} // If we didn't care about IE11, we could use new Map/Set(iterable).\n\n\nfunction cloneMap(map) {\n var clone = new Map();\n map.forEach(function (value, key) {\n clone.set(key, value);\n });\n return clone;\n}\n\nfunction cloneSet(set) {\n var clone = new Set();\n set.forEach(function (value) {\n clone.add(value);\n });\n return clone;\n} // This is a safety mechanism to protect against rogue getters and Proxies.\n\n\nfunction getProperty(object, property) {\n try {\n return object[property];\n } catch (err) {\n // Intentionally ignore.\n return undefined;\n }\n}\n\nfunction performReactRefresh() {\n\n if (pendingUpdates.length === 0) {\n return null;\n }\n\n if (isPerformingRefresh) {\n return null;\n }\n\n isPerformingRefresh = true;\n\n try {\n var staleFamilies = new Set();\n var updatedFamilies = new Set();\n var updates = pendingUpdates;\n pendingUpdates = [];\n updates.forEach(function (_ref) {\n var family = _ref[0],\n nextType = _ref[1];\n // Now that we got a real edit, we can create associations\n // that will be read by the React reconciler.\n var prevType = family.current;\n updatedFamiliesByType.set(prevType, family);\n updatedFamiliesByType.set(nextType, family);\n family.current = nextType; // Determine whether this should be a re-render or a re-mount.\n\n if (canPreserveStateBetween(prevType, nextType)) {\n updatedFamilies.add(family);\n } else {\n staleFamilies.add(family);\n }\n }); // TODO: rename these fields to something more meaningful.\n\n var update = {\n updatedFamilies: updatedFamilies,\n // Families that will re-render preserving state\n staleFamilies: staleFamilies // Families that will be remounted\n\n };\n helpersByRendererID.forEach(function (helpers) {\n // Even if there are no roots, set the handler on first update.\n // This ensures that if *new* roots are mounted, they'll use the resolve handler.\n helpers.setRefreshHandler(resolveFamily);\n });\n var didError = false;\n var firstError = null; // We snapshot maps and sets that are mutated during commits.\n // If we don't do this, there is a risk they will be mutated while\n // we iterate over them. For example, trying to recover a failed root\n // may cause another root to be added to the failed list -- an infinite loop.\n\n var failedRootsSnapshot = cloneSet(failedRoots);\n var mountedRootsSnapshot = cloneSet(mountedRoots);\n var helpersByRootSnapshot = cloneMap(helpersByRoot);\n failedRootsSnapshot.forEach(function (root) {\n var helpers = helpersByRootSnapshot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n if (!failedRoots.has(root)) {// No longer failed.\n }\n\n if (rootElements === null) {\n return;\n }\n\n if (!rootElements.has(root)) {\n return;\n }\n\n var element = rootElements.get(root);\n\n try {\n helpers.scheduleRoot(root, element);\n } catch (err) {\n if (!didError) {\n didError = true;\n firstError = err;\n } // Keep trying other roots.\n\n }\n });\n mountedRootsSnapshot.forEach(function (root) {\n var helpers = helpersByRootSnapshot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n if (!mountedRoots.has(root)) {// No longer mounted.\n }\n\n try {\n helpers.scheduleRefresh(root, update);\n } catch (err) {\n if (!didError) {\n didError = true;\n firstError = err;\n } // Keep trying other roots.\n\n }\n });\n\n if (didError) {\n throw firstError;\n }\n\n return update;\n } finally {\n isPerformingRefresh = false;\n }\n}\nfunction register(type, id) {\n {\n if (type === null) {\n return;\n }\n\n if (typeof type !== 'function' && typeof type !== 'object') {\n return;\n } // This can happen in an edge case, e.g. if we register\n // return value of a HOC but it returns a cached component.\n // Ignore anything but the first registration for each type.\n\n\n if (allFamiliesByType.has(type)) {\n return;\n } // Create family or remember to update it.\n // None of this bookkeeping affects reconciliation\n // until the first performReactRefresh() call above.\n\n\n var family = allFamiliesByID.get(id);\n\n if (family === undefined) {\n family = {\n current: type\n };\n allFamiliesByID.set(id, family);\n } else {\n pendingUpdates.push([family, type]);\n }\n\n allFamiliesByType.set(type, family); // Visit inner types because we might not have registered them.\n\n if (typeof type === 'object' && type !== null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n register(type.render, id + '$render');\n break;\n\n case REACT_MEMO_TYPE:\n register(type.type, id + '$type');\n break;\n }\n }\n }\n}\nfunction setSignature(type, key) {\n var forceReset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var getCustomHooks = arguments.length > 3 ? arguments[3] : undefined;\n\n {\n if (!allSignaturesByType.has(type)) {\n allSignaturesByType.set(type, {\n forceReset: forceReset,\n ownKey: key,\n fullKey: null,\n getCustomHooks: getCustomHooks || function () {\n return [];\n }\n });\n } // Visit inner types because we might not have signed them.\n\n\n if (typeof type === 'object' && type !== null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n setSignature(type.render, key, forceReset, getCustomHooks);\n break;\n\n case REACT_MEMO_TYPE:\n setSignature(type.type, key, forceReset, getCustomHooks);\n break;\n }\n }\n }\n} // This is lazily called during first render for a type.\n// It captures Hook list at that time so inline requires don't break comparisons.\n\nfunction collectCustomHooksForSignature(type) {\n {\n var signature = allSignaturesByType.get(type);\n\n if (signature !== undefined) {\n computeFullKey(signature);\n }\n }\n}\nfunction getFamilyByID(id) {\n {\n return allFamiliesByID.get(id);\n }\n}\nfunction getFamilyByType(type) {\n {\n return allFamiliesByType.get(type);\n }\n}\nfunction findAffectedHostInstances(families) {\n {\n var affectedInstances = new Set();\n mountedRoots.forEach(function (root) {\n var helpers = helpersByRoot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n var instancesForRoot = helpers.findHostInstancesForRefresh(root, families);\n instancesForRoot.forEach(function (inst) {\n affectedInstances.add(inst);\n });\n });\n return affectedInstances;\n }\n}\nfunction injectIntoGlobalHook(globalObject) {\n {\n // For React Native, the global hook will be set up by require('react-devtools-core').\n // That code will run before us. So we need to monkeypatch functions on existing hook.\n // For React Web, the global hook will be set up by the extension.\n // This will also run before us.\n var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n if (hook === undefined) {\n // However, if there is no DevTools extension, we'll need to set up the global hook ourselves.\n // Note that in this case it's important that renderer code runs *after* this method call.\n // Otherwise, the renderer will think that there is no global hook, and won't do the injection.\n var nextID = 0;\n globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {\n renderers: new Map(),\n supportsFiber: true,\n inject: function (injected) {\n return nextID++;\n },\n onScheduleFiberRoot: function (id, root, children) {},\n onCommitFiberRoot: function (id, root, maybePriorityLevel, didError) {},\n onCommitFiberUnmount: function () {}\n };\n }\n\n if (hook.isDisabled) {\n // This isn't a real property on the hook, but it can be set to opt out\n // of DevTools integration and associated warnings and logs.\n // Using console['warn'] to evade Babel and ESLint\n console['warn']('Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). ' + 'Fast Refresh is not compatible with this shim and will be disabled.');\n return;\n } // Here, we just want to get a reference to scheduleRefresh.\n\n\n var oldInject = hook.inject;\n\n hook.inject = function (injected) {\n var id = oldInject.apply(this, arguments);\n\n if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n // This version supports React Refresh.\n helpersByRendererID.set(id, injected);\n }\n\n return id;\n }; // Do the same for any already injected roots.\n // This is useful if ReactDOM has already been initialized.\n // https://github.com/facebook/react/issues/17626\n\n\n hook.renderers.forEach(function (injected, id) {\n if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n // This version supports React Refresh.\n helpersByRendererID.set(id, injected);\n }\n }); // We also want to track currently mounted roots.\n\n var oldOnCommitFiberRoot = hook.onCommitFiberRoot;\n\n var oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function () {};\n\n hook.onScheduleFiberRoot = function (id, root, children) {\n if (!isPerformingRefresh) {\n // If it was intentionally scheduled, don't attempt to restore.\n // This includes intentionally scheduled unmounts.\n failedRoots.delete(root);\n\n if (rootElements !== null) {\n rootElements.set(root, children);\n }\n }\n\n return oldOnScheduleFiberRoot.apply(this, arguments);\n };\n\n hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) {\n var helpers = helpersByRendererID.get(id);\n\n if (helpers !== undefined) {\n helpersByRoot.set(root, helpers);\n var current = root.current;\n var alternate = current.alternate; // We need to determine whether this root has just (un)mounted.\n // This logic is copy-pasted from similar logic in the DevTools backend.\n // If this breaks with some refactoring, you'll want to update DevTools too.\n\n if (alternate !== null) {\n var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && mountedRoots.has(root);\n var isMounted = current.memoizedState != null && current.memoizedState.element != null;\n\n if (!wasMounted && isMounted) {\n // Mount a new root.\n mountedRoots.add(root);\n failedRoots.delete(root);\n } else if (wasMounted && isMounted) ; else if (wasMounted && !isMounted) {\n // Unmount an existing root.\n mountedRoots.delete(root);\n\n if (didError) {\n // We'll remount it on future edits.\n failedRoots.add(root);\n } else {\n helpersByRoot.delete(root);\n }\n } else if (!wasMounted && !isMounted) {\n if (didError) {\n // We'll remount it on future edits.\n failedRoots.add(root);\n }\n }\n } else {\n // Mount a new root.\n mountedRoots.add(root);\n }\n } // Always call the decorated DevTools hook.\n\n\n return oldOnCommitFiberRoot.apply(this, arguments);\n };\n }\n}\nfunction hasUnrecoverableErrors() {\n // TODO: delete this after removing dependency in RN.\n return false;\n} // Exposed for testing.\n\nfunction _getMountedRootCount() {\n {\n return mountedRoots.size;\n }\n} // This is a wrapper over more primitive functions for setting signature.\n// Signatures let us decide whether the Hook order has changed on refresh.\n//\n// This function is intended to be used as a transform target, e.g.:\n// var _s = createSignatureFunctionForTransform()\n//\n// function Hello() {\n// const [foo, setFoo] = useState(0);\n// const value = useCustomHook();\n// _s(); /* Call without arguments triggers collecting the custom Hook list.\n// * This doesn't happen during the module evaluation because we\n// * don't want to change the module order with inline requires.\n// * Next calls are noops. */\n// return <h1>Hi</h1>;\n// }\n//\n// /* Call with arguments attaches the signature to the type: */\n// _s(\n// Hello,\n// 'useState{[foo, setFoo]}(0)',\n// () => [useCustomHook], /* Lazy to avoid triggering inline requires */\n// );\n\nfunction createSignatureFunctionForTransform() {\n {\n var savedType;\n var hasCustomHooks;\n var didCollectHooks = false;\n return function (type, key, forceReset, getCustomHooks) {\n if (typeof key === 'string') {\n // We're in the initial phase that associates signatures\n // with the functions. Note this may be called multiple times\n // in HOC chains like _s(hoc1(_s(hoc2(_s(actualFunction))))).\n if (!savedType) {\n // We're in the innermost call, so this is the actual type.\n savedType = type;\n hasCustomHooks = typeof getCustomHooks === 'function';\n } // Set the signature for all types (even wrappers!) in case\n // they have no signatures of their own. This is to prevent\n // problems like https://github.com/facebook/react/issues/20417.\n\n\n if (type != null && (typeof type === 'function' || typeof type === 'object')) {\n setSignature(type, key, forceReset, getCustomHooks);\n }\n\n return type;\n } else {\n // We're in the _s() call without arguments, which means\n // this is the time to collect custom Hook signatures.\n // Only do this once. This path is hot and runs *inside* every render!\n if (!didCollectHooks && hasCustomHooks) {\n didCollectHooks = true;\n collectCustomHooksForSignature(savedType);\n }\n }\n };\n }\n}\nfunction isLikelyComponentType(type) {\n {\n switch (typeof type) {\n case 'function':\n {\n // First, deal with classes.\n if (type.prototype != null) {\n if (type.prototype.isReactComponent) {\n // React class.\n return true;\n }\n\n var ownNames = Object.getOwnPropertyNames(type.prototype);\n\n if (ownNames.length > 1 || ownNames[0] !== 'constructor') {\n // This looks like a class.\n return false;\n } // eslint-disable-next-line no-proto\n\n\n if (type.prototype.__proto__ !== Object.prototype) {\n // It has a superclass.\n return false;\n } // Pass through.\n // This looks like a regular function with empty prototype.\n\n } // For plain functions and arrows, use name as a heuristic.\n\n\n var name = type.name || type.displayName;\n return typeof name === 'string' && /^[A-Z]/.test(name);\n }\n\n case 'object':\n {\n if (type != null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n case REACT_MEMO_TYPE:\n // Definitely React components.\n return true;\n\n default:\n return false;\n }\n }\n\n return false;\n }\n\n default:\n {\n return false;\n }\n }\n }\n}\n\nexports._getMountedRootCount = _getMountedRootCount;\nexports.collectCustomHooksForSignature = collectCustomHooksForSignature;\nexports.createSignatureFunctionForTransform = createSignatureFunctionForTransform;\nexports.findAffectedHostInstances = findAffectedHostInstances;\nexports.getFamilyByID = getFamilyByID;\nexports.getFamilyByType = getFamilyByType;\nexports.hasUnrecoverableErrors = hasUnrecoverableErrors;\nexports.injectIntoGlobalHook = injectIntoGlobalHook;\nexports.isLikelyComponentType = isLikelyComponentType;\nexports.performReactRefresh = performReactRefresh;\nexports.register = register;\nexports.setSignature = setSignature;\n })();\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/react-refresh/cjs/react-refresh-runtime.development.js?");
/***/ }),
/***/ "./node_modules/react-refresh/runtime.js":
/*!***********************************************!*\
!*** ./node_modules/react-refresh/runtime.js ***!
\***********************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
eval("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react-refresh-runtime.development.js */ \"./node_modules/react-refresh/cjs/react-refresh-runtime.development.js\");\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/react-refresh/runtime.js?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./node_modules/react-refresh/runtime.js");
/******/ window.ReactRefreshRuntime = __webpack_exports__;
/******/
/******/ })()
; development/react-refresh-runtime.min.js 0000644 00000057135 15144410747 0014443 0 ustar 00 /*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/react-refresh/cjs/react-refresh-runtime.development.js":
/*!*****************************************************************************!*\
!*** ./node_modules/react-refresh/cjs/react-refresh-runtime.development.js ***!
\*****************************************************************************/
/***/ ((__unused_webpack_module, exports) => {
eval("/**\n * @license React\n * react-refresh-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n'use strict';\n\n// ATTENTION\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\n\nvar PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // We never remove these associations.\n// It's OK to reference families, but use WeakMap/Set for types.\n\nvar allFamiliesByID = new Map();\nvar allFamiliesByType = new PossiblyWeakMap();\nvar allSignaturesByType = new PossiblyWeakMap(); // This WeakMap is read by React, so we only put families\n// that have actually been edited here. This keeps checks fast.\n// $FlowIssue\n\nvar updatedFamiliesByType = new PossiblyWeakMap(); // This is cleared on every performReactRefresh() call.\n// It is an array of [Family, NextType] tuples.\n\nvar pendingUpdates = []; // This is injected by the renderer via DevTools global hook.\n\nvar helpersByRendererID = new Map();\nvar helpersByRoot = new Map(); // We keep track of mounted roots so we can schedule updates.\n\nvar mountedRoots = new Set(); // If a root captures an error, we remember it so we can retry on edit.\n\nvar failedRoots = new Set(); // In environments that support WeakMap, we also remember the last element for every root.\n// It needs to be weak because we do this even for roots that failed to mount.\n// If there is no WeakMap, we won't attempt to do retrying.\n// $FlowIssue\n\nvar rootElements = // $FlowIssue\ntypeof WeakMap === 'function' ? new WeakMap() : null;\nvar isPerformingRefresh = false;\n\nfunction computeFullKey(signature) {\n if (signature.fullKey !== null) {\n return signature.fullKey;\n }\n\n var fullKey = signature.ownKey;\n var hooks;\n\n try {\n hooks = signature.getCustomHooks();\n } catch (err) {\n // This can happen in an edge case, e.g. if expression like Foo.useSomething\n // depends on Foo which is lazily initialized during rendering.\n // In that case just assume we'll have to remount.\n signature.forceReset = true;\n signature.fullKey = fullKey;\n return fullKey;\n }\n\n for (var i = 0; i < hooks.length; i++) {\n var hook = hooks[i];\n\n if (typeof hook !== 'function') {\n // Something's wrong. Assume we need to remount.\n signature.forceReset = true;\n signature.fullKey = fullKey;\n return fullKey;\n }\n\n var nestedHookSignature = allSignaturesByType.get(hook);\n\n if (nestedHookSignature === undefined) {\n // No signature means Hook wasn't in the source code, e.g. in a library.\n // We'll skip it because we can assume it won't change during this session.\n continue;\n }\n\n var nestedHookKey = computeFullKey(nestedHookSignature);\n\n if (nestedHookSignature.forceReset) {\n signature.forceReset = true;\n }\n\n fullKey += '\\n---\\n' + nestedHookKey;\n }\n\n signature.fullKey = fullKey;\n return fullKey;\n}\n\nfunction haveEqualSignatures(prevType, nextType) {\n var prevSignature = allSignaturesByType.get(prevType);\n var nextSignature = allSignaturesByType.get(nextType);\n\n if (prevSignature === undefined && nextSignature === undefined) {\n return true;\n }\n\n if (prevSignature === undefined || nextSignature === undefined) {\n return false;\n }\n\n if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) {\n return false;\n }\n\n if (nextSignature.forceReset) {\n return false;\n }\n\n return true;\n}\n\nfunction isReactClass(type) {\n return type.prototype && type.prototype.isReactComponent;\n}\n\nfunction canPreserveStateBetween(prevType, nextType) {\n if (isReactClass(prevType) || isReactClass(nextType)) {\n return false;\n }\n\n if (haveEqualSignatures(prevType, nextType)) {\n return true;\n }\n\n return false;\n}\n\nfunction resolveFamily(type) {\n // Only check updated types to keep lookups fast.\n return updatedFamiliesByType.get(type);\n} // If we didn't care about IE11, we could use new Map/Set(iterable).\n\n\nfunction cloneMap(map) {\n var clone = new Map();\n map.forEach(function (value, key) {\n clone.set(key, value);\n });\n return clone;\n}\n\nfunction cloneSet(set) {\n var clone = new Set();\n set.forEach(function (value) {\n clone.add(value);\n });\n return clone;\n} // This is a safety mechanism to protect against rogue getters and Proxies.\n\n\nfunction getProperty(object, property) {\n try {\n return object[property];\n } catch (err) {\n // Intentionally ignore.\n return undefined;\n }\n}\n\nfunction performReactRefresh() {\n\n if (pendingUpdates.length === 0) {\n return null;\n }\n\n if (isPerformingRefresh) {\n return null;\n }\n\n isPerformingRefresh = true;\n\n try {\n var staleFamilies = new Set();\n var updatedFamilies = new Set();\n var updates = pendingUpdates;\n pendingUpdates = [];\n updates.forEach(function (_ref) {\n var family = _ref[0],\n nextType = _ref[1];\n // Now that we got a real edit, we can create associations\n // that will be read by the React reconciler.\n var prevType = family.current;\n updatedFamiliesByType.set(prevType, family);\n updatedFamiliesByType.set(nextType, family);\n family.current = nextType; // Determine whether this should be a re-render or a re-mount.\n\n if (canPreserveStateBetween(prevType, nextType)) {\n updatedFamilies.add(family);\n } else {\n staleFamilies.add(family);\n }\n }); // TODO: rename these fields to something more meaningful.\n\n var update = {\n updatedFamilies: updatedFamilies,\n // Families that will re-render preserving state\n staleFamilies: staleFamilies // Families that will be remounted\n\n };\n helpersByRendererID.forEach(function (helpers) {\n // Even if there are no roots, set the handler on first update.\n // This ensures that if *new* roots are mounted, they'll use the resolve handler.\n helpers.setRefreshHandler(resolveFamily);\n });\n var didError = false;\n var firstError = null; // We snapshot maps and sets that are mutated during commits.\n // If we don't do this, there is a risk they will be mutated while\n // we iterate over them. For example, trying to recover a failed root\n // may cause another root to be added to the failed list -- an infinite loop.\n\n var failedRootsSnapshot = cloneSet(failedRoots);\n var mountedRootsSnapshot = cloneSet(mountedRoots);\n var helpersByRootSnapshot = cloneMap(helpersByRoot);\n failedRootsSnapshot.forEach(function (root) {\n var helpers = helpersByRootSnapshot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n if (!failedRoots.has(root)) {// No longer failed.\n }\n\n if (rootElements === null) {\n return;\n }\n\n if (!rootElements.has(root)) {\n return;\n }\n\n var element = rootElements.get(root);\n\n try {\n helpers.scheduleRoot(root, element);\n } catch (err) {\n if (!didError) {\n didError = true;\n firstError = err;\n } // Keep trying other roots.\n\n }\n });\n mountedRootsSnapshot.forEach(function (root) {\n var helpers = helpersByRootSnapshot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n if (!mountedRoots.has(root)) {// No longer mounted.\n }\n\n try {\n helpers.scheduleRefresh(root, update);\n } catch (err) {\n if (!didError) {\n didError = true;\n firstError = err;\n } // Keep trying other roots.\n\n }\n });\n\n if (didError) {\n throw firstError;\n }\n\n return update;\n } finally {\n isPerformingRefresh = false;\n }\n}\nfunction register(type, id) {\n {\n if (type === null) {\n return;\n }\n\n if (typeof type !== 'function' && typeof type !== 'object') {\n return;\n } // This can happen in an edge case, e.g. if we register\n // return value of a HOC but it returns a cached component.\n // Ignore anything but the first registration for each type.\n\n\n if (allFamiliesByType.has(type)) {\n return;\n } // Create family or remember to update it.\n // None of this bookkeeping affects reconciliation\n // until the first performReactRefresh() call above.\n\n\n var family = allFamiliesByID.get(id);\n\n if (family === undefined) {\n family = {\n current: type\n };\n allFamiliesByID.set(id, family);\n } else {\n pendingUpdates.push([family, type]);\n }\n\n allFamiliesByType.set(type, family); // Visit inner types because we might not have registered them.\n\n if (typeof type === 'object' && type !== null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n register(type.render, id + '$render');\n break;\n\n case REACT_MEMO_TYPE:\n register(type.type, id + '$type');\n break;\n }\n }\n }\n}\nfunction setSignature(type, key) {\n var forceReset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var getCustomHooks = arguments.length > 3 ? arguments[3] : undefined;\n\n {\n if (!allSignaturesByType.has(type)) {\n allSignaturesByType.set(type, {\n forceReset: forceReset,\n ownKey: key,\n fullKey: null,\n getCustomHooks: getCustomHooks || function () {\n return [];\n }\n });\n } // Visit inner types because we might not have signed them.\n\n\n if (typeof type === 'object' && type !== null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n setSignature(type.render, key, forceReset, getCustomHooks);\n break;\n\n case REACT_MEMO_TYPE:\n setSignature(type.type, key, forceReset, getCustomHooks);\n break;\n }\n }\n }\n} // This is lazily called during first render for a type.\n// It captures Hook list at that time so inline requires don't break comparisons.\n\nfunction collectCustomHooksForSignature(type) {\n {\n var signature = allSignaturesByType.get(type);\n\n if (signature !== undefined) {\n computeFullKey(signature);\n }\n }\n}\nfunction getFamilyByID(id) {\n {\n return allFamiliesByID.get(id);\n }\n}\nfunction getFamilyByType(type) {\n {\n return allFamiliesByType.get(type);\n }\n}\nfunction findAffectedHostInstances(families) {\n {\n var affectedInstances = new Set();\n mountedRoots.forEach(function (root) {\n var helpers = helpersByRoot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n var instancesForRoot = helpers.findHostInstancesForRefresh(root, families);\n instancesForRoot.forEach(function (inst) {\n affectedInstances.add(inst);\n });\n });\n return affectedInstances;\n }\n}\nfunction injectIntoGlobalHook(globalObject) {\n {\n // For React Native, the global hook will be set up by require('react-devtools-core').\n // That code will run before us. So we need to monkeypatch functions on existing hook.\n // For React Web, the global hook will be set up by the extension.\n // This will also run before us.\n var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n if (hook === undefined) {\n // However, if there is no DevTools extension, we'll need to set up the global hook ourselves.\n // Note that in this case it's important that renderer code runs *after* this method call.\n // Otherwise, the renderer will think that there is no global hook, and won't do the injection.\n var nextID = 0;\n globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {\n renderers: new Map(),\n supportsFiber: true,\n inject: function (injected) {\n return nextID++;\n },\n onScheduleFiberRoot: function (id, root, children) {},\n onCommitFiberRoot: function (id, root, maybePriorityLevel, didError) {},\n onCommitFiberUnmount: function () {}\n };\n }\n\n if (hook.isDisabled) {\n // This isn't a real property on the hook, but it can be set to opt out\n // of DevTools integration and associated warnings and logs.\n // Using console['warn'] to evade Babel and ESLint\n console['warn']('Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). ' + 'Fast Refresh is not compatible with this shim and will be disabled.');\n return;\n } // Here, we just want to get a reference to scheduleRefresh.\n\n\n var oldInject = hook.inject;\n\n hook.inject = function (injected) {\n var id = oldInject.apply(this, arguments);\n\n if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n // This version supports React Refresh.\n helpersByRendererID.set(id, injected);\n }\n\n return id;\n }; // Do the same for any already injected roots.\n // This is useful if ReactDOM has already been initialized.\n // https://github.com/facebook/react/issues/17626\n\n\n hook.renderers.forEach(function (injected, id) {\n if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n // This version supports React Refresh.\n helpersByRendererID.set(id, injected);\n }\n }); // We also want to track currently mounted roots.\n\n var oldOnCommitFiberRoot = hook.onCommitFiberRoot;\n\n var oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function () {};\n\n hook.onScheduleFiberRoot = function (id, root, children) {\n if (!isPerformingRefresh) {\n // If it was intentionally scheduled, don't attempt to restore.\n // This includes intentionally scheduled unmounts.\n failedRoots.delete(root);\n\n if (rootElements !== null) {\n rootElements.set(root, children);\n }\n }\n\n return oldOnScheduleFiberRoot.apply(this, arguments);\n };\n\n hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) {\n var helpers = helpersByRendererID.get(id);\n\n if (helpers !== undefined) {\n helpersByRoot.set(root, helpers);\n var current = root.current;\n var alternate = current.alternate; // We need to determine whether this root has just (un)mounted.\n // This logic is copy-pasted from similar logic in the DevTools backend.\n // If this breaks with some refactoring, you'll want to update DevTools too.\n\n if (alternate !== null) {\n var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && mountedRoots.has(root);\n var isMounted = current.memoizedState != null && current.memoizedState.element != null;\n\n if (!wasMounted && isMounted) {\n // Mount a new root.\n mountedRoots.add(root);\n failedRoots.delete(root);\n } else if (wasMounted && isMounted) ; else if (wasMounted && !isMounted) {\n // Unmount an existing root.\n mountedRoots.delete(root);\n\n if (didError) {\n // We'll remount it on future edits.\n failedRoots.add(root);\n } else {\n helpersByRoot.delete(root);\n }\n } else if (!wasMounted && !isMounted) {\n if (didError) {\n // We'll remount it on future edits.\n failedRoots.add(root);\n }\n }\n } else {\n // Mount a new root.\n mountedRoots.add(root);\n }\n } // Always call the decorated DevTools hook.\n\n\n return oldOnCommitFiberRoot.apply(this, arguments);\n };\n }\n}\nfunction hasUnrecoverableErrors() {\n // TODO: delete this after removing dependency in RN.\n return false;\n} // Exposed for testing.\n\nfunction _getMountedRootCount() {\n {\n return mountedRoots.size;\n }\n} // This is a wrapper over more primitive functions for setting signature.\n// Signatures let us decide whether the Hook order has changed on refresh.\n//\n// This function is intended to be used as a transform target, e.g.:\n// var _s = createSignatureFunctionForTransform()\n//\n// function Hello() {\n// const [foo, setFoo] = useState(0);\n// const value = useCustomHook();\n// _s(); /* Call without arguments triggers collecting the custom Hook list.\n// * This doesn't happen during the module evaluation because we\n// * don't want to change the module order with inline requires.\n// * Next calls are noops. */\n// return <h1>Hi</h1>;\n// }\n//\n// /* Call with arguments attaches the signature to the type: */\n// _s(\n// Hello,\n// 'useState{[foo, setFoo]}(0)',\n// () => [useCustomHook], /* Lazy to avoid triggering inline requires */\n// );\n\nfunction createSignatureFunctionForTransform() {\n {\n var savedType;\n var hasCustomHooks;\n var didCollectHooks = false;\n return function (type, key, forceReset, getCustomHooks) {\n if (typeof key === 'string') {\n // We're in the initial phase that associates signatures\n // with the functions. Note this may be called multiple times\n // in HOC chains like _s(hoc1(_s(hoc2(_s(actualFunction))))).\n if (!savedType) {\n // We're in the innermost call, so this is the actual type.\n savedType = type;\n hasCustomHooks = typeof getCustomHooks === 'function';\n } // Set the signature for all types (even wrappers!) in case\n // they have no signatures of their own. This is to prevent\n // problems like https://github.com/facebook/react/issues/20417.\n\n\n if (type != null && (typeof type === 'function' || typeof type === 'object')) {\n setSignature(type, key, forceReset, getCustomHooks);\n }\n\n return type;\n } else {\n // We're in the _s() call without arguments, which means\n // this is the time to collect custom Hook signatures.\n // Only do this once. This path is hot and runs *inside* every render!\n if (!didCollectHooks && hasCustomHooks) {\n didCollectHooks = true;\n collectCustomHooksForSignature(savedType);\n }\n }\n };\n }\n}\nfunction isLikelyComponentType(type) {\n {\n switch (typeof type) {\n case 'function':\n {\n // First, deal with classes.\n if (type.prototype != null) {\n if (type.prototype.isReactComponent) {\n // React class.\n return true;\n }\n\n var ownNames = Object.getOwnPropertyNames(type.prototype);\n\n if (ownNames.length > 1 || ownNames[0] !== 'constructor') {\n // This looks like a class.\n return false;\n } // eslint-disable-next-line no-proto\n\n\n if (type.prototype.__proto__ !== Object.prototype) {\n // It has a superclass.\n return false;\n } // Pass through.\n // This looks like a regular function with empty prototype.\n\n } // For plain functions and arrows, use name as a heuristic.\n\n\n var name = type.name || type.displayName;\n return typeof name === 'string' && /^[A-Z]/.test(name);\n }\n\n case 'object':\n {\n if (type != null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n case REACT_MEMO_TYPE:\n // Definitely React components.\n return true;\n\n default:\n return false;\n }\n }\n\n return false;\n }\n\n default:\n {\n return false;\n }\n }\n }\n}\n\nexports._getMountedRootCount = _getMountedRootCount;\nexports.collectCustomHooksForSignature = collectCustomHooksForSignature;\nexports.createSignatureFunctionForTransform = createSignatureFunctionForTransform;\nexports.findAffectedHostInstances = findAffectedHostInstances;\nexports.getFamilyByID = getFamilyByID;\nexports.getFamilyByType = getFamilyByType;\nexports.hasUnrecoverableErrors = hasUnrecoverableErrors;\nexports.injectIntoGlobalHook = injectIntoGlobalHook;\nexports.isLikelyComponentType = isLikelyComponentType;\nexports.performReactRefresh = performReactRefresh;\nexports.register = register;\nexports.setSignature = setSignature;\n })();\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/react-refresh/cjs/react-refresh-runtime.development.js?");
/***/ }),
/***/ "./node_modules/react-refresh/runtime.js":
/*!***********************************************!*\
!*** ./node_modules/react-refresh/runtime.js ***!
\***********************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
eval("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react-refresh-runtime.development.js */ \"./node_modules/react-refresh/cjs/react-refresh-runtime.development.js\");\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/react-refresh/runtime.js?");
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./node_modules/react-refresh/runtime.js");
/******/ window.ReactRefreshRuntime = __webpack_exports__;
/******/
/******/ })()
; development/react-refresh-entry.min.js 0000644 00000200353 15144410747 0014111 0 ustar 00 /*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js":
/*!***************************************************************************************!*\
!*** ./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js ***!
\***************************************************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
eval("/* global __react_refresh_library__ */\n\nif (true) {\n const safeThis = __webpack_require__(/*! core-js-pure/features/global-this */ \"./node_modules/core-js-pure/features/global-this.js\");\n const RefreshRuntime = __webpack_require__(/*! react-refresh/runtime */ \"react-refresh/runtime\");\n\n if (typeof safeThis !== 'undefined') {\n var $RefreshInjected$ = '__reactRefreshInjected';\n // Namespace the injected flag (if necessary) for monorepo compatibility\n if (typeof __react_refresh_library__ !== 'undefined' && __react_refresh_library__) {\n $RefreshInjected$ += '_' + __react_refresh_library__;\n }\n\n // Only inject the runtime if it hasn't been injected\n if (!safeThis[$RefreshInjected$]) {\n // Inject refresh runtime into global scope\n RefreshRuntime.injectIntoGlobalHook(safeThis);\n\n // Mark the runtime as injected to prevent double-injection\n safeThis[$RefreshInjected$] = true;\n }\n }\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/actual/global-this.js":
/*!*********************************************************!*\
!*** ./node_modules/core-js-pure/actual/global-this.js ***!
\*********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar parent = __webpack_require__(/*! ../stable/global-this */ \"./node_modules/core-js-pure/stable/global-this.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/actual/global-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/es/global-this.js":
/*!*****************************************************!*\
!*** ./node_modules/core-js-pure/es/global-this.js ***!
\*****************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\n__webpack_require__(/*! ../modules/es.global-this */ \"./node_modules/core-js-pure/modules/es.global-this.js\");\n\nmodule.exports = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/es/global-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/features/global-this.js":
/*!***********************************************************!*\
!*** ./node_modules/core-js-pure/features/global-this.js ***!
\***********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nmodule.exports = __webpack_require__(/*! ../full/global-this */ \"./node_modules/core-js-pure/full/global-this.js\");\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/features/global-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/full/global-this.js":
/*!*******************************************************!*\
!*** ./node_modules/core-js-pure/full/global-this.js ***!
\*******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\n// TODO: remove from `core-js@4`\n__webpack_require__(/*! ../modules/esnext.global-this */ \"./node_modules/core-js-pure/modules/esnext.global-this.js\");\n\nvar parent = __webpack_require__(/*! ../actual/global-this */ \"./node_modules/core-js-pure/actual/global-this.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/full/global-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/a-callable.js":
/*!***********************************************************!*\
!*** ./node_modules/core-js-pure/internals/a-callable.js ***!
\***********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar tryToString = __webpack_require__(/*! ../internals/try-to-string */ \"./node_modules/core-js-pure/internals/try-to-string.js\");\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw new $TypeError(tryToString(argument) + ' is not a function');\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/a-callable.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/an-object.js":
/*!**********************************************************!*\
!*** ./node_modules/core-js-pure/internals/an-object.js ***!
\**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw new $TypeError($String(argument) + ' is not an object');\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/an-object.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/classof-raw.js":
/*!************************************************************!*\
!*** ./node_modules/core-js-pure/internals/classof-raw.js ***!
\************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/classof-raw.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/create-non-enumerable-property.js":
/*!*******************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/create-non-enumerable-property.js ***!
\*******************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ \"./node_modules/core-js-pure/internals/object-define-property.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js-pure/internals/create-property-descriptor.js\");\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/create-non-enumerable-property.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/create-property-descriptor.js":
/*!***************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/create-property-descriptor.js ***!
\***************************************************************************/
/***/ ((module) => {
"use strict";
eval("\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/create-property-descriptor.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/define-global-property.js":
/*!***********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/define-global-property.js ***!
\***********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/define-global-property.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/descriptors.js":
/*!************************************************************!*\
!*** ./node_modules/core-js-pure/internals/descriptors.js ***!
\************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/descriptors.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/document-create-element.js":
/*!************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/document-create-element.js ***!
\************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/document-create-element.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/engine-user-agent.js":
/*!******************************************************************!*\
!*** ./node_modules/core-js-pure/internals/engine-user-agent.js ***!
\******************************************************************/
/***/ ((module) => {
"use strict";
eval("\nmodule.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/engine-user-agent.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/engine-v8-version.js":
/*!******************************************************************!*\
!*** ./node_modules/core-js-pure/internals/engine-v8-version.js ***!
\******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ \"./node_modules/core-js-pure/internals/engine-user-agent.js\");\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/engine-v8-version.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/export.js":
/*!*******************************************************!*\
!*** ./node_modules/core-js-pure/internals/export.js ***!
\*******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar apply = __webpack_require__(/*! ../internals/function-apply */ \"./node_modules/core-js-pure/internals/function-apply.js\");\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ \"./node_modules/core-js-pure/internals/function-uncurry-this-clause.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar getOwnPropertyDescriptor = (__webpack_require__(/*! ../internals/object-get-own-property-descriptor */ \"./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js\").f);\nvar isForced = __webpack_require__(/*! ../internals/is-forced */ \"./node_modules/core-js-pure/internals/is-forced.js\");\nvar path = __webpack_require__(/*! ../internals/path */ \"./node_modules/core-js-pure/internals/path.js\");\nvar bind = __webpack_require__(/*! ../internals/function-bind-context */ \"./node_modules/core-js-pure/internals/function-bind-context.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js-pure/internals/has-own-property.js\");\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof Wrapper) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return apply(NativeConstructor, this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : global[TARGET] && global[TARGET].prototype;\n\n var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (!FORCED && !PROTO && typeof targetProperty == typeof sourceProperty) continue;\n\n // bind methods to global for calling from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changes in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n createNonEnumerableProperty(target, key, resultProperty);\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);\n // export real prototype methods\n if (options.real && targetPrototype && (FORCED || !targetPrototype[key])) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/export.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/fails.js":
/*!******************************************************!*\
!*** ./node_modules/core-js-pure/internals/fails.js ***!
\******************************************************/
/***/ ((module) => {
"use strict";
eval("\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/fails.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/function-apply.js":
/*!***************************************************************!*\
!*** ./node_modules/core-js-pure/internals/function-apply.js ***!
\***************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-apply.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/function-bind-context.js":
/*!**********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/function-bind-context.js ***!
\**********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ \"./node_modules/core-js-pure/internals/function-uncurry-this-clause.js\");\nvar aCallable = __webpack_require__(/*! ../internals/a-callable */ \"./node_modules/core-js-pure/internals/a-callable.js\");\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-bind-context.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/function-bind-native.js":
/*!*********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/function-bind-native.js ***!
\*********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-bind-native.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/function-call.js":
/*!**************************************************************!*\
!*** ./node_modules/core-js-pure/internals/function-call.js ***!
\**************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-call.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/function-uncurry-this-clause.js":
/*!*****************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/function-uncurry-this-clause.js ***!
\*****************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar classofRaw = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nmodule.exports = function (fn) {\n // Nashorn bug:\n // https://github.com/zloirock/core-js/issues/1128\n // https://github.com/zloirock/core-js/issues/1130\n if (classofRaw(fn) === 'Function') return uncurryThis(fn);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-uncurry-this-clause.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/function-uncurry-this.js":
/*!**********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/function-uncurry-this.js ***!
\**********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-uncurry-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/get-built-in.js":
/*!*************************************************************!*\
!*** ./node_modules/core-js-pure/internals/get-built-in.js ***!
\*************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar path = __webpack_require__(/*! ../internals/path */ \"./node_modules/core-js-pure/internals/path.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\n\nvar aFunction = function (variable) {\n return isCallable(variable) ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/get-built-in.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/get-method.js":
/*!***********************************************************!*\
!*** ./node_modules/core-js-pure/internals/get-method.js ***!
\***********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar aCallable = __webpack_require__(/*! ../internals/a-callable */ \"./node_modules/core-js-pure/internals/a-callable.js\");\nvar isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ \"./node_modules/core-js-pure/internals/is-null-or-undefined.js\");\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/get-method.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/global.js":
/*!*******************************************************!*\
!*** ./node_modules/core-js-pure/internals/global.js ***!
\*******************************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
eval("\nvar check = function (it) {\n return it && it.Math === Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) ||\n check(typeof this == 'object' && this) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/global.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/has-own-property.js":
/*!*****************************************************************!*\
!*** ./node_modules/core-js-pure/internals/has-own-property.js ***!
\*****************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\nvar toObject = __webpack_require__(/*! ../internals/to-object */ \"./node_modules/core-js-pure/internals/to-object.js\");\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/has-own-property.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/ie8-dom-define.js":
/*!***************************************************************!*\
!*** ./node_modules/core-js-pure/internals/ie8-dom-define.js ***!
\***************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar createElement = __webpack_require__(/*! ../internals/document-create-element */ \"./node_modules/core-js-pure/internals/document-create-element.js\");\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a !== 7;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/ie8-dom-define.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/indexed-object.js":
/*!***************************************************************!*\
!*** ./node_modules/core-js-pure/internals/indexed-object.js ***!
\***************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar classof = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) === 'String' ? split(it, '') : $Object(it);\n} : $Object;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/indexed-object.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/is-callable.js":
/*!************************************************************!*\
!*** ./node_modules/core-js-pure/internals/is-callable.js ***!
\************************************************************/
/***/ ((module) => {
"use strict";
eval("\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\nvar documentAll = typeof document == 'object' && document.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nmodule.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-callable.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/is-forced.js":
/*!**********************************************************!*\
!*** ./node_modules/core-js-pure/internals/is-forced.js ***!
\**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value === POLYFILL ? true\n : value === NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-forced.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/is-null-or-undefined.js":
/*!*********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/is-null-or-undefined.js ***!
\*********************************************************************/
/***/ ((module) => {
"use strict";
eval("\n// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-null-or-undefined.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/is-object.js":
/*!**********************************************************!*\
!*** ./node_modules/core-js-pure/internals/is-object.js ***!
\**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-object.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/is-pure.js":
/*!********************************************************!*\
!*** ./node_modules/core-js-pure/internals/is-pure.js ***!
\********************************************************/
/***/ ((module) => {
"use strict";
eval("\nmodule.exports = true;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-pure.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/is-symbol.js":
/*!**********************************************************!*\
!*** ./node_modules/core-js-pure/internals/is-symbol.js ***!
\**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ \"./node_modules/core-js-pure/internals/get-built-in.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar isPrototypeOf = __webpack_require__(/*! ../internals/object-is-prototype-of */ \"./node_modules/core-js-pure/internals/object-is-prototype-of.js\");\nvar USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ \"./node_modules/core-js-pure/internals/use-symbol-as-uid.js\");\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-symbol.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/object-define-property.js":
/*!***********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/object-define-property.js ***!
\***********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ \"./node_modules/core-js-pure/internals/ie8-dom-define.js\");\nvar V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(/*! ../internals/v8-prototype-define-bug */ \"./node_modules/core-js-pure/internals/v8-prototype-define-bug.js\");\nvar anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js-pure/internals/an-object.js\");\nvar toPropertyKey = __webpack_require__(/*! ../internals/to-property-key */ \"./node_modules/core-js-pure/internals/to-property-key.js\");\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-define-property.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js":
/*!***********************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js ***!
\***********************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar call = __webpack_require__(/*! ../internals/function-call */ \"./node_modules/core-js-pure/internals/function-call.js\");\nvar propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ \"./node_modules/core-js-pure/internals/object-property-is-enumerable.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js-pure/internals/create-property-descriptor.js\");\nvar toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ \"./node_modules/core-js-pure/internals/to-indexed-object.js\");\nvar toPropertyKey = __webpack_require__(/*! ../internals/to-property-key */ \"./node_modules/core-js-pure/internals/to-property-key.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js-pure/internals/has-own-property.js\");\nvar IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ \"./node_modules/core-js-pure/internals/ie8-dom-define.js\");\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/object-is-prototype-of.js":
/*!***********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/object-is-prototype-of.js ***!
\***********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-is-prototype-of.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/object-property-is-enumerable.js":
/*!******************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/object-property-is-enumerable.js ***!
\******************************************************************************/
/***/ ((__unused_webpack_module, exports) => {
"use strict";
eval("\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-property-is-enumerable.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/ordinary-to-primitive.js":
/*!**********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/ordinary-to-primitive.js ***!
\**********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar call = __webpack_require__(/*! ../internals/function-call */ \"./node_modules/core-js-pure/internals/function-call.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw new $TypeError(\"Can't convert object to primitive value\");\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/ordinary-to-primitive.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/path.js":
/*!*****************************************************!*\
!*** ./node_modules/core-js-pure/internals/path.js ***!
\*****************************************************/
/***/ ((module) => {
"use strict";
eval("\nmodule.exports = {};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/path.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/require-object-coercible.js":
/*!*************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/require-object-coercible.js ***!
\*************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ \"./node_modules/core-js-pure/internals/is-null-or-undefined.js\");\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw new $TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/require-object-coercible.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/shared-store.js":
/*!*************************************************************!*\
!*** ./node_modules/core-js-pure/internals/shared-store.js ***!
\*************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar defineGlobalProperty = __webpack_require__(/*! ../internals/define-global-property */ \"./node_modules/core-js-pure/internals/define-global-property.js\");\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/shared-store.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/shared.js":
/*!*******************************************************!*\
!*** ./node_modules/core-js-pure/internals/shared.js ***!
\*******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar IS_PURE = __webpack_require__(/*! ../internals/is-pure */ \"./node_modules/core-js-pure/internals/is-pure.js\");\nvar store = __webpack_require__(/*! ../internals/shared-store */ \"./node_modules/core-js-pure/internals/shared-store.js\");\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.35.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/shared.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/symbol-constructor-detection.js":
/*!*****************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/symbol-constructor-detection.js ***!
\*****************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\n/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ \"./node_modules/core-js-pure/internals/engine-v8-version.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\nvar $String = global.String;\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol('symbol detection');\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,\n // of course, fail.\n return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/symbol-constructor-detection.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/to-indexed-object.js":
/*!******************************************************************!*\
!*** ./node_modules/core-js-pure/internals/to-indexed-object.js ***!
\******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\n// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ \"./node_modules/core-js-pure/internals/indexed-object.js\");\nvar requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ \"./node_modules/core-js-pure/internals/require-object-coercible.js\");\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-indexed-object.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/to-object.js":
/*!**********************************************************!*\
!*** ./node_modules/core-js-pure/internals/to-object.js ***!
\**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ \"./node_modules/core-js-pure/internals/require-object-coercible.js\");\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-object.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/to-primitive.js":
/*!*************************************************************!*\
!*** ./node_modules/core-js-pure/internals/to-primitive.js ***!
\*************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar call = __webpack_require__(/*! ../internals/function-call */ \"./node_modules/core-js-pure/internals/function-call.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\nvar isSymbol = __webpack_require__(/*! ../internals/is-symbol */ \"./node_modules/core-js-pure/internals/is-symbol.js\");\nvar getMethod = __webpack_require__(/*! ../internals/get-method */ \"./node_modules/core-js-pure/internals/get-method.js\");\nvar ordinaryToPrimitive = __webpack_require__(/*! ../internals/ordinary-to-primitive */ \"./node_modules/core-js-pure/internals/ordinary-to-primitive.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw new $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-primitive.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/to-property-key.js":
/*!****************************************************************!*\
!*** ./node_modules/core-js-pure/internals/to-property-key.js ***!
\****************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ \"./node_modules/core-js-pure/internals/to-primitive.js\");\nvar isSymbol = __webpack_require__(/*! ../internals/is-symbol */ \"./node_modules/core-js-pure/internals/is-symbol.js\");\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-property-key.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/try-to-string.js":
/*!**************************************************************!*\
!*** ./node_modules/core-js-pure/internals/try-to-string.js ***!
\**************************************************************/
/***/ ((module) => {
"use strict";
eval("\nvar $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/try-to-string.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/uid.js":
/*!****************************************************!*\
!*** ./node_modules/core-js-pure/internals/uid.js ***!
\****************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/uid.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/use-symbol-as-uid.js":
/*!******************************************************************!*\
!*** ./node_modules/core-js-pure/internals/use-symbol-as-uid.js ***!
\******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\n/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = __webpack_require__(/*! ../internals/symbol-constructor-detection */ \"./node_modules/core-js-pure/internals/symbol-constructor-detection.js\");\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/use-symbol-as-uid.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/v8-prototype-define-bug.js":
/*!************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/v8-prototype-define-bug.js ***!
\************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype !== 42;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/v8-prototype-define-bug.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/well-known-symbol.js":
/*!******************************************************************!*\
!*** ./node_modules/core-js-pure/internals/well-known-symbol.js ***!
\******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar shared = __webpack_require__(/*! ../internals/shared */ \"./node_modules/core-js-pure/internals/shared.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js-pure/internals/has-own-property.js\");\nvar uid = __webpack_require__(/*! ../internals/uid */ \"./node_modules/core-js-pure/internals/uid.js\");\nvar NATIVE_SYMBOL = __webpack_require__(/*! ../internals/symbol-constructor-detection */ \"./node_modules/core-js-pure/internals/symbol-constructor-detection.js\");\nvar USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ \"./node_modules/core-js-pure/internals/use-symbol-as-uid.js\");\n\nvar Symbol = global.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/well-known-symbol.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/modules/es.global-this.js":
/*!*************************************************************!*\
!*** ./node_modules/core-js-pure/modules/es.global-this.js ***!
\*************************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js-pure/internals/export.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\n// `globalThis` object\n// https://tc39.es/ecma262/#sec-globalthis\n$({ global: true, forced: global.globalThis !== global }, {\n globalThis: global\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/modules/es.global-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/modules/esnext.global-this.js":
/*!*****************************************************************!*\
!*** ./node_modules/core-js-pure/modules/esnext.global-this.js ***!
\*****************************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\n// TODO: Remove from `core-js@4`\n__webpack_require__(/*! ../modules/es.global-this */ \"./node_modules/core-js-pure/modules/es.global-this.js\");\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/modules/esnext.global-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/stable/global-this.js":
/*!*********************************************************!*\
!*** ./node_modules/core-js-pure/stable/global-this.js ***!
\*********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar parent = __webpack_require__(/*! ../es/global-this */ \"./node_modules/core-js-pure/es/global-this.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/stable/global-this.js?");
/***/ }),
/***/ "react-refresh/runtime":
/*!**************************************!*\
!*** external "ReactRefreshRuntime" ***!
\**************************************/
/***/ ((module) => {
"use strict";
module.exports = window["ReactRefreshRuntime"];
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/global */
/******/ (() => {
/******/ __webpack_require__.g = (function() {
/******/ if (typeof globalThis === 'object') return globalThis;
/******/ try {
/******/ return this || new Function('return this')();
/******/ } catch (e) {
/******/ if (typeof window === 'object') return window;
/******/ }
/******/ })();
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js");
/******/
/******/ })()
; development/react-refresh-entry.js 0000644 00000200353 15144410747 0013327 0 ustar 00 /*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js":
/*!***************************************************************************************!*\
!*** ./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js ***!
\***************************************************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
eval("/* global __react_refresh_library__ */\n\nif (true) {\n const safeThis = __webpack_require__(/*! core-js-pure/features/global-this */ \"./node_modules/core-js-pure/features/global-this.js\");\n const RefreshRuntime = __webpack_require__(/*! react-refresh/runtime */ \"react-refresh/runtime\");\n\n if (typeof safeThis !== 'undefined') {\n var $RefreshInjected$ = '__reactRefreshInjected';\n // Namespace the injected flag (if necessary) for monorepo compatibility\n if (typeof __react_refresh_library__ !== 'undefined' && __react_refresh_library__) {\n $RefreshInjected$ += '_' + __react_refresh_library__;\n }\n\n // Only inject the runtime if it hasn't been injected\n if (!safeThis[$RefreshInjected$]) {\n // Inject refresh runtime into global scope\n RefreshRuntime.injectIntoGlobalHook(safeThis);\n\n // Mark the runtime as injected to prevent double-injection\n safeThis[$RefreshInjected$] = true;\n }\n }\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/actual/global-this.js":
/*!*********************************************************!*\
!*** ./node_modules/core-js-pure/actual/global-this.js ***!
\*********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar parent = __webpack_require__(/*! ../stable/global-this */ \"./node_modules/core-js-pure/stable/global-this.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/actual/global-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/es/global-this.js":
/*!*****************************************************!*\
!*** ./node_modules/core-js-pure/es/global-this.js ***!
\*****************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\n__webpack_require__(/*! ../modules/es.global-this */ \"./node_modules/core-js-pure/modules/es.global-this.js\");\n\nmodule.exports = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/es/global-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/features/global-this.js":
/*!***********************************************************!*\
!*** ./node_modules/core-js-pure/features/global-this.js ***!
\***********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nmodule.exports = __webpack_require__(/*! ../full/global-this */ \"./node_modules/core-js-pure/full/global-this.js\");\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/features/global-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/full/global-this.js":
/*!*******************************************************!*\
!*** ./node_modules/core-js-pure/full/global-this.js ***!
\*******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\n// TODO: remove from `core-js@4`\n__webpack_require__(/*! ../modules/esnext.global-this */ \"./node_modules/core-js-pure/modules/esnext.global-this.js\");\n\nvar parent = __webpack_require__(/*! ../actual/global-this */ \"./node_modules/core-js-pure/actual/global-this.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/full/global-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/a-callable.js":
/*!***********************************************************!*\
!*** ./node_modules/core-js-pure/internals/a-callable.js ***!
\***********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar tryToString = __webpack_require__(/*! ../internals/try-to-string */ \"./node_modules/core-js-pure/internals/try-to-string.js\");\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw new $TypeError(tryToString(argument) + ' is not a function');\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/a-callable.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/an-object.js":
/*!**********************************************************!*\
!*** ./node_modules/core-js-pure/internals/an-object.js ***!
\**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw new $TypeError($String(argument) + ' is not an object');\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/an-object.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/classof-raw.js":
/*!************************************************************!*\
!*** ./node_modules/core-js-pure/internals/classof-raw.js ***!
\************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/classof-raw.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/create-non-enumerable-property.js":
/*!*******************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/create-non-enumerable-property.js ***!
\*******************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ \"./node_modules/core-js-pure/internals/object-define-property.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js-pure/internals/create-property-descriptor.js\");\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/create-non-enumerable-property.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/create-property-descriptor.js":
/*!***************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/create-property-descriptor.js ***!
\***************************************************************************/
/***/ ((module) => {
"use strict";
eval("\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/create-property-descriptor.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/define-global-property.js":
/*!***********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/define-global-property.js ***!
\***********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/define-global-property.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/descriptors.js":
/*!************************************************************!*\
!*** ./node_modules/core-js-pure/internals/descriptors.js ***!
\************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/descriptors.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/document-create-element.js":
/*!************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/document-create-element.js ***!
\************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/document-create-element.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/engine-user-agent.js":
/*!******************************************************************!*\
!*** ./node_modules/core-js-pure/internals/engine-user-agent.js ***!
\******************************************************************/
/***/ ((module) => {
"use strict";
eval("\nmodule.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/engine-user-agent.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/engine-v8-version.js":
/*!******************************************************************!*\
!*** ./node_modules/core-js-pure/internals/engine-v8-version.js ***!
\******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ \"./node_modules/core-js-pure/internals/engine-user-agent.js\");\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/engine-v8-version.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/export.js":
/*!*******************************************************!*\
!*** ./node_modules/core-js-pure/internals/export.js ***!
\*******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar apply = __webpack_require__(/*! ../internals/function-apply */ \"./node_modules/core-js-pure/internals/function-apply.js\");\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ \"./node_modules/core-js-pure/internals/function-uncurry-this-clause.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar getOwnPropertyDescriptor = (__webpack_require__(/*! ../internals/object-get-own-property-descriptor */ \"./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js\").f);\nvar isForced = __webpack_require__(/*! ../internals/is-forced */ \"./node_modules/core-js-pure/internals/is-forced.js\");\nvar path = __webpack_require__(/*! ../internals/path */ \"./node_modules/core-js-pure/internals/path.js\");\nvar bind = __webpack_require__(/*! ../internals/function-bind-context */ \"./node_modules/core-js-pure/internals/function-bind-context.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js-pure/internals/has-own-property.js\");\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof Wrapper) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return apply(NativeConstructor, this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : global[TARGET] && global[TARGET].prototype;\n\n var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (!FORCED && !PROTO && typeof targetProperty == typeof sourceProperty) continue;\n\n // bind methods to global for calling from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changes in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n createNonEnumerableProperty(target, key, resultProperty);\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);\n // export real prototype methods\n if (options.real && targetPrototype && (FORCED || !targetPrototype[key])) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/export.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/fails.js":
/*!******************************************************!*\
!*** ./node_modules/core-js-pure/internals/fails.js ***!
\******************************************************/
/***/ ((module) => {
"use strict";
eval("\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/fails.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/function-apply.js":
/*!***************************************************************!*\
!*** ./node_modules/core-js-pure/internals/function-apply.js ***!
\***************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-apply.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/function-bind-context.js":
/*!**********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/function-bind-context.js ***!
\**********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ \"./node_modules/core-js-pure/internals/function-uncurry-this-clause.js\");\nvar aCallable = __webpack_require__(/*! ../internals/a-callable */ \"./node_modules/core-js-pure/internals/a-callable.js\");\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-bind-context.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/function-bind-native.js":
/*!*********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/function-bind-native.js ***!
\*********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-bind-native.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/function-call.js":
/*!**************************************************************!*\
!*** ./node_modules/core-js-pure/internals/function-call.js ***!
\**************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-call.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/function-uncurry-this-clause.js":
/*!*****************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/function-uncurry-this-clause.js ***!
\*****************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar classofRaw = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nmodule.exports = function (fn) {\n // Nashorn bug:\n // https://github.com/zloirock/core-js/issues/1128\n // https://github.com/zloirock/core-js/issues/1130\n if (classofRaw(fn) === 'Function') return uncurryThis(fn);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-uncurry-this-clause.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/function-uncurry-this.js":
/*!**********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/function-uncurry-this.js ***!
\**********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-uncurry-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/get-built-in.js":
/*!*************************************************************!*\
!*** ./node_modules/core-js-pure/internals/get-built-in.js ***!
\*************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar path = __webpack_require__(/*! ../internals/path */ \"./node_modules/core-js-pure/internals/path.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\n\nvar aFunction = function (variable) {\n return isCallable(variable) ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/get-built-in.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/get-method.js":
/*!***********************************************************!*\
!*** ./node_modules/core-js-pure/internals/get-method.js ***!
\***********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar aCallable = __webpack_require__(/*! ../internals/a-callable */ \"./node_modules/core-js-pure/internals/a-callable.js\");\nvar isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ \"./node_modules/core-js-pure/internals/is-null-or-undefined.js\");\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/get-method.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/global.js":
/*!*******************************************************!*\
!*** ./node_modules/core-js-pure/internals/global.js ***!
\*******************************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
eval("\nvar check = function (it) {\n return it && it.Math === Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) ||\n check(typeof this == 'object' && this) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/global.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/has-own-property.js":
/*!*****************************************************************!*\
!*** ./node_modules/core-js-pure/internals/has-own-property.js ***!
\*****************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\nvar toObject = __webpack_require__(/*! ../internals/to-object */ \"./node_modules/core-js-pure/internals/to-object.js\");\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/has-own-property.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/ie8-dom-define.js":
/*!***************************************************************!*\
!*** ./node_modules/core-js-pure/internals/ie8-dom-define.js ***!
\***************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar createElement = __webpack_require__(/*! ../internals/document-create-element */ \"./node_modules/core-js-pure/internals/document-create-element.js\");\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a !== 7;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/ie8-dom-define.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/indexed-object.js":
/*!***************************************************************!*\
!*** ./node_modules/core-js-pure/internals/indexed-object.js ***!
\***************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar classof = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) === 'String' ? split(it, '') : $Object(it);\n} : $Object;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/indexed-object.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/is-callable.js":
/*!************************************************************!*\
!*** ./node_modules/core-js-pure/internals/is-callable.js ***!
\************************************************************/
/***/ ((module) => {
"use strict";
eval("\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\nvar documentAll = typeof document == 'object' && document.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nmodule.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-callable.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/is-forced.js":
/*!**********************************************************!*\
!*** ./node_modules/core-js-pure/internals/is-forced.js ***!
\**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value === POLYFILL ? true\n : value === NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-forced.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/is-null-or-undefined.js":
/*!*********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/is-null-or-undefined.js ***!
\*********************************************************************/
/***/ ((module) => {
"use strict";
eval("\n// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-null-or-undefined.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/is-object.js":
/*!**********************************************************!*\
!*** ./node_modules/core-js-pure/internals/is-object.js ***!
\**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-object.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/is-pure.js":
/*!********************************************************!*\
!*** ./node_modules/core-js-pure/internals/is-pure.js ***!
\********************************************************/
/***/ ((module) => {
"use strict";
eval("\nmodule.exports = true;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-pure.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/is-symbol.js":
/*!**********************************************************!*\
!*** ./node_modules/core-js-pure/internals/is-symbol.js ***!
\**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ \"./node_modules/core-js-pure/internals/get-built-in.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar isPrototypeOf = __webpack_require__(/*! ../internals/object-is-prototype-of */ \"./node_modules/core-js-pure/internals/object-is-prototype-of.js\");\nvar USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ \"./node_modules/core-js-pure/internals/use-symbol-as-uid.js\");\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-symbol.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/object-define-property.js":
/*!***********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/object-define-property.js ***!
\***********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ \"./node_modules/core-js-pure/internals/ie8-dom-define.js\");\nvar V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(/*! ../internals/v8-prototype-define-bug */ \"./node_modules/core-js-pure/internals/v8-prototype-define-bug.js\");\nvar anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js-pure/internals/an-object.js\");\nvar toPropertyKey = __webpack_require__(/*! ../internals/to-property-key */ \"./node_modules/core-js-pure/internals/to-property-key.js\");\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-define-property.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js":
/*!***********************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js ***!
\***********************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar call = __webpack_require__(/*! ../internals/function-call */ \"./node_modules/core-js-pure/internals/function-call.js\");\nvar propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ \"./node_modules/core-js-pure/internals/object-property-is-enumerable.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js-pure/internals/create-property-descriptor.js\");\nvar toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ \"./node_modules/core-js-pure/internals/to-indexed-object.js\");\nvar toPropertyKey = __webpack_require__(/*! ../internals/to-property-key */ \"./node_modules/core-js-pure/internals/to-property-key.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js-pure/internals/has-own-property.js\");\nvar IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ \"./node_modules/core-js-pure/internals/ie8-dom-define.js\");\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/object-is-prototype-of.js":
/*!***********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/object-is-prototype-of.js ***!
\***********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-is-prototype-of.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/object-property-is-enumerable.js":
/*!******************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/object-property-is-enumerable.js ***!
\******************************************************************************/
/***/ ((__unused_webpack_module, exports) => {
"use strict";
eval("\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-property-is-enumerable.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/ordinary-to-primitive.js":
/*!**********************************************************************!*\
!*** ./node_modules/core-js-pure/internals/ordinary-to-primitive.js ***!
\**********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar call = __webpack_require__(/*! ../internals/function-call */ \"./node_modules/core-js-pure/internals/function-call.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw new $TypeError(\"Can't convert object to primitive value\");\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/ordinary-to-primitive.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/path.js":
/*!*****************************************************!*\
!*** ./node_modules/core-js-pure/internals/path.js ***!
\*****************************************************/
/***/ ((module) => {
"use strict";
eval("\nmodule.exports = {};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/path.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/require-object-coercible.js":
/*!*************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/require-object-coercible.js ***!
\*************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ \"./node_modules/core-js-pure/internals/is-null-or-undefined.js\");\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw new $TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/require-object-coercible.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/shared-store.js":
/*!*************************************************************!*\
!*** ./node_modules/core-js-pure/internals/shared-store.js ***!
\*************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar defineGlobalProperty = __webpack_require__(/*! ../internals/define-global-property */ \"./node_modules/core-js-pure/internals/define-global-property.js\");\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/shared-store.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/shared.js":
/*!*******************************************************!*\
!*** ./node_modules/core-js-pure/internals/shared.js ***!
\*******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar IS_PURE = __webpack_require__(/*! ../internals/is-pure */ \"./node_modules/core-js-pure/internals/is-pure.js\");\nvar store = __webpack_require__(/*! ../internals/shared-store */ \"./node_modules/core-js-pure/internals/shared-store.js\");\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.35.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/shared.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/symbol-constructor-detection.js":
/*!*****************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/symbol-constructor-detection.js ***!
\*****************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\n/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ \"./node_modules/core-js-pure/internals/engine-v8-version.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\nvar $String = global.String;\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol('symbol detection');\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,\n // of course, fail.\n return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/symbol-constructor-detection.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/to-indexed-object.js":
/*!******************************************************************!*\
!*** ./node_modules/core-js-pure/internals/to-indexed-object.js ***!
\******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\n// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ \"./node_modules/core-js-pure/internals/indexed-object.js\");\nvar requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ \"./node_modules/core-js-pure/internals/require-object-coercible.js\");\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-indexed-object.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/to-object.js":
/*!**********************************************************!*\
!*** ./node_modules/core-js-pure/internals/to-object.js ***!
\**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ \"./node_modules/core-js-pure/internals/require-object-coercible.js\");\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-object.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/to-primitive.js":
/*!*************************************************************!*\
!*** ./node_modules/core-js-pure/internals/to-primitive.js ***!
\*************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar call = __webpack_require__(/*! ../internals/function-call */ \"./node_modules/core-js-pure/internals/function-call.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\nvar isSymbol = __webpack_require__(/*! ../internals/is-symbol */ \"./node_modules/core-js-pure/internals/is-symbol.js\");\nvar getMethod = __webpack_require__(/*! ../internals/get-method */ \"./node_modules/core-js-pure/internals/get-method.js\");\nvar ordinaryToPrimitive = __webpack_require__(/*! ../internals/ordinary-to-primitive */ \"./node_modules/core-js-pure/internals/ordinary-to-primitive.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw new $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-primitive.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/to-property-key.js":
/*!****************************************************************!*\
!*** ./node_modules/core-js-pure/internals/to-property-key.js ***!
\****************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ \"./node_modules/core-js-pure/internals/to-primitive.js\");\nvar isSymbol = __webpack_require__(/*! ../internals/is-symbol */ \"./node_modules/core-js-pure/internals/is-symbol.js\");\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-property-key.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/try-to-string.js":
/*!**************************************************************!*\
!*** ./node_modules/core-js-pure/internals/try-to-string.js ***!
\**************************************************************/
/***/ ((module) => {
"use strict";
eval("\nvar $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/try-to-string.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/uid.js":
/*!****************************************************!*\
!*** ./node_modules/core-js-pure/internals/uid.js ***!
\****************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/uid.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/use-symbol-as-uid.js":
/*!******************************************************************!*\
!*** ./node_modules/core-js-pure/internals/use-symbol-as-uid.js ***!
\******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\n/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = __webpack_require__(/*! ../internals/symbol-constructor-detection */ \"./node_modules/core-js-pure/internals/symbol-constructor-detection.js\");\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/use-symbol-as-uid.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/v8-prototype-define-bug.js":
/*!************************************************************************!*\
!*** ./node_modules/core-js-pure/internals/v8-prototype-define-bug.js ***!
\************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype !== 42;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/v8-prototype-define-bug.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/internals/well-known-symbol.js":
/*!******************************************************************!*\
!*** ./node_modules/core-js-pure/internals/well-known-symbol.js ***!
\******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar shared = __webpack_require__(/*! ../internals/shared */ \"./node_modules/core-js-pure/internals/shared.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js-pure/internals/has-own-property.js\");\nvar uid = __webpack_require__(/*! ../internals/uid */ \"./node_modules/core-js-pure/internals/uid.js\");\nvar NATIVE_SYMBOL = __webpack_require__(/*! ../internals/symbol-constructor-detection */ \"./node_modules/core-js-pure/internals/symbol-constructor-detection.js\");\nvar USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ \"./node_modules/core-js-pure/internals/use-symbol-as-uid.js\");\n\nvar Symbol = global.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/well-known-symbol.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/modules/es.global-this.js":
/*!*************************************************************!*\
!*** ./node_modules/core-js-pure/modules/es.global-this.js ***!
\*************************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js-pure/internals/export.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\n// `globalThis` object\n// https://tc39.es/ecma262/#sec-globalthis\n$({ global: true, forced: global.globalThis !== global }, {\n globalThis: global\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/modules/es.global-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/modules/esnext.global-this.js":
/*!*****************************************************************!*\
!*** ./node_modules/core-js-pure/modules/esnext.global-this.js ***!
\*****************************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\n// TODO: Remove from `core-js@4`\n__webpack_require__(/*! ../modules/es.global-this */ \"./node_modules/core-js-pure/modules/es.global-this.js\");\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/modules/esnext.global-this.js?");
/***/ }),
/***/ "./node_modules/core-js-pure/stable/global-this.js":
/*!*********************************************************!*\
!*** ./node_modules/core-js-pure/stable/global-this.js ***!
\*********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
eval("\nvar parent = __webpack_require__(/*! ../es/global-this */ \"./node_modules/core-js-pure/es/global-this.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/stable/global-this.js?");
/***/ }),
/***/ "react-refresh/runtime":
/*!**************************************!*\
!*** external "ReactRefreshRuntime" ***!
\**************************************/
/***/ ((module) => {
"use strict";
module.exports = window["ReactRefreshRuntime"];
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/global */
/******/ (() => {
/******/ __webpack_require__.g = (function() {
/******/ if (typeof globalThis === 'object') return globalThis;
/******/ try {
/******/ return this || new Function('return this')();
/******/ } catch (e) {
/******/ if (typeof window === 'object') return window;
/******/ }
/******/ })();
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js");
/******/
/******/ })()
; primitives.min.js 0000644 00000003175 15144410747 0010074 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{BlockQuotation:()=>g,Circle:()=>i,Defs:()=>m,G:()=>l,HorizontalRule:()=>b,Line:()=>c,LinearGradient:()=>u,Path:()=>s,Polygon:()=>d,RadialGradient:()=>p,Rect:()=>f,SVG:()=>w,Stop:()=>y,View:()=>v});const r=window.ReactJSXRuntime;function n(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=n(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}const o=function(){for(var e,t,r=0,o="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=n(e))&&(o&&(o+=" "),o+=t);return o},a=window.wp.element,i=e=>(0,a.createElement)("circle",e),l=e=>(0,a.createElement)("g",e),c=e=>(0,a.createElement)("line",e),s=e=>(0,a.createElement)("path",e),d=e=>(0,a.createElement)("polygon",e),f=e=>(0,a.createElement)("rect",e),m=e=>(0,a.createElement)("defs",e),p=e=>(0,a.createElement)("radialGradient",e),u=e=>(0,a.createElement)("linearGradient",e),y=e=>(0,a.createElement)("stop",e),w=(0,a.forwardRef)((({className:e,isPressed:t,...n},a)=>{const i={...n,className:o(e,{"is-pressed":t})||void 0,"aria-hidden":!0,focusable:!1};return(0,r.jsx)("svg",{...i,ref:a})}));w.displayName="SVG";const b="hr",g="blockquote",v="div";(window.wp=window.wp||{}).primitives=t})(); url.js 0000644 00000050407 15144410747 0005721 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 9681:
/***/ ((module) => {
var characterMap = {
"À": "A",
"Á": "A",
"Â": "A",
"Ã": "A",
"Ä": "A",
"Å": "A",
"Ấ": "A",
"Ắ": "A",
"Ẳ": "A",
"Ẵ": "A",
"Ặ": "A",
"Æ": "AE",
"Ầ": "A",
"Ằ": "A",
"Ȃ": "A",
"Ả": "A",
"Ạ": "A",
"Ẩ": "A",
"Ẫ": "A",
"Ậ": "A",
"Ç": "C",
"Ḉ": "C",
"È": "E",
"É": "E",
"Ê": "E",
"Ë": "E",
"Ế": "E",
"Ḗ": "E",
"Ề": "E",
"Ḕ": "E",
"Ḝ": "E",
"Ȇ": "E",
"Ẻ": "E",
"Ẽ": "E",
"Ẹ": "E",
"Ể": "E",
"Ễ": "E",
"Ệ": "E",
"Ì": "I",
"Í": "I",
"Î": "I",
"Ï": "I",
"Ḯ": "I",
"Ȋ": "I",
"Ỉ": "I",
"Ị": "I",
"Ð": "D",
"Ñ": "N",
"Ò": "O",
"Ó": "O",
"Ô": "O",
"Õ": "O",
"Ö": "O",
"Ø": "O",
"Ố": "O",
"Ṍ": "O",
"Ṓ": "O",
"Ȏ": "O",
"Ỏ": "O",
"Ọ": "O",
"Ổ": "O",
"Ỗ": "O",
"Ộ": "O",
"Ờ": "O",
"Ở": "O",
"Ỡ": "O",
"Ớ": "O",
"Ợ": "O",
"Ù": "U",
"Ú": "U",
"Û": "U",
"Ü": "U",
"Ủ": "U",
"Ụ": "U",
"Ử": "U",
"Ữ": "U",
"Ự": "U",
"Ý": "Y",
"à": "a",
"á": "a",
"â": "a",
"ã": "a",
"ä": "a",
"å": "a",
"ấ": "a",
"ắ": "a",
"ẳ": "a",
"ẵ": "a",
"ặ": "a",
"æ": "ae",
"ầ": "a",
"ằ": "a",
"ȃ": "a",
"ả": "a",
"ạ": "a",
"ẩ": "a",
"ẫ": "a",
"ậ": "a",
"ç": "c",
"ḉ": "c",
"è": "e",
"é": "e",
"ê": "e",
"ë": "e",
"ế": "e",
"ḗ": "e",
"ề": "e",
"ḕ": "e",
"ḝ": "e",
"ȇ": "e",
"ẻ": "e",
"ẽ": "e",
"ẹ": "e",
"ể": "e",
"ễ": "e",
"ệ": "e",
"ì": "i",
"í": "i",
"î": "i",
"ï": "i",
"ḯ": "i",
"ȋ": "i",
"ỉ": "i",
"ị": "i",
"ð": "d",
"ñ": "n",
"ò": "o",
"ó": "o",
"ô": "o",
"õ": "o",
"ö": "o",
"ø": "o",
"ố": "o",
"ṍ": "o",
"ṓ": "o",
"ȏ": "o",
"ỏ": "o",
"ọ": "o",
"ổ": "o",
"ỗ": "o",
"ộ": "o",
"ờ": "o",
"ở": "o",
"ỡ": "o",
"ớ": "o",
"ợ": "o",
"ù": "u",
"ú": "u",
"û": "u",
"ü": "u",
"ủ": "u",
"ụ": "u",
"ử": "u",
"ữ": "u",
"ự": "u",
"ý": "y",
"ÿ": "y",
"Ā": "A",
"ā": "a",
"Ă": "A",
"ă": "a",
"Ą": "A",
"ą": "a",
"Ć": "C",
"ć": "c",
"Ĉ": "C",
"ĉ": "c",
"Ċ": "C",
"ċ": "c",
"Č": "C",
"č": "c",
"C̆": "C",
"c̆": "c",
"Ď": "D",
"ď": "d",
"Đ": "D",
"đ": "d",
"Ē": "E",
"ē": "e",
"Ĕ": "E",
"ĕ": "e",
"Ė": "E",
"ė": "e",
"Ę": "E",
"ę": "e",
"Ě": "E",
"ě": "e",
"Ĝ": "G",
"Ǵ": "G",
"ĝ": "g",
"ǵ": "g",
"Ğ": "G",
"ğ": "g",
"Ġ": "G",
"ġ": "g",
"Ģ": "G",
"ģ": "g",
"Ĥ": "H",
"ĥ": "h",
"Ħ": "H",
"ħ": "h",
"Ḫ": "H",
"ḫ": "h",
"Ĩ": "I",
"ĩ": "i",
"Ī": "I",
"ī": "i",
"Ĭ": "I",
"ĭ": "i",
"Į": "I",
"į": "i",
"İ": "I",
"ı": "i",
"IJ": "IJ",
"ij": "ij",
"Ĵ": "J",
"ĵ": "j",
"Ķ": "K",
"ķ": "k",
"Ḱ": "K",
"ḱ": "k",
"K̆": "K",
"k̆": "k",
"Ĺ": "L",
"ĺ": "l",
"Ļ": "L",
"ļ": "l",
"Ľ": "L",
"ľ": "l",
"Ŀ": "L",
"ŀ": "l",
"Ł": "l",
"ł": "l",
"Ḿ": "M",
"ḿ": "m",
"M̆": "M",
"m̆": "m",
"Ń": "N",
"ń": "n",
"Ņ": "N",
"ņ": "n",
"Ň": "N",
"ň": "n",
"ʼn": "n",
"N̆": "N",
"n̆": "n",
"Ō": "O",
"ō": "o",
"Ŏ": "O",
"ŏ": "o",
"Ő": "O",
"ő": "o",
"Œ": "OE",
"œ": "oe",
"P̆": "P",
"p̆": "p",
"Ŕ": "R",
"ŕ": "r",
"Ŗ": "R",
"ŗ": "r",
"Ř": "R",
"ř": "r",
"R̆": "R",
"r̆": "r",
"Ȓ": "R",
"ȓ": "r",
"Ś": "S",
"ś": "s",
"Ŝ": "S",
"ŝ": "s",
"Ş": "S",
"Ș": "S",
"ș": "s",
"ş": "s",
"Š": "S",
"š": "s",
"Ţ": "T",
"ţ": "t",
"ț": "t",
"Ț": "T",
"Ť": "T",
"ť": "t",
"Ŧ": "T",
"ŧ": "t",
"T̆": "T",
"t̆": "t",
"Ũ": "U",
"ũ": "u",
"Ū": "U",
"ū": "u",
"Ŭ": "U",
"ŭ": "u",
"Ů": "U",
"ů": "u",
"Ű": "U",
"ű": "u",
"Ų": "U",
"ų": "u",
"Ȗ": "U",
"ȗ": "u",
"V̆": "V",
"v̆": "v",
"Ŵ": "W",
"ŵ": "w",
"Ẃ": "W",
"ẃ": "w",
"X̆": "X",
"x̆": "x",
"Ŷ": "Y",
"ŷ": "y",
"Ÿ": "Y",
"Y̆": "Y",
"y̆": "y",
"Ź": "Z",
"ź": "z",
"Ż": "Z",
"ż": "z",
"Ž": "Z",
"ž": "z",
"ſ": "s",
"ƒ": "f",
"Ơ": "O",
"ơ": "o",
"Ư": "U",
"ư": "u",
"Ǎ": "A",
"ǎ": "a",
"Ǐ": "I",
"ǐ": "i",
"Ǒ": "O",
"ǒ": "o",
"Ǔ": "U",
"ǔ": "u",
"Ǖ": "U",
"ǖ": "u",
"Ǘ": "U",
"ǘ": "u",
"Ǚ": "U",
"ǚ": "u",
"Ǜ": "U",
"ǜ": "u",
"Ứ": "U",
"ứ": "u",
"Ṹ": "U",
"ṹ": "u",
"Ǻ": "A",
"ǻ": "a",
"Ǽ": "AE",
"ǽ": "ae",
"Ǿ": "O",
"ǿ": "o",
"Þ": "TH",
"þ": "th",
"Ṕ": "P",
"ṕ": "p",
"Ṥ": "S",
"ṥ": "s",
"X́": "X",
"x́": "x",
"Ѓ": "Г",
"ѓ": "г",
"Ќ": "К",
"ќ": "к",
"A̋": "A",
"a̋": "a",
"E̋": "E",
"e̋": "e",
"I̋": "I",
"i̋": "i",
"Ǹ": "N",
"ǹ": "n",
"Ồ": "O",
"ồ": "o",
"Ṑ": "O",
"ṑ": "o",
"Ừ": "U",
"ừ": "u",
"Ẁ": "W",
"ẁ": "w",
"Ỳ": "Y",
"ỳ": "y",
"Ȁ": "A",
"ȁ": "a",
"Ȅ": "E",
"ȅ": "e",
"Ȉ": "I",
"ȉ": "i",
"Ȍ": "O",
"ȍ": "o",
"Ȑ": "R",
"ȑ": "r",
"Ȕ": "U",
"ȕ": "u",
"B̌": "B",
"b̌": "b",
"Č̣": "C",
"č̣": "c",
"Ê̌": "E",
"ê̌": "e",
"F̌": "F",
"f̌": "f",
"Ǧ": "G",
"ǧ": "g",
"Ȟ": "H",
"ȟ": "h",
"J̌": "J",
"ǰ": "j",
"Ǩ": "K",
"ǩ": "k",
"M̌": "M",
"m̌": "m",
"P̌": "P",
"p̌": "p",
"Q̌": "Q",
"q̌": "q",
"Ř̩": "R",
"ř̩": "r",
"Ṧ": "S",
"ṧ": "s",
"V̌": "V",
"v̌": "v",
"W̌": "W",
"w̌": "w",
"X̌": "X",
"x̌": "x",
"Y̌": "Y",
"y̌": "y",
"A̧": "A",
"a̧": "a",
"B̧": "B",
"b̧": "b",
"Ḑ": "D",
"ḑ": "d",
"Ȩ": "E",
"ȩ": "e",
"Ɛ̧": "E",
"ɛ̧": "e",
"Ḩ": "H",
"ḩ": "h",
"I̧": "I",
"i̧": "i",
"Ɨ̧": "I",
"ɨ̧": "i",
"M̧": "M",
"m̧": "m",
"O̧": "O",
"o̧": "o",
"Q̧": "Q",
"q̧": "q",
"U̧": "U",
"u̧": "u",
"X̧": "X",
"x̧": "x",
"Z̧": "Z",
"z̧": "z",
"й":"и",
"Й":"И",
"ё":"е",
"Ё":"Е",
};
var chars = Object.keys(characterMap).join('|');
var allAccents = new RegExp(chars, 'g');
var firstAccent = new RegExp(chars, '');
function matcher(match) {
return characterMap[match];
}
var removeAccents = function(string) {
return string.replace(allAccents, matcher);
};
var hasAccents = function(string) {
return !!string.match(firstAccent);
};
module.exports = removeAccents;
module.exports.has = hasAccents;
module.exports.remove = removeAccents;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* 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))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
addQueryArgs: () => (/* reexport */ addQueryArgs),
buildQueryString: () => (/* reexport */ buildQueryString),
cleanForSlug: () => (/* reexport */ cleanForSlug),
filterURLForDisplay: () => (/* reexport */ filterURLForDisplay),
getAuthority: () => (/* reexport */ getAuthority),
getFilename: () => (/* reexport */ getFilename),
getFragment: () => (/* reexport */ getFragment),
getPath: () => (/* reexport */ getPath),
getPathAndQueryString: () => (/* reexport */ getPathAndQueryString),
getProtocol: () => (/* reexport */ getProtocol),
getQueryArg: () => (/* reexport */ getQueryArg),
getQueryArgs: () => (/* reexport */ getQueryArgs),
getQueryString: () => (/* reexport */ getQueryString),
hasQueryArg: () => (/* reexport */ hasQueryArg),
isEmail: () => (/* reexport */ isEmail),
isPhoneNumber: () => (/* reexport */ isPhoneNumber),
isURL: () => (/* reexport */ isURL),
isValidAuthority: () => (/* reexport */ isValidAuthority),
isValidFragment: () => (/* reexport */ isValidFragment),
isValidPath: () => (/* reexport */ isValidPath),
isValidProtocol: () => (/* reexport */ isValidProtocol),
isValidQueryString: () => (/* reexport */ isValidQueryString),
normalizePath: () => (/* reexport */ normalizePath),
prependHTTP: () => (/* reexport */ prependHTTP),
prependHTTPS: () => (/* reexport */ prependHTTPS),
removeQueryArgs: () => (/* reexport */ removeQueryArgs),
safeDecodeURI: () => (/* reexport */ safeDecodeURI),
safeDecodeURIComponent: () => (/* reexport */ safeDecodeURIComponent)
});
;// ./node_modules/@wordpress/url/build-module/is-url.js
function isURL(url) {
try {
new URL(url);
return true;
} catch {
return false;
}
}
;// ./node_modules/@wordpress/url/build-module/is-email.js
const EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;
function isEmail(email) {
return EMAIL_REGEXP.test(email);
}
;// ./node_modules/@wordpress/url/build-module/is-phone-number.js
const PHONE_REGEXP = /^(tel:)?(\+)?\d{6,15}$/;
function isPhoneNumber(phoneNumber) {
phoneNumber = phoneNumber.replace(/[-.() ]/g, "");
return PHONE_REGEXP.test(phoneNumber);
}
;// ./node_modules/@wordpress/url/build-module/get-protocol.js
function getProtocol(url) {
const matches = /^([^\s:]+:)/.exec(url);
if (matches) {
return matches[1];
}
}
;// ./node_modules/@wordpress/url/build-module/is-valid-protocol.js
function isValidProtocol(protocol) {
if (!protocol) {
return false;
}
return /^[a-z\-.\+]+[0-9]*:$/i.test(protocol);
}
;// ./node_modules/@wordpress/url/build-module/get-authority.js
function getAuthority(url) {
const matches = /^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(
url
);
if (matches) {
return matches[1];
}
}
;// ./node_modules/@wordpress/url/build-module/is-valid-authority.js
function isValidAuthority(authority) {
if (!authority) {
return false;
}
return /^[^\s#?]+$/.test(authority);
}
;// ./node_modules/@wordpress/url/build-module/get-path.js
function getPath(url) {
const matches = /^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(url);
if (matches) {
return matches[1];
}
}
;// ./node_modules/@wordpress/url/build-module/is-valid-path.js
function isValidPath(path) {
if (!path) {
return false;
}
return /^[^\s#?]+$/.test(path);
}
;// ./node_modules/@wordpress/url/build-module/get-query-string.js
function getQueryString(url) {
let query;
try {
query = new URL(url, "http://example.com").search.substring(1);
} catch (error) {
}
if (query) {
return query;
}
}
;// ./node_modules/@wordpress/url/build-module/build-query-string.js
function buildQueryString(data) {
let string = "";
const stack = Object.entries(data);
let pair;
while (pair = stack.shift()) {
let [key, value] = pair;
const hasNestedData = Array.isArray(value) || value && value.constructor === Object;
if (hasNestedData) {
const valuePairs = Object.entries(value).reverse();
for (const [member, memberValue] of valuePairs) {
stack.unshift([`${key}[${member}]`, memberValue]);
}
} else if (value !== void 0) {
if (value === null) {
value = "";
}
string += "&" + [key, String(value)].map(encodeURIComponent).join("=");
}
}
return string.substr(1);
}
;// ./node_modules/@wordpress/url/build-module/is-valid-query-string.js
function isValidQueryString(queryString) {
if (!queryString) {
return false;
}
return /^[^\s#?\/]+$/.test(queryString);
}
;// ./node_modules/@wordpress/url/build-module/get-path-and-query-string.js
function getPathAndQueryString(url) {
const path = getPath(url);
const queryString = getQueryString(url);
let value = "/";
if (path) {
value += path;
}
if (queryString) {
value += `?${queryString}`;
}
return value;
}
;// ./node_modules/@wordpress/url/build-module/get-fragment.js
function getFragment(url) {
const matches = /^\S+?(#[^\s\?]*)/.exec(url);
if (matches) {
return matches[1];
}
}
;// ./node_modules/@wordpress/url/build-module/is-valid-fragment.js
function isValidFragment(fragment) {
if (!fragment) {
return false;
}
return /^#[^\s#?\/]*$/.test(fragment);
}
;// ./node_modules/@wordpress/url/build-module/safe-decode-uri-component.js
function safeDecodeURIComponent(uriComponent) {
try {
return decodeURIComponent(uriComponent);
} catch (uriComponentError) {
return uriComponent;
}
}
;// ./node_modules/@wordpress/url/build-module/get-query-args.js
function setPath(object, path, value) {
const length = path.length;
const lastIndex = length - 1;
for (let i = 0; i < length; i++) {
let key = path[i];
if (!key && Array.isArray(object)) {
key = object.length.toString();
}
key = ["__proto__", "constructor", "prototype"].includes(key) ? key.toUpperCase() : key;
const isNextKeyArrayIndex = !isNaN(Number(path[i + 1]));
object[key] = i === lastIndex ? (
// If at end of path, assign the intended value.
value
) : (
// Otherwise, advance to the next object in the path, creating
// it if it does not yet exist.
object[key] || (isNextKeyArrayIndex ? [] : {})
);
if (Array.isArray(object[key]) && !isNextKeyArrayIndex) {
object[key] = { ...object[key] };
}
object = object[key];
}
}
function getQueryArgs(url) {
return (getQueryString(url) || "").replace(/\+/g, "%20").split("&").reduce((accumulator, keyValue) => {
const [key, value = ""] = keyValue.split("=").filter(Boolean).map(safeDecodeURIComponent);
if (key) {
const segments = key.replace(/\]/g, "").split("[");
setPath(accumulator, segments, value);
}
return accumulator;
}, /* @__PURE__ */ Object.create(null));
}
;// ./node_modules/@wordpress/url/build-module/add-query-args.js
function addQueryArgs(url = "", args) {
if (!args || !Object.keys(args).length) {
return url;
}
const fragment = getFragment(url) || "";
let baseUrl = url.replace(fragment, "");
const queryStringIndex = url.indexOf("?");
if (queryStringIndex !== -1) {
args = Object.assign(getQueryArgs(url), args);
baseUrl = baseUrl.substr(0, queryStringIndex);
}
return baseUrl + "?" + buildQueryString(args) + fragment;
}
;// ./node_modules/@wordpress/url/build-module/get-query-arg.js
function getQueryArg(url, arg) {
return getQueryArgs(url)[arg];
}
;// ./node_modules/@wordpress/url/build-module/has-query-arg.js
function hasQueryArg(url, arg) {
return getQueryArg(url, arg) !== void 0;
}
;// ./node_modules/@wordpress/url/build-module/remove-query-args.js
function removeQueryArgs(url, ...args) {
const fragment = url.replace(/^[^#]*/, "");
url = url.replace(/#.*/, "");
const queryStringIndex = url.indexOf("?");
if (queryStringIndex === -1) {
return url + fragment;
}
const query = getQueryArgs(url);
const baseURL = url.substr(0, queryStringIndex);
args.forEach((arg) => delete query[arg]);
const queryString = buildQueryString(query);
const updatedUrl = queryString ? baseURL + "?" + queryString : baseURL;
return updatedUrl + fragment;
}
;// ./node_modules/@wordpress/url/build-module/prepend-http.js
const USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i;
function prependHTTP(url) {
if (!url) {
return url;
}
url = url.trim();
if (!USABLE_HREF_REGEXP.test(url) && !isEmail(url)) {
return "http://" + url;
}
return url;
}
;// ./node_modules/@wordpress/url/build-module/safe-decode-uri.js
function safeDecodeURI(uri) {
try {
return decodeURI(uri);
} catch (uriError) {
return uri;
}
}
;// ./node_modules/@wordpress/url/build-module/filter-url-for-display.js
function filterURLForDisplay(url, maxLength = null) {
if (!url) {
return "";
}
let filteredURL = url.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i, "").replace(/^www\./i, "");
if (filteredURL.match(/^[^\/]+\/$/)) {
filteredURL = filteredURL.replace("/", "");
}
const fileRegexp = /\/([^\/?]+)\.(?:[\w]+)(?=\?|$)/;
if (!maxLength || filteredURL.length <= maxLength || !filteredURL.match(fileRegexp)) {
return filteredURL;
}
filteredURL = filteredURL.split("?")[0];
const urlPieces = filteredURL.split("/");
const file = urlPieces[urlPieces.length - 1];
if (file.length <= maxLength) {
return "\u2026" + filteredURL.slice(-maxLength);
}
const index = file.lastIndexOf(".");
const [fileName, extension] = [
file.slice(0, index),
file.slice(index + 1)
];
const truncatedFile = fileName.slice(-3) + "." + extension;
return file.slice(0, maxLength - truncatedFile.length - 1) + "\u2026" + truncatedFile;
}
// EXTERNAL MODULE: ./node_modules/remove-accents/index.js
var remove_accents = __webpack_require__(9681);
var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
;// ./node_modules/@wordpress/url/build-module/clean-for-slug.js
function cleanForSlug(string) {
if (!string) {
return "";
}
return remove_accents_default()(string).replace(/( |–|—)/g, "-").replace(/[\s\./]+/g, "-").replace(/&\S+?;/g, "").replace(/[^\p{L}\p{N}_-]+/gu, "").toLowerCase().replace(/-+/g, "-").replace(/(^-+)|(-+$)/g, "");
}
;// ./node_modules/@wordpress/url/build-module/get-filename.js
function getFilename(url) {
let filename;
if (!url) {
return;
}
try {
filename = new URL(url, "http://example.com").pathname.split("/").pop();
} catch (error) {
}
if (filename) {
return filename;
}
}
;// ./node_modules/@wordpress/url/build-module/normalize-path.js
function normalizePath(path) {
const split = path.split("?");
const query = split[1];
const base = split[0];
if (!query) {
return base;
}
return base + "?" + query.split("&").map((entry) => entry.split("=")).map((pair) => pair.map(decodeURIComponent)).sort((a, b) => a[0].localeCompare(b[0])).map((pair) => pair.map(encodeURIComponent)).map((pair) => pair.join("=")).join("&");
}
;// ./node_modules/@wordpress/url/build-module/prepend-https.js
function prependHTTPS(url) {
if (!url) {
return url;
}
if (url.startsWith("http://")) {
return url;
}
url = prependHTTP(url);
return url.replace(/^http:/, "https:");
}
;// ./node_modules/@wordpress/url/build-module/index.js
})();
(window.wp = window.wp || {}).url = __webpack_exports__;
/******/ })()
; keycodes.js 0000644 00000017621 15144410747 0006726 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // 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))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
ALT: () => (/* binding */ ALT),
BACKSPACE: () => (/* binding */ BACKSPACE),
COMMAND: () => (/* binding */ COMMAND),
CTRL: () => (/* binding */ CTRL),
DELETE: () => (/* binding */ DELETE),
DOWN: () => (/* binding */ DOWN),
END: () => (/* binding */ END),
ENTER: () => (/* binding */ ENTER),
ESCAPE: () => (/* binding */ ESCAPE),
F10: () => (/* binding */ F10),
HOME: () => (/* binding */ HOME),
LEFT: () => (/* binding */ LEFT),
PAGEDOWN: () => (/* binding */ PAGEDOWN),
PAGEUP: () => (/* binding */ PAGEUP),
RIGHT: () => (/* binding */ RIGHT),
SHIFT: () => (/* binding */ SHIFT),
SPACE: () => (/* binding */ SPACE),
TAB: () => (/* binding */ TAB),
UP: () => (/* binding */ UP),
ZERO: () => (/* binding */ ZERO),
displayShortcut: () => (/* binding */ displayShortcut),
displayShortcutList: () => (/* binding */ displayShortcutList),
isAppleOS: () => (/* reexport */ isAppleOS),
isKeyboardEvent: () => (/* binding */ isKeyboardEvent),
modifiers: () => (/* binding */ modifiers),
rawShortcut: () => (/* binding */ rawShortcut),
shortcutAriaLabel: () => (/* binding */ shortcutAriaLabel)
});
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// ./node_modules/@wordpress/keycodes/build-module/platform.js
function isAppleOS(_window) {
if (!_window) {
if (typeof window === "undefined") {
return false;
}
_window = window;
}
const { platform } = _window.navigator;
return platform.indexOf("Mac") !== -1 || ["iPad", "iPhone"].includes(platform);
}
;// ./node_modules/@wordpress/keycodes/build-module/index.js
const BACKSPACE = 8;
const TAB = 9;
const ENTER = 13;
const ESCAPE = 27;
const SPACE = 32;
const PAGEUP = 33;
const PAGEDOWN = 34;
const END = 35;
const HOME = 36;
const LEFT = 37;
const UP = 38;
const RIGHT = 39;
const DOWN = 40;
const DELETE = 46;
const F10 = 121;
const ALT = "alt";
const CTRL = "ctrl";
const COMMAND = "meta";
const SHIFT = "shift";
const ZERO = 48;
function capitaliseFirstCharacter(string) {
return string.length < 2 ? string.toUpperCase() : string.charAt(0).toUpperCase() + string.slice(1);
}
function mapValues(object, mapFn) {
return Object.fromEntries(
Object.entries(object).map(([key, value]) => [
key,
mapFn(value)
])
);
}
const modifiers = {
primary: (_isApple) => _isApple() ? [COMMAND] : [CTRL],
primaryShift: (_isApple) => _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT],
primaryAlt: (_isApple) => _isApple() ? [ALT, COMMAND] : [CTRL, ALT],
secondary: (_isApple) => _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT],
access: (_isApple) => _isApple() ? [CTRL, ALT] : [SHIFT, ALT],
ctrl: () => [CTRL],
alt: () => [ALT],
ctrlShift: () => [CTRL, SHIFT],
shift: () => [SHIFT],
shiftAlt: () => [SHIFT, ALT],
undefined: () => []
};
const rawShortcut = /* @__PURE__ */ mapValues(modifiers, (modifier) => {
return (character, _isApple = isAppleOS) => {
return [...modifier(_isApple), character.toLowerCase()].join(
"+"
);
};
});
const displayShortcutList = /* @__PURE__ */ mapValues(
modifiers,
(modifier) => {
return (character, _isApple = isAppleOS) => {
const isApple = _isApple();
const replacementKeyMap = {
[ALT]: isApple ? "\u2325" : "Alt",
[CTRL]: isApple ? "\u2303" : "Ctrl",
// Make sure ⌃ is the U+2303 UP ARROWHEAD unicode character and not the caret character.
[COMMAND]: "\u2318",
[SHIFT]: isApple ? "\u21E7" : "Shift"
};
const modifierKeys = modifier(_isApple).reduce(
(accumulator, key) => {
const replacementKey = replacementKeyMap[key] ?? key;
if (isApple) {
return [...accumulator, replacementKey];
}
return [...accumulator, replacementKey, "+"];
},
[]
);
return [
...modifierKeys,
capitaliseFirstCharacter(character)
];
};
}
);
const displayShortcut = /* @__PURE__ */ mapValues(
displayShortcutList,
(shortcutList) => {
return (character, _isApple = isAppleOS) => shortcutList(character, _isApple).join("");
}
);
const shortcutAriaLabel = /* @__PURE__ */ mapValues(modifiers, (modifier) => {
return (character, _isApple = isAppleOS) => {
const isApple = _isApple();
const replacementKeyMap = {
[SHIFT]: "Shift",
[COMMAND]: isApple ? "Command" : "Control",
[CTRL]: "Control",
[ALT]: isApple ? "Option" : "Alt",
/* translators: comma as in the character ',' */
",": (0,external_wp_i18n_namespaceObject.__)("Comma"),
/* translators: period as in the character '.' */
".": (0,external_wp_i18n_namespaceObject.__)("Period"),
/* translators: backtick as in the character '`' */
"`": (0,external_wp_i18n_namespaceObject.__)("Backtick"),
/* translators: tilde as in the character '~' */
"~": (0,external_wp_i18n_namespaceObject.__)("Tilde")
};
return [...modifier(_isApple), character].map(
(key) => capitaliseFirstCharacter(replacementKeyMap[key] ?? key)
).join(isApple ? " " : " + ");
};
});
function getEventModifiers(event) {
return [ALT, CTRL, COMMAND, SHIFT].filter(
(key) => event[`${key}Key`]
);
}
const isKeyboardEvent = /* @__PURE__ */ mapValues(modifiers, (getModifiers) => {
return (event, character, _isApple = isAppleOS) => {
const mods = getModifiers(_isApple);
const eventMods = getEventModifiers(event);
const replacementWithShiftKeyMap = {
Comma: ",",
Backslash: "\\",
// Windows returns `\` for both IntlRo and IntlYen.
IntlRo: "\\",
IntlYen: "\\"
};
const modsDiff = mods.filter(
(mod) => !eventMods.includes(mod)
);
const eventModsDiff = eventMods.filter(
(mod) => !mods.includes(mod)
);
if (modsDiff.length > 0 || eventModsDiff.length > 0) {
return false;
}
let key = event.key.toLowerCase();
if (!character) {
return mods.includes(key);
}
if (event.altKey && character.length === 1) {
key = String.fromCharCode(event.keyCode).toLowerCase();
}
if (event.shiftKey && character.length === 1 && replacementWithShiftKeyMap[event.code]) {
key = replacementWithShiftKeyMap[event.code];
}
if (character === "del") {
character = "delete";
}
return key === character.toLowerCase();
};
});
(window.wp = window.wp || {}).keycodes = __webpack_exports__;
/******/ })()
; viewport.js 0000644 00000014447 15144410747 0007002 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // 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))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
ifViewportMatches: () => (/* reexport */ if_viewport_matches_default),
store: () => (/* reexport */ store),
withViewportMatch: () => (/* reexport */ with_viewport_match_default)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/viewport/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
setIsMatching: () => (setIsMatching)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/viewport/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
isViewportMatch: () => (isViewportMatch)
});
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// ./node_modules/@wordpress/viewport/build-module/store/reducer.js
function reducer(state = {}, action) {
switch (action.type) {
case "SET_IS_MATCHING":
return action.values;
}
return state;
}
var reducer_default = reducer;
;// ./node_modules/@wordpress/viewport/build-module/store/actions.js
function setIsMatching(values) {
return {
type: "SET_IS_MATCHING",
values
};
}
;// ./node_modules/@wordpress/viewport/build-module/store/selectors.js
function isViewportMatch(state, query) {
if (query.indexOf(" ") === -1) {
query = ">= " + query;
}
return !!state[query];
}
;// ./node_modules/@wordpress/viewport/build-module/store/index.js
const STORE_NAME = "core/viewport";
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
reducer: reducer_default,
actions: actions_namespaceObject,
selectors: selectors_namespaceObject
});
(0,external_wp_data_namespaceObject.register)(store);
;// ./node_modules/@wordpress/viewport/build-module/listener.js
const addDimensionsEventListener = (breakpoints, operators) => {
const setIsMatching = (0,external_wp_compose_namespaceObject.debounce)(
() => {
const values = Object.fromEntries(
queries.map(([key, query]) => [key, query.matches])
);
(0,external_wp_data_namespaceObject.dispatch)(store).setIsMatching(values);
},
0,
{ leading: true }
);
const operatorEntries = Object.entries(operators);
const queries = Object.entries(breakpoints).flatMap(
([name, width]) => {
return operatorEntries.map(([operator, condition]) => {
const list = window.matchMedia(
`(${condition}: ${width}px)`
);
list.addEventListener("change", setIsMatching);
return [`${operator} ${name}`, list];
});
}
);
window.addEventListener("orientationchange", setIsMatching);
setIsMatching();
setIsMatching.flush();
};
var listener_default = addDimensionsEventListener;
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// ./node_modules/@wordpress/viewport/build-module/with-viewport-match.js
const withViewportMatch = (queries) => {
const queryEntries = Object.entries(queries);
const useViewPortQueriesResult = () => Object.fromEntries(
queryEntries.map(([key, query]) => {
let [operator, breakpointName] = query.split(" ");
if (breakpointName === void 0) {
breakpointName = operator;
operator = ">=";
}
return [key, (0,external_wp_compose_namespaceObject.useViewportMatch)(breakpointName, operator)];
})
);
return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((WrappedComponent) => {
return (0,external_wp_compose_namespaceObject.pure)((props) => {
const queriesResult = useViewPortQueriesResult();
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...props, ...queriesResult });
});
}, "withViewportMatch");
};
var with_viewport_match_default = withViewportMatch;
;// ./node_modules/@wordpress/viewport/build-module/if-viewport-matches.js
const ifViewportMatches = (query) => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(
(0,external_wp_compose_namespaceObject.compose)([
with_viewport_match_default({
isViewportMatch: query
}),
(0,external_wp_compose_namespaceObject.ifCondition)((props) => props.isViewportMatch)
]),
"ifViewportMatches"
);
var if_viewport_matches_default = ifViewportMatches;
;// ./node_modules/@wordpress/viewport/build-module/index.js
const BREAKPOINTS = {
huge: 1440,
wide: 1280,
large: 960,
medium: 782,
small: 600,
mobile: 480
};
const OPERATORS = {
"<": "max-width",
">=": "min-width"
};
listener_default(BREAKPOINTS, OPERATORS);
(window.wp = window.wp || {}).viewport = __webpack_exports__;
/******/ })()
; blob.js 0000644 00000006131 15144410747 0006030 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // 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))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createBlobURL: () => (/* binding */ createBlobURL),
/* harmony export */ downloadBlob: () => (/* binding */ downloadBlob),
/* harmony export */ getBlobByURL: () => (/* binding */ getBlobByURL),
/* harmony export */ getBlobTypeByURL: () => (/* binding */ getBlobTypeByURL),
/* harmony export */ isBlobURL: () => (/* binding */ isBlobURL),
/* harmony export */ revokeBlobURL: () => (/* binding */ revokeBlobURL)
/* harmony export */ });
const cache = {};
function createBlobURL(file) {
const url = window.URL.createObjectURL(file);
cache[url] = file;
return url;
}
function getBlobByURL(url) {
return cache[url];
}
function getBlobTypeByURL(url) {
return getBlobByURL(url)?.type.split("/")[0];
}
function revokeBlobURL(url) {
if (cache[url]) {
window.URL.revokeObjectURL(url);
}
delete cache[url];
}
function isBlobURL(url) {
if (!url || !url.indexOf) {
return false;
}
return url.indexOf("blob:") === 0;
}
function downloadBlob(filename, content, contentType = "") {
if (!filename || !content) {
return;
}
const file = new window.Blob([content], { type: contentType });
const url = window.URL.createObjectURL(file);
const anchorElement = document.createElement("a");
anchorElement.href = url;
anchorElement.download = filename;
anchorElement.style.display = "none";
document.body.appendChild(anchorElement);
anchorElement.click();
document.body.removeChild(anchorElement);
window.URL.revokeObjectURL(url);
}
(window.wp = window.wp || {}).blob = __webpack_exports__;
/******/ })()
; latex-to-mathml.js 0000644 00001571362 15144410747 0010145 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // 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))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": () => (/* binding */ latexToMathML)
});
;// ./node_modules/temml/dist/temml.mjs
/**
* This is the ParseError class, which is the main error thrown by Temml
* functions when something has gone wrong. This is used to distinguish internal
* errors from errors in the expression that the user provided.
*
* If possible, a caller should provide a Token or ParseNode with information
* about where in the source string the problem occurred.
*/
class ParseError {
constructor(
message, // The error message
token // An object providing position information
) {
let error = " " + message;
let start;
const loc = token && token.loc;
if (loc && loc.start <= loc.end) {
// If we have the input and a position, make the error a bit fancier
// Get the input
const input = loc.lexer.input;
// Prepend some information
start = loc.start;
const end = loc.end;
if (start === input.length) {
error += " at end of input: ";
} else {
error += " at position " + (start + 1) + ": ";
}
// Underline token in question using combining underscores
const underlined = input.slice(start, end).replace(/[^]/g, "$&\u0332");
// Extract some context from the input and add it to the error
let left;
if (start > 15) {
left = "…" + input.slice(start - 15, start);
} else {
left = input.slice(0, start);
}
let right;
if (end + 15 < input.length) {
right = input.slice(end, end + 15) + "…";
} else {
right = input.slice(end);
}
error += left + underlined + right;
}
// Some hackery to make ParseError a prototype of Error
// See http://stackoverflow.com/a/8460753
const self = new Error(error);
self.name = "ParseError";
self.__proto__ = ParseError.prototype;
self.position = start;
return self;
}
}
ParseError.prototype.__proto__ = Error.prototype;
//
/**
* This file contains a list of utility functions which are useful in other
* files.
*/
/**
* Provide a default value if a setting is undefined
*/
const deflt = function(setting, defaultIfUndefined) {
return setting === undefined ? defaultIfUndefined : setting;
};
// hyphenate and escape adapted from Facebook's React under Apache 2 license
const uppercase = /([A-Z])/g;
const hyphenate = function(str) {
return str.replace(uppercase, "-$1").toLowerCase();
};
const ESCAPE_LOOKUP = {
"&": "&",
">": ">",
"<": "<",
'"': """,
"'": "'"
};
const ESCAPE_REGEX = /[&><"']/g;
/**
* Escapes text to prevent scripting attacks.
*/
function temml_escape(text) {
return String(text).replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]);
}
/**
* Sometimes we want to pull out the innermost element of a group. In most
* cases, this will just be the group itself, but when ordgroups and colors have
* a single element, we want to pull that out.
*/
const getBaseElem = function(group) {
if (group.type === "ordgroup") {
if (group.body.length === 1) {
return getBaseElem(group.body[0]);
} else {
return group;
}
} else if (group.type === "color") {
if (group.body.length === 1) {
return getBaseElem(group.body[0]);
} else {
return group;
}
} else if (group.type === "font") {
return getBaseElem(group.body);
} else {
return group;
}
};
/**
* TeXbook algorithms often reference "character boxes", which are simply groups
* with a single character in them. To decide if something is a character box,
* we find its innermost group, and see if it is a single character.
*/
const isCharacterBox = function(group) {
const baseElem = getBaseElem(group);
// These are all the types of groups which hold single characters
return baseElem.type === "mathord" || baseElem.type === "textord" || baseElem.type === "atom"
};
const assert = function(value) {
if (!value) {
throw new Error("Expected non-null, but got " + String(value));
}
return value;
};
/**
* Return the protocol of a URL, or "_relative" if the URL does not specify a
* protocol (and thus is relative), or `null` if URL has invalid protocol
* (so should be outright rejected).
*/
const protocolFromUrl = function(url) {
// Check for possible leading protocol.
// https://url.spec.whatwg.org/#url-parsing strips leading whitespace
// (\x00) or C0 control (\x00-\x1F) characters.
// eslint-disable-next-line no-control-regex
const protocol = /^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(url);
if (!protocol) {
return "_relative";
}
// Reject weird colons
if (protocol[2] !== ":") {
return null;
}
// Reject invalid characters in scheme according to
// https://datatracker.ietf.org/doc/html/rfc3986#section-3.1
if (!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(protocol[1])) {
return null;
}
// Lowercase the protocol
return protocol[1].toLowerCase();
};
/**
* Round `n` to 4 decimal places, or to the nearest 1/10,000th em. The TeXbook
* gives an acceptable rounding error of 100sp (which would be the nearest
* 1/6551.6em with our ptPerEm = 10):
* http://www.ctex.org/documents/shredder/src/texbook.pdf#page=69
*/
const round = function(n) {
return +n.toFixed(4);
};
var utils = {
deflt,
escape: temml_escape,
hyphenate,
getBaseElem,
isCharacterBox,
protocolFromUrl,
round
};
/**
* This is a module for storing settings passed into Temml. It correctly handles
* default settings.
*/
/**
* The main Settings object
*/
class Settings {
constructor(options) {
// allow null options
options = options || {};
this.displayMode = utils.deflt(options.displayMode, false); // boolean
this.annotate = utils.deflt(options.annotate, false); // boolean
this.leqno = utils.deflt(options.leqno, false); // boolean
this.throwOnError = utils.deflt(options.throwOnError, false); // boolean
this.errorColor = utils.deflt(options.errorColor, "#b22222"); // string
this.macros = options.macros || {};
this.wrap = utils.deflt(options.wrap, "tex"); // "tex" | "="
this.xml = utils.deflt(options.xml, false); // boolean
this.colorIsTextColor = utils.deflt(options.colorIsTextColor, false); // booelean
this.strict = utils.deflt(options.strict, false); // boolean
this.trust = utils.deflt(options.trust, false); // trust context. See html.js.
this.maxSize = (options.maxSize === undefined
? [Infinity, Infinity]
: Array.isArray(options.maxSize)
? options.maxSize
: [Infinity, Infinity]
);
this.maxExpand = Math.max(0, utils.deflt(options.maxExpand, 1000)); // number
}
/**
* Check whether to test potentially dangerous input, and return
* `true` (trusted) or `false` (untrusted). The sole argument `context`
* should be an object with `command` field specifying the relevant LaTeX
* command (as a string starting with `\`), and any other arguments, etc.
* If `context` has a `url` field, a `protocol` field will automatically
* get added by this function (changing the specified object).
*/
isTrusted(context) {
if (context.url && !context.protocol) {
const protocol = utils.protocolFromUrl(context.url);
if (protocol == null) {
return false
}
context.protocol = protocol;
}
const trust = typeof this.trust === "function" ? this.trust(context) : this.trust;
return Boolean(trust);
}
}
/**
* All registered functions.
* `functions.js` just exports this same dictionary again and makes it public.
* `Parser.js` requires this dictionary.
*/
const _functions = {};
/**
* All MathML builders. Should be only used in the `define*` and the `build*ML`
* functions.
*/
const _mathmlGroupBuilders = {};
function defineFunction({
type,
names,
props,
handler,
mathmlBuilder
}) {
// Set default values of functions
const data = {
type,
numArgs: props.numArgs,
argTypes: props.argTypes,
allowedInArgument: !!props.allowedInArgument,
allowedInText: !!props.allowedInText,
allowedInMath: props.allowedInMath === undefined ? true : props.allowedInMath,
numOptionalArgs: props.numOptionalArgs || 0,
infix: !!props.infix,
primitive: !!props.primitive,
handler: handler
};
for (let i = 0; i < names.length; ++i) {
_functions[names[i]] = data;
}
if (type) {
if (mathmlBuilder) {
_mathmlGroupBuilders[type] = mathmlBuilder;
}
}
}
/**
* Use this to register only the MathML builder for a function(e.g.
* if the function's ParseNode is generated in Parser.js rather than via a
* stand-alone handler provided to `defineFunction`).
*/
function defineFunctionBuilders({ type, mathmlBuilder }) {
defineFunction({
type,
names: [],
props: { numArgs: 0 },
handler() {
throw new Error("Should never be called.")
},
mathmlBuilder
});
}
const normalizeArgument = function(arg) {
return arg.type === "ordgroup" && arg.body.length === 1 ? arg.body[0] : arg
};
// Since the corresponding buildMathML function expects a
// list of elements, we normalize for different kinds of arguments
const ordargument = function(arg) {
return arg.type === "ordgroup" ? arg.body : [arg]
};
/**
* This node represents a document fragment, which contains elements, but when
* placed into the DOM doesn't have any representation itself. It only contains
* children and doesn't have any DOM node properties.
*/
class DocumentFragment {
constructor(children) {
this.children = children;
this.classes = [];
this.style = {};
}
hasClass(className) {
return this.classes.includes(className);
}
/** Convert the fragment into a node. */
toNode() {
const frag = document.createDocumentFragment();
for (let i = 0; i < this.children.length; i++) {
frag.appendChild(this.children[i].toNode());
}
return frag;
}
/** Convert the fragment into HTML markup. */
toMarkup() {
let markup = "";
// Simply concatenate the markup for the children together.
for (let i = 0; i < this.children.length; i++) {
markup += this.children[i].toMarkup();
}
return markup;
}
/**
* Converts the math node into a string, similar to innerText. Applies to
* MathDomNode's only.
*/
toText() {
// To avoid this, we would subclass documentFragment separately for
// MathML, but polyfills for subclassing is expensive per PR 1469.
const toText = (child) => child.toText();
return this.children.map(toText).join("");
}
}
/**
* These objects store the data about the DOM nodes we create, as well as some
* extra data. They can then be transformed into real DOM nodes with the
* `toNode` function or HTML markup using `toMarkup`. They are useful for both
* storing extra properties on the nodes, as well as providing a way to easily
* work with the DOM.
*
* Similar functions for working with MathML nodes exist in mathMLTree.js.
*
*/
/**
* Create an HTML className based on a list of classes. In addition to joining
* with spaces, we also remove empty classes.
*/
const createClass = function(classes) {
return classes.filter((cls) => cls).join(" ");
};
const initNode = function(classes, style) {
this.classes = classes || [];
this.attributes = {};
this.style = style || {};
};
/**
* Convert into an HTML node
*/
const toNode = function(tagName) {
const node = document.createElement(tagName);
// Apply the class
node.className = createClass(this.classes);
// Apply inline styles
for (const style in this.style) {
if (Object.prototype.hasOwnProperty.call(this.style, style )) {
node.style[style] = this.style[style];
}
}
// Apply attributes
for (const attr in this.attributes) {
if (Object.prototype.hasOwnProperty.call(this.attributes, attr )) {
node.setAttribute(attr, this.attributes[attr]);
}
}
// Append the children, also as HTML nodes
for (let i = 0; i < this.children.length; i++) {
node.appendChild(this.children[i].toNode());
}
return node;
};
/**
* Convert into an HTML markup string
*/
const toMarkup = function(tagName) {
let markup = `<${tagName}`;
// Add the class
if (this.classes.length) {
markup += ` class="${utils.escape(createClass(this.classes))}"`;
}
let styles = "";
// Add the styles, after hyphenation
for (const style in this.style) {
if (Object.prototype.hasOwnProperty.call(this.style, style )) {
styles += `${utils.hyphenate(style)}:${this.style[style]};`;
}
}
if (styles) {
markup += ` style="${styles}"`;
}
// Add the attributes
for (const attr in this.attributes) {
if (Object.prototype.hasOwnProperty.call(this.attributes, attr )) {
markup += ` ${attr}="${utils.escape(this.attributes[attr])}"`;
}
}
markup += ">";
// Add the markup of the children, also as markup
for (let i = 0; i < this.children.length; i++) {
markup += this.children[i].toMarkup();
}
markup += `</${tagName}>`;
return markup;
};
/**
* This node represents a span node, with a className, a list of children, and
* an inline style.
*
*/
class Span {
constructor(classes, children, style) {
initNode.call(this, classes, style);
this.children = children || [];
}
setAttribute(attribute, value) {
this.attributes[attribute] = value;
}
toNode() {
return toNode.call(this, "span");
}
toMarkup() {
return toMarkup.call(this, "span");
}
}
let TextNode$1 = class TextNode {
constructor(text) {
this.text = text;
}
toNode() {
return document.createTextNode(this.text);
}
toMarkup() {
return utils.escape(this.text);
}
};
// Create an <a href="…"> node.
class AnchorNode {
constructor(href, classes, children) {
this.href = href;
this.classes = classes;
this.children = children || [];
}
toNode() {
const node = document.createElement("a");
node.setAttribute("href", this.href);
if (this.classes.length > 0) {
node.className = createClass(this.classes);
}
for (let i = 0; i < this.children.length; i++) {
node.appendChild(this.children[i].toNode());
}
return node
}
toMarkup() {
let markup = `<a href='${utils.escape(this.href)}'`;
if (this.classes.length > 0) {
markup += ` class="${utils.escape(createClass(this.classes))}"`;
}
markup += ">";
for (let i = 0; i < this.children.length; i++) {
markup += this.children[i].toMarkup();
}
markup += "</a>";
return markup
}
}
/*
* This node represents an image embed (<img>) element.
*/
class Img {
constructor(src, alt, style) {
this.alt = alt;
this.src = src;
this.classes = ["mord"];
this.style = style;
}
hasClass(className) {
return this.classes.includes(className);
}
toNode() {
const node = document.createElement("img");
node.src = this.src;
node.alt = this.alt;
node.className = "mord";
// Apply inline styles
for (const style in this.style) {
if (Object.prototype.hasOwnProperty.call(this.style, style )) {
node.style[style] = this.style[style];
}
}
return node;
}
toMarkup() {
let markup = `<img src='${this.src}' alt='${this.alt}'`;
// Add the styles, after hyphenation
let styles = "";
for (const style in this.style) {
if (Object.prototype.hasOwnProperty.call(this.style, style )) {
styles += `${utils.hyphenate(style)}:${this.style[style]};`;
}
}
if (styles) {
markup += ` style="${utils.escape(styles)}"`;
}
markup += ">";
return markup;
}
}
//
/**
* These objects store data about MathML nodes.
* The `toNode` and `toMarkup` functions create namespaced DOM nodes and
* HTML text markup respectively.
*/
function newDocumentFragment(children) {
return new DocumentFragment(children);
}
/**
* This node represents a general purpose MathML node of any type,
* for example, `"mo"` or `"mspace"`, corresponding to `<mo>` and
* `<mspace>` tags).
*/
class MathNode {
constructor(type, children, classes, style) {
this.type = type;
this.attributes = {};
this.children = children || [];
this.classes = classes || [];
this.style = style || {}; // Used for <mstyle> elements
this.label = "";
}
/**
* Sets an attribute on a MathML node. MathML depends on attributes to convey a
* semantic content, so this is used heavily.
*/
setAttribute(name, value) {
this.attributes[name] = value;
}
/**
* Gets an attribute on a MathML node.
*/
getAttribute(name) {
return this.attributes[name];
}
setLabel(value) {
this.label = value;
}
/**
* Converts the math node into a MathML-namespaced DOM element.
*/
toNode() {
const node = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type);
for (const attr in this.attributes) {
if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
node.setAttribute(attr, this.attributes[attr]);
}
}
if (this.classes.length > 0) {
node.className = createClass(this.classes);
}
// Apply inline styles
for (const style in this.style) {
if (Object.prototype.hasOwnProperty.call(this.style, style )) {
node.style[style] = this.style[style];
}
}
for (let i = 0; i < this.children.length; i++) {
node.appendChild(this.children[i].toNode());
}
return node;
}
/**
* Converts the math node into an HTML markup string.
*/
toMarkup() {
let markup = "<" + this.type;
// Add the attributes
for (const attr in this.attributes) {
if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
markup += " " + attr + '="';
markup += utils.escape(this.attributes[attr]);
markup += '"';
}
}
if (this.classes.length > 0) {
markup += ` class="${utils.escape(createClass(this.classes))}"`;
}
let styles = "";
// Add the styles, after hyphenation
for (const style in this.style) {
if (Object.prototype.hasOwnProperty.call(this.style, style )) {
styles += `${utils.hyphenate(style)}:${this.style[style]};`;
}
}
if (styles) {
markup += ` style="${styles}"`;
}
markup += ">";
for (let i = 0; i < this.children.length; i++) {
markup += this.children[i].toMarkup();
}
markup += "</" + this.type + ">";
return markup;
}
/**
* Converts the math node into a string, similar to innerText, but escaped.
*/
toText() {
return this.children.map((child) => child.toText()).join("");
}
}
/**
* This node represents a piece of text.
*/
class TextNode {
constructor(text) {
this.text = text;
}
/**
* Converts the text node into a DOM text node.
*/
toNode() {
return document.createTextNode(this.text);
}
/**
* Converts the text node into escaped HTML markup
* (representing the text itself).
*/
toMarkup() {
return utils.escape(this.toText());
}
/**
* Converts the text node into a string
* (representing the text itself).
*/
toText() {
return this.text;
}
}
// Do not make an <mrow> the only child of a <mstyle>.
// An <mstyle> acts as its own implicit <mrow>.
const wrapWithMstyle = expression => {
let node;
if (expression.length === 1 && expression[0].type === "mrow") {
node = expression.pop();
node.type = "mstyle";
} else {
node = new MathNode("mstyle", expression);
}
return node
};
var mathMLTree = {
MathNode,
TextNode,
newDocumentFragment
};
/**
* This file provides support for building horizontal stretchy elements.
*/
// TODO: Remove when Chromium stretches \widetilde & \widehat
const estimatedWidth = node => {
let width = 0;
if (node.body) {
for (const item of node.body) {
width += estimatedWidth(item);
}
} else if (node.type === "supsub") {
width += estimatedWidth(node.base);
if (node.sub) { width += 0.7 * estimatedWidth(node.sub); }
if (node.sup) { width += 0.7 * estimatedWidth(node.sup); }
} else if (node.type === "mathord" || node.type === "textord") {
for (const ch of node.text.split('')) {
const codePoint = ch.codePointAt(0);
if ((0x60 < codePoint && codePoint < 0x7B) || (0x03B0 < codePoint && codePoint < 0x3CA)) {
width += 0.56; // lower case latin or greek. Use advance width of letter n
} else if (0x2F < codePoint && codePoint < 0x3A) {
width += 0.50; // numerals.
} else {
width += 0.92; // advance width of letter M
}
}
} else {
width += 1.0;
}
return width
};
const stretchyCodePoint = {
widehat: "^",
widecheck: "ˇ",
widetilde: "~",
wideparen: "⏜", // \u23dc
utilde: "~",
overleftarrow: "\u2190",
underleftarrow: "\u2190",
xleftarrow: "\u2190",
overrightarrow: "\u2192",
underrightarrow: "\u2192",
xrightarrow: "\u2192",
underbrace: "\u23df",
overbrace: "\u23de",
overgroup: "\u23e0",
overparen: "⏜",
undergroup: "\u23e1",
underparen: "\u23dd",
overleftrightarrow: "\u2194",
underleftrightarrow: "\u2194",
xleftrightarrow: "\u2194",
Overrightarrow: "\u21d2",
xRightarrow: "\u21d2",
overleftharpoon: "\u21bc",
xleftharpoonup: "\u21bc",
overrightharpoon: "\u21c0",
xrightharpoonup: "\u21c0",
xLeftarrow: "\u21d0",
xLeftrightarrow: "\u21d4",
xhookleftarrow: "\u21a9",
xhookrightarrow: "\u21aa",
xmapsto: "\u21a6",
xrightharpoondown: "\u21c1",
xleftharpoondown: "\u21bd",
xtwoheadleftarrow: "\u219e",
xtwoheadrightarrow: "\u21a0",
xlongequal: "=",
xrightleftarrows: "\u21c4",
yields: "\u2192",
yieldsLeft: "\u2190",
mesomerism: "\u2194",
longrightharpoonup: "\u21c0",
longleftharpoondown: "\u21bd",
eqrightharpoonup: "\u21c0",
eqleftharpoondown: "\u21bd",
"\\cdrightarrow": "\u2192",
"\\cdleftarrow": "\u2190",
"\\cdlongequal": "="
};
const mathMLnode = function(label) {
const child = new mathMLTree.TextNode(stretchyCodePoint[label.slice(1)]);
const node = new mathMLTree.MathNode("mo", [child]);
node.setAttribute("stretchy", "true");
return node
};
const crookedWides = ["\\widetilde", "\\widehat", "\\widecheck", "\\utilde"];
// TODO: Remove when Chromium stretches \widetilde & \widehat
const accentNode = (group) => {
const mo = mathMLnode(group.label);
if (crookedWides.includes(group.label)) {
const width = estimatedWidth(group.base);
if (1 < width && width < 1.6) {
mo.classes.push("tml-crooked-2");
} else if (1.6 <= width && width < 2.5) {
mo.classes.push("tml-crooked-3");
} else if (2.5 <= width) {
mo.classes.push("tml-crooked-4");
}
}
return mo
};
var stretchy = {
mathMLnode,
accentNode
};
/**
* This file holds a list of all no-argument functions and single-character
* symbols (like 'a' or ';').
*
* For each of the symbols, there are two properties they can have:
* - group (required): the ParseNode group type the symbol should have (i.e.
"textord", "mathord", etc).
* - replace: the character that this symbol or function should be
* replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi
* character in the main font).
*
* The outermost map in the table indicates what mode the symbols should be
* accepted in (e.g. "math" or "text").
*/
// Some of these have a "-token" suffix since these are also used as `ParseNode`
// types for raw text tokens, and we want to avoid conflicts with higher-level
// `ParseNode` types. These `ParseNode`s are constructed within `Parser` by
// looking up the `symbols` map.
const ATOMS = {
bin: 1,
close: 1,
inner: 1,
open: 1,
punct: 1,
rel: 1
};
const NON_ATOMS = {
"accent-token": 1,
mathord: 1,
"op-token": 1,
spacing: 1,
textord: 1
};
const symbols = {
math: {},
text: {}
};
/** `acceptUnicodeChar = true` is only applicable if `replace` is set. */
function defineSymbol(mode, group, replace, name, acceptUnicodeChar) {
symbols[mode][name] = { group, replace };
if (acceptUnicodeChar && replace) {
symbols[mode][replace] = symbols[mode][name];
}
}
// Some abbreviations for commonly used strings.
// This helps minify the code, and also spotting typos using jshint.
// modes:
const math = "math";
const temml_text = "text";
// groups:
const accent = "accent-token";
const bin = "bin";
const temml_close = "close";
const inner = "inner";
const mathord = "mathord";
const op = "op-token";
const temml_open = "open";
const punct = "punct";
const rel = "rel";
const spacing = "spacing";
const textord = "textord";
// Now comes the symbol table
// Relation Symbols
defineSymbol(math, rel, "\u2261", "\\equiv", true);
defineSymbol(math, rel, "\u227a", "\\prec", true);
defineSymbol(math, rel, "\u227b", "\\succ", true);
defineSymbol(math, rel, "\u223c", "\\sim", true);
defineSymbol(math, rel, "\u27c2", "\\perp", true);
defineSymbol(math, rel, "\u2aaf", "\\preceq", true);
defineSymbol(math, rel, "\u2ab0", "\\succeq", true);
defineSymbol(math, rel, "\u2243", "\\simeq", true);
defineSymbol(math, rel, "\u224c", "\\backcong", true);
defineSymbol(math, rel, "|", "\\mid", true);
defineSymbol(math, rel, "\u226a", "\\ll", true);
defineSymbol(math, rel, "\u226b", "\\gg", true);
defineSymbol(math, rel, "\u224d", "\\asymp", true);
defineSymbol(math, rel, "\u2225", "\\parallel");
defineSymbol(math, rel, "\u2323", "\\smile", true);
defineSymbol(math, rel, "\u2291", "\\sqsubseteq", true);
defineSymbol(math, rel, "\u2292", "\\sqsupseteq", true);
defineSymbol(math, rel, "\u2250", "\\doteq", true);
defineSymbol(math, rel, "\u2322", "\\frown", true);
defineSymbol(math, rel, "\u220b", "\\ni", true);
defineSymbol(math, rel, "\u220c", "\\notni", true);
defineSymbol(math, rel, "\u221d", "\\propto", true);
defineSymbol(math, rel, "\u22a2", "\\vdash", true);
defineSymbol(math, rel, "\u22a3", "\\dashv", true);
defineSymbol(math, rel, "\u220b", "\\owns");
defineSymbol(math, rel, "\u2258", "\\arceq", true);
defineSymbol(math, rel, "\u2259", "\\wedgeq", true);
defineSymbol(math, rel, "\u225a", "\\veeeq", true);
defineSymbol(math, rel, "\u225b", "\\stareq", true);
defineSymbol(math, rel, "\u225d", "\\eqdef", true);
defineSymbol(math, rel, "\u225e", "\\measeq", true);
defineSymbol(math, rel, "\u225f", "\\questeq", true);
defineSymbol(math, rel, "\u2260", "\\ne", true);
defineSymbol(math, rel, "\u2260", "\\neq");
// unicodemath
defineSymbol(math, rel, "\u2a75", "\\eqeq", true);
defineSymbol(math, rel, "\u2a76", "\\eqeqeq", true);
// mathtools.sty
defineSymbol(math, rel, "\u2237", "\\dblcolon", true);
defineSymbol(math, rel, "\u2254", "\\coloneqq", true);
defineSymbol(math, rel, "\u2255", "\\eqqcolon", true);
defineSymbol(math, rel, "\u2239", "\\eqcolon", true);
defineSymbol(math, rel, "\u2A74", "\\Coloneqq", true);
// Punctuation
defineSymbol(math, punct, "\u002e", "\\ldotp");
defineSymbol(math, punct, "\u00b7", "\\cdotp");
// Misc Symbols
defineSymbol(math, textord, "\u0023", "\\#");
defineSymbol(temml_text, textord, "\u0023", "\\#");
defineSymbol(math, textord, "\u0026", "\\&");
defineSymbol(temml_text, textord, "\u0026", "\\&");
defineSymbol(math, textord, "\u2135", "\\aleph", true);
defineSymbol(math, textord, "\u2200", "\\forall", true);
defineSymbol(math, textord, "\u210f", "\\hbar", true);
defineSymbol(math, textord, "\u2203", "\\exists", true);
// ∇ is actually a unary operator, not binary. But this works.
defineSymbol(math, bin, "\u2207", "\\nabla", true);
defineSymbol(math, textord, "\u266d", "\\flat", true);
defineSymbol(math, textord, "\u2113", "\\ell", true);
defineSymbol(math, textord, "\u266e", "\\natural", true);
defineSymbol(math, textord, "Å", "\\Angstrom", true);
defineSymbol(temml_text, textord, "Å", "\\Angstrom", true);
defineSymbol(math, textord, "\u2663", "\\clubsuit", true);
defineSymbol(math, textord, "\u2667", "\\varclubsuit", true);
defineSymbol(math, textord, "\u2118", "\\wp", true);
defineSymbol(math, textord, "\u266f", "\\sharp", true);
defineSymbol(math, textord, "\u2662", "\\diamondsuit", true);
defineSymbol(math, textord, "\u2666", "\\vardiamondsuit", true);
defineSymbol(math, textord, "\u211c", "\\Re", true);
defineSymbol(math, textord, "\u2661", "\\heartsuit", true);
defineSymbol(math, textord, "\u2665", "\\varheartsuit", true);
defineSymbol(math, textord, "\u2111", "\\Im", true);
defineSymbol(math, textord, "\u2660", "\\spadesuit", true);
defineSymbol(math, textord, "\u2664", "\\varspadesuit", true);
defineSymbol(math, textord, "\u2640", "\\female", true);
defineSymbol(math, textord, "\u2642", "\\male", true);
defineSymbol(math, textord, "\u00a7", "\\S", true);
defineSymbol(temml_text, textord, "\u00a7", "\\S");
defineSymbol(math, textord, "\u00b6", "\\P", true);
defineSymbol(temml_text, textord, "\u00b6", "\\P");
defineSymbol(temml_text, textord, "\u263a", "\\smiley", true);
defineSymbol(math, textord, "\u263a", "\\smiley", true);
// Math and Text
defineSymbol(math, textord, "\u2020", "\\dag");
defineSymbol(temml_text, textord, "\u2020", "\\dag");
defineSymbol(temml_text, textord, "\u2020", "\\textdagger");
defineSymbol(math, textord, "\u2021", "\\ddag");
defineSymbol(temml_text, textord, "\u2021", "\\ddag");
defineSymbol(temml_text, textord, "\u2021", "\\textdaggerdbl");
// Large Delimiters
defineSymbol(math, temml_close, "\u23b1", "\\rmoustache", true);
defineSymbol(math, temml_open, "\u23b0", "\\lmoustache", true);
defineSymbol(math, temml_close, "\u27ef", "\\rgroup", true);
defineSymbol(math, temml_open, "\u27ee", "\\lgroup", true);
// Binary Operators
defineSymbol(math, bin, "\u2213", "\\mp", true);
defineSymbol(math, bin, "\u2296", "\\ominus", true);
defineSymbol(math, bin, "\u228e", "\\uplus", true);
defineSymbol(math, bin, "\u2293", "\\sqcap", true);
defineSymbol(math, bin, "\u2217", "\\ast");
defineSymbol(math, bin, "\u2294", "\\sqcup", true);
defineSymbol(math, bin, "\u25ef", "\\bigcirc", true);
defineSymbol(math, bin, "\u2219", "\\bullet", true);
defineSymbol(math, bin, "\u2021", "\\ddagger");
defineSymbol(math, bin, "\u2240", "\\wr", true);
defineSymbol(math, bin, "\u2a3f", "\\amalg");
defineSymbol(math, bin, "\u0026", "\\And"); // from amsmath
defineSymbol(math, bin, "\u2AFD", "\\sslash", true); // from stmaryrd
// Arrow Symbols
defineSymbol(math, rel, "\u27f5", "\\longleftarrow", true);
defineSymbol(math, rel, "\u21d0", "\\Leftarrow", true);
defineSymbol(math, rel, "\u27f8", "\\Longleftarrow", true);
defineSymbol(math, rel, "\u27f6", "\\longrightarrow", true);
defineSymbol(math, rel, "\u21d2", "\\Rightarrow", true);
defineSymbol(math, rel, "\u27f9", "\\Longrightarrow", true);
defineSymbol(math, rel, "\u2194", "\\leftrightarrow", true);
defineSymbol(math, rel, "\u27f7", "\\longleftrightarrow", true);
defineSymbol(math, rel, "\u21d4", "\\Leftrightarrow", true);
defineSymbol(math, rel, "\u27fa", "\\Longleftrightarrow", true);
defineSymbol(math, rel, "\u21a4", "\\mapsfrom", true);
defineSymbol(math, rel, "\u21a6", "\\mapsto", true);
defineSymbol(math, rel, "\u27fc", "\\longmapsto", true);
defineSymbol(math, rel, "\u2197", "\\nearrow", true);
defineSymbol(math, rel, "\u21a9", "\\hookleftarrow", true);
defineSymbol(math, rel, "\u21aa", "\\hookrightarrow", true);
defineSymbol(math, rel, "\u2198", "\\searrow", true);
defineSymbol(math, rel, "\u21bc", "\\leftharpoonup", true);
defineSymbol(math, rel, "\u21c0", "\\rightharpoonup", true);
defineSymbol(math, rel, "\u2199", "\\swarrow", true);
defineSymbol(math, rel, "\u21bd", "\\leftharpoondown", true);
defineSymbol(math, rel, "\u21c1", "\\rightharpoondown", true);
defineSymbol(math, rel, "\u2196", "\\nwarrow", true);
defineSymbol(math, rel, "\u21cc", "\\rightleftharpoons", true);
defineSymbol(math, mathord, "\u21af", "\\lightning", true);
defineSymbol(math, mathord, "\u220E", "\\QED", true);
defineSymbol(math, mathord, "\u2030", "\\permil", true);
defineSymbol(temml_text, textord, "\u2030", "\\permil");
defineSymbol(math, mathord, "\u2609", "\\astrosun", true);
defineSymbol(math, mathord, "\u263c", "\\sun", true);
defineSymbol(math, mathord, "\u263e", "\\leftmoon", true);
defineSymbol(math, mathord, "\u263d", "\\rightmoon", true);
defineSymbol(math, mathord, "\u2295", "\\Earth");
// AMS Negated Binary Relations
defineSymbol(math, rel, "\u226e", "\\nless", true);
// Symbol names preceeded by "@" each have a corresponding macro.
defineSymbol(math, rel, "\u2a87", "\\lneq", true);
defineSymbol(math, rel, "\u2268", "\\lneqq", true);
defineSymbol(math, rel, "\u2268\ufe00", "\\lvertneqq");
defineSymbol(math, rel, "\u22e6", "\\lnsim", true);
defineSymbol(math, rel, "\u2a89", "\\lnapprox", true);
defineSymbol(math, rel, "\u2280", "\\nprec", true);
// unicode-math maps \u22e0 to \npreccurlyeq. We'll use the AMS synonym.
defineSymbol(math, rel, "\u22e0", "\\npreceq", true);
defineSymbol(math, rel, "\u22e8", "\\precnsim", true);
defineSymbol(math, rel, "\u2ab9", "\\precnapprox", true);
defineSymbol(math, rel, "\u2241", "\\nsim", true);
defineSymbol(math, rel, "\u2224", "\\nmid", true);
defineSymbol(math, rel, "\u2224", "\\nshortmid");
defineSymbol(math, rel, "\u22ac", "\\nvdash", true);
defineSymbol(math, rel, "\u22ad", "\\nvDash", true);
defineSymbol(math, rel, "\u22ea", "\\ntriangleleft");
defineSymbol(math, rel, "\u22ec", "\\ntrianglelefteq", true);
defineSymbol(math, rel, "\u2284", "\\nsubset", true);
defineSymbol(math, rel, "\u2285", "\\nsupset", true);
defineSymbol(math, rel, "\u228a", "\\subsetneq", true);
defineSymbol(math, rel, "\u228a\ufe00", "\\varsubsetneq");
defineSymbol(math, rel, "\u2acb", "\\subsetneqq", true);
defineSymbol(math, rel, "\u2acb\ufe00", "\\varsubsetneqq");
defineSymbol(math, rel, "\u226f", "\\ngtr", true);
defineSymbol(math, rel, "\u2a88", "\\gneq", true);
defineSymbol(math, rel, "\u2269", "\\gneqq", true);
defineSymbol(math, rel, "\u2269\ufe00", "\\gvertneqq");
defineSymbol(math, rel, "\u22e7", "\\gnsim", true);
defineSymbol(math, rel, "\u2a8a", "\\gnapprox", true);
defineSymbol(math, rel, "\u2281", "\\nsucc", true);
// unicode-math maps \u22e1 to \nsucccurlyeq. We'll use the AMS synonym.
defineSymbol(math, rel, "\u22e1", "\\nsucceq", true);
defineSymbol(math, rel, "\u22e9", "\\succnsim", true);
defineSymbol(math, rel, "\u2aba", "\\succnapprox", true);
// unicode-math maps \u2246 to \simneqq. We'll use the AMS synonym.
defineSymbol(math, rel, "\u2246", "\\ncong", true);
defineSymbol(math, rel, "\u2226", "\\nparallel", true);
defineSymbol(math, rel, "\u2226", "\\nshortparallel");
defineSymbol(math, rel, "\u22af", "\\nVDash", true);
defineSymbol(math, rel, "\u22eb", "\\ntriangleright");
defineSymbol(math, rel, "\u22ed", "\\ntrianglerighteq", true);
defineSymbol(math, rel, "\u228b", "\\supsetneq", true);
defineSymbol(math, rel, "\u228b", "\\varsupsetneq");
defineSymbol(math, rel, "\u2acc", "\\supsetneqq", true);
defineSymbol(math, rel, "\u2acc\ufe00", "\\varsupsetneqq");
defineSymbol(math, rel, "\u22ae", "\\nVdash", true);
defineSymbol(math, rel, "\u2ab5", "\\precneqq", true);
defineSymbol(math, rel, "\u2ab6", "\\succneqq", true);
defineSymbol(math, bin, "\u22b4", "\\unlhd");
defineSymbol(math, bin, "\u22b5", "\\unrhd");
// AMS Negated Arrows
defineSymbol(math, rel, "\u219a", "\\nleftarrow", true);
defineSymbol(math, rel, "\u219b", "\\nrightarrow", true);
defineSymbol(math, rel, "\u21cd", "\\nLeftarrow", true);
defineSymbol(math, rel, "\u21cf", "\\nRightarrow", true);
defineSymbol(math, rel, "\u21ae", "\\nleftrightarrow", true);
defineSymbol(math, rel, "\u21ce", "\\nLeftrightarrow", true);
// AMS Misc
defineSymbol(math, rel, "\u25b3", "\\vartriangle");
defineSymbol(math, textord, "\u210f", "\\hslash");
defineSymbol(math, textord, "\u25bd", "\\triangledown");
defineSymbol(math, textord, "\u25ca", "\\lozenge");
defineSymbol(math, textord, "\u24c8", "\\circledS");
defineSymbol(math, textord, "\u00ae", "\\circledR", true);
defineSymbol(temml_text, textord, "\u00ae", "\\circledR");
defineSymbol(temml_text, textord, "\u00ae", "\\textregistered");
defineSymbol(math, textord, "\u2221", "\\measuredangle", true);
defineSymbol(math, textord, "\u2204", "\\nexists");
defineSymbol(math, textord, "\u2127", "\\mho");
defineSymbol(math, textord, "\u2132", "\\Finv", true);
defineSymbol(math, textord, "\u2141", "\\Game", true);
defineSymbol(math, textord, "\u2035", "\\backprime");
defineSymbol(math, textord, "\u2036", "\\backdprime");
defineSymbol(math, textord, "\u2037", "\\backtrprime");
defineSymbol(math, textord, "\u25b2", "\\blacktriangle");
defineSymbol(math, textord, "\u25bc", "\\blacktriangledown");
defineSymbol(math, textord, "\u25a0", "\\blacksquare");
defineSymbol(math, textord, "\u29eb", "\\blacklozenge");
defineSymbol(math, textord, "\u2605", "\\bigstar");
defineSymbol(math, textord, "\u2222", "\\sphericalangle", true);
defineSymbol(math, textord, "\u2201", "\\complement", true);
// unicode-math maps U+F0 to \matheth. We map to AMS function \eth
defineSymbol(math, textord, "\u00f0", "\\eth", true);
defineSymbol(temml_text, textord, "\u00f0", "\u00f0");
defineSymbol(math, textord, "\u2571", "\\diagup");
defineSymbol(math, textord, "\u2572", "\\diagdown");
defineSymbol(math, textord, "\u25a1", "\\square");
defineSymbol(math, textord, "\u25a1", "\\Box");
defineSymbol(math, textord, "\u25ca", "\\Diamond");
// unicode-math maps U+A5 to \mathyen. We map to AMS function \yen
defineSymbol(math, textord, "\u00a5", "\\yen", true);
defineSymbol(temml_text, textord, "\u00a5", "\\yen", true);
defineSymbol(math, textord, "\u2713", "\\checkmark", true);
defineSymbol(temml_text, textord, "\u2713", "\\checkmark");
defineSymbol(math, textord, "\u2717", "\\ballotx", true);
defineSymbol(temml_text, textord, "\u2717", "\\ballotx");
defineSymbol(temml_text, textord, "\u2022", "\\textbullet");
// AMS Hebrew
defineSymbol(math, textord, "\u2136", "\\beth", true);
defineSymbol(math, textord, "\u2138", "\\daleth", true);
defineSymbol(math, textord, "\u2137", "\\gimel", true);
// AMS Greek
defineSymbol(math, textord, "\u03dd", "\\digamma", true);
defineSymbol(math, textord, "\u03f0", "\\varkappa");
// AMS Delimiters
defineSymbol(math, temml_open, "\u231C", "\\ulcorner", true);
defineSymbol(math, temml_close, "\u231D", "\\urcorner", true);
defineSymbol(math, temml_open, "\u231E", "\\llcorner", true);
defineSymbol(math, temml_close, "\u231F", "\\lrcorner", true);
// AMS Binary Relations
defineSymbol(math, rel, "\u2266", "\\leqq", true);
defineSymbol(math, rel, "\u2a7d", "\\leqslant", true);
defineSymbol(math, rel, "\u2a95", "\\eqslantless", true);
defineSymbol(math, rel, "\u2272", "\\lesssim", true);
defineSymbol(math, rel, "\u2a85", "\\lessapprox", true);
defineSymbol(math, rel, "\u224a", "\\approxeq", true);
defineSymbol(math, bin, "\u22d6", "\\lessdot");
defineSymbol(math, rel, "\u22d8", "\\lll", true);
defineSymbol(math, rel, "\u2276", "\\lessgtr", true);
defineSymbol(math, rel, "\u22da", "\\lesseqgtr", true);
defineSymbol(math, rel, "\u2a8b", "\\lesseqqgtr", true);
defineSymbol(math, rel, "\u2251", "\\doteqdot");
defineSymbol(math, rel, "\u2253", "\\risingdotseq", true);
defineSymbol(math, rel, "\u2252", "\\fallingdotseq", true);
defineSymbol(math, rel, "\u223d", "\\backsim", true);
defineSymbol(math, rel, "\u22cd", "\\backsimeq", true);
defineSymbol(math, rel, "\u2ac5", "\\subseteqq", true);
defineSymbol(math, rel, "\u22d0", "\\Subset", true);
defineSymbol(math, rel, "\u228f", "\\sqsubset", true);
defineSymbol(math, rel, "\u227c", "\\preccurlyeq", true);
defineSymbol(math, rel, "\u22de", "\\curlyeqprec", true);
defineSymbol(math, rel, "\u227e", "\\precsim", true);
defineSymbol(math, rel, "\u2ab7", "\\precapprox", true);
defineSymbol(math, rel, "\u22b2", "\\vartriangleleft");
defineSymbol(math, rel, "\u22b4", "\\trianglelefteq");
defineSymbol(math, rel, "\u22a8", "\\vDash", true);
defineSymbol(math, rel, "\u22ab", "\\VDash", true);
defineSymbol(math, rel, "\u22aa", "\\Vvdash", true);
defineSymbol(math, rel, "\u2323", "\\smallsmile");
defineSymbol(math, rel, "\u2322", "\\smallfrown");
defineSymbol(math, rel, "\u224f", "\\bumpeq", true);
defineSymbol(math, rel, "\u224e", "\\Bumpeq", true);
defineSymbol(math, rel, "\u2267", "\\geqq", true);
defineSymbol(math, rel, "\u2a7e", "\\geqslant", true);
defineSymbol(math, rel, "\u2a96", "\\eqslantgtr", true);
defineSymbol(math, rel, "\u2273", "\\gtrsim", true);
defineSymbol(math, rel, "\u2a86", "\\gtrapprox", true);
defineSymbol(math, bin, "\u22d7", "\\gtrdot");
defineSymbol(math, rel, "\u22d9", "\\ggg", true);
defineSymbol(math, rel, "\u2277", "\\gtrless", true);
defineSymbol(math, rel, "\u22db", "\\gtreqless", true);
defineSymbol(math, rel, "\u2a8c", "\\gtreqqless", true);
defineSymbol(math, rel, "\u2256", "\\eqcirc", true);
defineSymbol(math, rel, "\u2257", "\\circeq", true);
defineSymbol(math, rel, "\u225c", "\\triangleq", true);
defineSymbol(math, rel, "\u223c", "\\thicksim");
defineSymbol(math, rel, "\u2248", "\\thickapprox");
defineSymbol(math, rel, "\u2ac6", "\\supseteqq", true);
defineSymbol(math, rel, "\u22d1", "\\Supset", true);
defineSymbol(math, rel, "\u2290", "\\sqsupset", true);
defineSymbol(math, rel, "\u227d", "\\succcurlyeq", true);
defineSymbol(math, rel, "\u22df", "\\curlyeqsucc", true);
defineSymbol(math, rel, "\u227f", "\\succsim", true);
defineSymbol(math, rel, "\u2ab8", "\\succapprox", true);
defineSymbol(math, rel, "\u22b3", "\\vartriangleright");
defineSymbol(math, rel, "\u22b5", "\\trianglerighteq");
defineSymbol(math, rel, "\u22a9", "\\Vdash", true);
defineSymbol(math, rel, "\u2223", "\\shortmid");
defineSymbol(math, rel, "\u2225", "\\shortparallel");
defineSymbol(math, rel, "\u226c", "\\between", true);
defineSymbol(math, rel, "\u22d4", "\\pitchfork", true);
defineSymbol(math, rel, "\u221d", "\\varpropto");
defineSymbol(math, rel, "\u25c0", "\\blacktriangleleft");
// unicode-math says that \therefore is a mathord atom.
// We kept the amssymb atom type, which is rel.
defineSymbol(math, rel, "\u2234", "\\therefore", true);
defineSymbol(math, rel, "\u220d", "\\backepsilon");
defineSymbol(math, rel, "\u25b6", "\\blacktriangleright");
// unicode-math says that \because is a mathord atom.
// We kept the amssymb atom type, which is rel.
defineSymbol(math, rel, "\u2235", "\\because", true);
defineSymbol(math, rel, "\u22d8", "\\llless");
defineSymbol(math, rel, "\u22d9", "\\gggtr");
defineSymbol(math, bin, "\u22b2", "\\lhd");
defineSymbol(math, bin, "\u22b3", "\\rhd");
defineSymbol(math, rel, "\u2242", "\\eqsim", true);
defineSymbol(math, rel, "\u2251", "\\Doteq", true);
defineSymbol(math, rel, "\u297d", "\\strictif", true);
defineSymbol(math, rel, "\u297c", "\\strictfi", true);
// AMS Binary Operators
defineSymbol(math, bin, "\u2214", "\\dotplus", true);
defineSymbol(math, bin, "\u2216", "\\smallsetminus");
defineSymbol(math, bin, "\u22d2", "\\Cap", true);
defineSymbol(math, bin, "\u22d3", "\\Cup", true);
defineSymbol(math, bin, "\u2a5e", "\\doublebarwedge", true);
defineSymbol(math, bin, "\u229f", "\\boxminus", true);
defineSymbol(math, bin, "\u229e", "\\boxplus", true);
defineSymbol(math, bin, "\u29C4", "\\boxslash", true);
defineSymbol(math, bin, "\u22c7", "\\divideontimes", true);
defineSymbol(math, bin, "\u22c9", "\\ltimes", true);
defineSymbol(math, bin, "\u22ca", "\\rtimes", true);
defineSymbol(math, bin, "\u22cb", "\\leftthreetimes", true);
defineSymbol(math, bin, "\u22cc", "\\rightthreetimes", true);
defineSymbol(math, bin, "\u22cf", "\\curlywedge", true);
defineSymbol(math, bin, "\u22ce", "\\curlyvee", true);
defineSymbol(math, bin, "\u229d", "\\circleddash", true);
defineSymbol(math, bin, "\u229b", "\\circledast", true);
defineSymbol(math, bin, "\u22ba", "\\intercal", true);
defineSymbol(math, bin, "\u22d2", "\\doublecap");
defineSymbol(math, bin, "\u22d3", "\\doublecup");
defineSymbol(math, bin, "\u22a0", "\\boxtimes", true);
defineSymbol(math, bin, "\u22c8", "\\bowtie", true);
defineSymbol(math, bin, "\u22c8", "\\Join");
defineSymbol(math, bin, "\u27d5", "\\leftouterjoin", true);
defineSymbol(math, bin, "\u27d6", "\\rightouterjoin", true);
defineSymbol(math, bin, "\u27d7", "\\fullouterjoin", true);
// stix Binary Operators
defineSymbol(math, bin, "\u2238", "\\dotminus", true);
defineSymbol(math, bin, "\u27D1", "\\wedgedot", true);
defineSymbol(math, bin, "\u27C7", "\\veedot", true);
defineSymbol(math, bin, "\u2A62", "\\doublebarvee", true);
defineSymbol(math, bin, "\u2A63", "\\veedoublebar", true);
defineSymbol(math, bin, "\u2A5F", "\\wedgebar", true);
defineSymbol(math, bin, "\u2A60", "\\wedgedoublebar", true);
defineSymbol(math, bin, "\u2A54", "\\Vee", true);
defineSymbol(math, bin, "\u2A53", "\\Wedge", true);
defineSymbol(math, bin, "\u2A43", "\\barcap", true);
defineSymbol(math, bin, "\u2A42", "\\barcup", true);
defineSymbol(math, bin, "\u2A48", "\\capbarcup", true);
defineSymbol(math, bin, "\u2A40", "\\capdot", true);
defineSymbol(math, bin, "\u2A47", "\\capovercup", true);
defineSymbol(math, bin, "\u2A46", "\\cupovercap", true);
defineSymbol(math, bin, "\u2A4D", "\\closedvarcap", true);
defineSymbol(math, bin, "\u2A4C", "\\closedvarcup", true);
defineSymbol(math, bin, "\u2A2A", "\\minusdot", true);
defineSymbol(math, bin, "\u2A2B", "\\minusfdots", true);
defineSymbol(math, bin, "\u2A2C", "\\minusrdots", true);
defineSymbol(math, bin, "\u22BB", "\\Xor", true);
defineSymbol(math, bin, "\u22BC", "\\Nand", true);
defineSymbol(math, bin, "\u22BD", "\\Nor", true);
defineSymbol(math, bin, "\u22BD", "\\barvee");
defineSymbol(math, bin, "\u2AF4", "\\interleave", true);
defineSymbol(math, bin, "\u29E2", "\\shuffle", true);
defineSymbol(math, bin, "\u2AF6", "\\threedotcolon", true);
defineSymbol(math, bin, "\u2982", "\\typecolon", true);
defineSymbol(math, bin, "\u223E", "\\invlazys", true);
defineSymbol(math, bin, "\u2A4B", "\\twocaps", true);
defineSymbol(math, bin, "\u2A4A", "\\twocups", true);
defineSymbol(math, bin, "\u2A4E", "\\Sqcap", true);
defineSymbol(math, bin, "\u2A4F", "\\Sqcup", true);
defineSymbol(math, bin, "\u2A56", "\\veeonvee", true);
defineSymbol(math, bin, "\u2A55", "\\wedgeonwedge", true);
defineSymbol(math, bin, "\u29D7", "\\blackhourglass", true);
defineSymbol(math, bin, "\u29C6", "\\boxast", true);
defineSymbol(math, bin, "\u29C8", "\\boxbox", true);
defineSymbol(math, bin, "\u29C7", "\\boxcircle", true);
defineSymbol(math, bin, "\u229C", "\\circledequal", true);
defineSymbol(math, bin, "\u29B7", "\\circledparallel", true);
defineSymbol(math, bin, "\u29B6", "\\circledvert", true);
defineSymbol(math, bin, "\u29B5", "\\circlehbar", true);
defineSymbol(math, bin, "\u27E1", "\\concavediamond", true);
defineSymbol(math, bin, "\u27E2", "\\concavediamondtickleft", true);
defineSymbol(math, bin, "\u27E3", "\\concavediamondtickright", true);
defineSymbol(math, bin, "\u22C4", "\\diamond", true);
defineSymbol(math, bin, "\u29D6", "\\hourglass", true);
defineSymbol(math, bin, "\u27E0", "\\lozengeminus", true);
defineSymbol(math, bin, "\u233D", "\\obar", true);
defineSymbol(math, bin, "\u29B8", "\\obslash", true);
defineSymbol(math, bin, "\u2A38", "\\odiv", true);
defineSymbol(math, bin, "\u29C1", "\\ogreaterthan", true);
defineSymbol(math, bin, "\u29C0", "\\olessthan", true);
defineSymbol(math, bin, "\u29B9", "\\operp", true);
defineSymbol(math, bin, "\u2A37", "\\Otimes", true);
defineSymbol(math, bin, "\u2A36", "\\otimeshat", true);
defineSymbol(math, bin, "\u22C6", "\\star", true);
defineSymbol(math, bin, "\u25B3", "\\triangle", true);
defineSymbol(math, bin, "\u2A3A", "\\triangleminus", true);
defineSymbol(math, bin, "\u2A39", "\\triangleplus", true);
defineSymbol(math, bin, "\u2A3B", "\\triangletimes", true);
defineSymbol(math, bin, "\u27E4", "\\whitesquaretickleft", true);
defineSymbol(math, bin, "\u27E5", "\\whitesquaretickright", true);
defineSymbol(math, bin, "\u2A33", "\\smashtimes", true);
// AMS Arrows
// Note: unicode-math maps \u21e2 to their own function \rightdasharrow.
// We'll map it to AMS function \dashrightarrow. It produces the same atom.
defineSymbol(math, rel, "\u21e2", "\\dashrightarrow", true);
// unicode-math maps \u21e0 to \leftdasharrow. We'll use the AMS synonym.
defineSymbol(math, rel, "\u21e0", "\\dashleftarrow", true);
defineSymbol(math, rel, "\u21c7", "\\leftleftarrows", true);
defineSymbol(math, rel, "\u21c6", "\\leftrightarrows", true);
defineSymbol(math, rel, "\u21da", "\\Lleftarrow", true);
defineSymbol(math, rel, "\u219e", "\\twoheadleftarrow", true);
defineSymbol(math, rel, "\u21a2", "\\leftarrowtail", true);
defineSymbol(math, rel, "\u21ab", "\\looparrowleft", true);
defineSymbol(math, rel, "\u21cb", "\\leftrightharpoons", true);
defineSymbol(math, rel, "\u21b6", "\\curvearrowleft", true);
// unicode-math maps \u21ba to \acwopencirclearrow. We'll use the AMS synonym.
defineSymbol(math, rel, "\u21ba", "\\circlearrowleft", true);
defineSymbol(math, rel, "\u21b0", "\\Lsh", true);
defineSymbol(math, rel, "\u21c8", "\\upuparrows", true);
defineSymbol(math, rel, "\u21bf", "\\upharpoonleft", true);
defineSymbol(math, rel, "\u21c3", "\\downharpoonleft", true);
defineSymbol(math, rel, "\u22b6", "\\origof", true);
defineSymbol(math, rel, "\u22b7", "\\imageof", true);
defineSymbol(math, rel, "\u22b8", "\\multimap", true);
defineSymbol(math, rel, "\u21ad", "\\leftrightsquigarrow", true);
defineSymbol(math, rel, "\u21c9", "\\rightrightarrows", true);
defineSymbol(math, rel, "\u21c4", "\\rightleftarrows", true);
defineSymbol(math, rel, "\u21a0", "\\twoheadrightarrow", true);
defineSymbol(math, rel, "\u21a3", "\\rightarrowtail", true);
defineSymbol(math, rel, "\u21ac", "\\looparrowright", true);
defineSymbol(math, rel, "\u21b7", "\\curvearrowright", true);
// unicode-math maps \u21bb to \cwopencirclearrow. We'll use the AMS synonym.
defineSymbol(math, rel, "\u21bb", "\\circlearrowright", true);
defineSymbol(math, rel, "\u21b1", "\\Rsh", true);
defineSymbol(math, rel, "\u21ca", "\\downdownarrows", true);
defineSymbol(math, rel, "\u21be", "\\upharpoonright", true);
defineSymbol(math, rel, "\u21c2", "\\downharpoonright", true);
defineSymbol(math, rel, "\u21dd", "\\rightsquigarrow", true);
defineSymbol(math, rel, "\u21dd", "\\leadsto");
defineSymbol(math, rel, "\u21db", "\\Rrightarrow", true);
defineSymbol(math, rel, "\u21be", "\\restriction");
defineSymbol(math, textord, "\u2018", "`");
defineSymbol(math, textord, "$", "\\$");
defineSymbol(temml_text, textord, "$", "\\$");
defineSymbol(temml_text, textord, "$", "\\textdollar");
defineSymbol(math, textord, "¢", "\\cent");
defineSymbol(temml_text, textord, "¢", "\\cent");
defineSymbol(math, textord, "%", "\\%");
defineSymbol(temml_text, textord, "%", "\\%");
defineSymbol(math, textord, "_", "\\_");
defineSymbol(temml_text, textord, "_", "\\_");
defineSymbol(temml_text, textord, "_", "\\textunderscore");
defineSymbol(temml_text, textord, "\u2423", "\\textvisiblespace", true);
defineSymbol(math, textord, "\u2220", "\\angle", true);
defineSymbol(math, textord, "\u221e", "\\infty", true);
defineSymbol(math, textord, "\u2032", "\\prime");
defineSymbol(math, textord, "\u2033", "\\dprime");
defineSymbol(math, textord, "\u2034", "\\trprime");
defineSymbol(math, textord, "\u2057", "\\qprime");
defineSymbol(math, textord, "\u25b3", "\\triangle");
defineSymbol(temml_text, textord, "\u0391", "\\Alpha", true);
defineSymbol(temml_text, textord, "\u0392", "\\Beta", true);
defineSymbol(temml_text, textord, "\u0393", "\\Gamma", true);
defineSymbol(temml_text, textord, "\u0394", "\\Delta", true);
defineSymbol(temml_text, textord, "\u0395", "\\Epsilon", true);
defineSymbol(temml_text, textord, "\u0396", "\\Zeta", true);
defineSymbol(temml_text, textord, "\u0397", "\\Eta", true);
defineSymbol(temml_text, textord, "\u0398", "\\Theta", true);
defineSymbol(temml_text, textord, "\u0399", "\\Iota", true);
defineSymbol(temml_text, textord, "\u039a", "\\Kappa", true);
defineSymbol(temml_text, textord, "\u039b", "\\Lambda", true);
defineSymbol(temml_text, textord, "\u039c", "\\Mu", true);
defineSymbol(temml_text, textord, "\u039d", "\\Nu", true);
defineSymbol(temml_text, textord, "\u039e", "\\Xi", true);
defineSymbol(temml_text, textord, "\u039f", "\\Omicron", true);
defineSymbol(temml_text, textord, "\u03a0", "\\Pi", true);
defineSymbol(temml_text, textord, "\u03a1", "\\Rho", true);
defineSymbol(temml_text, textord, "\u03a3", "\\Sigma", true);
defineSymbol(temml_text, textord, "\u03a4", "\\Tau", true);
defineSymbol(temml_text, textord, "\u03a5", "\\Upsilon", true);
defineSymbol(temml_text, textord, "\u03a6", "\\Phi", true);
defineSymbol(temml_text, textord, "\u03a7", "\\Chi", true);
defineSymbol(temml_text, textord, "\u03a8", "\\Psi", true);
defineSymbol(temml_text, textord, "\u03a9", "\\Omega", true);
defineSymbol(math, mathord, "\u0391", "\\Alpha", true);
defineSymbol(math, mathord, "\u0392", "\\Beta", true);
defineSymbol(math, mathord, "\u0393", "\\Gamma", true);
defineSymbol(math, mathord, "\u0394", "\\Delta", true);
defineSymbol(math, mathord, "\u0395", "\\Epsilon", true);
defineSymbol(math, mathord, "\u0396", "\\Zeta", true);
defineSymbol(math, mathord, "\u0397", "\\Eta", true);
defineSymbol(math, mathord, "\u0398", "\\Theta", true);
defineSymbol(math, mathord, "\u0399", "\\Iota", true);
defineSymbol(math, mathord, "\u039a", "\\Kappa", true);
defineSymbol(math, mathord, "\u039b", "\\Lambda", true);
defineSymbol(math, mathord, "\u039c", "\\Mu", true);
defineSymbol(math, mathord, "\u039d", "\\Nu", true);
defineSymbol(math, mathord, "\u039e", "\\Xi", true);
defineSymbol(math, mathord, "\u039f", "\\Omicron", true);
defineSymbol(math, mathord, "\u03a0", "\\Pi", true);
defineSymbol(math, mathord, "\u03a1", "\\Rho", true);
defineSymbol(math, mathord, "\u03a3", "\\Sigma", true);
defineSymbol(math, mathord, "\u03a4", "\\Tau", true);
defineSymbol(math, mathord, "\u03a5", "\\Upsilon", true);
defineSymbol(math, mathord, "\u03a6", "\\Phi", true);
defineSymbol(math, mathord, "\u03a7", "\\Chi", true);
defineSymbol(math, mathord, "\u03a8", "\\Psi", true);
defineSymbol(math, mathord, "\u03a9", "\\Omega", true);
defineSymbol(math, temml_open, "\u00ac", "\\neg", true);
defineSymbol(math, temml_open, "\u00ac", "\\lnot");
defineSymbol(math, textord, "\u22a4", "\\top");
defineSymbol(math, textord, "\u22a5", "\\bot");
defineSymbol(math, textord, "\u2205", "\\emptyset");
defineSymbol(math, textord, "\u2300", "\\varnothing");
defineSymbol(math, mathord, "\u03b1", "\\alpha", true);
defineSymbol(math, mathord, "\u03b2", "\\beta", true);
defineSymbol(math, mathord, "\u03b3", "\\gamma", true);
defineSymbol(math, mathord, "\u03b4", "\\delta", true);
defineSymbol(math, mathord, "\u03f5", "\\epsilon", true);
defineSymbol(math, mathord, "\u03b6", "\\zeta", true);
defineSymbol(math, mathord, "\u03b7", "\\eta", true);
defineSymbol(math, mathord, "\u03b8", "\\theta", true);
defineSymbol(math, mathord, "\u03b9", "\\iota", true);
defineSymbol(math, mathord, "\u03ba", "\\kappa", true);
defineSymbol(math, mathord, "\u03bb", "\\lambda", true);
defineSymbol(math, mathord, "\u03bc", "\\mu", true);
defineSymbol(math, mathord, "\u03bd", "\\nu", true);
defineSymbol(math, mathord, "\u03be", "\\xi", true);
defineSymbol(math, mathord, "\u03bf", "\\omicron", true);
defineSymbol(math, mathord, "\u03c0", "\\pi", true);
defineSymbol(math, mathord, "\u03c1", "\\rho", true);
defineSymbol(math, mathord, "\u03c3", "\\sigma", true);
defineSymbol(math, mathord, "\u03c4", "\\tau", true);
defineSymbol(math, mathord, "\u03c5", "\\upsilon", true);
defineSymbol(math, mathord, "\u03d5", "\\phi", true);
defineSymbol(math, mathord, "\u03c7", "\\chi", true);
defineSymbol(math, mathord, "\u03c8", "\\psi", true);
defineSymbol(math, mathord, "\u03c9", "\\omega", true);
defineSymbol(math, mathord, "\u03b5", "\\varepsilon", true);
defineSymbol(math, mathord, "\u03d1", "\\vartheta", true);
defineSymbol(math, mathord, "\u03d6", "\\varpi", true);
defineSymbol(math, mathord, "\u03f1", "\\varrho", true);
defineSymbol(math, mathord, "\u03c2", "\\varsigma", true);
defineSymbol(math, mathord, "\u03c6", "\\varphi", true);
defineSymbol(math, mathord, "\u03d8", "\\Coppa", true);
defineSymbol(math, mathord, "\u03d9", "\\coppa", true);
defineSymbol(math, mathord, "\u03d9", "\\varcoppa", true);
defineSymbol(math, mathord, "\u03de", "\\Koppa", true);
defineSymbol(math, mathord, "\u03df", "\\koppa", true);
defineSymbol(math, mathord, "\u03e0", "\\Sampi", true);
defineSymbol(math, mathord, "\u03e1", "\\sampi", true);
defineSymbol(math, mathord, "\u03da", "\\Stigma", true);
defineSymbol(math, mathord, "\u03db", "\\stigma", true);
defineSymbol(math, mathord, "\u2aeb", "\\Bot");
defineSymbol(math, bin, "\u2217", "\u2217", true);
defineSymbol(math, bin, "+", "+");
defineSymbol(math, bin, "\u2217", "*");
defineSymbol(math, bin, "\u2044", "/", true);
defineSymbol(math, bin, "\u2044", "\u2044");
defineSymbol(math, bin, "\u2212", "-", true);
defineSymbol(math, bin, "\u22c5", "\\cdot", true);
defineSymbol(math, bin, "\u2218", "\\circ", true);
defineSymbol(math, bin, "\u00f7", "\\div", true);
defineSymbol(math, bin, "\u00b1", "\\pm", true);
defineSymbol(math, bin, "\u00d7", "\\times", true);
defineSymbol(math, bin, "\u2229", "\\cap", true);
defineSymbol(math, bin, "\u222a", "\\cup", true);
defineSymbol(math, bin, "\u2216", "\\setminus", true);
defineSymbol(math, bin, "\u2227", "\\land");
defineSymbol(math, bin, "\u2228", "\\lor");
defineSymbol(math, bin, "\u2227", "\\wedge", true);
defineSymbol(math, bin, "\u2228", "\\vee", true);
defineSymbol(math, temml_open, "\u27e6", "\\llbracket", true); // stmaryrd/semantic packages
defineSymbol(math, temml_close, "\u27e7", "\\rrbracket", true);
defineSymbol(math, temml_open, "\u27e8", "\\langle", true);
defineSymbol(math, temml_open, "\u27ea", "\\lAngle", true);
defineSymbol(math, temml_open, "\u2989", "\\llangle", true);
defineSymbol(math, temml_open, "|", "\\lvert");
defineSymbol(math, temml_open, "\u2016", "\\lVert", true);
defineSymbol(math, textord, "!", "\\oc"); // cmll package
defineSymbol(math, textord, "?", "\\wn");
defineSymbol(math, textord, "\u2193", "\\shpos");
defineSymbol(math, textord, "\u2195", "\\shift");
defineSymbol(math, textord, "\u2191", "\\shneg");
defineSymbol(math, temml_close, "?", "?");
defineSymbol(math, temml_close, "!", "!");
defineSymbol(math, temml_close, "‼", "‼");
defineSymbol(math, temml_close, "\u27e9", "\\rangle", true);
defineSymbol(math, temml_close, "\u27eb", "\\rAngle", true);
defineSymbol(math, temml_close, "\u298a", "\\rrangle", true);
defineSymbol(math, temml_close, "|", "\\rvert");
defineSymbol(math, temml_close, "\u2016", "\\rVert");
defineSymbol(math, temml_open, "\u2983", "\\lBrace", true); // stmaryrd/semantic packages
defineSymbol(math, temml_close, "\u2984", "\\rBrace", true);
defineSymbol(math, rel, "=", "\\equal", true);
defineSymbol(math, rel, ":", ":");
defineSymbol(math, rel, "\u2248", "\\approx", true);
defineSymbol(math, rel, "\u2245", "\\cong", true);
defineSymbol(math, rel, "\u2265", "\\ge");
defineSymbol(math, rel, "\u2265", "\\geq", true);
defineSymbol(math, rel, "\u2190", "\\gets");
defineSymbol(math, rel, ">", "\\gt", true);
defineSymbol(math, rel, "\u2208", "\\in", true);
defineSymbol(math, rel, "\u2209", "\\notin", true);
defineSymbol(math, rel, "\ue020", "\\@not");
defineSymbol(math, rel, "\u2282", "\\subset", true);
defineSymbol(math, rel, "\u2283", "\\supset", true);
defineSymbol(math, rel, "\u2286", "\\subseteq", true);
defineSymbol(math, rel, "\u2287", "\\supseteq", true);
defineSymbol(math, rel, "\u2288", "\\nsubseteq", true);
defineSymbol(math, rel, "\u2288", "\\nsubseteqq");
defineSymbol(math, rel, "\u2289", "\\nsupseteq", true);
defineSymbol(math, rel, "\u2289", "\\nsupseteqq");
defineSymbol(math, rel, "\u22a8", "\\models");
defineSymbol(math, rel, "\u2190", "\\leftarrow", true);
defineSymbol(math, rel, "\u2264", "\\le");
defineSymbol(math, rel, "\u2264", "\\leq", true);
defineSymbol(math, rel, "<", "\\lt", true);
defineSymbol(math, rel, "\u2192", "\\rightarrow", true);
defineSymbol(math, rel, "\u2192", "\\to");
defineSymbol(math, rel, "\u2271", "\\ngeq", true);
defineSymbol(math, rel, "\u2271", "\\ngeqq");
defineSymbol(math, rel, "\u2271", "\\ngeqslant");
defineSymbol(math, rel, "\u2270", "\\nleq", true);
defineSymbol(math, rel, "\u2270", "\\nleqq");
defineSymbol(math, rel, "\u2270", "\\nleqslant");
defineSymbol(math, rel, "\u2aeb", "\\Perp", true); //cmll package
defineSymbol(math, spacing, "\u00a0", "\\ ");
defineSymbol(math, spacing, "\u00a0", "\\space");
// Ref: LaTeX Source 2e: \DeclareRobustCommand{\nobreakspace}{%
defineSymbol(math, spacing, "\u00a0", "\\nobreakspace");
defineSymbol(temml_text, spacing, "\u00a0", "\\ ");
defineSymbol(temml_text, spacing, "\u00a0", " ");
defineSymbol(temml_text, spacing, "\u00a0", "\\space");
defineSymbol(temml_text, spacing, "\u00a0", "\\nobreakspace");
defineSymbol(math, spacing, null, "\\nobreak");
defineSymbol(math, spacing, null, "\\allowbreak");
defineSymbol(math, punct, ",", ",");
defineSymbol(temml_text, punct, ":", ":");
defineSymbol(math, punct, ";", ";");
defineSymbol(math, bin, "\u22bc", "\\barwedge");
defineSymbol(math, bin, "\u22bb", "\\veebar");
defineSymbol(math, bin, "\u2299", "\\odot", true);
// Firefox turns ⊕ into an emoji. So append \uFE0E. Define Unicode character in macros, not here.
defineSymbol(math, bin, "\u2295\uFE0E", "\\oplus");
defineSymbol(math, bin, "\u2297", "\\otimes", true);
defineSymbol(math, textord, "\u2202", "\\partial", true);
defineSymbol(math, bin, "\u2298", "\\oslash", true);
defineSymbol(math, bin, "\u229a", "\\circledcirc", true);
defineSymbol(math, bin, "\u22a1", "\\boxdot", true);
defineSymbol(math, bin, "\u25b3", "\\bigtriangleup");
defineSymbol(math, bin, "\u25bd", "\\bigtriangledown");
defineSymbol(math, bin, "\u2020", "\\dagger");
defineSymbol(math, bin, "\u22c4", "\\diamond");
defineSymbol(math, bin, "\u25c3", "\\triangleleft");
defineSymbol(math, bin, "\u25b9", "\\triangleright");
defineSymbol(math, temml_open, "{", "\\{");
defineSymbol(temml_text, textord, "{", "\\{");
defineSymbol(temml_text, textord, "{", "\\textbraceleft");
defineSymbol(math, temml_close, "}", "\\}");
defineSymbol(temml_text, textord, "}", "\\}");
defineSymbol(temml_text, textord, "}", "\\textbraceright");
defineSymbol(math, temml_open, "{", "\\lbrace");
defineSymbol(math, temml_close, "}", "\\rbrace");
defineSymbol(math, temml_open, "[", "\\lbrack", true);
defineSymbol(temml_text, textord, "[", "\\lbrack", true);
defineSymbol(math, temml_close, "]", "\\rbrack", true);
defineSymbol(temml_text, textord, "]", "\\rbrack", true);
defineSymbol(math, temml_open, "(", "\\lparen", true);
defineSymbol(math, temml_close, ")", "\\rparen", true);
defineSymbol(math, temml_open, "⦇", "\\llparenthesis", true);
defineSymbol(math, temml_close, "⦈", "\\rrparenthesis", true);
defineSymbol(temml_text, textord, "<", "\\textless", true); // in T1 fontenc
defineSymbol(temml_text, textord, ">", "\\textgreater", true); // in T1 fontenc
defineSymbol(math, temml_open, "\u230a", "\\lfloor", true);
defineSymbol(math, temml_close, "\u230b", "\\rfloor", true);
defineSymbol(math, temml_open, "\u2308", "\\lceil", true);
defineSymbol(math, temml_close, "\u2309", "\\rceil", true);
defineSymbol(math, textord, "\\", "\\backslash");
defineSymbol(math, textord, "|", "|");
defineSymbol(math, textord, "|", "\\vert");
defineSymbol(temml_text, textord, "|", "\\textbar", true); // in T1 fontenc
defineSymbol(math, textord, "\u2016", "\\|");
defineSymbol(math, textord, "\u2016", "\\Vert");
defineSymbol(temml_text, textord, "\u2016", "\\textbardbl");
defineSymbol(temml_text, textord, "~", "\\textasciitilde");
defineSymbol(temml_text, textord, "\\", "\\textbackslash");
defineSymbol(temml_text, textord, "^", "\\textasciicircum");
defineSymbol(math, rel, "\u2191", "\\uparrow", true);
defineSymbol(math, rel, "\u21d1", "\\Uparrow", true);
defineSymbol(math, rel, "\u2193", "\\downarrow", true);
defineSymbol(math, rel, "\u21d3", "\\Downarrow", true);
defineSymbol(math, rel, "\u2195", "\\updownarrow", true);
defineSymbol(math, rel, "\u21d5", "\\Updownarrow", true);
defineSymbol(math, op, "\u2210", "\\coprod");
defineSymbol(math, op, "\u22c1", "\\bigvee");
defineSymbol(math, op, "\u22c0", "\\bigwedge");
defineSymbol(math, op, "\u2a04", "\\biguplus");
defineSymbol(math, op, "\u2a04", "\\bigcupplus");
defineSymbol(math, op, "\u2a03", "\\bigcupdot");
defineSymbol(math, op, "\u2a07", "\\bigdoublevee");
defineSymbol(math, op, "\u2a08", "\\bigdoublewedge");
defineSymbol(math, op, "\u22c2", "\\bigcap");
defineSymbol(math, op, "\u22c3", "\\bigcup");
defineSymbol(math, op, "\u222b", "\\int");
defineSymbol(math, op, "\u222b", "\\intop");
defineSymbol(math, op, "\u222c", "\\iint");
defineSymbol(math, op, "\u222d", "\\iiint");
defineSymbol(math, op, "\u220f", "\\prod");
defineSymbol(math, op, "\u2211", "\\sum");
defineSymbol(math, op, "\u2a02", "\\bigotimes");
defineSymbol(math, op, "\u2a01", "\\bigoplus");
defineSymbol(math, op, "\u2a00", "\\bigodot");
defineSymbol(math, op, "\u2a09", "\\bigtimes");
defineSymbol(math, op, "\u222e", "\\oint");
defineSymbol(math, op, "\u222f", "\\oiint");
defineSymbol(math, op, "\u2230", "\\oiiint");
defineSymbol(math, op, "\u2231", "\\intclockwise");
defineSymbol(math, op, "\u2232", "\\varointclockwise");
defineSymbol(math, op, "\u2a0c", "\\iiiint");
defineSymbol(math, op, "\u2a0d", "\\intbar");
defineSymbol(math, op, "\u2a0e", "\\intBar");
defineSymbol(math, op, "\u2a0f", "\\fint");
defineSymbol(math, op, "\u2a12", "\\rppolint");
defineSymbol(math, op, "\u2a13", "\\scpolint");
defineSymbol(math, op, "\u2a15", "\\pointint");
defineSymbol(math, op, "\u2a16", "\\sqint");
defineSymbol(math, op, "\u2a17", "\\intlarhk");
defineSymbol(math, op, "\u2a18", "\\intx");
defineSymbol(math, op, "\u2a19", "\\intcap");
defineSymbol(math, op, "\u2a1a", "\\intcup");
defineSymbol(math, op, "\u2a05", "\\bigsqcap");
defineSymbol(math, op, "\u2a06", "\\bigsqcup");
defineSymbol(math, op, "\u222b", "\\smallint");
defineSymbol(temml_text, inner, "\u2026", "\\textellipsis");
defineSymbol(math, inner, "\u2026", "\\mathellipsis");
defineSymbol(temml_text, inner, "\u2026", "\\ldots", true);
defineSymbol(math, inner, "\u2026", "\\ldots", true);
defineSymbol(math, inner, "\u22f0", "\\iddots", true);
defineSymbol(math, inner, "\u22ef", "\\@cdots", true);
defineSymbol(math, inner, "\u22f1", "\\ddots", true);
defineSymbol(math, textord, "\u22ee", "\\varvdots"); // \vdots is a macro
defineSymbol(temml_text, textord, "\u22ee", "\\varvdots");
defineSymbol(math, accent, "\u02ca", "\\acute");
defineSymbol(math, accent, "\u0060", "\\grave");
defineSymbol(math, accent, "\u00a8", "\\ddot");
defineSymbol(math, accent, "\u2026", "\\dddot");
defineSymbol(math, accent, "\u2026\u002e", "\\ddddot");
defineSymbol(math, accent, "\u007e", "\\tilde");
defineSymbol(math, accent, "\u203e", "\\bar");
defineSymbol(math, accent, "\u02d8", "\\breve");
defineSymbol(math, accent, "\u02c7", "\\check");
defineSymbol(math, accent, "\u005e", "\\hat");
defineSymbol(math, accent, "\u2192", "\\vec");
defineSymbol(math, accent, "\u02d9", "\\dot");
defineSymbol(math, accent, "\u02da", "\\mathring");
defineSymbol(math, mathord, "\u0131", "\\imath", true);
defineSymbol(math, mathord, "\u0237", "\\jmath", true);
defineSymbol(math, textord, "\u0131", "\u0131");
defineSymbol(math, textord, "\u0237", "\u0237");
defineSymbol(temml_text, textord, "\u0131", "\\i", true);
defineSymbol(temml_text, textord, "\u0237", "\\j", true);
defineSymbol(temml_text, textord, "\u00df", "\\ss", true);
defineSymbol(temml_text, textord, "\u00e6", "\\ae", true);
defineSymbol(temml_text, textord, "\u0153", "\\oe", true);
defineSymbol(temml_text, textord, "\u00f8", "\\o", true);
defineSymbol(math, mathord, "\u00f8", "\\o", true);
defineSymbol(temml_text, textord, "\u00c6", "\\AE", true);
defineSymbol(temml_text, textord, "\u0152", "\\OE", true);
defineSymbol(temml_text, textord, "\u00d8", "\\O", true);
defineSymbol(math, mathord, "\u00d8", "\\O", true);
defineSymbol(temml_text, accent, "\u02ca", "\\'"); // acute
defineSymbol(temml_text, accent, "\u02cb", "\\`"); // grave
defineSymbol(temml_text, accent, "\u02c6", "\\^"); // circumflex
defineSymbol(temml_text, accent, "\u02dc", "\\~"); // tilde
defineSymbol(temml_text, accent, "\u02c9", "\\="); // macron
defineSymbol(temml_text, accent, "\u02d8", "\\u"); // breve
defineSymbol(temml_text, accent, "\u02d9", "\\."); // dot above
defineSymbol(temml_text, accent, "\u00b8", "\\c"); // cedilla
defineSymbol(temml_text, accent, "\u02da", "\\r"); // ring above
defineSymbol(temml_text, accent, "\u02c7", "\\v"); // caron
defineSymbol(temml_text, accent, "\u00a8", '\\"'); // diaresis
defineSymbol(temml_text, accent, "\u02dd", "\\H"); // double acute
defineSymbol(math, accent, "\u02ca", "\\'"); // acute
defineSymbol(math, accent, "\u02cb", "\\`"); // grave
defineSymbol(math, accent, "\u02c6", "\\^"); // circumflex
defineSymbol(math, accent, "\u02dc", "\\~"); // tilde
defineSymbol(math, accent, "\u02c9", "\\="); // macron
defineSymbol(math, accent, "\u02d8", "\\u"); // breve
defineSymbol(math, accent, "\u02d9", "\\."); // dot above
defineSymbol(math, accent, "\u00b8", "\\c"); // cedilla
defineSymbol(math, accent, "\u02da", "\\r"); // ring above
defineSymbol(math, accent, "\u02c7", "\\v"); // caron
defineSymbol(math, accent, "\u00a8", '\\"'); // diaresis
defineSymbol(math, accent, "\u02dd", "\\H"); // double acute
// These ligatures are detected and created in Parser.js's `formLigatures`.
const ligatures = {
"--": true,
"---": true,
"``": true,
"''": true
};
defineSymbol(temml_text, textord, "\u2013", "--", true);
defineSymbol(temml_text, textord, "\u2013", "\\textendash");
defineSymbol(temml_text, textord, "\u2014", "---", true);
defineSymbol(temml_text, textord, "\u2014", "\\textemdash");
defineSymbol(temml_text, textord, "\u2018", "`", true);
defineSymbol(temml_text, textord, "\u2018", "\\textquoteleft");
defineSymbol(temml_text, textord, "\u2019", "'", true);
defineSymbol(temml_text, textord, "\u2019", "\\textquoteright");
defineSymbol(temml_text, textord, "\u201c", "``", true);
defineSymbol(temml_text, textord, "\u201c", "\\textquotedblleft");
defineSymbol(temml_text, textord, "\u201d", "''", true);
defineSymbol(temml_text, textord, "\u201d", "\\textquotedblright");
// \degree from gensymb package
defineSymbol(math, textord, "\u00b0", "\\degree", true);
defineSymbol(temml_text, textord, "\u00b0", "\\degree");
// \textdegree from inputenc package
defineSymbol(temml_text, textord, "\u00b0", "\\textdegree", true);
// TODO: In LaTeX, \pounds can generate a different character in text and math
// mode, but among our fonts, only Main-Regular defines this character "163".
defineSymbol(math, textord, "\u00a3", "\\pounds");
defineSymbol(math, textord, "\u00a3", "\\mathsterling", true);
defineSymbol(temml_text, textord, "\u00a3", "\\pounds");
defineSymbol(temml_text, textord, "\u00a3", "\\textsterling", true);
defineSymbol(math, textord, "\u2720", "\\maltese");
defineSymbol(temml_text, textord, "\u2720", "\\maltese");
defineSymbol(math, textord, "\u20ac", "\\euro", true);
defineSymbol(temml_text, textord, "\u20ac", "\\euro", true);
defineSymbol(temml_text, textord, "\u20ac", "\\texteuro");
defineSymbol(math, textord, "\u00a9", "\\copyright", true);
defineSymbol(temml_text, textord, "\u00a9", "\\textcopyright");
defineSymbol(math, textord, "\u2300", "\\diameter", true);
defineSymbol(temml_text, textord, "\u2300", "\\diameter");
// Italic Greek
defineSymbol(math, textord, "𝛤", "\\varGamma");
defineSymbol(math, textord, "𝛥", "\\varDelta");
defineSymbol(math, textord, "𝛩", "\\varTheta");
defineSymbol(math, textord, "𝛬", "\\varLambda");
defineSymbol(math, textord, "𝛯", "\\varXi");
defineSymbol(math, textord, "𝛱", "\\varPi");
defineSymbol(math, textord, "𝛴", "\\varSigma");
defineSymbol(math, textord, "𝛶", "\\varUpsilon");
defineSymbol(math, textord, "𝛷", "\\varPhi");
defineSymbol(math, textord, "𝛹", "\\varPsi");
defineSymbol(math, textord, "𝛺", "\\varOmega");
defineSymbol(temml_text, textord, "𝛤", "\\varGamma");
defineSymbol(temml_text, textord, "𝛥", "\\varDelta");
defineSymbol(temml_text, textord, "𝛩", "\\varTheta");
defineSymbol(temml_text, textord, "𝛬", "\\varLambda");
defineSymbol(temml_text, textord, "𝛯", "\\varXi");
defineSymbol(temml_text, textord, "𝛱", "\\varPi");
defineSymbol(temml_text, textord, "𝛴", "\\varSigma");
defineSymbol(temml_text, textord, "𝛶", "\\varUpsilon");
defineSymbol(temml_text, textord, "𝛷", "\\varPhi");
defineSymbol(temml_text, textord, "𝛹", "\\varPsi");
defineSymbol(temml_text, textord, "𝛺", "\\varOmega");
// There are lots of symbols which are the same, so we add them in afterwards.
// All of these are textords in math mode
const mathTextSymbols = '0123456789/@."';
for (let i = 0; i < mathTextSymbols.length; i++) {
const ch = mathTextSymbols.charAt(i);
defineSymbol(math, textord, ch, ch);
}
// All of these are textords in text mode
const textSymbols = '0123456789!@*()-=+";:?/.,';
for (let i = 0; i < textSymbols.length; i++) {
const ch = textSymbols.charAt(i);
defineSymbol(temml_text, textord, ch, ch);
}
// All of these are textords in text mode, and mathords in math mode
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (let i = 0; i < letters.length; i++) {
const ch = letters.charAt(i);
defineSymbol(math, mathord, ch, ch);
defineSymbol(temml_text, textord, ch, ch);
}
// Some more letters in Unicode Basic Multilingual Plane.
const narrow = "ÇÐÞçþℂℍℕℙℚℝℤℎℏℊℋℌℐℑℒℓ℘ℛℜℬℰℱℳℭℨ";
for (let i = 0; i < narrow.length; i++) {
const ch = narrow.charAt(i);
defineSymbol(math, mathord, ch, ch);
defineSymbol(temml_text, textord, ch, ch);
}
// The next loop loads wide (surrogate pair) characters.
// We support some letters in the Unicode range U+1D400 to U+1D7FF,
// Mathematical Alphanumeric Symbols.
let wideChar = "";
for (let i = 0; i < letters.length; i++) {
// The hex numbers in the next line are a surrogate pair.
// 0xD835 is the high surrogate for all letters in the range we support.
// 0xDC00 is the low surrogate for bold A.
wideChar = String.fromCharCode(0xd835, 0xdc00 + i); // A-Z a-z bold
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
wideChar = String.fromCharCode(0xd835, 0xdc34 + i); // A-Z a-z italic
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
wideChar = String.fromCharCode(0xd835, 0xdc68 + i); // A-Z a-z bold italic
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
wideChar = String.fromCharCode(0xd835, 0xdd04 + i); // A-Z a-z Fractur
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
wideChar = String.fromCharCode(0xd835, 0xdda0 + i); // A-Z a-z sans-serif
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
wideChar = String.fromCharCode(0xd835, 0xddd4 + i); // A-Z a-z sans bold
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
wideChar = String.fromCharCode(0xd835, 0xde08 + i); // A-Z a-z sans italic
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
wideChar = String.fromCharCode(0xd835, 0xde70 + i); // A-Z a-z monospace
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
wideChar = String.fromCharCode(0xd835, 0xdd38 + i); // A-Z a-z double struck
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
const ch = letters.charAt(i);
wideChar = String.fromCharCode(0xd835, 0xdc9c + i); // A-Z a-z calligraphic
defineSymbol(math, mathord, ch, wideChar);
defineSymbol(temml_text, textord, ch, wideChar);
}
// Next, some wide character numerals
for (let i = 0; i < 10; i++) {
wideChar = String.fromCharCode(0xd835, 0xdfce + i); // 0-9 bold
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
wideChar = String.fromCharCode(0xd835, 0xdfe2 + i); // 0-9 sans serif
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
wideChar = String.fromCharCode(0xd835, 0xdfec + i); // 0-9 bold sans
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
wideChar = String.fromCharCode(0xd835, 0xdff6 + i); // 0-9 monospace
defineSymbol(math, mathord, wideChar, wideChar);
defineSymbol(temml_text, textord, wideChar, wideChar);
}
/*
* Neither Firefox nor Chrome support hard line breaks or soft line breaks.
* (Despite https://www.w3.org/Math/draft-spec/mathml.html#chapter3_presm.lbattrs)
* So Temml has work-arounds for both hard and soft breaks.
* The work-arounds sadly do not work simultaneously. Any top-level hard
* break makes soft line breaks impossible.
*
* Hard breaks are simulated by creating a <mtable> and putting each line in its own <mtr>.
*
* To create soft line breaks, Temml avoids using the <semantics> and <annotation> tags.
* Then the top level of a <math> element can be occupied by <mrow> elements, and the browser
* will break after a <mrow> if the expression extends beyond the container limit.
*
* The default is for soft line breaks after each top-level binary or
* relational operator, per TeXbook p. 173. So we gather the expression into <mrow>s so that
* each <mrow> ends in a binary or relational operator.
*
* An option is for soft line breaks before an "=" sign. That changes the <mrow>s.
*
* Soft line breaks will not work in Chromium and Safari, only Firefox.
*
* Hopefully browsers will someday do their own linebreaking and we will be able to delete
* much of this module.
*/
const openDelims = "([{⌊⌈⟨⟮⎰⟦⦃";
const closeDelims = ")]}⌋⌉⟩⟯⎱⟦⦄";
function setLineBreaks(expression, wrapMode, isDisplayMode) {
const mtrs = [];
let mrows = [];
let block = [];
let numTopLevelEquals = 0;
let i = 0;
let level = 0;
while (i < expression.length) {
while (expression[i] instanceof DocumentFragment) {
expression.splice(i, 1, ...expression[i].children); // Expand the fragment.
}
const node = expression[i];
if (node.attributes && node.attributes.linebreak &&
node.attributes.linebreak === "newline") {
// A hard line break. Create a <mtr> for the current block.
if (block.length > 0) {
mrows.push(new mathMLTree.MathNode("mrow", block));
}
mrows.push(node);
block = [];
const mtd = new mathMLTree.MathNode("mtd", mrows);
mtd.style.textAlign = "left";
mtrs.push(new mathMLTree.MathNode("mtr", [mtd]));
mrows = [];
i += 1;
continue
}
block.push(node);
if (node.type && node.type === "mo" && node.children.length === 1 &&
!Object.hasOwn(node.attributes, "movablelimits")) {
const ch = node.children[0].text;
if (openDelims.indexOf(ch) > -1) {
level += 1;
} else if (closeDelims.indexOf(ch) > -1) {
level -= 1;
} else if (level === 0 && wrapMode === "=" && ch === "=") {
numTopLevelEquals += 1;
if (numTopLevelEquals > 1) {
block.pop();
// Start a new block. (Insert a soft linebreak.)
const element = new mathMLTree.MathNode("mrow", block);
mrows.push(element);
block = [node];
}
} else if (level === 0 && wrapMode === "tex" && ch !== "∇") {
// Check if the following node is a \nobreak text node, e.g. "~""
const next = i < expression.length - 1 ? expression[i + 1] : null;
let glueIsFreeOfNobreak = true;
if (
!(
next &&
next.type === "mtext" &&
next.attributes.linebreak &&
next.attributes.linebreak === "nobreak"
)
) {
// We may need to start a new block.
// First, put any post-operator glue on same line as operator.
for (let j = i + 1; j < expression.length; j++) {
const nd = expression[j];
if (
nd.type &&
nd.type === "mspace" &&
!(nd.attributes.linebreak && nd.attributes.linebreak === "newline")
) {
block.push(nd);
i += 1;
if (
nd.attributes &&
nd.attributes.linebreak &&
nd.attributes.linebreak === "nobreak"
) {
glueIsFreeOfNobreak = false;
}
} else {
break;
}
}
}
if (glueIsFreeOfNobreak) {
// Start a new block. (Insert a soft linebreak.)
const element = new mathMLTree.MathNode("mrow", block);
mrows.push(element);
block = [];
}
}
}
i += 1;
}
if (block.length > 0) {
const element = new mathMLTree.MathNode("mrow", block);
mrows.push(element);
}
if (mtrs.length > 0) {
const mtd = new mathMLTree.MathNode("mtd", mrows);
mtd.style.textAlign = "left";
const mtr = new mathMLTree.MathNode("mtr", [mtd]);
mtrs.push(mtr);
const mtable = new mathMLTree.MathNode("mtable", mtrs);
if (!isDisplayMode) {
mtable.setAttribute("columnalign", "left");
mtable.setAttribute("rowspacing", "0em");
}
return mtable
}
return mathMLTree.newDocumentFragment(mrows);
}
/**
* This file converts a parse tree into a corresponding MathML tree. The main
* entry point is the `buildMathML` function, which takes a parse tree from the
* parser.
*/
/**
* Takes a symbol and converts it into a MathML text node after performing
* optional replacement from symbols.js.
*/
const makeText = function(text, mode, style) {
if (
symbols[mode][text] &&
symbols[mode][text].replace &&
text.charCodeAt(0) !== 0xd835 &&
!(
Object.prototype.hasOwnProperty.call(ligatures, text) &&
style &&
((style.fontFamily && style.fontFamily.slice(4, 6) === "tt") ||
(style.font && style.font.slice(4, 6) === "tt"))
)
) {
text = symbols[mode][text].replace;
}
return new mathMLTree.TextNode(text);
};
const copyChar = (newRow, child) => {
if (newRow.children.length === 0 ||
newRow.children[newRow.children.length - 1].type !== "mtext") {
const mtext = new mathMLTree.MathNode(
"mtext",
[new mathMLTree.TextNode(child.children[0].text)]
);
newRow.children.push(mtext);
} else {
newRow.children[newRow.children.length - 1].children[0].text += child.children[0].text;
}
};
const consolidateText = mrow => {
// If possible, consolidate adjacent <mtext> elements into a single element.
if (mrow.type !== "mrow" && mrow.type !== "mstyle") { return mrow }
if (mrow.children.length === 0) { return mrow } // empty group, e.g., \text{}
const newRow = new mathMLTree.MathNode("mrow");
for (let i = 0; i < mrow.children.length; i++) {
const child = mrow.children[i];
if (child.type === "mtext" && Object.keys(child.attributes).length === 0) {
copyChar(newRow, child);
} else if (child.type === "mrow") {
// We'll also check the children of an mrow. One level only. No recursion.
let canConsolidate = true;
for (let j = 0; j < child.children.length; j++) {
const grandChild = child.children[j];
if (grandChild.type !== "mtext" || Object.keys(child.attributes).length !== 0) {
canConsolidate = false;
break
}
}
if (canConsolidate) {
for (let j = 0; j < child.children.length; j++) {
const grandChild = child.children[j];
copyChar(newRow, grandChild);
}
} else {
newRow.children.push(child);
}
} else {
newRow.children.push(child);
}
}
for (let i = 0; i < newRow.children.length; i++) {
if (newRow.children[i].type === "mtext") {
const mtext = newRow.children[i];
// Firefox does not render a space at either end of an <mtext> string.
// To get proper rendering, we replace leading or trailing spaces with no-break spaces.
if (mtext.children[0].text.charAt(0) === " ") {
mtext.children[0].text = "\u00a0" + mtext.children[0].text.slice(1);
}
const L = mtext.children[0].text.length;
if (L > 0 && mtext.children[0].text.charAt(L - 1) === " ") {
mtext.children[0].text = mtext.children[0].text.slice(0, -1) + "\u00a0";
}
for (const [key, value] of Object.entries(mrow.attributes)) {
mtext.attributes[key] = value;
}
}
}
if (newRow.children.length === 1 && newRow.children[0].type === "mtext") {
return newRow.children[0]; // A consolidated <mtext>
} else {
return newRow
}
};
/**
* Wrap the given array of nodes in an <mrow> node if needed, i.e.,
* unless the array has length 1. Always returns a single node.
*/
const makeRow = function(body, semisimple = false) {
if (body.length === 1 && !(body[0] instanceof DocumentFragment)) {
return body[0];
} else if (!semisimple) {
// Suppress spacing on <mo> nodes at both ends of the row.
if (body[0] instanceof MathNode && body[0].type === "mo" && !body[0].attributes.fence) {
body[0].attributes.lspace = "0em";
body[0].attributes.rspace = "0em";
}
const end = body.length - 1;
if (body[end] instanceof MathNode && body[end].type === "mo" && !body[end].attributes.fence) {
body[end].attributes.lspace = "0em";
body[end].attributes.rspace = "0em";
}
}
return new mathMLTree.MathNode("mrow", body);
};
/**
* Check for <mi>.</mi> which is how a dot renders in MathML,
* or <mo separator="true" lspace="0em" rspace="0em">,</mo>
* which is how a braced comma {,} renders in MathML
*/
function isNumberPunctuation(group) {
if (!group) {
return false
}
if (group.type === 'mi' && group.children.length === 1) {
const child = group.children[0];
return child instanceof TextNode && child.text === '.'
} else if (group.type === "mtext" && group.children.length === 1) {
const child = group.children[0];
return child instanceof TextNode && child.text === '\u2008' // punctuation space
} else if (group.type === 'mo' && group.children.length === 1 &&
group.getAttribute('separator') === 'true' &&
group.getAttribute('lspace') === '0em' &&
group.getAttribute('rspace') === '0em') {
const child = group.children[0];
return child instanceof TextNode && child.text === ','
} else {
return false
}
}
const isComma = (expression, i) => {
const node = expression[i];
const followingNode = expression[i + 1];
return (node.type === "atom" && node.text === ",") &&
// Don't consolidate if there is a space after the comma.
node.loc && followingNode.loc && node.loc.end === followingNode.loc.start
};
const isRel = item => {
return (item.type === "atom" && item.family === "rel") ||
(item.type === "mclass" && item.mclass === "mrel")
};
/**
* Takes a list of nodes, builds them, and returns a list of the generated
* MathML nodes. Also do a couple chores along the way:
* (1) Suppress spacing when an author wraps an operator w/braces, as in {=}.
* (2) Suppress spacing between two adjacent relations.
*/
const buildExpression = function(expression, style, semisimple = false) {
if (!semisimple && expression.length === 1) {
const group = buildGroup$1(expression[0], style);
if (group instanceof MathNode && group.type === "mo") {
// When TeX writers want to suppress spacing on an operator,
// they often put the operator by itself inside braces.
group.setAttribute("lspace", "0em");
group.setAttribute("rspace", "0em");
}
return [group];
}
const groups = [];
const groupArray = [];
let lastGroup;
for (let i = 0; i < expression.length; i++) {
groupArray.push(buildGroup$1(expression[i], style));
}
for (let i = 0; i < groupArray.length; i++) {
const group = groupArray[i];
// Suppress spacing between adjacent relations
if (i < expression.length - 1 && isRel(expression[i]) && isRel(expression[i + 1])) {
group.setAttribute("rspace", "0em");
}
if (i > 0 && isRel(expression[i]) && isRel(expression[i - 1])) {
group.setAttribute("lspace", "0em");
}
// Concatenate numbers
if (group.type === 'mn' && lastGroup && lastGroup.type === 'mn') {
// Concatenate <mn>...</mn> followed by <mi>.</mi>
lastGroup.children.push(...group.children);
continue
} else if (isNumberPunctuation(group) && lastGroup && lastGroup.type === 'mn') {
// Concatenate <mn>...</mn> followed by <mi>.</mi>
lastGroup.children.push(...group.children);
continue
} else if (lastGroup && lastGroup.type === "mn" && i < groupArray.length - 1 &&
groupArray[i + 1].type === "mn" && isComma(expression, i)) {
lastGroup.children.push(...group.children);
continue
} else if (group.type === 'mn' && isNumberPunctuation(lastGroup)) {
// Concatenate <mi>.</mi> followed by <mn>...</mn>
group.children = [...lastGroup.children, ...group.children];
groups.pop();
} else if ((group.type === 'msup' || group.type === 'msub') &&
group.children.length >= 1 && lastGroup &&
(lastGroup.type === 'mn' || isNumberPunctuation(lastGroup))) {
// Put preceding <mn>...</mn> or <mi>.</mi> inside base of
// <msup><mn>...base...</mn>...exponent...</msup> (or <msub>)
const base = group.children[0];
if (base instanceof MathNode && base.type === 'mn' && lastGroup) {
base.children = [...lastGroup.children, ...base.children];
groups.pop();
}
}
groups.push(group);
lastGroup = group;
}
return groups
};
/**
* Equivalent to buildExpression, but wraps the elements in an <mrow>
* if there's more than one. Returns a single node instead of an array.
*/
const buildExpressionRow = function(expression, style, semisimple = false) {
return makeRow(buildExpression(expression, style, semisimple), semisimple);
};
/**
* Takes a group from the parser and calls the appropriate groupBuilders function
* on it to produce a MathML node.
*/
const buildGroup$1 = function(group, style) {
if (!group) {
return new mathMLTree.MathNode("mrow");
}
if (_mathmlGroupBuilders[group.type]) {
// Call the groupBuilders function
const result = _mathmlGroupBuilders[group.type](group, style);
return result;
} else {
throw new ParseError("Got group of unknown type: '" + group.type + "'");
}
};
const glue$1 = _ => {
return new mathMLTree.MathNode("mtd", [], [], { padding: "0", width: "50%" })
};
const labelContainers = ["mrow", "mtd", "mtable", "mtr"];
const getLabel = parent => {
for (const node of parent.children) {
if (node.type && labelContainers.includes(node.type)) {
if (node.classes && node.classes[0] === "tml-label") {
const label = node.label;
return label
} else {
const label = getLabel(node);
if (label) { return label }
}
} else if (!node.type) {
const label = getLabel(node);
if (label) { return label }
}
}
};
const taggedExpression = (expression, tag, style, leqno) => {
tag = buildExpressionRow(tag[0].body, style);
tag = consolidateText(tag);
tag.classes.push("tml-tag");
const label = getLabel(expression); // from a \label{} function.
expression = new mathMLTree.MathNode("mtd", [expression]);
const rowArray = [glue$1(), expression, glue$1()];
rowArray[leqno ? 0 : 2].classes.push(leqno ? "tml-left" : "tml-right");
rowArray[leqno ? 0 : 2].children.push(tag);
const mtr = new mathMLTree.MathNode("mtr", rowArray, ["tml-tageqn"]);
if (label) { mtr.setAttribute("id", label); }
const table = new mathMLTree.MathNode("mtable", [mtr]);
table.style.width = "100%";
table.setAttribute("displaystyle", "true");
return table
};
/**
* Takes a full parse tree and settings and builds a MathML representation of
* it.
*/
function buildMathML(tree, texExpression, style, settings) {
// Strip off outer tag wrapper for processing below.
let tag = null;
if (tree.length === 1 && tree[0].type === "tag") {
tag = tree[0].tag;
tree = tree[0].body;
}
const expression = buildExpression(tree, style);
if (expression.length === 1 && expression[0] instanceof AnchorNode) {
return expression[0]
}
const wrap = (settings.displayMode || settings.annotate) ? "none" : settings.wrap;
const n1 = expression.length === 0 ? null : expression[0];
let wrapper = expression.length === 1 && tag === null && (n1 instanceof MathNode)
? expression[0]
: setLineBreaks(expression, wrap, settings.displayMode);
if (tag) {
wrapper = taggedExpression(wrapper, tag, style, settings.leqno);
}
if (settings.annotate) {
// Build a TeX annotation of the source
const annotation = new mathMLTree.MathNode(
"annotation", [new mathMLTree.TextNode(texExpression)]);
annotation.setAttribute("encoding", "application/x-tex");
wrapper = new mathMLTree.MathNode("semantics", [wrapper, annotation]);
}
const math = new mathMLTree.MathNode("math", [wrapper]);
if (settings.xml) {
math.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML");
}
if (wrapper.style.width) {
math.style.width = "100%";
}
if (settings.displayMode) {
math.setAttribute("display", "block");
math.style.display = "block math"; // necessary in Chromium.
// Firefox and Safari do not recognize display: "block math".
// Set a class so that the CSS file can set display: block.
math.classes = ["tml-display"];
}
return math;
}
const smalls = "acegıȷmnopqrsuvwxyzαγεηικμνοπρςστυχωϕ𝐚𝐜𝐞𝐠𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐮𝐯𝐰𝐱𝐲𝐳";
const talls = "ABCDEFGHIJKLMNOPQRSTUVWXYZbdfhkltΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩβδλζφθψ"
+ "𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙𝐛𝐝𝐟𝐡𝐤𝐥𝐭";
const longSmalls = new Set(["\\alpha", "\\gamma", "\\delta", "\\epsilon", "\\eta", "\\iota",
"\\kappa", "\\mu", "\\nu", "\\pi", "\\rho", "\\sigma", "\\tau", "\\upsilon", "\\chi", "\\psi",
"\\omega", "\\imath", "\\jmath"]);
const longTalls = new Set(["\\Gamma", "\\Delta", "\\Sigma", "\\Omega", "\\beta", "\\delta",
"\\lambda", "\\theta", "\\psi"]);
const mathmlBuilder$a = (group, style) => {
const accentNode = group.isStretchy
? stretchy.accentNode(group)
: new mathMLTree.MathNode("mo", [makeText(group.label, group.mode)]);
if (group.label === "\\vec") {
accentNode.style.transform = "scale(0.75) translate(10%, 30%)";
} else {
accentNode.style.mathStyle = "normal";
accentNode.style.mathDepth = "0";
if (needWebkitShift.has(group.label) && utils.isCharacterBox(group.base)) {
let shift = "";
const ch = group.base.text;
if (smalls.indexOf(ch) > -1 || longSmalls.has(ch)) { shift = "tml-xshift"; }
if (talls.indexOf(ch) > -1 || longTalls.has(ch)) { shift = "tml-capshift"; }
if (shift) { accentNode.classes.push(shift); }
}
}
if (!group.isStretchy) {
accentNode.setAttribute("stretchy", "false");
}
const node = new mathMLTree.MathNode((group.label === "\\c" ? "munder" : "mover"),
[buildGroup$1(group.base, style), accentNode]
);
return node;
};
const nonStretchyAccents = new Set([
"\\acute",
"\\grave",
"\\ddot",
"\\dddot",
"\\ddddot",
"\\tilde",
"\\bar",
"\\breve",
"\\check",
"\\hat",
"\\vec",
"\\dot",
"\\mathring"
]);
const needWebkitShift = new Set([
"\\acute",
"\\bar",
"\\breve",
"\\check",
"\\dot",
"\\ddot",
"\\grave",
"\\hat",
"\\mathring",
"\\'", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\r", "\\H", "\\v"
]);
const combiningChar = {
"\\`": "\u0300",
"\\'": "\u0301",
"\\^": "\u0302",
"\\~": "\u0303",
"\\=": "\u0304",
"\\u": "\u0306",
"\\.": "\u0307",
'\\"': "\u0308",
"\\r": "\u030A",
"\\H": "\u030B",
"\\v": "\u030C"
};
// Accents
defineFunction({
type: "accent",
names: [
"\\acute",
"\\grave",
"\\ddot",
"\\dddot",
"\\ddddot",
"\\tilde",
"\\bar",
"\\breve",
"\\check",
"\\hat",
"\\vec",
"\\dot",
"\\mathring",
"\\overparen",
"\\widecheck",
"\\widehat",
"\\wideparen",
"\\widetilde",
"\\overrightarrow",
"\\overleftarrow",
"\\Overrightarrow",
"\\overleftrightarrow",
"\\overgroup",
"\\overleftharpoon",
"\\overrightharpoon"
],
props: {
numArgs: 1
},
handler: (context, args) => {
const base = normalizeArgument(args[0]);
const isStretchy = !nonStretchyAccents.has(context.funcName);
return {
type: "accent",
mode: context.parser.mode,
label: context.funcName,
isStretchy: isStretchy,
base: base
};
},
mathmlBuilder: mathmlBuilder$a
});
// Text-mode accents
defineFunction({
type: "accent",
names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\c", "\\u", "\\.", '\\"', "\\r", "\\H", "\\v"],
props: {
numArgs: 1,
allowedInText: true,
allowedInMath: true,
argTypes: ["primitive"]
},
handler: (context, args) => {
const base = normalizeArgument(args[0]);
const mode = context.parser.mode;
if (mode === "math" && context.parser.settings.strict) {
// LaTeX only writes a warning. It doesn't stop. We'll issue the same warning.
// eslint-disable-next-line no-console
console.log(`Temml parse error: Command ${context.funcName} is invalid in math mode.`);
}
if (mode === "text" && base.text && base.text.length === 1
&& context.funcName in combiningChar && smalls.indexOf(base.text) > -1) {
// Return a combining accent character
return {
type: "textord",
mode: "text",
text: base.text + combiningChar[context.funcName]
}
} else {
// Build up the accent
return {
type: "accent",
mode: mode,
label: context.funcName,
isStretchy: false,
base: base
}
}
},
mathmlBuilder: mathmlBuilder$a
});
defineFunction({
type: "accentUnder",
names: [
"\\underleftarrow",
"\\underrightarrow",
"\\underleftrightarrow",
"\\undergroup",
"\\underparen",
"\\utilde"
],
props: {
numArgs: 1
},
handler: ({ parser, funcName }, args) => {
const base = args[0];
return {
type: "accentUnder",
mode: parser.mode,
label: funcName,
base: base
};
},
mathmlBuilder: (group, style) => {
const accentNode = stretchy.accentNode(group);
accentNode.style["math-depth"] = 0;
const node = new mathMLTree.MathNode("munder", [
buildGroup$1(group.base, style),
accentNode
]);
return node;
}
});
/**
* This file does conversion between units. In particular, it provides
* calculateSize to convert other units into CSS units.
*/
const ptPerUnit = {
// Convert to CSS (Postscipt) points, not TeX points
// https://en.wikibooks.org/wiki/LaTeX/Lengths and
// https://tex.stackexchange.com/a/8263
pt: 800 / 803, // convert TeX point to CSS (Postscript) point
pc: (12 * 800) / 803, // pica
dd: ((1238 / 1157) * 800) / 803, // didot
cc: ((14856 / 1157) * 800) / 803, // cicero (12 didot)
nd: ((685 / 642) * 800) / 803, // new didot
nc: ((1370 / 107) * 800) / 803, // new cicero (12 new didot)
sp: ((1 / 65536) * 800) / 803, // scaled point (TeX's internal smallest unit)
mm: (25.4 / 72),
cm: (2.54 / 72),
in: (1 / 72),
px: (96 / 72)
};
/**
* Determine whether the specified unit (either a string defining the unit
* or a "size" parse node containing a unit field) is valid.
*/
const validUnits = [
"em",
"ex",
"mu",
"pt",
"mm",
"cm",
"in",
"px",
"bp",
"pc",
"dd",
"cc",
"nd",
"nc",
"sp"
];
const validUnit = function(unit) {
if (typeof unit !== "string") {
unit = unit.unit;
}
return validUnits.indexOf(unit) > -1
};
const emScale = styleLevel => {
const scriptLevel = Math.max(styleLevel - 1, 0);
return [1, 0.7, 0.5][scriptLevel]
};
/*
* Convert a "size" parse node (with numeric "number" and string "unit" fields,
* as parsed by functions.js argType "size") into a CSS value.
*/
const calculateSize = function(sizeValue, style) {
let number = sizeValue.number;
if (style.maxSize[0] < 0 && number > 0) {
return { number: 0, unit: "em" }
}
const unit = sizeValue.unit;
switch (unit) {
case "mm":
case "cm":
case "in":
case "px": {
const numInCssPts = number * ptPerUnit[unit];
if (numInCssPts > style.maxSize[1]) {
return { number: style.maxSize[1], unit: "pt" }
}
return { number, unit }; // absolute CSS units.
}
case "em":
case "ex": {
// In TeX, em and ex do not change size in \scriptstyle.
if (unit === "ex") { number *= 0.431; }
number = Math.min(number / emScale(style.level), style.maxSize[0]);
return { number: utils.round(number), unit: "em" };
}
case "bp": {
if (number > style.maxSize[1]) { number = style.maxSize[1]; }
return { number, unit: "pt" }; // TeX bp is a CSS pt. (1/72 inch).
}
case "pt":
case "pc":
case "dd":
case "cc":
case "nd":
case "nc":
case "sp": {
number = Math.min(number * ptPerUnit[unit], style.maxSize[1]);
return { number: utils.round(number), unit: "pt" }
}
case "mu": {
number = Math.min(number / 18, style.maxSize[0]);
return { number: utils.round(number), unit: "em" }
}
default:
throw new ParseError("Invalid unit: '" + unit + "'")
}
};
// Helper functions
const padding$2 = width => {
const node = new mathMLTree.MathNode("mspace");
node.setAttribute("width", width + "em");
return node
};
const paddedNode = (group, lspace = 0.3, rspace = 0, mustSmash = false) => {
if (group == null && rspace === 0) { return padding$2(lspace) }
const row = group ? [group] : [];
if (lspace !== 0) { row.unshift(padding$2(lspace)); }
if (rspace > 0) { row.push(padding$2(rspace)); }
if (mustSmash) {
// Used for the bottom arrow in a {CD} environment
const mpadded = new mathMLTree.MathNode("mpadded", row);
mpadded.setAttribute("height", "0");
return mpadded
} else {
return new mathMLTree.MathNode("mrow", row)
}
};
const labelSize = (size, scriptLevel) => Number(size) / emScale(scriptLevel);
const munderoverNode = (fName, body, below, style) => {
const arrowNode = stretchy.mathMLnode(fName);
// Is this the short part of a mhchem equilibrium arrow?
const isEq = fName.slice(1, 3) === "eq";
const minWidth = fName.charAt(1) === "x"
? "1.75" // mathtools extensible arrows are ≥ 1.75em long
: fName.slice(2, 4) === "cd"
? "3.0" // cd package arrows
: isEq
? "1.0" // The shorter harpoon of a mhchem equilibrium arrow
: "2.0"; // other mhchem arrows
// TODO: When Firefox supports minsize, use the next line.
//arrowNode.setAttribute("minsize", String(minWidth) + "em")
arrowNode.setAttribute("lspace", "0");
arrowNode.setAttribute("rspace", (isEq ? "0.5em" : "0"));
// <munderover> upper and lower labels are set to scriptlevel by MathML
// So we have to adjust our label dimensions accordingly.
const labelStyle = style.withLevel(style.level < 2 ? 2 : 3);
const minArrowWidth = labelSize(minWidth, labelStyle.level);
// The dummyNode will be inside a <mover> inside a <mover>
// So it will be at scriptlevel 3
const dummyWidth = labelSize(minWidth, 3);
const emptyLabel = paddedNode(null, minArrowWidth.toFixed(4), 0);
const dummyNode = paddedNode(null, dummyWidth.toFixed(4), 0);
// The arrow is a little longer than the label. Set a spacer length.
const space = labelSize((isEq ? 0 : 0.3), labelStyle.level).toFixed(4);
let upperNode;
let lowerNode;
const gotUpper = (body && body.body &&
// \hphantom visible content
(body.body.body || body.body.length > 0));
if (gotUpper) {
let label = buildGroup$1(body, labelStyle);
const mustSmash = (fName === "\\\\cdrightarrow" || fName === "\\\\cdleftarrow");
label = paddedNode(label, space, space, mustSmash);
// Since Firefox does not support minsize, stack a invisible node
// on top of the label. Its width will serve as a min-width.
// TODO: Refactor this after Firefox supports minsize.
upperNode = new mathMLTree.MathNode("mover", [label, dummyNode]);
}
const gotLower = (below && below.body &&
(below.body.body || below.body.length > 0));
if (gotLower) {
let label = buildGroup$1(below, labelStyle);
label = paddedNode(label, space, space);
lowerNode = new mathMLTree.MathNode("munder", [label, dummyNode]);
}
let node;
if (!gotUpper && !gotLower) {
node = new mathMLTree.MathNode("mover", [arrowNode, emptyLabel]);
} else if (gotUpper && gotLower) {
node = new mathMLTree.MathNode("munderover", [arrowNode, lowerNode, upperNode]);
} else if (gotUpper) {
node = new mathMLTree.MathNode("mover", [arrowNode, upperNode]);
} else {
node = new mathMLTree.MathNode("munder", [arrowNode, lowerNode]);
}
if (minWidth === "3.0") { node.style.height = "1em"; } // CD environment
node.setAttribute("accent", "false"); // Necessary for MS Word
return node
};
// Stretchy arrows with an optional argument
defineFunction({
type: "xArrow",
names: [
"\\xleftarrow",
"\\xrightarrow",
"\\xLeftarrow",
"\\xRightarrow",
"\\xleftrightarrow",
"\\xLeftrightarrow",
"\\xhookleftarrow",
"\\xhookrightarrow",
"\\xmapsto",
"\\xrightharpoondown",
"\\xrightharpoonup",
"\\xleftharpoondown",
"\\xleftharpoonup",
"\\xlongequal",
"\\xtwoheadrightarrow",
"\\xtwoheadleftarrow",
// The next 5 functions are here only to support mhchem
"\\yields",
"\\yieldsLeft",
"\\mesomerism",
"\\longrightharpoonup",
"\\longleftharpoondown",
// The next 3 functions are here only to support the {CD} environment.
"\\\\cdrightarrow",
"\\\\cdleftarrow",
"\\\\cdlongequal"
],
props: {
numArgs: 1,
numOptionalArgs: 1
},
handler({ parser, funcName }, args, optArgs) {
return {
type: "xArrow",
mode: parser.mode,
name: funcName,
body: args[0],
below: optArgs[0]
};
},
mathmlBuilder(group, style) {
// Build the arrow and its labels.
const node = munderoverNode(group.name, group.body, group.below, style);
// Create operator spacing for a relation.
const row = [node];
row.unshift(padding$2(0.2778));
row.push(padding$2(0.2778));
return new mathMLTree.MathNode("mrow", row)
}
});
const arrowComponent = {
"\\xtofrom": ["\\xrightarrow", "\\xleftarrow"],
"\\xleftrightharpoons": ["\\xleftharpoonup", "\\xrightharpoondown"],
"\\xrightleftharpoons": ["\\xrightharpoonup", "\\xleftharpoondown"],
"\\yieldsLeftRight": ["\\yields", "\\yieldsLeft"],
// The next three all get the same harpoon glyphs. Only the lengths and paddings differ.
"\\equilibrium": ["\\longrightharpoonup", "\\longleftharpoondown"],
"\\equilibriumRight": ["\\longrightharpoonup", "\\eqleftharpoondown"],
"\\equilibriumLeft": ["\\eqrightharpoonup", "\\longleftharpoondown"]
};
// Browsers are not good at stretching a glyph that contains a pair of stacked arrows such as ⇄.
// So we stack a pair of single arrows.
defineFunction({
type: "stackedArrow",
names: [
"\\xtofrom", // expfeil
"\\xleftrightharpoons", // mathtools
"\\xrightleftharpoons", // mathtools
"\\yieldsLeftRight", // mhchem
"\\equilibrium", // mhchem
"\\equilibriumRight",
"\\equilibriumLeft"
],
props: {
numArgs: 1,
numOptionalArgs: 1
},
handler({ parser, funcName }, args, optArgs) {
const lowerArrowBody = args[0]
? {
type: "hphantom",
mode: parser.mode,
body: args[0]
}
: null;
const upperArrowBelow = optArgs[0]
? {
type: "hphantom",
mode: parser.mode,
body: optArgs[0]
}
: null;
return {
type: "stackedArrow",
mode: parser.mode,
name: funcName,
body: args[0],
upperArrowBelow,
lowerArrowBody,
below: optArgs[0]
};
},
mathmlBuilder(group, style) {
const topLabel = arrowComponent[group.name][0];
const botLabel = arrowComponent[group.name][1];
const topArrow = munderoverNode(topLabel, group.body, group.upperArrowBelow, style);
const botArrow = munderoverNode(botLabel, group.lowerArrowBody, group.below, style);
let wrapper;
const raiseNode = new mathMLTree.MathNode("mpadded", [topArrow]);
raiseNode.setAttribute("voffset", "0.3em");
raiseNode.setAttribute("height", "+0.3em");
raiseNode.setAttribute("depth", "-0.3em");
// One of the arrows is given ~zero width. so the other has the same horzontal alignment.
if (group.name === "\\equilibriumLeft") {
const botNode = new mathMLTree.MathNode("mpadded", [botArrow]);
botNode.setAttribute("width", "0.5em");
wrapper = new mathMLTree.MathNode(
"mpadded",
[padding$2(0.2778), botNode, raiseNode, padding$2(0.2778)]
);
} else {
raiseNode.setAttribute("width", (group.name === "\\equilibriumRight" ? "0.5em" : "0"));
wrapper = new mathMLTree.MathNode(
"mpadded",
[padding$2(0.2778), raiseNode, botArrow, padding$2(0.2778)]
);
}
wrapper.setAttribute("voffset", "-0.18em");
wrapper.setAttribute("height", "-0.18em");
wrapper.setAttribute("depth", "+0.18em");
return wrapper
}
});
/**
* Asserts that the node is of the given type and returns it with stricter
* typing. Throws if the node's type does not match.
*/
function assertNodeType(node, type) {
if (!node || node.type !== type) {
throw new Error(
`Expected node of type ${type}, but got ` +
(node ? `node of type ${node.type}` : String(node))
);
}
return node;
}
/**
* Returns the node more strictly typed iff it is of the given type. Otherwise,
* returns null.
*/
function assertSymbolNodeType(node) {
const typedNode = checkSymbolNodeType(node);
if (!typedNode) {
throw new Error(
`Expected node of symbol group type, but got ` +
(node ? `node of type ${node.type}` : String(node))
);
}
return typedNode;
}
/**
* Returns the node more strictly typed iff it is of the given type. Otherwise,
* returns null.
*/
function checkSymbolNodeType(node) {
if (node && (node.type === "atom" ||
Object.prototype.hasOwnProperty.call(NON_ATOMS, node.type))) {
return node;
}
return null;
}
const cdArrowFunctionName = {
">": "\\\\cdrightarrow",
"<": "\\\\cdleftarrow",
"=": "\\\\cdlongequal",
A: "\\uparrow",
V: "\\downarrow",
"|": "\\Vert",
".": "no arrow"
};
const newCell = () => {
// Create an empty cell, to be filled below with parse nodes.
return { type: "styling", body: [], mode: "math", scriptLevel: "display" };
};
const isStartOfArrow = (node) => {
return node.type === "textord" && node.text === "@";
};
const isLabelEnd = (node, endChar) => {
return (node.type === "mathord" || node.type === "atom") && node.text === endChar;
};
function cdArrow(arrowChar, labels, parser) {
// Return a parse tree of an arrow and its labels.
// This acts in a way similar to a macro expansion.
const funcName = cdArrowFunctionName[arrowChar];
switch (funcName) {
case "\\\\cdrightarrow":
case "\\\\cdleftarrow":
return parser.callFunction(funcName, [labels[0]], [labels[1]]);
case "\\uparrow":
case "\\downarrow": {
const leftLabel = parser.callFunction("\\\\cdleft", [labels[0]], []);
const bareArrow = {
type: "atom",
text: funcName,
mode: "math",
family: "rel"
};
const sizedArrow = parser.callFunction("\\Big", [bareArrow], []);
const rightLabel = parser.callFunction("\\\\cdright", [labels[1]], []);
const arrowGroup = {
type: "ordgroup",
mode: "math",
body: [leftLabel, sizedArrow, rightLabel],
semisimple: true
};
return parser.callFunction("\\\\cdparent", [arrowGroup], []);
}
case "\\\\cdlongequal":
return parser.callFunction("\\\\cdlongequal", [], []);
case "\\Vert": {
const arrow = { type: "textord", text: "\\Vert", mode: "math" };
return parser.callFunction("\\Big", [arrow], []);
}
default:
return { type: "textord", text: " ", mode: "math" };
}
}
function parseCD(parser) {
// Get the array's parse nodes with \\ temporarily mapped to \cr.
const parsedRows = [];
parser.gullet.beginGroup();
parser.gullet.macros.set("\\cr", "\\\\\\relax");
parser.gullet.beginGroup();
while (true) {
// Get the parse nodes for the next row.
parsedRows.push(parser.parseExpression(false, "\\\\"));
parser.gullet.endGroup();
parser.gullet.beginGroup();
const next = parser.fetch().text;
if (next === "&" || next === "\\\\") {
parser.consume();
} else if (next === "\\end") {
if (parsedRows[parsedRows.length - 1].length === 0) {
parsedRows.pop(); // final row ended in \\
}
break;
} else {
throw new ParseError("Expected \\\\ or \\cr or \\end", parser.nextToken);
}
}
let row = [];
const body = [row];
// Loop thru the parse nodes. Collect them into cells and arrows.
for (let i = 0; i < parsedRows.length; i++) {
// Start a new row.
const rowNodes = parsedRows[i];
// Create the first cell.
let cell = newCell();
for (let j = 0; j < rowNodes.length; j++) {
if (!isStartOfArrow(rowNodes[j])) {
// If a parseNode is not an arrow, it goes into a cell.
cell.body.push(rowNodes[j]);
} else {
// Parse node j is an "@", the start of an arrow.
// Before starting on the arrow, push the cell into `row`.
row.push(cell);
// Now collect parseNodes into an arrow.
// The character after "@" defines the arrow type.
j += 1;
const arrowChar = assertSymbolNodeType(rowNodes[j]).text;
// Create two empty label nodes. We may or may not use them.
const labels = new Array(2);
labels[0] = { type: "ordgroup", mode: "math", body: [] };
labels[1] = { type: "ordgroup", mode: "math", body: [] };
// Process the arrow.
if ("=|.".indexOf(arrowChar) > -1) ; else if ("<>AV".indexOf(arrowChar) > -1) {
// Four arrows, `@>>>`, `@<<<`, `@AAA`, and `@VVV`, each take
// two optional labels. E.g. the right-point arrow syntax is
// really: @>{optional label}>{optional label}>
// Collect parseNodes into labels.
for (let labelNum = 0; labelNum < 2; labelNum++) {
let inLabel = true;
for (let k = j + 1; k < rowNodes.length; k++) {
if (isLabelEnd(rowNodes[k], arrowChar)) {
inLabel = false;
j = k;
break;
}
if (isStartOfArrow(rowNodes[k])) {
throw new ParseError(
"Missing a " + arrowChar + " character to complete a CD arrow.",
rowNodes[k]
);
}
labels[labelNum].body.push(rowNodes[k]);
}
if (inLabel) {
// isLabelEnd never returned a true.
throw new ParseError(
"Missing a " + arrowChar + " character to complete a CD arrow.",
rowNodes[j]
);
}
}
} else {
throw new ParseError(`Expected one of "<>AV=|." after @.`);
}
// Now join the arrow to its labels.
const arrow = cdArrow(arrowChar, labels, parser);
// Wrap the arrow in a styling node
row.push(arrow);
// In CD's syntax, cells are implicit. That is, everything that
// is not an arrow gets collected into a cell. So create an empty
// cell now. It will collect upcoming parseNodes.
cell = newCell();
}
}
if (i % 2 === 0) {
// Even-numbered rows consist of: cell, arrow, cell, arrow, ... cell
// The last cell is not yet pushed into `row`, so:
row.push(cell);
} else {
// Odd-numbered rows consist of: vert arrow, empty cell, ... vert arrow
// Remove the empty cell that was placed at the beginning of `row`.
row.shift();
}
row = [];
body.push(row);
}
body.pop();
// End row group
parser.gullet.endGroup();
// End array group defining \\
parser.gullet.endGroup();
return {
type: "array",
mode: "math",
body,
tags: null,
labels: new Array(body.length + 1).fill(""),
envClasses: ["jot", "cd"],
cols: [],
hLinesBeforeRow: new Array(body.length + 1).fill([])
};
}
// The functions below are not available for general use.
// They are here only for internal use by the {CD} environment in placing labels
// next to vertical arrows.
// We don't need any such functions for horizontal arrows because we can reuse
// the functionality that already exists for extensible arrows.
defineFunction({
type: "cdlabel",
names: ["\\\\cdleft", "\\\\cdright"],
props: {
numArgs: 1
},
handler({ parser, funcName }, args) {
return {
type: "cdlabel",
mode: parser.mode,
side: funcName.slice(4),
label: args[0]
};
},
mathmlBuilder(group, style) {
if (group.label.body.length === 0) {
return new mathMLTree.MathNode("mrow", style) // empty label
}
// Abuse an <mtable> to create vertically centered content.
const mtd = new mathMLTree.MathNode("mtd", [buildGroup$1(group.label, style)]);
mtd.style.padding = "0";
const mtr = new mathMLTree.MathNode("mtr", [mtd]);
const mtable = new mathMLTree.MathNode("mtable", [mtr]);
const label = new mathMLTree.MathNode("mpadded", [mtable]);
// Set the label width to zero so that the arrow will be centered under the corner cell.
label.setAttribute("width", "0");
label.setAttribute("displaystyle", "false");
label.setAttribute("scriptlevel", "1");
if (group.side === "left") {
label.style.display = "flex";
label.style.justifyContent = "flex-end";
}
return label;
}
});
defineFunction({
type: "cdlabelparent",
names: ["\\\\cdparent"],
props: {
numArgs: 1
},
handler({ parser }, args) {
return {
type: "cdlabelparent",
mode: parser.mode,
fragment: args[0]
};
},
mathmlBuilder(group, style) {
return new mathMLTree.MathNode("mrow", [buildGroup$1(group.fragment, style)]);
}
});
// \@char is an internal function that takes a grouped decimal argument like
// {123} and converts into symbol with code 123. It is used by the *macro*
// \char defined in macros.js.
defineFunction({
type: "textord",
names: ["\\@char"],
props: {
numArgs: 1,
allowedInText: true
},
handler({ parser, token }, args) {
const arg = assertNodeType(args[0], "ordgroup");
const group = arg.body;
let number = "";
for (let i = 0; i < group.length; i++) {
const node = assertNodeType(group[i], "textord");
number += node.text;
}
const code = parseInt(number);
if (isNaN(code)) {
throw new ParseError(`\\@char has non-numeric argument ${number}`, token)
}
return {
type: "textord",
mode: parser.mode,
text: String.fromCodePoint(code)
}
}
});
// Helpers
const htmlRegEx = /^(#[a-f0-9]{3}|#?[a-f0-9]{6})$/i;
const htmlOrNameRegEx = /^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i;
const RGBregEx = /^ *\d{1,3} *(?:, *\d{1,3} *){2}$/;
const rgbRegEx = /^ *[10](?:\.\d*)? *(?:, *[10](?:\.\d*)? *){2}$/;
const xcolorHtmlRegEx = /^[a-f0-9]{6}$/i;
const toHex = num => {
let str = num.toString(16);
if (str.length === 1) { str = "0" + str; }
return str
};
// Colors from Tables 4.1 and 4.2 of the xcolor package.
// Table 4.1 (lower case) RGB values are taken from chroma and xcolor.dtx.
// Table 4.2 (Capitalizzed) values were sampled, because Chroma contains a unreliable
// conversion from cmyk to RGB. See https://tex.stackexchange.com/a/537274.
const xcolors = JSON.parse(`{
"Apricot": "#ffb484",
"Aquamarine": "#08b4bc",
"Bittersweet": "#c84c14",
"blue": "#0000FF",
"Blue": "#303494",
"BlueGreen": "#08b4bc",
"BlueViolet": "#503c94",
"BrickRed": "#b8341c",
"brown": "#BF8040",
"Brown": "#802404",
"BurntOrange": "#f8941c",
"CadetBlue": "#78749c",
"CarnationPink": "#f884b4",
"Cerulean": "#08a4e4",
"CornflowerBlue": "#40ace4",
"cyan": "#00FFFF",
"Cyan": "#08acec",
"Dandelion": "#ffbc44",
"darkgray": "#404040",
"DarkOrchid": "#a8548c",
"Emerald": "#08ac9c",
"ForestGreen": "#089c54",
"Fuchsia": "#90348c",
"Goldenrod": "#ffdc44",
"gray": "#808080",
"Gray": "#98949c",
"green": "#00FF00",
"Green": "#08a44c",
"GreenYellow": "#e0e474",
"JungleGreen": "#08ac9c",
"Lavender": "#f89cc4",
"lightgray": "#c0c0c0",
"lime": "#BFFF00",
"LimeGreen": "#90c43c",
"magenta": "#FF00FF",
"Magenta": "#f0048c",
"Mahogany": "#b0341c",
"Maroon": "#b03434",
"Melon": "#f89c7c",
"MidnightBlue": "#086494",
"Mulberry": "#b03c94",
"NavyBlue": "#086cbc",
"olive": "#7F7F00",
"OliveGreen": "#407c34",
"orange": "#FF8000",
"Orange": "#f8843c",
"OrangeRed": "#f0145c",
"Orchid": "#b074ac",
"Peach": "#f8945c",
"Periwinkle": "#8074bc",
"PineGreen": "#088c74",
"pink": "#ff7f7f",
"Plum": "#98248c",
"ProcessBlue": "#08b4ec",
"purple": "#BF0040",
"Purple": "#a0449c",
"RawSienna": "#983c04",
"red": "#ff0000",
"Red": "#f01c24",
"RedOrange": "#f86434",
"RedViolet": "#a0246c",
"Rhodamine": "#f0549c",
"Royallue": "#0874bc",
"RoyalPurple": "#683c9c",
"RubineRed": "#f0047c",
"Salmon": "#f8948c",
"SeaGreen": "#30bc9c",
"Sepia": "#701404",
"SkyBlue": "#48c4dc",
"SpringGreen": "#c8dc64",
"Tan": "#e09c74",
"teal": "#007F7F",
"TealBlue": "#08acb4",
"Thistle": "#d884b4",
"Turquoise": "#08b4cc",
"violet": "#800080",
"Violet": "#60449c",
"VioletRed": "#f054a4",
"WildStrawberry": "#f0246c",
"yellow": "#FFFF00",
"Yellow": "#fff404",
"YellowGreen": "#98cc6c",
"YellowOrange": "#ffa41c"
}`);
const colorFromSpec = (model, spec) => {
let color = "";
if (model === "HTML") {
if (!htmlRegEx.test(spec)) {
throw new ParseError("Invalid HTML input.")
}
color = spec;
} else if (model === "RGB") {
if (!RGBregEx.test(spec)) {
throw new ParseError("Invalid RGB input.")
}
spec.split(",").map(e => { color += toHex(Number(e.trim())); });
} else {
if (!rgbRegEx.test(spec)) {
throw new ParseError("Invalid rbg input.")
}
spec.split(",").map(e => {
const num = Number(e.trim());
if (num > 1) { throw new ParseError("Color rgb input must be < 1.") }
color += toHex(Number((num * 255).toFixed(0)));
});
}
if (color.charAt(0) !== "#") { color = "#" + color; }
return color
};
const validateColor = (color, macros, token) => {
const macroName = `\\\\color@${color}`; // from \defineColor.
const match = htmlOrNameRegEx.exec(color);
if (!match) { throw new ParseError("Invalid color: '" + color + "'", token) }
// We allow a 6-digit HTML color spec without a leading "#".
// This follows the xcolor package's HTML color model.
// Predefined color names are all missed by this RegEx pattern.
if (xcolorHtmlRegEx.test(color)) {
return "#" + color
} else if (color.charAt(0) === "#") {
return color
} else if (macros.has(macroName)) {
color = macros.get(macroName).tokens[0].text;
} else if (xcolors[color]) {
color = xcolors[color];
}
return color
};
const mathmlBuilder$9 = (group, style) => {
// In LaTeX, color is not supposed to change the spacing of any node.
// So instead of wrapping the group in an <mstyle>, we apply
// the color individually to each node and return a document fragment.
let expr = buildExpression(group.body, style.withColor(group.color));
expr = expr.map(e => {
e.style.color = group.color;
return e
});
return mathMLTree.newDocumentFragment(expr)
};
defineFunction({
type: "color",
names: ["\\textcolor"],
props: {
numArgs: 2,
numOptionalArgs: 1,
allowedInText: true,
argTypes: ["raw", "raw", "original"]
},
handler({ parser, token }, args, optArgs) {
const model = optArgs[0] && assertNodeType(optArgs[0], "raw").string;
let color = "";
if (model) {
const spec = assertNodeType(args[0], "raw").string;
color = colorFromSpec(model, spec);
} else {
color = validateColor(assertNodeType(args[0], "raw").string, parser.gullet.macros, token);
}
const body = args[1];
return {
type: "color",
mode: parser.mode,
color,
isTextColor: true,
body: ordargument(body)
}
},
mathmlBuilder: mathmlBuilder$9
});
defineFunction({
type: "color",
names: ["\\color"],
props: {
numArgs: 1,
numOptionalArgs: 1,
allowedInText: true,
argTypes: ["raw", "raw"]
},
handler({ parser, breakOnTokenText, token }, args, optArgs) {
const model = optArgs[0] && assertNodeType(optArgs[0], "raw").string;
let color = "";
if (model) {
const spec = assertNodeType(args[0], "raw").string;
color = colorFromSpec(model, spec);
} else {
color = validateColor(assertNodeType(args[0], "raw").string, parser.gullet.macros, token);
}
// Parse out the implicit body that should be colored.
const body = parser.parseExpression(true, breakOnTokenText, true);
return {
type: "color",
mode: parser.mode,
color,
isTextColor: false,
body
}
},
mathmlBuilder: mathmlBuilder$9
});
defineFunction({
type: "color",
names: ["\\definecolor"],
props: {
numArgs: 3,
allowedInText: true,
argTypes: ["raw", "raw", "raw"]
},
handler({ parser, funcName, token }, args) {
const name = assertNodeType(args[0], "raw").string;
if (!/^[A-Za-z]+$/.test(name)) {
throw new ParseError("Color name must be latin letters.", token)
}
const model = assertNodeType(args[1], "raw").string;
if (!["HTML", "RGB", "rgb"].includes(model)) {
throw new ParseError("Color model must be HTML, RGB, or rgb.", token)
}
const spec = assertNodeType(args[2], "raw").string;
const color = colorFromSpec(model, spec);
parser.gullet.macros.set(`\\\\color@${name}`, { tokens: [{ text: color }], numArgs: 0 });
return { type: "internal", mode: parser.mode }
}
// No mathmlBuilder. The point of \definecolor is to set a macro.
});
// Row breaks within tabular environments, and line breaks at top level
// \DeclareRobustCommand\\{...\@xnewline}
defineFunction({
type: "cr",
names: ["\\\\"],
props: {
numArgs: 0,
numOptionalArgs: 0,
allowedInText: true
},
handler({ parser }, args, optArgs) {
const size = parser.gullet.future().text === "[" ? parser.parseSizeGroup(true) : null;
const newLine = !parser.settings.displayMode;
return {
type: "cr",
mode: parser.mode,
newLine,
size: size && assertNodeType(size, "size").value
}
},
// The following builder is called only at the top level,
// not within tabular/array environments.
mathmlBuilder(group, style) {
// MathML 3.0 calls for newline to occur in an <mo> or an <mspace>.
// Ref: https://www.w3.org/TR/MathML3/chapter3.html#presm.linebreaking
const node = new mathMLTree.MathNode("mo");
if (group.newLine) {
node.setAttribute("linebreak", "newline");
if (group.size) {
const size = calculateSize(group.size, style);
node.setAttribute("height", size.number + size.unit);
}
}
return node
}
});
const globalMap = {
"\\global": "\\global",
"\\long": "\\\\globallong",
"\\\\globallong": "\\\\globallong",
"\\def": "\\gdef",
"\\gdef": "\\gdef",
"\\edef": "\\xdef",
"\\xdef": "\\xdef",
"\\let": "\\\\globallet",
"\\futurelet": "\\\\globalfuture"
};
const checkControlSequence = (tok) => {
const name = tok.text;
if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) {
throw new ParseError("Expected a control sequence", tok);
}
return name;
};
const getRHS = (parser) => {
let tok = parser.gullet.popToken();
if (tok.text === "=") {
// consume optional equals
tok = parser.gullet.popToken();
if (tok.text === " ") {
// consume one optional space
tok = parser.gullet.popToken();
}
}
return tok;
};
const letCommand = (parser, name, tok, global) => {
let macro = parser.gullet.macros.get(tok.text);
if (macro == null) {
// don't expand it later even if a macro with the same name is defined
// e.g., \let\foo=\frac \def\frac{\relax} \frac12
tok.noexpand = true;
macro = {
tokens: [tok],
numArgs: 0,
// reproduce the same behavior in expansion
unexpandable: !parser.gullet.isExpandable(tok.text)
};
}
parser.gullet.macros.set(name, macro, global);
};
// <assignment> -> <non-macro assignment>|<macro assignment>
// <non-macro assignment> -> <simple assignment>|\global<non-macro assignment>
// <macro assignment> -> <definition>|<prefix><macro assignment>
// <prefix> -> \global|\long|\outer
defineFunction({
type: "internal",
names: [
"\\global",
"\\long",
"\\\\globallong" // can’t be entered directly
],
props: {
numArgs: 0,
allowedInText: true
},
handler({ parser, funcName }) {
parser.consumeSpaces();
const token = parser.fetch();
if (globalMap[token.text]) {
// Temml doesn't have \par, so ignore \long
if (funcName === "\\global" || funcName === "\\\\globallong") {
token.text = globalMap[token.text];
}
return assertNodeType(parser.parseFunction(), "internal");
}
throw new ParseError(`Invalid token after macro prefix`, token);
}
});
// Basic support for macro definitions: \def, \gdef, \edef, \xdef
// <definition> -> <def><control sequence><definition text>
// <def> -> \def|\gdef|\edef|\xdef
// <definition text> -> <parameter text><left brace><balanced text><right brace>
defineFunction({
type: "internal",
names: ["\\def", "\\gdef", "\\edef", "\\xdef"],
props: {
numArgs: 0,
allowedInText: true,
primitive: true
},
handler({ parser, funcName }) {
let tok = parser.gullet.popToken();
const name = tok.text;
if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) {
throw new ParseError("Expected a control sequence", tok);
}
let numArgs = 0;
let insert;
const delimiters = [[]];
// <parameter text> contains no braces
while (parser.gullet.future().text !== "{") {
tok = parser.gullet.popToken();
if (tok.text === "#") {
// If the very last character of the <parameter text> is #, so that
// this # is immediately followed by {, TeX will behave as if the {
// had been inserted at the right end of both the parameter text
// and the replacement text.
if (parser.gullet.future().text === "{") {
insert = parser.gullet.future();
delimiters[numArgs].push("{");
break;
}
// A parameter, the first appearance of # must be followed by 1,
// the next by 2, and so on; up to nine #’s are allowed
tok = parser.gullet.popToken();
if (!/^[1-9]$/.test(tok.text)) {
throw new ParseError(`Invalid argument number "${tok.text}"`);
}
if (parseInt(tok.text) !== numArgs + 1) {
throw new ParseError(`Argument number "${tok.text}" out of order`);
}
numArgs++;
delimiters.push([]);
} else if (tok.text === "EOF") {
throw new ParseError("Expected a macro definition");
} else {
delimiters[numArgs].push(tok.text);
}
}
// replacement text, enclosed in '{' and '}' and properly nested
let { tokens } = parser.gullet.consumeArg();
if (insert) {
tokens.unshift(insert);
}
if (funcName === "\\edef" || funcName === "\\xdef") {
tokens = parser.gullet.expandTokens(tokens);
if (tokens.length > parser.gullet.settings.maxExpand) {
throw new ParseError("Too many expansions in an " + funcName);
}
tokens.reverse(); // to fit in with stack order
}
// Final arg is the expansion of the macro
parser.gullet.macros.set(
name,
{ tokens, numArgs, delimiters },
funcName === globalMap[funcName]
);
return { type: "internal", mode: parser.mode };
}
});
// <simple assignment> -> <let assignment>
// <let assignment> -> \futurelet<control sequence><token><token>
// | \let<control sequence><equals><one optional space><token>
// <equals> -> <optional spaces>|<optional spaces>=
defineFunction({
type: "internal",
names: [
"\\let",
"\\\\globallet" // can’t be entered directly
],
props: {
numArgs: 0,
allowedInText: true,
primitive: true
},
handler({ parser, funcName }) {
const name = checkControlSequence(parser.gullet.popToken());
parser.gullet.consumeSpaces();
const tok = getRHS(parser);
letCommand(parser, name, tok, funcName === "\\\\globallet");
return { type: "internal", mode: parser.mode };
}
});
// ref: https://www.tug.org/TUGboat/tb09-3/tb22bechtolsheim.pdf
defineFunction({
type: "internal",
names: [
"\\futurelet",
"\\\\globalfuture" // can’t be entered directly
],
props: {
numArgs: 0,
allowedInText: true,
primitive: true
},
handler({ parser, funcName }) {
const name = checkControlSequence(parser.gullet.popToken());
const middle = parser.gullet.popToken();
const tok = parser.gullet.popToken();
letCommand(parser, name, tok, funcName === "\\\\globalfuture");
parser.gullet.pushToken(tok);
parser.gullet.pushToken(middle);
return { type: "internal", mode: parser.mode };
}
});
defineFunction({
type: "internal",
names: ["\\newcommand", "\\renewcommand", "\\providecommand"],
props: {
numArgs: 0,
allowedInText: true,
primitive: true
},
handler({ parser, funcName }) {
let name = "";
const tok = parser.gullet.popToken();
if (tok.text === "{") {
name = checkControlSequence(parser.gullet.popToken());
parser.gullet.popToken();
} else {
name = checkControlSequence(tok);
}
const exists = parser.gullet.isDefined(name);
if (exists && funcName === "\\newcommand") {
throw new ParseError(
`\\newcommand{${name}} attempting to redefine ${name}; use \\renewcommand`
);
}
if (!exists && funcName === "\\renewcommand") {
throw new ParseError(
`\\renewcommand{${name}} when command ${name} does not yet exist; use \\newcommand`
);
}
let numArgs = 0;
if (parser.gullet.future().text === "[") {
let tok = parser.gullet.popToken();
tok = parser.gullet.popToken();
if (!/^[0-9]$/.test(tok.text)) {
throw new ParseError(`Invalid number of arguments: "${tok.text}"`);
}
numArgs = parseInt(tok.text);
tok = parser.gullet.popToken();
if (tok.text !== "]") {
throw new ParseError(`Invalid argument "${tok.text}"`);
}
}
// replacement text, enclosed in '{' and '}' and properly nested
const { tokens } = parser.gullet.consumeArg();
if (!(funcName === "\\providecommand" && parser.gullet.macros.has(name))) {
// Ignore \providecommand
parser.gullet.macros.set(
name,
{ tokens, numArgs }
);
}
return { type: "internal", mode: parser.mode };
}
});
// Extra data needed for the delimiter handler down below
const delimiterSizes = {
"\\bigl": { mclass: "mopen", size: 1 },
"\\Bigl": { mclass: "mopen", size: 2 },
"\\biggl": { mclass: "mopen", size: 3 },
"\\Biggl": { mclass: "mopen", size: 4 },
"\\bigr": { mclass: "mclose", size: 1 },
"\\Bigr": { mclass: "mclose", size: 2 },
"\\biggr": { mclass: "mclose", size: 3 },
"\\Biggr": { mclass: "mclose", size: 4 },
"\\bigm": { mclass: "mrel", size: 1 },
"\\Bigm": { mclass: "mrel", size: 2 },
"\\biggm": { mclass: "mrel", size: 3 },
"\\Biggm": { mclass: "mrel", size: 4 },
"\\big": { mclass: "mord", size: 1 },
"\\Big": { mclass: "mord", size: 2 },
"\\bigg": { mclass: "mord", size: 3 },
"\\Bigg": { mclass: "mord", size: 4 }
};
const delimiters = [
"(",
"\\lparen",
")",
"\\rparen",
"[",
"\\lbrack",
"]",
"\\rbrack",
"\\{",
"\\lbrace",
"\\}",
"\\rbrace",
"⦇",
"\\llparenthesis",
"⦈",
"\\rrparenthesis",
"\\lfloor",
"\\rfloor",
"\u230a",
"\u230b",
"\\lceil",
"\\rceil",
"\u2308",
"\u2309",
"<",
">",
"\\langle",
"\u27e8",
"\\rangle",
"\u27e9",
"\\lAngle",
"\u27ea",
"\\rAngle",
"\u27eb",
"\\llangle",
"⦉",
"\\rrangle",
"⦊",
"\\lt",
"\\gt",
"\\lvert",
"\\rvert",
"\\lVert",
"\\rVert",
"\\lgroup",
"\\rgroup",
"\u27ee",
"\u27ef",
"\\lmoustache",
"\\rmoustache",
"\u23b0",
"\u23b1",
"\\llbracket",
"\\rrbracket",
"\u27e6",
"\u27e6",
"\\lBrace",
"\\rBrace",
"\u2983",
"\u2984",
"/",
"\\backslash",
"|",
"\\vert",
"\\|",
"\\Vert",
"\u2016",
"\\uparrow",
"\\Uparrow",
"\\downarrow",
"\\Downarrow",
"\\updownarrow",
"\\Updownarrow",
"."
];
// Export isDelimiter for benefit of parser.
const dels = ["}", "\\left", "\\middle", "\\right"];
const isDelimiter = str => str.length > 0 &&
(delimiters.includes(str) || delimiterSizes[str] || dels.includes(str));
// Metrics of the different sizes. Found by looking at TeX's output of
// $\bigl| // \Bigl| \biggl| \Biggl| \showlists$
// Used to create stacked delimiters of appropriate sizes in makeSizedDelim.
const sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0];
// Delimiter functions
function checkDelimiter(delim, context) {
const symDelim = checkSymbolNodeType(delim);
if (symDelim && delimiters.includes(symDelim.text)) {
// If a character is not in the MathML operator dictionary, it will not stretch.
// Replace such characters w/characters that will stretch.
if (["<", "\\lt"].includes(symDelim.text)) { symDelim.text = "⟨"; }
if ([">", "\\gt"].includes(symDelim.text)) { symDelim.text = "⟩"; }
return symDelim;
} else if (symDelim) {
throw new ParseError(`Invalid delimiter '${symDelim.text}' after '${context.funcName}'`, delim);
} else {
throw new ParseError(`Invalid delimiter type '${delim.type}'`, delim);
}
}
// / \
const needExplicitStretch = ["\u002F", "\u005C", "\\backslash", "\\vert", "|"];
defineFunction({
type: "delimsizing",
names: [
"\\bigl",
"\\Bigl",
"\\biggl",
"\\Biggl",
"\\bigr",
"\\Bigr",
"\\biggr",
"\\Biggr",
"\\bigm",
"\\Bigm",
"\\biggm",
"\\Biggm",
"\\big",
"\\Big",
"\\bigg",
"\\Bigg"
],
props: {
numArgs: 1,
argTypes: ["primitive"]
},
handler: (context, args) => {
const delim = checkDelimiter(args[0], context);
return {
type: "delimsizing",
mode: context.parser.mode,
size: delimiterSizes[context.funcName].size,
mclass: delimiterSizes[context.funcName].mclass,
delim: delim.text
};
},
mathmlBuilder: (group) => {
const children = [];
if (group.delim === ".") { group.delim = ""; }
children.push(makeText(group.delim, group.mode));
const node = new mathMLTree.MathNode("mo", children);
if (group.mclass === "mopen" || group.mclass === "mclose") {
// Only some of the delimsizing functions act as fences, and they
// return "mopen" or "mclose" mclass.
node.setAttribute("fence", "true");
} else {
// Explicitly disable fencing if it's not a fence, to override the
// defaults.
node.setAttribute("fence", "false");
}
if (needExplicitStretch.includes(group.delim) || group.delim.indexOf("arrow") > -1) {
// We have to explicitly set stretchy to true.
node.setAttribute("stretchy", "true");
}
node.setAttribute("symmetric", "true"); // Needed for tall arrows in Firefox.
node.setAttribute("minsize", sizeToMaxHeight[group.size] + "em");
node.setAttribute("maxsize", sizeToMaxHeight[group.size] + "em");
return node;
}
});
function assertParsed(group) {
if (!group.body) {
throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
}
}
defineFunction({
type: "leftright-right",
names: ["\\right"],
props: {
numArgs: 1,
argTypes: ["primitive"]
},
handler: (context, args) => {
return {
type: "leftright-right",
mode: context.parser.mode,
delim: checkDelimiter(args[0], context).text
};
}
});
defineFunction({
type: "leftright",
names: ["\\left"],
props: {
numArgs: 1,
argTypes: ["primitive"]
},
handler: (context, args) => {
const delim = checkDelimiter(args[0], context);
const parser = context.parser;
// Parse out the implicit body
++parser.leftrightDepth;
// parseExpression stops before '\\right' or `\\middle`
let body = parser.parseExpression(false, null, true);
let nextToken = parser.fetch();
while (nextToken.text === "\\middle") {
// `\middle`, from the ε-TeX package, ends one group and starts another group.
// We had to parse this expression with `breakOnMiddle` enabled in order
// to get TeX-compliant parsing of \over.
// But we do not want, at this point, to end on \middle, so continue
// to parse until we fetch a `\right`.
parser.consume();
const middle = parser.fetch().text;
if (!symbols.math[middle]) {
throw new ParseError(`Invalid delimiter '${middle}' after '\\middle'`);
}
checkDelimiter({ type: "atom", mode: "math", text: middle }, { funcName: "\\middle" });
body.push({ type: "middle", mode: "math", delim: middle });
parser.consume();
body = body.concat(parser.parseExpression(false, null, true));
nextToken = parser.fetch();
}
--parser.leftrightDepth;
// Check the next token
parser.expect("\\right", false);
const right = assertNodeType(parser.parseFunction(), "leftright-right");
return {
type: "leftright",
mode: parser.mode,
body,
left: delim.text,
right: right.delim
};
},
mathmlBuilder: (group, style) => {
assertParsed(group);
const inner = buildExpression(group.body, style);
if (group.left === ".") { group.left = ""; }
const leftNode = new mathMLTree.MathNode("mo", [makeText(group.left, group.mode)]);
leftNode.setAttribute("fence", "true");
leftNode.setAttribute("form", "prefix");
if (group.left === "/" || group.left === "\u005C" || group.left.indexOf("arrow") > -1) {
leftNode.setAttribute("stretchy", "true");
}
inner.unshift(leftNode);
if (group.right === ".") { group.right = ""; }
const rightNode = new mathMLTree.MathNode("mo", [makeText(group.right, group.mode)]);
rightNode.setAttribute("fence", "true");
rightNode.setAttribute("form", "postfix");
if (group.right === "\u2216" || group.right.indexOf("arrow") > -1) {
rightNode.setAttribute("stretchy", "true");
}
if (group.body.length > 0) {
const lastElement = group.body[group.body.length - 1];
if (lastElement.type === "color" && !lastElement.isTextColor) {
// \color is a switch. If the last element is of type "color" then
// the user set the \color switch and left it on.
// A \right delimiter turns the switch off, but the delimiter itself gets the color.
rightNode.setAttribute("mathcolor", lastElement.color);
}
}
inner.push(rightNode);
return makeRow(inner);
}
});
defineFunction({
type: "middle",
names: ["\\middle"],
props: {
numArgs: 1,
argTypes: ["primitive"]
},
handler: (context, args) => {
const delim = checkDelimiter(args[0], context);
if (!context.parser.leftrightDepth) {
throw new ParseError("\\middle without preceding \\left", delim);
}
return {
type: "middle",
mode: context.parser.mode,
delim: delim.text
};
},
mathmlBuilder: (group, style) => {
const textNode = makeText(group.delim, group.mode);
const middleNode = new mathMLTree.MathNode("mo", [textNode]);
middleNode.setAttribute("fence", "true");
if (group.delim.indexOf("arrow") > -1) {
middleNode.setAttribute("stretchy", "true");
}
// The next line is not semantically correct, but
// Chromium fails to stretch if it is not there.
middleNode.setAttribute("form", "prefix");
// MathML gives 5/18em spacing to each <mo> element.
// \middle should get delimiter spacing instead.
middleNode.setAttribute("lspace", "0.05em");
middleNode.setAttribute("rspace", "0.05em");
return middleNode;
}
});
const padding$1 = _ => {
const node = new mathMLTree.MathNode("mspace");
node.setAttribute("width", "3pt");
return node
};
const mathmlBuilder$8 = (group, style) => {
let node;
if (group.label.indexOf("colorbox") > -1 || group.label === "\\boxed") {
// MathML core does not support +width attribute in <mpadded>.
// Firefox does not reliably add side padding.
// Insert <mspace>
node = new mathMLTree.MathNode("mrow", [
padding$1(),
buildGroup$1(group.body, style),
padding$1()
]);
} else {
node = new mathMLTree.MathNode("menclose", [buildGroup$1(group.body, style)]);
}
switch (group.label) {
case "\\overline":
node.setAttribute("notation", "top"); // for Firefox & WebKit
node.classes.push("tml-overline"); // for Chromium
break
case "\\underline":
node.setAttribute("notation", "bottom");
node.classes.push("tml-underline");
break
case "\\cancel":
node.setAttribute("notation", "updiagonalstrike");
node.children.push(new mathMLTree.MathNode("mrow", [], ["tml-cancel", "upstrike"]));
break
case "\\bcancel":
node.setAttribute("notation", "downdiagonalstrike");
node.children.push(new mathMLTree.MathNode("mrow", [], ["tml-cancel", "downstrike"]));
break
case "\\sout":
node.setAttribute("notation", "horizontalstrike");
node.children.push(new mathMLTree.MathNode("mrow", [], ["tml-cancel", "sout"]));
break
case "\\xcancel":
node.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
node.classes.push("tml-xcancel");
break
case "\\longdiv":
node.setAttribute("notation", "longdiv");
node.classes.push("longdiv-top");
node.children.push(new mathMLTree.MathNode("mrow", [], ["longdiv-arc"]));
break
case "\\phase":
node.setAttribute("notation", "phasorangle");
node.classes.push("phasor-bottom");
node.children.push(new mathMLTree.MathNode("mrow", [], ["phasor-angle"]));
break
case "\\textcircled":
node.setAttribute("notation", "circle");
node.classes.push("circle-pad");
node.children.push(new mathMLTree.MathNode("mrow", [], ["textcircle"]));
break
case "\\angl":
node.setAttribute("notation", "actuarial");
node.classes.push("actuarial");
break
case "\\boxed":
// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}} from amsmath.sty
node.setAttribute("notation", "box");
node.classes.push("tml-box");
node.setAttribute("scriptlevel", "0");
node.setAttribute("displaystyle", "true");
break
case "\\fbox":
node.setAttribute("notation", "box");
node.classes.push("tml-fbox");
break
case "\\fcolorbox":
case "\\colorbox": {
// <menclose> doesn't have a good notation option for \colorbox.
// So use <mpadded> instead. Set some attributes that come
// included with <menclose>.
//const fboxsep = 3; // 3 pt from LaTeX source2e
//node.setAttribute("height", `+${2 * fboxsep}pt`)
//node.setAttribute("voffset", `${fboxsep}pt`)
const style = { padding: "3pt 0 3pt 0" };
if (group.label === "\\fcolorbox") {
style.border = "0.0667em solid " + String(group.borderColor);
}
node.style = style;
break
}
}
if (group.backgroundColor) {
node.setAttribute("mathbackground", group.backgroundColor);
}
return node;
};
defineFunction({
type: "enclose",
names: ["\\colorbox"],
props: {
numArgs: 2,
numOptionalArgs: 1,
allowedInText: true,
argTypes: ["raw", "raw", "text"]
},
handler({ parser, funcName }, args, optArgs) {
const model = optArgs[0] && assertNodeType(optArgs[0], "raw").string;
let color = "";
if (model) {
const spec = assertNodeType(args[0], "raw").string;
color = colorFromSpec(model, spec);
} else {
color = validateColor(assertNodeType(args[0], "raw").string, parser.gullet.macros);
}
const body = args[1];
return {
type: "enclose",
mode: parser.mode,
label: funcName,
backgroundColor: color,
body
};
},
mathmlBuilder: mathmlBuilder$8
});
defineFunction({
type: "enclose",
names: ["\\fcolorbox"],
props: {
numArgs: 3,
numOptionalArgs: 1,
allowedInText: true,
argTypes: ["raw", "raw", "raw", "text"]
},
handler({ parser, funcName }, args, optArgs) {
const model = optArgs[0] && assertNodeType(optArgs[0], "raw").string;
let borderColor = "";
let backgroundColor;
if (model) {
const borderSpec = assertNodeType(args[0], "raw").string;
const backgroundSpec = assertNodeType(args[0], "raw").string;
borderColor = colorFromSpec(model, borderSpec);
backgroundColor = colorFromSpec(model, backgroundSpec);
} else {
borderColor = validateColor(assertNodeType(args[0], "raw").string, parser.gullet.macros);
backgroundColor = validateColor(assertNodeType(args[1], "raw").string, parser.gullet.macros);
}
const body = args[2];
return {
type: "enclose",
mode: parser.mode,
label: funcName,
backgroundColor,
borderColor,
body
};
},
mathmlBuilder: mathmlBuilder$8
});
defineFunction({
type: "enclose",
names: ["\\fbox"],
props: {
numArgs: 1,
argTypes: ["hbox"],
allowedInText: true
},
handler({ parser }, args) {
return {
type: "enclose",
mode: parser.mode,
label: "\\fbox",
body: args[0]
};
}
});
defineFunction({
type: "enclose",
names: ["\\angl", "\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\overline",
"\\boxed", "\\longdiv", "\\phase"],
props: {
numArgs: 1
},
handler({ parser, funcName }, args) {
const body = args[0];
return {
type: "enclose",
mode: parser.mode,
label: funcName,
body
};
},
mathmlBuilder: mathmlBuilder$8
});
defineFunction({
type: "enclose",
names: ["\\underline"],
props: {
numArgs: 1,
allowedInText: true
},
handler({ parser, funcName }, args) {
const body = args[0];
return {
type: "enclose",
mode: parser.mode,
label: funcName,
body
};
},
mathmlBuilder: mathmlBuilder$8
});
defineFunction({
type: "enclose",
names: ["\\textcircled"],
props: {
numArgs: 1,
argTypes: ["text"],
allowedInArgument: true,
allowedInText: true
},
handler({ parser, funcName }, args) {
const body = args[0];
return {
type: "enclose",
mode: parser.mode,
label: funcName,
body
};
},
mathmlBuilder: mathmlBuilder$8
});
/**
* All registered environments.
* `environments.js` exports this same dictionary again and makes it public.
* `Parser.js` requires this dictionary via `environments.js`.
*/
const _environments = {};
function defineEnvironment({ type, names, props, handler, mathmlBuilder }) {
// Set default values of environments.
const data = {
type,
numArgs: props.numArgs || 0,
allowedInText: false,
numOptionalArgs: 0,
handler
};
for (let i = 0; i < names.length; ++i) {
_environments[names[i]] = data;
}
if (mathmlBuilder) {
_mathmlGroupBuilders[type] = mathmlBuilder;
}
}
/**
* Lexing or parsing positional information for error reporting.
* This object is immutable.
*/
class SourceLocation {
constructor(lexer, start, end) {
this.lexer = lexer; // Lexer holding the input string.
this.start = start; // Start offset, zero-based inclusive.
this.end = end; // End offset, zero-based exclusive.
}
/**
* Merges two `SourceLocation`s from location providers, given they are
* provided in order of appearance.
* - Returns the first one's location if only the first is provided.
* - Returns a merged range of the first and the last if both are provided
* and their lexers match.
* - Otherwise, returns null.
*/
static range(first, second) {
if (!second) {
return first && first.loc;
} else if (!first || !first.loc || !second.loc || first.loc.lexer !== second.loc.lexer) {
return null;
} else {
return new SourceLocation(first.loc.lexer, first.loc.start, second.loc.end);
}
}
}
/**
* Interface required to break circular dependency between Token, Lexer, and
* ParseError.
*/
/**
* The resulting token returned from `lex`.
*
* It consists of the token text plus some position information.
* The position information is essentially a range in an input string,
* but instead of referencing the bare input string, we refer to the lexer.
* That way it is possible to attach extra metadata to the input string,
* like for example a file name or similar.
*
* The position information is optional, so it is OK to construct synthetic
* tokens if appropriate. Not providing available position information may
* lead to degraded error reporting, though.
*/
class Token {
constructor(
text, // the text of this token
loc
) {
this.text = text;
this.loc = loc;
}
/**
* Given a pair of tokens (this and endToken), compute a `Token` encompassing
* the whole input range enclosed by these two.
*/
range(
endToken, // last token of the range, inclusive
text // the text of the newly constructed token
) {
return new Token(text, SourceLocation.range(this, endToken));
}
}
// In TeX, there are actually three sets of dimensions, one for each of
// textstyle, scriptstyle, and scriptscriptstyle. These are
// provided in the the arrays below, in that order.
//
// Math style is not quite the same thing as script level.
const StyleLevel = {
DISPLAY: 0,
TEXT: 1,
SCRIPT: 2,
SCRIPTSCRIPT: 3
};
/**
* All registered global/built-in macros.
* `macros.js` exports this same dictionary again and makes it public.
* `Parser.js` requires this dictionary via `macros.js`.
*/
const _macros = {};
// This function might one day accept an additional argument and do more things.
function defineMacro(name, body) {
_macros[name] = body;
}
/**
* Predefined macros for Temml.
* This can be used to define some commands in terms of others.
*/
const macros = _macros;
//////////////////////////////////////////////////////////////////////
// macro tools
defineMacro("\\noexpand", function(context) {
// The expansion is the token itself; but that token is interpreted
// as if its meaning were ‘\relax’ if it is a control sequence that
// would ordinarily be expanded by TeX’s expansion rules.
const t = context.popToken();
if (context.isExpandable(t.text)) {
t.noexpand = true;
t.treatAsRelax = true;
}
return { tokens: [t], numArgs: 0 };
});
defineMacro("\\expandafter", function(context) {
// TeX first reads the token that comes immediately after \expandafter,
// without expanding it; let’s call this token t. Then TeX reads the
// token that comes after t (and possibly more tokens, if that token
// has an argument), replacing it by its expansion. Finally TeX puts
// t back in front of that expansion.
const t = context.popToken();
context.expandOnce(true); // expand only an expandable token
return { tokens: [t], numArgs: 0 };
});
// LaTeX's \@firstoftwo{#1}{#2} expands to #1, skipping #2
// TeX source: \long\def\@firstoftwo#1#2{#1}
defineMacro("\\@firstoftwo", function(context) {
const args = context.consumeArgs(2);
return { tokens: args[0], numArgs: 0 };
});
// LaTeX's \@secondoftwo{#1}{#2} expands to #2, skipping #1
// TeX source: \long\def\@secondoftwo#1#2{#2}
defineMacro("\\@secondoftwo", function(context) {
const args = context.consumeArgs(2);
return { tokens: args[1], numArgs: 0 };
});
// LaTeX's \@ifnextchar{#1}{#2}{#3} looks ahead to the next (unexpanded)
// symbol that isn't a space, consuming any spaces but not consuming the
// first nonspace character. If that nonspace character matches #1, then
// the macro expands to #2; otherwise, it expands to #3.
defineMacro("\\@ifnextchar", function(context) {
const args = context.consumeArgs(3); // symbol, if, else
context.consumeSpaces();
const nextToken = context.future();
if (args[0].length === 1 && args[0][0].text === nextToken.text) {
return { tokens: args[1], numArgs: 0 };
} else {
return { tokens: args[2], numArgs: 0 };
}
});
// LaTeX's \@ifstar{#1}{#2} looks ahead to the next (unexpanded) symbol.
// If it is `*`, then it consumes the symbol, and the macro expands to #1;
// otherwise, the macro expands to #2 (without consuming the symbol).
// TeX source: \def\@ifstar#1{\@ifnextchar *{\@firstoftwo{#1}}}
defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");
// LaTeX's \TextOrMath{#1}{#2} expands to #1 in text mode, #2 in math mode
defineMacro("\\TextOrMath", function(context) {
const args = context.consumeArgs(2);
if (context.mode === "text") {
return { tokens: args[0], numArgs: 0 };
} else {
return { tokens: args[1], numArgs: 0 };
}
});
const stringFromArg = arg => {
// Reverse the order of the arg and return a string.
let str = "";
for (let i = arg.length - 1; i > -1; i--) {
str += arg[i].text;
}
return str
};
// Lookup table for parsing numbers in base 8 through 16
const digitToNumber = {
0: 0,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
9: 9,
a: 10,
A: 10,
b: 11,
B: 11,
c: 12,
C: 12,
d: 13,
D: 13,
e: 14,
E: 14,
f: 15,
F: 15
};
const nextCharNumber = context => {
const numStr = context.future().text;
if (numStr === "EOF") { return [null, ""] }
return [digitToNumber[numStr.charAt(0)], numStr]
};
const appendCharNumbers = (number, numStr, base) => {
for (let i = 1; i < numStr.length; i++) {
const digit = digitToNumber[numStr.charAt(i)];
number *= base;
number += digit;
}
return number
};
// TeX \char makes a literal character (catcode 12) using the following forms:
// (see The TeXBook, p. 43)
// \char123 -- decimal
// \char'123 -- octal
// \char"123 -- hex
// \char`x -- character that can be written (i.e. isn't active)
// \char`\x -- character that cannot be written (e.g. %)
// These all refer to characters from the font, so we turn them into special
// calls to a function \@char dealt with in the Parser.
defineMacro("\\char", function(context) {
let token = context.popToken();
let base;
let number = "";
if (token.text === "'") {
base = 8;
token = context.popToken();
} else if (token.text === '"') {
base = 16;
token = context.popToken();
} else if (token.text === "`") {
token = context.popToken();
if (token.text[0] === "\\") {
number = token.text.charCodeAt(1);
} else if (token.text === "EOF") {
throw new ParseError("\\char` missing argument");
} else {
number = token.text.charCodeAt(0);
}
} else {
base = 10;
}
if (base) {
// Parse a number in the given base, starting with first `token`.
let numStr = token.text;
number = digitToNumber[numStr.charAt(0)];
if (number == null || number >= base) {
throw new ParseError(`Invalid base-${base} digit ${token.text}`);
}
number = appendCharNumbers(number, numStr, base);
let digit;
[digit, numStr] = nextCharNumber(context);
while (digit != null && digit < base) {
number *= base;
number += digit;
number = appendCharNumbers(number, numStr, base);
context.popToken();
[digit, numStr] = nextCharNumber(context);
}
}
return `\\@char{${number}}`;
});
function recreateArgStr(context) {
// Recreate the macro's original argument string from the array of parse tokens.
const tokens = context.consumeArgs(1)[0];
let str = "";
let expectedLoc = tokens[tokens.length - 1].loc.start;
for (let i = tokens.length - 1; i >= 0; i--) {
const actualLoc = tokens[i].loc.start;
if (actualLoc > expectedLoc) {
// context.consumeArgs has eaten a space.
str += " ";
expectedLoc = actualLoc;
}
str += tokens[i].text;
expectedLoc += tokens[i].text.length;
}
return str
}
// The Latin Modern font renders <mi>√</mi> at the wrong vertical alignment.
// This macro provides a better rendering.
defineMacro("\\surd", '\\sqrt{\\vphantom{|}}');
// See comment for \oplus in symbols.js.
defineMacro("\u2295", "\\oplus");
// Since Temml has no \par, ignore \long.
defineMacro("\\long", "");
//////////////////////////////////////////////////////////////////////
// Grouping
// \let\bgroup={ \let\egroup=}
defineMacro("\\bgroup", "{");
defineMacro("\\egroup", "}");
// Symbols from latex.ltx:
// \def~{\nobreakspace{}}
// \def\lq{`}
// \def\rq{'}
// \def \aa {\r a}
defineMacro("~", "\\nobreakspace");
defineMacro("\\lq", "`");
defineMacro("\\rq", "'");
defineMacro("\\aa", "\\r a");
defineMacro("\\Bbbk", "\\Bbb{k}");
// \mathstrut from the TeXbook, p 360
defineMacro("\\mathstrut", "\\vphantom{(}");
// \underbar from TeXbook p 353
defineMacro("\\underbar", "\\underline{\\text{#1}}");
//////////////////////////////////////////////////////////////////////
// LaTeX_2ε
// \vdots{\vbox{\baselineskip4\p@ \lineskiplimit\z@
// \kern6\p@\hbox{.}\hbox{.}\hbox{.}}}
// We'll call \varvdots, which gets a glyph from symbols.js.
// The zero-width rule gets us an equivalent to the vertical 6pt kern.
defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("\u22ee", "\\vdots");
// {array} environment gaps
defineMacro("\\arraystretch", "1"); // line spacing factor times 12pt
defineMacro("\\arraycolsep", "6pt"); // half the width separating columns
//////////////////////////////////////////////////////////////////////
// amsmath.sty
// http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf
//\newcommand{\substack}[1]{\subarray{c}#1\endsubarray}
defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
// \def\iff{\DOTSB\;\Longleftrightarrow\;}
// \def\implies{\DOTSB\;\Longrightarrow\;}
// \def\impliedby{\DOTSB\;\Longleftarrow\;}
defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
// AMSMath's automatic \dots, based on \mdots@@ macro.
const dotsByToken = {
",": "\\dotsc",
"\\not": "\\dotsb",
// \keybin@ checks for the following:
"+": "\\dotsb",
"=": "\\dotsb",
"<": "\\dotsb",
">": "\\dotsb",
"-": "\\dotsb",
"*": "\\dotsb",
":": "\\dotsb",
// Symbols whose definition starts with \DOTSB:
"\\DOTSB": "\\dotsb",
"\\coprod": "\\dotsb",
"\\bigvee": "\\dotsb",
"\\bigwedge": "\\dotsb",
"\\biguplus": "\\dotsb",
"\\bigcap": "\\dotsb",
"\\bigcup": "\\dotsb",
"\\prod": "\\dotsb",
"\\sum": "\\dotsb",
"\\bigotimes": "\\dotsb",
"\\bigoplus": "\\dotsb",
"\\bigodot": "\\dotsb",
"\\bigsqcap": "\\dotsb",
"\\bigsqcup": "\\dotsb",
"\\bigtimes": "\\dotsb",
"\\And": "\\dotsb",
"\\longrightarrow": "\\dotsb",
"\\Longrightarrow": "\\dotsb",
"\\longleftarrow": "\\dotsb",
"\\Longleftarrow": "\\dotsb",
"\\longleftrightarrow": "\\dotsb",
"\\Longleftrightarrow": "\\dotsb",
"\\mapsto": "\\dotsb",
"\\longmapsto": "\\dotsb",
"\\hookrightarrow": "\\dotsb",
"\\doteq": "\\dotsb",
// Symbols whose definition starts with \mathbin:
"\\mathbin": "\\dotsb",
// Symbols whose definition starts with \mathrel:
"\\mathrel": "\\dotsb",
"\\relbar": "\\dotsb",
"\\Relbar": "\\dotsb",
"\\xrightarrow": "\\dotsb",
"\\xleftarrow": "\\dotsb",
// Symbols whose definition starts with \DOTSI:
"\\DOTSI": "\\dotsi",
"\\int": "\\dotsi",
"\\oint": "\\dotsi",
"\\iint": "\\dotsi",
"\\iiint": "\\dotsi",
"\\iiiint": "\\dotsi",
"\\idotsint": "\\dotsi",
// Symbols whose definition starts with \DOTSX:
"\\DOTSX": "\\dotsx"
};
defineMacro("\\dots", function(context) {
// TODO: If used in text mode, should expand to \textellipsis.
// However, in Temml, \textellipsis and \ldots behave the same
// (in text mode), and it's unlikely we'd see any of the math commands
// that affect the behavior of \dots when in text mode. So fine for now
// (until we support \ifmmode ... \else ... \fi).
let thedots = "\\dotso";
const next = context.expandAfterFuture().text;
if (next in dotsByToken) {
thedots = dotsByToken[next];
} else if (next.slice(0, 4) === "\\not") {
thedots = "\\dotsb";
} else if (next in symbols.math) {
if (["bin", "rel"].includes(symbols.math[next].group)) {
thedots = "\\dotsb";
}
}
return thedots;
});
const spaceAfterDots = {
// \rightdelim@ checks for the following:
")": true,
"]": true,
"\\rbrack": true,
"\\}": true,
"\\rbrace": true,
"\\rangle": true,
"\\rceil": true,
"\\rfloor": true,
"\\rgroup": true,
"\\rmoustache": true,
"\\right": true,
"\\bigr": true,
"\\biggr": true,
"\\Bigr": true,
"\\Biggr": true,
// \extra@ also tests for the following:
$: true,
// \extrap@ checks for the following:
";": true,
".": true,
",": true
};
defineMacro("\\dotso", function(context) {
const next = context.future().text;
if (next in spaceAfterDots) {
return "\\ldots\\,";
} else {
return "\\ldots";
}
});
defineMacro("\\dotsc", function(context) {
const next = context.future().text;
// \dotsc uses \extra@ but not \extrap@, instead specially checking for
// ';' and '.', but doesn't check for ','.
if (next in spaceAfterDots && next !== ",") {
return "\\ldots\\,";
} else {
return "\\ldots";
}
});
defineMacro("\\cdots", function(context) {
const next = context.future().text;
if (next in spaceAfterDots) {
return "\\@cdots\\,";
} else {
return "\\@cdots";
}
});
defineMacro("\\dotsb", "\\cdots");
defineMacro("\\dotsm", "\\cdots");
defineMacro("\\dotsi", "\\!\\cdots");
defineMacro("\\idotsint", "\\dotsi");
// amsmath doesn't actually define \dotsx, but \dots followed by a macro
// starting with \DOTSX implies \dotso, and then \extra@ detects this case
// and forces the added `\,`.
defineMacro("\\dotsx", "\\ldots\\,");
// \let\DOTSI\relax
// \let\DOTSB\relax
// \let\DOTSX\relax
defineMacro("\\DOTSI", "\\relax");
defineMacro("\\DOTSB", "\\relax");
defineMacro("\\DOTSX", "\\relax");
// Spacing, based on amsmath.sty's override of LaTeX defaults
// \DeclareRobustCommand{\tmspace}[3]{%
// \ifmmode\mskip#1#2\else\kern#1#3\fi\relax}
defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
// \renewcommand{\,}{\tmspace+\thinmuskip{.1667em}}
// TODO: math mode should use \thinmuskip
defineMacro("\\,", "{\\tmspace+{3mu}{.1667em}}");
// \let\thinspace\,
defineMacro("\\thinspace", "\\,");
// \def\>{\mskip\medmuskip}
// \renewcommand{\:}{\tmspace+\medmuskip{.2222em}}
// TODO: \> and math mode of \: should use \medmuskip = 4mu plus 2mu minus 4mu
defineMacro("\\>", "\\mskip{4mu}");
defineMacro("\\:", "{\\tmspace+{4mu}{.2222em}}");
// \let\medspace\:
defineMacro("\\medspace", "\\:");
// \renewcommand{\;}{\tmspace+\thickmuskip{.2777em}}
// TODO: math mode should use \thickmuskip = 5mu plus 5mu
defineMacro("\\;", "{\\tmspace+{5mu}{.2777em}}");
// \let\thickspace\;
defineMacro("\\thickspace", "\\;");
// \renewcommand{\!}{\tmspace-\thinmuskip{.1667em}}
// TODO: math mode should use \thinmuskip
defineMacro("\\!", "{\\tmspace-{3mu}{.1667em}}");
// \let\negthinspace\!
defineMacro("\\negthinspace", "\\!");
// \newcommand{\negmedspace}{\tmspace-\medmuskip{.2222em}}
// TODO: math mode should use \medmuskip
defineMacro("\\negmedspace", "{\\tmspace-{4mu}{.2222em}}");
// \newcommand{\negthickspace}{\tmspace-\thickmuskip{.2777em}}
// TODO: math mode should use \thickmuskip
defineMacro("\\negthickspace", "{\\tmspace-{5mu}{.277em}}");
// \def\enspace{\kern.5em }
defineMacro("\\enspace", "\\kern.5em ");
// \def\enskip{\hskip.5em\relax}
defineMacro("\\enskip", "\\hskip.5em\\relax");
// \def\quad{\hskip1em\relax}
defineMacro("\\quad", "\\hskip1em\\relax");
// \def\qquad{\hskip2em\relax}
defineMacro("\\qquad", "\\hskip2em\\relax");
defineMacro("\\AA", "\\TextOrMath{\\Angstrom}{\\mathring{A}}\\relax");
// \tag@in@display form of \tag
defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
defineMacro("\\tag@paren", "\\tag@literal{({#1})}");
defineMacro("\\tag@literal", (context) => {
if (context.macros.get("\\df@tag")) {
throw new ParseError("Multiple \\tag");
}
return "\\gdef\\df@tag{\\text{#1}}";
});
defineMacro("\\notag", "\\nonumber");
defineMacro("\\nonumber", "\\gdef\\@eqnsw{0}");
// \renewcommand{\bmod}{\nonscript\mskip-\medmuskip\mkern5mu\mathbin
// {\operator@font mod}\penalty900
// \mkern5mu\nonscript\mskip-\medmuskip}
// \newcommand{\pod}[1]{\allowbreak
// \if@display\mkern18mu\else\mkern8mu\fi(#1)}
// \renewcommand{\pmod}[1]{\pod{{\operator@font mod}\mkern6mu#1}}
// \newcommand{\mod}[1]{\allowbreak\if@display\mkern18mu
// \else\mkern12mu\fi{\operator@font mod}\,\,#1}
// TODO: math mode should use \medmuskip = 4mu plus 2mu minus 4mu
defineMacro("\\bmod", "\\mathbin{\\text{mod}}");
defineMacro(
"\\pod",
"\\allowbreak" + "\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"
);
defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
defineMacro(
"\\mod",
"\\allowbreak" +
"\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}" +
"{\\rm mod}\\,\\,#1"
);
//////////////////////////////////////////////////////////////////////
// LaTeX source2e
// \expandafter\let\expandafter\@normalcr
// \csname\expandafter\@gobble\string\\ \endcsname
// \DeclareRobustCommand\newline{\@normalcr\relax}
defineMacro("\\newline", "\\\\\\relax");
// \def\TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@}
// TODO: Doesn't normally work in math mode because \@ fails.
defineMacro("\\TeX", "\\textrm{T}\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125em\\textrm{X}");
defineMacro(
"\\LaTeX",
"\\textrm{L}\\kern-.35em\\raisebox{0.2em}{\\scriptstyle A}\\kern-.15em\\TeX"
);
defineMacro(
"\\Temml",
// eslint-disable-next-line max-len
"\\textrm{T}\\kern-0.2em\\lower{0.2em}{\\textrm{E}}\\kern-0.08em{\\textrm{M}\\kern-0.08em\\raise{0.2em}\\textrm{M}\\kern-0.08em\\textrm{L}}"
);
// \DeclareRobustCommand\hspace{\@ifstar\@hspacer\@hspace}
// \def\@hspace#1{\hskip #1\relax}
// \def\@hspacer#1{\vrule \@width\z@\nobreak
// \hskip #1\hskip \z@skip}
defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
defineMacro("\\@hspace", "\\hskip #1\\relax");
defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");
defineMacro("\\colon", `\\mathpunct{\\char"3a}`);
//////////////////////////////////////////////////////////////////////
// mathtools.sty
defineMacro("\\prescript", "\\pres@cript{_{#1}^{#2}}{}{#3}");
//\providecommand\ordinarycolon{:}
defineMacro("\\ordinarycolon", `\\char"3a`);
// Raise to center on the math axis, as closely as possible.
defineMacro("\\vcentcolon", "\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}}");
// \providecommand*\coloneq{\vcentcolon\mathrel{\mkern-1.2mu}\mathrel{-}}
defineMacro("\\coloneq", '\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"2212}');
// \providecommand*\Coloneq{\dblcolon\mathrel{\mkern-1.2mu}\mathrel{-}}
defineMacro("\\Coloneq", '\\mathrel{\\char"2237\\char"2212}');
// \providecommand*\Eqqcolon{=\mathrel{\mkern-1.2mu}\dblcolon}
defineMacro("\\Eqqcolon", '\\mathrel{\\char"3d\\char"2237}');
// \providecommand*\Eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\dblcolon}
defineMacro("\\Eqcolon", '\\mathrel{\\char"2212\\char"2237}');
// \providecommand*\colonapprox{\vcentcolon\mathrel{\mkern-1.2mu}\approx}
defineMacro("\\colonapprox", '\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"2248}');
// \providecommand*\Colonapprox{\dblcolon\mathrel{\mkern-1.2mu}\approx}
defineMacro("\\Colonapprox", '\\mathrel{\\char"2237\\char"2248}');
// \providecommand*\colonsim{\vcentcolon\mathrel{\mkern-1.2mu}\sim}
defineMacro("\\colonsim", '\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"223c}');
// \providecommand*\Colonsim{\dblcolon\mathrel{\mkern-1.2mu}\sim}
defineMacro("\\Colonsim", '\\mathrel{\\raisebox{0.035em}{\\ordinarycolon}\\char"223c}');
//////////////////////////////////////////////////////////////////////
// colonequals.sty
// Alternate names for mathtools's macros:
defineMacro("\\ratio", "\\vcentcolon");
defineMacro("\\coloncolon", "\\dblcolon");
defineMacro("\\colonequals", "\\coloneqq");
defineMacro("\\coloncolonequals", "\\Coloneqq");
defineMacro("\\equalscolon", "\\eqqcolon");
defineMacro("\\equalscoloncolon", "\\Eqqcolon");
defineMacro("\\colonminus", "\\coloneq");
defineMacro("\\coloncolonminus", "\\Coloneq");
defineMacro("\\minuscolon", "\\eqcolon");
defineMacro("\\minuscoloncolon", "\\Eqcolon");
// \colonapprox name is same in mathtools and colonequals.
defineMacro("\\coloncolonapprox", "\\Colonapprox");
// \colonsim name is same in mathtools and colonequals.
defineMacro("\\coloncolonsim", "\\Colonsim");
// Present in newtxmath, pxfonts and txfonts
defineMacro("\\notni", "\\mathrel{\\char`\u220C}");
defineMacro("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");
defineMacro("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");
//////////////////////////////////////////////////////////////////////
// From amsopn.sty
defineMacro("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");
defineMacro("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");
defineMacro("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{\\text{lim}}}");
defineMacro("\\varliminf", "\\DOTSB\\operatorname*{\\underline{\\text{lim}}}");
defineMacro("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{\\text{lim}}}");
defineMacro("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{\\text{lim}}}");
defineMacro("\\centerdot", "{\\medspace\\rule{0.167em}{0.189em}\\medspace}");
//////////////////////////////////////////////////////////////////////
// statmath.sty
// https://ctan.math.illinois.edu/macros/latex/contrib/statmath/statmath.pdf
defineMacro("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");
defineMacro("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");
defineMacro("\\plim", "\\DOTSB\\operatorname*{plim}");
//////////////////////////////////////////////////////////////////////
// MnSymbol.sty
defineMacro("\\leftmodels", "\\mathop{\\reflectbox{$\\models$}}");
//////////////////////////////////////////////////////////////////////
// braket.sty
// http://ctan.math.washington.edu/tex-archive/macros/latex/contrib/braket/braket.pdf
defineMacro("\\bra", "\\mathinner{\\langle{#1}|}");
defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}");
defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}");
defineMacro("\\Bra", "\\left\\langle#1\\right|");
defineMacro("\\Ket", "\\left|#1\\right\\rangle");
// A helper for \Braket and \Set
const replaceVert = (argStr, match) => {
const ch = match[0] === "|" ? "\\vert" : "\\Vert";
const replaceStr = `}\\,\\middle${ch}\\,{`;
return argStr.slice(0, match.index) + replaceStr + argStr.slice(match.index + match[0].length)
};
defineMacro("\\Braket", function(context) {
let argStr = recreateArgStr(context);
const regEx = /\|\||\||\\\|/g;
let match;
while ((match = regEx.exec(argStr)) !== null) {
argStr = replaceVert(argStr, match);
}
return "\\left\\langle{" + argStr + "}\\right\\rangle"
});
defineMacro("\\Set", function(context) {
let argStr = recreateArgStr(context);
const match = /\|\||\||\\\|/.exec(argStr);
if (match) {
argStr = replaceVert(argStr, match);
}
return "\\left\\{\\:{" + argStr + "}\\:\\right\\}"
});
defineMacro("\\set", function(context) {
const argStr = recreateArgStr(context);
return "\\{{" + argStr.replace(/\|/, "}\\mid{") + "}\\}"
});
//////////////////////////////////////////////////////////////////////
// actuarialangle.dtx
defineMacro("\\angln", "{\\angl n}");
//////////////////////////////////////////////////////////////////////
// derivative.sty
defineMacro("\\odv", "\\@ifstar\\odv@next\\odv@numerator");
defineMacro("\\odv@numerator", "\\frac{\\mathrm{d}#1}{\\mathrm{d}#2}");
defineMacro("\\odv@next", "\\frac{\\mathrm{d}}{\\mathrm{d}#2}#1");
defineMacro("\\pdv", "\\@ifstar\\pdv@next\\pdv@numerator");
const pdvHelper = args => {
const numerator = args[0][0].text;
const denoms = stringFromArg(args[1]).split(",");
const power = String(denoms.length);
const numOp = power === "1" ? "\\partial" : `\\partial^${power}`;
let denominator = "";
denoms.map(e => { denominator += "\\partial " + e.trim() + "\\,";});
return [numerator, numOp, denominator.replace(/\\,$/, "")]
};
defineMacro("\\pdv@numerator", function(context) {
const [numerator, numOp, denominator] = pdvHelper(context.consumeArgs(2));
return `\\frac{${numOp} ${numerator}}{${denominator}}`
});
defineMacro("\\pdv@next", function(context) {
const [numerator, numOp, denominator] = pdvHelper(context.consumeArgs(2));
return `\\frac{${numOp}}{${denominator}} ${numerator}`
});
//////////////////////////////////////////////////////////////////////
// upgreek.dtx
defineMacro("\\upalpha", "\\up@greek{\\alpha}");
defineMacro("\\upbeta", "\\up@greek{\\beta}");
defineMacro("\\upgamma", "\\up@greek{\\gamma}");
defineMacro("\\updelta", "\\up@greek{\\delta}");
defineMacro("\\upepsilon", "\\up@greek{\\epsilon}");
defineMacro("\\upzeta", "\\up@greek{\\zeta}");
defineMacro("\\upeta", "\\up@greek{\\eta}");
defineMacro("\\uptheta", "\\up@greek{\\theta}");
defineMacro("\\upiota", "\\up@greek{\\iota}");
defineMacro("\\upkappa", "\\up@greek{\\kappa}");
defineMacro("\\uplambda", "\\up@greek{\\lambda}");
defineMacro("\\upmu", "\\up@greek{\\mu}");
defineMacro("\\upnu", "\\up@greek{\\nu}");
defineMacro("\\upxi", "\\up@greek{\\xi}");
defineMacro("\\upomicron", "\\up@greek{\\omicron}");
defineMacro("\\uppi", "\\up@greek{\\pi}");
defineMacro("\\upalpha", "\\up@greek{\\alpha}");
defineMacro("\\uprho", "\\up@greek{\\rho}");
defineMacro("\\upsigma", "\\up@greek{\\sigma}");
defineMacro("\\uptau", "\\up@greek{\\tau}");
defineMacro("\\upupsilon", "\\up@greek{\\upsilon}");
defineMacro("\\upphi", "\\up@greek{\\phi}");
defineMacro("\\upchi", "\\up@greek{\\chi}");
defineMacro("\\uppsi", "\\up@greek{\\psi}");
defineMacro("\\upomega", "\\up@greek{\\omega}");
//////////////////////////////////////////////////////////////////////
// cmll package
defineMacro("\\invamp", '\\mathbin{\\char"214b}');
defineMacro("\\parr", '\\mathbin{\\char"214b}');
defineMacro("\\with", '\\mathbin{\\char"26}');
defineMacro("\\multimapinv", '\\mathrel{\\char"27dc}');
defineMacro("\\multimapboth", '\\mathrel{\\char"29df}');
defineMacro("\\scoh", '{\\mkern5mu\\char"2322\\mkern5mu}');
defineMacro("\\sincoh", '{\\mkern5mu\\char"2323\\mkern5mu}');
defineMacro("\\coh", `{\\mkern5mu\\rule{}{0.7em}\\mathrlap{\\smash{\\raise2mu{\\char"2322}}}
{\\smash{\\lower4mu{\\char"2323}}}\\mkern5mu}`);
defineMacro("\\incoh", `{\\mkern5mu\\rule{}{0.7em}\\mathrlap{\\smash{\\raise2mu{\\char"2323}}}
{\\smash{\\lower4mu{\\char"2322}}}\\mkern5mu}`);
//////////////////////////////////////////////////////////////////////
// chemstyle package
defineMacro("\\standardstate", "\\text{\\tiny\\char`⦵}");
/* eslint-disable */
/* -*- Mode: JavaScript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* Temml mhchem.js
*
* This file implements a Temml version of mhchem version 3.3.0.
* It is adapted from MathJax/extensions/TeX/mhchem.js
* It differs from the MathJax version as follows:
* 1. The interface is changed so that it can be called from Temml, not MathJax.
* 2. \rlap and \llap are replaced with \mathrlap and \mathllap.
* 3. The reaction arrow code is simplified. All reaction arrows are rendered
* using Temml extensible arrows instead of building non-extensible arrows.
* 4. The ~bond forms are composed entirely of \rule elements.
* 5. Two dashes in _getBond are wrapped in braces to suppress spacing. i.e., {-}
* 6. The electron dot uses \textbullet instead of \bullet.
* 7. \smash[T] has been removed. (WebKit hides anything inside \smash{…})
*
* This code, as other Temml code, is released under the MIT license.
*
* /*************************************************************
*
* MathJax/extensions/TeX/mhchem.js
*
* Implements the \ce command for handling chemical formulas
* from the mhchem LaTeX package.
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2011-2015 The MathJax Consortium
* Copyright (c) 2015-2018 Martin Hensel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// Coding Style
// - use '' for identifiers that can by minified/uglified
// - use "" for strings that need to stay untouched
// version: "3.3.0" for MathJax and Temml
// Add \ce, \pu, and \tripleDash to the Temml macros.
defineMacro("\\ce", function(context) {
return chemParse(context.consumeArgs(1)[0], "ce")
});
defineMacro("\\pu", function(context) {
return chemParse(context.consumeArgs(1)[0], "pu");
});
// Math fonts do not include glyphs for the ~ form of bonds. So we'll send path geometry
// So we'll compose characters built from \rule elements.
defineMacro("\\uniDash", `{\\rule{0.672em}{0.06em}}`)
defineMacro("\\triDash", `{\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}}`)
defineMacro("\\tripleDash", `\\kern0.075em\\raise0.25em{\\triDash}\\kern0.075em`)
defineMacro("\\tripleDashOverLine", `\\kern0.075em\\mathrlap{\\raise0.125em{\\uniDash}}\\raise0.34em{\\triDash}\\kern0.075em`)
defineMacro("\\tripleDashOverDoubleLine", `\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\triDash}}\\raise0.27em{\\uniDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em`)
defineMacro("\\tripleDashBetweenDoubleLine", `\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\uniDash}}\\raise0.27em{\\triDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em`)
//
// This is the main function for handing the \ce and \pu commands.
// It takes the argument to \ce or \pu and returns the corresponding TeX string.
//
var chemParse = function (tokens, stateMachine) {
// Recreate the argument string from Temml's array of tokens.
var str = "";
var expectedLoc = tokens.length && tokens[tokens.length - 1].loc.start
for (var i = tokens.length - 1; i >= 0; i--) {
if(tokens[i].loc.start > expectedLoc) {
// context.consumeArgs has eaten a space.
str += " ";
expectedLoc = tokens[i].loc.start;
}
str += tokens[i].text;
expectedLoc += tokens[i].text.length;
}
// Call the mhchem core parser.
var tex = texify.go(mhchemParser.go(str, stateMachine));
return tex;
};
//
// Core parser for mhchem syntax (recursive)
//
/** @type {MhchemParser} */
var mhchemParser = {
//
// Parses mchem \ce syntax
//
// Call like
// go("H2O");
//
go: function (input, stateMachine) {
if (!input) { return []; }
if (stateMachine === undefined) { stateMachine = 'ce'; }
var state = '0';
//
// String buffers for parsing:
//
// buffer.a == amount
// buffer.o == element
// buffer.b == left-side superscript
// buffer.p == left-side subscript
// buffer.q == right-side subscript
// buffer.d == right-side superscript
//
// buffer.r == arrow
// buffer.rdt == arrow, script above, type
// buffer.rd == arrow, script above, content
// buffer.rqt == arrow, script below, type
// buffer.rq == arrow, script below, content
//
// buffer.text_
// buffer.rm
// etc.
//
// buffer.parenthesisLevel == int, starting at 0
// buffer.sb == bool, space before
// buffer.beginsWithBond == bool
//
// These letters are also used as state names.
//
// Other states:
// 0 == begin of main part (arrow/operator unlikely)
// 1 == next entity
// 2 == next entity (arrow/operator unlikely)
// 3 == next atom
// c == macro
//
/** @type {Buffer} */
var buffer = {};
buffer['parenthesisLevel'] = 0;
input = input.replace(/\n/g, " ");
input = input.replace(/[\u2212\u2013\u2014\u2010]/g, "-");
input = input.replace(/[\u2026]/g, "...");
//
// Looks through mhchemParser.transitions, to execute a matching action
// (recursive)
//
var lastInput;
var watchdog = 10;
/** @type {ParserOutput[]} */
var output = [];
while (true) {
if (lastInput !== input) {
watchdog = 10;
lastInput = input;
} else {
watchdog--;
}
//
// Find actions in transition table
//
var machine = mhchemParser.stateMachines[stateMachine];
var t = machine.transitions[state] || machine.transitions['*'];
iterateTransitions:
for (var i=0; i<t.length; i++) {
var matches = mhchemParser.patterns.match_(t[i].pattern, input);
if (matches) {
//
// Execute actions
//
var task = t[i].task;
for (var iA=0; iA<task.action_.length; iA++) {
var o;
//
// Find and execute action
//
if (machine.actions[task.action_[iA].type_]) {
o = machine.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
} else if (mhchemParser.actions[task.action_[iA].type_]) {
o = mhchemParser.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
} else {
throw ["MhchemBugA", "mhchem bug A. Please report. (" + task.action_[iA].type_ + ")"]; // Trying to use non-existing action
}
//
// Add output
//
mhchemParser.concatArray(output, o);
}
//
// Set next state,
// Shorten input,
// Continue with next character
// (= apply only one transition per position)
//
state = task.nextState || state;
if (input.length > 0) {
if (!task.revisit) {
input = matches.remainder;
}
if (!task.toContinue) {
break iterateTransitions;
}
} else {
return output;
}
}
}
//
// Prevent infinite loop
//
if (watchdog <= 0) {
throw ["MhchemBugU", "mhchem bug U. Please report."]; // Unexpected character
}
}
},
concatArray: function (a, b) {
if (b) {
if (Array.isArray(b)) {
for (var iB=0; iB<b.length; iB++) {
a.push(b[iB]);
}
} else {
a.push(b);
}
}
},
patterns: {
//
// Matching patterns
// either regexps or function that return null or {match_:"a", remainder:"bc"}
//
patterns: {
// property names must not look like integers ("2") for correct property traversal order, later on
'empty': /^$/,
'else': /^./,
'else2': /^./,
'space': /^\s/,
'space A': /^\s(?=[A-Z\\$])/,
'space$': /^\s$/,
'a-z': /^[a-z]/,
'x': /^x/,
'x$': /^x$/,
'i$': /^i$/,
'letters': /^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,
'\\greek': /^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,
'one lowercase latin letter $': /^(?:([a-z])(?:$|[^a-zA-Z]))$/,
'$one lowercase latin letter$ $': /^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,
'one lowercase greek letter $': /^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,
'digits': /^[0-9]+/,
'-9.,9': /^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,
'-9.,9 no missing 0': /^[+\-]?[0-9]+(?:[.,][0-9]+)?/,
'(-)(9.,9)(e)(99)': function (input) {
var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);
if (m && m[0]) {
return { match_: m.splice(1), remainder: input.substr(m[0].length) };
}
return null;
},
'(-)(9)^(-9)': function (input) {
var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);
if (m && m[0]) {
return { match_: m.splice(1), remainder: input.substr(m[0].length) };
}
return null;
},
'state of aggregation $': function (input) { // ... or crystal system
var a = mhchemParser.patterns.findObserveGroups(input, "", /^\([a-z]{1,3}(?=[\),])/, ")", ""); // (aq), (aq,$\infty$), (aq, sat)
if (a && a.remainder.match(/^($|[\s,;\)\]\}])/)) { return a; } // AND end of 'phrase'
var m = input.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/); // OR crystal system ($o$) (\ca$c$)
if (m) {
return { match_: m[0], remainder: input.substr(m[0].length) };
}
return null;
},
'_{(state of aggregation)}$': /^_\{(\([a-z]{1,3}\))\}/,
'{[(': /^(?:\\\{|\[|\()/,
')]}': /^(?:\)|\]|\\\})/,
', ': /^[,;]\s*/,
',': /^[,;]/,
'.': /^[.]/,
'. ': /^([.\u22C5\u00B7\u2022])\s*/,
'...': /^\.\.\.(?=$|[^.])/,
'* ': /^([*])\s*/,
'^{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "^{", "", "", "}"); },
'^($...$)': function (input) { return mhchemParser.patterns.findObserveGroups(input, "^", "$", "$", ""); },
'^a': /^\^([0-9]+|[^\\_])/,
'^\\x{}{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true); },
'^\\x{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", ""); },
'^\\x': /^\^(\\[a-zA-Z]+)\s*/,
'^(-1)': /^\^(-?\d+)/,
'\'': /^'/,
'_{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "_{", "", "", "}"); },
'_($...$)': function (input) { return mhchemParser.patterns.findObserveGroups(input, "_", "$", "$", ""); },
'_9': /^_([+\-]?[0-9]+|[^\\])/,
'_\\x{}{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true); },
'_\\x{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", ""); },
'_\\x': /^_(\\[a-zA-Z]+)\s*/,
'^_': /^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,
'{}': /^\{\}/,
'{...}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "", "{", "}", ""); },
'{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "{", "", "", "}"); },
'$...$': function (input) { return mhchemParser.patterns.findObserveGroups(input, "", "$", "$", ""); },
'${(...)}$': function (input) { return mhchemParser.patterns.findObserveGroups(input, "${", "", "", "}$"); },
'$(...)$': function (input) { return mhchemParser.patterns.findObserveGroups(input, "$", "", "", "$"); },
'=<>': /^[=<>]/,
'#': /^[#\u2261]/,
'+': /^\+/,
'-$': /^-(?=[\s_},;\]/]|$|\([a-z]+\))/, // -space -, -; -] -/ -$ -state-of-aggregation
'-9': /^-(?=[0-9])/,
'- orbital overlap': /^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,
'-': /^-/,
'pm-operator': /^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,
'operator': /^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,
'arrowUpDown': /^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,
'\\bond{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\bond{", "", "", "}"); },
'->': /^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,
'CMT': /^[CMT](?=\[)/,
'[(...)]': function (input) { return mhchemParser.patterns.findObserveGroups(input, "[", "", "", "]"); },
'1st-level escape': /^(&|\\\\|\\hline)\s*/,
'\\,': /^(?:\\[,\ ;:])/, // \\x - but output no space before
'\\x{}{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true); },
'\\x{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", ""); },
'\\ca': /^\\ca(?:\s+|(?![a-zA-Z]))/,
'\\x': /^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,
'orbital': /^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/, // only those with numbers in front, because the others will be formatted correctly anyway
'others': /^[\/~|]/,
'\\frac{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\frac{", "", "", "}", "{", "", "", "}"); },
'\\overset{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\overset{", "", "", "}", "{", "", "", "}"); },
'\\underset{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\underset{", "", "", "}", "{", "", "", "}"); },
'\\underbrace{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\underbrace{", "", "", "}_", "{", "", "", "}"); },
'\\color{(...)}0': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}"); },
'\\color{(...)}{(...)}1': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}", "{", "", "", "}"); },
'\\color(...){(...)}2': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\color", "\\", "", /^(?=\{)/, "{", "", "", "}"); },
'\\ce{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\ce{", "", "", "}"); },
'oxidation$': /^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,
'd-oxidation$': /^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/, // 0 could be oxidation or charge
'roman numeral': /^[IVX]+/,
'1/2$': /^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,
'amount': function (input) {
var match;
// e.g. 2, 0.5, 1/2, -2, n/2, +; $a$ could be added later in parsing
match = input.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/);
if (match) {
return { match_: match[0], remainder: input.substr(match[0].length) };
}
var a = mhchemParser.patterns.findObserveGroups(input, "", "$", "$", "");
if (a) { // e.g. $2n-1$, $-$
match = a.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/);
if (match) {
return { match_: match[0], remainder: input.substr(match[0].length) };
}
}
return null;
},
'amount2': function (input) { return this['amount'](input); },
'(KV letters),': /^(?:[A-Z][a-z]{0,2}|i)(?=,)/,
'formula$': function (input) {
if (input.match(/^\([a-z]+\)$/)) { return null; } // state of aggregation = no formula
var match = input.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);
if (match) {
return { match_: match[0], remainder: input.substr(match[0].length) };
}
return null;
},
'uprightEntities': /^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,
'/': /^\s*(\/)\s*/,
'//': /^\s*(\/\/)\s*/,
'*': /^\s*[*.]\s*/
},
findObserveGroups: function (input, begExcl, begIncl, endIncl, endExcl, beg2Excl, beg2Incl, end2Incl, end2Excl, combine) {
/** @type {{(input: string, pattern: string | RegExp): string | string[] | null;}} */
var _match = function (input, pattern) {
if (typeof pattern === "string") {
if (input.indexOf(pattern) !== 0) { return null; }
return pattern;
} else {
var match = input.match(pattern);
if (!match) { return null; }
return match[0];
}
};
/** @type {{(input: string, i: number, endChars: string | RegExp): {endMatchBegin: number, endMatchEnd: number} | null;}} */
var _findObserveGroups = function (input, i, endChars) {
var braces = 0;
while (i < input.length) {
var a = input.charAt(i);
var match = _match(input.substr(i), endChars);
if (match !== null && braces === 0) {
return { endMatchBegin: i, endMatchEnd: i + match.length };
} else if (a === "{") {
braces++;
} else if (a === "}") {
if (braces === 0) {
throw ["ExtraCloseMissingOpen", "Extra close brace or missing open brace"];
} else {
braces--;
}
}
i++;
}
if (braces > 0) {
return null;
}
return null;
};
var match = _match(input, begExcl);
if (match === null) { return null; }
input = input.substr(match.length);
match = _match(input, begIncl);
if (match === null) { return null; }
var e = _findObserveGroups(input, match.length, endIncl || endExcl);
if (e === null) { return null; }
var match1 = input.substring(0, (endIncl ? e.endMatchEnd : e.endMatchBegin));
if (!(beg2Excl || beg2Incl)) {
return {
match_: match1,
remainder: input.substr(e.endMatchEnd)
};
} else {
var group2 = this.findObserveGroups(input.substr(e.endMatchEnd), beg2Excl, beg2Incl, end2Incl, end2Excl);
if (group2 === null) { return null; }
/** @type {string[]} */
var matchRet = [match1, group2.match_];
return {
match_: (combine ? matchRet.join("") : matchRet),
remainder: group2.remainder
};
}
},
//
// Matching function
// e.g. match("a", input) will look for the regexp called "a" and see if it matches
// returns null or {match_:"a", remainder:"bc"}
//
match_: function (m, input) {
var pattern = mhchemParser.patterns.patterns[m];
if (pattern === undefined) {
throw ["MhchemBugP", "mhchem bug P. Please report. (" + m + ")"]; // Trying to use non-existing pattern
} else if (typeof pattern === "function") {
return mhchemParser.patterns.patterns[m](input); // cannot use cached var pattern here, because some pattern functions need this===mhchemParser
} else { // RegExp
var match = input.match(pattern);
if (match) {
var mm;
if (match[2]) {
mm = [ match[1], match[2] ];
} else if (match[1]) {
mm = match[1];
} else {
mm = match[0];
}
return { match_: mm, remainder: input.substr(match[0].length) };
}
return null;
}
}
},
//
// Generic state machine actions
//
actions: {
'a=': function (buffer, m) { buffer.a = (buffer.a || "") + m; },
'b=': function (buffer, m) { buffer.b = (buffer.b || "") + m; },
'p=': function (buffer, m) { buffer.p = (buffer.p || "") + m; },
'o=': function (buffer, m) { buffer.o = (buffer.o || "") + m; },
'q=': function (buffer, m) { buffer.q = (buffer.q || "") + m; },
'd=': function (buffer, m) { buffer.d = (buffer.d || "") + m; },
'rm=': function (buffer, m) { buffer.rm = (buffer.rm || "") + m; },
'text=': function (buffer, m) { buffer.text_ = (buffer.text_ || "") + m; },
'insert': function (buffer, m, a) { return { type_: a }; },
'insert+p1': function (buffer, m, a) { return { type_: a, p1: m }; },
'insert+p1+p2': function (buffer, m, a) { return { type_: a, p1: m[0], p2: m[1] }; },
'copy': function (buffer, m) { return m; },
'rm': function (buffer, m) { return { type_: 'rm', p1: m || ""}; },
'text': function (buffer, m) { return mhchemParser.go(m, 'text'); },
'{text}': function (buffer, m) {
var ret = [ "{" ];
mhchemParser.concatArray(ret, mhchemParser.go(m, 'text'));
ret.push("}");
return ret;
},
'tex-math': function (buffer, m) { return mhchemParser.go(m, 'tex-math'); },
'tex-math tight': function (buffer, m) { return mhchemParser.go(m, 'tex-math tight'); },
'bond': function (buffer, m, k) { return { type_: 'bond', kind_: k || m }; },
'color0-output': function (buffer, m) { return { type_: 'color0', color: m[0] }; },
'ce': function (buffer, m) { return mhchemParser.go(m); },
'1/2': function (buffer, m) {
/** @type {ParserOutput[]} */
var ret = [];
if (m.match(/^[+\-]/)) {
ret.push(m.substr(0, 1));
m = m.substr(1);
}
var n = m.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);
n[1] = n[1].replace(/\$/g, "");
ret.push({ type_: 'frac', p1: n[1], p2: n[2] });
if (n[3]) {
n[3] = n[3].replace(/\$/g, "");
ret.push({ type_: 'tex-math', p1: n[3] });
}
return ret;
},
'9,9': function (buffer, m) { return mhchemParser.go(m, '9,9'); }
},
//
// createTransitions
// convert { 'letter': { 'state': { action_: 'output' } } } to { 'state' => [ { pattern: 'letter', task: { action_: [{type_: 'output'}] } } ] }
// with expansion of 'a|b' to 'a' and 'b' (at 2 places)
//
createTransitions: function (o) {
var pattern, state;
/** @type {string[]} */
var stateArray;
var i;
//
// 1. Collect all states
//
/** @type {Transitions} */
var transitions = {};
for (pattern in o) {
for (state in o[pattern]) {
stateArray = state.split("|");
o[pattern][state].stateArray = stateArray;
for (i=0; i<stateArray.length; i++) {
transitions[stateArray[i]] = [];
}
}
}
//
// 2. Fill states
//
for (pattern in o) {
for (state in o[pattern]) {
stateArray = o[pattern][state].stateArray || [];
for (i=0; i<stateArray.length; i++) {
//
// 2a. Normalize actions into array: 'text=' ==> [{type_:'text='}]
// (Note to myself: Resolving the function here would be problematic. It would need .bind (for *this*) and currying (for *option*).)
//
/** @type {any} */
var p = o[pattern][state];
if (p.action_) {
p.action_ = [].concat(p.action_);
for (var k=0; k<p.action_.length; k++) {
if (typeof p.action_[k] === "string") {
p.action_[k] = { type_: p.action_[k] };
}
}
} else {
p.action_ = [];
}
//
// 2.b Multi-insert
//
var patternArray = pattern.split("|");
for (var j=0; j<patternArray.length; j++) {
if (stateArray[i] === '*') { // insert into all
for (var t in transitions) {
transitions[t].push({ pattern: patternArray[j], task: p });
}
} else {
transitions[stateArray[i]].push({ pattern: patternArray[j], task: p });
}
}
}
}
}
return transitions;
},
stateMachines: {}
};
//
// Definition of state machines
//
mhchemParser.stateMachines = {
//
// \ce state machines
//
//#region ce
'ce': { // main parser
transitions: mhchemParser.createTransitions({
'empty': {
'*': { action_: 'output' } },
'else': {
'0|1|2': { action_: 'beginsWithBond=false', revisit: true, toContinue: true } },
'oxidation$': {
'0': { action_: 'oxidation-output' } },
'CMT': {
'r': { action_: 'rdt=', nextState: 'rt' },
'rd': { action_: 'rqt=', nextState: 'rdt' } },
'arrowUpDown': {
'0|1|2|as': { action_: [ 'sb=false', 'output', 'operator' ], nextState: '1' } },
'uprightEntities': {
'0|1|2': { action_: [ 'o=', 'output' ], nextState: '1' } },
'orbital': {
'0|1|2|3': { action_: 'o=', nextState: 'o' } },
'->': {
'0|1|2|3': { action_: 'r=', nextState: 'r' },
'a|as': { action_: [ 'output', 'r=' ], nextState: 'r' },
'*': { action_: [ 'output', 'r=' ], nextState: 'r' } },
'+': {
'o': { action_: 'd= kv', nextState: 'd' },
'd|D': { action_: 'd=', nextState: 'd' },
'q': { action_: 'd=', nextState: 'qd' },
'qd|qD': { action_: 'd=', nextState: 'qd' },
'dq': { action_: [ 'output', 'd=' ], nextState: 'd' },
'3': { action_: [ 'sb=false', 'output', 'operator' ], nextState: '0' } },
'amount': {
'0|2': { action_: 'a=', nextState: 'a' } },
'pm-operator': {
'0|1|2|a|as': { action_: [ 'sb=false', 'output', { type_: 'operator', option: '\\pm' } ], nextState: '0' } },
'operator': {
'0|1|2|a|as': { action_: [ 'sb=false', 'output', 'operator' ], nextState: '0' } },
'-$': {
'o|q': { action_: [ 'charge or bond', 'output' ], nextState: 'qd' },
'd': { action_: 'd=', nextState: 'd' },
'D': { action_: [ 'output', { type_: 'bond', option: "-" } ], nextState: '3' },
'q': { action_: 'd=', nextState: 'qd' },
'qd': { action_: 'd=', nextState: 'qd' },
'qD|dq': { action_: [ 'output', { type_: 'bond', option: "-" } ], nextState: '3' } },
'-9': {
'3|o': { action_: [ 'output', { type_: 'insert', option: 'hyphen' } ], nextState: '3' } },
'- orbital overlap': {
'o': { action_: [ 'output', { type_: 'insert', option: 'hyphen' } ], nextState: '2' },
'd': { action_: [ 'output', { type_: 'insert', option: 'hyphen' } ], nextState: '2' } },
'-': {
'0|1|2': { action_: [ { type_: 'output', option: 1 }, 'beginsWithBond=true', { type_: 'bond', option: "-" } ], nextState: '3' },
'3': { action_: { type_: 'bond', option: "-" } },
'a': { action_: [ 'output', { type_: 'insert', option: 'hyphen' } ], nextState: '2' },
'as': { action_: [ { type_: 'output', option: 2 }, { type_: 'bond', option: "-" } ], nextState: '3' },
'b': { action_: 'b=' },
'o': { action_: { type_: '- after o/d', option: false }, nextState: '2' },
'q': { action_: { type_: '- after o/d', option: false }, nextState: '2' },
'd|qd|dq': { action_: { type_: '- after o/d', option: true }, nextState: '2' },
'D|qD|p': { action_: [ 'output', { type_: 'bond', option: "-" } ], nextState: '3' } },
'amount2': {
'1|3': { action_: 'a=', nextState: 'a' } },
'letters': {
'0|1|2|3|a|as|b|p|bp|o': { action_: 'o=', nextState: 'o' },
'q|dq': { action_: ['output', 'o='], nextState: 'o' },
'd|D|qd|qD': { action_: 'o after d', nextState: 'o' } },
'digits': {
'o': { action_: 'q=', nextState: 'q' },
'd|D': { action_: 'q=', nextState: 'dq' },
'q': { action_: [ 'output', 'o=' ], nextState: 'o' },
'a': { action_: 'o=', nextState: 'o' } },
'space A': {
'b|p|bp': {} },
'space': {
'a': { nextState: 'as' },
'0': { action_: 'sb=false' },
'1|2': { action_: 'sb=true' },
'r|rt|rd|rdt|rdq': { action_: 'output', nextState: '0' },
'*': { action_: [ 'output', 'sb=true' ], nextState: '1'} },
'1st-level escape': {
'1|2': { action_: [ 'output', { type_: 'insert+p1', option: '1st-level escape' } ] },
'*': { action_: [ 'output', { type_: 'insert+p1', option: '1st-level escape' } ], nextState: '0' } },
'[(...)]': {
'r|rt': { action_: 'rd=', nextState: 'rd' },
'rd|rdt': { action_: 'rq=', nextState: 'rdq' } },
'...': {
'o|d|D|dq|qd|qD': { action_: [ 'output', { type_: 'bond', option: "..." } ], nextState: '3' },
'*': { action_: [ { type_: 'output', option: 1 }, { type_: 'insert', option: 'ellipsis' } ], nextState: '1' } },
'. |* ': {
'*': { action_: [ 'output', { type_: 'insert', option: 'addition compound' } ], nextState: '1' } },
'state of aggregation $': {
'*': { action_: [ 'output', 'state of aggregation' ], nextState: '1' } },
'{[(': {
'a|as|o': { action_: [ 'o=', 'output', 'parenthesisLevel++' ], nextState: '2' },
'0|1|2|3': { action_: [ 'o=', 'output', 'parenthesisLevel++' ], nextState: '2' },
'*': { action_: [ 'output', 'o=', 'output', 'parenthesisLevel++' ], nextState: '2' } },
')]}': {
'0|1|2|3|b|p|bp|o': { action_: [ 'o=', 'parenthesisLevel--' ], nextState: 'o' },
'a|as|d|D|q|qd|qD|dq': { action_: [ 'output', 'o=', 'parenthesisLevel--' ], nextState: 'o' } },
', ': {
'*': { action_: [ 'output', 'comma' ], nextState: '0' } },
'^_': { // ^ and _ without a sensible argument
'*': { } },
'^{(...)}|^($...$)': {
'0|1|2|as': { action_: 'b=', nextState: 'b' },
'p': { action_: 'b=', nextState: 'bp' },
'3|o': { action_: 'd= kv', nextState: 'D' },
'q': { action_: 'd=', nextState: 'qD' },
'd|D|qd|qD|dq': { action_: [ 'output', 'd=' ], nextState: 'D' } },
'^a|^\\x{}{}|^\\x{}|^\\x|\'': {
'0|1|2|as': { action_: 'b=', nextState: 'b' },
'p': { action_: 'b=', nextState: 'bp' },
'3|o': { action_: 'd= kv', nextState: 'd' },
'q': { action_: 'd=', nextState: 'qd' },
'd|qd|D|qD': { action_: 'd=' },
'dq': { action_: [ 'output', 'd=' ], nextState: 'd' } },
'_{(state of aggregation)}$': {
'd|D|q|qd|qD|dq': { action_: [ 'output', 'q=' ], nextState: 'q' } },
'_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x': {
'0|1|2|as': { action_: 'p=', nextState: 'p' },
'b': { action_: 'p=', nextState: 'bp' },
'3|o': { action_: 'q=', nextState: 'q' },
'd|D': { action_: 'q=', nextState: 'dq' },
'q|qd|qD|dq': { action_: [ 'output', 'q=' ], nextState: 'q' } },
'=<>': {
'0|1|2|3|a|as|o|q|d|D|qd|qD|dq': { action_: [ { type_: 'output', option: 2 }, 'bond' ], nextState: '3' } },
'#': {
'0|1|2|3|a|as|o': { action_: [ { type_: 'output', option: 2 }, { type_: 'bond', option: "#" } ], nextState: '3' } },
'{}': {
'*': { action_: { type_: 'output', option: 1 }, nextState: '1' } },
'{...}': {
'0|1|2|3|a|as|b|p|bp': { action_: 'o=', nextState: 'o' },
'o|d|D|q|qd|qD|dq': { action_: [ 'output', 'o=' ], nextState: 'o' } },
'$...$': {
'a': { action_: 'a=' }, // 2$n$
'0|1|2|3|as|b|p|bp|o': { action_: 'o=', nextState: 'o' }, // not 'amount'
'as|o': { action_: 'o=' },
'q|d|D|qd|qD|dq': { action_: [ 'output', 'o=' ], nextState: 'o' } },
'\\bond{(...)}': {
'*': { action_: [ { type_: 'output', option: 2 }, 'bond' ], nextState: "3" } },
'\\frac{(...)}': {
'*': { action_: [ { type_: 'output', option: 1 }, 'frac-output' ], nextState: '3' } },
'\\overset{(...)}': {
'*': { action_: [ { type_: 'output', option: 2 }, 'overset-output' ], nextState: '3' } },
'\\underset{(...)}': {
'*': { action_: [ { type_: 'output', option: 2 }, 'underset-output' ], nextState: '3' } },
'\\underbrace{(...)}': {
'*': { action_: [ { type_: 'output', option: 2 }, 'underbrace-output' ], nextState: '3' } },
'\\color{(...)}{(...)}1|\\color(...){(...)}2': {
'*': { action_: [ { type_: 'output', option: 2 }, 'color-output' ], nextState: '3' } },
'\\color{(...)}0': {
'*': { action_: [ { type_: 'output', option: 2 }, 'color0-output' ] } },
'\\ce{(...)}': {
'*': { action_: [ { type_: 'output', option: 2 }, 'ce' ], nextState: '3' } },
'\\,': {
'*': { action_: [ { type_: 'output', option: 1 }, 'copy' ], nextState: '1' } },
'\\x{}{}|\\x{}|\\x': {
'0|1|2|3|a|as|b|p|bp|o|c0': { action_: [ 'o=', 'output' ], nextState: '3' },
'*': { action_: ['output', 'o=', 'output' ], nextState: '3' } },
'others': {
'*': { action_: [ { type_: 'output', option: 1 }, 'copy' ], nextState: '3' } },
'else2': {
'a': { action_: 'a to o', nextState: 'o', revisit: true },
'as': { action_: [ 'output', 'sb=true' ], nextState: '1', revisit: true },
'r|rt|rd|rdt|rdq': { action_: [ 'output' ], nextState: '0', revisit: true },
'*': { action_: [ 'output', 'copy' ], nextState: '3' } }
}),
actions: {
'o after d': function (buffer, m) {
var ret;
if ((buffer.d || "").match(/^[0-9]+$/)) {
var tmp = buffer.d;
buffer.d = undefined;
ret = this['output'](buffer);
buffer.b = tmp;
} else {
ret = this['output'](buffer);
}
mhchemParser.actions['o='](buffer, m);
return ret;
},
'd= kv': function (buffer, m) {
buffer.d = m;
buffer.dType = 'kv';
},
'charge or bond': function (buffer, m) {
if (buffer['beginsWithBond']) {
/** @type {ParserOutput[]} */
var ret = [];
mhchemParser.concatArray(ret, this['output'](buffer));
mhchemParser.concatArray(ret, mhchemParser.actions['bond'](buffer, m, "-"));
return ret;
} else {
buffer.d = m;
}
},
'- after o/d': function (buffer, m, isAfterD) {
var c1 = mhchemParser.patterns.match_('orbital', buffer.o || "");
var c2 = mhchemParser.patterns.match_('one lowercase greek letter $', buffer.o || "");
var c3 = mhchemParser.patterns.match_('one lowercase latin letter $', buffer.o || "");
var c4 = mhchemParser.patterns.match_('$one lowercase latin letter$ $', buffer.o || "");
var hyphenFollows = m==="-" && ( c1 && c1.remainder==="" || c2 || c3 || c4 );
if (hyphenFollows && !buffer.a && !buffer.b && !buffer.p && !buffer.d && !buffer.q && !c1 && c3) {
buffer.o = '$' + buffer.o + '$';
}
/** @type {ParserOutput[]} */
var ret = [];
if (hyphenFollows) {
mhchemParser.concatArray(ret, this['output'](buffer));
ret.push({ type_: 'hyphen' });
} else {
c1 = mhchemParser.patterns.match_('digits', buffer.d || "");
if (isAfterD && c1 && c1.remainder==='') {
mhchemParser.concatArray(ret, mhchemParser.actions['d='](buffer, m));
mhchemParser.concatArray(ret, this['output'](buffer));
} else {
mhchemParser.concatArray(ret, this['output'](buffer));
mhchemParser.concatArray(ret, mhchemParser.actions['bond'](buffer, m, "-"));
}
}
return ret;
},
'a to o': function (buffer) {
buffer.o = buffer.a;
buffer.a = undefined;
},
'sb=true': function (buffer) { buffer.sb = true; },
'sb=false': function (buffer) { buffer.sb = false; },
'beginsWithBond=true': function (buffer) { buffer['beginsWithBond'] = true; },
'beginsWithBond=false': function (buffer) { buffer['beginsWithBond'] = false; },
'parenthesisLevel++': function (buffer) { buffer['parenthesisLevel']++; },
'parenthesisLevel--': function (buffer) { buffer['parenthesisLevel']--; },
'state of aggregation': function (buffer, m) {
return { type_: 'state of aggregation', p1: mhchemParser.go(m, 'o') };
},
'comma': function (buffer, m) {
var a = m.replace(/\s*$/, '');
var withSpace = (a !== m);
if (withSpace && buffer['parenthesisLevel'] === 0) {
return { type_: 'comma enumeration L', p1: a };
} else {
return { type_: 'comma enumeration M', p1: a };
}
},
'output': function (buffer, m, entityFollows) {
// entityFollows:
// undefined = if we have nothing else to output, also ignore the just read space (buffer.sb)
// 1 = an entity follows, never omit the space if there was one just read before (can only apply to state 1)
// 2 = 1 + the entity can have an amount, so output a\, instead of converting it to o (can only apply to states a|as)
/** @type {ParserOutput | ParserOutput[]} */
var ret;
if (!buffer.r) {
ret = [];
if (!buffer.a && !buffer.b && !buffer.p && !buffer.o && !buffer.q && !buffer.d && !entityFollows) {
//ret = [];
} else {
if (buffer.sb) {
ret.push({ type_: 'entitySkip' });
}
if (!buffer.o && !buffer.q && !buffer.d && !buffer.b && !buffer.p && entityFollows!==2) {
buffer.o = buffer.a;
buffer.a = undefined;
} else if (!buffer.o && !buffer.q && !buffer.d && (buffer.b || buffer.p)) {
buffer.o = buffer.a;
buffer.d = buffer.b;
buffer.q = buffer.p;
buffer.a = buffer.b = buffer.p = undefined;
} else {
if (buffer.o && buffer.dType==='kv' && mhchemParser.patterns.match_('d-oxidation$', buffer.d || "")) {
buffer.dType = 'oxidation';
} else if (buffer.o && buffer.dType==='kv' && !buffer.q) {
buffer.dType = undefined;
}
}
ret.push({
type_: 'chemfive',
a: mhchemParser.go(buffer.a, 'a'),
b: mhchemParser.go(buffer.b, 'bd'),
p: mhchemParser.go(buffer.p, 'pq'),
o: mhchemParser.go(buffer.o, 'o'),
q: mhchemParser.go(buffer.q, 'pq'),
d: mhchemParser.go(buffer.d, (buffer.dType === 'oxidation' ? 'oxidation' : 'bd')),
dType: buffer.dType
});
}
} else { // r
/** @type {ParserOutput[]} */
var rd;
if (buffer.rdt === 'M') {
rd = mhchemParser.go(buffer.rd, 'tex-math');
} else if (buffer.rdt === 'T') {
rd = [ { type_: 'text', p1: buffer.rd || "" } ];
} else {
rd = mhchemParser.go(buffer.rd);
}
/** @type {ParserOutput[]} */
var rq;
if (buffer.rqt === 'M') {
rq = mhchemParser.go(buffer.rq, 'tex-math');
} else if (buffer.rqt === 'T') {
rq = [ { type_: 'text', p1: buffer.rq || ""} ];
} else {
rq = mhchemParser.go(buffer.rq);
}
ret = {
type_: 'arrow',
r: buffer.r,
rd: rd,
rq: rq
};
}
for (var p in buffer) {
if (p !== 'parenthesisLevel' && p !== 'beginsWithBond') {
delete buffer[p];
}
}
return ret;
},
'oxidation-output': function (buffer, m) {
var ret = [ "{" ];
mhchemParser.concatArray(ret, mhchemParser.go(m, 'oxidation'));
ret.push("}");
return ret;
},
'frac-output': function (buffer, m) {
return { type_: 'frac-ce', p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) };
},
'overset-output': function (buffer, m) {
return { type_: 'overset', p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) };
},
'underset-output': function (buffer, m) {
return { type_: 'underset', p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) };
},
'underbrace-output': function (buffer, m) {
return { type_: 'underbrace', p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) };
},
'color-output': function (buffer, m) {
return { type_: 'color', color1: m[0], color2: mhchemParser.go(m[1]) };
},
'r=': function (buffer, m) { buffer.r = m; },
'rdt=': function (buffer, m) { buffer.rdt = m; },
'rd=': function (buffer, m) { buffer.rd = m; },
'rqt=': function (buffer, m) { buffer.rqt = m; },
'rq=': function (buffer, m) { buffer.rq = m; },
'operator': function (buffer, m, p1) { return { type_: 'operator', kind_: (p1 || m) }; }
}
},
'a': {
transitions: mhchemParser.createTransitions({
'empty': {
'*': {} },
'1/2$': {
'0': { action_: '1/2' } },
'else': {
'0': { nextState: '1', revisit: true } },
'$(...)$': {
'*': { action_: 'tex-math tight', nextState: '1' } },
',': {
'*': { action_: { type_: 'insert', option: 'commaDecimal' } } },
'else2': {
'*': { action_: 'copy' } }
}),
actions: {}
},
'o': {
transitions: mhchemParser.createTransitions({
'empty': {
'*': {} },
'1/2$': {
'0': { action_: '1/2' } },
'else': {
'0': { nextState: '1', revisit: true } },
'letters': {
'*': { action_: 'rm' } },
'\\ca': {
'*': { action_: { type_: 'insert', option: 'circa' } } },
'\\x{}{}|\\x{}|\\x': {
'*': { action_: 'copy' } },
'${(...)}$|$(...)$': {
'*': { action_: 'tex-math' } },
'{(...)}': {
'*': { action_: '{text}' } },
'else2': {
'*': { action_: 'copy' } }
}),
actions: {}
},
'text': {
transitions: mhchemParser.createTransitions({
'empty': {
'*': { action_: 'output' } },
'{...}': {
'*': { action_: 'text=' } },
'${(...)}$|$(...)$': {
'*': { action_: 'tex-math' } },
'\\greek': {
'*': { action_: [ 'output', 'rm' ] } },
'\\,|\\x{}{}|\\x{}|\\x': {
'*': { action_: [ 'output', 'copy' ] } },
'else': {
'*': { action_: 'text=' } }
}),
actions: {
'output': function (buffer) {
if (buffer.text_) {
/** @type {ParserOutput} */
var ret = { type_: 'text', p1: buffer.text_ };
for (var p in buffer) { delete buffer[p]; }
return ret;
}
}
}
},
'pq': {
transitions: mhchemParser.createTransitions({
'empty': {
'*': {} },
'state of aggregation $': {
'*': { action_: 'state of aggregation' } },
'i$': {
'0': { nextState: '!f', revisit: true } },
'(KV letters),': {
'0': { action_: 'rm', nextState: '0' } },
'formula$': {
'0': { nextState: 'f', revisit: true } },
'1/2$': {
'0': { action_: '1/2' } },
'else': {
'0': { nextState: '!f', revisit: true } },
'${(...)}$|$(...)$': {
'*': { action_: 'tex-math' } },
'{(...)}': {
'*': { action_: 'text' } },
'a-z': {
'f': { action_: 'tex-math' } },
'letters': {
'*': { action_: 'rm' } },
'-9.,9': {
'*': { action_: '9,9' } },
',': {
'*': { action_: { type_: 'insert+p1', option: 'comma enumeration S' } } },
'\\color{(...)}{(...)}1|\\color(...){(...)}2': {
'*': { action_: 'color-output' } },
'\\color{(...)}0': {
'*': { action_: 'color0-output' } },
'\\ce{(...)}': {
'*': { action_: 'ce' } },
'\\,|\\x{}{}|\\x{}|\\x': {
'*': { action_: 'copy' } },
'else2': {
'*': { action_: 'copy' } }
}),
actions: {
'state of aggregation': function (buffer, m) {
return { type_: 'state of aggregation subscript', p1: mhchemParser.go(m, 'o') };
},
'color-output': function (buffer, m) {
return { type_: 'color', color1: m[0], color2: mhchemParser.go(m[1], 'pq') };
}
}
},
'bd': {
transitions: mhchemParser.createTransitions({
'empty': {
'*': {} },
'x$': {
'0': { nextState: '!f', revisit: true } },
'formula$': {
'0': { nextState: 'f', revisit: true } },
'else': {
'0': { nextState: '!f', revisit: true } },
'-9.,9 no missing 0': {
'*': { action_: '9,9' } },
'.': {
'*': { action_: { type_: 'insert', option: 'electron dot' } } },
'a-z': {
'f': { action_: 'tex-math' } },
'x': {
'*': { action_: { type_: 'insert', option: 'KV x' } } },
'letters': {
'*': { action_: 'rm' } },
'\'': {
'*': { action_: { type_: 'insert', option: 'prime' } } },
'${(...)}$|$(...)$': {
'*': { action_: 'tex-math' } },
'{(...)}': {
'*': { action_: 'text' } },
'\\color{(...)}{(...)}1|\\color(...){(...)}2': {
'*': { action_: 'color-output' } },
'\\color{(...)}0': {
'*': { action_: 'color0-output' } },
'\\ce{(...)}': {
'*': { action_: 'ce' } },
'\\,|\\x{}{}|\\x{}|\\x': {
'*': { action_: 'copy' } },
'else2': {
'*': { action_: 'copy' } }
}),
actions: {
'color-output': function (buffer, m) {
return { type_: 'color', color1: m[0], color2: mhchemParser.go(m[1], 'bd') };
}
}
},
'oxidation': {
transitions: mhchemParser.createTransitions({
'empty': {
'*': {} },
'roman numeral': {
'*': { action_: 'roman-numeral' } },
'${(...)}$|$(...)$': {
'*': { action_: 'tex-math' } },
'else': {
'*': { action_: 'copy' } }
}),
actions: {
'roman-numeral': function (buffer, m) { return { type_: 'roman numeral', p1: m || "" }; }
}
},
'tex-math': {
transitions: mhchemParser.createTransitions({
'empty': {
'*': { action_: 'output' } },
'\\ce{(...)}': {
'*': { action_: [ 'output', 'ce' ] } },
'{...}|\\,|\\x{}{}|\\x{}|\\x': {
'*': { action_: 'o=' } },
'else': {
'*': { action_: 'o=' } }
}),
actions: {
'output': function (buffer) {
if (buffer.o) {
/** @type {ParserOutput} */
var ret = { type_: 'tex-math', p1: buffer.o };
for (var p in buffer) { delete buffer[p]; }
return ret;
}
}
}
},
'tex-math tight': {
transitions: mhchemParser.createTransitions({
'empty': {
'*': { action_: 'output' } },
'\\ce{(...)}': {
'*': { action_: [ 'output', 'ce' ] } },
'{...}|\\,|\\x{}{}|\\x{}|\\x': {
'*': { action_: 'o=' } },
'-|+': {
'*': { action_: 'tight operator' } },
'else': {
'*': { action_: 'o=' } }
}),
actions: {
'tight operator': function (buffer, m) { buffer.o = (buffer.o || "") + "{"+m+"}"; },
'output': function (buffer) {
if (buffer.o) {
/** @type {ParserOutput} */
var ret = { type_: 'tex-math', p1: buffer.o };
for (var p in buffer) { delete buffer[p]; }
return ret;
}
}
}
},
'9,9': {
transitions: mhchemParser.createTransitions({
'empty': {
'*': {} },
',': {
'*': { action_: 'comma' } },
'else': {
'*': { action_: 'copy' } }
}),
actions: {
'comma': function () { return { type_: 'commaDecimal' }; }
}
},
//#endregion
//
// \pu state machines
//
//#region pu
'pu': {
transitions: mhchemParser.createTransitions({
'empty': {
'*': { action_: 'output' } },
'space$': {
'*': { action_: [ 'output', 'space' ] } },
'{[(|)]}': {
'0|a': { action_: 'copy' } },
'(-)(9)^(-9)': {
'0': { action_: 'number^', nextState: 'a' } },
'(-)(9.,9)(e)(99)': {
'0': { action_: 'enumber', nextState: 'a' } },
'space': {
'0|a': {} },
'pm-operator': {
'0|a': { action_: { type_: 'operator', option: '\\pm' }, nextState: '0' } },
'operator': {
'0|a': { action_: 'copy', nextState: '0' } },
'//': {
'd': { action_: 'o=', nextState: '/' } },
'/': {
'd': { action_: 'o=', nextState: '/' } },
'{...}|else': {
'0|d': { action_: 'd=', nextState: 'd' },
'a': { action_: [ 'space', 'd=' ], nextState: 'd' },
'/|q': { action_: 'q=', nextState: 'q' } }
}),
actions: {
'enumber': function (buffer, m) {
/** @type {ParserOutput[]} */
var ret = [];
if (m[0] === "+-" || m[0] === "+/-") {
ret.push("\\pm ");
} else if (m[0]) {
ret.push(m[0]);
}
if (m[1]) {
mhchemParser.concatArray(ret, mhchemParser.go(m[1], 'pu-9,9'));
if (m[2]) {
if (m[2].match(/[,.]/)) {
mhchemParser.concatArray(ret, mhchemParser.go(m[2], 'pu-9,9'));
} else {
ret.push(m[2]);
}
}
m[3] = m[4] || m[3];
if (m[3]) {
m[3] = m[3].trim();
if (m[3] === "e" || m[3].substr(0, 1) === "*") {
ret.push({ type_: 'cdot' });
} else {
ret.push({ type_: 'times' });
}
}
}
if (m[3]) {
ret.push("10^{"+m[5]+"}");
}
return ret;
},
'number^': function (buffer, m) {
/** @type {ParserOutput[]} */
var ret = [];
if (m[0] === "+-" || m[0] === "+/-") {
ret.push("\\pm ");
} else if (m[0]) {
ret.push(m[0]);
}
mhchemParser.concatArray(ret, mhchemParser.go(m[1], 'pu-9,9'));
ret.push("^{"+m[2]+"}");
return ret;
},
'operator': function (buffer, m, p1) { return { type_: 'operator', kind_: (p1 || m) }; },
'space': function () { return { type_: 'pu-space-1' }; },
'output': function (buffer) {
/** @type {ParserOutput | ParserOutput[]} */
var ret;
var md = mhchemParser.patterns.match_('{(...)}', buffer.d || "");
if (md && md.remainder === '') { buffer.d = md.match_; }
var mq = mhchemParser.patterns.match_('{(...)}', buffer.q || "");
if (mq && mq.remainder === '') { buffer.q = mq.match_; }
if (buffer.d) {
buffer.d = buffer.d.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
buffer.d = buffer.d.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
}
if (buffer.q) { // fraction
buffer.q = buffer.q.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
buffer.q = buffer.q.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
var b5 = {
d: mhchemParser.go(buffer.d, 'pu'),
q: mhchemParser.go(buffer.q, 'pu')
};
if (buffer.o === '//') {
ret = { type_: 'pu-frac', p1: b5.d, p2: b5.q };
} else {
ret = b5.d;
if (b5.d.length > 1 || b5.q.length > 1) {
ret.push({ type_: ' / ' });
} else {
ret.push({ type_: '/' });
}
mhchemParser.concatArray(ret, b5.q);
}
} else { // no fraction
ret = mhchemParser.go(buffer.d, 'pu-2');
}
for (var p in buffer) { delete buffer[p]; }
return ret;
}
}
},
'pu-2': {
transitions: mhchemParser.createTransitions({
'empty': {
'*': { action_: 'output' } },
'*': {
'*': { action_: [ 'output', 'cdot' ], nextState: '0' } },
'\\x': {
'*': { action_: 'rm=' } },
'space': {
'*': { action_: [ 'output', 'space' ], nextState: '0' } },
'^{(...)}|^(-1)': {
'1': { action_: '^(-1)' } },
'-9.,9': {
'0': { action_: 'rm=', nextState: '0' },
'1': { action_: '^(-1)', nextState: '0' } },
'{...}|else': {
'*': { action_: 'rm=', nextState: '1' } }
}),
actions: {
'cdot': function () { return { type_: 'tight cdot' }; },
'^(-1)': function (buffer, m) { buffer.rm += "^{"+m+"}"; },
'space': function () { return { type_: 'pu-space-2' }; },
'output': function (buffer) {
/** @type {ParserOutput | ParserOutput[]} */
var ret = [];
if (buffer.rm) {
var mrm = mhchemParser.patterns.match_('{(...)}', buffer.rm || "");
if (mrm && mrm.remainder === '') {
ret = mhchemParser.go(mrm.match_, 'pu');
} else {
ret = { type_: 'rm', p1: buffer.rm };
}
}
for (var p in buffer) { delete buffer[p]; }
return ret;
}
}
},
'pu-9,9': {
transitions: mhchemParser.createTransitions({
'empty': {
'0': { action_: 'output-0' },
'o': { action_: 'output-o' } },
',': {
'0': { action_: [ 'output-0', 'comma' ], nextState: 'o' } },
'.': {
'0': { action_: [ 'output-0', 'copy' ], nextState: 'o' } },
'else': {
'*': { action_: 'text=' } }
}),
actions: {
'comma': function () { return { type_: 'commaDecimal' }; },
'output-0': function (buffer) {
/** @type {ParserOutput[]} */
var ret = [];
buffer.text_ = buffer.text_ || "";
if (buffer.text_.length > 4) {
var a = buffer.text_.length % 3;
if (a === 0) { a = 3; }
for (var i=buffer.text_.length-3; i>0; i-=3) {
ret.push(buffer.text_.substr(i, 3));
ret.push({ type_: '1000 separator' });
}
ret.push(buffer.text_.substr(0, a));
ret.reverse();
} else {
ret.push(buffer.text_);
}
for (var p in buffer) { delete buffer[p]; }
return ret;
},
'output-o': function (buffer) {
/** @type {ParserOutput[]} */
var ret = [];
buffer.text_ = buffer.text_ || "";
if (buffer.text_.length > 4) {
var a = buffer.text_.length - 3;
for (var i=0; i<a; i+=3) {
ret.push(buffer.text_.substr(i, 3));
ret.push({ type_: '1000 separator' });
}
ret.push(buffer.text_.substr(i));
} else {
ret.push(buffer.text_);
}
for (var p in buffer) { delete buffer[p]; }
return ret;
}
}
}
//#endregion
};
//
// texify: Take MhchemParser output and convert it to TeX
//
/** @type {Texify} */
var texify = {
go: function (input, isInner) { // (recursive, max 4 levels)
if (!input) { return ""; }
var res = "";
var cee = false;
for (var i=0; i < input.length; i++) {
var inputi = input[i];
if (typeof inputi === "string") {
res += inputi;
} else {
res += texify._go2(inputi);
if (inputi.type_ === '1st-level escape') { cee = true; }
}
}
if (!isInner && !cee && res) {
res = "{" + res + "}";
}
return res;
},
_goInner: function (input) {
if (!input) { return input; }
return texify.go(input, true);
},
_go2: function (buf) {
/** @type {undefined | string} */
var res;
switch (buf.type_) {
case 'chemfive':
res = "";
var b5 = {
a: texify._goInner(buf.a),
b: texify._goInner(buf.b),
p: texify._goInner(buf.p),
o: texify._goInner(buf.o),
q: texify._goInner(buf.q),
d: texify._goInner(buf.d)
};
//
// a
//
if (b5.a) {
if (b5.a.match(/^[+\-]/)) { b5.a = "{"+b5.a+"}"; }
res += b5.a + "\\,";
}
//
// b and p
//
if (b5.b || b5.p) {
res += "{\\vphantom{X}}";
res += "^{\\hphantom{"+(b5.b||"")+"}}_{\\hphantom{"+(b5.p||"")+"}}";
res += "{\\vphantom{X}}";
// In the next two lines, I've removed \smash[t] (ron)
// TODO: Revert \smash[t] when WebKit properly renders <mpadded> w/height="0"
//res += "^{\\smash[t]{\\vphantom{2}}\\mathllap{"+(b5.b||"")+"}}";
res += "^{\\vphantom{2}\\mathllap{"+(b5.b||"")+"}}";
//res += "_{\\vphantom{2}\\mathllap{\\smash[t]{"+(b5.p||"")+"}}}";
res += "_{\\vphantom{2}\\mathllap{"+(b5.p||"")+"}}";
}
//
// o
//
if (b5.o) {
if (b5.o.match(/^[+\-]/)) { b5.o = "{"+b5.o+"}"; }
res += b5.o;
}
//
// q and d
//
if (buf.dType === 'kv') {
if (b5.d || b5.q) {
res += "{\\vphantom{X}}";
}
if (b5.d) {
res += "^{"+b5.d+"}";
}
if (b5.q) {
// In the next line, I've removed \smash[t] (ron)
// TODO: Revert \smash[t] when WebKit properly renders <mpadded> w/height="0"
//res += "_{\\smash[t]{"+b5.q+"}}";
res += "_{"+b5.q+"}";
}
} else if (buf.dType === 'oxidation') {
if (b5.d) {
res += "{\\vphantom{X}}";
res += "^{"+b5.d+"}";
}
if (b5.q) {
// A Firefox bug adds a bogus depth to <mphantom>, so we change \vphantom{X} to {}
// TODO: Reinstate \vphantom{X} when the Firefox bug is fixed.
// res += "{\\vphantom{X}}";
res += "{{}}";
// In the next line, I've removed \smash[t] (ron)
// TODO: Revert \smash[t] when WebKit properly renders <mpadded> w/height="0"
//res += "_{\\smash[t]{"+b5.q+"}}";
res += "_{"+b5.q+"}";
}
} else {
if (b5.q) {
// TODO: Reinstate \vphantom{X} when the Firefox bug is fixed.
// res += "{\\vphantom{X}}";
res += "{{}}";
// In the next line, I've removed \smash[t] (ron)
// TODO: Revert \smash[t] when WebKit properly renders <mpadded> w/height="0"
//res += "_{\\smash[t]{"+b5.q+"}}";
res += "_{"+b5.q+"}";
}
if (b5.d) {
// TODO: Reinstate \vphantom{X} when the Firefox bug is fixed.
// res += "{\\vphantom{X}}";
res += "{{}}";
res += "^{"+b5.d+"}";
}
}
break;
case 'rm':
res = "\\mathrm{"+buf.p1+"}";
break;
case 'text':
if (buf.p1.match(/[\^_]/)) {
buf.p1 = buf.p1.replace(" ", "~").replace("-", "\\text{-}");
res = "\\mathrm{"+buf.p1+"}";
} else {
res = "\\text{"+buf.p1+"}";
}
break;
case 'roman numeral':
res = "\\mathrm{"+buf.p1+"}";
break;
case 'state of aggregation':
res = "\\mskip2mu "+texify._goInner(buf.p1);
break;
case 'state of aggregation subscript':
res = "\\mskip1mu "+texify._goInner(buf.p1);
break;
case 'bond':
res = texify._getBond(buf.kind_);
if (!res) {
throw ["MhchemErrorBond", "mhchem Error. Unknown bond type (" + buf.kind_ + ")"];
}
break;
case 'frac':
var c = "\\frac{" + buf.p1 + "}{" + buf.p2 + "}";
res = "\\mathchoice{\\textstyle"+c+"}{"+c+"}{"+c+"}{"+c+"}";
break;
case 'pu-frac':
var d = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
res = "\\mathchoice{\\textstyle"+d+"}{"+d+"}{"+d+"}{"+d+"}";
break;
case 'tex-math':
res = buf.p1 + " ";
break;
case 'frac-ce':
res = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
break;
case 'overset':
res = "\\overset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
break;
case 'underset':
res = "\\underset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
break;
case 'underbrace':
res = "\\underbrace{" + texify._goInner(buf.p1) + "}_{" + texify._goInner(buf.p2) + "}";
break;
case 'color':
res = "{\\color{" + buf.color1 + "}{" + texify._goInner(buf.color2) + "}}";
break;
case 'color0':
res = "\\color{" + buf.color + "}";
break;
case 'arrow':
var b6 = {
rd: texify._goInner(buf.rd),
rq: texify._goInner(buf.rq)
};
var arrow = texify._getArrow(buf.r);
if (b6.rq) { arrow += "[{\\rm " + b6.rq + "}]"; }
if (b6.rd) {
arrow += "{\\rm " + b6.rd + "}";
} else {
arrow += "{}";
}
res = arrow;
break;
case 'operator':
res = texify._getOperator(buf.kind_);
break;
case '1st-level escape':
res = buf.p1+" "; // &, \\\\, \\hlin
break;
case 'space':
res = " ";
break;
case 'entitySkip':
res = "~";
break;
case 'pu-space-1':
res = "~";
break;
case 'pu-space-2':
res = "\\mkern3mu ";
break;
case '1000 separator':
res = "\\mkern2mu ";
break;
case 'commaDecimal':
res = "{,}";
break;
case 'comma enumeration L':
res = "{"+buf.p1+"}\\mkern6mu ";
break;
case 'comma enumeration M':
res = "{"+buf.p1+"}\\mkern3mu ";
break;
case 'comma enumeration S':
res = "{"+buf.p1+"}\\mkern1mu ";
break;
case 'hyphen':
res = "\\text{-}";
break;
case 'addition compound':
res = "\\,{\\cdot}\\,";
break;
case 'electron dot':
res = "\\mkern1mu \\text{\\textbullet}\\mkern1mu ";
break;
case 'KV x':
res = "{\\times}";
break;
case 'prime':
res = "\\prime ";
break;
case 'cdot':
res = "\\cdot ";
break;
case 'tight cdot':
res = "\\mkern1mu{\\cdot}\\mkern1mu ";
break;
case 'times':
res = "\\times ";
break;
case 'circa':
res = "{\\sim}";
break;
case '^':
res = "uparrow";
break;
case 'v':
res = "downarrow";
break;
case 'ellipsis':
res = "\\ldots ";
break;
case '/':
res = "/";
break;
case ' / ':
res = "\\,/\\,";
break;
default:
assertNever(buf);
throw ["MhchemBugT", "mhchem bug T. Please report."]; // Missing texify rule or unknown MhchemParser output
}
assertString(res);
return res;
},
_getArrow: function (a) {
switch (a) {
case "->": return "\\yields";
case "\u2192": return "\\yields";
case "\u27F6": return "\\yields";
case "<-": return "\\yieldsLeft";
case "<->": return "\\mesomerism";
case "<-->": return "\\yieldsLeftRight";
case "<=>": return "\\equilibrium";
case "\u21CC": return "\\equilibrium";
case "<=>>": return "\\equilibriumRight";
case "<<=>": return "\\equilibriumLeft";
default:
assertNever(a);
throw ["MhchemBugT", "mhchem bug T. Please report."];
}
},
_getBond: function (a) {
switch (a) {
case "-": return "{-}";
case "1": return "{-}";
case "=": return "{=}";
case "2": return "{=}";
case "#": return "{\\equiv}";
case "3": return "{\\equiv}";
case "~": return "{\\tripleDash}";
case "~-": return "{\\tripleDashOverLine}";
case "~=": return "{\\tripleDashOverDoubleLine}";
case "~--": return "{\\tripleDashOverDoubleLine}";
case "-~-": return "{\\tripleDashBetweenDoubleLine}";
case "...": return "{{\\cdot}{\\cdot}{\\cdot}}";
case "....": return "{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";
case "->": return "{\\rightarrow}";
case "<-": return "{\\leftarrow}";
case "<": return "{<}";
case ">": return "{>}";
default:
assertNever(a);
throw ["MhchemBugT", "mhchem bug T. Please report."];
}
},
_getOperator: function (a) {
switch (a) {
case "+": return " {}+{} ";
case "-": return " {}-{} ";
case "=": return " {}={} ";
case "<": return " {}<{} ";
case ">": return " {}>{} ";
case "<<": return " {}\\ll{} ";
case ">>": return " {}\\gg{} ";
case "\\pm": return " {}\\pm{} ";
case "\\approx": return " {}\\approx{} ";
case "$\\approx$": return " {}\\approx{} ";
case "v": return " \\downarrow{} ";
case "(v)": return " \\downarrow{} ";
case "^": return " \\uparrow{} ";
case "(^)": return " \\uparrow{} ";
default:
assertNever(a);
throw ["MhchemBugT", "mhchem bug T. Please report."];
}
}
};
//
// Helpers for code analysis
// Will show type error at calling position
//
/** @param {number} a */
function assertNever(a) {}
/** @param {string} a */
function assertString(a) {}
/* eslint-disable no-undef */
//////////////////////////////////////////////////////////////////////
// texvc.sty
// The texvc package contains macros available in mediawiki pages.
// We omit the functions deprecated at
// https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Deprecated_syntax
// We also omit texvc's \O, which conflicts with \text{\O}
defineMacro("\\darr", "\\downarrow");
defineMacro("\\dArr", "\\Downarrow");
defineMacro("\\Darr", "\\Downarrow");
defineMacro("\\lang", "\\langle");
defineMacro("\\rang", "\\rangle");
defineMacro("\\uarr", "\\uparrow");
defineMacro("\\uArr", "\\Uparrow");
defineMacro("\\Uarr", "\\Uparrow");
defineMacro("\\N", "\\mathbb{N}");
defineMacro("\\R", "\\mathbb{R}");
defineMacro("\\Z", "\\mathbb{Z}");
defineMacro("\\alef", "\\aleph");
defineMacro("\\alefsym", "\\aleph");
defineMacro("\\bull", "\\bullet");
defineMacro("\\clubs", "\\clubsuit");
defineMacro("\\cnums", "\\mathbb{C}");
defineMacro("\\Complex", "\\mathbb{C}");
defineMacro("\\Dagger", "\\ddagger");
defineMacro("\\diamonds", "\\diamondsuit");
defineMacro("\\empty", "\\emptyset");
defineMacro("\\exist", "\\exists");
defineMacro("\\harr", "\\leftrightarrow");
defineMacro("\\hArr", "\\Leftrightarrow");
defineMacro("\\Harr", "\\Leftrightarrow");
defineMacro("\\hearts", "\\heartsuit");
defineMacro("\\image", "\\Im");
defineMacro("\\infin", "\\infty");
defineMacro("\\isin", "\\in");
defineMacro("\\larr", "\\leftarrow");
defineMacro("\\lArr", "\\Leftarrow");
defineMacro("\\Larr", "\\Leftarrow");
defineMacro("\\lrarr", "\\leftrightarrow");
defineMacro("\\lrArr", "\\Leftrightarrow");
defineMacro("\\Lrarr", "\\Leftrightarrow");
defineMacro("\\natnums", "\\mathbb{N}");
defineMacro("\\plusmn", "\\pm");
defineMacro("\\rarr", "\\rightarrow");
defineMacro("\\rArr", "\\Rightarrow");
defineMacro("\\Rarr", "\\Rightarrow");
defineMacro("\\real", "\\Re");
defineMacro("\\reals", "\\mathbb{R}");
defineMacro("\\Reals", "\\mathbb{R}");
defineMacro("\\sdot", "\\cdot");
defineMacro("\\sect", "\\S");
defineMacro("\\spades", "\\spadesuit");
defineMacro("\\sub", "\\subset");
defineMacro("\\sube", "\\subseteq");
defineMacro("\\supe", "\\supseteq");
defineMacro("\\thetasym", "\\vartheta");
defineMacro("\\weierp", "\\wp");
/* eslint-disable no-undef */
/****************************************************
*
* physics.js
*
* Implements the Physics Package for LaTeX input.
*
* ---------------------------------------------------------------------
*
* The original version of this file is licensed as follows:
* Copyright (c) 2015-2016 Kolen Cheung <https://github.com/ickc/MathJax-third-party-extensions>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ---------------------------------------------------------------------
*
* This file has been revised from the original in the following ways:
* 1. The interface is changed so that it can be called from Temml, not MathJax.
* 2. \Re and \Im are not used, to avoid conflict with existing LaTeX letters.
*
* This revision of the file is released under the MIT license.
* https://mit-license.org/
*/
defineMacro("\\quantity", "{\\left\\{ #1 \\right\\}}");
defineMacro("\\qty", "{\\left\\{ #1 \\right\\}}");
defineMacro("\\pqty", "{\\left( #1 \\right)}");
defineMacro("\\bqty", "{\\left[ #1 \\right]}");
defineMacro("\\vqty", "{\\left\\vert #1 \\right\\vert}");
defineMacro("\\Bqty", "{\\left\\{ #1 \\right\\}}");
defineMacro("\\absolutevalue", "{\\left\\vert #1 \\right\\vert}");
defineMacro("\\abs", "{\\left\\vert #1 \\right\\vert}");
defineMacro("\\norm", "{\\left\\Vert #1 \\right\\Vert}");
defineMacro("\\evaluated", "{\\left.#1 \\right\\vert}");
defineMacro("\\eval", "{\\left.#1 \\right\\vert}");
defineMacro("\\order", "{\\mathcal{O} \\left( #1 \\right)}");
defineMacro("\\commutator", "{\\left[ #1 , #2 \\right]}");
defineMacro("\\comm", "{\\left[ #1 , #2 \\right]}");
defineMacro("\\anticommutator", "{\\left\\{ #1 , #2 \\right\\}}");
defineMacro("\\acomm", "{\\left\\{ #1 , #2 \\right\\}}");
defineMacro("\\poissonbracket", "{\\left\\{ #1 , #2 \\right\\}}");
defineMacro("\\pb", "{\\left\\{ #1 , #2 \\right\\}}");
defineMacro("\\vectorbold", "{\\boldsymbol{ #1 }}");
defineMacro("\\vb", "{\\boldsymbol{ #1 }}");
defineMacro("\\vectorarrow", "{\\vec{\\boldsymbol{ #1 }}}");
defineMacro("\\va", "{\\vec{\\boldsymbol{ #1 }}}");
defineMacro("\\vectorunit", "{{\\boldsymbol{\\hat{ #1 }}}}");
defineMacro("\\vu", "{{\\boldsymbol{\\hat{ #1 }}}}");
defineMacro("\\dotproduct", "\\mathbin{\\boldsymbol\\cdot}");
defineMacro("\\vdot", "{\\boldsymbol\\cdot}");
defineMacro("\\crossproduct", "\\mathbin{\\boldsymbol\\times}");
defineMacro("\\cross", "\\mathbin{\\boldsymbol\\times}");
defineMacro("\\cp", "\\mathbin{\\boldsymbol\\times}");
defineMacro("\\gradient", "{\\boldsymbol\\nabla}");
defineMacro("\\grad", "{\\boldsymbol\\nabla}");
defineMacro("\\divergence", "{\\grad\\vdot}");
//defineMacro("\\div", "{\\grad\\vdot}"); Not included in Temml. Conflicts w/LaTeX \div
defineMacro("\\curl", "{\\grad\\cross}");
defineMacro("\\laplacian", "\\nabla^2");
defineMacro("\\tr", "{\\operatorname{tr}}");
defineMacro("\\Tr", "{\\operatorname{Tr}}");
defineMacro("\\rank", "{\\operatorname{rank}}");
defineMacro("\\erf", "{\\operatorname{erf}}");
defineMacro("\\Res", "{\\operatorname{Res}}");
defineMacro("\\principalvalue", "{\\mathcal{P}}");
defineMacro("\\pv", "{\\mathcal{P}}");
defineMacro("\\PV", "{\\operatorname{P.V.}}");
// Temml does not use the next two lines. They conflict with LaTeX letters.
//defineMacro("\\Re", "{\\operatorname{Re} \\left\\{ #1 \\right\\}}");
//defineMacro("\\Im", "{\\operatorname{Im} \\left\\{ #1 \\right\\}}");
defineMacro("\\qqtext", "{\\quad\\text{ #1 }\\quad}");
defineMacro("\\qq", "{\\quad\\text{ #1 }\\quad}");
defineMacro("\\qcomma", "{\\text{,}\\quad}");
defineMacro("\\qc", "{\\text{,}\\quad}");
defineMacro("\\qcc", "{\\quad\\text{c.c.}\\quad}");
defineMacro("\\qif", "{\\quad\\text{if}\\quad}");
defineMacro("\\qthen", "{\\quad\\text{then}\\quad}");
defineMacro("\\qelse", "{\\quad\\text{else}\\quad}");
defineMacro("\\qotherwise", "{\\quad\\text{otherwise}\\quad}");
defineMacro("\\qunless", "{\\quad\\text{unless}\\quad}");
defineMacro("\\qgiven", "{\\quad\\text{given}\\quad}");
defineMacro("\\qusing", "{\\quad\\text{using}\\quad}");
defineMacro("\\qassume", "{\\quad\\text{assume}\\quad}");
defineMacro("\\qsince", "{\\quad\\text{since}\\quad}");
defineMacro("\\qlet", "{\\quad\\text{let}\\quad}");
defineMacro("\\qfor", "{\\quad\\text{for}\\quad}");
defineMacro("\\qall", "{\\quad\\text{all}\\quad}");
defineMacro("\\qeven", "{\\quad\\text{even}\\quad}");
defineMacro("\\qodd", "{\\quad\\text{odd}\\quad}");
defineMacro("\\qinteger", "{\\quad\\text{integer}\\quad}");
defineMacro("\\qand", "{\\quad\\text{and}\\quad}");
defineMacro("\\qor", "{\\quad\\text{or}\\quad}");
defineMacro("\\qas", "{\\quad\\text{as}\\quad}");
defineMacro("\\qin", "{\\quad\\text{in}\\quad}");
defineMacro("\\differential", "{\\text{d}}");
defineMacro("\\dd", "{\\text{d}}");
defineMacro("\\derivative", "{\\frac{\\text{d}{ #1 }}{\\text{d}{ #2 }}}");
defineMacro("\\dv", "{\\frac{\\text{d}{ #1 }}{\\text{d}{ #2 }}}");
defineMacro("\\partialderivative", "{\\frac{\\partial{ #1 }}{\\partial{ #2 }}}");
defineMacro("\\variation", "{\\delta}");
defineMacro("\\var", "{\\delta}");
defineMacro("\\functionalderivative", "{\\frac{\\delta{ #1 }}{\\delta{ #2 }}}");
defineMacro("\\fdv", "{\\frac{\\delta{ #1 }}{\\delta{ #2 }}}");
defineMacro("\\innerproduct", "{\\left\\langle {#1} \\mid { #2} \\right\\rangle}");
defineMacro("\\outerproduct",
"{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}");
defineMacro("\\dyad",
"{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}");
defineMacro("\\ketbra",
"{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}");
defineMacro("\\op",
"{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}");
defineMacro("\\expectationvalue", "{\\left\\langle {#1 } \\right\\rangle}");
defineMacro("\\expval", "{\\left\\langle {#1 } \\right\\rangle}");
defineMacro("\\ev", "{\\left\\langle {#1 } \\right\\rangle}");
defineMacro("\\matrixelement",
"{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}");
defineMacro("\\matrixel",
"{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}");
defineMacro("\\mel",
"{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}");
// Helper functions
function getHLines(parser) {
// Return an array. The array length = number of hlines.
// Each element in the array tells if the line is dashed.
const hlineInfo = [];
parser.consumeSpaces();
let nxt = parser.fetch().text;
if (nxt === "\\relax") {
parser.consume();
parser.consumeSpaces();
nxt = parser.fetch().text;
}
while (nxt === "\\hline" || nxt === "\\hdashline") {
parser.consume();
hlineInfo.push(nxt === "\\hdashline");
parser.consumeSpaces();
nxt = parser.fetch().text;
}
return hlineInfo;
}
const validateAmsEnvironmentContext = context => {
const settings = context.parser.settings;
if (!settings.displayMode) {
throw new ParseError(`{${context.envName}} can be used only in display mode.`);
}
};
const sizeRegEx$1 = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/;
const arrayGaps = macros => {
let arraystretch = macros.get("\\arraystretch");
if (typeof arraystretch !== "string") {
arraystretch = stringFromArg(arraystretch.tokens);
}
arraystretch = isNaN(arraystretch) ? null : Number(arraystretch);
let arraycolsepStr = macros.get("\\arraycolsep");
if (typeof arraycolsepStr !== "string") {
arraycolsepStr = stringFromArg(arraycolsepStr.tokens);
}
const match = sizeRegEx$1.exec(arraycolsepStr);
const arraycolsep = match
? { number: +(match[1] + match[2]), unit: match[3] }
: null;
return [arraystretch, arraycolsep]
};
const checkCellForLabels = cell => {
// Check if the author wrote a \tag{} inside this cell.
let rowLabel = "";
for (let i = 0; i < cell.length; i++) {
if (cell[i].type === "label") {
if (rowLabel) { throw new ParseError(("Multiple \\labels in one row")) }
rowLabel = cell[i].string;
}
}
return rowLabel
};
// autoTag (an argument to parseArray) can be one of three values:
// * undefined: Regular (not-top-level) array; no tags on each row
// * true: Automatic equation numbering, overridable by \tag
// * false: Tags allowed on each row, but no automatic numbering
// This function *doesn't* work with the "split" environment name.
function getAutoTag(name) {
if (name.indexOf("ed") === -1) {
return name.indexOf("*") === -1;
}
// return undefined;
}
/**
* Parse the body of the environment, with rows delimited by \\ and
* columns delimited by &, and create a nested list in row-major order
* with one group per cell. If given an optional argument scriptLevel
* ("text", "display", etc.), then each cell is cast into that scriptLevel.
*/
function parseArray(
parser,
{
cols, // [{ type: string , align: l|c|r|null }]
envClasses, // align(ed|at|edat) | array | cases | cd | small | multline
autoTag, // boolean
singleRow, // boolean
emptySingleRow, // boolean
maxNumCols, // number
leqno, // boolean
arraystretch, // number | null
arraycolsep // size value | null
},
scriptLevel
) {
parser.gullet.beginGroup();
if (!singleRow) {
// \cr is equivalent to \\ without the optional size argument (see below)
// TODO: provide helpful error when \cr is used outside array environment
parser.gullet.macros.set("\\cr", "\\\\\\relax");
}
// Start group for first cell
parser.gullet.beginGroup();
let row = [];
const body = [row];
const rowGaps = [];
const labels = [];
const hLinesBeforeRow = [];
const tags = (autoTag != null ? [] : undefined);
// amsmath uses \global\@eqnswtrue and \global\@eqnswfalse to represent
// whether this row should have an equation number. Simulate this with
// a \@eqnsw macro set to 1 or 0.
function beginRow() {
if (autoTag) {
parser.gullet.macros.set("\\@eqnsw", "1", true);
}
}
function endRow() {
if (tags) {
if (parser.gullet.macros.get("\\df@tag")) {
tags.push(parser.subparse([new Token("\\df@tag")]));
parser.gullet.macros.set("\\df@tag", undefined, true);
} else {
tags.push(Boolean(autoTag) &&
parser.gullet.macros.get("\\@eqnsw") === "1");
}
}
}
beginRow();
// Test for \hline at the top of the array.
hLinesBeforeRow.push(getHLines(parser));
while (true) {
// Parse each cell in its own group (namespace)
let cell = parser.parseExpression(false, singleRow ? "\\end" : "\\\\");
parser.gullet.endGroup();
parser.gullet.beginGroup();
cell = {
type: "ordgroup",
mode: parser.mode,
body: cell,
semisimple: true
};
row.push(cell);
const next = parser.fetch().text;
if (next === "&") {
if (maxNumCols && row.length === maxNumCols) {
if (envClasses.includes("array")) {
if (parser.settings.strict) {
throw new ParseError("Too few columns " + "specified in the {array} column argument.",
parser.nextToken)
}
} else if (maxNumCols === 2) {
throw new ParseError("The split environment accepts no more than two columns",
parser.nextToken);
} else {
throw new ParseError("The equation environment accepts only one column",
parser.nextToken)
}
}
parser.consume();
} else if (next === "\\end") {
endRow();
// Arrays terminate newlines with `\crcr` which consumes a `\cr` if
// the last line is empty. However, AMS environments keep the
// empty row if it's the only one.
// NOTE: Currently, `cell` is the last item added into `row`.
if (row.length === 1 && cell.body.length === 0 && (body.length > 1 || !emptySingleRow)) {
body.pop();
}
labels.push(checkCellForLabels(cell.body));
if (hLinesBeforeRow.length < body.length + 1) {
hLinesBeforeRow.push([]);
}
break;
} else if (next === "\\\\") {
parser.consume();
let size;
// \def\Let@{\let\\\math@cr}
// \def\math@cr{...\math@cr@}
// \def\math@cr@{\new@ifnextchar[\math@cr@@{\math@cr@@[\z@]}}
// \def\math@cr@@[#1]{...\math@cr@@@...}
// \def\math@cr@@@{\cr}
if (parser.gullet.future().text !== " ") {
size = parser.parseSizeGroup(true);
}
rowGaps.push(size ? size.value : null);
endRow();
labels.push(checkCellForLabels(cell.body));
// check for \hline(s) following the row separator
hLinesBeforeRow.push(getHLines(parser));
row = [];
body.push(row);
beginRow();
} else {
throw new ParseError("Expected & or \\\\ or \\cr or \\end", parser.nextToken);
}
}
// End cell group
parser.gullet.endGroup();
// End array group defining \cr
parser.gullet.endGroup();
return {
type: "array",
mode: parser.mode,
body,
cols,
rowGaps,
hLinesBeforeRow,
envClasses,
autoTag,
scriptLevel,
tags,
labels,
leqno,
arraystretch,
arraycolsep
};
}
// Decides on a scriptLevel for cells in an array according to whether the given
// environment name starts with the letter 'd'.
function dCellStyle(envName) {
return envName.slice(0, 1) === "d" ? "display" : "text"
}
const alignMap = {
c: "center ",
l: "left ",
r: "right "
};
const glue = group => {
const glueNode = new mathMLTree.MathNode("mtd", []);
glueNode.style = { padding: "0", width: "50%" };
if (group.envClasses.includes("multline")) {
glueNode.style.width = "7.5%";
}
return glueNode
};
const mathmlBuilder$7 = function(group, style) {
const tbl = [];
const numRows = group.body.length;
const hlines = group.hLinesBeforeRow;
for (let i = 0; i < numRows; i++) {
const rw = group.body[i];
const row = [];
const cellLevel = group.scriptLevel === "text"
? StyleLevel.TEXT
: group.scriptLevel === "script"
? StyleLevel.SCRIPT
: StyleLevel.DISPLAY;
for (let j = 0; j < rw.length; j++) {
const mtd = new mathMLTree.MathNode(
"mtd",
[buildGroup$1(rw[j], style.withLevel(cellLevel))]
);
if (group.envClasses.includes("multline")) {
const align = i === 0 ? "left" : i === numRows - 1 ? "right" : "center";
mtd.setAttribute("columnalign", align);
if (align !== "center") {
mtd.classes.push("tml-" + align);
}
}
row.push(mtd);
}
const numColumns = group.body[0].length;
// Fill out a short row with empty <mtd> elements.
for (let k = 0; k < numColumns - rw.length; k++) {
row.push(new mathMLTree.MathNode("mtd", [], style));
}
if (group.autoTag) {
const tag = group.tags[i];
let tagElement;
if (tag === true) { // automatic numbering
tagElement = new mathMLTree.MathNode("mtext", [new Span(["tml-eqn"])]);
} else if (tag === false) {
// \nonumber/\notag or starred environment
tagElement = new mathMLTree.MathNode("mtext", [], []);
} else { // manual \tag
tagElement = buildExpressionRow(tag[0].body, style.withLevel(cellLevel), true);
tagElement = consolidateText(tagElement);
tagElement.classes = ["tml-tag"];
}
if (tagElement) {
row.unshift(glue(group));
row.push(glue(group));
if (group.leqno) {
row[0].children.push(tagElement);
row[0].classes.push("tml-left");
} else {
row[row.length - 1].children.push(tagElement);
row[row.length - 1].classes.push("tml-right");
}
}
}
const mtr = new mathMLTree.MathNode("mtr", row, []);
const label = group.labels.shift();
if (label && group.tags && group.tags[i]) {
mtr.setAttribute("id", label);
if (Array.isArray(group.tags[i])) { mtr.classes.push("tml-tageqn"); }
}
// Write horizontal rules
if (i === 0 && hlines[0].length > 0) {
if (hlines[0].length === 2) {
mtr.children.forEach(cell => { cell.style.borderTop = "0.15em double"; });
} else {
mtr.children.forEach(cell => {
cell.style.borderTop = hlines[0][0] ? "0.06em dashed" : "0.06em solid";
});
}
}
if (hlines[i + 1].length > 0) {
if (hlines[i + 1].length === 2) {
mtr.children.forEach(cell => { cell.style.borderBottom = "0.15em double"; });
} else {
mtr.children.forEach(cell => {
cell.style.borderBottom = hlines[i + 1][0] ? "0.06em dashed" : "0.06em solid";
});
}
}
tbl.push(mtr);
}
if (group.envClasses.length > 0) {
if (group.arraystretch && group.arraystretch !== 1) {
// In LaTeX, \arraystretch is a factor applied to a 12pt strut height.
// It defines a baseline to baseline distance.
// Here, we do an approximation of that approach.
const pad = String(1.4 * group.arraystretch - 0.8) + "ex";
for (let i = 0; i < tbl.length; i++) {
for (let j = 0; j < tbl[i].children.length; j++) {
tbl[i].children[j].style.paddingTop = pad;
tbl[i].children[j].style.paddingBottom = pad;
}
}
}
let sidePadding = group.envClasses.includes("abut")
? "0"
: group.envClasses.includes("cases")
? "0"
: group.envClasses.includes("small")
? "0.1389"
: group.envClasses.includes("cd")
? "0.25"
: "0.4"; // default side padding
let sidePadUnit = "em";
if (group.arraycolsep) {
const arraySidePad = calculateSize(group.arraycolsep, style);
sidePadding = arraySidePad.number.toFixed(4);
sidePadUnit = arraySidePad.unit;
}
const numCols = tbl.length === 0 ? 0 : tbl[0].children.length;
const sidePad = (j, hand) => {
if (j === 0 && hand === 0) { return "0" }
if (j === numCols - 1 && hand === 1) { return "0" }
if (group.envClasses[0] !== "align") { return sidePadding }
if (hand === 1) { return "0" }
if (group.autoTag) {
return (j % 2) ? "1" : "0"
} else {
return (j % 2) ? "0" : "1"
}
};
// Side padding
for (let i = 0; i < tbl.length; i++) {
for (let j = 0; j < tbl[i].children.length; j++) {
tbl[i].children[j].style.paddingLeft = `${sidePad(j, 0)}${sidePadUnit}`;
tbl[i].children[j].style.paddingRight = `${sidePad(j, 1)}${sidePadUnit}`;
}
}
// Justification
const align = group.envClasses.includes("align") || group.envClasses.includes("alignat");
for (let i = 0; i < tbl.length; i++) {
const row = tbl[i];
if (align) {
for (let j = 0; j < row.children.length; j++) {
// Chromium does not recognize text-align: left. Use -webkit-
// TODO: Remove -webkit- when Chromium no longer needs it.
row.children[j].classes = ["tml-" + (j % 2 ? "left" : "right")];
}
if (group.autoTag) {
const k = group.leqno ? 0 : row.children.length - 1;
row.children[k].classes = ["tml-" + (group.leqno ? "left" : "right")];
}
}
if (row.children.length > 1 && group.envClasses.includes("cases")) {
row.children[1].style.paddingLeft = "1em";
}
if (group.envClasses.includes("cases") || group.envClasses.includes("subarray")) {
for (const cell of row.children) {
cell.classes.push("tml-left");
}
}
}
} else {
// Set zero padding on side of the matrix
for (let i = 0; i < tbl.length; i++) {
tbl[i].children[0].style.paddingLeft = "0em";
if (tbl[i].children.length === tbl[0].children.length) {
tbl[i].children[tbl[i].children.length - 1].style.paddingRight = "0em";
}
}
}
let table = new mathMLTree.MathNode("mtable", tbl);
if (group.envClasses.length > 0) {
// Top & bottom padding
if (group.envClasses.includes("jot")) {
table.classes.push("tml-jot");
} else if (group.envClasses.includes("small")) {
table.classes.push("tml-small");
}
}
if (group.scriptLevel === "display") { table.setAttribute("displaystyle", "true"); }
if (group.autoTag || group.envClasses.includes("multline")) {
table.style.width = "100%";
}
// Column separator lines and column alignment
let align = "";
if (group.cols && group.cols.length > 0) {
const cols = group.cols;
let prevTypeWasAlign = false;
let iStart = 0;
let iEnd = cols.length;
while (cols[iStart].type === "separator") {
iStart += 1;
}
while (cols[iEnd - 1].type === "separator") {
iEnd -= 1;
}
if (cols[0].type === "separator") {
const sep = cols[1].type === "separator"
? "0.15em double"
: cols[0].separator === "|"
? "0.06em solid "
: "0.06em dashed ";
for (const row of table.children) {
row.children[0].style.borderLeft = sep;
}
}
let iCol = group.autoTag ? 0 : -1;
for (let i = iStart; i < iEnd; i++) {
if (cols[i].type === "align") {
const colAlign = alignMap[cols[i].align];
align += colAlign;
iCol += 1;
for (const row of table.children) {
if (colAlign.trim() !== "center" && iCol < row.children.length) {
row.children[iCol].classes = ["tml-" + colAlign.trim()];
}
}
prevTypeWasAlign = true;
} else if (cols[i].type === "separator") {
// MathML accepts only single lines between cells.
// So we read only the first of consecutive separators.
if (prevTypeWasAlign) {
const sep = cols[i + 1].type === "separator"
? "0.15em double"
: cols[i].separator === "|"
? "0.06em solid"
: "0.06em dashed";
for (const row of table.children) {
if (iCol < row.children.length) {
row.children[iCol].style.borderRight = sep;
}
}
}
prevTypeWasAlign = false;
}
}
if (cols[cols.length - 1].type === "separator") {
const sep = cols[cols.length - 2].type === "separator"
? "0.15em double"
: cols[cols.length - 1].separator === "|"
? "0.06em solid"
: "0.06em dashed";
for (const row of table.children) {
row.children[row.children.length - 1].style.borderRight = sep;
row.children[row.children.length - 1].style.paddingRight = "0.4em";
}
}
}
if (group.autoTag) {
// allow for glue cells on each side
align = "left " + (align.length > 0 ? align : "center ") + "right ";
}
if (align) {
// Firefox reads this attribute, not the -webkit-left|right written above.
// TODO: When Chrome no longer needs "-webkit-", use CSS and delete the next line.
table.setAttribute("columnalign", align.trim());
}
if (group.envClasses.includes("small")) {
// A small array. Wrap in scriptstyle.
table = new mathMLTree.MathNode("mstyle", [table]);
table.setAttribute("scriptlevel", "1");
}
return table
};
// Convenience function for align, align*, aligned, alignat, alignat*, alignedat, split.
const alignedHandler = function(context, args) {
if (context.envName.indexOf("ed") === -1) {
validateAmsEnvironmentContext(context);
}
const isSplit = context.envName === "split";
const cols = [];
const res = parseArray(
context.parser,
{
cols,
emptySingleRow: true,
autoTag: isSplit ? undefined : getAutoTag(context.envName),
envClasses: ["abut", "jot"], // set row spacing & provisional column spacing
maxNumCols: context.envName === "split" ? 2 : undefined,
leqno: context.parser.settings.leqno
},
"display"
);
// Determining number of columns.
// 1. If the first argument is given, we use it as a number of columns,
// and makes sure that each row doesn't exceed that number.
// 2. Otherwise, just count number of columns = maximum number
// of cells in each row ("aligned" mode -- isAligned will be true).
//
// At the same time, prepend empty group {} at beginning of every second
// cell in each row (starting with second cell) so that operators become
// binary. This behavior is implemented in amsmath's \start@aligned.
let numMaths;
let numCols = 0;
const isAlignedAt = context.envName.indexOf("at") > -1;
if (args[0] && isAlignedAt) {
// alignat environment takes an argument w/ number of columns
let arg0 = "";
for (let i = 0; i < args[0].body.length; i++) {
const textord = assertNodeType(args[0].body[i], "textord");
arg0 += textord.text;
}
if (isNaN(arg0)) {
throw new ParseError("The alignat enviroment requires a numeric first argument.")
}
numMaths = Number(arg0);
numCols = numMaths * 2;
}
res.body.forEach(function(row) {
if (isAlignedAt) {
// Case 1
const curMaths = row.length / 2;
if (numMaths < curMaths) {
throw new ParseError(
"Too many math in a row: " + `expected ${numMaths}, but got ${curMaths}`,
row[0]
);
}
} else if (numCols < row.length) {
// Case 2
numCols = row.length;
}
});
// Adjusting alignment.
// In aligned mode, we add one \qquad between columns;
// otherwise we add nothing.
for (let i = 0; i < numCols; ++i) {
let align = "r";
if (i % 2 === 1) {
align = "l";
}
cols[i] = {
type: "align",
align: align
};
}
if (context.envName === "split") ; else if (isAlignedAt) {
res.envClasses.push("alignat"); // Sets justification
} else {
res.envClasses[0] = "align"; // Sets column spacing & justification
}
return res;
};
// Arrays are part of LaTeX, defined in lttab.dtx so its documentation
// is part of the source2e.pdf file of LaTeX2e source documentation.
// {darray} is an {array} environment where cells are set in \displaystyle,
// as defined in nccmath.sty.
defineEnvironment({
type: "array",
names: ["array", "darray"],
props: {
numArgs: 1
},
handler(context, args) {
// Since no types are specified above, the two possibilities are
// - The argument is wrapped in {} or [], in which case Parser's
// parseGroup() returns an "ordgroup" wrapping some symbol node.
// - The argument is a bare symbol node.
const symNode = checkSymbolNodeType(args[0]);
const colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body;
const cols = colalign.map(function(nde) {
const node = assertSymbolNodeType(nde);
const ca = node.text;
if ("lcr".indexOf(ca) !== -1) {
return {
type: "align",
align: ca
};
} else if (ca === "|") {
return {
type: "separator",
separator: "|"
};
} else if (ca === ":") {
return {
type: "separator",
separator: ":"
};
}
throw new ParseError("Unknown column alignment: " + ca, nde);
});
const [arraystretch, arraycolsep] = arrayGaps(context.parser.gullet.macros);
const res = {
cols,
envClasses: ["array"],
maxNumCols: cols.length,
arraystretch,
arraycolsep
};
return parseArray(context.parser, res, dCellStyle(context.envName));
},
mathmlBuilder: mathmlBuilder$7
});
// The matrix environments of amsmath builds on the array environment
// of LaTeX, which is discussed above.
// The mathtools package adds starred versions of the same environments.
// These have an optional argument to choose left|center|right justification.
defineEnvironment({
type: "array",
names: [
"matrix",
"pmatrix",
"bmatrix",
"Bmatrix",
"vmatrix",
"Vmatrix",
"matrix*",
"pmatrix*",
"bmatrix*",
"Bmatrix*",
"vmatrix*",
"Vmatrix*"
],
props: {
numArgs: 0
},
handler(context) {
const delimiters = {
matrix: null,
pmatrix: ["(", ")"],
bmatrix: ["[", "]"],
Bmatrix: ["\\{", "\\}"],
vmatrix: ["|", "|"],
Vmatrix: ["\\Vert", "\\Vert"]
}[context.envName.replace("*", "")];
// \hskip -\arraycolsep in amsmath
let colAlign = "c";
const payload = {
envClasses: [],
cols: []
};
if (context.envName.charAt(context.envName.length - 1) === "*") {
// It's one of the mathtools starred functions.
// Parse the optional alignment argument.
const parser = context.parser;
parser.consumeSpaces();
if (parser.fetch().text === "[") {
parser.consume();
parser.consumeSpaces();
colAlign = parser.fetch().text;
if ("lcr".indexOf(colAlign) === -1) {
throw new ParseError("Expected l or c or r", parser.nextToken);
}
parser.consume();
parser.consumeSpaces();
parser.expect("]");
parser.consume();
payload.cols = [];
}
}
const res = parseArray(context.parser, payload, "text");
res.cols = new Array(res.body[0].length).fill({ type: "align", align: colAlign });
const [arraystretch, arraycolsep] = arrayGaps(context.parser.gullet.macros);
return delimiters
? {
type: "leftright",
mode: context.mode,
body: [res],
left: delimiters[0],
right: delimiters[1],
rightColor: undefined, // \right uninfluenced by \color in array
arraystretch,
arraycolsep
}
: res;
},
mathmlBuilder: mathmlBuilder$7
});
defineEnvironment({
type: "array",
names: ["smallmatrix"],
props: {
numArgs: 0
},
handler(context) {
const payload = { type: "small" };
const res = parseArray(context.parser, payload, "script");
res.envClasses = ["small"];
return res;
},
mathmlBuilder: mathmlBuilder$7
});
defineEnvironment({
type: "array",
names: ["subarray"],
props: {
numArgs: 1
},
handler(context, args) {
// Parsing of {subarray} is similar to {array}
const symNode = checkSymbolNodeType(args[0]);
const colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body;
const cols = colalign.map(function(nde) {
const node = assertSymbolNodeType(nde);
const ca = node.text;
// {subarray} only recognizes "l" & "c"
if ("lc".indexOf(ca) !== -1) {
return {
type: "align",
align: ca
};
}
throw new ParseError("Unknown column alignment: " + ca, nde);
});
if (cols.length > 1) {
throw new ParseError("{subarray} can contain only one column");
}
let res = {
cols,
envClasses: ["small"]
};
res = parseArray(context.parser, res, "script");
if (res.body.length > 0 && res.body[0].length > 1) {
throw new ParseError("{subarray} can contain only one column");
}
return res;
},
mathmlBuilder: mathmlBuilder$7
});
// A cases environment (in amsmath.sty) is almost equivalent to
// \def
// \left\{\begin{array}{@{}l@{\quad}l@{}} … \end{array}\right.
// {dcases} is a {cases} environment where cells are set in \displaystyle,
// as defined in mathtools.sty.
// {rcases} is another mathtools environment. It's brace is on the right side.
defineEnvironment({
type: "array",
names: ["cases", "dcases", "rcases", "drcases"],
props: {
numArgs: 0
},
handler(context) {
const payload = {
cols: [],
envClasses: ["cases"]
};
const res = parseArray(context.parser, payload, dCellStyle(context.envName));
return {
type: "leftright",
mode: context.mode,
body: [res],
left: context.envName.indexOf("r") > -1 ? "." : "\\{",
right: context.envName.indexOf("r") > -1 ? "\\}" : ".",
rightColor: undefined
};
},
mathmlBuilder: mathmlBuilder$7
});
// In the align environment, one uses ampersands, &, to specify number of
// columns in each row, and to locate spacing between each column.
// align gets automatic numbering. align* and aligned do not.
// The alignedat environment can be used in math mode.
defineEnvironment({
type: "array",
names: ["align", "align*", "aligned", "split"],
props: {
numArgs: 0
},
handler: alignedHandler,
mathmlBuilder: mathmlBuilder$7
});
// alignat environment is like an align environment, but one must explicitly
// specify maximum number of columns in each row, and can adjust where spacing occurs.
defineEnvironment({
type: "array",
names: ["alignat", "alignat*", "alignedat"],
props: {
numArgs: 1
},
handler: alignedHandler,
mathmlBuilder: mathmlBuilder$7
});
// A gathered environment is like an array environment with one centered
// column, but where rows are considered lines so get \jot line spacing
// and contents are set in \displaystyle.
defineEnvironment({
type: "array",
names: ["gathered", "gather", "gather*"],
props: {
numArgs: 0
},
handler(context) {
if (context.envName !== "gathered") {
validateAmsEnvironmentContext(context);
}
const res = {
cols: [],
envClasses: ["abut", "jot"],
autoTag: getAutoTag(context.envName),
emptySingleRow: true,
leqno: context.parser.settings.leqno
};
return parseArray(context.parser, res, "display");
},
mathmlBuilder: mathmlBuilder$7
});
defineEnvironment({
type: "array",
names: ["equation", "equation*"],
props: {
numArgs: 0
},
handler(context) {
validateAmsEnvironmentContext(context);
const res = {
autoTag: getAutoTag(context.envName),
emptySingleRow: true,
singleRow: true,
maxNumCols: 1,
envClasses: ["align"],
leqno: context.parser.settings.leqno
};
return parseArray(context.parser, res, "display");
},
mathmlBuilder: mathmlBuilder$7
});
defineEnvironment({
type: "array",
names: ["multline", "multline*"],
props: {
numArgs: 0
},
handler(context) {
validateAmsEnvironmentContext(context);
const res = {
autoTag: context.envName === "multline",
maxNumCols: 1,
envClasses: ["jot", "multline"],
leqno: context.parser.settings.leqno
};
return parseArray(context.parser, res, "display");
},
mathmlBuilder: mathmlBuilder$7
});
defineEnvironment({
type: "array",
names: ["CD"],
props: {
numArgs: 0
},
handler(context) {
validateAmsEnvironmentContext(context);
return parseCD(context.parser);
},
mathmlBuilder: mathmlBuilder$7
});
// Catch \hline outside array environment
defineFunction({
type: "text", // Doesn't matter what this is.
names: ["\\hline", "\\hdashline"],
props: {
numArgs: 0,
allowedInText: true,
allowedInMath: true
},
handler(context, args) {
throw new ParseError(`${context.funcName} valid only within array environment`);
}
});
const environments = _environments;
// Environment delimiters. HTML/MathML rendering is defined in the corresponding
// defineEnvironment definitions.
defineFunction({
type: "environment",
names: ["\\begin", "\\end"],
props: {
numArgs: 1,
argTypes: ["text"]
},
handler({ parser, funcName }, args) {
const nameGroup = args[0];
if (nameGroup.type !== "ordgroup") {
throw new ParseError("Invalid environment name", nameGroup);
}
let envName = "";
for (let i = 0; i < nameGroup.body.length; ++i) {
envName += assertNodeType(nameGroup.body[i], "textord").text;
}
if (funcName === "\\begin") {
// begin...end is similar to left...right
if (!Object.prototype.hasOwnProperty.call(environments, envName )) {
throw new ParseError("No such environment: " + envName, nameGroup);
}
// Build the environment object. Arguments and other information will
// be made available to the begin and end methods using properties.
const env = environments[envName];
const { args, optArgs } = parser.parseArguments("\\begin{" + envName + "}", env);
const context = {
mode: parser.mode,
envName,
parser
};
const result = env.handler(context, args, optArgs);
parser.expect("\\end", false);
const endNameToken = parser.nextToken;
const end = assertNodeType(parser.parseFunction(), "environment");
if (end.name !== envName) {
throw new ParseError(
`Mismatch: \\begin{${envName}} matched by \\end{${end.name}}`,
endNameToken
);
}
return result;
}
return {
type: "environment",
mode: parser.mode,
name: envName,
nameGroup
};
}
});
defineFunction({
type: "envTag",
names: ["\\env@tag"],
props: {
numArgs: 1,
argTypes: ["math"]
},
handler({ parser }, args) {
return {
type: "envTag",
mode: parser.mode,
body: args[0]
};
},
mathmlBuilder(group, style) {
return new mathMLTree.MathNode("mrow");
}
});
defineFunction({
type: "noTag",
names: ["\\env@notag"],
props: {
numArgs: 0
},
handler({ parser }) {
return {
type: "noTag",
mode: parser.mode
};
},
mathmlBuilder(group, style) {
return new mathMLTree.MathNode("mrow");
}
});
const isLongVariableName = (group, font) => {
if (font !== "mathrm" || group.body.type !== "ordgroup" || group.body.body.length === 1) {
return false
}
if (group.body.body[0].type !== "mathord") { return false }
for (let i = 1; i < group.body.body.length; i++) {
const parseNodeType = group.body.body[i].type;
if (!(parseNodeType === "mathord" ||
(parseNodeType === "textord" && !isNaN(group.body.body[i].text)))) {
return false
}
}
return true
};
const mathmlBuilder$6 = (group, style) => {
const font = group.font;
const newStyle = style.withFont(font);
const mathGroup = buildGroup$1(group.body, newStyle);
if (mathGroup.children.length === 0) { return mathGroup } // empty group, e.g., \mathrm{}
if (font === "boldsymbol" && ["mo", "mpadded", "mrow"].includes(mathGroup.type)) {
mathGroup.style.fontWeight = "bold";
return mathGroup
}
// Check if it is possible to consolidate elements into a single <mi> element.
if (isLongVariableName(group, font)) {
// This is a \mathrm{…} group. It gets special treatment because symbolsOrd.js
// wraps <mi> elements with <mrow>s to work around a Firefox bug.
const mi = mathGroup.children[0].children[0];
delete mi.attributes.mathvariant;
for (let i = 1; i < mathGroup.children.length; i++) {
mi.children[0].text += mathGroup.children[i].type === "mn"
? mathGroup.children[i].children[0].text
: mathGroup.children[i].children[0].children[0].text;
}
// Wrap in a <mrow> to prevent the same Firefox bug.
const bogus = new mathMLTree.MathNode("mtext", new mathMLTree.TextNode("\u200b"));
return new mathMLTree.MathNode("mrow", [bogus, mi])
}
let canConsolidate = mathGroup.children[0].type === "mo";
for (let i = 1; i < mathGroup.children.length; i++) {
if (mathGroup.children[i].type === "mo" && font === "boldsymbol") {
mathGroup.children[i].style.fontWeight = "bold";
}
if (mathGroup.children[i].type !== "mi") { canConsolidate = false; }
const localVariant = mathGroup.children[i].attributes &&
mathGroup.children[i].attributes.mathvariant || "";
if (localVariant !== "normal") { canConsolidate = false; }
}
if (!canConsolidate) { return mathGroup }
// Consolidate the <mi> elements.
const mi = mathGroup.children[0];
for (let i = 1; i < mathGroup.children.length; i++) {
mi.children.push(mathGroup.children[i].children[0]);
}
if (mi.attributes.mathvariant && mi.attributes.mathvariant === "normal") {
// Workaround for a Firefox bug that renders spurious space around
// a <mi mathvariant="normal">
// Ref: https://bugs.webkit.org/show_bug.cgi?id=129097
// We insert a text node that contains a zero-width space and wrap in an mrow.
// TODO: Get rid of this <mi> workaround when the Firefox bug is fixed.
const bogus = new mathMLTree.MathNode("mtext", new mathMLTree.TextNode("\u200b"));
return new mathMLTree.MathNode("mrow", [bogus, mi])
}
return mi
};
const fontAliases = {
"\\Bbb": "\\mathbb",
"\\bold": "\\mathbf",
"\\frak": "\\mathfrak",
"\\bm": "\\boldsymbol"
};
defineFunction({
type: "font",
names: [
// styles
"\\mathrm",
"\\mathit",
"\\mathbf",
"\\mathnormal",
"\\up@greek",
"\\boldsymbol",
// families
"\\mathbb",
"\\mathcal",
"\\mathfrak",
"\\mathscr",
"\\mathsf",
"\\mathsfit",
"\\mathtt",
// aliases
"\\Bbb",
"\\bm",
"\\bold",
"\\frak"
],
props: {
numArgs: 1,
allowedInArgument: true
},
handler: ({ parser, funcName }, args) => {
const body = normalizeArgument(args[0]);
let func = funcName;
if (func in fontAliases) {
func = fontAliases[func];
}
return {
type: "font",
mode: parser.mode,
font: func.slice(1),
body
};
},
mathmlBuilder: mathmlBuilder$6
});
// Old font changing functions
defineFunction({
type: "font",
names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],
props: {
numArgs: 0,
allowedInText: true
},
handler: ({ parser, funcName, breakOnTokenText }, args) => {
const { mode } = parser;
const body = parser.parseExpression(true, breakOnTokenText, true);
const fontStyle = `math${funcName.slice(1)}`;
return {
type: "font",
mode: mode,
font: fontStyle,
body: {
type: "ordgroup",
mode: parser.mode,
body
}
};
},
mathmlBuilder: mathmlBuilder$6
});
const stylArray = ["display", "text", "script", "scriptscript"];
const scriptLevel = { auto: -1, display: 0, text: 0, script: 1, scriptscript: 2 };
const mathmlBuilder$5 = (group, style) => {
// Track the scriptLevel of the numerator and denominator.
// We may need that info for \mathchoice or for adjusting em dimensions.
const childOptions = group.scriptLevel === "auto"
? style.incrementLevel()
: group.scriptLevel === "display"
? style.withLevel(StyleLevel.TEXT)
: group.scriptLevel === "text"
? style.withLevel(StyleLevel.SCRIPT)
: style.withLevel(StyleLevel.SCRIPTSCRIPT);
// Chromium (wrongly) continues to shrink fractions beyond scriptscriptlevel.
// So we check for levels that Chromium shrinks too small.
// If necessary, set an explicit fraction depth.
const numer = buildGroup$1(group.numer, childOptions);
const denom = buildGroup$1(group.denom, childOptions);
if (style.level === 3) {
numer.style.mathDepth = "2";
numer.setAttribute("scriptlevel", "2");
denom.style.mathDepth = "2";
denom.setAttribute("scriptlevel", "2");
}
let node = new mathMLTree.MathNode("mfrac", [numer, denom]);
if (!group.hasBarLine) {
node.setAttribute("linethickness", "0px");
} else if (group.barSize) {
const ruleWidth = calculateSize(group.barSize, style);
node.setAttribute("linethickness", ruleWidth.number + ruleWidth.unit);
}
if (group.leftDelim != null || group.rightDelim != null) {
const withDelims = [];
if (group.leftDelim != null) {
const leftOp = new mathMLTree.MathNode("mo", [
new mathMLTree.TextNode(group.leftDelim.replace("\\", ""))
]);
leftOp.setAttribute("fence", "true");
withDelims.push(leftOp);
}
withDelims.push(node);
if (group.rightDelim != null) {
const rightOp = new mathMLTree.MathNode("mo", [
new mathMLTree.TextNode(group.rightDelim.replace("\\", ""))
]);
rightOp.setAttribute("fence", "true");
withDelims.push(rightOp);
}
node = makeRow(withDelims);
}
if (group.scriptLevel !== "auto") {
node = new mathMLTree.MathNode("mstyle", [node]);
node.setAttribute("displaystyle", String(group.scriptLevel === "display"));
node.setAttribute("scriptlevel", scriptLevel[group.scriptLevel]);
}
return node;
};
defineFunction({
type: "genfrac",
names: [
"\\dfrac",
"\\frac",
"\\tfrac",
"\\dbinom",
"\\binom",
"\\tbinom",
"\\\\atopfrac", // can’t be entered directly
"\\\\bracefrac",
"\\\\brackfrac" // ditto
],
props: {
numArgs: 2,
allowedInArgument: true
},
handler: ({ parser, funcName }, args) => {
const numer = args[0];
const denom = args[1];
let hasBarLine = false;
let leftDelim = null;
let rightDelim = null;
let scriptLevel = "auto";
switch (funcName) {
case "\\dfrac":
case "\\frac":
case "\\tfrac":
hasBarLine = true;
break;
case "\\\\atopfrac":
hasBarLine = false;
break;
case "\\dbinom":
case "\\binom":
case "\\tbinom":
leftDelim = "(";
rightDelim = ")";
break;
case "\\\\bracefrac":
leftDelim = "\\{";
rightDelim = "\\}";
break;
case "\\\\brackfrac":
leftDelim = "[";
rightDelim = "]";
break;
default:
throw new Error("Unrecognized genfrac command");
}
switch (funcName) {
case "\\dfrac":
case "\\dbinom":
scriptLevel = "display";
break;
case "\\tfrac":
case "\\tbinom":
scriptLevel = "text";
break;
}
return {
type: "genfrac",
mode: parser.mode,
continued: false,
numer,
denom,
hasBarLine,
leftDelim,
rightDelim,
scriptLevel,
barSize: null
};
},
mathmlBuilder: mathmlBuilder$5
});
defineFunction({
type: "genfrac",
names: ["\\cfrac"],
props: {
numArgs: 2
},
handler: ({ parser, funcName }, args) => {
const numer = args[0];
const denom = args[1];
return {
type: "genfrac",
mode: parser.mode,
continued: true,
numer,
denom,
hasBarLine: true,
leftDelim: null,
rightDelim: null,
scriptLevel: "display",
barSize: null
};
}
});
// Infix generalized fractions -- these are not rendered directly, but replaced
// immediately by one of the variants above.
defineFunction({
type: "infix",
names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
props: {
numArgs: 0,
infix: true
},
handler({ parser, funcName, token }) {
let replaceWith;
switch (funcName) {
case "\\over":
replaceWith = "\\frac";
break;
case "\\choose":
replaceWith = "\\binom";
break;
case "\\atop":
replaceWith = "\\\\atopfrac";
break;
case "\\brace":
replaceWith = "\\\\bracefrac";
break;
case "\\brack":
replaceWith = "\\\\brackfrac";
break;
default:
throw new Error("Unrecognized infix genfrac command");
}
return {
type: "infix",
mode: parser.mode,
replaceWith,
token
};
}
});
const delimFromValue = function(delimString) {
let delim = null;
if (delimString.length > 0) {
delim = delimString;
delim = delim === "." ? null : delim;
}
return delim;
};
defineFunction({
type: "genfrac",
names: ["\\genfrac"],
props: {
numArgs: 6,
allowedInArgument: true,
argTypes: ["math", "math", "size", "text", "math", "math"]
},
handler({ parser }, args) {
const numer = args[4];
const denom = args[5];
// Look into the parse nodes to get the desired delimiters.
const leftNode = normalizeArgument(args[0]);
const leftDelim = leftNode.type === "atom" && leftNode.family === "open"
? delimFromValue(leftNode.text)
: null;
const rightNode = normalizeArgument(args[1]);
const rightDelim =
rightNode.type === "atom" && rightNode.family === "close"
? delimFromValue(rightNode.text)
: null;
const barNode = assertNodeType(args[2], "size");
let hasBarLine;
let barSize = null;
if (barNode.isBlank) {
// \genfrac acts differently than \above.
// \genfrac treats an empty size group as a signal to use a
// standard bar size. \above would see size = 0 and omit the bar.
hasBarLine = true;
} else {
barSize = barNode.value;
hasBarLine = barSize.number > 0;
}
// Find out if we want displaystyle, textstyle, etc.
let scriptLevel = "auto";
let styl = args[3];
if (styl.type === "ordgroup") {
if (styl.body.length > 0) {
const textOrd = assertNodeType(styl.body[0], "textord");
scriptLevel = stylArray[Number(textOrd.text)];
}
} else {
styl = assertNodeType(styl, "textord");
scriptLevel = stylArray[Number(styl.text)];
}
return {
type: "genfrac",
mode: parser.mode,
numer,
denom,
continued: false,
hasBarLine,
barSize,
leftDelim,
rightDelim,
scriptLevel
};
},
mathmlBuilder: mathmlBuilder$5
});
// \above is an infix fraction that also defines a fraction bar size.
defineFunction({
type: "infix",
names: ["\\above"],
props: {
numArgs: 1,
argTypes: ["size"],
infix: true
},
handler({ parser, funcName, token }, args) {
return {
type: "infix",
mode: parser.mode,
replaceWith: "\\\\abovefrac",
barSize: assertNodeType(args[0], "size").value,
token
};
}
});
defineFunction({
type: "genfrac",
names: ["\\\\abovefrac"],
props: {
numArgs: 3,
argTypes: ["math", "size", "math"]
},
handler: ({ parser, funcName }, args) => {
const numer = args[0];
const barSize = assert(assertNodeType(args[1], "infix").barSize);
const denom = args[2];
const hasBarLine = barSize.number > 0;
return {
type: "genfrac",
mode: parser.mode,
numer,
denom,
continued: false,
hasBarLine,
barSize,
leftDelim: null,
rightDelim: null,
scriptLevel: "auto"
};
},
mathmlBuilder: mathmlBuilder$5
});
// \hbox is provided for compatibility with LaTeX functions that act on a box.
// This function by itself doesn't do anything but set scriptlevel to \textstyle
// and prevent a soft line break.
defineFunction({
type: "hbox",
names: ["\\hbox"],
props: {
numArgs: 1,
argTypes: ["hbox"],
allowedInArgument: true,
allowedInText: false
},
handler({ parser }, args) {
return {
type: "hbox",
mode: parser.mode,
body: ordargument(args[0])
};
},
mathmlBuilder(group, style) {
const newStyle = style.withLevel(StyleLevel.TEXT);
const mrow = buildExpressionRow(group.body, newStyle);
return consolidateText(mrow)
}
});
const mathmlBuilder$4 = (group, style) => {
const accentNode = stretchy.mathMLnode(group.label);
accentNode.style["math-depth"] = 0;
return new mathMLTree.MathNode(group.isOver ? "mover" : "munder", [
buildGroup$1(group.base, style),
accentNode
]);
};
// Horizontal stretchy braces
defineFunction({
type: "horizBrace",
names: ["\\overbrace", "\\underbrace"],
props: {
numArgs: 1
},
handler({ parser, funcName }, args) {
return {
type: "horizBrace",
mode: parser.mode,
label: funcName,
isOver: /^\\over/.test(funcName),
base: args[0]
};
},
mathmlBuilder: mathmlBuilder$4
});
defineFunction({
type: "href",
names: ["\\href"],
props: {
numArgs: 2,
argTypes: ["url", "original"],
allowedInText: true
},
handler: ({ parser, token }, args) => {
const body = args[1];
const href = assertNodeType(args[0], "url").url;
if (
!parser.settings.isTrusted({
command: "\\href",
url: href
})
) {
throw new ParseError(`Function "\\href" is not trusted`, token)
}
return {
type: "href",
mode: parser.mode,
href,
body: ordargument(body)
};
},
mathmlBuilder: (group, style) => {
const math = new MathNode("math", [buildExpressionRow(group.body, style)]);
const anchorNode = new AnchorNode(group.href, [], [math]);
return anchorNode
}
});
defineFunction({
type: "href",
names: ["\\url"],
props: {
numArgs: 1,
argTypes: ["url"],
allowedInText: true
},
handler: ({ parser, token }, args) => {
const href = assertNodeType(args[0], "url").url;
if (
!parser.settings.isTrusted({
command: "\\url",
url: href
})
) {
throw new ParseError(`Function "\\url" is not trusted`, token)
}
const chars = [];
for (let i = 0; i < href.length; i++) {
let c = href[i];
if (c === "~") {
c = "\\textasciitilde";
}
chars.push({
type: "textord",
mode: "text",
text: c
});
}
const body = {
type: "text",
mode: parser.mode,
font: "\\texttt",
body: chars
};
return {
type: "href",
mode: parser.mode,
href,
body: ordargument(body)
};
}
});
defineFunction({
type: "html",
names: ["\\class", "\\id", "\\style", "\\data"],
props: {
numArgs: 2,
argTypes: ["raw", "original"],
allowedInText: true
},
handler: ({ parser, funcName, token }, args) => {
const value = assertNodeType(args[0], "raw").string;
const body = args[1];
if (parser.settings.strict) {
throw new ParseError(`Function "${funcName}" is disabled in strict mode`, token)
}
let trustContext;
const attributes = {};
switch (funcName) {
case "\\class":
attributes.class = value;
trustContext = {
command: "\\class",
class: value
};
break;
case "\\id":
attributes.id = value;
trustContext = {
command: "\\id",
id: value
};
break;
case "\\style":
attributes.style = value;
trustContext = {
command: "\\style",
style: value
};
break;
case "\\data": {
const data = value.split(",");
for (let i = 0; i < data.length; i++) {
const keyVal = data[i].split("=");
if (keyVal.length !== 2) {
throw new ParseError("Error parsing key-value for \\data");
}
attributes["data-" + keyVal[0].trim()] = keyVal[1].trim();
}
trustContext = {
command: "\\data",
attributes
};
break;
}
default:
throw new Error("Unrecognized html command");
}
if (!parser.settings.isTrusted(trustContext)) {
throw new ParseError(`Function "${funcName}" is not trusted`, token)
}
return {
type: "html",
mode: parser.mode,
attributes,
body: ordargument(body)
};
},
mathmlBuilder: (group, style) => {
const element = buildExpressionRow(group.body, style);
const classes = [];
if (group.attributes.class) {
classes.push(...group.attributes.class.trim().split(/\s+/));
}
element.classes = classes;
for (const attr in group.attributes) {
if (attr !== "class" && Object.prototype.hasOwnProperty.call(group.attributes, attr)) {
element.setAttribute(attr, group.attributes[attr]);
}
}
return element;
}
});
const sizeData = function(str) {
if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(str)) {
// str is a number with no unit specified.
// default unit is bp, per graphix package.
return { number: +str, unit: "bp" }
} else {
const match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(str);
if (!match) {
throw new ParseError("Invalid size: '" + str + "' in \\includegraphics");
}
const data = {
number: +(match[1] + match[2]), // sign + magnitude, cast to number
unit: match[3]
};
if (!validUnit(data)) {
throw new ParseError("Invalid unit: '" + data.unit + "' in \\includegraphics.");
}
return data
}
};
defineFunction({
type: "includegraphics",
names: ["\\includegraphics"],
props: {
numArgs: 1,
numOptionalArgs: 1,
argTypes: ["raw", "url"],
allowedInText: false
},
handler: ({ parser, token }, args, optArgs) => {
let width = { number: 0, unit: "em" };
let height = { number: 0.9, unit: "em" }; // sorta character sized.
let totalheight = { number: 0, unit: "em" };
let alt = "";
if (optArgs[0]) {
const attributeStr = assertNodeType(optArgs[0], "raw").string;
// Parser.js does not parse key/value pairs. We get a string.
const attributes = attributeStr.split(",");
for (let i = 0; i < attributes.length; i++) {
const keyVal = attributes[i].split("=");
if (keyVal.length === 2) {
const str = keyVal[1].trim();
switch (keyVal[0].trim()) {
case "alt":
alt = str;
break
case "width":
width = sizeData(str);
break
case "height":
height = sizeData(str);
break
case "totalheight":
totalheight = sizeData(str);
break
default:
throw new ParseError("Invalid key: '" + keyVal[0] + "' in \\includegraphics.")
}
}
}
}
const src = assertNodeType(args[0], "url").url;
if (alt === "") {
// No alt given. Use the file name. Strip away the path.
alt = src;
alt = alt.replace(/^.*[\\/]/, "");
alt = alt.substring(0, alt.lastIndexOf("."));
}
if (
!parser.settings.isTrusted({
command: "\\includegraphics",
url: src
})
) {
throw new ParseError(`Function "\\includegraphics" is not trusted`, token)
}
return {
type: "includegraphics",
mode: parser.mode,
alt: alt,
width: width,
height: height,
totalheight: totalheight,
src: src
}
},
mathmlBuilder: (group, style) => {
const height = calculateSize(group.height, style);
const depth = { number: 0, unit: "em" };
if (group.totalheight.number > 0) {
if (group.totalheight.unit === height.unit &&
group.totalheight.number > height.number) {
depth.number = group.totalheight.number - height.number;
depth.unit = height.unit;
}
}
let width = 0;
if (group.width.number > 0) {
width = calculateSize(group.width, style);
}
const graphicStyle = { height: height.number + depth.number + "em" };
if (width.number > 0) {
graphicStyle.width = width.number + width.unit;
}
if (depth.number > 0) {
graphicStyle.verticalAlign = -depth.number + depth.unit;
}
const node = new Img(group.src, group.alt, graphicStyle);
node.height = height;
node.depth = depth;
return new mathMLTree.MathNode("mtext", [node])
}
});
// Horizontal spacing commands
// TODO: \hskip and \mskip should support plus and minus in lengths
defineFunction({
type: "kern",
names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
props: {
numArgs: 1,
argTypes: ["size"],
primitive: true,
allowedInText: true
},
handler({ parser, funcName, token }, args) {
const size = assertNodeType(args[0], "size");
if (parser.settings.strict) {
const mathFunction = funcName[1] === "m"; // \mkern, \mskip
const muUnit = size.value.unit === "mu";
if (mathFunction) {
if (!muUnit) {
throw new ParseError(`LaTeX's ${funcName} supports only mu units, ` +
`not ${size.value.unit} units`, token)
}
if (parser.mode !== "math") {
throw new ParseError(`LaTeX's ${funcName} works only in math mode`, token)
}
} else {
// !mathFunction
if (muUnit) {
throw new ParseError(`LaTeX's ${funcName} doesn't support mu units`, token)
}
}
}
return {
type: "kern",
mode: parser.mode,
dimension: size.value
};
},
mathmlBuilder(group, style) {
const dimension = calculateSize(group.dimension, style);
const ch = dimension.unit === "em" ? spaceCharacter(dimension.number) : "";
if (group.mode === "text" && ch.length > 0) {
const character = new mathMLTree.TextNode(ch);
return new mathMLTree.MathNode("mtext", [character]);
} else {
const node = new mathMLTree.MathNode("mspace");
node.setAttribute("width", dimension.number + dimension.unit);
if (dimension.number < 0) {
node.style.marginLeft = dimension.number + dimension.unit;
}
return node;
}
}
});
const spaceCharacter = function(width) {
if (width >= 0.05555 && width <= 0.05556) {
return "\u200a"; //  
} else if (width >= 0.1666 && width <= 0.1667) {
return "\u2009"; //  
} else if (width >= 0.2222 && width <= 0.2223) {
return "\u2005"; //  
} else if (width >= 0.2777 && width <= 0.2778) {
return "\u2005\u200a"; //   
} else {
return "";
}
};
// Limit valid characters to a small set, for safety.
const invalidIdRegEx = /[^A-Za-z_0-9-]/g;
defineFunction({
type: "label",
names: ["\\label"],
props: {
numArgs: 1,
argTypes: ["raw"]
},
handler({ parser }, args) {
return {
type: "label",
mode: parser.mode,
string: args[0].string.replace(invalidIdRegEx, "")
};
},
mathmlBuilder(group, style) {
// Return a no-width, no-ink element with an HTML id.
const node = new mathMLTree.MathNode("mrow", [], ["tml-label"]);
if (group.string.length > 0) {
node.setLabel(group.string);
}
return node
}
});
// Horizontal overlap functions
const textModeLap = ["\\clap", "\\llap", "\\rlap"];
defineFunction({
type: "lap",
names: ["\\mathllap", "\\mathrlap", "\\mathclap", "\\clap", "\\llap", "\\rlap"],
props: {
numArgs: 1,
allowedInText: true
},
handler: ({ parser, funcName, token }, args) => {
if (textModeLap.includes(funcName)) {
if (parser.settings.strict && parser.mode !== "text") {
throw new ParseError(`{${funcName}} can be used only in text mode.
Try \\math${funcName.slice(1)}`, token)
}
funcName = funcName.slice(1);
} else {
funcName = funcName.slice(5);
}
const body = args[0];
return {
type: "lap",
mode: parser.mode,
alignment: funcName,
body
}
},
mathmlBuilder: (group, style) => {
// mathllap, mathrlap, mathclap
let strut;
if (group.alignment === "llap") {
// We need an invisible strut with the same depth as the group.
// We can't just read the depth, so we use \vphantom methods.
const phantomInner = buildExpression(ordargument(group.body), style);
const phantom = new mathMLTree.MathNode("mphantom", phantomInner);
strut = new mathMLTree.MathNode("mpadded", [phantom]);
strut.setAttribute("width", "0px");
}
const inner = buildGroup$1(group.body, style);
let node;
if (group.alignment === "llap") {
inner.style.position = "absolute";
inner.style.right = "0";
inner.style.bottom = `0`; // If we could have read the ink depth, it would go here.
node = new mathMLTree.MathNode("mpadded", [strut, inner]);
} else {
node = new mathMLTree.MathNode("mpadded", [inner]);
}
if (group.alignment === "rlap") {
if (group.body.body.length > 0 && group.body.body[0].type === "genfrac") {
// In Firefox, a <mpadded> squashes the 3/18em padding of a child \frac. Put it back.
node.setAttribute("lspace", "0.16667em");
}
} else {
const offset = group.alignment === "llap" ? "-1" : "-0.5";
node.setAttribute("lspace", offset + "width");
if (group.alignment === "llap") {
node.style.position = "relative";
} else {
node.style.display = "flex";
node.style.justifyContent = "center";
}
}
node.setAttribute("width", "0px");
return node
}
});
// Switching from text mode back to math mode
defineFunction({
type: "ordgroup",
names: ["\\(", "$"],
props: {
numArgs: 0,
allowedInText: true,
allowedInMath: false
},
handler({ funcName, parser }, args) {
const outerMode = parser.mode;
parser.switchMode("math");
const close = funcName === "\\(" ? "\\)" : "$";
const body = parser.parseExpression(false, close);
parser.expect(close);
parser.switchMode(outerMode);
return {
type: "ordgroup",
mode: parser.mode,
body
};
}
});
// Check for extra closing math delimiters
defineFunction({
type: "text", // Doesn't matter what this is.
names: ["\\)", "\\]"],
props: {
numArgs: 0,
allowedInText: true,
allowedInMath: false
},
handler(context, token) {
throw new ParseError(`Mismatched ${context.funcName}`, token);
}
});
const chooseStyle = (group, style) => {
switch (style.level) {
case StyleLevel.DISPLAY: // 0
return group.display;
case StyleLevel.TEXT: // 1
return group.text;
case StyleLevel.SCRIPT: // 2
return group.script;
case StyleLevel.SCRIPTSCRIPT: // 3
return group.scriptscript;
default:
return group.text;
}
};
defineFunction({
type: "mathchoice",
names: ["\\mathchoice"],
props: {
numArgs: 4,
primitive: true
},
handler: ({ parser }, args) => {
return {
type: "mathchoice",
mode: parser.mode,
display: ordargument(args[0]),
text: ordargument(args[1]),
script: ordargument(args[2]),
scriptscript: ordargument(args[3])
};
},
mathmlBuilder: (group, style) => {
const body = chooseStyle(group, style);
return buildExpressionRow(body, style);
}
});
const textAtomTypes = ["text", "textord", "mathord", "atom"];
const padding = width => {
const node = new mathMLTree.MathNode("mspace");
node.setAttribute("width", width + "em");
return node
};
function mathmlBuilder$3(group, style) {
let node;
const inner = buildExpression(group.body, style);
if (group.mclass === "minner") {
node = new mathMLTree.MathNode("mpadded", inner);
} else if (group.mclass === "mord") {
if (group.isCharacterBox || inner[0].type === "mathord") {
node = inner[0];
node.type = "mi";
if (node.children.length === 1 && node.children[0].text && node.children[0].text === "∇") {
node.setAttribute("mathvariant", "normal");
}
} else {
node = new mathMLTree.MathNode("mi", inner);
}
} else {
node = new mathMLTree.MathNode("mrow", inner);
if (group.mustPromote) {
node = inner[0];
node.type = "mo";
if (group.isCharacterBox && group.body[0].text && /[A-Za-z]/.test(group.body[0].text)) {
node.setAttribute("mathvariant", "italic");
}
} else {
node = new mathMLTree.MathNode("mrow", inner);
}
// Set spacing based on what is the most likely adjacent atom type.
// See TeXbook p170.
const doSpacing = style.level < 2; // Operator spacing is zero inside a (sub|super)script.
if (node.type === "mrow") {
if (doSpacing ) {
if (group.mclass === "mbin") {
// medium space
node.children.unshift(padding(0.2222));
node.children.push(padding(0.2222));
} else if (group.mclass === "mrel") {
// thickspace
node.children.unshift(padding(0.2778));
node.children.push(padding(0.2778));
} else if (group.mclass === "mpunct") {
node.children.push(padding(0.1667));
} else if (group.mclass === "minner") {
node.children.unshift(padding(0.0556)); // 1 mu is the most likely option
node.children.push(padding(0.0556));
}
}
} else {
if (group.mclass === "mbin") {
// medium space
node.attributes.lspace = (doSpacing ? "0.2222em" : "0");
node.attributes.rspace = (doSpacing ? "0.2222em" : "0");
} else if (group.mclass === "mrel") {
// thickspace
node.attributes.lspace = (doSpacing ? "0.2778em" : "0");
node.attributes.rspace = (doSpacing ? "0.2778em" : "0");
} else if (group.mclass === "mpunct") {
node.attributes.lspace = "0em";
node.attributes.rspace = (doSpacing ? "0.1667em" : "0");
} else if (group.mclass === "mopen" || group.mclass === "mclose") {
node.attributes.lspace = "0em";
node.attributes.rspace = "0em";
} else if (group.mclass === "minner" && doSpacing) {
node.attributes.lspace = "0.0556em"; // 1 mu is the most likely option
node.attributes.width = "+0.1111em";
}
}
if (!(group.mclass === "mopen" || group.mclass === "mclose")) {
delete node.attributes.stretchy;
delete node.attributes.form;
}
}
return node;
}
// Math class commands except \mathop
defineFunction({
type: "mclass",
names: [
"\\mathord",
"\\mathbin",
"\\mathrel",
"\\mathopen",
"\\mathclose",
"\\mathpunct",
"\\mathinner"
],
props: {
numArgs: 1,
primitive: true
},
handler({ parser, funcName }, args) {
const body = args[0];
const isCharacterBox = utils.isCharacterBox(body);
// We should not wrap a <mo> around a <mi> or <mord>. That would be invalid MathML.
// In that case, we instead promote the text contents of the body to the parent.
let mustPromote = true;
const mord = { type: "mathord", text: "", mode: parser.mode };
const arr = (body.body) ? body.body : [body];
for (const arg of arr) {
if (textAtomTypes.includes(arg.type)) {
if (symbols[parser.mode][arg.text]) {
mord.text += symbols[parser.mode][arg.text].replace;
} else if (arg.text) {
mord.text += arg.text;
} else if (arg.body) {
arg.body.map(e => { mord.text += e.text; });
}
} else {
mustPromote = false;
break
}
}
return {
type: "mclass",
mode: parser.mode,
mclass: "m" + funcName.slice(5),
body: ordargument(mustPromote ? mord : body),
isCharacterBox,
mustPromote
};
},
mathmlBuilder: mathmlBuilder$3
});
const binrelClass = (arg) => {
// \binrel@ spacing varies with (bin|rel|ord) of the atom in the argument.
// (by rendering separately and with {}s before and after, and measuring
// the change in spacing). We'll do roughly the same by detecting the
// atom type directly.
const atom = arg.type === "ordgroup" && arg.body.length ? arg.body[0] : arg;
if (atom.type === "atom" && (atom.family === "bin" || atom.family === "rel")) {
return "m" + atom.family;
} else {
return "mord";
}
};
// \@binrel{x}{y} renders like y but as mbin/mrel/mord if x is mbin/mrel/mord.
// This is equivalent to \binrel@{x}\binrel@@{y} in AMSTeX.
defineFunction({
type: "mclass",
names: ["\\@binrel"],
props: {
numArgs: 2
},
handler({ parser }, args) {
return {
type: "mclass",
mode: parser.mode,
mclass: binrelClass(args[0]),
body: ordargument(args[1]),
isCharacterBox: utils.isCharacterBox(args[1])
};
}
});
// Build a relation or stacked op by placing one symbol on top of another
defineFunction({
type: "mclass",
names: ["\\stackrel", "\\overset", "\\underset"],
props: {
numArgs: 2
},
handler({ parser, funcName }, args) {
const baseArg = args[1];
const shiftedArg = args[0];
const baseOp = {
type: "op",
mode: baseArg.mode,
limits: true,
alwaysHandleSupSub: true,
parentIsSupSub: false,
symbol: false,
stack: true,
suppressBaseShift: funcName !== "\\stackrel",
body: ordargument(baseArg)
};
return {
type: "supsub",
mode: shiftedArg.mode,
base: baseOp,
sup: funcName === "\\underset" ? null : shiftedArg,
sub: funcName === "\\underset" ? shiftedArg : null
};
},
mathmlBuilder: mathmlBuilder$3
});
// Helper function
const buildGroup = (el, style, noneNode) => {
if (!el) { return noneNode }
const node = buildGroup$1(el, style);
if (node.type === "mrow" && node.children.length === 0) { return noneNode }
return node
};
defineFunction({
type: "multiscript",
names: ["\\sideset", "\\pres@cript"], // See macros.js for \prescript
props: {
numArgs: 3
},
handler({ parser, funcName, token }, args) {
if (args[2].body.length === 0) {
throw new ParseError(funcName + `cannot parse an empty base.`)
}
const base = args[2].body[0];
if (parser.settings.strict && funcName === "\\sideset" && !base.symbol) {
throw new ParseError(`The base of \\sideset must be a big operator. Try \\prescript.`)
}
if ((args[0].body.length > 0 && args[0].body[0].type !== "supsub") ||
(args[1].body.length > 0 && args[1].body[0].type !== "supsub")) {
throw new ParseError("\\sideset can parse only subscripts and " +
"superscripts in its first two arguments", token)
}
// The prescripts and postscripts come wrapped in a supsub.
const prescripts = args[0].body.length > 0 ? args[0].body[0] : null;
const postscripts = args[1].body.length > 0 ? args[1].body[0] : null;
if (!prescripts && !postscripts) {
return base
} else if (!prescripts) {
// It's not a multi-script. Get a \textstyle supsub.
return {
type: "styling",
mode: parser.mode,
scriptLevel: "text",
body: [{
type: "supsub",
mode: parser.mode,
base,
sup: postscripts.sup,
sub: postscripts.sub
}]
}
} else {
return {
type: "multiscript",
mode: parser.mode,
isSideset: funcName === "\\sideset",
prescripts,
postscripts,
base
}
}
},
mathmlBuilder(group, style) {
const base = buildGroup$1(group.base, style);
const prescriptsNode = new mathMLTree.MathNode("mprescripts");
const noneNode = new mathMLTree.MathNode("none");
let children = [];
const preSub = buildGroup(group.prescripts.sub, style, noneNode);
const preSup = buildGroup(group.prescripts.sup, style, noneNode);
if (group.isSideset) {
// This seems silly, but LaTeX does this. Firefox ignores it, which does not make me sad.
preSub.setAttribute("style", "text-align: left;");
preSup.setAttribute("style", "text-align: left;");
}
if (group.postscripts) {
const postSub = buildGroup(group.postscripts.sub, style, noneNode);
const postSup = buildGroup(group.postscripts.sup, style, noneNode);
children = [base, postSub, postSup, prescriptsNode, preSub, preSup];
} else {
children = [base, prescriptsNode, preSub, preSup];
}
return new mathMLTree.MathNode("mmultiscripts", children);
}
});
defineFunction({
type: "not",
names: ["\\not"],
props: {
numArgs: 1,
primitive: true,
allowedInText: false
},
handler({ parser }, args) {
const isCharacterBox = utils.isCharacterBox(args[0]);
let body;
if (isCharacterBox) {
body = ordargument(args[0]);
if (body[0].text.charAt(0) === "\\") {
body[0].text = symbols.math[body[0].text].replace;
}
// \u0338 is the Unicode Combining Long Solidus Overlay
body[0].text = body[0].text.slice(0, 1) + "\u0338" + body[0].text.slice(1);
} else {
// When the argument is not a character box, TeX does an awkward, poorly placed overlay.
// We'll do the same.
const notNode = { type: "textord", mode: "math", text: "\u0338" };
const kernNode = { type: "kern", mode: "math", dimension: { number: -0.6, unit: "em" } };
body = [notNode, kernNode, args[0]];
}
return {
type: "not",
mode: parser.mode,
body,
isCharacterBox
};
},
mathmlBuilder(group, style) {
if (group.isCharacterBox) {
const inner = buildExpression(group.body, style, true);
return inner[0]
} else {
return buildExpressionRow(group.body, style)
}
}
});
// Limits, symbols
// Some helpers
const ordAtomTypes = ["textord", "mathord", "atom"];
// Most operators have a large successor symbol, but these don't.
const noSuccessor = ["\\smallint"];
// Math operators (e.g. \sin) need a space between these types and themselves:
const ordTypes = ["textord", "mathord", "ordgroup", "close", "leftright", "font"];
// NOTE: Unlike most `builders`s, this one handles not only "op", but also
// "supsub" since some of them (like \int) can affect super/subscripting.
const setSpacing = node => {
// The user wrote a \mathop{…} function. Change spacing from default to OP spacing.
// The most likely spacing for an OP is a thin space per TeXbook p170.
node.attributes.lspace = "0.1667em";
node.attributes.rspace = "0.1667em";
};
const mathmlBuilder$2 = (group, style) => {
let node;
if (group.symbol) {
// This is a symbol. Just add the symbol.
node = new MathNode("mo", [makeText(group.name, group.mode)]);
if (noSuccessor.includes(group.name)) {
node.setAttribute("largeop", "false");
} else {
node.setAttribute("movablelimits", "false");
}
if (group.fromMathOp) { setSpacing(node); }
} else if (group.body) {
// This is an operator with children. Add them.
node = new MathNode("mo", buildExpression(group.body, style));
if (group.fromMathOp) { setSpacing(node); }
} else {
// This is a text operator. Add all of the characters from the operator's name.
node = new MathNode("mi", [new TextNode(group.name.slice(1))]);
if (!group.parentIsSupSub) {
// Append an invisible <mo>⁡</mo>.
// ref: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.4
const operator = new MathNode("mo", [makeText("\u2061", "text")]);
const row = [node, operator];
// Set spacing
if (group.needsLeadingSpace) {
const lead = new MathNode("mspace");
lead.setAttribute("width", "0.1667em"); // thin space.
row.unshift(lead);
}
if (!group.isFollowedByDelimiter) {
const trail = new MathNode("mspace");
trail.setAttribute("width", "0.1667em"); // thin space.
row.push(trail);
}
node = new MathNode("mrow", row);
}
}
return node;
};
const singleCharBigOps = {
"\u220F": "\\prod",
"\u2210": "\\coprod",
"\u2211": "\\sum",
"\u22c0": "\\bigwedge",
"\u22c1": "\\bigvee",
"\u22c2": "\\bigcap",
"\u22c3": "\\bigcup",
"\u2a00": "\\bigodot",
"\u2a01": "\\bigoplus",
"\u2a02": "\\bigotimes",
"\u2a04": "\\biguplus",
"\u2a05": "\\bigsqcap",
"\u2a06": "\\bigsqcup",
"\u2a03": "\\bigcupdot",
"\u2a07": "\\bigdoublevee",
"\u2a08": "\\bigdoublewedge",
"\u2a09": "\\bigtimes"
};
defineFunction({
type: "op",
names: [
"\\coprod",
"\\bigvee",
"\\bigwedge",
"\\biguplus",
"\\bigcupplus",
"\\bigcupdot",
"\\bigcap",
"\\bigcup",
"\\bigdoublevee",
"\\bigdoublewedge",
"\\intop",
"\\prod",
"\\sum",
"\\bigotimes",
"\\bigoplus",
"\\bigodot",
"\\bigsqcap",
"\\bigsqcup",
"\\bigtimes",
"\\smallint",
"\u220F",
"\u2210",
"\u2211",
"\u22c0",
"\u22c1",
"\u22c2",
"\u22c3",
"\u2a00",
"\u2a01",
"\u2a02",
"\u2a04",
"\u2a06"
],
props: {
numArgs: 0
},
handler: ({ parser, funcName }, args) => {
let fName = funcName;
if (fName.length === 1) {
fName = singleCharBigOps[fName];
}
return {
type: "op",
mode: parser.mode,
limits: true,
parentIsSupSub: false,
symbol: true,
stack: false, // This is true for \stackrel{}, not here.
name: fName
};
},
mathmlBuilder: mathmlBuilder$2
});
// Note: calling defineFunction with a type that's already been defined only
// works because the same mathmlBuilder is being used.
defineFunction({
type: "op",
names: ["\\mathop"],
props: {
numArgs: 1,
primitive: true
},
handler: ({ parser }, args) => {
const body = args[0];
// It would be convienient to just wrap a <mo> around the argument.
// But if the argument is a <mi> or <mord>, that would be invalid MathML.
// In that case, we instead promote the text contents of the body to the parent.
const arr = (body.body) ? body.body : [body];
const isSymbol = arr.length === 1 && ordAtomTypes.includes(arr[0].type);
return {
type: "op",
mode: parser.mode,
limits: true,
parentIsSupSub: false,
symbol: isSymbol,
fromMathOp: true,
stack: false,
name: isSymbol ? arr[0].text : null,
body: isSymbol ? null : ordargument(body)
};
},
mathmlBuilder: mathmlBuilder$2
});
// There are 2 flags for operators; whether they produce limits in
// displaystyle, and whether they are symbols and should grow in
// displaystyle. These four groups cover the four possible choices.
const singleCharIntegrals = {
"\u222b": "\\int",
"\u222c": "\\iint",
"\u222d": "\\iiint",
"\u222e": "\\oint",
"\u222f": "\\oiint",
"\u2230": "\\oiiint",
"\u2231": "\\intclockwise",
"\u2232": "\\varointclockwise",
"\u2a0c": "\\iiiint",
"\u2a0d": "\\intbar",
"\u2a0e": "\\intBar",
"\u2a0f": "\\fint",
"\u2a12": "\\rppolint",
"\u2a13": "\\scpolint",
"\u2a15": "\\pointint",
"\u2a16": "\\sqint",
"\u2a17": "\\intlarhk",
"\u2a18": "\\intx",
"\u2a19": "\\intcap",
"\u2a1a": "\\intcup"
};
// No limits, not symbols
defineFunction({
type: "op",
names: [
"\\arcsin",
"\\arccos",
"\\arctan",
"\\arctg",
"\\arcctg",
"\\arg",
"\\ch",
"\\cos",
"\\cosec",
"\\cosh",
"\\cot",
"\\cotg",
"\\coth",
"\\csc",
"\\ctg",
"\\cth",
"\\deg",
"\\dim",
"\\exp",
"\\hom",
"\\ker",
"\\lg",
"\\ln",
"\\log",
"\\sec",
"\\sin",
"\\sinh",
"\\sh",
"\\sgn",
"\\tan",
"\\tanh",
"\\tg",
"\\th"
],
props: {
numArgs: 0
},
handler({ parser, funcName }) {
const prevAtomType = parser.prevAtomType;
const next = parser.gullet.future().text;
return {
type: "op",
mode: parser.mode,
limits: false,
parentIsSupSub: false,
symbol: false,
stack: false,
isFollowedByDelimiter: isDelimiter(next),
needsLeadingSpace: prevAtomType.length > 0 && ordTypes.includes(prevAtomType),
name: funcName
};
},
mathmlBuilder: mathmlBuilder$2
});
// Limits, not symbols
defineFunction({
type: "op",
names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"],
props: {
numArgs: 0
},
handler({ parser, funcName }) {
const prevAtomType = parser.prevAtomType;
const next = parser.gullet.future().text;
return {
type: "op",
mode: parser.mode,
limits: true,
parentIsSupSub: false,
symbol: false,
stack: false,
isFollowedByDelimiter: isDelimiter(next),
needsLeadingSpace: prevAtomType.length > 0 && ordTypes.includes(prevAtomType),
name: funcName
};
},
mathmlBuilder: mathmlBuilder$2
});
// No limits, symbols
defineFunction({
type: "op",
names: [
"\\int",
"\\iint",
"\\iiint",
"\\iiiint",
"\\oint",
"\\oiint",
"\\oiiint",
"\\intclockwise",
"\\varointclockwise",
"\\intbar",
"\\intBar",
"\\fint",
"\\rppolint",
"\\scpolint",
"\\pointint",
"\\sqint",
"\\intlarhk",
"\\intx",
"\\intcap",
"\\intcup",
"\u222b",
"\u222c",
"\u222d",
"\u222e",
"\u222f",
"\u2230",
"\u2231",
"\u2232",
"\u2a0c",
"\u2a0d",
"\u2a0e",
"\u2a0f",
"\u2a12",
"\u2a13",
"\u2a15",
"\u2a16",
"\u2a17",
"\u2a18",
"\u2a19",
"\u2a1a"
],
props: {
numArgs: 0
},
handler({ parser, funcName }) {
let fName = funcName;
if (fName.length === 1) {
fName = singleCharIntegrals[fName];
}
return {
type: "op",
mode: parser.mode,
limits: false,
parentIsSupSub: false,
symbol: true,
stack: false,
name: fName
};
},
mathmlBuilder: mathmlBuilder$2
});
// NOTE: Unlike most builders, this one handles not only
// "operatorname", but also "supsub" since \operatorname* can
// affect super/subscripting.
const mathmlBuilder$1 = (group, style) => {
let expression = buildExpression(group.body, style.withFont("mathrm"));
// Is expression a string or has it something like a fraction?
let isAllString = true; // default
for (let i = 0; i < expression.length; i++) {
let node = expression[i];
if (node instanceof mathMLTree.MathNode) {
if (node.type === "mrow" && node.children.length === 1 &&
node.children[0] instanceof mathMLTree.MathNode) {
node = node.children[0];
}
switch (node.type) {
case "mi":
case "mn":
case "ms":
case "mtext":
break; // Do nothing yet.
case "mspace":
{
if (node.attributes.width) {
const width = node.attributes.width.replace("em", "");
const ch = spaceCharacter(Number(width));
if (ch === "") {
isAllString = false;
} else {
expression[i] = new mathMLTree.MathNode("mtext", [new mathMLTree.TextNode(ch)]);
}
}
}
break
case "mo": {
const child = node.children[0];
if (node.children.length === 1 && child instanceof mathMLTree.TextNode) {
child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*");
} else {
isAllString = false;
}
break
}
default:
isAllString = false;
}
} else {
isAllString = false;
}
}
if (isAllString) {
// Write a single TextNode instead of multiple nested tags.
const word = expression.map((node) => node.toText()).join("");
expression = [new mathMLTree.TextNode(word)];
} else if (
expression.length === 1
&& ["mover", "munder"].includes(expression[0].type) &&
(expression[0].children[0].type === "mi" || expression[0].children[0].type === "mtext")
) {
expression[0].children[0].type = "mi";
if (group.parentIsSupSub) {
return new mathMLTree.MathNode("mrow", expression)
} else {
const operator = new mathMLTree.MathNode("mo", [makeText("\u2061", "text")]);
return mathMLTree.newDocumentFragment([expression[0], operator])
}
}
let wrapper;
if (isAllString) {
wrapper = new mathMLTree.MathNode("mi", expression);
if (expression[0].text.length === 1) {
wrapper.setAttribute("mathvariant", "normal");
}
} else {
wrapper = new mathMLTree.MathNode("mrow", expression);
}
if (!group.parentIsSupSub) {
// Append an <mo>⁡</mo>.
// ref: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.4
const operator = new mathMLTree.MathNode("mo", [makeText("\u2061", "text")]);
const fragment = [wrapper, operator];
if (group.needsLeadingSpace) {
// LaTeX gives operator spacing, but a <mi> gets ord spacing.
// So add a leading space.
const space = new mathMLTree.MathNode("mspace");
space.setAttribute("width", "0.1667em"); // thin space.
fragment.unshift(space);
}
if (!group.isFollowedByDelimiter) {
const trail = new mathMLTree.MathNode("mspace");
trail.setAttribute("width", "0.1667em"); // thin space.
fragment.push(trail);
}
return mathMLTree.newDocumentFragment(fragment)
}
return wrapper
};
// \operatorname
// amsopn.dtx: \mathop{#1\kern\z@\operator@font#3}\newmcodes@
defineFunction({
type: "operatorname",
names: ["\\operatorname@", "\\operatornamewithlimits"],
props: {
numArgs: 1,
allowedInArgument: true
},
handler: ({ parser, funcName }, args) => {
const body = args[0];
const prevAtomType = parser.prevAtomType;
const next = parser.gullet.future().text;
return {
type: "operatorname",
mode: parser.mode,
body: ordargument(body),
alwaysHandleSupSub: (funcName === "\\operatornamewithlimits"),
limits: false,
parentIsSupSub: false,
isFollowedByDelimiter: isDelimiter(next),
needsLeadingSpace: prevAtomType.length > 0 && ordTypes.includes(prevAtomType)
};
},
mathmlBuilder: mathmlBuilder$1
});
defineMacro("\\operatorname",
"\\@ifstar\\operatornamewithlimits\\operatorname@");
defineFunctionBuilders({
type: "ordgroup",
mathmlBuilder(group, style) {
return buildExpressionRow(group.body, style, group.semisimple);
}
});
defineFunction({
type: "phantom",
names: ["\\phantom"],
props: {
numArgs: 1,
allowedInText: true
},
handler: ({ parser }, args) => {
const body = args[0];
return {
type: "phantom",
mode: parser.mode,
body: ordargument(body)
};
},
mathmlBuilder: (group, style) => {
const inner = buildExpression(group.body, style);
return new mathMLTree.MathNode("mphantom", inner);
}
});
defineFunction({
type: "hphantom",
names: ["\\hphantom"],
props: {
numArgs: 1,
allowedInText: true
},
handler: ({ parser }, args) => {
const body = args[0];
return {
type: "hphantom",
mode: parser.mode,
body
};
},
mathmlBuilder: (group, style) => {
const inner = buildExpression(ordargument(group.body), style);
const phantom = new mathMLTree.MathNode("mphantom", inner);
const node = new mathMLTree.MathNode("mpadded", [phantom]);
node.setAttribute("height", "0px");
node.setAttribute("depth", "0px");
return node;
}
});
defineFunction({
type: "vphantom",
names: ["\\vphantom"],
props: {
numArgs: 1,
allowedInText: true
},
handler: ({ parser }, args) => {
const body = args[0];
return {
type: "vphantom",
mode: parser.mode,
body
};
},
mathmlBuilder: (group, style) => {
const inner = buildExpression(ordargument(group.body), style);
const phantom = new mathMLTree.MathNode("mphantom", inner);
const node = new mathMLTree.MathNode("mpadded", [phantom]);
node.setAttribute("width", "0px");
return node;
}
});
// In LaTeX, \pmb is a simulation of bold font.
// The version of \pmb in ambsy.sty works by typesetting three copies of the argument
// with small offsets. We use CSS font-weight:bold.
defineFunction({
type: "pmb",
names: ["\\pmb"],
props: {
numArgs: 1,
allowedInText: true
},
handler({ parser }, args) {
return {
type: "pmb",
mode: parser.mode,
body: ordargument(args[0])
}
},
mathmlBuilder(group, style) {
const inner = buildExpression(group.body, style);
// Wrap with an <mstyle> element.
const node = wrapWithMstyle(inner);
node.setAttribute("style", "font-weight:bold");
return node
}
});
// \raise, \lower, and \raisebox
const mathmlBuilder = (group, style) => {
const newStyle = style.withLevel(StyleLevel.TEXT);
const node = new mathMLTree.MathNode("mpadded", [buildGroup$1(group.body, newStyle)]);
const dy = calculateSize(group.dy, style);
node.setAttribute("voffset", dy.number + dy.unit);
// Add padding, which acts to increase height in Chromium.
// TODO: Figure out some way to change height in Firefox w/o breaking Chromium.
if (dy.number > 0) {
node.style.padding = dy.number + dy.unit + " 0 0 0";
} else {
node.style.padding = "0 0 " + Math.abs(dy.number) + dy.unit + " 0";
}
return node
};
defineFunction({
type: "raise",
names: ["\\raise", "\\lower"],
props: {
numArgs: 2,
argTypes: ["size", "primitive"],
primitive: true
},
handler({ parser, funcName }, args) {
const amount = assertNodeType(args[0], "size").value;
if (funcName === "\\lower") { amount.number *= -1; }
const body = args[1];
return {
type: "raise",
mode: parser.mode,
dy: amount,
body
};
},
mathmlBuilder
});
defineFunction({
type: "raise",
names: ["\\raisebox"],
props: {
numArgs: 2,
argTypes: ["size", "hbox"],
allowedInText: true
},
handler({ parser, funcName }, args) {
const amount = assertNodeType(args[0], "size").value;
const body = args[1];
return {
type: "raise",
mode: parser.mode,
dy: amount,
body
};
},
mathmlBuilder
});
defineFunction({
type: "ref",
names: ["\\ref", "\\eqref"],
props: {
numArgs: 1,
argTypes: ["raw"]
},
handler({ parser, funcName }, args) {
return {
type: "ref",
mode: parser.mode,
funcName,
string: args[0].string.replace(invalidIdRegEx, "")
};
},
mathmlBuilder(group, style) {
// Create an empty <a> node. Set a class and an href attribute.
// The post-processor will populate with the target's tag or equation number.
const classes = group.funcName === "\\ref" ? ["tml-ref"] : ["tml-ref", "tml-eqref"];
return new AnchorNode("#" + group.string, classes, null)
}
});
defineFunction({
type: "reflect",
names: ["\\reflectbox"],
props: {
numArgs: 1,
argTypes: ["hbox"],
allowedInText: true
},
handler({ parser }, args) {
return {
type: "reflect",
mode: parser.mode,
body: args[0]
};
},
mathmlBuilder(group, style) {
const node = buildGroup$1(group.body, style);
node.style.transform = "scaleX(-1)";
return node
}
});
defineFunction({
type: "internal",
names: ["\\relax"],
props: {
numArgs: 0,
allowedInText: true
},
handler({ parser }) {
return {
type: "internal",
mode: parser.mode
};
}
});
defineFunction({
type: "rule",
names: ["\\rule"],
props: {
numArgs: 2,
numOptionalArgs: 1,
allowedInText: true,
allowedInMath: true,
argTypes: ["size", "size", "size"]
},
handler({ parser }, args, optArgs) {
const shift = optArgs[0];
const width = assertNodeType(args[0], "size");
const height = assertNodeType(args[1], "size");
return {
type: "rule",
mode: parser.mode,
shift: shift && assertNodeType(shift, "size").value,
width: width.value,
height: height.value
};
},
mathmlBuilder(group, style) {
const width = calculateSize(group.width, style);
const height = calculateSize(group.height, style);
const shift = group.shift
? calculateSize(group.shift, style)
: { number: 0, unit: "em" };
const color = (style.color && style.getColor()) || "black";
const rule = new mathMLTree.MathNode("mspace");
if (width.number > 0 && height.number > 0) {
rule.setAttribute("mathbackground", color);
}
rule.setAttribute("width", width.number + width.unit);
rule.setAttribute("height", height.number + height.unit);
if (shift.number === 0) { return rule }
const wrapper = new mathMLTree.MathNode("mpadded", [rule]);
if (shift.number >= 0) {
wrapper.setAttribute("height", "+" + shift.number + shift.unit);
} else {
wrapper.setAttribute("height", shift.number + shift.unit);
wrapper.setAttribute("depth", "+" + -shift.number + shift.unit);
}
wrapper.setAttribute("voffset", shift.number + shift.unit);
return wrapper;
}
});
// The size mappings are taken from TeX with \normalsize=10pt.
// We don't have to track script level. MathML does that.
const sizeMap = {
"\\tiny": 0.5,
"\\sixptsize": 0.6,
"\\Tiny": 0.6,
"\\scriptsize": 0.7,
"\\footnotesize": 0.8,
"\\small": 0.9,
"\\normalsize": 1.0,
"\\large": 1.2,
"\\Large": 1.44,
"\\LARGE": 1.728,
"\\huge": 2.074,
"\\Huge": 2.488
};
defineFunction({
type: "sizing",
names: [
"\\tiny",
"\\sixptsize",
"\\Tiny",
"\\scriptsize",
"\\footnotesize",
"\\small",
"\\normalsize",
"\\large",
"\\Large",
"\\LARGE",
"\\huge",
"\\Huge"
],
props: {
numArgs: 0,
allowedInText: true
},
handler: ({ breakOnTokenText, funcName, parser }, args) => {
if (parser.settings.strict && parser.mode === "math") {
// eslint-disable-next-line no-console
console.log(`Temml strict-mode warning: Command ${funcName} is invalid in math mode.`);
}
const body = parser.parseExpression(false, breakOnTokenText, true);
return {
type: "sizing",
mode: parser.mode,
funcName,
body
};
},
mathmlBuilder: (group, style) => {
const newStyle = style.withFontSize(sizeMap[group.funcName]);
const inner = buildExpression(group.body, newStyle);
// Wrap with an <mstyle> element.
const node = wrapWithMstyle(inner);
const factor = (sizeMap[group.funcName] / style.fontSize).toFixed(4);
node.setAttribute("mathsize", factor + "em");
return node;
}
});
// smash, with optional [tb], as in AMS
defineFunction({
type: "smash",
names: ["\\smash"],
props: {
numArgs: 1,
numOptionalArgs: 1,
allowedInText: true
},
handler: ({ parser }, args, optArgs) => {
let smashHeight = false;
let smashDepth = false;
const tbArg = optArgs[0] && assertNodeType(optArgs[0], "ordgroup");
if (tbArg) {
// Optional [tb] argument is engaged.
// ref: amsmath: \renewcommand{\smash}[1][tb]{%
// def\mb@t{\ht}\def\mb@b{\dp}\def\mb@tb{\ht\z@\z@\dp}%
let letter = "";
for (let i = 0; i < tbArg.body.length; ++i) {
const node = tbArg.body[i];
// TODO: Write an AssertSymbolNode
letter = node.text;
if (letter === "t") {
smashHeight = true;
} else if (letter === "b") {
smashDepth = true;
} else {
smashHeight = false;
smashDepth = false;
break;
}
}
} else {
smashHeight = true;
smashDepth = true;
}
const body = args[0];
return {
type: "smash",
mode: parser.mode,
body,
smashHeight,
smashDepth
};
},
mathmlBuilder: (group, style) => {
const node = new mathMLTree.MathNode("mpadded", [buildGroup$1(group.body, style)]);
if (group.smashHeight) {
node.setAttribute("height", "0px");
}
if (group.smashDepth) {
node.setAttribute("depth", "0px");
}
return node;
}
});
defineFunction({
type: "sqrt",
names: ["\\sqrt"],
props: {
numArgs: 1,
numOptionalArgs: 1
},
handler({ parser }, args, optArgs) {
const index = optArgs[0];
const body = args[0];
return {
type: "sqrt",
mode: parser.mode,
body,
index
};
},
mathmlBuilder(group, style) {
const { body, index } = group;
return index
? new mathMLTree.MathNode("mroot", [
buildGroup$1(body, style),
buildGroup$1(index, style.incrementLevel())
])
: new mathMLTree.MathNode("msqrt", [buildGroup$1(body, style)]);
}
});
const styleMap = {
display: 0,
text: 1,
script: 2,
scriptscript: 3
};
const styleAttributes = {
display: ["0", "true"],
text: ["0", "false"],
script: ["1", "false"],
scriptscript: ["2", "false"]
};
defineFunction({
type: "styling",
names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"],
props: {
numArgs: 0,
allowedInText: true,
primitive: true
},
handler({ breakOnTokenText, funcName, parser }, args) {
// parse out the implicit body
const body = parser.parseExpression(true, breakOnTokenText, true);
const scriptLevel = funcName.slice(1, funcName.length - 5);
return {
type: "styling",
mode: parser.mode,
// Figure out what scriptLevel to use by pulling out the scriptLevel from
// the function name
scriptLevel,
body
};
},
mathmlBuilder(group, style) {
// Figure out what scriptLevel we're changing to.
const newStyle = style.withLevel(styleMap[group.scriptLevel]);
// The style argument in the next line does NOT directly set a MathML script level.
// It just tracks the style level, in case we need to know it for supsub or mathchoice.
const inner = buildExpression(group.body, newStyle);
// Wrap with an <mstyle> element.
const node = wrapWithMstyle(inner);
const attr = styleAttributes[group.scriptLevel];
// Here is where we set the MathML script level.
node.setAttribute("scriptlevel", attr[0]);
node.setAttribute("displaystyle", attr[1]);
return node;
}
});
/**
* Sometimes, groups perform special rules when they have superscripts or
* subscripts attached to them. This function lets the `supsub` group know that
* Sometimes, groups perform special rules when they have superscripts or
* its inner element should handle the superscripts and subscripts instead of
* handling them itself.
*/
// Helpers
const symbolRegEx = /^m(over|under|underover)$/;
// Super scripts and subscripts, whose precise placement can depend on other
// functions that precede them.
defineFunctionBuilders({
type: "supsub",
mathmlBuilder(group, style) {
// Is the inner group a relevant horizonal brace?
let isBrace = false;
let isOver;
let isSup;
let appendApplyFunction = false;
let appendSpace = false;
let needsLeadingSpace = false;
if (group.base && group.base.type === "horizBrace") {
isSup = !!group.sup;
if (isSup === group.base.isOver) {
isBrace = true;
isOver = group.base.isOver;
}
}
if (group.base && !group.base.stack &&
(group.base.type === "op" || group.base.type === "operatorname")) {
group.base.parentIsSupSub = true;
appendApplyFunction = !group.base.symbol;
appendSpace = appendApplyFunction && !group.isFollowedByDelimiter;
needsLeadingSpace = group.base.needsLeadingSpace;
}
const children = group.base && group.base.stack
? [buildGroup$1(group.base.body[0], style)]
: [buildGroup$1(group.base, style)];
// Note regarding scriptstyle level.
// (Sub|super)scripts should not shrink beyond MathML scriptlevel 2 aka \scriptscriptstyle
// Ref: https://w3c.github.io/mathml-core/#the-displaystyle-and-scriptlevel-attributes
// (BTW, MathML scriptlevel 2 is equal to Temml level 3.)
// But Chromium continues to shrink the (sub|super)scripts. So we explicitly set scriptlevel 2.
const childStyle = style.inSubOrSup();
if (group.sub) {
const sub = buildGroup$1(group.sub, childStyle);
if (style.level === 3) { sub.setAttribute("scriptlevel", "2"); }
children.push(sub);
}
if (group.sup) {
const sup = buildGroup$1(group.sup, childStyle);
if (style.level === 3) { sup.setAttribute("scriptlevel", "2"); }
const testNode = sup.type === "mrow" ? sup.children[0] : sup;
if ((testNode && testNode.type === "mo" && testNode.classes.includes("tml-prime"))
&& group.base && group.base.text && "fF".indexOf(group.base.text) > -1) {
// Chromium does not address italic correction on prime. Prevent f′ from overlapping.
testNode.classes.push("prime-pad");
}
children.push(sup);
}
let nodeType;
if (isBrace) {
nodeType = isOver ? "mover" : "munder";
} else if (!group.sub) {
const base = group.base;
if (
base &&
base.type === "op" &&
base.limits &&
(style.level === StyleLevel.DISPLAY || base.alwaysHandleSupSub)
) {
nodeType = "mover";
} else if (
base &&
base.type === "operatorname" &&
base.alwaysHandleSupSub &&
(base.limits || style.level === StyleLevel.DISPLAY)
) {
nodeType = "mover";
} else {
nodeType = "msup";
}
} else if (!group.sup) {
const base = group.base;
if (
base &&
base.type === "op" &&
base.limits &&
(style.level === StyleLevel.DISPLAY || base.alwaysHandleSupSub)
) {
nodeType = "munder";
} else if (
base &&
base.type === "operatorname" &&
base.alwaysHandleSupSub &&
(base.limits || style.level === StyleLevel.DISPLAY)
) {
nodeType = "munder";
} else {
nodeType = "msub";
}
} else {
const base = group.base;
if (base && ((base.type === "op" && base.limits) || base.type === "multiscript") &&
(style.level === StyleLevel.DISPLAY || base.alwaysHandleSupSub)
) {
nodeType = "munderover";
} else if (
base &&
base.type === "operatorname" &&
base.alwaysHandleSupSub &&
(style.level === StyleLevel.DISPLAY || base.limits)
) {
nodeType = "munderover";
} else {
nodeType = "msubsup";
}
}
let node = new mathMLTree.MathNode(nodeType, children);
if (appendApplyFunction) {
// Append an <mo>⁡</mo>.
// ref: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.4
const operator = new mathMLTree.MathNode("mo", [makeText("\u2061", "text")]);
if (needsLeadingSpace) {
const space = new mathMLTree.MathNode("mspace");
space.setAttribute("width", "0.1667em"); // thin space.
node = mathMLTree.newDocumentFragment([space, node, operator]);
} else {
node = mathMLTree.newDocumentFragment([node, operator]);
}
if (appendSpace) {
const space = new mathMLTree.MathNode("mspace");
space.setAttribute("width", "0.1667em"); // thin space.
node.children.push(space);
}
} else if (symbolRegEx.test(nodeType)) {
// Wrap in a <mrow>. Otherwise Firefox stretchy parens will not stretch to include limits.
node = new mathMLTree.MathNode("mrow", [node]);
}
return node
}
});
// Operator ParseNodes created in Parser.js from symbol Groups in src/symbols.js.
const temml_short = ["\\shortmid", "\\nshortmid", "\\shortparallel",
"\\nshortparallel", "\\smallsetminus"];
const arrows = ["\\Rsh", "\\Lsh", "\\restriction"];
const isArrow = str => {
if (str.length === 1) {
const codePoint = str.codePointAt(0);
return (0x218f < codePoint && codePoint < 0x2200)
}
return str.indexOf("arrow") > -1 || str.indexOf("harpoon") > -1 || arrows.includes(str)
};
defineFunctionBuilders({
type: "atom",
mathmlBuilder(group, style) {
const node = new mathMLTree.MathNode("mo", [makeText(group.text, group.mode)]);
if (group.family === "punct") {
node.setAttribute("separator", "true");
} else if (group.family === "open" || group.family === "close") {
// Delims built here should not stretch vertically.
// See delimsizing.js for stretchy delims.
if (group.family === "open") {
node.setAttribute("form", "prefix");
// Set an explicit attribute for stretch. Otherwise Firefox may do it wrong.
node.setAttribute("stretchy", "false");
} else if (group.family === "close") {
node.setAttribute("form", "postfix");
node.setAttribute("stretchy", "false");
}
} else if (group.text === "\\mid") {
// Firefox messes up this spacing if at the end of an <mrow>. See it explicitly.
node.setAttribute("lspace", "0.22em"); // medium space
node.setAttribute("rspace", "0.22em");
node.setAttribute("stretchy", "false");
} else if (group.family === "rel" && isArrow(group.text)) {
node.setAttribute("stretchy", "false");
} else if (temml_short.includes(group.text)) {
node.setAttribute("mathsize", "70%");
} else if (group.text === ":") {
// ":" is not in the MathML operator dictionary. Give it BIN spacing.
node.attributes.lspace = "0.2222em";
node.attributes.rspace = "0.2222em";
}
return node;
}
});
/**
* Maps TeX font commands to "mathvariant" attribute in buildMathML.js
*/
const fontMap = {
// styles
mathbf: "bold",
mathrm: "normal",
textit: "italic",
mathit: "italic",
mathnormal: "italic",
// families
mathbb: "double-struck",
mathcal: "script",
mathfrak: "fraktur",
mathscr: "script",
mathsf: "sans-serif",
mathtt: "monospace"
};
/**
* Returns the math variant as a string or null if none is required.
*/
const getVariant = function(group, style) {
// Handle font specifiers as best we can.
// Chromium does not support the MathML mathvariant attribute.
// So we'll use Unicode replacement characters instead.
// But first, determine the math variant.
// Deal with the \textit, \textbf, etc., functions.
if (style.fontFamily === "texttt") {
return "monospace"
} else if (style.fontFamily === "textsc") {
return "normal"; // handled via character substitution in symbolsOrd.js.
} else if (style.fontFamily === "textsf") {
if (style.fontShape === "textit" && style.fontWeight === "textbf") {
return "sans-serif-bold-italic"
} else if (style.fontShape === "textit") {
return "sans-serif-italic"
} else if (style.fontWeight === "textbf") {
return "sans-serif-bold"
} else {
return "sans-serif"
}
} else if (style.fontShape === "textit" && style.fontWeight === "textbf") {
return "bold-italic"
} else if (style.fontShape === "textit") {
return "italic"
} else if (style.fontWeight === "textbf") {
return "bold"
}
// Deal with the \mathit, mathbf, etc, functions.
const font = style.font;
if (!font || font === "mathnormal") {
return null
}
const mode = group.mode;
switch (font) {
case "mathit":
return "italic"
case "mathrm": {
const codePoint = group.text.codePointAt(0);
// LaTeX \mathrm returns italic for Greek characters.
return (0x03ab < codePoint && codePoint < 0x03cf) ? "italic" : "normal"
}
case "greekItalic":
return "italic"
case "up@greek":
return "normal"
case "boldsymbol":
case "mathboldsymbol":
return "bold-italic"
case "mathbf":
return "bold"
case "mathbb":
return "double-struck"
case "mathfrak":
return "fraktur"
case "mathscr":
case "mathcal":
return "script"
case "mathsf":
return "sans-serif"
case "mathsfit":
return "sans-serif-italic"
case "mathtt":
return "monospace"
}
let text = group.text;
if (symbols[mode][text] && symbols[mode][text].replace) {
text = symbols[mode][text].replace;
}
return Object.prototype.hasOwnProperty.call(fontMap, font) ? fontMap[font] : null
};
// Chromium does not support the MathML `mathvariant` attribute.
// Instead, we replace ASCII characters with Unicode characters that
// are defined in the font as bold, italic, double-struck, etc.
// This module identifies those Unicode code points.
// First, a few helpers.
const script = Object.freeze({
B: 0x20EA, // Offset from ASCII B to Unicode script B
E: 0x20EB,
F: 0x20EB,
H: 0x20C3,
I: 0x20C7,
L: 0x20C6,
M: 0x20E6,
R: 0x20C9,
e: 0x20CA,
g: 0x20A3,
o: 0x20C5
});
const frak = Object.freeze({
C: 0x20EA,
H: 0x20C4,
I: 0x20C8,
R: 0x20CA,
Z: 0x20CE
});
const bbb = Object.freeze({
C: 0x20BF, // blackboard bold
H: 0x20C5,
N: 0x20C7,
P: 0x20C9,
Q: 0x20C9,
R: 0x20CB,
Z: 0x20CA
});
const bold = Object.freeze({
"\u03f5": 0x1D2E7, // lunate epsilon
"\u03d1": 0x1D30C, // vartheta
"\u03f0": 0x1D2EE, // varkappa
"\u03c6": 0x1D319, // varphi
"\u03f1": 0x1D2EF, // varrho
"\u03d6": 0x1D30B // varpi
});
const boldItalic = Object.freeze({
"\u03f5": 0x1D35B, // lunate epsilon
"\u03d1": 0x1D380, // vartheta
"\u03f0": 0x1D362, // varkappa
"\u03c6": 0x1D38D, // varphi
"\u03f1": 0x1D363, // varrho
"\u03d6": 0x1D37F // varpi
});
const boldsf = Object.freeze({
"\u03f5": 0x1D395, // lunate epsilon
"\u03d1": 0x1D3BA, // vartheta
"\u03f0": 0x1D39C, // varkappa
"\u03c6": 0x1D3C7, // varphi
"\u03f1": 0x1D39D, // varrho
"\u03d6": 0x1D3B9 // varpi
});
const bisf = Object.freeze({
"\u03f5": 0x1D3CF, // lunate epsilon
"\u03d1": 0x1D3F4, // vartheta
"\u03f0": 0x1D3D6, // varkappa
"\u03c6": 0x1D401, // varphi
"\u03f1": 0x1D3D7, // varrho
"\u03d6": 0x1D3F3 // varpi
});
// Code point offsets below are derived from https://www.unicode.org/charts/PDF/U1D400.pdf
const offset = Object.freeze({
upperCaseLatin: { // A-Z
"normal": ch => { return 0 },
"bold": ch => { return 0x1D3BF },
"italic": ch => { return 0x1D3F3 },
"bold-italic": ch => { return 0x1D427 },
"script": ch => { return script[ch] || 0x1D45B },
"script-bold": ch => { return 0x1D48F },
"fraktur": ch => { return frak[ch] || 0x1D4C3 },
"fraktur-bold": ch => { return 0x1D52B },
"double-struck": ch => { return bbb[ch] || 0x1D4F7 },
"sans-serif": ch => { return 0x1D55F },
"sans-serif-bold": ch => { return 0x1D593 },
"sans-serif-italic": ch => { return 0x1D5C7 },
"sans-serif-bold-italic": ch => { return 0x1D63C },
"monospace": ch => { return 0x1D62F }
},
lowerCaseLatin: { // a-z
"normal": ch => { return 0 },
"bold": ch => { return 0x1D3B9 },
"italic": ch => { return ch === "h" ? 0x20A6 : 0x1D3ED },
"bold-italic": ch => { return 0x1D421 },
"script": ch => { return script[ch] || 0x1D455 },
"script-bold": ch => { return 0x1D489 },
"fraktur": ch => { return 0x1D4BD },
"fraktur-bold": ch => { return 0x1D525 },
"double-struck": ch => { return 0x1D4F1 },
"sans-serif": ch => { return 0x1D559 },
"sans-serif-bold": ch => { return 0x1D58D },
"sans-serif-italic": ch => { return 0x1D5C1 },
"sans-serif-bold-italic": ch => { return 0x1D5F5 },
"monospace": ch => { return 0x1D629 }
},
upperCaseGreek: { // A-Ω
"normal": ch => { return 0 },
"bold": ch => { return 0x1D317 },
"italic": ch => { return 0x1D351 },
// \boldsymbol actually returns upright bold for upperCaseGreek
"bold-italic": ch => { return 0x1D317 },
"script": ch => { return 0 },
"script-bold": ch => { return 0 },
"fraktur": ch => { return 0 },
"fraktur-bold": ch => { return 0 },
"double-struck": ch => { return 0 },
// Unicode has no code points for regular-weight san-serif Greek. Use bold.
"sans-serif": ch => { return 0x1D3C5 },
"sans-serif-bold": ch => { return 0x1D3C5 },
"sans-serif-italic": ch => { return 0 },
"sans-serif-bold-italic": ch => { return 0x1D3FF },
"monospace": ch => { return 0 }
},
lowerCaseGreek: { // α-ω
"normal": ch => { return 0 },
"bold": ch => { return 0x1D311 },
"italic": ch => { return 0x1D34B },
"bold-italic": ch => { return ch === "\u03d5" ? 0x1D37E : 0x1D385 },
"script": ch => { return 0 },
"script-bold": ch => { return 0 },
"fraktur": ch => { return 0 },
"fraktur-bold": ch => { return 0 },
"double-struck": ch => { return 0 },
// Unicode has no code points for regular-weight san-serif Greek. Use bold.
"sans-serif": ch => { return 0x1D3BF },
"sans-serif-bold": ch => { return 0x1D3BF },
"sans-serif-italic": ch => { return 0 },
"sans-serif-bold-italic": ch => { return 0x1D3F9 },
"monospace": ch => { return 0 }
},
varGreek: { // \varGamma, etc
"normal": ch => { return 0 },
"bold": ch => { return bold[ch] || -51 },
"italic": ch => { return 0 },
"bold-italic": ch => { return boldItalic[ch] || 0x3A },
"script": ch => { return 0 },
"script-bold": ch => { return 0 },
"fraktur": ch => { return 0 },
"fraktur-bold": ch => { return 0 },
"double-struck": ch => { return 0 },
"sans-serif": ch => { return boldsf[ch] || 0x74 },
"sans-serif-bold": ch => { return boldsf[ch] || 0x74 },
"sans-serif-italic": ch => { return 0 },
"sans-serif-bold-italic": ch => { return bisf[ch] || 0xAE },
"monospace": ch => { return 0 }
},
numeral: { // 0-9
"normal": ch => { return 0 },
"bold": ch => { return 0x1D79E },
"italic": ch => { return 0 },
"bold-italic": ch => { return 0 },
"script": ch => { return 0 },
"script-bold": ch => { return 0 },
"fraktur": ch => { return 0 },
"fraktur-bold": ch => { return 0 },
"double-struck": ch => { return 0x1D7A8 },
"sans-serif": ch => { return 0x1D7B2 },
"sans-serif-bold": ch => { return 0x1D7BC },
"sans-serif-italic": ch => { return 0 },
"sans-serif-bold-italic": ch => { return 0 },
"monospace": ch => { return 0x1D7C6 }
}
});
const variantChar = (ch, variant) => {
const codePoint = ch.codePointAt(0);
const block = 0x40 < codePoint && codePoint < 0x5b
? "upperCaseLatin"
: 0x60 < codePoint && codePoint < 0x7b
? "lowerCaseLatin"
: (0x390 < codePoint && codePoint < 0x3AA)
? "upperCaseGreek"
: 0x3B0 < codePoint && codePoint < 0x3CA || ch === "\u03d5"
? "lowerCaseGreek"
: 0x1D6E1 < codePoint && codePoint < 0x1D6FC || bold[ch]
? "varGreek"
: (0x2F < codePoint && codePoint < 0x3A)
? "numeral"
: "other";
return block === "other"
? ch
: String.fromCodePoint(codePoint + offset[block][variant](ch))
};
const smallCaps = Object.freeze({
a: "ᴀ",
b: "ʙ",
c: "ᴄ",
d: "ᴅ",
e: "ᴇ",
f: "ꜰ",
g: "ɢ",
h: "ʜ",
i: "ɪ",
j: "ᴊ",
k: "ᴋ",
l: "ʟ",
m: "ᴍ",
n: "ɴ",
o: "ᴏ",
p: "ᴘ",
q: "ǫ",
r: "ʀ",
s: "s",
t: "ᴛ",
u: "ᴜ",
v: "ᴠ",
w: "ᴡ",
x: "x",
y: "ʏ",
z: "ᴢ"
});
// "mathord" and "textord" ParseNodes created in Parser.js from symbol Groups in
// src/symbols.js.
const numberRegEx = /^\d(?:[\d,.]*\d)?$/;
const latinRegEx = /[A-Ba-z]/;
const primes = new Set(["\\prime", "\\dprime", "\\trprime", "\\qprime",
"\\backprime", "\\backdprime", "\\backtrprime"]);
const italicNumber = (text, variant, tag) => {
const mn = new mathMLTree.MathNode(tag, [text]);
const wrapper = new mathMLTree.MathNode("mstyle", [mn]);
wrapper.style["font-style"] = "italic";
wrapper.style["font-family"] = "Cambria, 'Times New Roman', serif";
if (variant === "bold-italic") { wrapper.style["font-weight"] = "bold"; }
return wrapper
};
defineFunctionBuilders({
type: "mathord",
mathmlBuilder(group, style) {
const text = makeText(group.text, group.mode, style);
const codePoint = text.text.codePointAt(0);
// Test for upper-case Greek
const defaultVariant = (0x0390 < codePoint && codePoint < 0x03aa) ? "normal" : "italic";
const variant = getVariant(group, style) || defaultVariant;
if (variant === "script") {
text.text = variantChar(text.text, variant);
return new mathMLTree.MathNode("mi", [text], [style.font])
} else if (variant !== "italic") {
text.text = variantChar(text.text, variant);
}
let node = new mathMLTree.MathNode("mi", [text]);
// TODO: Handle U+1D49C - U+1D4CF per https://www.unicode.org/charts/PDF/U1D400.pdf
if (variant === "normal") {
node.setAttribute("mathvariant", "normal");
if (text.text.length === 1) {
// A Firefox bug will apply spacing here, but there should be none. Fix it.
node = new mathMLTree.MathNode("mrow", [node]);
}
}
return node
}
});
defineFunctionBuilders({
type: "textord",
mathmlBuilder(group, style) {
let ch = group.text;
const codePoint = ch.codePointAt(0);
if (style.fontFamily === "textsc") {
// Convert small latin letters to small caps.
if (96 < codePoint && codePoint < 123) {
ch = smallCaps[ch];
}
}
const text = makeText(ch, group.mode, style);
const variant = getVariant(group, style) || "normal";
let node;
if (numberRegEx.test(group.text)) {
const tag = group.mode === "text" ? "mtext" : "mn";
if (variant === "italic" || variant === "bold-italic") {
return italicNumber(text, variant, tag)
} else {
if (variant !== "normal") {
text.text = text.text.split("").map(c => variantChar(c, variant)).join("");
}
node = new mathMLTree.MathNode(tag, [text]);
}
} else if (group.mode === "text") {
if (variant !== "normal") {
text.text = variantChar(text.text, variant);
}
node = new mathMLTree.MathNode("mtext", [text]);
} else if (primes.has(group.text)) {
node = new mathMLTree.MathNode("mo", [text]);
// TODO: If/when Chromium uses ssty variant for prime, remove the next line.
node.classes.push("tml-prime");
} else {
const origText = text.text;
if (variant !== "italic") {
text.text = variantChar(text.text, variant);
}
node = new mathMLTree.MathNode("mi", [text]);
if (text.text === origText && latinRegEx.test(origText)) {
node.setAttribute("mathvariant", "italic");
}
}
return node
}
});
// A map of CSS-based spacing functions to their CSS class.
const cssSpace = {
"\\nobreak": "nobreak",
"\\allowbreak": "allowbreak"
};
// A lookup table to determine whether a spacing function/symbol should be
// treated like a regular space character. If a symbol or command is a key
// in this table, then it should be a regular space character. Furthermore,
// the associated value may have a `className` specifying an extra CSS class
// to add to the created `span`.
const regularSpace = {
" ": {},
"\\ ": {},
"~": {
className: "nobreak"
},
"\\space": {},
"\\nobreakspace": {
className: "nobreak"
}
};
// ParseNode<"spacing"> created in Parser.js from the "spacing" symbol Groups in
// src/symbols.js.
defineFunctionBuilders({
type: "spacing",
mathmlBuilder(group, style) {
let node;
if (Object.prototype.hasOwnProperty.call(regularSpace, group.text)) {
// Firefox does not render a space in a <mtext> </mtext>. So write a no-break space.
// TODO: If Firefox fixes that bug, uncomment the next line and write ch into the node.
//const ch = (regularSpace[group.text].className === "nobreak") ? "\u00a0" : " "
node = new mathMLTree.MathNode("mtext", [new mathMLTree.TextNode("\u00a0")]);
} else if (Object.prototype.hasOwnProperty.call(cssSpace, group.text)) {
// MathML 3.0 calls for nobreak to occur in an <mo>, not an <mtext>
// Ref: https://www.w3.org/Math/draft-spec/mathml.html#chapter3_presm.lbattrs
node = new mathMLTree.MathNode("mo");
if (group.text === "\\nobreak") {
node.setAttribute("linebreak", "nobreak");
}
} else {
throw new ParseError(`Unknown type of space "${group.text}"`)
}
return node
}
});
defineFunctionBuilders({
type: "tag"
});
// For a \tag, the work usually done in a mathmlBuilder is instead done in buildMathML.js.
// That way, a \tag can be pulled out of the parse tree and wrapped around the outer node.
// Non-mathy text, possibly in a font
const textFontFamilies = {
"\\text": undefined,
"\\textrm": "textrm",
"\\textsf": "textsf",
"\\texttt": "texttt",
"\\textnormal": "textrm",
"\\textsc": "textsc" // small caps
};
const textFontWeights = {
"\\textbf": "textbf",
"\\textmd": "textmd"
};
const textFontShapes = {
"\\textit": "textit",
"\\textup": "textup"
};
const styleWithFont = (group, style) => {
const font = group.font;
// Checks if the argument is a font family or a font style.
if (!font) {
return style;
} else if (textFontFamilies[font]) {
return style.withTextFontFamily(textFontFamilies[font]);
} else if (textFontWeights[font]) {
return style.withTextFontWeight(textFontWeights[font]);
} else if (font === "\\emph") {
return style.fontShape === "textit"
? style.withTextFontShape("textup")
: style.withTextFontShape("textit")
}
return style.withTextFontShape(textFontShapes[font])
};
defineFunction({
type: "text",
names: [
// Font families
"\\text",
"\\textrm",
"\\textsf",
"\\texttt",
"\\textnormal",
"\\textsc",
// Font weights
"\\textbf",
"\\textmd",
// Font Shapes
"\\textit",
"\\textup",
"\\emph"
],
props: {
numArgs: 1,
argTypes: ["text"],
allowedInArgument: true,
allowedInText: true
},
handler({ parser, funcName }, args) {
const body = args[0];
return {
type: "text",
mode: parser.mode,
body: ordargument(body),
font: funcName
};
},
mathmlBuilder(group, style) {
const newStyle = styleWithFont(group, style);
const mrow = buildExpressionRow(group.body, newStyle);
return consolidateText(mrow)
}
});
// \vcenter: Vertically center the argument group on the math axis.
defineFunction({
type: "vcenter",
names: ["\\vcenter"],
props: {
numArgs: 1,
argTypes: ["original"],
allowedInText: false
},
handler({ parser }, args) {
return {
type: "vcenter",
mode: parser.mode,
body: args[0]
};
},
mathmlBuilder(group, style) {
// Use a math table to create vertically centered content.
const mtd = new mathMLTree.MathNode("mtd", [buildGroup$1(group.body, style)]);
mtd.style.padding = "0";
const mtr = new mathMLTree.MathNode("mtr", [mtd]);
return new mathMLTree.MathNode("mtable", [mtr])
}
});
defineFunction({
type: "verb",
names: ["\\verb"],
props: {
numArgs: 0,
allowedInText: true
},
handler(context, args, optArgs) {
// \verb and \verb* are dealt with directly in Parser.js.
// If we end up here, it's because of a failure to match the two delimiters
// in the regex in Lexer.js. LaTeX raises the following error when \verb is
// terminated by end of line (or file).
throw new ParseError("\\verb ended by end of line instead of matching delimiter");
},
mathmlBuilder(group, style) {
const text = new mathMLTree.TextNode(makeVerb(group));
const node = new mathMLTree.MathNode("mtext", [text]);
node.setAttribute("mathvariant", "monospace");
return node;
}
});
/**
* Converts verb group into body string.
*
* \verb* replaces each space with an open box \u2423
* \verb replaces each space with a no-break space \xA0
*/
const makeVerb = (group) => group.body.replace(/ /g, group.star ? "\u2423" : "\xA0");
/** Include this to ensure that all functions are defined. */
const functions = _functions;
/**
* The Lexer class handles tokenizing the input in various ways. Since our
* parser expects us to be able to backtrack, the lexer allows lexing from any
* given starting point.
*
* Its main exposed function is the `lex` function, which takes a position to
* lex from and a type of token to lex. It defers to the appropriate `_innerLex`
* function.
*
* The various `_innerLex` functions perform the actual lexing of different
* kinds.
*/
/* The following tokenRegex
* - matches typical whitespace (but not NBSP etc.) using its first two groups
* - does not match any control character \x00-\x1f except whitespace
* - does not match a bare backslash
* - matches any ASCII character except those just mentioned
* - does not match the BMP private use area \uE000-\uF8FF
* - does not match bare surrogate code units
* - matches any BMP character except for those just described
* - matches any valid Unicode surrogate pair
* - mathches numerals
* - matches a backslash followed by one or more whitespace characters
* - matches a backslash followed by one or more letters then whitespace
* - matches a backslash followed by any BMP character
* Capturing groups:
* [1] regular whitespace
* [2] backslash followed by whitespace
* [3] anything else, which may include:
* [4] left character of \verb*
* [5] left character of \verb
* [6] backslash followed by word, excluding any trailing whitespace
* Just because the Lexer matches something doesn't mean it's valid input:
* If there is no matching function or symbol definition, the Parser will
* still reject the input.
*/
const spaceRegexString = "[ \r\n\t]";
const controlWordRegexString = "\\\\[a-zA-Z@]+";
const controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]";
const controlWordWhitespaceRegexString = `(${controlWordRegexString})${spaceRegexString}*`;
const controlSpaceRegexString = "\\\\(\n|[ \r\t]+\n?)[ \r\t]*";
const combiningDiacriticalMarkString = "[\u0300-\u036f]";
const combiningDiacriticalMarksEndRegex = new RegExp(`${combiningDiacriticalMarkString}+$`);
const tokenRegexString =
`(${spaceRegexString}+)|` + // whitespace
`${controlSpaceRegexString}|` + // whitespace
"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]" + // single codepoint
`${combiningDiacriticalMarkString}*` + // ...plus accents
"|[\uD800-\uDBFF][\uDC00-\uDFFF]" + // surrogate pair
`${combiningDiacriticalMarkString}*` + // ...plus accents
"|\\\\verb\\*([^]).*?\\4" + // \verb*
"|\\\\verb([^*a-zA-Z]).*?\\5" + // \verb unstarred
`|${controlWordWhitespaceRegexString}` + // \macroName + spaces
`|${controlSymbolRegexString})`; // \\, \', etc.
/** Main Lexer class */
class Lexer {
constructor(input, settings) {
// Separate accents from characters
this.input = input;
this.settings = settings;
this.tokenRegex = new RegExp(tokenRegexString, 'g');
// Category codes. The lexer only supports comment characters (14) for now.
// MacroExpander additionally distinguishes active (13).
this.catcodes = {
"%": 14, // comment character
"~": 13 // active character
};
}
setCatcode(char, code) {
this.catcodes[char] = code;
}
/**
* This function lexes a single token.
*/
lex() {
const input = this.input;
const pos = this.tokenRegex.lastIndex;
if (pos === input.length) {
return new Token("EOF", new SourceLocation(this, pos, pos));
}
const match = this.tokenRegex.exec(input);
if (match === null || match.index !== pos) {
throw new ParseError(
`Unexpected character: '${input[pos]}'`,
new Token(input[pos], new SourceLocation(this, pos, pos + 1))
);
}
const text = match[6] || match[3] || (match[2] ? "\\ " : " ");
if (this.catcodes[text] === 14) {
// comment character
const nlIndex = input.indexOf("\n", this.tokenRegex.lastIndex);
if (nlIndex === -1) {
this.tokenRegex.lastIndex = input.length; // EOF
if (this.settings.strict) {
throw new ParseError("% comment has no terminating newline; LaTeX would " +
"fail because of commenting the end of math mode")
}
} else {
this.tokenRegex.lastIndex = nlIndex + 1;
}
return this.lex();
}
return new Token(text, new SourceLocation(this, pos, this.tokenRegex.lastIndex));
}
}
/**
* A `Namespace` refers to a space of nameable things like macros or lengths,
* which can be `set` either globally or local to a nested group, using an
* undo stack similar to how TeX implements this functionality.
* Performance-wise, `get` and local `set` take constant time, while global
* `set` takes time proportional to the depth of group nesting.
*/
class Namespace {
/**
* Both arguments are optional. The first argument is an object of
* built-in mappings which never change. The second argument is an object
* of initial (global-level) mappings, which will constantly change
* according to any global/top-level `set`s done.
*/
constructor(builtins = {}, globalMacros = {}) {
this.current = globalMacros;
this.builtins = builtins;
this.undefStack = [];
}
/**
* Start a new nested group, affecting future local `set`s.
*/
beginGroup() {
this.undefStack.push({});
}
/**
* End current nested group, restoring values before the group began.
*/
endGroup() {
if (this.undefStack.length === 0) {
throw new ParseError(
"Unbalanced namespace destruction: attempt " +
"to pop global namespace; please report this as a bug"
);
}
const undefs = this.undefStack.pop();
for (const undef in undefs) {
if (Object.prototype.hasOwnProperty.call(undefs, undef )) {
if (undefs[undef] === undefined) {
delete this.current[undef];
} else {
this.current[undef] = undefs[undef];
}
}
}
}
/**
* Detect whether `name` has a definition. Equivalent to
* `get(name) != null`.
*/
has(name) {
return Object.prototype.hasOwnProperty.call(this.current, name ) ||
Object.prototype.hasOwnProperty.call(this.builtins, name );
}
/**
* Get the current value of a name, or `undefined` if there is no value.
*
* Note: Do not use `if (namespace.get(...))` to detect whether a macro
* is defined, as the definition may be the empty string which evaluates
* to `false` in JavaScript. Use `if (namespace.get(...) != null)` or
* `if (namespace.has(...))`.
*/
get(name) {
if (Object.prototype.hasOwnProperty.call(this.current, name )) {
return this.current[name];
} else {
return this.builtins[name];
}
}
/**
* Set the current value of a name, and optionally set it globally too.
* Local set() sets the current value and (when appropriate) adds an undo
* operation to the undo stack. Global set() may change the undo
* operation at every level, so takes time linear in their number.
*/
set(name, value, global = false) {
if (global) {
// Global set is equivalent to setting in all groups. Simulate this
// by destroying any undos currently scheduled for this name,
// and adding an undo with the *new* value (in case it later gets
// locally reset within this environment).
for (let i = 0; i < this.undefStack.length; i++) {
delete this.undefStack[i][name];
}
if (this.undefStack.length > 0) {
this.undefStack[this.undefStack.length - 1][name] = value;
}
} else {
// Undo this set at end of this group (possibly to `undefined`),
// unless an undo is already in place, in which case that older
// value is the correct one.
const top = this.undefStack[this.undefStack.length - 1];
if (top && !Object.prototype.hasOwnProperty.call(top, name )) {
top[name] = this.current[name];
}
}
this.current[name] = value;
}
}
/**
* This file contains the “gullet” where macros are expanded
* until only non-macro tokens remain.
*/
// List of commands that act like macros but aren't defined as a macro,
// function, or symbol. Used in `isDefined`.
const implicitCommands = {
"^": true, // Parser.js
_: true, // Parser.js
"\\limits": true, // Parser.js
"\\nolimits": true // Parser.js
};
class MacroExpander {
constructor(input, settings, mode) {
this.settings = settings;
this.expansionCount = 0;
this.feed(input);
// Make new global namespace
this.macros = new Namespace(macros, settings.macros);
this.mode = mode;
this.stack = []; // contains tokens in REVERSE order
}
/**
* Feed a new input string to the same MacroExpander
* (with existing macros etc.).
*/
feed(input) {
this.lexer = new Lexer(input, this.settings);
}
/**
* Switches between "text" and "math" modes.
*/
switchMode(newMode) {
this.mode = newMode;
}
/**
* Start a new group nesting within all namespaces.
*/
beginGroup() {
this.macros.beginGroup();
}
/**
* End current group nesting within all namespaces.
*/
endGroup() {
this.macros.endGroup();
}
/**
* Returns the topmost token on the stack, without expanding it.
* Similar in behavior to TeX's `\futurelet`.
*/
future() {
if (this.stack.length === 0) {
this.pushToken(this.lexer.lex());
}
return this.stack[this.stack.length - 1]
}
/**
* Remove and return the next unexpanded token.
*/
popToken() {
this.future(); // ensure non-empty stack
return this.stack.pop();
}
/**
* Add a given token to the token stack. In particular, this get be used
* to put back a token returned from one of the other methods.
*/
pushToken(token) {
this.stack.push(token);
}
/**
* Append an array of tokens to the token stack.
*/
pushTokens(tokens) {
this.stack.push(...tokens);
}
/**
* Find an macro argument without expanding tokens and append the array of
* tokens to the token stack. Uses Token as a container for the result.
*/
scanArgument(isOptional) {
let start;
let end;
let tokens;
if (isOptional) {
this.consumeSpaces(); // \@ifnextchar gobbles any space following it
if (this.future().text !== "[") {
return null;
}
start = this.popToken(); // don't include [ in tokens
({ tokens, end } = this.consumeArg(["]"]));
} else {
({ tokens, start, end } = this.consumeArg());
}
// indicate the end of an argument
this.pushToken(new Token("EOF", end.loc));
this.pushTokens(tokens);
return start.range(end, "");
}
/**
* Consume all following space tokens, without expansion.
*/
consumeSpaces() {
for (;;) {
const token = this.future();
if (token.text === " ") {
this.stack.pop();
} else {
break;
}
}
}
/**
* Consume an argument from the token stream, and return the resulting array
* of tokens and start/end token.
*/
consumeArg(delims) {
// The argument for a delimited parameter is the shortest (possibly
// empty) sequence of tokens with properly nested {...} groups that is
// followed ... by this particular list of non-parameter tokens.
// The argument for an undelimited parameter is the next nonblank
// token, unless that token is ‘{’, when the argument will be the
// entire {...} group that follows.
const tokens = [];
const isDelimited = delims && delims.length > 0;
if (!isDelimited) {
// Ignore spaces between arguments. As the TeXbook says:
// "After you have said ‘\def\row#1#2{...}’, you are allowed to
// put spaces between the arguments (e.g., ‘\row x n’), because
// TeX doesn’t use single spaces as undelimited arguments."
this.consumeSpaces();
}
const start = this.future();
let tok;
let depth = 0;
let match = 0;
do {
tok = this.popToken();
tokens.push(tok);
if (tok.text === "{") {
++depth;
} else if (tok.text === "}") {
--depth;
if (depth === -1) {
throw new ParseError("Extra }", tok);
}
} else if (tok.text === "EOF") {
throw new ParseError(
"Unexpected end of input in a macro argument" +
", expected '" +
(delims && isDelimited ? delims[match] : "}") +
"'",
tok
);
}
if (delims && isDelimited) {
if ((depth === 0 || (depth === 1 && delims[match] === "{")) && tok.text === delims[match]) {
++match;
if (match === delims.length) {
// don't include delims in tokens
tokens.splice(-match, match);
break;
}
} else {
match = 0;
}
}
} while (depth !== 0 || isDelimited);
// If the argument found ... has the form ‘{<nested tokens>}’,
// ... the outermost braces enclosing the argument are removed
if (start.text === "{" && tokens[tokens.length - 1].text === "}") {
tokens.pop();
tokens.shift();
}
tokens.reverse(); // to fit in with stack order
return { tokens, start, end: tok };
}
/**
* Consume the specified number of (delimited) arguments from the token
* stream and return the resulting array of arguments.
*/
consumeArgs(numArgs, delimiters) {
if (delimiters) {
if (delimiters.length !== numArgs + 1) {
throw new ParseError("The length of delimiters doesn't match the number of args!");
}
const delims = delimiters[0];
for (let i = 0; i < delims.length; i++) {
const tok = this.popToken();
if (delims[i] !== tok.text) {
throw new ParseError("Use of the macro doesn't match its definition", tok);
}
}
}
const args = [];
for (let i = 0; i < numArgs; i++) {
args.push(this.consumeArg(delimiters && delimiters[i + 1]).tokens);
}
return args;
}
/**
* Expand the next token only once if possible.
*
* If the token is expanded, the resulting tokens will be pushed onto
* the stack in reverse order, and the number of such tokens will be
* returned. This number might be zero or positive.
*
* If not, the return value is `false`, and the next token remains at the
* top of the stack.
*
* In either case, the next token will be on the top of the stack,
* or the stack will be empty (in case of empty expansion
* and no other tokens).
*
* Used to implement `expandAfterFuture` and `expandNextToken`.
*
* If expandableOnly, only expandable tokens are expanded and
* an undefined control sequence results in an error.
*/
expandOnce(expandableOnly) {
const topToken = this.popToken();
const name = topToken.text;
const expansion = !topToken.noexpand ? this._getExpansion(name) : null;
if (expansion == null || (expandableOnly && expansion.unexpandable)) {
if (expandableOnly && expansion == null && name[0] === "\\" && !this.isDefined(name)) {
throw new ParseError("Undefined control sequence: " + name);
}
this.pushToken(topToken);
return false;
}
this.expansionCount++;
if (this.expansionCount > this.settings.maxExpand) {
throw new ParseError(
"Too many expansions: infinite loop or " + "need to increase maxExpand setting"
);
}
let tokens = expansion.tokens;
const args = this.consumeArgs(expansion.numArgs, expansion.delimiters);
if (expansion.numArgs) {
// paste arguments in place of the placeholders
tokens = tokens.slice(); // make a shallow copy
for (let i = tokens.length - 1; i >= 0; --i) {
let tok = tokens[i];
if (tok.text === "#") {
if (i === 0) {
throw new ParseError("Incomplete placeholder at end of macro body", tok);
}
tok = tokens[--i]; // next token on stack
if (tok.text === "#") {
// ## → #
tokens.splice(i + 1, 1); // drop first #
} else if (/^[1-9]$/.test(tok.text)) {
// replace the placeholder with the indicated argument
tokens.splice(i, 2, ...args[+tok.text - 1]);
} else {
throw new ParseError("Not a valid argument number", tok);
}
}
}
}
// Concatenate expansion onto top of stack.
this.pushTokens(tokens);
return tokens.length;
}
/**
* Expand the next token only once (if possible), and return the resulting
* top token on the stack (without removing anything from the stack).
* Similar in behavior to TeX's `\expandafter\futurelet`.
* Equivalent to expandOnce() followed by future().
*/
expandAfterFuture() {
this.expandOnce();
return this.future();
}
/**
* Recursively expand first token, then return first non-expandable token.
*/
expandNextToken() {
for (;;) {
if (this.expandOnce() === false) { // fully expanded
const token = this.stack.pop();
// The token after \noexpand is interpreted as if its meaning were ‘\relax’
if (token.treatAsRelax) {
token.text = "\\relax";
}
return token
}
}
// This pathway is impossible.
throw new Error(); // eslint-disable-line no-unreachable
}
/**
* Fully expand the given macro name and return the resulting list of
* tokens, or return `undefined` if no such macro is defined.
*/
expandMacro(name) {
return this.macros.has(name) ? this.expandTokens([new Token(name)]) : undefined;
}
/**
* Fully expand the given token stream and return the resulting list of
* tokens. Note that the input tokens are in reverse order, but the
* output tokens are in forward order.
*/
expandTokens(tokens) {
const output = [];
const oldStackLength = this.stack.length;
this.pushTokens(tokens);
while (this.stack.length > oldStackLength) {
// Expand only expandable tokens
if (this.expandOnce(true) === false) { // fully expanded
const token = this.stack.pop();
if (token.treatAsRelax) {
// the expansion of \noexpand is the token itself
token.noexpand = false;
token.treatAsRelax = false;
}
output.push(token);
}
}
return output;
}
/**
* Fully expand the given macro name and return the result as a string,
* or return `undefined` if no such macro is defined.
*/
expandMacroAsText(name) {
const tokens = this.expandMacro(name);
if (tokens) {
return tokens.map((token) => token.text).join("");
} else {
return tokens;
}
}
/**
* Returns the expanded macro as a reversed array of tokens and a macro
* argument count. Or returns `null` if no such macro.
*/
_getExpansion(name) {
const definition = this.macros.get(name);
if (definition == null) {
// mainly checking for undefined here
return definition;
}
// If a single character has an associated catcode other than 13
// (active character), then don't expand it.
if (name.length === 1) {
const catcode = this.lexer.catcodes[name];
if (catcode != null && catcode !== 13) {
return
}
}
const expansion = typeof definition === "function" ? definition(this) : definition;
if (typeof expansion === "string") {
let numArgs = 0;
if (expansion.indexOf("#") !== -1) {
const stripped = expansion.replace(/##/g, "");
while (stripped.indexOf("#" + (numArgs + 1)) !== -1) {
++numArgs;
}
}
const bodyLexer = new Lexer(expansion, this.settings);
const tokens = [];
let tok = bodyLexer.lex();
while (tok.text !== "EOF") {
tokens.push(tok);
tok = bodyLexer.lex();
}
tokens.reverse(); // to fit in with stack using push and pop
const expanded = { tokens, numArgs };
return expanded;
}
return expansion;
}
/**
* Determine whether a command is currently "defined" (has some
* functionality), meaning that it's a macro (in the current group),
* a function, a symbol, or one of the special commands listed in
* `implicitCommands`.
*/
isDefined(name) {
return (
this.macros.has(name) ||
Object.prototype.hasOwnProperty.call(functions, name ) ||
Object.prototype.hasOwnProperty.call(symbols.math, name ) ||
Object.prototype.hasOwnProperty.call(symbols.text, name ) ||
Object.prototype.hasOwnProperty.call(implicitCommands, name )
);
}
/**
* Determine whether a command is expandable.
*/
isExpandable(name) {
const macro = this.macros.get(name);
return macro != null
? typeof macro === "string" || typeof macro === "function" || !macro.unexpandable
: Object.prototype.hasOwnProperty.call(functions, name ) && !functions[name].primitive;
}
}
// Helpers for Parser.js handling of Unicode (sub|super)script characters.
const unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/;
const uSubsAndSups = Object.freeze({
'₊': '+',
'₋': '-',
'₌': '=',
'₍': '(',
'₎': ')',
'₀': '0',
'₁': '1',
'₂': '2',
'₃': '3',
'₄': '4',
'₅': '5',
'₆': '6',
'₇': '7',
'₈': '8',
'₉': '9',
'\u2090': 'a',
'\u2091': 'e',
'\u2095': 'h',
'\u1D62': 'i',
'\u2C7C': 'j',
'\u2096': 'k',
'\u2097': 'l',
'\u2098': 'm',
'\u2099': 'n',
'\u2092': 'o',
'\u209A': 'p',
'\u1D63': 'r',
'\u209B': 's',
'\u209C': 't',
'\u1D64': 'u',
'\u1D65': 'v',
'\u2093': 'x',
'\u1D66': 'β',
'\u1D67': 'γ',
'\u1D68': 'ρ',
'\u1D69': '\u03d5',
'\u1D6A': 'χ',
'⁺': '+',
'⁻': '-',
'⁼': '=',
'⁽': '(',
'⁾': ')',
'⁰': '0',
'¹': '1',
'²': '2',
'³': '3',
'⁴': '4',
'⁵': '5',
'⁶': '6',
'⁷': '7',
'⁸': '8',
'⁹': '9',
'\u1D2C': 'A',
'\u1D2E': 'B',
'\u1D30': 'D',
'\u1D31': 'E',
'\u1D33': 'G',
'\u1D34': 'H',
'\u1D35': 'I',
'\u1D36': 'J',
'\u1D37': 'K',
'\u1D38': 'L',
'\u1D39': 'M',
'\u1D3A': 'N',
'\u1D3C': 'O',
'\u1D3E': 'P',
'\u1D3F': 'R',
'\u1D40': 'T',
'\u1D41': 'U',
'\u2C7D': 'V',
'\u1D42': 'W',
'\u1D43': 'a',
'\u1D47': 'b',
'\u1D9C': 'c',
'\u1D48': 'd',
'\u1D49': 'e',
'\u1DA0': 'f',
'\u1D4D': 'g',
'\u02B0': 'h',
'\u2071': 'i',
'\u02B2': 'j',
'\u1D4F': 'k',
'\u02E1': 'l',
'\u1D50': 'm',
'\u207F': 'n',
'\u1D52': 'o',
'\u1D56': 'p',
'\u02B3': 'r',
'\u02E2': 's',
'\u1D57': 't',
'\u1D58': 'u',
'\u1D5B': 'v',
'\u02B7': 'w',
'\u02E3': 'x',
'\u02B8': 'y',
'\u1DBB': 'z',
'\u1D5D': 'β',
'\u1D5E': 'γ',
'\u1D5F': 'δ',
'\u1D60': '\u03d5',
'\u1D61': 'χ',
'\u1DBF': 'θ'
});
// Used for Unicode input of calligraphic and script letters
const asciiFromScript = Object.freeze({
"\ud835\udc9c": "A",
"\u212c": "B",
"\ud835\udc9e": "C",
"\ud835\udc9f": "D",
"\u2130": "E",
"\u2131": "F",
"\ud835\udca2": "G",
"\u210B": "H",
"\u2110": "I",
"\ud835\udca5": "J",
"\ud835\udca6": "K",
"\u2112": "L",
"\u2133": "M",
"\ud835\udca9": "N",
"\ud835\udcaa": "O",
"\ud835\udcab": "P",
"\ud835\udcac": "Q",
"\u211B": "R",
"\ud835\udcae": "S",
"\ud835\udcaf": "T",
"\ud835\udcb0": "U",
"\ud835\udcb1": "V",
"\ud835\udcb2": "W",
"\ud835\udcb3": "X",
"\ud835\udcb4": "Y",
"\ud835\udcb5": "Z"
});
// Mapping of Unicode accent characters to their LaTeX equivalent in text and
// math mode (when they exist).
var unicodeAccents = {
"\u0301": { text: "\\'", math: "\\acute" },
"\u0300": { text: "\\`", math: "\\grave" },
"\u0308": { text: '\\"', math: "\\ddot" },
"\u0303": { text: "\\~", math: "\\tilde" },
"\u0304": { text: "\\=", math: "\\bar" },
"\u0306": { text: "\\u", math: "\\breve" },
"\u030c": { text: "\\v", math: "\\check" },
"\u0302": { text: "\\^", math: "\\hat" },
"\u0307": { text: "\\.", math: "\\dot" },
"\u030a": { text: "\\r", math: "\\mathring" },
"\u030b": { text: "\\H" },
'\u0327': { text: '\\c' }
};
var unicodeSymbols = {
"á": "á",
"à": "à",
"ä": "ä",
"ǟ": "ǟ",
"ã": "ã",
"ā": "ā",
"ă": "ă",
"ắ": "ắ",
"ằ": "ằ",
"ẵ": "ẵ",
"ǎ": "ǎ",
"â": "â",
"ấ": "ấ",
"ầ": "ầ",
"ẫ": "ẫ",
"ȧ": "ȧ",
"ǡ": "ǡ",
"å": "å",
"ǻ": "ǻ",
"ḃ": "ḃ",
"ć": "ć",
"č": "č",
"ĉ": "ĉ",
"ċ": "ċ",
"ď": "ď",
"ḋ": "ḋ",
"é": "é",
"è": "è",
"ë": "ë",
"ẽ": "ẽ",
"ē": "ē",
"ḗ": "ḗ",
"ḕ": "ḕ",
"ĕ": "ĕ",
"ě": "ě",
"ê": "ê",
"ế": "ế",
"ề": "ề",
"ễ": "ễ",
"ė": "ė",
"ḟ": "ḟ",
"ǵ": "ǵ",
"ḡ": "ḡ",
"ğ": "ğ",
"ǧ": "ǧ",
"ĝ": "ĝ",
"ġ": "ġ",
"ḧ": "ḧ",
"ȟ": "ȟ",
"ĥ": "ĥ",
"ḣ": "ḣ",
"í": "í",
"ì": "ì",
"ï": "ï",
"ḯ": "ḯ",
"ĩ": "ĩ",
"ī": "ī",
"ĭ": "ĭ",
"ǐ": "ǐ",
"î": "î",
"ǰ": "ǰ",
"ĵ": "ĵ",
"ḱ": "ḱ",
"ǩ": "ǩ",
"ĺ": "ĺ",
"ľ": "ľ",
"ḿ": "ḿ",
"ṁ": "ṁ",
"ń": "ń",
"ǹ": "ǹ",
"ñ": "ñ",
"ň": "ň",
"ṅ": "ṅ",
"ó": "ó",
"ò": "ò",
"ö": "ö",
"ȫ": "ȫ",
"õ": "õ",
"ṍ": "ṍ",
"ṏ": "ṏ",
"ȭ": "ȭ",
"ō": "ō",
"ṓ": "ṓ",
"ṑ": "ṑ",
"ŏ": "ŏ",
"ǒ": "ǒ",
"ô": "ô",
"ố": "ố",
"ồ": "ồ",
"ỗ": "ỗ",
"ȯ": "ȯ",
"ȱ": "ȱ",
"ő": "ő",
"ṕ": "ṕ",
"ṗ": "ṗ",
"ŕ": "ŕ",
"ř": "ř",
"ṙ": "ṙ",
"ś": "ś",
"ṥ": "ṥ",
"š": "š",
"ṧ": "ṧ",
"ŝ": "ŝ",
"ṡ": "ṡ",
"ẗ": "ẗ",
"ť": "ť",
"ṫ": "ṫ",
"ú": "ú",
"ù": "ù",
"ü": "ü",
"ǘ": "ǘ",
"ǜ": "ǜ",
"ǖ": "ǖ",
"ǚ": "ǚ",
"ũ": "ũ",
"ṹ": "ṹ",
"ū": "ū",
"ṻ": "ṻ",
"ŭ": "ŭ",
"ǔ": "ǔ",
"û": "û",
"ů": "ů",
"ű": "ű",
"ṽ": "ṽ",
"ẃ": "ẃ",
"ẁ": "ẁ",
"ẅ": "ẅ",
"ŵ": "ŵ",
"ẇ": "ẇ",
"ẘ": "ẘ",
"ẍ": "ẍ",
"ẋ": "ẋ",
"ý": "ý",
"ỳ": "ỳ",
"ÿ": "ÿ",
"ỹ": "ỹ",
"ȳ": "ȳ",
"ŷ": "ŷ",
"ẏ": "ẏ",
"ẙ": "ẙ",
"ź": "ź",
"ž": "ž",
"ẑ": "ẑ",
"ż": "ż",
"Á": "Á",
"À": "À",
"Ä": "Ä",
"Ǟ": "Ǟ",
"Ã": "Ã",
"Ā": "Ā",
"Ă": "Ă",
"Ắ": "Ắ",
"Ằ": "Ằ",
"Ẵ": "Ẵ",
"Ǎ": "Ǎ",
"Â": "Â",
"Ấ": "Ấ",
"Ầ": "Ầ",
"Ẫ": "Ẫ",
"Ȧ": "Ȧ",
"Ǡ": "Ǡ",
"Å": "Å",
"Ǻ": "Ǻ",
"Ḃ": "Ḃ",
"Ć": "Ć",
"Č": "Č",
"Ĉ": "Ĉ",
"Ċ": "Ċ",
"Ď": "Ď",
"Ḋ": "Ḋ",
"É": "É",
"È": "È",
"Ë": "Ë",
"Ẽ": "Ẽ",
"Ē": "Ē",
"Ḗ": "Ḗ",
"Ḕ": "Ḕ",
"Ĕ": "Ĕ",
"Ě": "Ě",
"Ê": "Ê",
"Ế": "Ế",
"Ề": "Ề",
"Ễ": "Ễ",
"Ė": "Ė",
"Ḟ": "Ḟ",
"Ǵ": "Ǵ",
"Ḡ": "Ḡ",
"Ğ": "Ğ",
"Ǧ": "Ǧ",
"Ĝ": "Ĝ",
"Ġ": "Ġ",
"Ḧ": "Ḧ",
"Ȟ": "Ȟ",
"Ĥ": "Ĥ",
"Ḣ": "Ḣ",
"Í": "Í",
"Ì": "Ì",
"Ï": "Ï",
"Ḯ": "Ḯ",
"Ĩ": "Ĩ",
"Ī": "Ī",
"Ĭ": "Ĭ",
"Ǐ": "Ǐ",
"Î": "Î",
"İ": "İ",
"Ĵ": "Ĵ",
"Ḱ": "Ḱ",
"Ǩ": "Ǩ",
"Ĺ": "Ĺ",
"Ľ": "Ľ",
"Ḿ": "Ḿ",
"Ṁ": "Ṁ",
"Ń": "Ń",
"Ǹ": "Ǹ",
"Ñ": "Ñ",
"Ň": "Ň",
"Ṅ": "Ṅ",
"Ó": "Ó",
"Ò": "Ò",
"Ö": "Ö",
"Ȫ": "Ȫ",
"Õ": "Õ",
"Ṍ": "Ṍ",
"Ṏ": "Ṏ",
"Ȭ": "Ȭ",
"Ō": "Ō",
"Ṓ": "Ṓ",
"Ṑ": "Ṑ",
"Ŏ": "Ŏ",
"Ǒ": "Ǒ",
"Ô": "Ô",
"Ố": "Ố",
"Ồ": "Ồ",
"Ỗ": "Ỗ",
"Ȯ": "Ȯ",
"Ȱ": "Ȱ",
"Ő": "Ő",
"Ṕ": "Ṕ",
"Ṗ": "Ṗ",
"Ŕ": "Ŕ",
"Ř": "Ř",
"Ṙ": "Ṙ",
"Ś": "Ś",
"Ṥ": "Ṥ",
"Š": "Š",
"Ṧ": "Ṧ",
"Ŝ": "Ŝ",
"Ṡ": "Ṡ",
"Ť": "Ť",
"Ṫ": "Ṫ",
"Ú": "Ú",
"Ù": "Ù",
"Ü": "Ü",
"Ǘ": "Ǘ",
"Ǜ": "Ǜ",
"Ǖ": "Ǖ",
"Ǚ": "Ǚ",
"Ũ": "Ũ",
"Ṹ": "Ṹ",
"Ū": "Ū",
"Ṻ": "Ṻ",
"Ŭ": "Ŭ",
"Ǔ": "Ǔ",
"Û": "Û",
"Ů": "Ů",
"Ű": "Ű",
"Ṽ": "Ṽ",
"Ẃ": "Ẃ",
"Ẁ": "Ẁ",
"Ẅ": "Ẅ",
"Ŵ": "Ŵ",
"Ẇ": "Ẇ",
"Ẍ": "Ẍ",
"Ẋ": "Ẋ",
"Ý": "Ý",
"Ỳ": "Ỳ",
"Ÿ": "Ÿ",
"Ỹ": "Ỹ",
"Ȳ": "Ȳ",
"Ŷ": "Ŷ",
"Ẏ": "Ẏ",
"Ź": "Ź",
"Ž": "Ž",
"Ẑ": "Ẑ",
"Ż": "Ż",
"ά": "ά",
"ὰ": "ὰ",
"ᾱ": "ᾱ",
"ᾰ": "ᾰ",
"έ": "έ",
"ὲ": "ὲ",
"ή": "ή",
"ὴ": "ὴ",
"ί": "ί",
"ὶ": "ὶ",
"ϊ": "ϊ",
"ΐ": "ΐ",
"ῒ": "ῒ",
"ῑ": "ῑ",
"ῐ": "ῐ",
"ό": "ό",
"ὸ": "ὸ",
"ύ": "ύ",
"ὺ": "ὺ",
"ϋ": "ϋ",
"ΰ": "ΰ",
"ῢ": "ῢ",
"ῡ": "ῡ",
"ῠ": "ῠ",
"ώ": "ώ",
"ὼ": "ὼ",
"Ύ": "Ύ",
"Ὺ": "Ὺ",
"Ϋ": "Ϋ",
"Ῡ": "Ῡ",
"Ῠ": "Ῠ",
"Ώ": "Ώ",
"Ὼ": "Ὼ"
};
/* eslint no-constant-condition:0 */
const binLeftCancellers = ["bin", "op", "open", "punct", "rel"];
const sizeRegEx = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/;
/**
* This file contains the parser used to parse out a TeX expression from the
* input. Since TeX isn't context-free, standard parsers don't work particularly
* well.
*
* The strategy of this parser is as such:
*
* The main functions (the `.parse...` ones) take a position in the current
* parse string to parse tokens from. The lexer (found in Lexer.js, stored at
* this.gullet.lexer) also supports pulling out tokens at arbitrary places. When
* individual tokens are needed at a position, the lexer is called to pull out a
* token, which is then used.
*
* The parser has a property called "mode" indicating the mode that
* the parser is currently in. Currently it has to be one of "math" or
* "text", which denotes whether the current environment is a math-y
* one or a text-y one (e.g. inside \text). Currently, this serves to
* limit the functions which can be used in text mode.
*
* The main functions then return an object which contains the useful data that
* was parsed at its given point, and a new position at the end of the parsed
* data. The main functions can call each other and continue the parsing by
* using the returned position as a new starting point.
*
* There are also extra `.handle...` functions, which pull out some reused
* functionality into self-contained functions.
*
* The functions return ParseNodes.
*/
class Parser {
constructor(input, settings, isPreamble = false) {
// Start in math mode
this.mode = "math";
// Create a new macro expander (gullet) and (indirectly via that) also a
// new lexer (mouth) for this parser (stomach, in the language of TeX)
this.gullet = new MacroExpander(input, settings, this.mode);
// Store the settings for use in parsing
this.settings = settings;
// Are we defining a preamble?
this.isPreamble = isPreamble;
// Count leftright depth (for \middle errors)
this.leftrightDepth = 0;
this.prevAtomType = "";
}
/**
* Checks a result to make sure it has the right type, and throws an
* appropriate error otherwise.
*/
expect(text, consume = true) {
if (this.fetch().text !== text) {
throw new ParseError(`Expected '${text}', got '${this.fetch().text}'`, this.fetch());
}
if (consume) {
this.consume();
}
}
/**
* Discards the current lookahead token, considering it consumed.
*/
consume() {
this.nextToken = null;
}
/**
* Return the current lookahead token, or if there isn't one (at the
* beginning, or if the previous lookahead token was consume()d),
* fetch the next token as the new lookahead token and return it.
*/
fetch() {
if (this.nextToken == null) {
this.nextToken = this.gullet.expandNextToken();
}
return this.nextToken;
}
/**
* Switches between "text" and "math" modes.
*/
switchMode(newMode) {
this.mode = newMode;
this.gullet.switchMode(newMode);
}
/**
* Main parsing function, which parses an entire input.
*/
parse() {
// Create a group namespace for every $...$, $$...$$, \[...\].)
// A \def is then valid only within that pair of delimiters.
this.gullet.beginGroup();
if (this.settings.colorIsTextColor) {
// Use old \color behavior (same as LaTeX's \textcolor) if requested.
// We do this within the group for the math expression, so it doesn't
// pollute settings.macros.
this.gullet.macros.set("\\color", "\\textcolor");
}
// Try to parse the input
const parse = this.parseExpression(false);
// If we succeeded, make sure there's an EOF at the end
this.expect("EOF");
if (this.isPreamble) {
const macros = Object.create(null);
Object.entries(this.gullet.macros.current).forEach(([key, value]) => {
macros[key] = value;
});
this.gullet.endGroup();
return macros
}
// The only local macro that we want to save is from \tag.
const tag = this.gullet.macros.get("\\df@tag");
// End the group namespace for the expression
this.gullet.endGroup();
if (tag) { this.gullet.macros.current["\\df@tag"] = tag; }
return parse;
}
static get endOfExpression() {
return ["}", "\\endgroup", "\\end", "\\right", "\\endtoggle", "&"];
}
/**
* Fully parse a separate sequence of tokens as a separate job.
* Tokens should be specified in reverse order, as in a MacroDefinition.
*/
subparse(tokens) {
// Save the next token from the current job.
const oldToken = this.nextToken;
this.consume();
// Run the new job, terminating it with an excess '}'
this.gullet.pushToken(new Token("}"));
this.gullet.pushTokens(tokens);
const parse = this.parseExpression(false);
this.expect("}");
// Restore the next token from the current job.
this.nextToken = oldToken;
return parse;
}
/**
* Parses an "expression", which is a list of atoms.
*
* `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
* happens when functions have higher precedence han infix
* nodes in implicit parses.
*
* `breakOnTokenText`: The text of the token that the expression should end
* with, or `null` if something else should end the
* expression.
*
* `breakOnMiddle`: \color, \over, and old styling functions work on an implicit group.
* These groups end just before the usual tokens, but they also
* end just before `\middle`.
*/
parseExpression(breakOnInfix, breakOnTokenText, breakOnMiddle) {
const body = [];
this.prevAtomType = "";
// Keep adding atoms to the body until we can't parse any more atoms (either
// we reached the end, a }, or a \right)
while (true) {
// Ignore spaces in math mode
if (this.mode === "math") {
this.consumeSpaces();
}
const lex = this.fetch();
if (Parser.endOfExpression.indexOf(lex.text) !== -1) {
break;
}
if (breakOnTokenText && lex.text === breakOnTokenText) {
break;
}
if (breakOnMiddle && lex.text === "\\middle") {
break
}
if (breakOnInfix && functions[lex.text] && functions[lex.text].infix) {
break;
}
const atom = this.parseAtom(breakOnTokenText);
if (!atom) {
break;
} else if (atom.type === "internal") {
continue;
}
body.push(atom);
// Keep a record of the atom type, so that op.js can set correct spacing.
this.prevAtomType = atom.type === "atom" ? atom.family : atom.type;
}
if (this.mode === "text") {
this.formLigatures(body);
}
return this.handleInfixNodes(body);
}
/**
* Rewrites infix operators such as \over with corresponding commands such
* as \frac.
*
* There can only be one infix operator per group. If there's more than one
* then the expression is ambiguous. This can be resolved by adding {}.
*/
handleInfixNodes(body) {
let overIndex = -1;
let funcName;
for (let i = 0; i < body.length; i++) {
if (body[i].type === "infix") {
if (overIndex !== -1) {
throw new ParseError("only one infix operator per group", body[i].token);
}
overIndex = i;
funcName = body[i].replaceWith;
}
}
if (overIndex !== -1 && funcName) {
let numerNode;
let denomNode;
const numerBody = body.slice(0, overIndex);
const denomBody = body.slice(overIndex + 1);
if (numerBody.length === 1 && numerBody[0].type === "ordgroup") {
numerNode = numerBody[0];
} else {
numerNode = { type: "ordgroup", mode: this.mode, body: numerBody };
}
if (denomBody.length === 1 && denomBody[0].type === "ordgroup") {
denomNode = denomBody[0];
} else {
denomNode = { type: "ordgroup", mode: this.mode, body: denomBody };
}
let node;
if (funcName === "\\\\abovefrac") {
node = this.callFunction(funcName, [numerNode, body[overIndex], denomNode], []);
} else {
node = this.callFunction(funcName, [numerNode, denomNode], []);
}
return [node];
} else {
return body;
}
}
/**
* Handle a subscript or superscript with nice errors.
*/
handleSupSubscript(
name // For error reporting.
) {
const symbolToken = this.fetch();
const symbol = symbolToken.text;
this.consume();
this.consumeSpaces(); // ignore spaces before sup/subscript argument
const group = this.parseGroup(name);
if (!group) {
throw new ParseError("Expected group after '" + symbol + "'", symbolToken);
}
return group;
}
/**
* Converts the textual input of an unsupported command into a text node
* contained within a color node whose color is determined by errorColor
*/
formatUnsupportedCmd(text) {
const textordArray = [];
for (let i = 0; i < text.length; i++) {
textordArray.push({ type: "textord", mode: "text", text: text[i] });
}
const textNode = {
type: "text",
mode: this.mode,
body: textordArray
};
const colorNode = {
type: "color",
mode: this.mode,
color: this.settings.errorColor,
body: [textNode]
};
return colorNode;
}
/**
* Parses a group with optional super/subscripts.
*/
parseAtom(breakOnTokenText) {
// The body of an atom is an implicit group, so that things like
// \left(x\right)^2 work correctly.
const base = this.parseGroup("atom", breakOnTokenText);
// In text mode, we don't have superscripts or subscripts
if (this.mode === "text") {
return base;
}
// Note that base may be empty (i.e. null) at this point.
let superscript;
let subscript;
while (true) {
// Guaranteed in math mode, so eat any spaces first.
this.consumeSpaces();
// Lex the first token
const lex = this.fetch();
if (lex.text === "\\limits" || lex.text === "\\nolimits") {
// We got a limit control
if (base && base.type === "op") {
const limits = lex.text === "\\limits";
base.limits = limits;
base.alwaysHandleSupSub = true;
} else if (base && base.type === "operatorname") {
if (base.alwaysHandleSupSub) {
base.limits = lex.text === "\\limits";
}
} else {
throw new ParseError("Limit controls must follow a math operator", lex);
}
this.consume();
} else if (lex.text === "^") {
// We got a superscript start
if (superscript) {
throw new ParseError("Double superscript", lex);
}
superscript = this.handleSupSubscript("superscript");
} else if (lex.text === "_") {
// We got a subscript start
if (subscript) {
throw new ParseError("Double subscript", lex);
}
subscript = this.handleSupSubscript("subscript");
} else if (lex.text === "'") {
// We got a prime
if (superscript) {
throw new ParseError("Double superscript", lex);
}
const prime = { type: "textord", mode: this.mode, text: "\\prime" };
// Many primes can be grouped together, so we handle this here
const primes = [prime];
this.consume();
// Keep lexing tokens until we get something that's not a prime
while (this.fetch().text === "'") {
// For each one, add another prime to the list
primes.push(prime);
this.consume();
}
// If there's a superscript following the primes, combine that
// superscript in with the primes.
if (this.fetch().text === "^") {
primes.push(this.handleSupSubscript("superscript"));
}
// Put everything into an ordgroup as the superscript
superscript = { type: "ordgroup", mode: this.mode, body: primes };
} else if (uSubsAndSups[lex.text]) {
// A Unicode subscript or superscript character.
// We treat these similarly to the unicode-math package.
// So we render a string of Unicode (sub|super)scripts the
// same as a (sub|super)script of regular characters.
const isSub = unicodeSubRegEx.test(lex.text);
const subsupTokens = [];
subsupTokens.push(new Token(uSubsAndSups[lex.text]));
this.consume();
// Continue fetching tokens to fill out the group.
while (true) {
const token = this.fetch().text;
if (!(uSubsAndSups[token])) { break }
if (unicodeSubRegEx.test(token) !== isSub) { break }
subsupTokens.unshift(new Token(uSubsAndSups[token]));
this.consume();
}
// Now create a (sub|super)script.
const body = this.subparse(subsupTokens);
if (isSub) {
subscript = { type: "ordgroup", mode: "math", body };
} else {
superscript = { type: "ordgroup", mode: "math", body };
}
} else {
// If it wasn't ^, _, a Unicode (sub|super)script, or ', stop parsing super/subscripts
break;
}
}
if (superscript || subscript) {
if (base && base.type === "multiscript" && !base.postscripts) {
// base is the result of a \prescript function.
// Write the sub- & superscripts into the multiscript element.
base.postscripts = { sup: superscript, sub: subscript };
return base
} else {
// We got either a superscript or subscript, create a supsub
const isFollowedByDelimiter = (!base || base.type !== "op" && base.type !== "operatorname")
? undefined
: isDelimiter(this.nextToken.text);
return {
type: "supsub",
mode: this.mode,
base: base,
sup: superscript,
sub: subscript,
isFollowedByDelimiter
}
}
} else {
// Otherwise return the original body
return base;
}
}
/**
* Parses an entire function, including its base and all of its arguments.
*/
parseFunction(
breakOnTokenText,
name // For determining its context
) {
const token = this.fetch();
const func = token.text;
const funcData = functions[func];
if (!funcData) {
return null;
}
this.consume(); // consume command token
if (name && name !== "atom" && !funcData.allowedInArgument) {
throw new ParseError(
"Got function '" + func + "' with no arguments" + (name ? " as " + name : ""),
token
);
} else if (this.mode === "text" && !funcData.allowedInText) {
throw new ParseError("Can't use function '" + func + "' in text mode", token);
} else if (this.mode === "math" && funcData.allowedInMath === false) {
throw new ParseError("Can't use function '" + func + "' in math mode", token);
}
const prevAtomType = this.prevAtomType;
const { args, optArgs } = this.parseArguments(func, funcData);
this.prevAtomType = prevAtomType;
return this.callFunction(func, args, optArgs, token, breakOnTokenText);
}
/**
* Call a function handler with a suitable context and arguments.
*/
callFunction(name, args, optArgs, token, breakOnTokenText) {
const context = {
funcName: name,
parser: this,
token,
breakOnTokenText
};
const func = functions[name];
if (func && func.handler) {
return func.handler(context, args, optArgs);
} else {
throw new ParseError(`No function handler for ${name}`);
}
}
/**
* Parses the arguments of a function or environment
*/
parseArguments(
func, // Should look like "\name" or "\begin{name}".
funcData
) {
const totalArgs = funcData.numArgs + funcData.numOptionalArgs;
if (totalArgs === 0) {
return { args: [], optArgs: [] };
}
const args = [];
const optArgs = [];
for (let i = 0; i < totalArgs; i++) {
let argType = funcData.argTypes && funcData.argTypes[i];
const isOptional = i < funcData.numOptionalArgs;
if (
(funcData.primitive && argType == null) ||
// \sqrt expands into primitive if optional argument doesn't exist
(funcData.type === "sqrt" && i === 1 && optArgs[0] == null)
) {
argType = "primitive";
}
const arg = this.parseGroupOfType(`argument to '${func}'`, argType, isOptional);
if (isOptional) {
optArgs.push(arg);
} else if (arg != null) {
args.push(arg);
} else {
// should be unreachable
throw new ParseError("Null argument, please report this as a bug");
}
}
return { args, optArgs };
}
/**
* Parses a group when the mode is changing.
*/
parseGroupOfType(name, type, optional) {
switch (type) {
case "size":
return this.parseSizeGroup(optional);
case "url":
return this.parseUrlGroup(optional);
case "math":
case "text":
return this.parseArgumentGroup(optional, type);
case "hbox": {
// hbox argument type wraps the argument in the equivalent of
// \hbox, which is like \text but switching to \textstyle size.
const group = this.parseArgumentGroup(optional, "text");
return group != null
? {
type: "styling",
mode: group.mode,
body: [group],
scriptLevel: "text" // simulate \textstyle
}
: null;
}
case "raw": {
const token = this.parseStringGroup("raw", optional);
return token != null
? {
type: "raw",
mode: "text",
string: token.text
}
: null;
}
case "primitive": {
if (optional) {
throw new ParseError("A primitive argument cannot be optional");
}
const group = this.parseGroup(name);
if (group == null) {
throw new ParseError("Expected group as " + name, this.fetch());
}
return group;
}
case "original":
case null:
case undefined:
return this.parseArgumentGroup(optional);
default:
throw new ParseError("Unknown group type as " + name, this.fetch());
}
}
/**
* Discard any space tokens, fetching the next non-space token.
*/
consumeSpaces() {
while (true) {
const ch = this.fetch().text;
// \ufe0e is the Unicode variation selector to supress emoji. Ignore it.
if (ch === " " || ch === "\u00a0" || ch === "\ufe0e") {
this.consume();
} else {
break
}
}
}
/**
* Parses a group, essentially returning the string formed by the
* brace-enclosed tokens plus some position information.
*/
parseStringGroup(
modeName, // Used to describe the mode in error messages.
optional
) {
const argToken = this.gullet.scanArgument(optional);
if (argToken == null) {
return null;
}
let str = "";
let nextToken;
while ((nextToken = this.fetch()).text !== "EOF") {
str += nextToken.text;
this.consume();
}
this.consume(); // consume the end of the argument
argToken.text = str;
return argToken;
}
/**
* Parses a regex-delimited group: the largest sequence of tokens
* whose concatenated strings match `regex`. Returns the string
* formed by the tokens plus some position information.
*/
parseRegexGroup(
regex,
modeName // Used to describe the mode in error messages.
) {
const firstToken = this.fetch();
let lastToken = firstToken;
let str = "";
let nextToken;
while ((nextToken = this.fetch()).text !== "EOF" && regex.test(str + nextToken.text)) {
lastToken = nextToken;
str += lastToken.text;
this.consume();
}
if (str === "") {
throw new ParseError("Invalid " + modeName + ": '" + firstToken.text + "'", firstToken);
}
return firstToken.range(lastToken, str);
}
/**
* Parses a size specification, consisting of magnitude and unit.
*/
parseSizeGroup(optional) {
let res;
let isBlank = false;
// don't expand before parseStringGroup
this.gullet.consumeSpaces();
if (!optional && this.gullet.future().text !== "{") {
res = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size");
} else {
res = this.parseStringGroup("size", optional);
}
if (!res) {
return null;
}
if (!optional && res.text.length === 0) {
// Because we've tested for what is !optional, this block won't
// affect \kern, \hspace, etc. It will capture the mandatory arguments
// to \genfrac and \above.
res.text = "0pt"; // Enable \above{}
isBlank = true; // This is here specifically for \genfrac
}
const match = sizeRegEx.exec(res.text);
if (!match) {
throw new ParseError("Invalid size: '" + res.text + "'", res);
}
const data = {
number: +(match[1] + match[2]), // sign + magnitude, cast to number
unit: match[3]
};
if (!validUnit(data)) {
throw new ParseError("Invalid unit: '" + data.unit + "'", res);
}
return {
type: "size",
mode: this.mode,
value: data,
isBlank
};
}
/**
* Parses an URL, checking escaped letters and allowed protocols,
* and setting the catcode of % as an active character (as in \hyperref).
*/
parseUrlGroup(optional) {
this.gullet.lexer.setCatcode("%", 13); // active character
this.gullet.lexer.setCatcode("~", 12); // other character
const res = this.parseStringGroup("url", optional);
this.gullet.lexer.setCatcode("%", 14); // comment character
this.gullet.lexer.setCatcode("~", 13); // active character
if (res == null) {
return null;
}
// hyperref package allows backslashes alone in href, but doesn't
// generate valid links in such cases; we interpret this as
// "undefined" behaviour, and keep them as-is. Some browser will
// replace backslashes with forward slashes.
let url = res.text.replace(/\\([#$%&~_^{}])/g, "$1");
url = res.text.replace(/{\u2044}/g, "/");
return {
type: "url",
mode: this.mode,
url
};
}
/**
* Parses an argument with the mode specified.
*/
parseArgumentGroup(optional, mode) {
const argToken = this.gullet.scanArgument(optional);
if (argToken == null) {
return null;
}
const outerMode = this.mode;
if (mode) {
// Switch to specified mode
this.switchMode(mode);
}
this.gullet.beginGroup();
const expression = this.parseExpression(false, "EOF");
// TODO: find an alternative way to denote the end
this.expect("EOF"); // expect the end of the argument
this.gullet.endGroup();
const result = {
type: "ordgroup",
mode: this.mode,
loc: argToken.loc,
body: expression
};
if (mode) {
// Switch mode back
this.switchMode(outerMode);
}
return result;
}
/**
* Parses an ordinary group, which is either a single nucleus (like "x")
* or an expression in braces (like "{x+y}") or an implicit group, a group
* that starts at the current position, and ends right before a higher explicit
* group ends, or at EOF.
*/
parseGroup(
name, // For error reporting.
breakOnTokenText
) {
const firstToken = this.fetch();
const text = firstToken.text;
let result;
// Try to parse an open brace or \begingroup
if (text === "{" || text === "\\begingroup" || text === "\\toggle") {
this.consume();
const groupEnd = text === "{"
? "}"
: text === "\\begingroup"
? "\\endgroup"
: "\\endtoggle";
this.gullet.beginGroup();
// If we get a brace, parse an expression
const expression = this.parseExpression(false, groupEnd);
const lastToken = this.fetch();
this.expect(groupEnd); // Check that we got a matching closing brace
this.gullet.endGroup();
result = {
type: (lastToken.text === "\\endtoggle" ? "toggle" : "ordgroup"),
mode: this.mode,
loc: SourceLocation.range(firstToken, lastToken),
body: expression,
// A group formed by \begingroup...\endgroup is a semi-simple group
// which doesn't affect spacing in math mode, i.e., is transparent.
// https://tex.stackexchange.com/questions/1930/
semisimple: text === "\\begingroup" || undefined
};
} else {
// If there exists a function with this name, parse the function.
// Otherwise, just return a nucleus
result = this.parseFunction(breakOnTokenText, name) || this.parseSymbol();
if (result == null && text[0] === "\\" &&
!Object.prototype.hasOwnProperty.call(implicitCommands, text )) {
result = this.formatUnsupportedCmd(text);
this.consume();
}
}
return result;
}
/**
* Form ligature-like combinations of characters for text mode.
* This includes inputs like "--", "---", "``" and "''".
* The result will simply replace multiple textord nodes with a single
* character in each value by a single textord node having multiple
* characters in its value. The representation is still ASCII source.
* The group will be modified in place.
*/
formLigatures(group) {
let n = group.length - 1;
for (let i = 0; i < n; ++i) {
const a = group[i];
const v = a.text;
if (v === "-" && group[i + 1].text === "-") {
if (i + 1 < n && group[i + 2].text === "-") {
group.splice(i, 3, {
type: "textord",
mode: "text",
loc: SourceLocation.range(a, group[i + 2]),
text: "---"
});
n -= 2;
} else {
group.splice(i, 2, {
type: "textord",
mode: "text",
loc: SourceLocation.range(a, group[i + 1]),
text: "--"
});
n -= 1;
}
}
if ((v === "'" || v === "`") && group[i + 1].text === v) {
group.splice(i, 2, {
type: "textord",
mode: "text",
loc: SourceLocation.range(a, group[i + 1]),
text: v + v
});
n -= 1;
}
}
}
/**
* Parse a single symbol out of the string. Here, we handle single character
* symbols and special functions like \verb.
*/
parseSymbol() {
const nucleus = this.fetch();
let text = nucleus.text;
if (/^\\verb[^a-zA-Z]/.test(text)) {
this.consume();
let arg = text.slice(5);
const star = arg.charAt(0) === "*";
if (star) {
arg = arg.slice(1);
}
// Lexer's tokenRegex is constructed to always have matching
// first/last characters.
if (arg.length < 2 || arg.charAt(0) !== arg.slice(-1)) {
throw new ParseError(`\\verb assertion failed --
please report what input caused this bug`);
}
arg = arg.slice(1, -1); // remove first and last char
return {
type: "verb",
mode: "text",
body: arg,
star
};
}
// At this point, we should have a symbol, possibly with accents.
// First expand any accented base symbol according to unicodeSymbols.
if (Object.prototype.hasOwnProperty.call(unicodeSymbols, text[0]) &&
this.mode === "math" && !symbols[this.mode][text[0]]) {
// This behavior is not strict (XeTeX-compatible) in math mode.
if (this.settings.strict && this.mode === "math") {
throw new ParseError(`Accented Unicode text character "${text[0]}" used in ` + `math mode`,
nucleus
);
}
text = unicodeSymbols[text[0]] + text.slice(1);
}
// Strip off any combining characters
const match = this.mode === "math"
? combiningDiacriticalMarksEndRegex.exec(text)
: null;
if (match) {
text = text.substring(0, match.index);
if (text === "i") {
text = "\u0131"; // dotless i, in math and text mode
} else if (text === "j") {
text = "\u0237"; // dotless j, in math and text mode
}
}
// Recognize base symbol
let symbol;
if (symbols[this.mode][text]) {
let group = symbols[this.mode][text].group;
if (group === "bin" && binLeftCancellers.includes(this.prevAtomType)) {
// Change from a binary operator to a unary (prefix) operator
group = "open";
}
const loc = SourceLocation.range(nucleus);
let s;
if (Object.prototype.hasOwnProperty.call(ATOMS, group )) {
const family = group;
s = {
type: "atom",
mode: this.mode,
family,
loc,
text
};
} else {
if (asciiFromScript[text]) {
// Unicode 14 disambiguates chancery from roundhand.
// See https://www.unicode.org/charts/PDF/U1D400.pdf
this.consume();
const nextCode = this.fetch().text.charCodeAt(0);
// mathcal is Temml default. Use mathscript if called for.
const font = nextCode === 0xfe01 ? "mathscr" : "mathcal";
if (nextCode === 0xfe00 || nextCode === 0xfe01) { this.consume(); }
return {
type: "font",
mode: "math",
font,
body: { type: "mathord", mode: "math", loc, text: asciiFromScript[text] }
}
}
// Default ord character. No disambiguation necessary.
s = {
type: group,
mode: this.mode,
loc,
text
};
}
symbol = s;
} else if (text.charCodeAt(0) >= 0x80 || combiningDiacriticalMarksEndRegex.exec(text)) {
// no symbol for e.g. ^
if (this.settings.strict && this.mode === "math") {
throw new ParseError(`Unicode text character "${text[0]}" used in math mode`, nucleus)
}
// All nonmathematical Unicode characters are rendered as if they
// are in text mode (wrapped in \text) because that's what it
// takes to render them in LaTeX.
symbol = {
type: "textord",
mode: "text",
loc: SourceLocation.range(nucleus),
text
};
} else {
return null; // EOF, ^, _, {, }, etc.
}
this.consume();
// Transform combining characters into accents
if (match) {
for (let i = 0; i < match[0].length; i++) {
const accent = match[0][i];
if (!unicodeAccents[accent]) {
throw new ParseError(`Unknown accent ' ${accent}'`, nucleus);
}
const command = unicodeAccents[accent][this.mode] ||
unicodeAccents[accent].text;
if (!command) {
throw new ParseError(`Accent ${accent} unsupported in ${this.mode} mode`, nucleus);
}
symbol = {
type: "accent",
mode: this.mode,
loc: SourceLocation.range(nucleus),
label: command,
isStretchy: false,
base: symbol
};
}
}
return symbol;
}
}
/**
* Parses an expression using a Parser, then returns the parsed result.
*/
const parseTree = function(toParse, settings) {
if (!(typeof toParse === "string" || toParse instanceof String)) {
throw new TypeError("Temml can only parse string typed expression")
}
const parser = new Parser(toParse, settings);
// Blank out any \df@tag to avoid spurious "Duplicate \tag" errors
delete parser.gullet.macros.current["\\df@tag"];
let tree = parser.parse();
// LaTeX ignores a \tag placed outside an AMS environment.
if (!(tree.length > 0 && tree[0].type && tree[0].type === "array" && tree[0].addEqnNum)) {
// If the input used \tag, it will set the \df@tag macro to the tag.
// In this case, we separately parse the tag and wrap the tree.
if (parser.gullet.macros.get("\\df@tag")) {
if (!settings.displayMode) {
throw new ParseError("\\tag works only in display mode")
}
parser.gullet.feed("\\df@tag");
tree = [
{
type: "tag",
mode: "text",
body: tree,
tag: parser.parse()
}
];
}
}
return tree
};
/**
* This file contains information about the style that the mathmlBuilder carries
* around with it. Data is held in an `Style` object, and when
* recursing, a new `Style` object can be created with the `.with*` functions.
*/
const subOrSupLevel = [2, 2, 3, 3];
/**
* This is the main Style class. It contains the current style.level, color, and font.
*
* Style objects should not be modified. To create a new Style with
* different properties, call a `.with*` method.
*/
class Style {
constructor(data) {
// Style.level can be 0 | 1 | 2 | 3, which correspond to
// displaystyle, textstyle, scriptstyle, and scriptscriptstyle.
// style.level usually does not directly set MathML's script level. MathML does that itself.
// However, Chromium does not stop shrinking after scriptscriptstyle, so we do explicitly
// set a scriptlevel attribute in those conditions.
// We also use style.level to track math style so that we can get the correct
// scriptlevel when needed in supsub.js, mathchoice.js, or for dimensions in em.
this.level = data.level;
this.color = data.color; // string | void
// A font family applies to a group of fonts (i.e. SansSerif), while a font
// represents a specific font (i.e. SansSerif Bold).
// See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm
this.font = data.font || ""; // string
this.fontFamily = data.fontFamily || ""; // string
this.fontSize = data.fontSize || 1.0; // number
this.fontWeight = data.fontWeight || "";
this.fontShape = data.fontShape || "";
this.maxSize = data.maxSize; // [number, number]
}
/**
* Returns a new style object with the same properties as "this". Properties
* from "extension" will be copied to the new style object.
*/
extend(extension) {
const data = {
level: this.level,
color: this.color,
font: this.font,
fontFamily: this.fontFamily,
fontSize: this.fontSize,
fontWeight: this.fontWeight,
fontShape: this.fontShape,
maxSize: this.maxSize
};
for (const key in extension) {
if (Object.prototype.hasOwnProperty.call(extension, key)) {
data[key] = extension[key];
}
}
return new Style(data);
}
withLevel(n) {
return this.extend({
level: n
});
}
incrementLevel() {
return this.extend({
level: Math.min(this.level + 1, 3)
});
}
inSubOrSup() {
return this.extend({
level: subOrSupLevel[this.level]
})
}
/**
* Create a new style object with the given color.
*/
withColor(color) {
return this.extend({
color: color
});
}
/**
* Creates a new style object with the given math font or old text font.
* @type {[type]}
*/
withFont(font) {
return this.extend({
font
});
}
/**
* Create a new style objects with the given fontFamily.
*/
withTextFontFamily(fontFamily) {
return this.extend({
fontFamily,
font: ""
});
}
/**
* Creates a new style object with the given font size
*/
withFontSize(num) {
return this.extend({
fontSize: num
});
}
/**
* Creates a new style object with the given font weight
*/
withTextFontWeight(fontWeight) {
return this.extend({
fontWeight,
font: ""
});
}
/**
* Creates a new style object with the given font weight
*/
withTextFontShape(fontShape) {
return this.extend({
fontShape,
font: ""
});
}
/**
* Gets the CSS color of the current style object
*/
getColor() {
return this.color;
}
}
/* Temml Post Process
* Populate the text contents of each \ref & \eqref
*
* As with other Temml code, this file is released under terms of the MIT license.
* https://mit-license.org/
*/
const version = "0.10.34";
function postProcess(block) {
const labelMap = {};
let i = 0;
// Get a collection of the parents of each \tag & auto-numbered equation
const amsEqns = document.getElementsByClassName('tml-eqn');
for (let parent of amsEqns) {
// AMS automatically numbered equation.
// Assign an id.
i += 1;
parent.setAttribute("id", "tml-eqn-" + String(i));
// No need to write a number into the text content of the element.
// A CSS counter has done that even if this postProcess() function is not used.
// Find any \label that refers to an AMS automatic eqn number.
while (true) {
if (parent.tagName === "mtable") { break }
const labels = parent.getElementsByClassName("tml-label");
if (labels.length > 0) {
const id = parent.attributes.id.value;
labelMap[id] = String(i);
break
} else {
parent = parent.parentElement;
}
}
}
// Find \labels associated with \tag
const taggedEqns = document.getElementsByClassName('tml-tageqn');
for (const parent of taggedEqns) {
const labels = parent.getElementsByClassName("tml-label");
if (labels.length > 0) {
const tags = parent.getElementsByClassName("tml-tag");
if (tags.length > 0) {
const id = parent.attributes.id.value;
labelMap[id] = tags[0].textContent;
}
}
}
// Populate \ref & \eqref text content
const refs = block.getElementsByClassName("tml-ref");
[...refs].forEach(ref => {
const attr = ref.getAttribute("href");
let str = labelMap[attr.slice(1)];
if (ref.className.indexOf("tml-eqref") === -1) {
// \ref. Omit parens.
str = str.replace(/^\(/, "");
str = str.replace(/\)$/, "");
} else {
// \eqref. Include parens
if (str.charAt(0) !== "(") { str = "(" + str; }
if (str.slice(-1) !== ")") { str = str + ")"; }
}
const mtext = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mtext");
mtext.appendChild(document.createTextNode(str));
const math = document.createElementNS("http://www.w3.org/1998/Math/MathML", "math");
math.appendChild(mtext);
ref.appendChild(math);
});
}
/* eslint no-console:0 */
/**
* This is the main entry point for Temml. Here, we expose functions for
* rendering expressions either to DOM nodes or to markup strings.
*
* We also expose the ParseError class to check if errors thrown from Temml are
* errors in the expression, or errors in javascript handling.
*/
/**
* @type {import('./temml').render}
* Parse and build an expression, and place that expression in the DOM node
* given.
*/
let render = function(expression, baseNode, options = {}) {
baseNode.textContent = "";
const alreadyInMathElement = baseNode.tagName.toLowerCase() === "math";
if (alreadyInMathElement) { options.wrap = "none"; }
const math = renderToMathMLTree(expression, options);
if (alreadyInMathElement) {
// The <math> element already exists. Populate it.
baseNode.textContent = "";
math.children.forEach(e => { baseNode.appendChild(e.toNode()); });
} else if (math.children.length > 1) {
baseNode.textContent = "";
math.children.forEach(e => { baseNode.appendChild(e.toNode()); });
} else {
baseNode.appendChild(math.toNode());
}
};
// Temml's styles don't work properly in quirks mode. Print out an error, and
// disable rendering.
if (typeof document !== "undefined") {
if (document.compatMode !== "CSS1Compat") {
typeof console !== "undefined" &&
console.warn(
"Warning: Temml doesn't work in quirks mode. Make sure your " +
"website has a suitable doctype."
);
render = function() {
throw new ParseError("Temml doesn't work in quirks mode.");
};
}
}
/**
* @type {import('./temml').renderToString}
* Parse and build an expression, and return the markup for that.
*/
const renderToString = function(expression, options) {
const markup = renderToMathMLTree(expression, options).toMarkup();
return markup;
};
/**
* @type {import('./temml').generateParseTree}
* Parse an expression and return the parse tree.
*/
const generateParseTree = function(expression, options) {
const settings = new Settings(options);
return parseTree(expression, settings);
};
/**
* @type {import('./temml').definePreamble}
* Take an expression which contains a preamble.
* Parse it and return the macros.
*/
const definePreamble = function(expression, options) {
const settings = new Settings(options);
settings.macros = {};
if (!(typeof expression === "string" || expression instanceof String)) {
throw new TypeError("Temml can only parse string typed expression")
}
const parser = new Parser(expression, settings, true);
// Blank out any \df@tag to avoid spurious "Duplicate \tag" errors
delete parser.gullet.macros.current["\\df@tag"];
const macros = parser.parse();
return macros
};
/**
* If the given error is a Temml ParseError,
* renders the invalid LaTeX as a span with hover title giving the Temml
* error message. Otherwise, simply throws the error.
*/
const renderError = function(error, expression, options) {
if (options.throwOnError || !(error instanceof ParseError)) {
throw error;
}
const node = new Span(["temml-error"], [new TextNode$1(expression + "\n" + error.toString())]);
node.style.color = options.errorColor;
node.style.whiteSpace = "pre-line";
return node;
};
/**
* @type {import('./temml').renderToMathMLTree}
* Generates and returns the Temml build tree. This is used for advanced
* use cases (like rendering to custom output).
*/
const renderToMathMLTree = function(expression, options) {
const settings = new Settings(options);
try {
const tree = parseTree(expression, settings);
const style = new Style({
level: settings.displayMode ? StyleLevel.DISPLAY : StyleLevel.TEXT,
maxSize: settings.maxSize
});
return buildMathML(tree, expression, style, settings);
} catch (error) {
return renderError(error, expression, settings);
}
};
/** @type {import('./temml').default} */
var temml = {
/**
* Current Temml version
*/
version: version,
/**
* Renders the given LaTeX into MathML, and adds
* it as a child to the specified DOM node.
*/
render,
/**
* Renders the given LaTeX into MathML string,
* for sending to the client.
*/
renderToString,
/**
* Post-process an entire HTML block.
* Writes AMS auto-numbers and implements \ref{}.
* Typcally called once, after a loop has rendered many individual spans.
*/
postProcess,
/**
* Temml error, usually during parsing.
*/
ParseError,
/**
* Creates a set of macros with document-wide scope.
*/
definePreamble,
/**
* Parses the given LaTeX into Temml's internal parse tree structure,
* without rendering to HTML or MathML.
*
* NOTE: This method is not currently recommended for public use.
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__parse: generateParseTree,
/**
* Renders the given LaTeX into a MathML internal DOM tree
* representation, without flattening that representation to a string.
*
* NOTE: This method is not currently recommended for public use.
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__renderToMathMLTree: renderToMathMLTree,
/**
* adds a new symbol to builtin symbols table
*/
__defineSymbol: defineSymbol,
/**
* adds a new macro to builtin macro list
*/
__defineMacro: defineMacro
};
;// ./node_modules/@wordpress/latex-to-mathml/build-module/index.js
function latexToMathML(latex, { displayMode = true } = {}) {
const mathML = temml.renderToString(latex, {
displayMode,
annotate: true,
throwOnError: true
});
const doc = document.implementation.createHTMLDocument("");
doc.body.innerHTML = mathML;
return doc.body.querySelector("math")?.innerHTML ?? "";
}
(window.wp = window.wp || {}).latexToMathml = __webpack_exports__;
/******/ })()
; rich-text.min.js 0000644 00000110661 15144410747 0007607 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{RichTextData:()=>j,__experimentalRichText:()=>yt,__unstableCreateElement:()=>v,__unstableToDom:()=>xe,__unstableUseRichText:()=>bt,applyFormat:()=>g,concat:()=>Y,create:()=>V,getActiveFormat:()=>G,getActiveFormats:()=>x,getActiveObject:()=>Z,getTextContent:()=>H,insert:()=>oe,insertObject:()=>ie,isCollapsed:()=>J,isEmpty:()=>Q,join:()=>ee,registerFormatType:()=>te,remove:()=>ae,removeFormat:()=>ne,replace:()=>se,slice:()=>ce,split:()=>ue,store:()=>f,toHTMLString:()=>_,toggleFormat:()=>Ce,unregisterFormatType:()=>_e,useAnchor:()=>Me,useAnchorRef:()=>Oe});var n={};e.r(n),e.d(n,{getFormatType:()=>i,getFormatTypeForBareElement:()=>c,getFormatTypeForClassName:()=>u,getFormatTypes:()=>s});var r={};e.r(r),e.d(r,{addFormatTypes:()=>l,removeFormatTypes:()=>d});const o=window.wp.data;var a=(0,o.combineReducers)({formatTypes:function(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce(((e,t)=>({...e,[t.name]:t})),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.names.includes(e))))}return e}});const s=(0,o.createSelector)((e=>Object.values(e.formatTypes)),(e=>[e.formatTypes]));function i(e,t){return e.formatTypes[t]}function c(e,t){const n=s(e);return n.find((({className:e,tagName:n})=>null===e&&t===n))||n.find((({className:e,tagName:t})=>null===e&&"*"===t))}function u(e,t){return s(e).find((({className:e})=>null!==e&&` ${t} `.indexOf(` ${e} `)>=0))}function l(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function d(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const f=(0,o.createReduxStore)("core/rich-text",{reducer:a,selectors:n,actions:r});function m(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const o=Object.keys(n),a=Object.keys(r);if(o.length!==a.length)return!1;const s=o.length;for(let e=0;e<s;e++){const t=o[e];if(n[t]!==r[t])return!1}return!0}function p(e){const t=e.formats.slice();return t.forEach(((e,n)=>{const r=t[n-1];if(r){const o=e.slice();o.forEach(((e,t)=>{const n=r[t];m(e,n)&&(o[t]=n)})),t[n]=o}})),{...e,formats:t}}function h(e,t,n){return(e=e.slice())[t]=n,e}function g(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:a}=e,s=o.slice();if(n===r){const e=s[n]?.find((({type:e})=>e===t.type));if(e){const o=s[n].indexOf(e);for(;s[n]&&s[n][o]===e;)s[n]=h(s[n],o,t),n--;for(r++;s[r]&&s[r][o]===e;)s[r]=h(s[r],o,t),r++}}else{let e=1/0;for(let o=n;o<r;o++)if(s[o]){s[o]=s[o].filter((({type:e})=>e!==t.type));const n=s[o].length;n<e&&(e=n)}else s[o]=[],e=0;for(let o=n;o<r;o++)s[o].splice(e,0,t)}return p({...e,formats:s,activeFormats:[...a?.filter((({type:e})=>e!==t.type))||[],t]})}function v({implementation:e},t){return v.body||(v.body=e.createHTMLDocument("").body),v.body.innerHTML=t,v.body}(0,o.register)(f);const b="",y="\ufeff",E=window.wp.escapeHtml;function x(e,t=[]){const{formats:n,start:r,end:o,activeFormats:a}=e;if(void 0===r)return t;if(r===o){if(a)return a;const e=n[r-1]||t,o=n[r]||t;return e.length<o.length?e:o}if(!n[r])return t;const s=n.slice(r,o),i=[...s[0]];let c=s.length;for(;c--;){const e=s[c];if(!e)return t;let n=i.length;for(;n--;){const t=i[n];e.find((e=>m(t,e)))||i.splice(n,1)}if(0===i.length)return t}return i||t}function T(e){return(0,o.select)(f).getFormatType(e)}function w(e,t){if(t)return e;const n={};for(const t in e){let r=t;t.startsWith("data-disable-rich-text-")&&(r=t.slice(23)),n[r]=e[t]}return n}function N({type:e,tagName:t,attributes:n,unregisteredAttributes:r,object:o,boundaryClass:a,isEditableTree:s}){const i=T(e);let c={};if(a&&s&&(c["data-rich-text-format-boundary"]="true"),!i)return n&&(c={...n,...c}),{type:e,attributes:w(c,s),object:o};c={...r,...c};for(const e in n){const t=!!i.attributes&&i.attributes[e];t?c[t]=n[e]:c[e]=n[e]}return i.className&&(c.class?c.class=`${i.className} ${c.class}`:c.class=i.className),{type:t||i.tagName,object:i.object,attributes:w(c,s)}}function L(e,t,n){do{if(e[n]!==t[n])return!1}while(n--);return!0}function C({value:e,preserveWhiteSpace:t,createEmpty:n,append:r,getLastChild:o,getParent:a,isText:s,getText:i,remove:c,appendText:u,onStartIndex:l,onEndIndex:d,isEditableTree:f,placeholder:m}){const{formats:p,replacements:h,text:g,start:v,end:E}=e,w=p.length+1,C=n(),_=x(e),S=_[_.length-1];let A,F;r(C,"");for(let e=0;e<w;e++){const n=g.charAt(e),x=f&&(!F||"\n"===F),w=p[e];let _=o(C);if(w&&w.forEach(((e,t)=>{if(_&&A&&L(w,A,t))return void(_=o(_));const{type:n,tagName:u,attributes:l,unregisteredAttributes:d}=e,m=f&&e===S,p=a(_),h=r(p,N({type:n,tagName:u,attributes:l,unregisteredAttributes:d,boundaryClass:m,isEditableTree:f}));s(_)&&0===i(_).length&&c(_),_=r(h,"")})),0===e&&(l&&0===v&&l(C,_),d&&0===E&&d(C,_)),n===b){const t=h[e];if(!t)continue;const{type:n,attributes:o,innerHTML:s}=t,i=T(n);if(f&&"#comment"===n)_=r(a(_),{type:"span",attributes:{contenteditable:"false","data-rich-text-comment":o["data-rich-text-comment"]}}),r(r(_,{type:"span"}),o["data-rich-text-comment"].trim());else if(f||"script"!==n)if(!1===i?.contentEditable){if(s||f){if(_=a(_),f){const t={contenteditable:"false","data-rich-text-bogus":!0};v===e&&E===e+1&&(t["data-rich-text-format-boundary"]=!0),_=r(_,{type:"span",attributes:t}),f&&e+1===g.length&&r(a(_),y)}_=r(_,N({...t,isEditableTree:f})),s&&r(_,{html:s})}}else _=r(a(_),N({...t,object:!0,isEditableTree:f}));else _=r(a(_),N({type:"script",isEditableTree:f})),r(_,{html:decodeURIComponent(o["data-rich-text-script"])});_=r(a(_),"")}else t||"\n"!==n?s(_)?u(_,n):_=r(a(_),n):(_=r(a(_),{type:"br",attributes:f?{"data-rich-text-line-break":"true"}:void 0,object:!0}),_=r(a(_),""));l&&v===e+1&&l(C,_),d&&E===e+1&&d(C,_),x&&e===g.length&&(r(a(_),y),m&&0===g.length&&r(a(_),{type:"span",attributes:{"data-rich-text-placeholder":m,style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),A=w,F=n}return C}function _({value:e,preserveWhiteSpace:t}){return k(C({value:e,preserveWhiteSpace:t,createEmpty:S,append:F,getLastChild:A,getParent:D,isText:R,getText:M,remove:$,appendText:O}).children)}function S(){return{}}function A({children:e}){return e&&e[e.length-1]}function F(e,t){return"string"==typeof t&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function O(e,t){e.text+=t}function D({parent:e}){return e}function R({text:e}){return"string"==typeof e}function M({text:e}){return e}function $(e){const t=e.parent.children.indexOf(e);return-1!==t&&e.parent.children.splice(t,1),e}function k(e=[]){return e.map((e=>void 0!==e.html?e.html:void 0===e.text?function({type:e,attributes:t,object:n,children:r}){if("#comment"===e)return`\x3c!--${t["data-rich-text-comment"]}--\x3e`;let o="";for(const e in t)(0,E.isValidAttributeName)(e)&&(o+=` ${e}="${(0,E.escapeAttribute)(t[e])}"`);return n?`<${e}${o}>`:`<${e}${o}>${k(r)}</${e}>`}(e):(0,E.escapeEditableHTML)(e.text))).join("")}function H({text:e}){return e.replace(b,"")}function P({tagName:e,attributes:t}){let n;if(t&&t.class&&(n=(0,o.select)(f).getFormatTypeForClassName(t.class),n&&(t.class=` ${t.class} `.replace(` ${n.className} `," ").trim(),t.class||delete t.class)),n||(n=(0,o.select)(f).getFormatTypeForBareElement(e)),!n)return t?{type:e,attributes:t}:{type:e};if(n.__experimentalCreatePrepareEditableTree&&!n.__experimentalCreateOnChangeEditableValue)return null;if(!t)return{formatType:n,type:n.name,tagName:e};const r={},a={},s={...t};for(const e in n.attributes){const t=n.attributes[e];r[e]=s[t],delete s[t],void 0===r[e]&&delete r[e]}for(const e in s)a[e]=t[e];return!1===n.contentEditable&&delete a.contenteditable,{formatType:n,type:n.name,tagName:e,attributes:r,unregisteredAttributes:a}}class j{#e;static empty(){return new j}static fromPlainText(e){return new j(V({text:e}))}static fromHTMLString(e){return new j(V({html:e}))}static fromHTMLElement(e,t={}){const{preserveWhiteSpace:n=!1}=t,r=n?e:z(e),o=new j(V({element:r}));return Object.defineProperty(o,"originalHTML",{value:e.innerHTML}),o}constructor(e={formats:[],replacements:[],text:""}){this.#e=e}toPlainText(){return H(this.#e)}toHTMLString({preserveWhiteSpace:e}={}){return this.originalHTML||_({value:this.#e,preserveWhiteSpace:e})}valueOf(){return this.toHTMLString()}toString(){return this.toHTMLString()}toJSON(){return this.toHTMLString()}get length(){return this.text.length}get formats(){return this.#e.formats}get replacements(){return this.#e.replacements}get text(){return this.#e.text}}for(const e of Object.getOwnPropertyNames(String.prototype))j.prototype.hasOwnProperty(e)||Object.defineProperty(j.prototype,e,{value(...t){return this.toHTMLString()[e](...t)}});function V({element:e,text:t,html:n,range:r,__unstableIsEditableTree:o}={}){return n instanceof j?{text:n.text,formats:n.formats,replacements:n.replacements}:"string"==typeof t&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:("string"==typeof n&&n.length>0&&(e=v(document,n)),"object"!=typeof e?{formats:[],replacements:[],text:""}:q({element:e,range:r,isEditableTree:o}))}function I(e,t,n,r){if(!n)return;const{parentNode:o}=t,{startContainer:a,startOffset:s,endContainer:i,endOffset:c}=n,u=e.text.length;void 0!==r.start?e.start=u+r.start:t===a&&t.nodeType===t.TEXT_NODE?e.start=u+s:o===a&&t===a.childNodes[s]?e.start=u:o===a&&t===a.childNodes[s-1]?e.start=u+r.text.length:t===a&&(e.start=u),void 0!==r.end?e.end=u+r.end:t===i&&t.nodeType===t.TEXT_NODE?e.end=u+c:o===i&&t===i.childNodes[c-1]?e.end=u+r.text.length:o===i&&t===i.childNodes[c]?e.end=u:t===i&&(e.end=u+c)}function W(e,t,n){if(!t)return;const{startContainer:r,endContainer:o}=t;let{startOffset:a,endOffset:s}=t;return e===r&&(a=n(e.nodeValue.slice(0,a)).length),e===o&&(s=n(e.nodeValue.slice(0,s)).length),{startContainer:r,startOffset:a,endContainer:o,endOffset:s}}function z(e,t=!0){const n=e.cloneNode(!0);return n.normalize(),Array.from(n.childNodes).forEach(((e,n,r)=>{if(e.nodeType===e.TEXT_NODE){let o=e.nodeValue;/[\n\t\r\f]/.test(o)&&(o=o.replace(/[\n\t\r\f]+/g," ")),-1!==o.indexOf(" ")&&(o=o.replace(/ {2,}/g," ")),0===n&&o.startsWith(" ")?o=o.slice(1):t&&n===r.length-1&&o.endsWith(" ")&&(o=o.slice(0,-1)),e.nodeValue=o}else e.nodeType===e.ELEMENT_NODE&&e.replaceWith(z(e,!1))})),n}const B="\r";function X(e){return e.replace(new RegExp(`[${y}${b}${B}]`,"gu"),"")}function q({element:e,range:t,isEditableTree:n}){const r={formats:[],replacements:[],text:""};if(!e)return r;if(!e.hasChildNodes())return I(r,e,t,{formats:[],replacements:[],text:""}),r;const o=e.childNodes.length;for(let a=0;a<o;a++){const o=e.childNodes[a],s=o.nodeName.toLowerCase();if(o.nodeType===o.TEXT_NODE){const e=X(o.nodeValue);I(r,o,t=W(o,t,X),{text:e}),r.formats.length+=e.length,r.replacements.length+=e.length,r.text+=e;continue}if(o.nodeType===o.COMMENT_NODE||o.nodeType===o.ELEMENT_NODE&&"SPAN"===o.tagName&&o.hasAttribute("data-rich-text-comment")){const e={formats:[,],replacements:[{type:"#comment",attributes:{"data-rich-text-comment":o.nodeType===o.COMMENT_NODE?o.nodeValue:o.getAttribute("data-rich-text-comment")}}],text:b};I(r,o,t,e),U(r,e);continue}if(o.nodeType!==o.ELEMENT_NODE)continue;if(n&&"br"===s&&!o.getAttribute("data-rich-text-line-break")){I(r,o,t,{formats:[],replacements:[],text:""});continue}if("script"===s){const e={formats:[,],replacements:[{type:s,attributes:{"data-rich-text-script":o.getAttribute("data-rich-text-script")||encodeURIComponent(o.innerHTML)}}],text:b};I(r,o,t,e),U(r,e);continue}if("br"===s){I(r,o,t,{formats:[],replacements:[],text:""}),U(r,V({text:"\n"}));continue}const i=P({tagName:s,attributes:K({element:o})});if(!1===i?.formatType?.contentEditable){delete i.formatType,I(r,o,t,{formats:[],replacements:[],text:""}),U(r,{formats:[,],replacements:[{...i,innerHTML:o.innerHTML}],text:b});continue}i&&delete i.formatType;const c=q({element:o,range:t,isEditableTree:n});if(I(r,o,t,c),!i||o.getAttribute("data-rich-text-placeholder")||o.getAttribute("data-rich-text-bogus"))U(r,c);else if(0===c.text.length)i.attributes&&U(r,{formats:[,],replacements:[i],text:b});else{let e=function(t){if(e.formats===t)return e.newFormats;const n=t?[i,...t]:[i];return e.formats=t,e.newFormats=n,n};e.newFormats=[i],U(r,{...c,formats:Array.from(c.formats,e)})}}return r}function K({element:e}){if(!e.hasAttributes())return;const t=e.attributes.length;let n;for(let r=0;r<t;r++){const{name:t,value:o}=e.attributes[r];if(0===t.indexOf("data-rich-text-"))continue;n=n||{},n[/^on/i.test(t)?"data-disable-rich-text-"+t:t]=o}return n}function U(e,t){return e.formats=e.formats.concat(t.formats),e.replacements=e.replacements.concat(t.replacements),e.text+=t.text,e}function Y(...e){return p(e.reduce(U,V()))}function G(e,t){return x(e).find((({type:e})=>e===t))}function Z({start:e,end:t,replacements:n,text:r}){if(e+1===t&&r[e]===b)return n[e]}function J({start:e,end:t}){if(void 0!==e&&void 0!==t)return e===t}function Q({text:e}){return 0===e.length}function ee(e,t=""){return"string"==typeof t&&(t=V({text:t})),p(e.reduce(((e,{formats:n,replacements:r,text:o})=>({formats:e.formats.concat(t.formats,n),replacements:e.replacements.concat(t.replacements,r),text:e.text+t.text+o}))))}function te(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if((0,o.select)(f).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(t.className)){if(null===t.className){const e=(0,o.select)(f).getFormatTypeForBareElement(t.tagName);if(e&&"core/unknown"!==e.name)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=(0,o.select)(f).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return(0,o.dispatch)(f).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}function ne(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:a}=e,s=o.slice();if(n===r){const e=s[n]?.find((({type:e})=>e===t));if(e){for(;s[n]?.find((t=>t===e));)re(s,n,t),n--;for(r++;s[r]?.find((t=>t===e));)re(s,r,t),r++}}else for(let e=n;e<r;e++)s[e]&&re(s,e,t);return p({...e,formats:s,activeFormats:a?.filter((({type:e})=>e!==t))||[]})}function re(e,t,n){const r=e[t].filter((({type:e})=>e!==n));r.length?e[t]=r:delete e[t]}function oe(e,t,n=e.start,r=e.end){const{formats:o,replacements:a,text:s}=e;"string"==typeof t&&(t=V({text:t}));const i=n+t.text.length;return p({formats:o.slice(0,n).concat(t.formats,o.slice(r)),replacements:a.slice(0,n).concat(t.replacements,a.slice(r)),text:s.slice(0,n)+t.text+s.slice(r),start:i,end:i})}function ae(e,t,n){return oe(e,V(),t,n)}function se({formats:e,replacements:t,text:n,start:r,end:o},a,s){return n=n.replace(a,((n,...a)=>{const i=a[a.length-2];let c,u,l=s;return"function"==typeof l&&(l=s(n,...a)),"object"==typeof l?(c=l.formats,u=l.replacements,l=l.text):(c=Array(l.length),u=Array(l.length),e[i]&&(c=c.fill(e[i]))),e=e.slice(0,i).concat(c,e.slice(i+n.length)),t=t.slice(0,i).concat(u,t.slice(i+n.length)),r&&(r=o=i+l.length),l})),p({formats:e,replacements:t,text:n,start:r,end:o})}function ie(e,t,n,r){return oe(e,{formats:[,],replacements:[t],text:b},n,r)}function ce(e,t=e.start,n=e.end){const{formats:r,replacements:o,text:a}=e;return void 0===t||void 0===n?{...e}:{formats:r.slice(t,n),replacements:o.slice(t,n),text:a.slice(t,n)}}function ue({formats:e,replacements:t,text:n,start:r,end:o},a){if("string"!=typeof a)return function({formats:e,replacements:t,text:n,start:r,end:o},a=r,s=o){if(void 0===r||void 0===o)return;const i={formats:e.slice(0,a),replacements:t.slice(0,a),text:n.slice(0,a)},c={formats:e.slice(s),replacements:t.slice(s),text:n.slice(s),start:0,end:0};return[i,c]}(...arguments);let s=0;return n.split(a).map((n=>{const i=s,c={formats:e.slice(i,i+n.length),replacements:t.slice(i,i+n.length),text:n};return s+=a.length+n.length,void 0!==r&&void 0!==o&&(r>=i&&r<s?c.start=r-i:r<i&&o>i&&(c.start=0),o>=i&&o<s?c.end=o-i:r<s&&o>s&&(c.end=n.length)),c}))}function le(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}const de="http://www.w3.org/1998/Math/MathML";function fe(e,t,n){const r=e.parentNode;let o=0;for(;e=e.previousSibling;)o++;return n=[o,...n],r!==t&&(n=fe(r,t,n)),n}function me(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function pe(e,t){if(void 0!==t.html)return e.innerHTML+=t.html;"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:r}=t;if(n)if("#comment"===n)t=e.ownerDocument.createComment(r["data-rich-text-comment"]);else{const o=e.namespaceURI;t="math"===n?e.ownerDocument.createElementNS(de,n):o===de?"MTEXT"===e.tagName?e.ownerDocument.createElement(n):e.ownerDocument.createElementNS(de,n):e.ownerDocument.createElement(n);for(const e in r)t.setAttribute(e,r[e])}return e.appendChild(t)}function he(e,t){e.appendData(t)}function ge({lastChild:e}){return e}function ve({parentNode:e}){return e}function be(e){return e.nodeType===e.TEXT_NODE}function ye({nodeValue:e}){return e}function Ee(e){return e.parentNode.removeChild(e)}function xe({value:e,prepareEditableTree:t,isEditableTree:n=!0,placeholder:r,doc:o=document}){let a=[],s=[];t&&(e={...e,formats:t(e)});return{body:C({value:e,createEmpty:()=>v(o,""),append:pe,getLastChild:ge,getParent:ve,isText:be,getText:ye,remove:Ee,appendText:he,onStartIndex(e,t){a=fe(t,e,[t.nodeValue.length])},onEndIndex(e,t){s=fe(t,e,[t.nodeValue.length])},isEditableTree:n,placeholder:r}),selection:{startPath:a,endPath:s}}}function Te({value:e,current:t,prepareEditableTree:n,__unstableDomOnly:r,placeholder:o}){const{body:a,selection:s}=xe({value:e,prepareEditableTree:n,placeholder:o,doc:t.ownerDocument});we(a,t),void 0===e.start||r||function({startPath:e,endPath:t},n){const{node:r,offset:o}=me(n,e),{node:a,offset:s}=me(n,t),{ownerDocument:i}=n,{defaultView:c}=i,u=c.getSelection(),l=i.createRange();l.setStart(r,o),l.setEnd(a,s);const{activeElement:d}=i;if(u.rangeCount>0){if(le(l,u.getRangeAt(0)))return;u.removeAllRanges()}u.addRange(l),d!==i.activeElement&&d instanceof c.HTMLElement&&d.focus()}(s,t)}function we(e,t){let n,r=0;for(;n=e.firstChild;){const o=t.childNodes[r];if(o)if(o.isEqualNode(n))e.removeChild(n);else if(o.nodeName!==n.nodeName||o.nodeType===o.TEXT_NODE&&o.data!==n.data)t.replaceChild(n,o);else{const t=o.attributes,r=n.attributes;if(t){let e=t.length;for(;e--;){const{name:r}=t[e];n.getAttribute(r)||o.removeAttribute(r)}}if(r)for(let e=0;e<r.length;e++){const{name:t,value:n}=r[e];o.getAttribute(t)!==n&&o.setAttribute(t,n)}we(n,o),e.removeChild(n)}else t.appendChild(n);r++}for(;t.childNodes[r];)t.removeChild(t.childNodes[r])}const Ne=window.wp.a11y,Le=window.wp.i18n;function Ce(e,t){return G(e,t.type)?(t.title&&(0,Ne.speak)((0,Le.sprintf)((0,Le.__)("%s removed."),t.title),"assertive"),ne(e,t.type)):(t.title&&(0,Ne.speak)((0,Le.sprintf)((0,Le.__)("%s applied."),t.title),"assertive"),g(e,t))}function _e(e){const t=(0,o.select)(f).getFormatType(e);if(t)return(0,o.dispatch)(f).removeFormatTypes(e),t;window.console.error(`Format ${e} is not registered.`)}const Se=window.wp.element,Ae=window.wp.deprecated;var Fe=e.n(Ae);function Oe({ref:e,value:t,settings:n={}}){Fe()("`useAnchorRef` hook",{since:"6.1",alternative:"`useAnchor` hook"});const{tagName:r,className:o,name:a}=n,s=a?G(t,a):void 0;return(0,Se.useMemo)((()=>{if(!e.current)return;const{ownerDocument:{defaultView:t}}=e.current,n=t.getSelection();if(!n.rangeCount)return;const a=n.getRangeAt(0);if(!s)return a;let i=a.startContainer;for(i=i.nextElementSibling||i;i.nodeType!==i.ELEMENT_NODE;)i=i.parentNode;return i.closest(r+(o?"."+o:""))}),[s,t.start,t.end,r,o])}const De=window.wp.compose;function Re(e,t,n){if(!e)return;const{ownerDocument:r}=e,{defaultView:o}=r,a=o.getSelection();if(!a)return;if(!a.rangeCount)return;const s=a.getRangeAt(0);if(!s||!s.startContainer)return;const i=function(e,t,n,r){let o=e.startContainer;if(o.nodeType===o.TEXT_NODE&&e.startOffset===o.length&&o.nextSibling)for(o=o.nextSibling;o.firstChild;)o=o.firstChild;if(o.nodeType!==o.ELEMENT_NODE&&(o=o.parentElement),!o)return;if(o===t)return;if(!t.contains(o))return;const a=n+(r?"."+r:"");for(;o!==t;){if(o.matches(a))return o;o=o.parentElement}}(s,e,t,n);return i||function(e,t){return{contextElement:t,getBoundingClientRect:()=>t.contains(e.startContainer)?e.getBoundingClientRect():t.getBoundingClientRect()}}(s,e)}function Me({editableContentElement:e,settings:t={}}){const{tagName:n,className:r,isActive:o}=t,[a,s]=(0,Se.useState)((()=>Re(e,n,r))),i=(0,De.usePrevious)(o);return(0,Se.useLayoutEffect)((()=>{if(!e)return;function t(){s(Re(e,n,r))}function a(){u.addEventListener("selectionchange",t)}function c(){u.removeEventListener("selectionchange",t)}const{ownerDocument:u}=e;return(e===u.activeElement||!i&&o||i&&!o)&&(s(Re(e,n,r)),a()),e.addEventListener("focusin",a),e.addEventListener("focusout",c),()=>{c(),e.removeEventListener("focusin",a),e.removeEventListener("focusout",c)}}),[e,n,r,o,i]),a}const $e="pre-wrap",ke="1px";var He={grad:.9,turn:360,rad:360/(2*Math.PI)},Pe=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},je=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Ve=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Ie=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},We=function(e){return{r:Ve(e.r,0,255),g:Ve(e.g,0,255),b:Ve(e.b,0,255),a:Ve(e.a)}},ze=function(e){return{r:je(e.r),g:je(e.g),b:je(e.b),a:je(e.a,3)}},Be=/^#([0-9a-f]{3,8})$/i,Xe=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},qe=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=Math.max(t,n,r),s=a-Math.min(t,n,r),i=s?a===t?(n-r)/s:a===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(i<0?i+6:i),s:a?s/a*100:0,v:a/255*100,a:o}},Ke=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),s=r*(1-n),i=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),u=a%6;return{r:255*[r,i,s,s,c,r][u],g:255*[c,r,r,i,s,s][u],b:255*[s,s,c,r,r,i][u],a:o}},Ue=function(e){return{h:Ie(e.h),s:Ve(e.s,0,100),l:Ve(e.l,0,100),a:Ve(e.a)}},Ye=function(e){return{h:je(e.h),s:je(e.s),l:je(e.l),a:je(e.a,3)}},Ge=function(e){return Ke((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},Ze=function(e){return{h:(t=qe(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},Je=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,et=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,nt={string:[[function(e){var t=Be.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?je(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?je(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=et.exec(e)||tt.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:We({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Je.exec(e)||Qe.exec(e);if(!t)return null;var n,r,o=Ue({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(He[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Ge(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=void 0===o?1:o;return Pe(t)&&Pe(n)&&Pe(r)?We({r:Number(t),g:Number(n),b:Number(r),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,a=void 0===o?1:o;if(!Pe(t)||!Pe(n)||!Pe(r))return null;var s=Ue({h:Number(t),s:Number(n),l:Number(r),a:Number(a)});return Ge(s)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,a=void 0===o?1:o;if(!Pe(t)||!Pe(n)||!Pe(r))return null;var s=function(e){return{h:Ie(e.h),s:Ve(e.s,0,100),v:Ve(e.v,0,100),a:Ve(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(a)});return Ke(s)},"hsv"]]},rt=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},ot=function(e){return"string"==typeof e?rt(e.trim(),nt.string):"object"==typeof e&&null!==e?rt(e,nt.object):[null,void 0]},at=function(e,t){var n=Ze(e);return{h:n.h,s:Ve(n.s+100*t,0,100),l:n.l,a:n.a}},st=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},it=function(e,t){var n=Ze(e);return{h:n.h,s:n.s,l:Ve(n.l+100*t,0,100),a:n.a}},ct=function(){function e(e){this.parsed=ot(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return je(st(this.rgba),2)},e.prototype.isDark=function(){return st(this.rgba)<.5},e.prototype.isLight=function(){return st(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=ze(this.rgba)).r,n=e.g,r=e.b,a=(o=e.a)<1?Xe(je(255*o)):"","#"+Xe(t)+Xe(n)+Xe(r)+a;var e,t,n,r,o,a},e.prototype.toRgb=function(){return ze(this.rgba)},e.prototype.toRgbString=function(){return t=(e=ze(this.rgba)).r,n=e.g,r=e.b,(o=e.a)<1?"rgba("+t+", "+n+", "+r+", "+o+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,o},e.prototype.toHsl=function(){return Ye(Ze(this.rgba))},e.prototype.toHslString=function(){return t=(e=Ye(Ze(this.rgba))).h,n=e.s,r=e.l,(o=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+o+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,o},e.prototype.toHsv=function(){return e=qe(this.rgba),{h:je(e.h),s:je(e.s),v:je(e.v),a:je(e.a,3)};var e},e.prototype.invert=function(){return ut({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),ut(at(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),ut(at(this.rgba,-e))},e.prototype.grayscale=function(){return ut(at(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),ut(it(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),ut(it(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?ut({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):je(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ze(this.rgba);return"number"==typeof e?ut({h:e,s:t.s,l:t.l,a:t.a}):je(t.h)},e.prototype.isEqual=function(e){return this.toHex()===ut(e).toHex()},e}(),ut=function(e){return e instanceof ct?e:new ct(e)};function lt({record:e}){const t=(0,Se.useRef)(),{activeFormats:n=[],replacements:r,start:o}=e.current,a=r[o];return(0,Se.useEffect)((()=>{if(!(n&&n.length||a))return;const e="*[data-rich-text-format-boundary]",r=t.current.querySelector(e);if(!r)return;const{ownerDocument:o}=r,{defaultView:s}=o,i=s.getComputedStyle(r),c=`${`.rich-text:focus ${e}`} {${`background-color: ${ut(i.color).alpha(.2).toRgbString()}`}}`,u="rich-text-boundary-style";let l=o.getElementById(u);l||(l=o.createElement("style"),l.id=u,o.head.appendChild(l)),l.innerHTML!==c&&(l.innerHTML=c)}),[n,a]),t}const dt=window.wp.keycodes,ft=[];const mt=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),pt=[],ht="data-rich-text-placeholder";const gt=[e=>t=>{function n(n){const{record:r}=e.current,{ownerDocument:o}=t;if(J(r.current)||!t.contains(o.activeElement))return;const a=ce(r.current),s=H(a),i=_({value:a});n.clipboardData.setData("text/plain",s),n.clipboardData.setData("text/html",i),n.clipboardData.setData("rich-text","true"),n.preventDefault(),"cut"===n.type&&o.execCommand("delete")}const{defaultView:r}=t.ownerDocument;return r.addEventListener("copy",n),r.addEventListener("cut",n),()=>{r.removeEventListener("copy",n),r.removeEventListener("cut",n)}},()=>e=>{function t(t){const{target:n}=t;if(n===e||n.textContent&&n.isContentEditable)return;const{ownerDocument:r}=n,{defaultView:o}=r,a=o.getSelection();if(a.containsNode(n))return;const s=r.createRange(),i=n.isContentEditable?n:n.closest("[contenteditable]");s.selectNode(i),a.removeAllRanges(),a.addRange(s),t.preventDefault()}function n(n){n.relatedTarget&&!e.contains(n.relatedTarget)&&"A"===n.relatedTarget.tagName&&t(n)}return e.addEventListener("click",t),e.addEventListener("focusin",n),()=>{e.removeEventListener("click",t),e.removeEventListener("focusin",n)}},e=>t=>{function n(n){const{keyCode:r,shiftKey:o,altKey:a,metaKey:s,ctrlKey:i}=n;if(o||a||s||i||r!==dt.LEFT&&r!==dt.RIGHT)return;const{record:c,applyRecord:u,forceRender:l}=e.current,{text:d,formats:f,start:m,end:p,activeFormats:h=[]}=c.current,g=J(c.current),{ownerDocument:v}=t,{defaultView:b}=v,{direction:y}=b.getComputedStyle(t),E="rtl"===y?dt.RIGHT:dt.LEFT,x=n.keyCode===E;if(g&&0===h.length){if(0===m&&x)return;if(p===d.length&&!x)return}if(!g)return;const T=f[m-1]||ft,w=f[m]||ft,N=x?T:w,L=h.every(((e,t)=>e===N[t]));let C=h.length;if(L?C<N.length&&C++:C--,C===h.length)return void(c.current._newActiveFormats=N);n.preventDefault();const _=(L?N:x?w:T).slice(0,C),S={...c.current,activeFormats:_};c.current=S,u(S),l()}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){const{keyCode:n}=t,{createRecord:r,handleChange:o}=e.current;if(t.defaultPrevented)return;if(n!==dt.DELETE&&n!==dt.BACKSPACE)return;const a=r(),{start:s,end:i,text:c}=a;0===s&&0!==i&&i===c.length&&(o(ae(a)),t.preventDefault())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{const{ownerDocument:n}=t,{defaultView:r}=n;let o=!1;function a(t){if(o)return;let n;t&&(n=t.inputType);const{record:r,applyRecord:a,createRecord:s,handleChange:i}=e.current;if(n&&(0===n.indexOf("format")||mt.has(n)))return void a(r.current);const c=s(),{start:u,activeFormats:l=[]}=r.current,d=function({value:e,start:t,end:n,formats:r}){const o=Math.min(t,n),a=Math.max(t,n),s=e.formats[o-1]||[],i=e.formats[a]||[];for(e.activeFormats=r.map(((e,t)=>{if(s[t]){if(m(e,s[t]))return s[t]}else if(i[t]&&m(e,i[t]))return i[t];return e}));--n>=t;)e.activeFormats.length>0?e.formats[n]=e.activeFormats:delete e.formats[n];return e}({value:c,start:u,end:c.start,formats:l});i(d)}function s(){const{record:i,applyRecord:c,createRecord:u,onSelectionChange:l}=e.current;if("true"!==t.contentEditable)return;if(n.activeElement!==t)return void n.removeEventListener("selectionchange",s);if(o)return;const{start:d,end:f,text:m}=u(),p=i.current;if(m!==p.text)return void a();if(d===p.start&&f===p.end)return void(0===p.text.length&&0===d&&function(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:r}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const o=n.childNodes[r];o&&o.nodeType===o.ELEMENT_NODE&&o.hasAttribute(ht)&&t.collapseToStart()}(r));const h={...p,start:d,end:f,activeFormats:p._newActiveFormats,_newActiveFormats:void 0},g=x(h,pt);h.activeFormats=g,i.current=h,c(h,{domOnly:!0}),l(d,f)}function i(){o=!0,n.removeEventListener("selectionchange",s),t.querySelector(`[${ht}]`)?.remove()}function c(){o=!1,a({inputType:"insertText"}),n.addEventListener("selectionchange",s)}function u(){const{record:r,isSelected:o,onSelectionChange:a,applyRecord:i}=e.current;if(!t.parentElement.closest('[contenteditable="true"]')){if(o)i(r.current,{domOnly:!0});else{const e=void 0;r.current={...r.current,start:e,end:e,activeFormats:pt}}a(r.current.start,r.current.end),window.queueMicrotask(s),n.addEventListener("selectionchange",s)}}return t.addEventListener("input",a),t.addEventListener("compositionstart",i),t.addEventListener("compositionend",c),t.addEventListener("focus",u),()=>{t.removeEventListener("input",a),t.removeEventListener("compositionstart",i),t.removeEventListener("compositionend",c),t.removeEventListener("focus",u)}},()=>e=>{const{ownerDocument:t}=e,{defaultView:n}=t,r=n?.getSelection();let o;function a(){return r.rangeCount?r.getRangeAt(0):null}function s(e){const n="keydown"===e.type?"keyup":"pointerup";function r(){t.removeEventListener(n,s),t.removeEventListener("selectionchange",r),t.removeEventListener("input",r)}function s(){r(),le(o,a())||t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(n,s),t.addEventListener("selectionchange",r),t.addEventListener("input",r),o=a()}return e.addEventListener("pointerdown",s),e.addEventListener("keydown",s),()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("keydown",s)}},function(){return e=>{const{ownerDocument:t}=e,{defaultView:n}=t;let r=null;function o(t){t.defaultPrevented||t.target!==e&&t.target.contains(e)&&(r=e.getAttribute("contenteditable"),e.setAttribute("contenteditable","false"),n.getSelection().removeAllRanges())}function a(){null!==r&&(e.setAttribute("contenteditable",r),r=null)}return n.addEventListener("pointerdown",o),n.addEventListener("pointerup",a),()=>{n.removeEventListener("pointerdown",o),n.removeEventListener("pointerup",a)}}}];function vt(e){const t=(0,Se.useRef)(e);(0,Se.useInsertionEffect)((()=>{t.current=e}));const n=(0,Se.useMemo)((()=>gt.map((e=>e(t)))),[t]);return(0,De.useRefEffect)((e=>{const t=n.map((t=>t(e)));return()=>{t.forEach((e=>e()))}}),[n])}function bt({value:e="",selectionStart:t,selectionEnd:n,placeholder:r,onSelectionChange:a,preserveWhiteSpace:s,onChange:i,__unstableDisableFormats:c,__unstableIsSelected:u,__unstableDependencies:l=[],__unstableAfterParse:d,__unstableBeforeSerialize:f,__unstableAddInvisibleFormats:m}){const p=(0,o.useRegistry)(),[,h]=(0,Se.useReducer)((()=>({}))),g=(0,Se.useRef)();function v(e,{domOnly:t}={}){Te({value:e,current:g.current,prepareEditableTree:m,__unstableDomOnly:t,placeholder:r})}const b=(0,Se.useRef)(e),y=(0,Se.useRef)();function E(){b.current=e,y.current=e,e instanceof j||(y.current=e?j.fromHTMLString(e,{preserveWhiteSpace:s}):j.empty()),y.current={text:y.current.text,formats:y.current.formats,replacements:y.current.replacements},c&&(y.current.formats=Array(e.length),y.current.replacements=Array(e.length)),d&&(y.current.formats=d(y.current)),y.current.start=t,y.current.end=n}const x=(0,Se.useRef)(!1);function T(t){if(y.current=t,v(t),c)b.current=t.text;else{const n=f?f(t):t.formats;t={...t,formats:n},b.current="string"==typeof e?_({value:t,preserveWhiteSpace:s}):new j(t)}const{start:n,end:r,formats:o,text:u}=y.current;p.batch((()=>{a(n,r),i(b.current,{__unstableFormats:o,__unstableText:u})})),h()}function w(){const t=b.current;E();const n=t&&"string"==typeof t&&"string"==typeof e&&t.length!==e.length,r=g.current?.contains(g.current.ownerDocument.activeElement),o=n&&!r;v(y.current,{domOnly:o})}y.current?t===y.current.start&&n===y.current.end||(x.current=u,y.current={...y.current,start:t,end:n,activeFormats:void 0}):(x.current=u,E());const N=(0,Se.useRef)(!1);(0,Se.useLayoutEffect)((()=>{N.current&&e!==b.current&&(w(),h())}),[e]),(0,Se.useLayoutEffect)((()=>{x.current&&(g.current.ownerDocument.activeElement!==g.current&&g.current.focus(),v(y.current),x.current=!1)}),[x.current]);const L=(0,De.useMergeRefs)([g,(0,Se.useCallback)((e=>{e&&(e.style.whiteSpace=$e,e.style.minWidth=ke)}),[]),lt({record:y}),vt({record:y,handleChange:T,applyRecord:v,createRecord:function(){const{ownerDocument:{defaultView:e}}=g.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return V({element:g.current,range:n,__unstableIsEditableTree:!0})},isSelected:u,onSelectionChange:a,forceRender:h}),(0,De.useRefEffect)((()=>{w(),N.current=!0}),[r,...l])]);return{value:y.current,getValue:()=>y.current,onChange:T,ref:L}}function yt(){}(window.wp=window.wp||{}).richText=t})(); data-controls.js 0000644 00000010614 15144410747 0007665 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* 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))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
__unstableAwaitPromise: () => (/* binding */ __unstableAwaitPromise),
apiFetch: () => (/* binding */ apiFetch),
controls: () => (/* binding */ controls),
dispatch: () => (/* binding */ dispatch),
select: () => (/* binding */ build_module_select),
syncSelect: () => (/* binding */ syncSelect)
});
;// external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
;// ./node_modules/@wordpress/data-controls/build-module/index.js
function apiFetch(request) {
return {
type: "API_FETCH",
request
};
}
function build_module_select(storeNameOrDescriptor, selectorName, ...args) {
external_wp_deprecated_default()("`select` control in `@wordpress/data-controls`", {
since: "5.7",
alternative: "built-in `resolveSelect` control in `@wordpress/data`"
});
return external_wp_data_namespaceObject.controls.resolveSelect(
storeNameOrDescriptor,
selectorName,
...args
);
}
function syncSelect(storeNameOrDescriptor, selectorName, ...args) {
external_wp_deprecated_default()("`syncSelect` control in `@wordpress/data-controls`", {
since: "5.7",
alternative: "built-in `select` control in `@wordpress/data`"
});
return external_wp_data_namespaceObject.controls.select(storeNameOrDescriptor, selectorName, ...args);
}
function dispatch(storeNameOrDescriptor, actionName, ...args) {
external_wp_deprecated_default()("`dispatch` control in `@wordpress/data-controls`", {
since: "5.7",
alternative: "built-in `dispatch` control in `@wordpress/data`"
});
return external_wp_data_namespaceObject.controls.dispatch(storeNameOrDescriptor, actionName, ...args);
}
const __unstableAwaitPromise = function(promise) {
return {
type: "AWAIT_PROMISE",
promise
};
};
const controls = {
AWAIT_PROMISE({ promise }) {
return promise;
},
API_FETCH({ request }) {
return external_wp_apiFetch_default()(request);
}
};
(window.wp = window.wp || {}).dataControls = __webpack_exports__;
/******/ })()
; is-shallow-equal.min.js 0000644 00000001772 15144410747 0011071 0 ustar 00 /*! This file is auto-generated */
(()=>{"use strict";var r={d:(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e),r:r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},e={};function t(r,e){if(r===e)return!0;const t=Object.keys(r),n=Object.keys(e);if(t.length!==n.length)return!1;let o=0;for(;o<t.length;){const n=t[o],i=r[n];if(void 0===i&&!e.hasOwnProperty(n)||i!==e[n])return!1;o++}return!0}function n(r,e){if(r===e)return!0;if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function o(r,e){if(r&&e){if(r.constructor===Object&&e.constructor===Object)return t(r,e);if(Array.isArray(r)&&Array.isArray(e))return n(r,e)}return r===e}r.r(e),r.d(e,{default:()=>o,isShallowEqualArrays:()=>n,isShallowEqualObjects:()=>t}),(window.wp=window.wp||{}).isShallowEqual=e})(); block-serialization-default-parser.js 0000644 00000015500 15144410747 0013773 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // 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))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ parse: () => (/* binding */ parse)
/* harmony export */ });
let document;
let offset;
let output;
let stack;
const tokenizer = /<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;
function Block(blockName, attrs, innerBlocks, innerHTML, innerContent) {
return {
blockName,
attrs,
innerBlocks,
innerHTML,
innerContent
};
}
function Freeform(innerHTML) {
return Block(null, {}, [], innerHTML, [innerHTML]);
}
function Frame(block, tokenStart, tokenLength, prevOffset, leadingHtmlStart) {
return {
block,
tokenStart,
tokenLength,
prevOffset: prevOffset || tokenStart + tokenLength,
leadingHtmlStart
};
}
const parse = (doc) => {
document = doc;
offset = 0;
output = [];
stack = [];
tokenizer.lastIndex = 0;
do {
} while (proceed());
return output;
};
function proceed() {
const stackDepth = stack.length;
const next = nextToken();
const [tokenType, blockName, attrs, startOffset, tokenLength] = next;
const leadingHtmlStart = startOffset > offset ? offset : null;
switch (tokenType) {
case "no-more-tokens":
if (0 === stackDepth) {
addFreeform();
return false;
}
if (1 === stackDepth) {
addBlockFromStack();
return false;
}
while (0 < stack.length) {
addBlockFromStack();
}
return false;
case "void-block":
if (0 === stackDepth) {
if (null !== leadingHtmlStart) {
output.push(
Freeform(
document.substr(
leadingHtmlStart,
startOffset - leadingHtmlStart
)
)
);
}
output.push(Block(blockName, attrs, [], "", []));
offset = startOffset + tokenLength;
return true;
}
addInnerBlock(
Block(blockName, attrs, [], "", []),
startOffset,
tokenLength
);
offset = startOffset + tokenLength;
return true;
case "block-opener":
stack.push(
Frame(
Block(blockName, attrs, [], "", []),
startOffset,
tokenLength,
startOffset + tokenLength,
leadingHtmlStart
)
);
offset = startOffset + tokenLength;
return true;
case "block-closer":
if (0 === stackDepth) {
addFreeform();
return false;
}
if (1 === stackDepth) {
addBlockFromStack(startOffset);
offset = startOffset + tokenLength;
return true;
}
const stackTop = stack.pop();
const html = document.substr(
stackTop.prevOffset,
startOffset - stackTop.prevOffset
);
stackTop.block.innerHTML += html;
stackTop.block.innerContent.push(html);
stackTop.prevOffset = startOffset + tokenLength;
addInnerBlock(
stackTop.block,
stackTop.tokenStart,
stackTop.tokenLength,
startOffset + tokenLength
);
offset = startOffset + tokenLength;
return true;
default:
addFreeform();
return false;
}
}
function parseJSON(input) {
try {
return JSON.parse(input);
} catch (e) {
return null;
}
}
function nextToken() {
const matches = tokenizer.exec(document);
if (null === matches) {
return ["no-more-tokens", "", null, 0, 0];
}
const startedAt = matches.index;
const [
match,
closerMatch,
namespaceMatch,
nameMatch,
attrsMatch,
,
voidMatch
] = matches;
const length = match.length;
const isCloser = !!closerMatch;
const isVoid = !!voidMatch;
const namespace = namespaceMatch || "core/";
const name = namespace + nameMatch;
const hasAttrs = !!attrsMatch;
const attrs = hasAttrs ? parseJSON(attrsMatch) : {};
if (isCloser && (isVoid || hasAttrs)) {
}
if (isVoid) {
return ["void-block", name, attrs, startedAt, length];
}
if (isCloser) {
return ["block-closer", name, null, startedAt, length];
}
return ["block-opener", name, attrs, startedAt, length];
}
function addFreeform(rawLength) {
const length = rawLength ? rawLength : document.length - offset;
if (0 === length) {
return;
}
output.push(Freeform(document.substr(offset, length)));
}
function addInnerBlock(block, tokenStart, tokenLength, lastOffset) {
const parent = stack[stack.length - 1];
parent.block.innerBlocks.push(block);
const html = document.substr(
parent.prevOffset,
tokenStart - parent.prevOffset
);
if (html) {
parent.block.innerHTML += html;
parent.block.innerContent.push(html);
}
parent.block.innerContent.push(null);
parent.prevOffset = lastOffset ? lastOffset : tokenStart + tokenLength;
}
function addBlockFromStack(endOffset) {
const { block, leadingHtmlStart, prevOffset, tokenStart } = stack.pop();
const html = endOffset ? document.substr(prevOffset, endOffset - prevOffset) : document.substr(prevOffset);
if (html) {
block.innerHTML += html;
block.innerContent.push(html);
}
if (null !== leadingHtmlStart) {
output.push(
Freeform(
document.substr(
leadingHtmlStart,
tokenStart - leadingHtmlStart
)
)
);
}
output.push(block);
}
(window.wp = window.wp || {}).blockSerializationDefaultParser = __webpack_exports__;
/******/ })()
; hooks.min.js 0000644 00000013035 15144410747 0007020 0 ustar 00 /*! This file is auto-generated */
(()=>{var t={507:(t,e,r)=>{"use strict";r.d(e,{A:()=>A});var n=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var i=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var o=function(t,e){return function(r,o,s,c=10){const l=t[e];if(!i(r))return;if(!n(o))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof c)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:c,namespace:o};if(l[r]){const t=l[r].handlers;let e;for(e=t.length;e>0&&!(c>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),l.__current.forEach((t=>{t.name===r&&t.currentIndex>=e&&t.currentIndex++}))}else l[r]={handlers:[a],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,o,s,c)}};var s=function(t,e,r=!1){return function(o,s){const c=t[e];if(!i(o))return;if(!r&&!n(s))return;if(!c[o])return 0;let l=0;if(r)l=c[o].handlers.length,c[o]={runs:c[o].runs,handlers:[]};else{const t=c[o].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),l++,c.__current.forEach((t=>{t.name===o&&t.currentIndex>=e&&t.currentIndex--})))}return"hookRemoved"!==o&&t.doAction("hookRemoved",o,s),l}};var c=function(t,e){return function(r,n){const i=t[e];return void 0!==n?r in i&&i[r].handlers.some((t=>t.namespace===n)):r in i}};var l=function(t,e,r,n){return function(i,...o){const s=t[e];s[i]||(s[i]={handlers:[],runs:0}),s[i].runs++;const c=s[i].handlers;if(!c||!c.length)return r?o[0]:void 0;const l={name:i,currentIndex:0};return(n?async function(){try{s.__current.add(l);let t=r?o[0]:void 0;for(;l.currentIndex<c.length;){const e=c[l.currentIndex];t=await e.callback.apply(null,o),r&&(o[0]=t),l.currentIndex++}return r?t:void 0}finally{s.__current.delete(l)}}:function(){try{s.__current.add(l);let t=r?o[0]:void 0;for(;l.currentIndex<c.length;){t=c[l.currentIndex].callback.apply(null,o),r&&(o[0]=t),l.currentIndex++}return r?t:void 0}finally{s.__current.delete(l)}})()}};var a=function(t,e){return function(){const r=t[e],n=Array.from(r.__current);return n.at(-1)?.name??null}};var d=function(t,e){return function(r){const n=t[e];return void 0===r?n.__current.size>0:Array.from(n.__current).some((t=>t.name===r))}};var u=function(t,e){return function(r){const n=t[e];if(i(r))return n[r]&&n[r].runs?n[r].runs:0}};class h{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=o(this,"actions"),this.addFilter=o(this,"filters"),this.removeAction=s(this,"actions"),this.removeFilter=s(this,"filters"),this.hasAction=c(this,"actions"),this.hasFilter=c(this,"filters"),this.removeAllActions=s(this,"actions",!0),this.removeAllFilters=s(this,"filters",!0),this.doAction=l(this,"actions",!1,!1),this.doActionAsync=l(this,"actions",!1,!0),this.applyFilters=l(this,"filters",!0,!1),this.applyFiltersAsync=l(this,"filters",!0,!0),this.currentAction=a(this,"actions"),this.currentFilter=a(this,"filters"),this.doingAction=d(this,"actions"),this.doingFilter=d(this,"filters"),this.didAction=u(this,"actions"),this.didFilter=u(this,"filters")}}var A=function(){return new h}},8770:()=>{}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{actions:()=>x,addAction:()=>s,addFilter:()=>c,applyFilters:()=>m,applyFiltersAsync:()=>v,createHooks:()=>t.A,currentAction:()=>y,currentFilter:()=>F,defaultHooks:()=>o,didAction:()=>b,didFilter:()=>k,doAction:()=>f,doActionAsync:()=>p,doingAction:()=>_,doingFilter:()=>g,filters:()=>w,hasAction:()=>d,hasFilter:()=>u,removeAction:()=>l,removeAllActions:()=>h,removeAllFilters:()=>A,removeFilter:()=>a});var t=r(507),e=r(8770),i={};for(const t in e)["default","actions","addAction","addFilter","applyFilters","applyFiltersAsync","createHooks","currentAction","currentFilter","defaultHooks","didAction","didFilter","doAction","doActionAsync","doingAction","doingFilter","filters","hasAction","hasFilter","removeAction","removeAllActions","removeAllFilters","removeFilter"].indexOf(t)<0&&(i[t]=()=>e[t]);r.d(n,i);const o=(0,t.A)(),{addAction:s,addFilter:c,removeAction:l,removeFilter:a,hasAction:d,hasFilter:u,removeAllActions:h,removeAllFilters:A,doAction:f,doActionAsync:p,applyFilters:m,applyFiltersAsync:v,currentAction:y,currentFilter:F,doingAction:_,doingFilter:g,didAction:b,didFilter:k,actions:x,filters:w}=o})(),(window.wp=window.wp||{}).hooks=n})(); editor.min.js 0000644 00001463234 15144410747 0007176 0 ustar 00 /*! This file is auto-generated */
(()=>{var e={66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===s}(e)}(e)};var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((s=e,Array.isArray(s)?[]:{}),e,t):e;var s}function o(e,t,s){return e.concat(t).map((function(e){return n(e,s)}))}function r(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function i(e,t){try{return t in e}catch(e){return!1}}function a(e,t,s){var o={};return s.isMergeableObject(e)&&r(e).forEach((function(t){o[t]=n(e[t],s)})),r(t).forEach((function(r){(function(e,t){return i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,r)||(i(e,r)&&s.isMergeableObject(t[r])?o[r]=function(e,t){if(!t.customMerge)return l;var s=t.customMerge(e);return"function"==typeof s?s:l}(r,s)(e[r],t[r],s):o[r]=n(t[r],s))})),o}function l(e,s,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||t,r.cloneUnlessOtherwiseSpecified=n;var i=Array.isArray(s);return i===Array.isArray(e)?i?r.arrayMerge(e,s,r):a(e,s,r):n(s,r)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,s){return l(e,s,t)}),{})};var c=l;e.exports=c},461:(e,t,s)=>{var n=s(6109);e.exports=function(e){var t=n(e,"line-height"),s=parseFloat(t,10);if(t===s+""){var o=e.style.lineHeight;e.style.lineHeight=t+"em",t=n(e,"line-height"),s=parseFloat(t,10),o?e.style.lineHeight=o:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(s*=4,s/=3):-1!==t.indexOf("mm")?(s*=96,s/=25.4):-1!==t.indexOf("cm")?(s*=96,s/=2.54):-1!==t.indexOf("in")?s*=96:-1!==t.indexOf("pc")&&(s*=16),s=Math.round(s),"normal"===t){var r=e.nodeName,i=document.createElement(r);i.innerHTML=" ","TEXTAREA"===r.toUpperCase()&&i.setAttribute("rows","1");var a=n(e,"font-size");i.style.fontSize=a,i.style.padding="0px",i.style.border="0px";var l=document.body;l.appendChild(i),s=i.offsetHeight,l.removeChild(i)}return s}},628:(e,t,s)=>{"use strict";var n=s(4067);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,s,o,r,i){if(i!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var s={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:o};return s.PropTypes=s,s}},1609:e=>{"use strict";e.exports=window.React},4067:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4132:(e,t,s)=>{"use strict";var n=s(4462);t.A=n.TextareaAutosize},4306:function(e,t){var s,n,o;
/*!
autosize 4.0.4
license: MIT
http://www.jacklmoore.com/autosize
*/n=[e,t],s=function(e,t){"use strict";var s,n,o="function"==typeof Map?new Map:(s=[],n=[],{has:function(e){return s.indexOf(e)>-1},get:function(e){return n[s.indexOf(e)]},set:function(e,t){-1===s.indexOf(e)&&(s.push(e),n.push(t))},delete:function(e){var t=s.indexOf(e);t>-1&&(s.splice(t,1),n.splice(t,1))}}),r=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){r=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,s=null,n=null,i=function(){e.clientWidth!==s&&p()},a=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",p,!1),Object.keys(t).forEach((function(s){e.style[s]=t[s]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",p,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:a,update:p}),l()}function l(){var s=window.getComputedStyle(e,null);"vertical"===s.resize?e.style.resize="none":"both"===s.resize&&(e.style.resize="horizontal"),t="content-box"===s.boxSizing?-(parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)):parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),isNaN(t)&&(t=0),p()}function c(t){var s=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=s,e.style.overflowY=t}function d(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function u(){if(0!==e.scrollHeight){var n=d(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",s=e.clientWidth,n.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function p(){u();var t=Math.round(parseFloat(e.style.height)),s=window.getComputedStyle(e,null),o="content-box"===s.boxSizing?Math.round(parseFloat(s.height)):e.offsetHeight;if(o<t?"hidden"===s.overflowY&&(c("scroll"),u(),o="content-box"===s.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==s.overflowY&&(c("hidden"),u(),o="content-box"===s.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),n!==o){n=o;var i=r("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function a(e){var t=o.get(e);t&&t.destroy()}function l(e){var t=o.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],l),e}),t.default=c,e.exports=t.default},void 0===(o="function"==typeof s?s.apply(t,n):s)||(e.exports=o)},4462:function(e,t,s){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},function(e,t){function s(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}),r=this&&this.__assign||Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var o in t=arguments[s])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i=this&&this.__rest||function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&(s[n[o]]=e[n[o]])}return s};t.__esModule=!0;var a=s(1609),l=s(5826),c=s(4306),d=s(461),u="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:d(t.textarea)})},t.onChange=function(e){var s=t.props.onChange;t.currentValue=e.currentTarget.value,s&&s(e)},t}return o(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,s=t.maxRows,n=t.async;"number"==typeof s&&this.updateLineHeight(),"number"==typeof s||n?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(u,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(u,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,s=(t.onResize,t.maxRows),n=(t.onChange,t.style),o=(t.innerRef,t.children),l=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,d=s&&c?c*s:null;return a.createElement("textarea",r({},l,{onChange:this.onChange,style:d?r({},n,{maxHeight:d}):n,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),o)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:l.number,maxRows:l.number,onResize:l.func,innerRef:l.any,async:l.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef((function(e,t){return a.createElement(p,r({},e,{innerRef:t}))}))},5215:e=>{"use strict";e.exports=function e(t,s){if(t===s)return!0;if(t&&s&&"object"==typeof t&&"object"==typeof s){if(t.constructor!==s.constructor)return!1;var n,o,r;if(Array.isArray(t)){if((n=t.length)!=s.length)return!1;for(o=n;0!=o--;)if(!e(t[o],s[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===s.toString();if((n=(r=Object.keys(t)).length)!==Object.keys(s).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(s,r[o]))return!1;for(o=n;0!=o--;){var i=r[o];if(!e(t[i],s[i]))return!1}return!0}return t!=t&&s!=s}},5826:(e,t,s)=>{e.exports=s(628)()},6109:e=>{e.exports=function(e,t,s){return((s=window.getComputedStyle)?s(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},s=Object.keys(t).join("|"),n=new RegExp(s,"g"),o=new RegExp(s,"");function r(e){return t[e]}var i=function(e){return e.replace(n,r)};e.exports=i,e.exports.has=function(e){return!!e.match(o)},e.exports.remove=i}},t={};function s(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";s.r(n),s.d(n,{AlignmentToolbar:()=>Yh,Autocomplete:()=>Zh,AutosaveMonitor:()=>Oc,BlockAlignmentToolbar:()=>qh,BlockControls:()=>Kh,BlockEdit:()=>Qh,BlockEditorKeyboardShortcuts:()=>Xh,BlockFormatControls:()=>Jh,BlockIcon:()=>eg,BlockInspector:()=>tg,BlockList:()=>sg,BlockMover:()=>ng,BlockNavigationDropdown:()=>og,BlockSelectionClearer:()=>rg,BlockSettingsMenu:()=>ig,BlockTitle:()=>ag,BlockToolbar:()=>lg,CharacterCount:()=>Oh,ColorPalette:()=>cg,ContrastChecker:()=>dg,CopyHandler:()=>ug,DefaultBlockAppender:()=>pg,DocumentBar:()=>Gc,DocumentOutline:()=>ed,DocumentOutlineCheck:()=>td,EditorHistoryRedo:()=>rd,EditorHistoryUndo:()=>id,EditorKeyboardShortcuts:()=>kl,EditorKeyboardShortcutsRegister:()=>sd,EditorNotices:()=>ld,EditorProvider:()=>Al,EditorSnackbars:()=>dd,EntitiesSavedStates:()=>yd,ErrorBoundary:()=>kd,FontSizePicker:()=>mg,InnerBlocks:()=>gg,Inserter:()=>hg,InspectorAdvancedControls:()=>_g,InspectorControls:()=>fg,LocalAutosaveMonitor:()=>Ed,MediaPlaceholder:()=>Sg,MediaUpload:()=>kg,MediaUploadCheck:()=>Cg,MultiSelectScrollIntoView:()=>Pg,NavigableToolbar:()=>jg,ObserveTyping:()=>Eg,PageAttributesCheck:()=>Td,PageAttributesOrder:()=>Nd,PageAttributesPanel:()=>Wd,PageAttributesParent:()=>zd,PageTemplate:()=>nu,PanelColorSettings:()=>bg,PlainText:()=>yg,PluginBlockSettingsMenuItem:()=>_u,PluginDocumentSettingPanel:()=>gu,PluginMoreMenuItem:()=>fu,PluginPostPublishPanel:()=>vu,PluginPostStatusInfo:()=>Cu,PluginPrePublishPanel:()=>Tu,PluginPreviewMenuItem:()=>Bu,PluginSidebar:()=>Iu,PluginSidebarMoreMenuItem:()=>Nu,PostAuthor:()=>Wu,PostAuthorCheck:()=>Zu,PostAuthorPanel:()=>qu,PostComments:()=>Qu,PostDiscussionPanel:()=>sp,PostExcerpt:()=>np,PostExcerptCheck:()=>op,PostExcerptPanel:()=>up,PostFeaturedImage:()=>wp,PostFeaturedImageCheck:()=>gp,PostFeaturedImagePanel:()=>kp,PostFormat:()=>jp,PostFormatCheck:()=>Cp,PostLastRevision:()=>Ip,PostLastRevisionCheck:()=>Ep,PostLastRevisionPanel:()=>Np,PostLockedModal:()=>Rp,PostPendingStatus:()=>Ap,PostPendingStatusCheck:()=>Dp,PostPingbacks:()=>Xu,PostPreviewButton:()=>Mp,PostPublishButton:()=>Vp,PostPublishButtonLabel:()=>Lp,PostPublishPanel:()=>Ym,PostSavedState:()=>nh,PostSchedule:()=>am,PostScheduleCheck:()=>oh,PostScheduleLabel:()=>cm,PostSchedulePanel:()=>ih,PostSticky:()=>Xm,PostStickyCheck:()=>Qm,PostSwitchToDraftButton:()=>ah,PostSyncStatus:()=>lh,PostTaxonomies:()=>dh,PostTaxonomiesCheck:()=>uh,PostTaxonomiesFlatTermSelector:()=>wm,PostTaxonomiesHierarchicalTermSelector:()=>Dm,PostTaxonomiesPanel:()=>mh,PostTemplatePanel:()=>Vu,PostTextEditor:()=>gh,PostTitle:()=>vh,PostTitleRaw:()=>wh,PostTrash:()=>kh,PostTrashCheck:()=>Sh,PostTypeSupportCheck:()=>Bd,PostURL:()=>Ch,PostURLCheck:()=>Ph,PostURLLabel:()=>jh,PostURLPanel:()=>Th,PostVisibility:()=>zp,PostVisibilityCheck:()=>Nh,PostVisibilityLabel:()=>Gp,RichText:()=>Wh,RichTextShortcut:()=>xg,RichTextToolbarButton:()=>vg,ServerSideRender:()=>zh(),SkipToSelectedBlock:()=>Tg,TableOfContents:()=>Vh,TextEditorGlobalKeyboardShortcuts:()=>$g,ThemeSupportCheck:()=>hp,TimeToRead:()=>Lh,URLInput:()=>Bg,URLInputButton:()=>Ig,URLPopover:()=>Ng,UnsavedChangesWarning:()=>Uh,VisualEditorGlobalKeyboardShortcuts:()=>Gg,Warning:()=>Rg,WordCount:()=>Ah,WritingFlow:()=>Dg,__unstableRichTextInputEvent:()=>wg,cleanForSlug:()=>Wg,createCustomColorsHOC:()=>Ag,getColorClassName:()=>Mg,getColorObjectByAttributeValues:()=>Lg,getColorObjectByColorValue:()=>Og,getFontSize:()=>Fg,getFontSizeClass:()=>Vg,getTemplatePartIcon:()=>H,mediaUpload:()=>yi,privateApis:()=>Xy,registerEntityAction:()=>Jy,registerEntityField:()=>tx,store:()=>vc,storeConfig:()=>xc,transformStyles:()=>g.transformStyles,unregisterEntityAction:()=>ex,unregisterEntityField:()=>sx,useEntitiesSavedStatesIsDirty:()=>fd,usePostScheduleLabel:()=>dm,usePostURLLabel:()=>Eh,usePostVisibilityLabel:()=>$p,userAutocompleter:()=>Sc,withColorContext:()=>Ug,withColors:()=>Hg,withFontSizes:()=>zg});var e={};s.r(e),s.d(e,{__experimentalGetDefaultTemplatePartAreas:()=>ls,__experimentalGetDefaultTemplateType:()=>cs,__experimentalGetDefaultTemplateTypes:()=>as,__experimentalGetTemplateInfo:()=>ds,__unstableIsEditorReady:()=>et,canInsertBlockType:()=>ns,canUserUseUnfilteredHTML:()=>$e,didPostSaveRequestFail:()=>Ee,didPostSaveRequestSucceed:()=>je,getActivePostLock:()=>Ge,getAdjacentBlockClientId:()=>Et,getAutosaveAttribute:()=>me,getBlock:()=>mt,getBlockAttributes:()=>pt,getBlockCount:()=>yt,getBlockHierarchyRootClientId:()=>jt,getBlockIndex:()=>Ht,getBlockInsertionPoint:()=>Xt,getBlockListSettings:()=>is,getBlockMode:()=>qt,getBlockName:()=>dt,getBlockOrder:()=>Ut,getBlockRootClientId:()=>Pt,getBlockSelectionEnd:()=>vt,getBlockSelectionStart:()=>xt,getBlocks:()=>ht,getBlocksByClientId:()=>bt,getClientIdsOfDescendants:()=>gt,getClientIdsWithDescendants:()=>_t,getCurrentPost:()=>ne,getCurrentPostAttribute:()=>de,getCurrentPostId:()=>re,getCurrentPostLastRevisionId:()=>le,getCurrentPostRevisionsCount:()=>ae,getCurrentPostType:()=>oe,getCurrentTemplateId:()=>ie,getDeviceType:()=>nt,getEditedPostAttribute:()=>pe,getEditedPostContent:()=>Re,getEditedPostPreviewLink:()=>Ie,getEditedPostSlug:()=>Le,getEditedPostVisibility:()=>he,getEditorBlocks:()=>Ze,getEditorMode:()=>it,getEditorSelection:()=>Je,getEditorSelectionEnd:()=>Xe,getEditorSelectionStart:()=>Qe,getEditorSettings:()=>tt,getFirstMultiSelectedBlockClientId:()=>Dt,getGlobalBlockCount:()=>ft,getInserterItems:()=>os,getLastMultiSelectedBlockClientId:()=>At,getMultiSelectedBlockClientIds:()=>Nt,getMultiSelectedBlocks:()=>Rt,getMultiSelectedBlocksEndClientId:()=>Vt,getMultiSelectedBlocksStartClientId:()=>Ft,getNextBlockClientId:()=>Bt,getPermalink:()=>Me,getPermalinkParts:()=>Oe,getPostEdits:()=>ce,getPostLockUser:()=>ze,getPostTypeLabel:()=>us,getPreviousBlockClientId:()=>Tt,getRenderingMode:()=>st,getSelectedBlock:()=>Ct,getSelectedBlockClientId:()=>kt,getSelectedBlockCount:()=>wt,getSelectedBlocksInitialCaretPosition:()=>It,getStateBeforeOptimisticTransaction:()=>at,getSuggestedPostFormat:()=>Ne,getTemplate:()=>ts,getTemplateLock:()=>ss,hasChangedContent:()=>J,hasEditorRedo:()=>Q,hasEditorUndo:()=>K,hasInserterItems:()=>rs,hasMultiSelection:()=>Wt,hasNonPostEntityChanges:()=>te,hasSelectedBlock:()=>St,hasSelectedInnerBlock:()=>Gt,inSomeHistory:()=>lt,isAncestorMultiSelected:()=>Ot,isAutosavingPost:()=>Te,isBlockInsertionPointVisible:()=>Jt,isBlockMultiSelected:()=>Lt,isBlockSelected:()=>zt,isBlockValid:()=>ut,isBlockWithinSelection:()=>$t,isCaretWithinFormattedText:()=>Qt,isCleanNewPost:()=>se,isCurrentPostPending:()=>ge,isCurrentPostPublished:()=>_e,isCurrentPostScheduled:()=>fe,isDeletingPost:()=>ke,isEditedPostAutosaveable:()=>ve,isEditedPostBeingScheduled:()=>we,isEditedPostDateFloating:()=>Se,isEditedPostDirty:()=>ee,isEditedPostEmpty:()=>xe,isEditedPostNew:()=>X,isEditedPostPublishable:()=>be,isEditedPostSaveable:()=>ye,isEditorPanelEnabled:()=>qe,isEditorPanelOpened:()=>Ke,isEditorPanelRemoved:()=>Ye,isFirstMultiSelectedBlock:()=>Mt,isInserterOpened:()=>rt,isListViewOpened:()=>ot,isMultiSelecting:()=>Zt,isPermalinkEditable:()=>Ae,isPostAutosavingLocked:()=>Ue,isPostLockTakeover:()=>He,isPostLocked:()=>Fe,isPostSavingLocked:()=>Ve,isPreviewingPost:()=>Be,isPublishSidebarEnabled:()=>We,isPublishSidebarOpened:()=>ps,isPublishingPost:()=>De,isSavingNonPostEntityChanges:()=>Pe,isSavingPost:()=>Ce,isSelectionEnabled:()=>Yt,isTyping:()=>Kt,isValidTemplate:()=>es});var t={};s.r(t),s.d(t,{__experimentalTearDownEditor:()=>vs,__unstableSaveForPreview:()=>Is,autosave:()=>Bs,clearSelectedBlock:()=>hn,closePublishSidebar:()=>sn,createUndoLevel:()=>Ds,disablePublishSidebar:()=>Ls,editPost:()=>Ps,enablePublishSidebar:()=>Ms,enterFormattedText:()=>Rn,exitFormattedText:()=>Dn,hideInsertionPoint:()=>kn,insertBlock:()=>vn,insertBlocks:()=>wn,insertDefaultBlock:()=>An,lockPostAutosaving:()=>Vs,lockPostSaving:()=>Os,mergeBlocks:()=>jn,moveBlockToPosition:()=>xn,moveBlocksDown:()=>bn,moveBlocksUp:()=>yn,multiSelect:()=>mn,openPublishSidebar:()=>tn,receiveBlocks:()=>an,redo:()=>Ns,refreshPost:()=>Es,removeBlock:()=>Tn,removeBlocks:()=>En,removeEditorPanel:()=>Ys,replaceBlock:()=>fn,replaceBlocks:()=>_n,resetBlocks:()=>rn,resetEditorBlocks:()=>Hs,resetPost:()=>ws,savePost:()=>js,selectBlock:()=>dn,setDeviceType:()=>$s,setEditedPost:()=>Cs,setIsInserterOpened:()=>qs,setIsListViewOpened:()=>Ks,setRenderingMode:()=>Gs,setTemplateValidity:()=>Cn,setupEditor:()=>xs,setupEditorState:()=>ks,showInsertionPoint:()=>Sn,startMultiSelect:()=>un,startTyping:()=>In,stopMultiSelect:()=>pn,stopTyping:()=>Nn,switchEditorMode:()=>en,synchronizeTemplate:()=>Pn,toggleBlockMode:()=>Bn,toggleDistractionFree:()=>Qs,toggleEditorPanelEnabled:()=>Ws,toggleEditorPanelOpened:()=>Zs,togglePublishSidebar:()=>nn,toggleSelection:()=>gn,toggleSpotlightMode:()=>Xs,toggleTopToolbar:()=>Js,trashPost:()=>Ts,undo:()=>Rs,unlockPostAutosaving:()=>Us,unlockPostSaving:()=>Fs,updateBlock:()=>ln,updateBlockAttributes:()=>cn,updateBlockListSettings:()=>Mn,updateEditorSettings:()=>zs,updatePost:()=>Ss,updatePostLock:()=>As});var o={};s.r(o),s.d(o,{closeModal:()=>xa,disableComplementaryArea:()=>ma,enableComplementaryArea:()=>pa,openModal:()=>ya,pinItem:()=>ha,setDefaultComplementaryArea:()=>ua,setFeatureDefaults:()=>ba,setFeatureValue:()=>fa,toggleFeature:()=>_a,unpinItem:()=>ga});var r={};s.r(r),s.d(r,{getActiveComplementaryArea:()=>va,isComplementaryAreaLoading:()=>wa,isFeatureActive:()=>ka,isItemPinned:()=>Sa,isModalActive:()=>Ca});var i={};s.r(i),s.d(i,{ActionItem:()=>Na,ComplementaryArea:()=>Va,ComplementaryAreaMoreMenuItem:()=>Da,FullscreenMode:()=>Ua,InterfaceSkeleton:()=>Wa,PinnedItems:()=>Ma,store:()=>ja});var a={};s.r(a),s.d(a,{createTemplate:()=>Zl,hideBlockTypes:()=>ql,registerEntityAction:()=>Vl,registerEntityField:()=>Hl,registerPostTypeSchema:()=>$l,removeTemplates:()=>Xl,revertTemplate:()=>Ql,saveDirtyEntities:()=>Kl,setCanvasMinHeight:()=>ec,setCurrentTemplateId:()=>Wl,setDefaultRenderingMode:()=>Jl,setIsReady:()=>Gl,showBlockTypes:()=>Yl,unregisterEntityAction:()=>Ul,unregisterEntityField:()=>zl});var l={};s.r(l),s.d(l,{getCanvasMinHeight:()=>yc,getDefaultRenderingMode:()=>bc,getEntityActions:()=>hc,getEntityFields:()=>_c,getInserter:()=>lc,getInserterSidebarToggleRef:()=>dc,getListViewToggleRef:()=>cc,getPostBlocksByName:()=>fc,getPostIcon:()=>pc,hasPostMetaChanges:()=>mc,isEntityReady:()=>gc});const c=window.ReactJSXRuntime,d=window.wp.data,u=window.wp.coreData,p=window.wp.element,m=window.wp.compose,h=window.wp.hooks,g=window.wp.blockEditor,_={...g.SETTINGS_DEFAULTS,richEditingEnabled:!0,codeEditingEnabled:!0,fontLibraryEnabled:!0,enableCustomFields:void 0,defaultRenderingMode:"post-only"};var f=(0,d.combineReducers)({actions:function(e={},t){switch(t.type){case"REGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_ACTION":return{...e,[t.kind]:{...e[t.kind],[t.name]:(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.actionId))}}}return e},fields:function(e={},t){switch(t.type){case"REGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:[...(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.config.id)),t.config]}};case"UNREGISTER_ENTITY_FIELD":return{...e,[t.kind]:{...e[t.kind],[t.name]:(e[t.kind]?.[t.name]??[]).filter((e=>e.id!==t.fieldId))}}}return e},isReady:function(e={},t){return"SET_IS_READY"===t.type?{...e,[t.kind]:{...e[t.kind],[t.name]:!0}}:e}});function b(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}var y=(0,d.combineReducers)({postId:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postId:e},postType:function(e=null,t){return"SET_EDITED_POST"===t.type?t.postType:e},templateId:function(e=null,t){return"SET_CURRENT_TEMPLATE_ID"===t.type?t.id:e},saving:function(e={},t){switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:"REQUEST_POST_UPDATE_START"===t.type,options:t.options||{}}}return e},deleting:function(e={},t){switch(t.type){case"REQUEST_POST_DELETE_START":case"REQUEST_POST_DELETE_FINISH":return{pending:"REQUEST_POST_DELETE_START"===t.type}}return e},postLock:function(e={isLocked:!1},t){return"UPDATE_POST_LOCK"===t.type?t.lock:e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},postSavingLock:function(e={},t){switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":{const{[t.lockName]:s,...n}=e;return n}}return e},editorSettings:function(e=_,t){return"UPDATE_EDITOR_SETTINGS"===t.type?{...e,...t.settings}:e},postAutosavingLock:function(e={},t){switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":{const{[t.lockName]:s,...n}=e;return n}}return e},renderingMode:function(e="post-only",t){return"SET_RENDERING_MODE"===t.type?t.mode:e},deviceType:function(e="Desktop",t){return"SET_DEVICE_TYPE"===t.type?t.deviceType:e},removedPanels:function(e=[],t){if("REMOVE_PANEL"===t.type)if(!e.includes(t.panelName))return[...e,t.panelName];return e},blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},inserterSidebarToggleRef:function(e={current:null}){return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},listViewToggleRef:function(e={current:null}){return e},publishSidebarActive:function(e=!1,t){switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e},canvasMinHeight:function(e=0,t){return"SET_CANVAS_MIN_HEIGHT"===t.type?t.minHeight:e},dataviews:f});const x=window.wp.blocks,v=window.wp.date,w=window.wp.url,S=window.wp.deprecated;var k=s.n(S);const C=window.wp.preferences,P=new Set(["meta"]),j=/%(?:postname|pagename)%/,E=6e4,T=["title","excerpt","content"],B="wp_template",I="wp_template_part",N="wp_block",R="wp_navigation",D="custom",A=["wp_template","wp_template_part"],M=[...A,"wp_block","wp_navigation"],L=window.wp.primitives;var O=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),F=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",d:"M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),V=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),U=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});function H(e){return"header"===e?O:"footer"===e?F:"sidebar"===e?V:U}const z=window.wp.privateApis,{lock:G,unlock:$}=(0,z.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/editor");var W=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})});const Z={},Y=e=>{if(!e)return Z;const{templateTypes:t,templateAreas:s,template:n}=e,{description:o,slug:r,title:i,area:a}=n,{title:l,description:c}=Object.values(t).find((e=>e.slug===r))??Z,d="string"==typeof i?i:i?.rendered,u="string"==typeof o?o:o?.raw,p=s?.map((e=>({...e,icon:H(e.icon)}))),m=p?.find((e=>a===e.area))?.icon||W;return{title:d&&d!==r?d:l||r,description:u||c,icon:m}},q={},K=(0,d.createRegistrySelector)((e=>()=>e(u.store).hasUndo())),Q=(0,d.createRegistrySelector)((e=>()=>e(u.store).hasRedo()));function X(e){return"auto-draft"===ne(e).status}function J(e){return"content"in ce(e)}const ee=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return e(u.store).hasEditsForEntityRecord("postType",s,n)})),te=(0,d.createRegistrySelector)((e=>t=>{const s=e(u.store).__experimentalGetDirtyEntityRecords(),{type:n,id:o}=ne(t);return s.some((e=>"postType"!==e.kind||e.name!==n||e.key!==o))}));function se(e){return!ee(e)&&X(e)}const ne=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),n=oe(t),o=e(u.store).getRawEntityRecord("postType",n,s);return o||q}));function oe(e){return e.postType}function re(e){return e.postId}function ie(e){return e.templateId}function ae(e){return ne(e)._links?.["version-history"]?.[0]?.count??0}function le(e){return ne(e)._links?.["predecessor-version"]?.[0]?.id??null}const ce=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return e(u.store).getEntityRecordEdits("postType",s,n)||q}));function de(e,t){switch(t){case"type":return oe(e);case"id":return re(e);default:const s=ne(e);if(!s.hasOwnProperty(t))break;return b(s[t])}}const ue=(0,d.createSelector)(((e,t)=>{const s=ce(e);return s.hasOwnProperty(t)?{...de(e,t),...s[t]}:de(e,t)}),((e,t)=>[de(e,t),ce(e)[t]]));function pe(e,t){if("content"===t)return Re(e);const s=ce(e);return s.hasOwnProperty(t)?P.has(t)?ue(e,t):s[t]:de(e,t)}const me=(0,d.createRegistrySelector)((e=>(t,s)=>{if(!T.includes(s)&&"preview_link"!==s)return;const n=oe(t);if("wp_template"===n)return!1;const o=re(t),r=e(u.store).getCurrentUser()?.id,i=e(u.store).getAutosave(n,o,r);return i?b(i[s]):void 0}));function he(e){if("private"===pe(e,"status"))return"private";return pe(e,"password")?"password":"public"}function ge(e){return"pending"===ne(e).status}function _e(e,t){const s=t||ne(e);return-1!==["publish","private"].indexOf(s.status)||"future"===s.status&&!(0,v.isInTheFuture)(new Date(Number((0,v.getDate)(s.date))-E))}function fe(e){return"future"===ne(e).status&&!_e(e)}function be(e){const t=ne(e);return ee(e)||-1===["publish","private","future"].indexOf(t.status)}function ye(e){return!Ce(e)&&(!!pe(e,"title")||!!pe(e,"excerpt")||!xe(e)||"native"===p.Platform.OS)}const xe=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),n=oe(t),o=e(u.store).getEditedEntityRecord("postType",n,s);if("function"!=typeof o.content)return!o.content;const r=pe(t,"blocks");if(0===r.length)return!0;if(r.length>1)return!1;const i=r[0].name;return(i===(0,x.getDefaultBlockName)()||i===(0,x.getFreeformContentHandlerName)())&&!Re(t)})),ve=(0,d.createRegistrySelector)((e=>t=>{if(!ye(t))return!1;if(Ue(t))return!1;const s=oe(t),n=e(u.store).getPostType(s);if("wp_template"===s||!n?.supports?.autosave)return!1;const o=re(t),r=e(u.store).hasFetchedAutosaves(s,o),i=e(u.store).getCurrentUser()?.id,a=e(u.store).getAutosave(s,o,i);return!!r&&(!a||(!!J(t)||["title","excerpt","meta"].some((e=>b(a[e])!==pe(t,e)))))}));function we(e){const t=pe(e,"date"),s=new Date(Number((0,v.getDate)(t))-E);return(0,v.isInTheFuture)(s)}function Se(e){const t=pe(e,"date"),s=pe(e,"modified"),n=ne(e).status;return("draft"===n||"auto-draft"===n||"pending"===n)&&(t===s||null===t)}function ke(e){return!!e.deleting.pending}function Ce(e){return!!e.saving.pending}const Pe=(0,d.createRegistrySelector)((e=>t=>{const s=e(u.store).__experimentalGetEntitiesBeingSaved(),{type:n,id:o}=ne(t);return s.some((e=>"postType"!==e.kind||e.name!==n||e.key!==o))})),je=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return!e(u.store).getLastEntitySaveError("postType",s,n)})),Ee=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=re(t);return!!e(u.store).getLastEntitySaveError("postType",s,n)}));function Te(e){return Ce(e)&&Boolean(e.saving.options?.isAutosave)}function Be(e){return Ce(e)&&Boolean(e.saving.options?.isPreview)}function Ie(e){if(e.saving.pending||Ce(e))return;let t=me(e,"preview_link");t&&"draft"!==ne(e).status||(t=pe(e,"link"),t&&(t=(0,w.addQueryArgs)(t,{preview:!0})));const s=pe(e,"featured_media");return t&&s?(0,w.addQueryArgs)(t,{_thumbnail_id:s}):t}const Ne=(0,d.createRegistrySelector)((e=>()=>{const t=e(g.store).getBlocks();if(t.length>2)return null;let s;if(1===t.length&&(s=t[0].name,"core/embed"===s)){const e=t[0].attributes?.providerNameSlug;["youtube","vimeo"].includes(e)?s="core/video":["spotify","soundcloud"].includes(e)&&(s="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(s=t[0].name),s){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}})),Re=(0,d.createRegistrySelector)((e=>t=>{const s=re(t),n=oe(t),o=e(u.store).getEditedEntityRecord("postType",n,s);if(o){if("function"==typeof o.content)return o.content(o);if(o.blocks)return(0,x.__unstableSerializeAndClean)(o.blocks);if(o.content)return o.content}return""}));function De(e){return Ce(e)&&!_e(e)&&"publish"===pe(e,"status")}function Ae(e){const t=pe(e,"permalink_template");return j.test(t)}function Me(e){const t=Oe(e);if(!t)return null;const{prefix:s,postName:n,suffix:o}=t;return Ae(e)?s+n+o:s}function Le(e){return pe(e,"slug")||(0,w.cleanForSlug)(pe(e,"title"))||re(e)}function Oe(e){const t=pe(e,"permalink_template");if(!t)return null;const s=pe(e,"slug")||pe(e,"generated_slug"),[n,o]=t.split(j);return{prefix:n,postName:s,suffix:o}}function Fe(e){return e.postLock.isLocked}function Ve(e){return Object.keys(e.postSavingLock).length>0}function Ue(e){return Object.keys(e.postAutosavingLock).length>0}function He(e){return e.postLock.isTakeover}function ze(e){return e.postLock.user}function Ge(e){return e.postLock.activePostLock}function $e(e){return Boolean(ne(e)._links?.hasOwnProperty("wp:action-unfiltered-html"))}const We=(0,d.createRegistrySelector)((e=>()=>!!e(C.store).get("core","isPublishSidebarEnabled"))),Ze=(0,d.createSelector)((e=>pe(e,"blocks")||(0,x.parse)(Re(e))),(e=>[pe(e,"blocks"),Re(e)]));function Ye(e,t){return e.removedPanels.includes(t)}const qe=(0,d.createRegistrySelector)((e=>(t,s)=>{const n=e(C.store).get("core","inactivePanels");return!Ye(t,s)&&!n?.includes(s)})),Ke=(0,d.createRegistrySelector)((e=>(t,s)=>{const n=e(C.store).get("core","openPanels");return!!n?.includes(s)}));function Qe(e){return k()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),pe(e,"selection")?.selectionStart}function Xe(e){return k()("select('core/editor').getEditorSelectionStart",{since:"5.8",alternative:"select('core/editor').getEditorSelection"}),pe(e,"selection")?.selectionEnd}function Je(e){return pe(e,"selection")}function et(e){return!!e.postId}function tt(e){return e.editorSettings}function st(e){return e.renderingMode}const nt=(0,d.createRegistrySelector)((e=>t=>$(e(g.store)).isZoomOut()?"Desktop":t.deviceType));function ot(e){return e.listViewPanel}function rt(e){return!!e.blockInserterPanel}const it=(0,d.createRegistrySelector)((e=>()=>e(C.store).get("core","editorMode")??"visual"));function at(){return k()("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function lt(){return k()("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function ct(e){return(0,d.createRegistrySelector)((t=>(s,...n)=>(k()("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`",version:"6.2"}),t(g.store)[e](...n))))}const dt=ct("getBlockName"),ut=ct("isBlockValid"),pt=ct("getBlockAttributes"),mt=ct("getBlock"),ht=ct("getBlocks"),gt=ct("getClientIdsOfDescendants"),_t=ct("getClientIdsWithDescendants"),ft=ct("getGlobalBlockCount"),bt=ct("getBlocksByClientId"),yt=ct("getBlockCount"),xt=ct("getBlockSelectionStart"),vt=ct("getBlockSelectionEnd"),wt=ct("getSelectedBlockCount"),St=ct("hasSelectedBlock"),kt=ct("getSelectedBlockClientId"),Ct=ct("getSelectedBlock"),Pt=ct("getBlockRootClientId"),jt=ct("getBlockHierarchyRootClientId"),Et=ct("getAdjacentBlockClientId"),Tt=ct("getPreviousBlockClientId"),Bt=ct("getNextBlockClientId"),It=ct("getSelectedBlocksInitialCaretPosition"),Nt=ct("getMultiSelectedBlockClientIds"),Rt=ct("getMultiSelectedBlocks"),Dt=ct("getFirstMultiSelectedBlockClientId"),At=ct("getLastMultiSelectedBlockClientId"),Mt=ct("isFirstMultiSelectedBlock"),Lt=ct("isBlockMultiSelected"),Ot=ct("isAncestorMultiSelected"),Ft=ct("getMultiSelectedBlocksStartClientId"),Vt=ct("getMultiSelectedBlocksEndClientId"),Ut=ct("getBlockOrder"),Ht=ct("getBlockIndex"),zt=ct("isBlockSelected"),Gt=ct("hasSelectedInnerBlock"),$t=ct("isBlockWithinSelection"),Wt=ct("hasMultiSelection"),Zt=ct("isMultiSelecting"),Yt=ct("isSelectionEnabled"),qt=ct("getBlockMode"),Kt=ct("isTyping"),Qt=ct("isCaretWithinFormattedText"),Xt=ct("getBlockInsertionPoint"),Jt=ct("isBlockInsertionPointVisible"),es=ct("isValidTemplate"),ts=ct("getTemplate"),ss=ct("getTemplateLock"),ns=ct("canInsertBlockType"),os=ct("getInserterItems"),rs=ct("hasInserterItems"),is=ct("getBlockListSettings"),as=(0,d.createRegistrySelector)((e=>()=>(k()("select('core/editor').__experimentalGetDefaultTemplateTypes",{since:"6.8",alternative:"select('core/core-data').getCurrentTheme()?.default_template_types"}),e(u.store).getCurrentTheme()?.default_template_types))),ls=(0,d.createRegistrySelector)((e=>(0,d.createSelector)((()=>{k()("select('core/editor').__experimentalGetDefaultTemplatePartAreas",{since:"6.8",alternative:"select('core/core-data').getCurrentTheme()?.default_template_part_areas"});return(e(u.store).getCurrentTheme()?.default_template_part_areas||[]).map((e=>({...e,icon:H(e.icon)})))})))),cs=(0,d.createRegistrySelector)((e=>(0,d.createSelector)(((t,s)=>{k()("select('core/editor').__experimentalGetDefaultTemplateType",{since:"6.8"});const n=e(u.store).getCurrentTheme()?.default_template_types;return n?Object.values(n).find((e=>e.slug===s))??q:q})))),ds=(0,d.createRegistrySelector)((e=>(0,d.createSelector)(((t,s)=>{if(k()("select('core/editor').__experimentalGetTemplateInfo",{since:"6.8"}),!s)return q;const n=e(u.store).getCurrentTheme(),o=n?.default_template_types||[];return Y({template:s,templateAreas:n?.default_template_part_areas||[],templateTypes:o})})))),us=(0,d.createRegistrySelector)((e=>t=>{const s=oe(t),n=e(u.store).getPostType(s);return n?.labels?.singular_name}));function ps(e){return e.publishSidebarActive}const ms=window.wp.a11y,hs=window.wp.apiFetch;var gs=s.n(hs);const _s=window.wp.notices,fs=window.wp.i18n;function bs(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}function ys(e,t){window.sessionStorage.removeItem(bs(e,t))}const xs=(e,t,s)=>({dispatch:n})=>{n.setEditedPost(e.type,e.id);if("auto-draft"===e.status&&s){let o;o="content"in t?t.content:e.content.raw;let r=(0,x.parse)(o);r=(0,x.synchronizeBlocksWithTemplate)(r,s),n.resetEditorBlocks(r,{__unstableShouldCreateUndoLevel:!1})}t&&Object.values(t).some((([t,s])=>s!==(e[t]?.raw??e[t])))&&n.editPost(t)};function vs(){return k()("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function ws(){return k()("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function Ss(){return k()("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function ks(e){return k()("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),Cs(e.type,e.id)}function Cs(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}const Ps=(e,t)=>({select:s,registry:n})=>{const{id:o,type:r}=s.getCurrentPost();n.dispatch(u.store).editEntityRecord("postType",r,o,e,t)},js=(e={})=>async({select:t,dispatch:s,registry:n})=>{if(!t.isEditedPostSaveable())return;const o=t.getEditedPostContent();e.isAutosave||s.editPost({content:o},{undoIgnore:!0});const r=t.getCurrentPost();let i={id:r.id,...n.select(u.store).getEntityRecordNonTransientEdits("postType",r.type,r.id),content:o};s({type:"REQUEST_POST_UPDATE_START",options:e});let a=!1;try{i=await(0,h.applyFiltersAsync)("editor.preSavePost",i,e)}catch(e){a=e}if(!a)try{await n.dispatch(u.store).saveEntityRecord("postType",r.type,i,e)}catch(e){a=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while updating.")}if(a||(a=n.select(u.store).getLastEntitySaveError("postType",r.type,r.id)),!a)try{await(0,h.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e)}catch(e){a=e}if(!a)try{await(0,h.doActionAsync)("editor.savePost",{id:r.id},e)}catch(e){a=e}if(s({type:"REQUEST_POST_UPDATE_FINISH",options:e}),a){const e=function(e){const{post:t,edits:s,error:n}=e;if(n&&"rest_autosave_no_changes"===n.code)return[];const o=-1!==["publish","private","future"].indexOf(t.status);if("offline_error"===n.code){const e={publish:(0,fs.__)("Publishing failed because you were offline."),private:(0,fs.__)("Publishing failed because you were offline."),future:(0,fs.__)("Scheduling failed because you were offline."),default:(0,fs.__)("Updating failed because you were offline.")};return[!o&&s.status in e?e[s.status]:e.default,{id:"editor-save"}]}const r={publish:(0,fs.__)("Publishing failed."),private:(0,fs.__)("Publishing failed."),future:(0,fs.__)("Scheduling failed."),default:(0,fs.__)("Updating failed.")};let i=!o&&s.status in r?r[s.status]:r.default;return n.message&&!/<\/?[^>]*>/.test(n.message)&&(i=[i,n.message].join(" ")),[i,{id:"editor-save"}]}({post:r,edits:i,error:a});e.length&&n.dispatch(_s.store).createErrorNotice(...e)}else{const s=t.getCurrentPost(),o=function(e){const{previousPost:t,post:s,postType:n}=e;if(e.options?.isAutosave)return[];const o=["publish","private","future"],r=o.includes(t.status),i=o.includes(s.status),a="trash"===s.status&&"trash"!==t.status;let l,c,d=n?.viewable??!1;a?(l=n.labels.item_trashed,d=!1):r||i?r&&!i?(l=n.labels.item_reverted_to_draft,d=!1):l=!r&&i?{publish:n.labels.item_published,private:n.labels.item_published_privately,future:n.labels.item_scheduled}[s.status]:n.labels.item_updated:(l=(0,fs.__)("Draft saved."),c=!0);const u=[];return d&&u.push({label:c?(0,fs.__)("View Preview"):n.labels.view_item,url:s.link,openInNewTab:!0}),[l,{id:"editor-save",type:"snackbar",actions:u}]}({previousPost:r,post:s,postType:await n.resolveSelect(u.store).getPostType(s.type),options:e});o.length&&n.dispatch(_s.store).createSuccessNotice(...o),e.isAutosave||n.dispatch(g.store).__unstableMarkLastChangeAsPersistent()}};function Es(){return k()("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}const Ts=()=>async({select:e,dispatch:t,registry:s})=>{const n=e.getCurrentPostType(),o=await s.resolveSelect(u.store).getPostType(n),{rest_base:r,rest_namespace:i="wp/v2"}=o;t({type:"REQUEST_POST_DELETE_START"});try{const s=e.getCurrentPost();await gs()({path:`/${i}/${r}/${s.id}`,method:"DELETE"}),await t.savePost()}catch(e){s.dispatch(_s.store).createErrorNotice(...(a={error:e},[a.error.message&&"unknown_error"!==a.error.code?a.error.message:(0,fs.__)("Trashing failed"),{id:"editor-trash-fail"}]))}var a;t({type:"REQUEST_POST_DELETE_FINISH"})},Bs=({local:e=!1,...t}={})=>async({select:s,dispatch:n})=>{const o=s.getCurrentPost();if("wp_template"!==o.type)if(e){const e=s.isEditedPostNew(),t=s.getEditedPostAttribute("title"),n=s.getEditedPostAttribute("content"),r=s.getEditedPostAttribute("excerpt");!function(e,t,s,n,o){window.sessionStorage.setItem(bs(e,t),JSON.stringify({post_title:s,content:n,excerpt:o}))}(o.id,e,t,n,r)}else await n.savePost({isAutosave:!0,...t})},Is=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:s})=>{if((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()){["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await s.savePost({isPreview:!0}):await s.autosave({isPreview:!0})}return t.getEditedPostPreviewLink()},Ns=()=>({registry:e})=>{e.dispatch(u.store).redo()},Rs=()=>({registry:e})=>{e.dispatch(u.store).undo()};function Ds(){return k()("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function As(e){return{type:"UPDATE_POST_LOCK",lock:e}}const Ms=()=>({registry:e})=>{e.dispatch(C.store).set("core","isPublishSidebarEnabled",!0)},Ls=()=>({registry:e})=>{e.dispatch(C.store).set("core","isPublishSidebarEnabled",!1)};function Os(e){return{type:"LOCK_POST_SAVING",lockName:e}}function Fs(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function Vs(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function Us(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}const Hs=(e,t={})=>({select:s,dispatch:n,registry:o})=>{const{__unstableShouldCreateUndoLevel:r,selection:i}=t,a={blocks:e,selection:i};if(!1!==r){const{id:e,type:t}=s.getCurrentPost();if(o.select(u.store).getEditedEntityRecord("postType",t,e).blocks===a.blocks)return void o.dispatch(u.store).__unstableCreateUndoLevel("postType",t,e);a.content=({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e)}n.editPost(a)};function zs(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const Gs=e=>({dispatch:t,registry:s,select:n})=>{n.__unstableIsEditorReady()&&(s.dispatch(g.store).clearSelectedBlock(),t.editPost({selection:void 0},{undoIgnore:!0})),t({type:"SET_RENDERING_MODE",mode:e})};function $s(e){return{type:"SET_DEVICE_TYPE",deviceType:e}}const Ws=e=>({registry:t})=>{const s=t.select(C.store).get("core","inactivePanels")??[];let n;n=!!s?.includes(e)?s.filter((t=>t!==e)):[...s,e],t.dispatch(C.store).set("core","inactivePanels",n)},Zs=e=>({registry:t})=>{const s=t.select(C.store).get("core","openPanels")??[];let n;n=!!s?.includes(e)?s.filter((t=>t!==e)):[...s,e],t.dispatch(C.store).set("core","openPanels",n)};function Ys(e){return{type:"REMOVE_PANEL",panelName:e}}const qs=e=>({dispatch:t,registry:s})=>{"object"==typeof e&&e.hasOwnProperty("rootClientId")&&e.hasOwnProperty("insertionIndex")&&$(s.dispatch(g.store)).setInsertionPoint({rootClientId:e.rootClientId,index:e.insertionIndex}),t({type:"SET_IS_INSERTER_OPENED",value:e})};function Ks(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Qs=({createNotice:e=!0}={})=>({dispatch:t,registry:s})=>{const n=s.select(C.store).get("core","distractionFree");n&&s.dispatch(C.store).set("core","fixedToolbar",!1),n||s.batch((()=>{s.dispatch(C.store).set("core","fixedToolbar",!0),t.setIsInserterOpened(!1),t.setIsListViewOpened(!1),$(s.dispatch(g.store)).resetZoomLevel()})),s.batch((()=>{s.dispatch(C.store).set("core","distractionFree",!n),e&&s.dispatch(_s.store).createInfoNotice(n?(0,fs.__)("Distraction free mode deactivated."):(0,fs.__)("Distraction free mode activated."),{id:"core/editor/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{s.batch((()=>{s.dispatch(C.store).set("core","fixedToolbar",n),s.dispatch(C.store).toggle("core","distractionFree")}))}}]})}))},Xs=()=>({registry:e})=>{e.dispatch(C.store).toggle("core","focusMode");const t=e.select(C.store).get("core","focusMode");e.dispatch(_s.store).createInfoNotice(t?(0,fs.__)("Spotlight mode activated."):(0,fs.__)("Spotlight mode deactivated."),{id:"core/editor/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{e.dispatch(C.store).toggle("core","focusMode")}}]})},Js=()=>({registry:e})=>{e.dispatch(C.store).toggle("core","fixedToolbar");const t=e.select(C.store).get("core","fixedToolbar");e.dispatch(_s.store).createInfoNotice(t?(0,fs.__)("Top toolbar activated."):(0,fs.__)("Top toolbar deactivated."),{id:"core/editor/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,fs.__)("Undo"),onClick:()=>{e.dispatch(C.store).toggle("core","fixedToolbar")}}]})},en=e=>({dispatch:t,registry:s})=>{if(s.dispatch(C.store).set("core","editorMode",e),"visual"!==e&&(s.dispatch(g.store).clearSelectedBlock(),$(s.dispatch(g.store)).resetZoomLevel()),"visual"===e)(0,ms.speak)((0,fs.__)("Visual editor selected"),"assertive");else if("text"===e){s.select(C.store).get("core","distractionFree")&&t.toggleDistractionFree(),(0,ms.speak)((0,fs.__)("Code editor selected"),"assertive")}};function tn(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function sn(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function nn(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const on=e=>(...t)=>({registry:s})=>{k()("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),s.dispatch(g.store)[e](...t)},rn=on("resetBlocks"),an=on("receiveBlocks"),ln=on("updateBlock"),cn=on("updateBlockAttributes"),dn=on("selectBlock"),un=on("startMultiSelect"),pn=on("stopMultiSelect"),mn=on("multiSelect"),hn=on("clearSelectedBlock"),gn=on("toggleSelection"),_n=on("replaceBlocks"),fn=on("replaceBlock"),bn=on("moveBlocksDown"),yn=on("moveBlocksUp"),xn=on("moveBlockToPosition"),vn=on("insertBlock"),wn=on("insertBlocks"),Sn=on("showInsertionPoint"),kn=on("hideInsertionPoint"),Cn=on("setTemplateValidity"),Pn=on("synchronizeTemplate"),jn=on("mergeBlocks"),En=on("removeBlocks"),Tn=on("removeBlock"),Bn=on("toggleBlockMode"),In=on("startTyping"),Nn=on("stopTyping"),Rn=on("enterFormattedText"),Dn=on("exitFormattedText"),An=on("insertDefaultBlock"),Mn=on("updateBlockListSettings"),Ln=window.wp.htmlEntities;function On(e){return!!e&&(e.source===D&&(Boolean(e?.plugin)||e?.has_theme_file))}var Fn=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});var Vn={id:"view-post",label:(0,fs._x)("View","verb"),isPrimary:!0,icon:Fn,isEligible:e=>"trash"!==e.status,callback(e,{onActionPerformed:t}){const s=e[0];window.open(s?.link,"_blank"),t&&t(e)}};var Un={id:"view-post-revisions",context:"list",label(e){const t=e[0]._links?.["version-history"]?.[0]?.count??0;return(0,fs.sprintf)((0,fs.__)("View revisions (%d)"),t)},isEligible(e){if("trash"===e.status)return!1;return!!(e?._links?.["predecessor-version"]?.[0]?.id??null)&&(e?._links?.["version-history"]?.[0]?.count??0)>1},callback(e,{onActionPerformed:t}){const s=e[0],n=(0,w.addQueryArgs)("revision.php",{revision:s?._links?.["predecessor-version"]?.[0]?.id});document.location.href=n,t&&t(e)}};const Hn=window.wp.components;var zn=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})});var Gn=function(){return Gn=Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++)for(var o in t=arguments[s])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Gn.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function $n(e){return e.toLowerCase()}var Wn=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Zn=/[^A-Z0-9]+/gi;function Yn(e,t,s){return t instanceof RegExp?e.replace(t,s):t.reduce((function(e,t){return e.replace(t,s)}),e)}function qn(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var s=t.splitRegexp,n=void 0===s?Wn:s,o=t.stripRegexp,r=void 0===o?Zn:o,i=t.transform,a=void 0===i?$n:i,l=t.delimiter,c=void 0===l?" ":l,d=Yn(Yn(e,n,"$1\0$2"),r,"\0"),u=0,p=d.length;"\0"===d.charAt(u);)u++;for(;"\0"===d.charAt(p-1);)p--;return d.slice(u,p).split("\0").map(a).join(c)}(e,Gn({delimiter:"."},t))}function Kn(e,t){return void 0===t&&(t={}),qn(e,Gn({delimiter:"-"},t))}function Qn(e,t){return`fields-create-template-part-modal__area-option-${e}-${t}`}function Xn(e,t){return`fields-create-template-part-modal__area-option-description-${e}-${t}`}function Jn({modalTitle:e,...t}){const s=(0,d.useSelect)((e=>e(u.store).getPostType("wp_template_part")?.labels?.add_new_item),[]);return(0,c.jsx)(Hn.Modal,{title:e||s,onRequestClose:t.closeModal,overlayClassName:"fields-create-template-part-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,c.jsx)(to,{...t})})}const eo=e=>"header"===e?O:"footer"===e?F:"sidebar"===e?V:U;function to({defaultArea:e="uncategorized",blocks:t=[],confirmLabel:s=(0,fs.__)("Add"),closeModal:n,onCreate:o,onError:r,defaultTitle:i=""}){const{createErrorNotice:a}=(0,d.useDispatch)(_s.store),{saveEntityRecord:l}=(0,d.useDispatch)(u.store),h=(0,d.useSelect)((e=>e(u.store).getEntityRecords("postType","wp_template_part",{per_page:-1})),[])??[],[g,_]=(0,p.useState)(i),[f,b]=(0,p.useState)(e),[y,v]=(0,p.useState)(!1),w=(0,m.useInstanceId)(Jn),S=(0,d.useSelect)((e=>e(u.store).getCurrentTheme()?.default_template_part_areas),[]);async function k(){if(g&&!y)try{v(!0);const e=((e,t)=>{const s=e.toLowerCase(),n=t.map((e=>e.title.rendered.toLowerCase()));if(!n.includes(s))return e;let o=2;for(;n.includes(`${s} ${o}`);)o++;return`${e} ${o}`})(g,h),s=(e=>Kn(e).replace(/[^\w-]+/g,"")||"wp-custom-part")(e),n=await l("postType","wp_template_part",{slug:s,title:e,content:(0,x.serialize)(t),area:f},{throwOnError:!0});await o(n)}catch(e){const t=e instanceof Error&&"code"in e&&e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while creating the template part.");a(t,{type:"snackbar"}),r?.()}finally{v(!1)}}return(0,c.jsx)("form",{onSubmit:async e=>{e.preventDefault(),await k()},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"4",children:[(0,c.jsx)(Hn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,fs.__)("Name"),value:g,onChange:_,required:!0}),(0,c.jsxs)("fieldset",{className:"fields-create-template-part-modal__area-fieldset",children:[(0,c.jsx)(Hn.BaseControl.VisualLabel,{as:"legend",children:(0,fs.__)("Area")}),(0,c.jsx)("div",{className:"fields-create-template-part-modal__area-radio-group",children:(S??[]).map((e=>{const t=eo(e.icon);return(0,c.jsxs)("div",{className:"fields-create-template-part-modal__area-radio-wrapper",children:[(0,c.jsx)("input",{type:"radio",id:Qn(e.area,w),name:`fields-create-template-part-modal__area-${w}`,value:e.area,checked:f===e.area,onChange:()=>{b(e.area)},"aria-describedby":Xn(e.area,w)}),(0,c.jsx)(Hn.Icon,{icon:t,className:"fields-create-template-part-modal__area-radio-icon"}),(0,c.jsx)("label",{htmlFor:Qn(e.area,w),className:"fields-create-template-part-modal__area-radio-label",children:e.label}),(0,c.jsx)(Hn.Icon,{icon:zn,className:"fields-create-template-part-modal__area-radio-checkmark"}),(0,c.jsx)("p",{className:"fields-create-template-part-modal__area-radio-description",id:Xn(e.area,w),children:e.description})]},e.area)}))})]}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{n()},children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit","aria-disabled":!g||y,isBusy:y,children:s})]})]})})}function so(e){return"wp_template"===e.type||"wp_template_part"===e.type}function no(e,t=(0,fs.__)("(no title)")){let s="";return"string"==typeof e.title?s=(0,Ln.decodeEntities)(e.title):e.title&&"rendered"in e.title?s=(0,Ln.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title&&(s=(0,Ln.decodeEntities)(e.title.raw)),s||t}function oo(e){return!!e&&([e.source,e.source].includes("custom")&&!Boolean("wp_template"===e.type&&e?.plugin)&&!e.has_theme_file)}const ro={id:"duplicate-template-part",label:(0,fs._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"===e.type,modalHeader:(0,fs._x)("Duplicate template part","action label"),modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t})=>{const[s]=e,n=(0,p.useMemo)((()=>s.blocks??(0,x.parse)("string"==typeof s.content?s.content:s.content.raw,{__unstableSkipMigrationLogs:!0})),[s.content,s.blocks]),{createSuccessNotice:o}=(0,d.useDispatch)(_s.store);return(0,c.jsx)(to,{blocks:n,defaultArea:s.area,defaultTitle:(0,fs.sprintf)((0,fs._x)("%s (Copy)","template part"),no(s)),onCreate:function(e){o((0,fs.sprintf)((0,fs._x)('"%s" duplicated.',"template part"),no(e)),{type:"snackbar",id:"edit-site-patterns-success"}),t?.()},onError:t,confirmLabel:(0,fs._x)("Duplicate","action label"),closeModal:t??(()=>{})})}};var io=ro;const ao=window.wp.patterns,{lock:lo,unlock:co}=(0,z.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/fields"),{CreatePatternModalContents:uo,useDuplicatePatternProps:po}=co(ao.privateApis),mo={id:"duplicate-pattern",label:(0,fs._x)("Duplicate","action label"),isEligible:e=>"wp_template_part"!==e.type,modalHeader:(0,fs._x)("Duplicate pattern","action label"),modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t})=>{const[s]=e,n=po({pattern:s,onSuccess:()=>t?.()});return(0,c.jsx)(uo,{onClose:t,confirmLabel:(0,fs._x)("Duplicate","action label"),...n})}};var ho=mo;const{PATTERN_TYPES:go}=co(ao.privateApis),_o={id:"rename-post",label:(0,fs.__)("Rename"),modalFocusOnMount:"firstContentElement",isEligible:e=>"trash"!==e.status&&(["wp_template","wp_template_part",...Object.values(go)].includes(e.type)?function(e){return"wp_template"===e.type}(e)?oo(e)&&e.is_custom&&e.permissions?.update:function(e){return"wp_template_part"===e.type}(e)?"custom"===e.source&&!e?.has_theme_file&&e.permissions?.update:e.type===go.user&&e.permissions?.update:e.permissions?.update),RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n]=e,[o,r]=(0,p.useState)((()=>no(n,""))),{editEntityRecord:i,saveEditedEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:m}=(0,d.useDispatch)(_s.store);return(0,c.jsx)("form",{onSubmit:async function(c){c.preventDefault();try{await i("postType",n.type,n.id,{title:o}),r(""),t?.(),await a("postType",n.type,n.id,{throwOnError:!0}),l((0,fs.__)("Name updated"),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while updating the name");m(s,{type:"snackbar"})}},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Name"),value:o,onChange:r,required:!0}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,fs.__)("Save")})]})]})})}};var fo=_o;const bo={id:"order-pages",label:(0,fs.__)("Order"),isEligible:({status:e})=>"trash"!==e,modalFocusOnMount:"firstContentElement",RenderModal:function({items:e,closeModal:t,onActionPerformed:s}){const[n,o]=(0,p.useState)(e[0]),{editEntityRecord:r,saveEditedEntityRecord:i}=(0,d.useDispatch)(u.store),{createSuccessNotice:a,createErrorNotice:l}=(0,d.useDispatch)(_s.store),m=function(e){return"number"==typeof e.menu_order&&Number.isInteger(e.menu_order)&&e.menu_order>0}(n);return(0,c.jsx)("form",{onSubmit:async function(o){if(o.preventDefault(),m)try{await r("postType",n.type,n.id,{menu_order:n.menu_order}),t?.(),await i("postType",n.type,n.id,{throwOnError:!0}),a((0,fs.__)("Order updated."),{type:"snackbar"}),s?.(e)}catch(e){const t=e,s=t.message&&"unknown_error"!==t.code?t.message:(0,fs.__)("An error occurred while updating the order");l(s,{type:"snackbar"})}},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)("div",{children:(0,fs.__)("Determines the order of pages. Pages with the same order value are sorted alphabetically. Negative order values are supported.")}),(0,c.jsx)(Hn.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,fs.__)("Order"),type:"number",value:"number"==typeof n.menu_order&&Number.isInteger(n.menu_order)?String(n.menu_order):"",onChange:e=>{const t=parseInt(e,10);o({...n,menu_order:isNaN(t)?void 0:t})}}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",accessibleWhenDisabled:!0,disabled:!m,children:(0,fs.__)("Save")})]})]})})}};var yo=bo;"stream"in Blob.prototype||Object.defineProperty(Blob.prototype,"stream",{value(){return new Response(this).body}}),"setBigUint64"in DataView.prototype||Object.defineProperty(DataView.prototype,"setBigUint64",{value(e,t,s){const n=Number(0xffffffffn&t),o=Number(t>>32n);this.setUint32(e+(s?0:4),n,s),this.setUint32(e+(s?4:0),o,s)}});var xo=e=>new DataView(new ArrayBuffer(e)),vo=e=>new Uint8Array(e.buffer||e),wo=e=>(new TextEncoder).encode(String(e)),So=e=>Math.min(4294967295,Number(e)),ko=e=>Math.min(65535,Number(e));function Co(e,t,s){void 0===t||t instanceof Date||(t=new Date(t));const n=void 0!==e;if(s||(s=n?436:509),e instanceof File)return{isFile:n,t:t||new Date(e.lastModified),bytes:e.stream(),mode:s};if(e instanceof Response)return{isFile:n,t:t||new Date(e.headers.get("Last-Modified")||Date.now()),bytes:e.body,mode:s};if(void 0===t)t=new Date;else if(isNaN(t))throw new Error("Invalid modification date.");if(!n)return{isFile:n,t,mode:s};if("string"==typeof e)return{isFile:n,t,bytes:wo(e),mode:s};if(e instanceof Blob)return{isFile:n,t,bytes:e.stream(),mode:s};if(e instanceof Uint8Array||e instanceof ReadableStream)return{isFile:n,t,bytes:e,mode:s};if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{isFile:n,t,bytes:vo(e),mode:s};if(Symbol.asyncIterator in e)return{isFile:n,t,bytes:Po(e[Symbol.asyncIterator]()),mode:s};throw new TypeError("Unsupported input format.")}function Po(e,t=e){return new ReadableStream({async pull(t){let s=0;for(;t.desiredSize>s;){const n=await e.next();if(!n.value){t.close();break}{const e=jo(n.value);t.enqueue(e),s+=e.byteLength}}},cancel(e){t.throw?.(e)}})}function jo(e){return"string"==typeof e?wo(e):e instanceof Uint8Array?e:vo(e)}function Eo(e,t,s){let[n,o]=function(e){return e?e instanceof Uint8Array?[e,1]:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?[vo(e),1]:[wo(e),0]:[void 0,0]}(t);if(e instanceof File)return{i:Bo(n||wo(e.name)),o:BigInt(e.size),u:o};if(e instanceof Response){const t=e.headers.get("content-disposition"),r=t&&t.match(/;\s*filename\*?\s*=\s*(?:UTF-\d+''|)["']?([^;"'\r\n]*)["']?(?:;|$)/i),i=r&&r[1]||e.url&&new URL(e.url).pathname.split("/").findLast(Boolean),a=i&&decodeURIComponent(i),l=s||+e.headers.get("content-length");return{i:Bo(n||wo(a)),o:BigInt(l),u:o}}return n=Bo(n,void 0!==e||void 0!==s),"string"==typeof e?{i:n,o:BigInt(wo(e).length),u:o}:e instanceof Blob?{i:n,o:BigInt(e.size),u:o}:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?{i:n,o:BigInt(e.byteLength),u:o}:{i:n,o:To(e,s),u:o}}function To(e,t){return t>-1?BigInt(t):e?void 0:0n}function Bo(e,t=1){if(!e||e.every((e=>47===e)))throw new Error("The file must have a name.");if(t)for(;47===e[e.length-1];)e=e.subarray(0,-1);else 47!==e[e.length-1]&&(e=new Uint8Array([...e,47]));return e}var Io=new Uint32Array(256);for(let e=0;e<256;++e){let t=e;for(let e=0;e<8;++e)t=t>>>1^(1&t&&3988292384);Io[e]=t}function No(e,t=0){t=~t;for(var s=0,n=e.length;s<n;s++)t=t>>>8^Io[255&t^e[s]];return~t>>>0}function Ro(e,t,s=0){const n=e.getSeconds()>>1|e.getMinutes()<<5|e.getHours()<<11,o=e.getDate()|e.getMonth()+1<<5|e.getFullYear()-1980<<9;t.setUint16(s,n,1),t.setUint16(s+2,o,1)}function Do({i:e,u:t},s){return 8*(!t||(s??function(e){try{Ao.decode(e)}catch{return 0}return 1}(e)))}var Ao=new TextDecoder("utf8",{fatal:1});function Mo(e,t=0){const s=xo(30);return s.setUint32(0,1347093252),s.setUint32(4,754976768|t),Ro(e.t,s,10),s.setUint16(26,e.i.length,1),vo(s)}async function*Lo(e){let{bytes:t}=e;if("then"in t&&(t=await t),t instanceof Uint8Array)yield t,e.l=No(t,0),e.o=BigInt(t.length);else{e.o=0n;const s=t.getReader();for(;;){const{value:t,done:n}=await s.read();if(n)break;e.l=No(t,e.l),e.o+=BigInt(t.length),yield t}}}function Oo(e,t){const s=xo(16+(t?8:0));return s.setUint32(0,1347094280),s.setUint32(4,e.isFile?e.l:0,1),t?(s.setBigUint64(8,e.o,1),s.setBigUint64(16,e.o,1)):(s.setUint32(8,So(e.o),1),s.setUint32(12,So(e.o),1)),vo(s)}function Fo(e,t,s=0,n=0){const o=xo(46);return o.setUint32(0,1347092738),o.setUint32(4,755182848),o.setUint16(8,2048|s),Ro(e.t,o,12),o.setUint32(16,e.isFile?e.l:0,1),o.setUint32(20,So(e.o),1),o.setUint32(24,So(e.o),1),o.setUint16(28,e.i.length,1),o.setUint16(30,n,1),o.setUint16(40,e.mode|(e.isFile?32768:16384),1),o.setUint32(42,So(t),1),vo(o)}function Vo(e,t,s){const n=xo(s);return n.setUint16(0,1,1),n.setUint16(2,s-4,1),16&s&&(n.setBigUint64(4,e.o,1),n.setBigUint64(12,e.o,1)),n.setBigUint64(s-8,t,1),vo(n)}function Uo(e){return e instanceof File||e instanceof Response?[[e],[e]]:[[e.input,e.name,e.size],[e.input,e.lastModified,e.mode]]}function Ho(e,t={}){const s={"Content-Type":"application/zip","Content-Disposition":"attachment"};return("bigint"==typeof t.length||Number.isInteger(t.length))&&t.length>0&&(s["Content-Length"]=String(t.length)),t.metadata&&(s["Content-Length"]=String((e=>function(e){let t=BigInt(22),s=0n,n=0;for(const o of e){if(!o.i)throw new Error("Every file must have a non-empty name.");if(void 0===o.o)throw new Error(`Missing size for file "${(new TextDecoder).decode(o.i)}".`);const e=o.o>=0xffffffffn,r=s>=0xffffffffn;s+=BigInt(46+o.i.length+(e&&8))+o.o,t+=BigInt(o.i.length+46+(12*r|28*e)),n||(n=e)}return(n||s>=0xffffffffn)&&(t+=BigInt(76)),t+s}(function*(e){for(const t of e)yield Eo(...Uo(t)[0])}(e)))(t.metadata))),new Response(zo(e,t),{headers:s})}function zo(e,t={}){const s=function(e){const t=e[Symbol.iterator in e?Symbol.iterator:Symbol.asyncIterator]();return{async next(){const e=await t.next();if(e.done)return e;const[s,n]=Uo(e.value);return{done:0,value:Object.assign(Co(...n),Eo(...s))}},throw:t.throw?.bind(t),[Symbol.asyncIterator](){return this}}}(e);return Po(async function*(e,t){const s=[];let n=0n,o=0n,r=0;for await(const i of e){const e=Do(i,t.buffersAreUTF8);yield Mo(i,e),yield new Uint8Array(i.i),i.isFile&&(yield*Lo(i));const a=i.o>=0xffffffffn,l=12*(n>=0xffffffffn)|28*a;yield Oo(i,a),s.push(Fo(i,n,e,l)),s.push(i.i),l&&s.push(Vo(i,n,l)),a&&(n+=8n),o++,n+=BigInt(46+i.i.length)+i.o,r||(r=a)}let i=0n;for(const e of s)yield e,i+=BigInt(e.length);if(r||n>=0xffffffffn){const e=xo(76);e.setUint32(0,1347094022),e.setBigUint64(4,BigInt(44),1),e.setUint32(12,755182848),e.setBigUint64(24,o,1),e.setBigUint64(32,o,1),e.setBigUint64(40,i,1),e.setBigUint64(48,n,1),e.setUint32(56,1347094023),e.setBigUint64(64,n+i,1),e.setUint32(72,1,1),yield vo(e)}const a=xo(22);a.setUint32(0,1347093766),a.setUint16(8,ko(o),1),a.setUint16(10,ko(o),1),a.setUint32(12,So(i),1),a.setUint32(16,So(n),1),yield vo(a)}(s,t),s)}const Go=window.wp.blob;var $o=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})});function Wo(e){return JSON.stringify({__file:e.type,title:no(e),content:"string"==typeof e.content?e.content:e.content?.raw,syncStatus:e.wp_pattern_sync_status},null,2)}var Zo={id:"export-pattern",label:(0,fs.__)("Export as JSON"),icon:$o,supportsBulk:!0,isEligible:e=>"wp_block"===e.type,callback:async e=>{if(1===e.length)return(0,Go.downloadBlob)(`${Kn(no(e[0])||e[0].slug)}.json`,Wo(e[0]),"application/json");const t={},s=e.map((e=>{const s=Kn(no(e)||e.slug);return t[s]=(t[s]||0)+1,{name:s+(t[s]>1?"-"+(t[s]-1):"")+".json",lastModified:new Date,input:Wo(e)}}));return(0,Go.downloadBlob)((0,fs.__)("patterns-export")+".zip",await Ho(s).blob(),"application/zip")}},Yo=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"})});var qo={id:"restore",label:(0,fs.__)("Restore"),isPrimary:!0,icon:Yo,supportsBulk:!0,isEligible:e=>!so(e)&&"wp_block"!==e.type&&"trash"===e.status&&e.permissions?.update,async callback(e,{registry:t,onActionPerformed:s}){const{createSuccessNotice:n,createErrorNotice:o}=t.dispatch(_s.store),{editEntityRecord:r,saveEditedEntityRecord:i}=t.dispatch(u.store);await Promise.allSettled(e.map((e=>r("postType",e.type,e.id,{status:"draft"}))));const a=await Promise.allSettled(e.map((e=>i("postType",e.type,e.id,{throwOnError:!0}))));if(a.every((({status:e})=>"fulfilled"===e))){let t;t=1===e.length?(0,fs.sprintf)((0,fs.__)('"%s" has been restored.'),no(e[0])):"page"===e[0].type?(0,fs.sprintf)((0,fs.__)("%d pages have been restored."),e.length):(0,fs.sprintf)((0,fs.__)("%d posts have been restored."),e.length),n(t,{type:"snackbar",id:"restore-post-action"}),s&&s(e)}else{let e;if(1===a.length){const t=a[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while restoring the post.")}else{const t=new Set,s=a.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while restoring the posts."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while restoring the posts: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while restoring the posts: %s"),[...t].join(","))}o(e,{type:"snackbar"})}}};const Ko=async(e,{allowUndo:t=!0}={})=>{const s="edit-site-template-reverted";var n;if((0,d.dispatch)(_s.store).removeNotice(s),(n=e)&&"custom"===n.source&&(Boolean(n?.plugin)||n?.has_theme_file))try{const n=(0,d.select)(u.store).getEntityConfig("postType",e.type);if(!n)return void(0,d.dispatch)(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const o=(0,w.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:e.origin}),r=await gs()({path:o});if(!r)return void(0,d.dispatch)(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const i=({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e),a=(0,d.select)(u.store).getEditedEntityRecord("postType",e.type,e.id);(0,d.dispatch)(u.store).editEntityRecord("postType",e.type,e.id,{content:i,blocks:a.blocks,source:"custom"},{undoIgnore:!0});const l=(0,x.parse)(r?.content?.raw);if((0,d.dispatch)(u.store).editEntityRecord("postType",e.type,r.id,{content:i,blocks:l,source:"theme"}),t){const t=()=>{(0,d.dispatch)(u.store).editEntityRecord("postType",e.type,a.id,{content:i,blocks:a.blocks,source:"custom"})};(0,d.dispatch)(_s.store).createSuccessNotice((0,fs.__)("Template reset."),{type:"snackbar",id:s,actions:[{label:(0,fs.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("Template revert failed. Please reload.");(0,d.dispatch)(_s.store).createErrorNotice(t,{type:"snackbar"})}else(0,d.dispatch)(_s.store).createErrorNotice((0,fs.__)("This template is not revertable."),{type:"snackbar"})},Qo={id:"reset-post",label:(0,fs.__)("Reset"),isEligible:e=>so(e)&&"custom"===e?.source&&(Boolean("wp_template"===e.type&&e?.plugin)||e?.has_theme_file),icon:Yo,supportsBulk:!0,hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),{saveEditedEntityRecord:r}=(0,d.useDispatch)(u.store),{createSuccessNotice:i,createErrorNotice:a}=(0,d.useDispatch)(_s.store);return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Reset to default and clear all customizations?")}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{o(!0),await(async()=>{try{for(const t of e)await Ko(t,{allowUndo:!1}),await r("postType",t.type,t.id);i(e.length>1?(0,fs.sprintf)((0,fs.__)("%d items reset."),e.length):(0,fs.sprintf)((0,fs.__)('"%s" reset.'),no(e[0])),{type:"snackbar",id:"revert-template-action"})}catch(t){let s;s="wp_template"===e[0].type?1===e.length?(0,fs.__)("An error occurred while reverting the template."):(0,fs.__)("An error occurred while reverting the templates."):1===e.length?(0,fs.__)("An error occurred while reverting the template part."):(0,fs.__)("An error occurred while reverting the template parts.");const n=t,o=n.message&&"unknown_error"!==n.code?n.message:s;a(o,{type:"snackbar"})}})(),s?.(e),o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,children:(0,fs.__)("Reset")})]})]})}};var Xo=Qo,Jo=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})});function er(e){const t=new Set;if(1===e.length){const s=e[0];s.reason?.message&&t.add(s.reason.message)}else{const s=e.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}}return t}const{PATTERN_TYPES:tr}=co(ao.privateApis),sr={id:"delete-post",label:(0,fs.__)("Delete"),isPrimary:!0,icon:Jo,isEligible:e=>so(e)?oo(e):e.type===tr.user,supportsBulk:!0,hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),r=e.every((e=>so(e)&&e?.has_theme_file));return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:e.length>1?(0,fs.sprintf)((0,fs._n)("Delete %d item?","Delete %d items?",e.length),e.length):(0,fs.sprintf)((0,fs._x)('Delete "%s"?',"template part"),no(e[0]))}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{variant:"primary",onClick:async()=>{o(!0);const n={success:{messages:{getMessage:e=>r?(0,fs.sprintf)((0,fs.__)('"%s" reset.'),(0,Ln.decodeEntities)(no(e))):(0,fs.sprintf)((0,fs._x)('"%s" deleted.',"template part"),(0,Ln.decodeEntities)(no(e))),getBatchMessage:()=>r?(0,fs.__)("Items reset."):(0,fs.__)("Items deleted.")}},error:{messages:{getMessage:e=>1===e.size?[...e][0]:r?(0,fs.__)("An error occurred while reverting the item."):(0,fs.__)("An error occurred while deleting the item."),getBatchMessage:e=>0===e.size?r?(0,fs.__)("An error occurred while reverting the items."):(0,fs.__)("An error occurred while deleting the items."):1===e.size?r?(0,fs.sprintf)((0,fs.__)("An error occurred while reverting the items: %s"),[...e][0]):(0,fs.sprintf)((0,fs.__)("An error occurred while deleting the items: %s"),[...e][0]):r?(0,fs.sprintf)((0,fs.__)("Some errors occurred while reverting the items: %s"),[...e].join(",")):(0,fs.sprintf)((0,fs.__)("Some errors occurred while deleting the items: %s"),[...e].join(","))}}};await(async(e,t,s)=>{const{createSuccessNotice:n,createErrorNotice:o}=(0,d.dispatch)(_s.store),{deleteEntityRecord:r}=(0,d.dispatch)(u.store),i=await Promise.allSettled(e.map((e=>r("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(i.every((({status:e})=>"fulfilled"===e))){let o;o=1===i.length?t.success.messages.getMessage(e[0]):t.success.messages.getBatchMessage(e),n(o,{type:t.success.type??"snackbar",id:t.success.id}),s.onActionPerformed?.(e)}else{const e=er(i);let n="";n=1===i.length?t.error.messages.getMessage(e):t.error.messages.getBatchMessage(e),o(n,{type:t.error.type??"snackbar",id:t.error.id}),s.onActionError?.()}})(e,n,{onActionPerformed:s}),o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Delete")})]})]})}};var nr=sr;const or={id:"move-to-trash",label:(0,fs.__)("Trash"),isPrimary:!0,icon:Jo,isEligible:e=>!so(e)&&"wp_block"!==e.type&&(!!e.status&&!["auto-draft","trash"].includes(e.status)&&e.permissions?.delete),supportsBulk:!0,hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),{createSuccessNotice:r,createErrorNotice:i}=(0,d.useDispatch)(_s.store),{deleteEntityRecord:a}=(0,d.useDispatch)(u.store);return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:1===e.length?(0,fs.sprintf)((0,fs.__)('Are you sure you want to move "%s" to the trash?'),no(e[0])):(0,fs.sprintf)((0,fs._n)("Are you sure you want to move %d item to the trash ?","Are you sure you want to move %d items to the trash ?",e.length),e.length)}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:async()=>{o(!0);const n=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id.toString(),{},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let t;t=1===n.length?(0,fs.sprintf)((0,fs.__)('"%s" moved to the trash.'),no(e[0])):(0,fs.sprintf)((0,fs._n)("%d item moved to the trash.","%d items moved to the trash.",e.length),e.length),r(t,{type:"snackbar",id:"move-to-trash-action"})}else{let e;if(1===n.length){const t=n[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while moving the item to the trash.")}else{const t=new Set,s=n.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while moving the items to the trash."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while moving the item to the trash: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while moving the items to the trash: %s"),[...t].join(","))}i(e,{type:"snackbar"})}s&&s(e),o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,children:(0,fs._x)("Trash","verb")})]})]})}};var rr=or;const ir={id:"permanently-delete",label:(0,fs.__)("Permanently delete"),supportsBulk:!0,icon:Jo,isEligible(e){if(so(e)||"wp_block"===e.type)return!1;const{status:t,permissions:s}=e;return"trash"===t&&s?.delete},hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:s})=>{const[n,o]=(0,p.useState)(!1),{createSuccessNotice:r,createErrorNotice:i}=(0,d.useDispatch)(_s.store),{deleteEntityRecord:a}=(0,d.useDispatch)(u.store);return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:e.length>1?(0,fs.sprintf)((0,fs._n)("Are you sure you want to permanently delete %d item?","Are you sure you want to permanently delete %d items?",e.length),e.length):(0,fs.sprintf)((0,fs.__)('Are you sure you want to permanently delete "%s"?'),(0,Ln.decodeEntities)(no(e[0])))}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{variant:"tertiary",onClick:t,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{variant:"primary",onClick:async()=>{o(!0);const n=await Promise.allSettled(e.map((e=>a("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let t;t=1===n.length?(0,fs.sprintf)((0,fs.__)('"%s" permanently deleted.'),no(e[0])):(0,fs.__)("The items were permanently deleted."),r(t,{type:"snackbar",id:"permanently-delete-post-action"}),s?.(e)}else{let e;if(1===n.length){const t=n[0];e=t.reason?.message?t.reason.message:(0,fs.__)("An error occurred while permanently deleting the item.")}else{const t=new Set,s=n.filter((({status:e})=>"rejected"===e));for(const e of s){const s=e;s.reason?.message&&t.add(s.reason.message)}e=0===t.size?(0,fs.__)("An error occurred while permanently deleting the items."):1===t.size?(0,fs.sprintf)((0,fs.__)("An error occurred while permanently deleting the items: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("Some errors occurred while permanently deleting the items: %s"),[...t].join(","))}i(e,{type:"snackbar"})}o(!1),t?.()},isBusy:n,disabled:n,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,fs.__)("Delete permanently")})]})]})}};var ar=ir;const lr=window.wp.mediaUtils;var cr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M5 11.25h14v1.5H5z"})});const dr={id:"featured_media",type:"media",label:(0,fs.__)("Featured Image"),Edit:({data:e,field:t,onChange:s})=>{const{id:n}=t,o=t.getValue({item:e}),r=(0,d.useSelect)((e=>{const{getEntityRecord:t}=e(u.store);return t("postType","attachment",o)}),[o]),i=(0,p.useCallback)((e=>s({[n]:e})),[n,s]),a=r?.source_url,l=r?.title?.rendered,m=(0,p.useRef)(null);return(0,c.jsx)("fieldset",{className:"fields-controls__featured-image",children:(0,c.jsx)("div",{className:"fields-controls__featured-image-container",children:(0,c.jsx)(lr.MediaUpload,{onSelect:e=>{i(e.id)},allowedTypes:["image"],render:({open:e})=>(0,c.jsx)("div",{ref:m,role:"button",tabIndex:-1,onClick:()=>{e()},onKeyDown:e,children:(0,c.jsxs)(Hn.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr 24px",children:[a&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("img",{className:"fields-controls__featured-image-image",alt:"",width:24,height:24,src:a}),(0,c.jsx)("span",{className:"fields-controls__featured-image-title",children:l})]}),!a&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"fields-controls__featured-image-placeholder",style:{width:"24px",height:"24px"}}),(0,c.jsx)("span",{className:"fields-controls__featured-image-title",children:(0,fs.__)("Choose an image…")})]}),a&&(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Hn.Button,{size:"small",className:"fields-controls__featured-image-remove-button",icon:cr,onClick:e=>{e.stopPropagation(),i(0)}})})]})})})})})},render:({item:e,config:t})=>{const s=e?._embedded?.["wp:featuredmedia"]?.[0],n=s?.source_url;return n?(0,c.jsx)("img",{className:"fields-controls__featured-image-image",src:n,alt:"",srcSet:s?.media_details?.sizes?Object.values(s.media_details.sizes).map((e=>`${e.source_url} ${e.width}w`)).join(", "):void 0,sizes:t?.sizes||"100vw"}):(0,c.jsx)("span",{className:"fields-controls__featured-image-placeholder"})},enableSorting:!1,filterBy:!1};var ur=dr;function pr(e){var t,s,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=pr(e[t]))&&(n&&(n+=" "),n+=s)}else for(s in e)e[s]&&(n&&(n+=" "),n+=s);return n}const mr=function(){for(var e,t,s=0,n="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=pr(e))&&(n&&(n+=" "),n+=t);return n};var hr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})});var gr=function({item:e}){const t=e?._embedded?.author?.[0]?.name,s=e?._embedded?.author?.[0]?.avatar_urls?.[48],[n,o]=(0,p.useState)(!1);return(0,c.jsxs)(Hn.__experimentalHStack,{alignment:"left",spacing:0,children:[!!s&&(0,c.jsx)("div",{className:mr("page-templates-author-field__avatar",{"is-loaded":n}),children:(0,c.jsx)("img",{onLoad:()=>o(!0),alt:(0,fs.__)("Author avatar"),src:s})}),!s&&(0,c.jsx)("div",{className:"page-templates-author-field__icon",children:(0,c.jsx)(Hn.Icon,{icon:hr})}),(0,c.jsx)("span",{className:"page-templates-author-field__name",children:t})]})};const _r={label:(0,fs.__)("Author"),id:"author",type:"integer",getElements:async()=>(await(0,d.resolveSelect)(u.store).getEntityRecords("root","user",{per_page:-1})??[]).map((({id:e,name:t})=>({value:e,label:t}))),render:gr,sort:(e,t,s)=>{const n=e._embedded?.author?.[0]?.name||"",o=t._embedded?.author?.[0]?.name||"";return"asc"===s?n.localeCompare(o):o.localeCompare(n)},filterBy:{operators:["isAny","isNone"]}};var fr=_r,br=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"})}),yr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z"})}),xr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z"})}),vr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"})}),wr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})});var Sr=[{value:"draft",label:(0,fs.__)("Draft"),icon:br,description:(0,fs.__)("Not ready to publish.")},{value:"future",label:(0,fs.__)("Scheduled"),icon:yr,description:(0,fs.__)("Publish automatically on a chosen date.")},{value:"pending",label:(0,fs.__)("Pending Review"),icon:xr,description:(0,fs.__)("Waiting for review before publishing.")},{value:"private",label:(0,fs.__)("Private"),icon:vr,description:(0,fs.__)("Only visible to site admins and editors.")},{value:"publish",label:(0,fs.__)("Published"),icon:wr,description:(0,fs.__)("Visible to everyone.")},{value:"trash",label:(0,fs.__)("Trash"),icon:Jo}];var kr=function({item:e}){const t=Sr.find((({value:t})=>t===e.status)),s=t?.label||e.status,n=t?.icon;return(0,c.jsxs)(Hn.__experimentalHStack,{alignment:"left",spacing:0,children:[n&&(0,c.jsx)("div",{className:"edit-site-post-list__status-icon",children:(0,c.jsx)(Hn.Icon,{icon:n})}),(0,c.jsx)("span",{children:s})]})};var Cr={label:(0,fs.__)("Status"),id:"status",type:"text",elements:Sr,render:kr,Edit:"radio",enableSorting:!1,filterBy:{operators:["isAny"]}};const Pr=e=>(0,v.dateI18n)((0,v.getSettings)().formats.datetimeAbbreviated,(0,v.getDate)(e));var jr=({item:e})=>{if(["draft","private"].includes(e.status??""))return(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Modified: <time>%s</time></span>"),Pr(e.date??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})});if("future"===e.status)return(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Scheduled: <time>%s</time></span>"),Pr(e.date??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})});if("publish"===e.status)return(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Published: <time>%s</time></span>"),Pr(e.date??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})});const t=(0,v.getDate)(e.modified??null)>(0,v.getDate)(e.date??null)?e.modified:e.date;return"pending"===e.status?(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)("<span>Modified: <time>%s</time></span>"),Pr(t??null)),{span:(0,c.jsx)("span",{}),time:(0,c.jsx)("time",{})}):(0,c.jsx)("time",{children:Pr(e.date??null)})};var Er={id:"date",type:"datetime",label:(0,fs.__)("Date"),render:jr,filterBy:!1},Tr=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})});const Br=e=>"object"!=typeof e?"":e.slug||(0,w.cleanForSlug)(no(e))||e.id.toString(),Ir=({field:e,onChange:t,data:s})=>{const{id:n}=e,o=e.getValue({item:s})||Br(s),r=s.permalink_template||"",i=/%(?:postname|pagename)%/,[a,l]=r.split(i),u=a,h=l,g=i.test(r),_=(0,p.useRef)(o),f=o||_.current,b=g?`${u}${f}${h}`:(0,w.safeDecodeURIComponent)(s.link||"");(0,p.useEffect)((()=>{o&&void 0===_.current&&(_.current=o)}),[o]);const y=(0,p.useCallback)((e=>t({[n]:e})),[n,t]),{createNotice:x}=(0,d.useDispatch)(_s.store),v=(0,m.useCopyToClipboard)(b,(()=>{x("info",(0,fs.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})})),S="editor-post-url__slug-description-"+(0,m.useInstanceId)(Ir);return(0,c.jsxs)("fieldset",{className:"fields-controls__slug",children:[g&&(0,c.jsxs)(Hn.__experimentalVStack,{children:[(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"0px",children:[(0,c.jsx)("span",{children:(0,fs.__)("Customize the last part of the Permalink.")}),(0,c.jsx)(Hn.ExternalLink,{href:"https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink",children:(0,fs.__)("Learn more")})]}),(0,c.jsx)(Hn.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,c.jsx)(Hn.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,icon:Tr,ref:v,label:(0,fs.__)("Copy")}),label:(0,fs.__)("Link"),hideLabelFromVision:!0,value:o,autoComplete:"off",spellCheck:"false",type:"text",className:"fields-controls__slug-input",onChange:e=>{y(e)},onBlur:()=>{""===o&&y(_.current)},"aria-describedby":S}),(0,c.jsxs)("div",{className:"fields-controls__slug-help",children:[(0,c.jsx)("span",{className:"fields-controls__slug-help-visual-label",children:(0,fs.__)("Permalink:")}),(0,c.jsxs)(Hn.ExternalLink,{className:"fields-controls__slug-help-link",href:b,children:[(0,c.jsx)("span",{className:"fields-controls__slug-help-prefix",children:u}),(0,c.jsx)("span",{className:"fields-controls__slug-help-slug",children:f}),(0,c.jsx)("span",{className:"fields-controls__slug-help-suffix",children:h})]})]})]}),!g&&(0,c.jsx)(Hn.ExternalLink,{className:"fields-controls__slug-help",href:b,children:b})]})};var Nr=Ir;var Rr=({item:e})=>{const t=Br(e),s=(0,p.useRef)(t);(0,p.useEffect)((()=>{t&&void 0===s.current&&(s.current=t)}),[t]);return`${t||s.current}`};var Dr={id:"slug",type:"text",label:(0,fs.__)("Slug"),Edit:Nr,render:Rr,filterBy:!1},Ar=s(9681),Mr=s.n(Ar);function Lr(e){return"object"==typeof e.title&&"rendered"in e.title&&e.title.rendered?(0,Ln.decodeEntities)(e.title.rendered):`#${e?.id} (${(0,fs.__)("no title")})`}const Or=(e,t)=>{const s=Mr()(e||"").toLowerCase(),n=Mr()(t||"").toLowerCase();return s===n?0:s.startsWith(n)?s.length:1/0};function Fr({data:e,onChangeControl:t}){const[s,n]=(0,p.useState)(null),o=e.parent,r=e.id,i=e.type,{parentPostTitle:a,pageItems:l,isHierarchical:h}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEntityRecords:n,getPostType:a}=e(u.store),l=a(i),c=l?.hierarchical&&l.viewable,d=o?t("postType",i,o):null,p={per_page:100,exclude:r,parent_exclude:r,orderby:"menu_order",order:"asc",_fields:"id,title,parent",...null!==s&&{search:s}};return{isHierarchical:c,parentPostTitle:d?Lr(d):"",pageItems:c?n("postType",i,p):null}}),[s,o,r,i]),g=(0,p.useMemo)((()=>{const e=(t,n=0)=>{const o=t.map((t=>[{value:t.id,label:"— ".repeat(n)+(0,Ln.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],n+1)])).sort((([e],[t])=>Or(e.rawName,s??"")>=Or(t.rawName,s??"")?1:-1));return o.flat()};if(!l)return[];let t=l.map((e=>({id:e.id,parent:e.parent??null,name:Lr(e)})));s||(t=function(e){const t=e.map((e=>({children:[],...e})));if(t.some((({parent:e})=>null==e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),n=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?n(t):[]}}));return n(s[0]||[])}(t));const n=e(t),r=n.find((e=>e.value===o));return o&&a&&!r&&n.unshift({value:o,label:a,rawName:""}),n.map((e=>({...e,value:e.value.toString()})))}),[l,s,a,o]);if(!h)return null;return(0,c.jsx)(Hn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Parent"),help:(0,fs.__)("Choose a parent page."),value:o?.toString(),options:g,onFilterValueChange:(0,m.debounce)((e=>{n(e)}),300),onChange:e=>{if(e)return t(parseInt(e,10)??0);t(0)},hideLabelFromVision:!0})}var Vr={id:"parent",type:"text",label:(0,fs.__)("Parent"),Edit:({data:e,field:t,onChange:s})=>{const{id:n}=t,o=(0,d.useSelect)((e=>e(u.store).getEntityRecord("root","__unstableBase")?.home),[]),r=(0,p.useCallback)((e=>s({[n]:e})),[n,s]);return(0,c.jsx)("fieldset",{className:"fields-controls__parent",children:(0,c.jsxs)("div",{children:[(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'),(0,w.filterURLForDisplay)(o).replace(/([/.])/g,"<wbr />$1")),{wbr:(0,c.jsx)("wbr",{})}),(0,c.jsx)("p",{children:(0,p.createInterpolateElement)((0,fs.__)("They also show up as sub-items in the default navigation menu. <a>Learn more.</a>"),{a:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes"),children:void 0})})}),(0,c.jsx)(Fr,{data:e,onChangeControl:r})]})})},render:({item:e})=>{const t=(0,d.useSelect)((t=>{const{getEntityRecord:s}=t(u.store);return e?.parent?s("postType",e.type,e.parent):null}),[e.parent,e.type]);return t?(0,c.jsx)(c.Fragment,{children:Lr(t)}):(0,c.jsx)(c.Fragment,{children:(0,fs.__)("None")})},enableSorting:!0,filterBy:!1};var Ur={id:"comment_status",label:(0,fs.__)("Comments"),type:"text",Edit:"radio",enableSorting:!1,enableHiding:!1,filterBy:!1,elements:[{value:"open",label:(0,fs.__)("Open"),description:(0,fs.__)("Visitors can add new comments and replies.")},{value:"closed",label:(0,fs.__)("Closed"),description:(0,fs.__)("Visitors cannot add new comments or replies. Existing comments remain visible.")}]};var Hr={id:"ping_status",label:(0,fs.__)("Trackbacks & Pingbacks"),type:"text",Edit:function({data:e,onChange:t}){const s=e?.ping_status??"open";return(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Enable pingbacks & trackbacks"),checked:"open"===s,onChange:s=>{t({...e,ping_status:s?"open":"closed"})},help:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,fs.__)("Learn more about pingbacks & trackbacks")})})},enableSorting:!1,enableHiding:!1,filterBy:!1,elements:[{value:"open",label:(0,fs.__)("Allow"),description:(0,fs.__)("Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.")},{value:"closed",label:(0,fs.__)("Don't allow"),description:(0,fs.__)("Don't allow link notifications from other blogs (pingbacks and trackbacks) on new articles.")}]};var zr={id:"discussion",label:(0,fs.__)("Discussion"),type:"text",render:({item:e})=>{const t="open"===e.comment_status,s="open"===e.ping_status;return t&&s?(0,fs.__)("Open"):t&&!s?(0,fs.__)("Comments only"):!t&&s?(0,fs.__)("Pings only"):(0,fs.__)("Closed")},filterBy:!1};const Gr=[],$r={id:"template",type:"text",label:(0,fs.__)("Template"),Edit:({data:e,field:t,onChange:s})=>{const{id:n}=t,o=e.type,r="number"==typeof e.id?e.id:parseInt(e.id,10),i=e.slug,{canSwitchTemplate:a,templates:l}=(0,d.useSelect)((e=>{const t=e(u.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:o})??Gr,{getHomePage:s,getPostsPageId:n}=co(e(u.store)),i=n()===+r,a="page"===o&&s()?.postId===+r;return{templates:t,canSwitchTemplate:!i&&!a}}),[r,o]),h=(0,p.useMemo)((()=>a?l.filter((t=>t.is_custom&&t.slug!==e.template&&!!t.content.raw)).map((e=>({name:e.slug,blocks:(0,x.parse)(e.content.raw),title:(0,Ln.decodeEntities)(e.title.rendered),id:e.id}))):[]),[a,e.template,l]),_=(0,m.useAsyncList)(h),f=t.getValue({item:e}),b=l.find((e=>e.slug===f)),y=(0,d.useSelect)((e=>{if(b)return b;let t;if(t=i?"page"===o?`${o}-${i}`:`single-${o}-${i}`:"page"===o?"page":`single-${o}`,o){const s=e(u.store).getDefaultTemplateId({slug:t});return e(u.store).getEntityRecord("postType","wp_template",s)}}),[b,o,i]),[v,w]=(0,p.useState)(!1),S=(0,p.useCallback)((e=>s({[n]:e})),[n,s]);return(0,c.jsxs)("fieldset",{className:"fields-controls__template",children:[(0,c.jsx)(Hn.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:e})=>(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",size:"compact",onClick:e,children:y?no(y):""}),renderContent:({onToggle:e})=>(0,c.jsxs)(Hn.MenuGroup,{children:[(0,c.jsx)(Hn.MenuItem,{onClick:()=>{w(!0),e()},children:(0,fs.__)("Change template")}),""!==f&&(0,c.jsx)(Hn.MenuItem,{onClick:()=>{S(""),e()},children:(0,fs.__)("Use default template")})]})}),v&&(0,c.jsx)(Hn.Modal,{title:(0,fs.__)("Choose a template"),onRequestClose:()=>w(!1),overlayClassName:"fields-controls__template-modal",isFullScreen:!0,children:(0,c.jsx)("div",{className:"fields-controls__template-content",children:(0,c.jsx)(g.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:h,shownPatterns:_,onClickPattern:e=>{S(e.name),w(!1)}})})})]})},enableSorting:!1,filterBy:!1};var Wr=$r;var Zr=function({data:e,onChange:t,field:s}){const[n,o]=(0,p.useState)(!!s.getValue({item:e}));return(0,c.jsxs)(Hn.__experimentalVStack,{as:"fieldset",spacing:4,className:"fields-controls__password",children:[(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Password protected"),help:(0,fs.__)("Only visible to those who know the password"),checked:n,onChange:e=>{o(e),e||t({password:""})}}),n&&(0,c.jsx)("div",{className:"fields-controls__password-input",children:(0,c.jsx)(Hn.TextControl,{label:(0,fs.__)("Password"),onChange:e=>t({password:e}),value:s.getValue({item:e})||"",placeholder:(0,fs.__)("Use a secure password"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]})};var Yr={id:"password",type:"text",label:(0,fs.__)("Password"),Edit:Zr,enableSorting:!1,enableHiding:!1,isVisible:e=>"private"!==e.status,filterBy:!1};function qr({item:e,className:t,children:s}){const n=no(e);return(0,c.jsxs)(Hn.__experimentalHStack,{className:mr("fields-field__title",t),alignment:"center",justify:"flex-start",children:[(0,c.jsx)("span",{children:n||(0,fs.__)("(no title)")}),s]})}function Kr({item:e}){return(0,c.jsx)(qr,{item:e})}const{Badge:Qr}=co(Hn.privateApis);var Xr={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>no(e),render:function({item:e}){const{frontPageId:t,postsPageId:s}=(0,d.useSelect)((e=>{const{getEntityRecord:t}=e(u.store),s=t("root","site");return{frontPageId:s?.page_on_front,postsPageId:s?.page_for_posts}}),[]);return(0,c.jsx)(qr,{item:e,className:"fields-field__page-title",children:[t,s].includes(e.id)&&(0,c.jsx)(Qr,{children:e.id===t?(0,fs.__)("Homepage"):(0,fs.__)("Posts Page")})})},enableHiding:!1,enableGlobalSearch:!0,filterBy:!1};var Jr={type:"text",label:(0,fs.__)("Template"),placeholder:(0,fs.__)("No title"),id:"title",getValue:({item:e})=>no(e),render:Kr,enableHiding:!1,enableGlobalSearch:!0,filterBy:!1},ei=(0,p.forwardRef)((({icon:e,size:t=24,...s},n)=>(0,p.cloneElement)(e,{width:t,height:t,...s,ref:n}))),ti=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"})});const{PATTERN_TYPES:si}=co(ao.privateApis);var ni={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>no(e),render:function({item:e}){return(0,c.jsx)(qr,{item:e,className:"fields-field__pattern-title",children:e.type===si.theme&&(0,c.jsx)(Hn.Tooltip,{placement:"top",text:(0,fs.__)("This pattern cannot be edited."),children:(0,c.jsx)(ei,{icon:ti,size:24})})})},enableHiding:!1,enableGlobalSearch:!0,filterBy:!1};var oi={type:"text",id:"title",label:(0,fs.__)("Title"),placeholder:(0,fs.__)("No title"),getValue:({item:e})=>no(e),render:Kr,enableHiding:!0,enableGlobalSearch:!0,filterBy:!1};var ri=(0,m.createHigherOrderComponent)((e=>({useSubRegistry:t=!0,...s})=>{const n=(0,d.useRegistry)(),[o]=(0,p.useState)((()=>new WeakMap)),r=function(e,t,s){if(!s)return t;let n=e.get(t);return n||(n=(0,d.createRegistry)({"core/block-editor":g.storeConfig},t),n.registerStore("core/editor",xc),e.set(t,n)),n}(o,n,t);return r===n?(0,c.jsx)(e,{registry:n,...s}):(0,c.jsx)(d.RegistryProvider,{value:r,children:(0,c.jsx)(e,{registry:r,...s})})}),"withRegistryProvider");const ii=(e,t)=>`<a ${ai(e)}>${t}</a>`,ai=e=>`href="${e}" target="_blank" rel="noreferrer noopener"`,li=e=>{const{title:t,foreign_landing_url:s,creator:n,creator_url:o,license:r,license_version:i,license_url:a}=e,l=((e,t)=>{let s=e.trim();return"pdm"!==e&&(s=e.toUpperCase().replace("SAMPLING","Sampling")),t&&(s+=` ${t}`),["pdm","cc0"].includes(e)||(s=`CC ${s}`),s})(r,i),c=(0,Ln.decodeEntities)(n);let d;return d=c?t?(0,fs.sprintf)((0,fs._x)('"%1$s" by %2$s/ %3$s',"caption"),ii(s,(0,Ln.decodeEntities)(t)),o?ii(o,c):c,a?ii(`${a}?ref=openverse`,l):l):(0,fs.sprintf)((0,fs._x)("<a %1$s>Work</a> by %2$s/ %3$s","caption"),ai(s),o?ii(o,c):c,a?ii(`${a}?ref=openverse`,l):l):t?(0,fs.sprintf)((0,fs._x)('"%1$s"/ %2$s',"caption"),ii(s,(0,Ln.decodeEntities)(t)),a?ii(`${a}?ref=openverse`,l):l):(0,fs.sprintf)((0,fs._x)("<a %1$s>Work</a>/ %2$s","caption"),ai(s),a?ii(`${a}?ref=openverse`,l):l),d.replace(/\s{2}/g," ")},ci=async(e={})=>(await(0,d.resolveSelect)(u.store).getEntityRecords("postType","attachment",{...e,orderBy:e?.search?"relevance":"date"})).map((e=>({...e,alt:e.alt_text,url:e.source_url,previewUrl:e.media_details?.sizes?.medium?.source_url,caption:e.caption?.raw})));var di=[{name:"images",labels:{name:(0,fs.__)("Images"),search_items:(0,fs.__)("Search images")},mediaType:"image",fetch:async(e={})=>ci({...e,media_type:"image"})},{name:"videos",labels:{name:(0,fs.__)("Videos"),search_items:(0,fs.__)("Search videos")},mediaType:"video",fetch:async(e={})=>ci({...e,media_type:"video"})},{name:"audio",labels:{name:(0,fs.__)("Audio"),search_items:(0,fs.__)("Search audio")},mediaType:"audio",fetch:async(e={})=>ci({...e,media_type:"audio"})},{name:"openverse",labels:{name:(0,fs.__)("Openverse"),search_items:(0,fs.__)("Search Openverse")},mediaType:"image",async fetch(e={}){const t={...e,mature:!1,excluded_source:"flickr,inaturalist,wikimedia",license:"pdm,cc0"},s={per_page:"page_size",search:"q"},n=new URL("https://api.openverse.org/v1/images/");Object.entries(t).forEach((([e,t])=>{const o=s[e]||e;n.searchParams.set(o,t)}));const o=await window.fetch(n,{headers:{"User-Agent":"WordPress/inserter-media-fetch"}});return(await o.json()).results.map((e=>({...e,title:e.title?.toLowerCase().startsWith("file:")?e.title.slice(5):e.title,sourceId:e.id,id:void 0,caption:li(e),previewUrl:e.thumbnail})))},getReportUrl:({sourceId:e})=>`https://wordpress.org/openverse/image/${e}/report/`,isExternalResource:!0}];const ui={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let pi;const mi=new Uint8Array(16);function hi(){if(!pi&&(pi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pi(mi)}const gi=[];for(let e=0;e<256;++e)gi.push((e+256).toString(16).slice(1));function _i(e,t=0){return gi[e[t+0]]+gi[e[t+1]]+gi[e[t+2]]+gi[e[t+3]]+"-"+gi[e[t+4]]+gi[e[t+5]]+"-"+gi[e[t+6]]+gi[e[t+7]]+"-"+gi[e[t+8]]+gi[e[t+9]]+"-"+gi[e[t+10]]+gi[e[t+11]]+gi[e[t+12]]+gi[e[t+13]]+gi[e[t+14]]+gi[e[t+15]]}const fi=function(e,t,s){if(ui.randomUUID&&!t&&!e)return ui.randomUUID();const n=(e=e||{}).random||(e.rng||hi)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){s=s||0;for(let e=0;e<16;++e)t[s+e]=n[e];return t}return _i(n)},bi=()=>{};function yi({additionalData:e={},allowedTypes:t,filesList:s,maxUploadFileSize:n,onError:o=bi,onFileChange:r,onSuccess:i,multiple:a=!0}){const{receiveEntityRecords:l}=(0,d.dispatch)(u.store),{getCurrentPost:c,getEditorSettings:p}=(0,d.select)(vc),{lockPostAutosaving:m,unlockPostAutosaving:h,lockPostSaving:g,unlockPostSaving:_}=(0,d.dispatch)(vc),f=p().allowedMimeTypes,b=`image-upload-${fi()}`;let y=!1;n=n||p().maxUploadFileSize;const x=c(),v="number"==typeof x?.id?x.id:x?.wp_id,w=v?{post:v}:{},S=()=>{_(b),h(b),y=!1};(0,lr.uploadMedia)({allowedTypes:t,filesList:s,onFileChange:e=>{y?S():(g(b),m(b),y=!0),r?.(e);const t=e.filter((e=>e?.id));if(t?.length){l("postType","attachment",t,void 0,!0)}},onSuccess:i,additionalData:{...w,...e},maxUploadFileSize:n,onError:({message:e})=>{S(),o(e)},wpAllowedMimeTypes:f,multiple:a})}const{sideloadMedia:xi}=$(lr.privateApis);var vi=xi,wi=s(66),Si=s.n(wi);
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function ki(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ci(e){var t,s;return!1!==ki(e)&&(void 0===(t=e.constructor)||!1!==ki(s=t.prototype)&&!1!==s.hasOwnProperty("isPrototypeOf"))}const{GlobalStylesContext:Pi,cleanEmptyObject:ji}=$(g.privateApis);function Ei(e,t){return Si()(e,t,{isMergeableObject:Ci,customMerge:e=>{if("backgroundImage"===e)return(e,t)=>t}})}function Ti(){const[e,t,s]=function(){const{globalStylesId:e,isReady:t,settings:s,styles:n,_links:o}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,hasFinishedResolution:n,canUser:o}=e(u.store),r=e(u.store).__experimentalGetCurrentGlobalStylesId();let i;const a=r?o("update",{kind:"root",name:"globalStyles",id:r}):null;r&&"boolean"==typeof a&&(i=a?s("root","globalStyles",r):t("root","globalStyles",r,{context:"view"}));let l=!1;return n("__experimentalGetCurrentGlobalStylesId")&&(l=!r||(a?n("getEditedEntityRecord",["root","globalStyles",r]):n("getEntityRecord",["root","globalStyles",r,{context:"view"}]))),{globalStylesId:r,isReady:l,settings:i?.settings,styles:i?.styles,_links:i?._links}}),[]),{getEditedEntityRecord:r}=(0,d.useSelect)(u.store),{editEntityRecord:i}=(0,d.useDispatch)(u.store);return[t,(0,p.useMemo)((()=>({settings:s??{},styles:n??{},_links:o??{}})),[s,n,o]),(0,p.useCallback)(((t,s={})=>{const n=r("root","globalStyles",e),o="function"==typeof t?t({styles:n?.styles??{},settings:n?.settings??{},_links:n?._links??{}}):t;i("root","globalStyles",e,{styles:ji(o.styles)||{},settings:ji(o.settings)||{},_links:ji(o._links)||{}},s)}),[e,i,r])]}(),[n,o]=function(){const e=(0,d.useSelect)((e=>e(u.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),r=(0,p.useMemo)((()=>o&&t?Ei(o,t):{}),[t,o]);return(0,p.useMemo)((()=>({isReady:e&&n,user:t,base:o,merged:r,setUserConfig:s})),[r,t,o,s,e,n])}const Bi={};function Ii(e){const{RECEIVE_INTERMEDIATE_RESULTS:t}=$(u.privateApis),{getEntityRecords:s}=e(u.store);return s("postType","wp_block",{per_page:-1,[t]:!0})}const Ni=["__experimentalBlockBindingsSupportedAttributes","__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","alignWide","blockInspectorTabs","maxUploadFileSize","allowedMimeTypes","bodyPlaceholder","canLockBlocks","canUpdateBlockBindings","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isPreviewMode","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableResolvedAssets","__unstableIsBlockBasedTheme"],{globalStylesDataKey:Ri,globalStylesLinksDataKey:Di,selectBlockPatternsKey:Ai,reusableBlocksSelectKey:Mi,sectionRootClientIdKey:Li,mediaEditKey:Oi}=$(g.privateApis);var Fi=function(e,t,s,n){const o=(0,m.useViewportMatch)("medium"),{allowRightClickOverrides:r,blockTypes:i,focusMode:a,hasFixedToolbar:l,isDistractionFree:c,keepCaretInsideBlock:h,hasUploadPermissions:_,hiddenBlockTypes:f,canUseUnfilteredHTML:b,userCanCreatePages:y,pageOnFront:v,pageForPosts:w,userPatternCategories:S,restBlockPatternCategories:k,sectionRootClientId:P}=(0,d.useSelect)((e=>{const{canUser:r,getRawEntityRecord:i,getEntityRecord:a,getUserPatternCategories:l,getBlockPatternCategories:c}=e(u.store),{get:d}=e(C.store),{getBlockTypes:p}=e(x.store),{getBlocksByName:m,getBlockAttributes:h}=e(g.store),_=r("read",{kind:"root",name:"site"})?a("root","site"):void 0;return{allowRightClickOverrides:d("core","allowRightClickOverrides"),blockTypes:p(),canUseUnfilteredHTML:i("postType",t,s)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:d("core","focusMode"),hasFixedToolbar:d("core","fixedToolbar")||!o,hiddenBlockTypes:d("core","hiddenBlockTypes"),isDistractionFree:d("core","distractionFree"),keepCaretInsideBlock:d("core","keepCaretInsideBlock"),hasUploadPermissions:r("create",{kind:"postType",name:"attachment"})??!0,userCanCreatePages:r("create",{kind:"postType",name:"page"}),pageOnFront:_?.page_on_front,pageForPosts:_?.page_for_posts,userPatternCategories:l(),restBlockPatternCategories:c(),sectionRootClientId:"template-locked"===n?m("core/post-content")?.[0]??"":m("core/group").find((e=>"main"===h(e)?.tagName))??""}}),[t,s,o,n]),{merged:j}=Ti(),E=j.styles??Bi,T=j._links??Bi,B=e.__experimentalAdditionalBlockPatterns??e.__experimentalBlockPatterns,I=e.__experimentalAdditionalBlockPatternCategories??e.__experimentalBlockPatternCategories,N=(0,p.useMemo)((()=>[...B||[]].filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(t)))),[B,t]),R=(0,p.useMemo)((()=>[...I||[],...k||[]].filter(((e,t,s)=>t===s.findIndex((t=>e.name===t.name))))),[I,k]),{undo:D,setIsInserterOpened:A}=(0,d.useDispatch)(vc),{editMediaEntity:M}=$((0,d.useDispatch)(u.store)),{saveEntityRecord:L}=(0,d.useDispatch)(u.store),O=(0,p.useCallback)((e=>y?L("postType","page",e):Promise.reject({message:(0,fs.__)("You do not have permission to create Pages.")})),[L,y]),F=(0,p.useMemo)((()=>{if(f&&f.length>0){return(!0===e.allowedBlockTypes?i.map((({name:e})=>e)):e.allowedBlockTypes||[]).filter((e=>!f.includes(e)))}return e.allowedBlockTypes}),[e.allowedBlockTypes,f,i]),V=!1===e.focusMode;return(0,p.useMemo)((()=>{const s={...Object.fromEntries(Object.entries(e).filter((([e])=>Ni.includes(e)))),[Ri]:E,[Di]:T,allowedBlockTypes:F,allowRightClickOverrides:r,focusMode:a&&!V,hasFixedToolbar:l,isDistractionFree:c,keepCaretInsideBlock:h,[Oi]:_?M:void 0,mediaUpload:_?yi:void 0,mediaSideload:_?vi:void 0,__experimentalBlockPatterns:N,[Ai]:e=>{const{hasFinishedResolution:s,getBlockPatternsForPostType:n}=$(e(u.store)),o=n(t);return s("getBlockPatterns")?o:void 0},[Mi]:Ii,__experimentalBlockPatternCategories:R,__experimentalUserPatternCategories:S,__experimentalFetchLinkSuggestions:(t,s)=>(0,u.__experimentalFetchLinkSuggestions)(t,s,e),inserterMediaCategories:di,__experimentalFetchRichUrlData:u.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:b,__experimentalUndo:D,outlineMode:!c&&"wp_template"===t,__experimentalCreatePageEntity:O,__experimentalUserCanCreatePages:y,pageOnFront:v,pageForPosts:w,__experimentalPreferPatternsOnRoot:"wp_template"===t,templateLock:"wp_navigation"===t?"insert":e.templateLock,template:"wp_navigation"===t?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:A,[Li]:P,editorTool:"post-only"===n&&"wp_template"!==t?"edit":void 0};return s}),[F,r,a,V,l,c,h,e,_,S,N,R,b,D,O,y,v,w,t,A,P,E,T,n,M])};const Vi=["core/post-title","core/post-featured-image","core/post-content"];function Ui(){const e=(0,p.useMemo)((()=>[...(0,h.applyFilters)("editor.postContentBlockTypes",Vi)]),[]),t=(0,d.useSelect)((t=>{const{getPostBlocksByName:s}=$(t(vc));return s(e)}),[e]);return t}function Hi(){const e=Ui(),{templateParts:t}=(0,d.useSelect)((e=>{const{getBlocksByName:t}=e(g.store);return{templateParts:t("core/template-part")}}),[]),s=(0,d.useSelect)((e=>{const{getBlockOrder:s}=e(g.store);return t.flatMap((e=>s(e)))}),[t]),n=(0,d.useRegistry)();return(0,p.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:t}=n.dispatch(g.store);return e("","disabled"),()=>{t("")}}),[n]),(0,p.useEffect)((()=>{const{setBlockEditingMode:t,unsetBlockEditingMode:s}=n.dispatch(g.store);return n.batch((()=>{for(const s of e)t(s,"contentOnly")})),()=>{n.batch((()=>{for(const t of e)s(t)}))}}),[e,n]),(0,p.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:s}=n.dispatch(g.store);return n.batch((()=>{for(const s of t)e(s,"contentOnly")})),()=>{n.batch((()=>{for(const e of t)s(e)}))}}),[t,n]),(0,p.useEffect)((()=>{const{setBlockEditingMode:e,unsetBlockEditingMode:t}=n.dispatch(g.store);return n.batch((()=>{for(const t of s)e(t,"disabled")})),()=>{n.batch((()=>{for(const e of s)t(e)}))}}),[s,n]),null}function zi(){const e=(0,d.useSelect)((e=>e(g.store).getBlockOrder()?.[0]),[]),{setBlockEditingMode:t,unsetBlockEditingMode:s}=(0,d.useDispatch)(g.store);(0,p.useEffect)((()=>{if(e)return t(e,"contentOnly"),()=>{s(e)}}),[e,s,t])}const Gi=["wp_block","wp_template","wp_template_part"];var $i=(0,c.jsxs)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,c.jsx)(L.Path,{d:"m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"}),(0,c.jsx)(L.Path,{d:"m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"})]}),Wi=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),Zi=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})}),Yi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"})}),qi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})}),Ki=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),Qi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),Xi=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),Ji=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),ea=(0,c.jsxs)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,c.jsx)(L.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,c.jsx)(L.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),ta=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})}),sa=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z"})});const na=window.wp.commands;var oa=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})}),ra=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})});const ia=window.wp.viewport,aa=window.wp.plugins;var la=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})});function ca(e){return["core/edit-post","core/edit-site"].includes(e)?(k()(`${e} interface scope`,{alternative:"core interface scope",hint:"core/edit-post and core/edit-site are merging.",version:"6.6"}),"core"):e}function da(e,t){return"core"===e&&"edit-site/template"===t?(k()("edit-site/template sidebar",{alternative:"edit-post/document",version:"6.6"}),"edit-post/document"):"core"===e&&"edit-site/block-inspector"===t?(k()("edit-site/block-inspector sidebar",{alternative:"edit-post/block",version:"6.6"}),"edit-post/block"):t}const ua=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=ca(e),area:t=da(e,t)}),pa=(e,t)=>({registry:s,dispatch:n})=>{if(!t)return;e=ca(e),t=da(e,t);s.select(C.store).get(e,"isComplementaryAreaVisible")||s.dispatch(C.store).set(e,"isComplementaryAreaVisible",!0),n({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},ma=e=>({registry:t})=>{e=ca(e);t.select(C.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(C.store).set(e,"isComplementaryAreaVisible",!1)},ha=(e,t)=>({registry:s})=>{if(!t)return;e=ca(e),t=da(e,t);const n=s.select(C.store).get(e,"pinnedItems");!0!==n?.[t]&&s.dispatch(C.store).set(e,"pinnedItems",{...n,[t]:!0})},ga=(e,t)=>({registry:s})=>{if(!t)return;e=ca(e),t=da(e,t);const n=s.select(C.store).get(e,"pinnedItems");s.dispatch(C.store).set(e,"pinnedItems",{...n,[t]:!1})};function _a(e,t){return function({registry:s}){k()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),s.dispatch(C.store).toggle(e,t)}}function fa(e,t,s){return function({registry:n}){k()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),n.dispatch(C.store).set(e,t,!!s)}}function ba(e,t){return function({registry:s}){k()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),s.dispatch(C.store).setDefaults(e,t)}}function ya(e){return{type:"OPEN_MODAL",name:e}}function xa(){return{type:"CLOSE_MODAL"}}const va=(0,d.createRegistrySelector)((e=>(t,s)=>{s=ca(s);const n=e(C.store).get(s,"isComplementaryAreaVisible");if(void 0!==n)return!1===n?null:t?.complementaryAreas?.[s]})),wa=(0,d.createRegistrySelector)((e=>(t,s)=>{s=ca(s);const n=e(C.store).get(s,"isComplementaryAreaVisible"),o=t?.complementaryAreas?.[s];return n&&void 0===o})),Sa=(0,d.createRegistrySelector)((e=>(t,s,n)=>{n=da(s=ca(s),n);const o=e(C.store).get(s,"pinnedItems");return o?.[n]??!0})),ka=(0,d.createRegistrySelector)((e=>(t,s,n)=>(k()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(C.store).get(s,n))));function Ca(e,t){return e.activeModal===t}var Pa=(0,d.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:s,area:n}=t;return e[s]?e:{...e,[s]:n}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:s,area:n}=t;return{...e,[s]:n}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}});const ja=(0,d.createReduxStore)("core/interface",{reducer:Pa,actions:o,selectors:r});function Ea({as:e=Hn.Button,scope:t,identifier:s,icon:n,selectedIcon:o,name:r,shortcut:i,...a}){const l=e,u=(0,aa.usePluginContext)(),p=n||u.icon,m=s||`${u.name}/${r}`,h=(0,d.useSelect)((e=>e(ja).getActiveComplementaryArea(t)===m),[m,t]),{enableComplementaryArea:g,disableComplementaryArea:_}=(0,d.useDispatch)(ja);return(0,c.jsx)(l,{icon:o&&h?o:p,"aria-controls":m.replace("/",":"),"aria-checked":(f=a.role,["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(f)?h:void 0),onClick:()=>{h?_(t):g(t,m)},shortcut:i,...a});var f}(0,d.register)(ja);var Ta=({children:e,className:t,toggleButtonProps:s})=>{const n=(0,c.jsx)(Ea,{icon:la,...s});return(0,c.jsxs)("div",{className:mr("components-panel__header","interface-complementary-area-header",t),tabIndex:-1,children:[e,n]})};const Ba=()=>{};function Ia({name:e,as:t=Hn.Button,onClick:s,...n}){return(0,c.jsx)(Hn.Fill,{name:e,children:({onClick:e})=>(0,c.jsx)(t,{onClick:s||e?(...t)=>{(s||Ba)(...t),(e||Ba)(...t)}:void 0,...n})})}Ia.Slot=function({name:e,as:t=Hn.MenuGroup,fillProps:s={},bubblesVirtually:n,...o}){return(0,c.jsx)(Hn.Slot,{name:e,bubblesVirtually:n,fillProps:s,children:e=>{if(!p.Children.toArray(e).length)return null;const s=[];p.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&s.push(t)}));const n=p.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&s.includes(e.props.__unstableTarget)?null:e));return(0,c.jsx)(t,{...o,children:n})}})};var Na=Ia;const Ra=({__unstableExplicitMenuItem:e,__unstableTarget:t,...s})=>(0,c.jsx)(Hn.MenuItem,{...s});function Da({scope:e,target:t,__unstableExplicitMenuItem:s,...n}){return(0,c.jsx)(Ea,{as:n=>(0,c.jsx)(Na,{__unstableExplicitMenuItem:s,__unstableTarget:`${e}/${t}`,as:Ra,name:`${e}/plugin-more-menu`,...n}),role:"menuitemcheckbox",selectedIcon:zn,name:t,scope:e,...n})}function Aa({scope:e,...t}){return(0,c.jsx)(Hn.Fill,{name:`PinnedItems/${e}`,...t})}Aa.Slot=function({scope:e,className:t,...s}){return(0,c.jsx)(Hn.Slot,{name:`PinnedItems/${e}`,...s,children:e=>e?.length>0&&(0,c.jsx)("div",{className:mr(t,"interface-pinned-items"),children:e})})};var Ma=Aa;const La={open:{width:280},closed:{width:0},mobileOpen:{width:"100vw"}};function Oa({activeArea:e,isActive:t,scope:s,children:n,className:o,id:r}){const i=(0,m.useReducedMotion)(),a=(0,m.useViewportMatch)("medium","<"),l=(0,m.usePrevious)(e),d=(0,m.usePrevious)(t),[,u]=(0,p.useState)({});(0,p.useEffect)((()=>{u({})}),[t]);const h={type:"tween",duration:i||a||l&&e&&e!==l?0:.3,ease:[.6,0,.4,1]};return(0,c.jsx)(Hn.Fill,{name:`ComplementaryArea/${s}`,children:(0,c.jsx)(Hn.__unstableAnimatePresence,{initial:!1,children:(d||t)&&(0,c.jsx)(Hn.__unstableMotion.div,{variants:La,initial:"closed",animate:a?"mobileOpen":"open",exit:"closed",transition:h,className:"interface-complementary-area__fill",children:(0,c.jsx)("div",{id:r,className:o,style:{width:a?"100vw":280},children:n})})})})}function Fa({children:e,className:t,closeLabel:s=(0,fs.__)("Close plugin"),identifier:n,header:o,headerClassName:r,icon:i,isPinnable:a=!0,panelClassName:l,scope:u,name:h,title:g,toggleShortcut:_,isActiveByDefault:f}){const b=(0,aa.usePluginContext)(),y=i||b.icon,x=n||`${b.name}/${h}`,[v,w]=(0,p.useState)(!1),{isLoading:S,isActive:k,isPinned:P,activeArea:j,isSmall:E,isLarge:T,showIconLabels:B}=(0,d.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:s,isItemPinned:n}=e(ja),{get:o}=e(C.store),r=t(u);return{isLoading:s(u),isActive:r===x,isPinned:n(u,x),activeArea:r,isSmall:e(ia.store).isViewportMatch("< medium"),isLarge:e(ia.store).isViewportMatch("large"),showIconLabels:o("core","showIconLabels")}}),[x,u]),I=(0,m.useViewportMatch)("medium","<");!function(e,t,s,n,o){const r=(0,p.useRef)(!1),i=(0,p.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:l}=(0,d.useDispatch)(ja);(0,p.useEffect)((()=>{n&&o&&!r.current?(l(e),i.current=!0):i.current&&!o&&r.current?(i.current=!1,a(e,t)):i.current&&s&&s!==t&&(i.current=!1),o!==r.current&&(r.current=o)}),[n,o,e,t,s,l,a])}(u,x,j,k,E);const{enableComplementaryArea:N,disableComplementaryArea:R,pinItem:D,unpinItem:A}=(0,d.useDispatch)(ja);if((0,p.useEffect)((()=>{f&&void 0===j&&!E?N(u,x):void 0===j&&E&&R(u,x),w(!0)}),[j,f,u,x,E,N,R]),v)return(0,c.jsxs)(c.Fragment,{children:[a&&(0,c.jsx)(Ma,{scope:u,children:P&&(0,c.jsx)(Ea,{scope:u,identifier:x,isPressed:k&&(!B||T),"aria-expanded":k,"aria-disabled":S,label:g,icon:B?zn:y,showTooltip:!B,variant:B?"tertiary":void 0,size:"compact",shortcut:_})}),h&&a&&(0,c.jsx)(Da,{target:h,scope:u,icon:y,identifier:x,children:g}),(0,c.jsxs)(Oa,{activeArea:j,isActive:k,className:mr("interface-complementary-area",t),scope:u,id:x.replace("/",":"),children:[(0,c.jsx)(Ta,{className:r,closeLabel:s,onClose:()=>R(u),toggleButtonProps:{label:s,size:"compact",shortcut:_,scope:u,identifier:x},children:o||(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("h2",{className:"interface-complementary-area-header__title",children:g}),a&&!I&&(0,c.jsx)(Hn.Button,{className:"interface-complementary-area__pin-unpin-item",icon:P?oa:ra,label:P?(0,fs.__)("Unpin from toolbar"):(0,fs.__)("Pin to toolbar"),onClick:()=>(P?A:D)(u,x),isPressed:P,"aria-expanded":P,size:"compact"})]})}),(0,c.jsx)(Hn.Panel,{className:l,children:e})]})]})}Fa.Slot=function({scope:e,...t}){return(0,c.jsx)(Hn.Slot,{name:`ComplementaryArea/${e}`,...t})};var Va=Fa;var Ua=({isActive:e})=>((0,p.useEffect)((()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}}),[]),(0,p.useEffect)((()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")})),[e]),null);const Ha=(0,p.forwardRef)((({children:e,className:t,ariaLabel:s,as:n="div",...o},r)=>(0,c.jsx)(n,{ref:r,className:mr("admin-ui-navigable-region",t),"aria-label":s,role:"region",tabIndex:"-1",...o,children:e})));Ha.displayName="NavigableRegion";var za=Ha;const Ga={type:"tween",duration:.25,ease:[.6,0,.4,1]};const $a={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...Ga,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...Ga,delay:.8,delayChildren:.8}}};var Wa=(0,p.forwardRef)((function({isDistractionFree:e,footer:t,header:s,editorNotices:n,sidebar:o,secondarySidebar:r,content:i,actions:a,labels:l,className:d},u){const[h,g]=(0,m.useResizeObserver)(),_=(0,m.useViewportMatch)("medium","<"),f={type:"tween",duration:(0,m.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]};!function(e){(0,p.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const b={...{header:(0,fs._x)("Header","header landmark area"),body:(0,fs.__)("Content"),secondarySidebar:(0,fs.__)("Block Library"),sidebar:(0,fs._x)("Settings","settings landmark area"),actions:(0,fs.__)("Publish"),footer:(0,fs.__)("Footer")},...l};return(0,c.jsxs)("div",{ref:u,className:mr(d,"interface-interface-skeleton",!!t&&"has-footer"),children:[(0,c.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,c.jsx)(Hn.__unstableAnimatePresence,{initial:!1,children:!!s&&(0,c.jsx)(za,{as:Hn.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":b.header,initial:e&&!_?"distractionFreeHidden":"hidden",whileHover:e&&!_?"distractionFreeHover":"visible",animate:e&&!_?"distractionFreeDisabled":"visible",exit:e&&!_?"distractionFreeHidden":"hidden",variants:$a,transition:f,children:s})}),e&&(0,c.jsx)("div",{className:"interface-interface-skeleton__header",children:n}),(0,c.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,c.jsx)(Hn.__unstableAnimatePresence,{initial:!1,children:!!r&&(0,c.jsx)(za,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:b.secondarySidebar,as:Hn.__unstableMotion.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:g.width},closed:{width:0}},transition:f,children:(0,c.jsxs)(Hn.__unstableMotion.div,{style:{position:"absolute",width:_?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:f,children:[h,r]})})}),(0,c.jsx)(za,{className:"interface-interface-skeleton__content",ariaLabel:b.body,children:i}),!!o&&(0,c.jsx)(za,{className:"interface-interface-skeleton__sidebar",ariaLabel:b.sidebar,children:o}),!!a&&(0,c.jsx)(za,{className:"interface-interface-skeleton__actions",ariaLabel:b.actions,children:a})]})]}),!!t&&(0,c.jsx)(za,{className:"interface-interface-skeleton__footer",ariaLabel:b.footer,children:t})]})}));const{RenamePatternModal:Za}=$(ao.privateApis),Ya="editor/pattern-rename";function qa(){const{record:e,postType:t}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),{getEditedEntityRecord:n}=e(u.store),o=t();return{record:n("postType",o,s()),postType:o}}),[]),{closeModal:s}=(0,d.useDispatch)(ja);return(0,d.useSelect)((e=>e(ja).isModalActive(Ya)))&&t===N?(0,c.jsx)(Za,{onClose:s,pattern:e}):null}const{DuplicatePatternModal:Ka}=$(ao.privateApis),Qa="editor/pattern-duplicate";function Xa(){const{record:e,postType:t}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),{getEditedEntityRecord:n}=e(u.store),o=t();return{record:n("postType",o,s()),postType:o}}),[]),{closeModal:s}=(0,d.useDispatch)(ja);return(0,d.useSelect)((e=>e(ja).isModalActive(Qa)))&&t===N?(0,c.jsx)(Ka,{onClose:s,onSuccess:()=>s(),pattern:e}):null}const{BlockRemovalWarningModal:Ja}=$(g.privateApis),el=["core/post-content","core/post-template","core/query"],tl=[{postTypes:["wp_template","wp_template_part"],callback(e){if(e.filter((({name:e})=>el.includes(e))).length)return(0,fs._n)("Deleting this block will stop your post or page content from displaying on this template. It is not recommended.","Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.",e.length)}},{postTypes:["wp_block"],callback(e){if(e.filter((({attributes:e})=>e?.metadata?.bindings&&Object.values(e.metadata.bindings).some((e=>"core/pattern-overrides"===e.source)))).length)return(0,fs._n)("The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?","Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?",e.length)}}];function sl(){const e=(0,d.useSelect)((e=>e(vc).getCurrentPostType()),[]),t=(0,p.useMemo)((()=>tl.filter((t=>t.postTypes.includes(e)))),[e]);return Ja&&t?(0,c.jsx)(Ja,{rules:t}):null}function nl({blockPatterns:e,onChoosePattern:t}){const{editEntityRecord:s}=(0,d.useDispatch)(u.store),{postType:n,postId:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc);return{postType:t(),postId:s()}}),[]);return(0,c.jsx)(g.__experimentalBlockPatternsList,{blockPatterns:e,onClickPattern:(e,r)=>{s("postType",n,o,{blocks:r,content:({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e)}),t()}})}function ol({onClose:e}){const[t,s]=(0,p.useState)(!0),{set:n}=(0,d.useDispatch)(C.store),o=function(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,d.useSelect)((e=>{const{getPatternsByBlockTypes:t,getBlocksByName:s}=e(g.store),{getCurrentPostType:n,getRenderingMode:o}=e(vc);return{blockPatternsWithPostContentBlockType:t("core/post-content","post-only"===o()?"":s("core/post-content")?.[0]),postType:n()}}),[]);return(0,p.useMemo)((()=>e?.length?e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t))):[]),[t,e])}();if(!(o.length>0))return null;function r(){e(),n("core","enableChoosePatternModal",t)}return(0,c.jsxs)(Hn.Modal,{className:"editor-start-page-options__modal",title:(0,fs.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:r,children:[(0,c.jsx)("div",{className:"editor-start-page-options__modal-content",children:(0,c.jsx)(nl,{blockPatterns:o,onChoosePattern:r})}),(0,c.jsx)(Hn.Flex,{className:"editor-start-page-options__modal__actions",justify:"flex-start",expanded:!1,children:(0,c.jsx)(Hn.FlexItem,{children:(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:t,label:(0,fs.__)("Always show starter patterns for new pages"),onChange:e=>{s(e)}})})})]})}function rl(){const[e,t]=(0,p.useState)(!1),{isEditedPostDirty:s,isEditedPostEmpty:n}=(0,d.useSelect)(vc),{isModalActive:o}=(0,d.useSelect)(ja),{enabled:r,postId:i}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(vc),n=e(C.store).get("core","enableChoosePatternModal");return{postId:t(),enabled:n&&B!==s()}}),[]);return(0,p.useEffect)((()=>{const e=!s()&&n(),i=o("editor/preferences");r&&e&&!i&&t(!0)}),[r,i,s,n,o]),e?(0,c.jsx)(ol,{onClose:()=>t(!1)}):null}const il=window.wp.keyboardShortcuts,al=[{keyCombination:{modifier:"primary",character:"b"},description:(0,fs.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,fs.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,fs.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,fs.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,fs.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,fs.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,fs.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,fs.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,fs.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,fs.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,fs.__)("Add non breaking space.")}],ll=window.wp.keycodes;function cl({keyCombination:e,forceAriaLabel:t}){const s=e.modifier?ll.displayShortcutList[e.modifier](e.character):e.character,n=e.modifier?ll.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,c.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||n,children:(Array.isArray(s)?s:[s]).map(((e,t)=>"+"===e?(0,c.jsx)(p.Fragment,{children:e},t):(0,c.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}var dl=function({description:e,keyCombination:t,aliases:s=[],ariaLabel:n}){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,c.jsxs)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-term",children:[(0,c.jsx)(cl,{keyCombination:t,forceAriaLabel:n}),s.map(((e,t)=>(0,c.jsx)(cl,{keyCombination:e,forceAriaLabel:n},t)))]})]})};var ul=function({name:e}){const{keyCombination:t,description:s,aliases:n}=(0,d.useSelect)((t=>{const{getShortcutKeyCombination:s,getShortcutDescription:n,getShortcutAliases:o}=t(il.store);return{keyCombination:s(e),aliases:o(e),description:n(e)}}),[e]);return t?(0,c.jsx)(dl,{keyCombination:t,description:s,aliases:n}):null};const pl="editor/keyboard-shortcut-help",ml=({shortcuts:e})=>(0,c.jsx)("ul",{className:"editor-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,c.jsx)("li",{className:"editor-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,c.jsx)(ul,{name:e}):(0,c.jsx)(dl,{...e})},t)))}),hl=({title:e,shortcuts:t,className:s})=>(0,c.jsxs)("section",{className:mr("editor-keyboard-shortcut-help-modal__section",s),children:[!!e&&(0,c.jsx)("h2",{className:"editor-keyboard-shortcut-help-modal__section-title",children:e}),(0,c.jsx)(ml,{shortcuts:t})]}),gl=({title:e,categoryName:t,additionalShortcuts:s=[]})=>{const n=(0,d.useSelect)((e=>e(il.store).getCategoryShortcuts(t)),[t]);return(0,c.jsx)(hl,{title:e,shortcuts:n.concat(s)})};var _l=function(){const e=(0,d.useSelect)((e=>e(ja).isModalActive(pl)),[]),{openModal:t,closeModal:s}=(0,d.useDispatch)(ja),n=()=>{e?s():t(pl)};return(0,il.useShortcut)("core/editor/keyboard-shortcuts",n),e?(0,c.jsxs)(Hn.Modal,{className:"editor-keyboard-shortcut-help-modal",title:(0,fs.__)("Keyboard shortcuts"),closeButtonLabel:(0,fs.__)("Close"),onRequestClose:n,children:[(0,c.jsx)(hl,{className:"editor-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/editor/keyboard-shortcuts"]}),(0,c.jsx)(gl,{title:(0,fs.__)("Global shortcuts"),categoryName:"global"}),(0,c.jsx)(gl,{title:(0,fs.__)("Selection shortcuts"),categoryName:"selection"}),(0,c.jsx)(gl,{title:(0,fs.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,fs.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,fs.__)("Forward-slash")}]}),(0,c.jsx)(hl,{title:(0,fs.__)("Text formatting"),shortcuts:al}),(0,c.jsx)(gl,{title:(0,fs.__)("List View shortcuts"),categoryName:"list-view"})]}):null};function fl({clientId:e,onClose:t}){const s=Ui(),{entity:n,onNavigateToEntityRecord:o,canEditTemplates:r}=(0,d.useSelect)((t=>{const{getBlockParentsByBlockName:n,getSettings:o,getBlockAttributes:r,getBlockParents:i}=t(g.store),{getCurrentTemplateId:a,getRenderingMode:l}=t(vc),c=n(e,"core/block",!0)[0];let d;if(c?d=t(u.store).getEntityRecord("postType","wp_block",r(c).ref):"template-locked"!==l()||i(e).some((e=>s.includes(e)))||(d=t(u.store).getEntityRecord("postType","wp_template",a())),!d)return{};return{canEditTemplates:t(u.store).canUser("create",{kind:"postType",name:"wp_template"}),entity:d,onNavigateToEntityRecord:o().onNavigateToEntityRecord}}),[e,s]);if(!n)return(0,c.jsx)(bl,{clientId:e,onClose:t});const i="wp_block"===n.type;let a=i?(0,fs.__)("Edit the pattern to move, delete, or make further changes to this block."):(0,fs.__)("Edit the template to move, delete, or make further changes to this block.");return r||(a=(0,fs.__)("Only users with permissions to edit the template can move or delete this block")),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__unstableBlockSettingsMenuFirstItem,{children:(0,c.jsx)(Hn.MenuItem,{onClick:()=>{o({postId:n.id,postType:n.type})},disabled:!r,children:i?(0,fs.__)("Edit pattern"):(0,fs.__)("Edit template")})}),(0,c.jsx)(Hn.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:a})]})}function bl({clientId:e,onClose:t}){const{contentLockingParent:s}=(0,d.useSelect)((t=>{const{getContentLockingParent:s}=$(t(g.store));return{contentLockingParent:s(e)}}),[e]),n=(0,g.useBlockDisplayInformation)(s),o=(0,d.useDispatch)(g.store);if(!n?.title)return null;const{modifyContentLockBlock:r}=$(o);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__unstableBlockSettingsMenuFirstItem,{children:(0,c.jsx)(Hn.MenuItem,{onClick:()=>{r(s),t()},children:(0,fs._x)("Unlock","Unlock content locked blocks")})}),(0,c.jsx)(Hn.__experimentalText,{variant:"muted",as:"p",className:"editor-content-only-settings-menu__description",children:(0,fs.__)("Temporarily unlock the parent block to edit, delete or make further changes to this block.")})]})}function yl(){return(0,c.jsx)(g.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>1===e.length&&(0,c.jsx)(fl,{clientId:e[0],onClose:t})})}function xl(e){const{slug:t,patterns:s}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),{getEntityRecord:n,getBlockPatterns:o}=e(u.store),r=s();return{slug:n("postType",t(),r).slug,patterns:o()}}),[]),n=(0,d.useSelect)((e=>e(u.store).getCurrentTheme().stylesheet));return(0,p.useMemo)((()=>[{name:"fallback",blocks:(0,x.parse)(e),title:(0,fs.__)("Fallback content")},...s.filter((e=>Array.isArray(e.templateTypes)&&e.templateTypes.some((e=>t.startsWith(e))))).map((e=>({...e,blocks:(0,x.parse)(e.content).map((e=>function(e){return e.innerBlocks.find((e=>"core/template-part"===e.name))&&(e.innerBlocks=e.innerBlocks.map((e=>("core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=n),e)))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=n),e}(e)))})))]),[e,t,s])}function vl({fallbackContent:e,onChoosePattern:t,postType:s}){const[,,n]=(0,u.useEntityBlockEditor)("postType",s),o=xl(e);return(0,c.jsx)(g.__experimentalBlockPatternsList,{blockPatterns:o,onClickPattern:(e,s)=>{n(s,{selection:void 0}),t()}})}function wl({slug:e,isCustom:t,onClose:s,postType:n}){const o=function(e,t=!1){return(0,d.useSelect)((s=>{const{getEntityRecord:n,getDefaultTemplateId:o}=s(u.store),r=o({slug:e,is_custom:t,ignore_empty:!0});return r?n("postType",B,r)?.content?.raw:void 0}),[e,t])}(e,t);return o?(0,c.jsxs)(Hn.Modal,{className:"editor-start-template-options__modal",title:(0,fs.__)("Choose a pattern"),closeLabel:(0,fs.__)("Cancel"),focusOnMount:"firstElement",onRequestClose:s,isFullScreen:!0,children:[(0,c.jsx)("div",{className:"editor-start-template-options__modal-content",children:(0,c.jsx)(vl,{fallbackContent:o,slug:e,isCustom:t,postType:n,onChoosePattern:()=>{s()}})}),(0,c.jsx)(Hn.Flex,{className:"editor-start-template-options__modal__actions",justify:"flex-end",expanded:!1,children:(0,c.jsx)(Hn.FlexItem,{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:s,children:(0,fs.__)("Skip")})})})]}):null}function Sl(){const[e,t]=(0,p.useState)(!1),{shouldOpenModal:s,slug:n,isCustom:o,postType:r,postId:i}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),n=t(),o=s(),{getEditedEntityRecord:r,hasEditsForEntityRecord:i}=e(u.store),a=r("postType",n,o);return{shouldOpenModal:!i("postType",n,o)&&""===a.content&&B===n,slug:a.slug,isCustom:a.is_custom,postType:n,postId:o}}),[]);return(0,p.useEffect)((()=>{t(!1)}),[r,i]),!s||e?null:(0,c.jsx)(wl,{slug:n,isCustom:o,postType:r,onClose:()=>t(!0)})}function kl(){const e=(0,d.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:s}=e(vc).getEditorSettings();return!t||!s}),[]),{getBlockSelectionStart:t}=(0,d.useSelect)(g.store),{getActiveComplementaryArea:s}=(0,d.useSelect)(ja),{enableComplementaryArea:n,disableComplementaryArea:o}=(0,d.useDispatch)(ja),{redo:r,undo:i,savePost:a,setIsListViewOpened:l,switchEditorMode:c,toggleDistractionFree:u}=(0,d.useDispatch)(vc),{isEditedPostDirty:p,isPostSavingLocked:m,isListViewOpened:h,getEditorMode:_}=(0,d.useSelect)(vc);return(0,il.useShortcut)("core/editor/toggle-mode",(()=>{c("visual"===_()?"text":"visual")}),{isDisabled:e}),(0,il.useShortcut)("core/editor/toggle-distraction-free",(()=>{u()})),(0,il.useShortcut)("core/editor/undo",(e=>{i(),e.preventDefault()})),(0,il.useShortcut)("core/editor/redo",(e=>{r(),e.preventDefault()})),(0,il.useShortcut)("core/editor/save",(e=>{e.preventDefault(),m()||p()&&a()})),(0,il.useShortcut)("core/editor/toggle-list-view",(e=>{h()||(e.preventDefault(),l(!0))})),(0,il.useShortcut)("core/editor/toggle-sidebar",(e=>{e.preventDefault();if(["edit-post/document","edit-post/block"].includes(s("core")))o("core");else{const e=t()?"edit-post/block":"edit-post/document";n("core",e)}})),null}function Cl({clientId:e,onClose:t}){const{getBlocks:s}=(0,d.useSelect)(g.store),{replaceBlocks:n}=(0,d.useDispatch)(g.store);return(0,d.useSelect)((t=>t(g.store).canRemoveBlock(e)),[e])?(0,c.jsx)(Hn.MenuItem,{onClick:()=>{n(e,s(e)),t()},children:(0,fs.__)("Detach")}):null}function Pl({clientIds:e,blocks:t}){const[s,n]=(0,p.useState)(!1),{replaceBlocks:o}=(0,d.useDispatch)(g.store),{createSuccessNotice:r}=(0,d.useDispatch)(_s.store),{isBlockBasedTheme:i,canCreate:a}=(0,d.useSelect)((e=>({isBlockBasedTheme:e(u.store).getCurrentTheme()?.is_block_theme,canCreate:e(g.store).canInsertBlockType("core/template-part")})),[]);if(!i||!a)return null;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.MenuItem,{icon:U,onClick:()=>{n(!0)},"aria-expanded":s,"aria-haspopup":"dialog",children:(0,fs.__)("Create template part")}),s&&(0,c.jsx)(Jn,{closeModal:()=>{n(!1)},blocks:t,onCreate:async t=>{o(e,(0,x.createBlock)("core/template-part",{slug:t.slug,theme:t.theme})),r((0,fs.__)("Template part created."),{type:"snackbar"})}})]})}function jl(){return(0,c.jsx)(g.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>(0,c.jsx)(El,{clientIds:e,onClose:t})})}function El({clientIds:e,onClose:t}){const{blocks:s}=(0,d.useSelect)((t=>{const{getBlocksByClientId:s}=t(g.store);return{blocks:s(e)}}),[e]);return 1===s.length&&"core/template-part"===s[0]?.name?(0,c.jsx)(Cl,{clientId:e[0],onClose:t}):(0,c.jsx)(Pl,{clientIds:e,blocks:s})}const{ExperimentalBlockEditorProvider:Tl}=$(g.privateApis),{PatternsMenuItems:Bl}=$(ao.privateApis),Il=()=>{},Nl=["wp_block","wp_navigation","wp_template_part"];const Rl=ri((({post:e,settings:t,recovery:s,initialEdits:n,children:o,BlockEditorProviderComponent:r=Tl,__unstableTemplate:i})=>{const a=!!i,{editorSettings:l,selection:m,isReady:_,mode:f,defaultMode:b,postTypeEntities:y}=(0,d.useSelect)((t=>{const{getEditorSettings:s,getEditorSelection:n,getRenderingMode:o,__unstableIsEditorReady:r,getDefaultRenderingMode:i}=$(t(vc)),{getEntitiesConfig:l}=t(u.store),c=o(),d=i(e.type),p="template-locked"===d?a:void 0!==d,m=void 0!==d;return{editorSettings:s(),isReady:r(),mode:m?c:void 0,defaultMode:p?d:void 0,selection:n(),postTypeEntities:"wp_template"===e.type?l("postType"):null}}),[e.type,a]),v=a&&"post-only"!==f,w=v?i:e,S=(0,p.useMemo)((()=>{const t={};if("wp_template"===e.type){if("page"===e.slug)t.postType="page";else if("single"===e.slug)t.postType="post";else if("single"===e.slug.split("-")[0]){const s=y?.map((e=>e.name))||[],n=e.slug.match(`^single-(${s.join("|")})(?:-.+)?$`);n&&(t.postType=n[1])}}else Nl.includes(w.type)&&!v||(t.postId=e.id,t.postType=e.type);return{...t,templateSlug:"wp_template"===w.type?w.slug:void 0}}),[v,e.id,e.type,e.slug,w.type,w.slug,y]),{id:k,type:P}=w,j=Fi(l,P,k,f),[E,T,R]=function(e,t,s){const n="template-locked"===s?"template":"post",[o,r,i]=(0,u.useEntityBlockEditor)("postType",e.type,{id:e.id}),[a,l,c]=(0,u.useEntityBlockEditor)("postType",t?.type,{id:t?.id}),d=(0,p.useMemo)((()=>{if("wp_navigation"===e.type)return[(0,x.createBlock)("core/navigation",{ref:e.id,templateLock:!1})]}),[e.type,e.id]),m=(0,p.useMemo)((()=>d||("template"===n?a:o)),[d,n,a,o]);return t&&"template-locked"===s||"wp_navigation"===e.type?[m,Il,Il]:[m,"post"===n?r:l,"post"===n?i:c]}(e,i,f),{updatePostLock:D,setupEditor:A,updateEditorSettings:M,setCurrentTemplateId:L,setEditedPost:O,setRenderingMode:F}=$((0,d.useDispatch)(vc)),{createWarningNotice:V}=(0,d.useDispatch)(_s.store);return(0,p.useLayoutEffect)((()=>{s||(D(t.postLock),A(e,n,t.template),t.autosave&&V((0,fs.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,fs.__)("View the autosave"),url:t.autosave.editLink}]}))}),[]),(0,p.useEffect)((()=>{O(e.type,e.id)}),[e.type,e.id,O]),(0,p.useEffect)((()=>{M(t)}),[t,M]),(0,p.useEffect)((()=>{L(i?.id)}),[i?.id,L]),(0,p.useEffect)((()=>{b&&F(b)}),[b,F]),function(e,t){(0,p.useEffect)((()=>((0,h.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((s,n)=>!(!Gi.includes(e)&&"core/template-part"===n.name&&"post-only"===t)&&s)),(0,h.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((t,s,n,{getBlockParentsByBlockName:o})=>Gi.includes(e)||"core/post-content"!==s.name?t:o(n,"core/query").length>0)),()=>{(0,h.removeFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter"),(0,h.removeFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter")})),[e,t])}(e.type,f),(0,na.useCommandLoader)({name:"core/editor/edit-ui",hook:function(){const{editorMode:e,isListViewOpen:t,showBlockBreadcrumbs:s,isDistractionFree:n,isFocusMode:o,isPreviewMode:r,isViewable:i,isCodeEditingEnabled:a,isRichEditingEnabled:l,isPublishSidebarEnabled:c}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{isListViewOpened:s,getCurrentPostType:n,getEditorSettings:o}=e(vc),{getSettings:r}=e(g.store),{getPostType:i}=e(u.store);return{editorMode:t("core","editorMode")??"visual",isListViewOpen:s(),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),isDistractionFree:t("core","distractionFree"),isFocusMode:t("core","focusMode"),isPreviewMode:r().isPreviewMode,isViewable:i(n())?.viewable??!1,isCodeEditingEnabled:o().codeEditingEnabled,isRichEditingEnabled:o().richEditingEnabled,isPublishSidebarEnabled:e(vc).isPublishSidebarEnabled()}}),[]),{getActiveComplementaryArea:p}=(0,d.useSelect)(ja),{toggle:m}=(0,d.useDispatch)(C.store),{createInfoNotice:h}=(0,d.useDispatch)(_s.store),{__unstableSaveForPreview:_,setIsListViewOpened:f,switchEditorMode:b,toggleDistractionFree:y,toggleSpotlightMode:x,toggleTopToolbar:v}=(0,d.useDispatch)(vc),{openModal:w,enableComplementaryArea:S,disableComplementaryArea:k}=(0,d.useDispatch)(ja),{getCurrentPostId:P}=(0,d.useSelect)(vc),j=a&&l;if(r)return{commands:[],isLoading:!1};const E=[];return E.push({name:"core/open-shortcut-help",label:(0,fs.__)("Keyboard shortcuts"),icon:$i,callback:({close:e})=>{e(),w("editor/keyboard-shortcut-help")}}),E.push({name:"core/toggle-distraction-free",label:n?(0,fs.__)("Exit Distraction free"):(0,fs.__)("Enter Distraction free"),callback:({close:e})=>{y(),e()}}),E.push({name:"core/open-preferences",label:(0,fs.__)("Editor preferences"),callback:({close:e})=>{e(),w("editor/preferences")}}),E.push({name:"core/toggle-spotlight-mode",label:o?(0,fs.__)("Exit Spotlight mode"):(0,fs.__)("Enter Spotlight mode"),callback:({close:e})=>{x(),e()}}),E.push({name:"core/toggle-list-view",label:t?(0,fs.__)("Close List View"):(0,fs.__)("Open List View"),icon:Wi,callback:({close:e})=>{f(!t),e(),h(t?(0,fs.__)("List View off."):(0,fs.__)("List View on."),{id:"core/editor/toggle-list-view/notice",type:"snackbar"})}}),E.push({name:"core/toggle-top-toolbar",label:(0,fs.__)("Top toolbar"),callback:({close:e})=>{v(),e()}}),j&&E.push({name:"core/toggle-code-editor",label:"visual"===e?(0,fs.__)("Open code editor"):(0,fs.__)("Exit code editor"),icon:Zi,callback:({close:t})=>{b("visual"===e?"text":"visual"),t()}}),E.push({name:"core/toggle-breadcrumbs",label:s?(0,fs.__)("Hide block breadcrumbs"):(0,fs.__)("Show block breadcrumbs"),callback:({close:e})=>{m("core","showBlockBreadcrumbs"),e(),h(s?(0,fs.__)("Breadcrumbs hidden."):(0,fs.__)("Breadcrumbs visible."),{id:"core/editor/toggle-breadcrumbs/notice",type:"snackbar"})}}),E.push({name:"core/open-settings-sidebar",label:(0,fs.__)("Show or hide the Settings panel"),icon:(0,fs.isRTL)()?Yi:qi,callback:({close:e})=>{const t=p("core");e(),"edit-post/document"===t?k("core"):S("core","edit-post/document")}}),E.push({name:"core/open-block-inspector",label:(0,fs.__)("Show or hide the Block settings panel"),icon:Ki,callback:({close:e})=>{const t=p("core");e(),"edit-post/block"===t?k("core"):S("core","edit-post/block")}}),E.push({name:"core/toggle-publish-sidebar",label:c?(0,fs.__)("Disable pre-publish checks"):(0,fs.__)("Enable pre-publish checks"),icon:Qi,callback:({close:e})=>{e(),m("core","isPublishSidebarEnabled"),h(c?(0,fs.__)("Pre-publish checks disabled."):(0,fs.__)("Pre-publish checks enabled."),{id:"core/editor/publish-sidebar/notice",type:"snackbar"})}}),i&&E.push({name:"core/preview-link",label:(0,fs.__)("Preview in a new tab"),icon:Fn,callback:async({close:e})=>{e();const t=P(),s=await _();window.open(s,`wp-preview-${t}`)}}),{commands:E,isLoading:!1}}}),(0,na.useCommandLoader)({name:"core/editor/contextual-commands",hook:function(){const{postType:e}=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(vc);return{postType:t()}}),[]),{openModal:t}=(0,d.useDispatch)(ja),s=[];return e===N&&(s.push({name:"core/rename-pattern",label:(0,fs.__)("Rename pattern"),icon:Xi,callback:({close:e})=>{t(Ya),e()}}),s.push({name:"core/duplicate-pattern",label:(0,fs.__)("Duplicate pattern"),icon:Ji,callback:({close:e})=>{t(Qa),e()}})),{isLoading:!1,commands:s}},context:"entity-edit"}),(0,na.useCommandLoader)({name:"core/editor/page-content-focus",hook:function(){const{onNavigateToEntityRecord:e,goBack:t,templateId:s,isPreviewMode:n}=(0,d.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s,getCurrentTemplateId:n}=$(e(vc)),o=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:s,goBack:o.onNavigateToPreviousEntityRecord,templateId:n(),isPreviewMode:o.isPreviewMode}}),[]),{editedRecord:o,hasResolved:r}=(0,u.useEntityRecord)("postType","wp_template",s);if(n)return{isLoading:!1,commands:[]};const i=[];return s&&r&&i.push({name:"core/switch-to-template-focus",label:(0,fs.sprintf)((0,fs.__)("Edit template: %s"),(0,Ln.decodeEntities)(o.title)),icon:W,callback:({close:t})=>{e({postId:s,postType:"wp_template"}),t()}}),t&&i.push({name:"core/switch-to-previous-entity",label:(0,fs.__)("Go back"),icon:ea,callback:({close:e})=>{t(),e()}}),{isLoading:!1,commands:i}},context:"entity-edit"}),(0,na.useCommandLoader)({name:"core/edit-site/manipulate-document",hook:function(){const{postType:e,postId:t}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(vc);return{postType:s(),postId:t()}}),[]),{editedRecord:s,hasResolved:n}=(0,u.useEntityRecord)("postType",e,t),{revertTemplate:o}=$((0,d.useDispatch)(vc));if(!n||![I,B].includes(e))return{isLoading:!0,commands:[]};const r=[];if(On(s)){const e=s.type===B?(0,fs.sprintf)((0,fs.__)("Reset template: %s"),(0,Ln.decodeEntities)(s.title)):(0,fs.sprintf)((0,fs.__)("Reset template part: %s"),(0,Ln.decodeEntities)(s.title));r.push({name:"core/reset-template",label:e,icon:(0,fs.isRTL)()?ta:sa,callback:({close:e})=>{o(s),e()}})}return{isLoading:!n,commands:r}}}),_&&f?(0,c.jsx)(u.EntityProvider,{kind:"root",type:"site",children:(0,c.jsx)(u.EntityProvider,{kind:"postType",type:e.type,id:e.id,children:(0,c.jsx)(g.BlockContextProvider,{value:S,children:(0,c.jsxs)(r,{value:E,onChange:R,onInput:T,selection:m,settings:j,useSubRegistry:!1,children:[o,!t.isPreviewMode&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Bl,{}),(0,c.jsx)(jl,{}),(0,c.jsx)(yl,{}),"template-locked"===f&&(0,c.jsx)(Hi,{}),"wp_navigation"===P&&(0,c.jsx)(zi,{}),(0,c.jsx)(kl,{}),(0,c.jsx)(_l,{}),(0,c.jsx)(sl,{}),(0,c.jsx)(rl,{}),(0,c.jsx)(Sl,{}),(0,c.jsx)(qa,{}),(0,c.jsx)(Xa,{})]})]})})})}):null}));function Dl(e){return(0,c.jsx)(Rl,{...e,BlockEditorProviderComponent:g.BlockEditorProvider,children:e.children})}var Al=Dl;const{useGlobalStyle:Ml}=$(g.privateApis);function Ll({template:e,post:t}){const[s="white"]=Ml("color.background"),[n]=(0,u.useEntityBlockEditor)("postType",t.type,{id:t.id}),[o]=(0,u.useEntityBlockEditor)("postType",e?.type,{id:e?.id}),r=e&&o?o:n,i=!r?.length;return(0,c.jsxs)("div",{className:"editor-fields-content-preview",style:{backgroundColor:s},children:[i&&(0,c.jsx)("span",{className:"editor-fields-content-preview__empty",children:(0,fs.__)("Empty content")}),!i&&(0,c.jsx)(g.BlockPreview.Async,{children:(0,c.jsx)(g.BlockPreview,{blocks:r})})]})}const Ol={type:"media",id:"content-preview",label:(0,fs.__)("Content preview"),render:function({item:e}){const{settings:t,template:s}=(0,d.useSelect)((t=>{const{canUser:s,getPostType:n,getTemplateId:o,getEntityRecord:r}=$(t(u.store)),i=s("read",{kind:"postType",name:"wp_template"}),a=t(vc).getEditorSettings(),l=a.supportsTemplateMode,c=n(e.type)?.viewable??!1,d=l&&c&&i?o(e.type,e.id):null;return{settings:a,template:d?r("postType","wp_template",d):void 0}}),[e.type,e.id]);return(0,c.jsx)(Dl,{post:e,settings:t,__unstableTemplate:s,children:(0,c.jsx)(Ll,{template:s,post:e})})},enableSorting:!1};var Fl=Ol;function Vl(e,t,s){return{type:"REGISTER_ENTITY_ACTION",kind:e,name:t,config:s}}function Ul(e,t,s){return{type:"UNREGISTER_ENTITY_ACTION",kind:e,name:t,actionId:s}}function Hl(e,t,s){return{type:"REGISTER_ENTITY_FIELD",kind:e,name:t,config:s}}function zl(e,t,s){return{type:"UNREGISTER_ENTITY_FIELD",kind:e,name:t,fieldId:s}}function Gl(e,t){return{type:"SET_IS_READY",kind:e,name:t}}const $l=e=>async({registry:t})=>{if($(t.select(vc)).isEntityReady("postType",e))return;$(t.dispatch(vc)).setIsReady("postType",e);const s=await t.resolveSelect(u.store).getPostType(e),n=await t.resolveSelect(u.store).canUser("create",{kind:"postType",name:e}),o=await t.resolveSelect(u.store).getCurrentTheme(),r=[s.viewable?Vn:void 0,s.supports?.revisions?Un:void 0,void 0,"wp_template_part"===s.slug&&n&&o?.is_block_theme?io:void 0,n&&"wp_block"===s.slug?ho:void 0,s.supports?.title?fo:void 0,s.supports?.["page-attributes"]?yo:void 0,"wp_block"===s.slug?Zo:void 0,qo,Xo,nr,rr,ar].filter(Boolean),i=[s.supports?.thumbnail&&o?.theme_supports?.["post-thumbnails"]&&ur,s.supports?.author&&fr,Cr,Er,Dr,s.supports?.["page-attributes"]&&Vr,s.supports?.comments&&Ur,s.supports?.trackbacks&&Hr,(s.supports?.comments||s.supports?.trackbacks)&&zr,Wr,Yr,s.supports?.editor&&s.viewable&&Fl].filter(Boolean);if(s.supports?.title){let t;t="page"===e?Xr:"wp_template"===e?Jr:"wp_block"===e?ni:oi,i.push(t)}t.batch((()=>{r.forEach((s=>{$(t.dispatch(vc)).registerEntityAction("postType",e,s)})),i.forEach((s=>{$(t.dispatch(vc)).registerEntityField("postType",e,s)}))})),(0,h.doAction)("core.registerPostTypeSchema",e)};function Wl(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}const Zl=e=>async({select:t,dispatch:s,registry:n})=>{const o=await n.dispatch(u.store).saveEntityRecord("postType","wp_template",e);return n.dispatch(u.store).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:o.slug}),n.dispatch(_s.store).createSuccessNotice((0,fs.__)("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:(0,fs.__)("Go back"),onClick:()=>s.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),o},Yl=e=>({registry:t})=>{const s=(t.select(C.store).get("core","hiddenBlockTypes")??[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(C.store).set("core","hiddenBlockTypes",s)},ql=e=>({registry:t})=>{const s=t.select(C.store).get("core","hiddenBlockTypes")??[],n=new Set([...s,...Array.isArray(e)?e:[e]]);t.dispatch(C.store).set("core","hiddenBlockTypes",[...n])},Kl=({onSave:e,dirtyEntityRecords:t=[],entitiesToSkip:s=[],close:n}={})=>({registry:o})=>{const r=[{kind:"postType",name:"wp_navigation"}],i="site-editor-save-success",a=o.select(u.store).getEntityRecord("root","__unstableBase")?.home;o.dispatch(_s.store).removeNotice(i);const l=t.filter((({kind:e,name:t,key:n,property:o})=>!s.some((s=>s.kind===e&&s.name===t&&s.key===n&&s.property===o))));n?.(l);const c=[],d=[];l.forEach((({kind:e,name:t,key:s,property:n})=>{"root"===e&&"site"===t?c.push(n):(r.some((s=>s.kind===e&&s.name===t))&&o.dispatch(u.store).editEntityRecord(e,t,s,{status:"publish"}),d.push(o.dispatch(u.store).saveEditedEntityRecord(e,t,s)))})),c.length&&d.push(o.dispatch(u.store).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,c)),o.dispatch(g.store).__unstableMarkLastChangeAsPersistent(),Promise.all(d).then((t=>e?e(t):t)).then((e=>{e.some((e=>void 0===e))?o.dispatch(_s.store).createErrorNotice((0,fs.__)("Saving failed.")):o.dispatch(_s.store).createSuccessNotice((0,fs.__)("Site updated."),{type:"snackbar",id:i,actions:[{label:(0,fs.__)("View site"),url:a,openInNewTab:!0}]})})).catch((e=>o.dispatch(_s.store).createErrorNotice(`${(0,fs.__)("Saving failed.")} ${e}`)))},Ql=(e,{allowUndo:t=!0}={})=>async({registry:s})=>{const n="edit-site-template-reverted";if(s.dispatch(_s.store).removeNotice(n),On(e))try{const o=s.select(u.store).getEntityConfig("postType",e.type);if(!o)return void s.dispatch(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const r=(0,w.addQueryArgs)(`${o.baseURL}/${e.id}`,{context:"edit",source:e.origin}),i=await gs()({path:r});if(!i)return void s.dispatch(_s.store).createErrorNotice((0,fs.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});const a=({blocks:e=[]})=>(0,x.__unstableSerializeAndClean)(e),l=s.select(u.store).getEditedEntityRecord("postType",e.type,e.id);s.dispatch(u.store).editEntityRecord("postType",e.type,e.id,{content:a,blocks:l.blocks,source:"custom"},{undoIgnore:!0});const c=(0,x.parse)(i?.content?.raw);if(s.dispatch(u.store).editEntityRecord("postType",e.type,i.id,{content:a,blocks:c,source:"theme"}),t){const t=()=>{s.dispatch(u.store).editEntityRecord("postType",e.type,l.id,{content:a,blocks:l.blocks,source:"custom"})};s.dispatch(_s.store).createSuccessNotice((0,fs.__)("Template reset."),{type:"snackbar",id:n,actions:[{label:(0,fs.__)("Undo"),onClick:t}]})}}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("Template revert failed. Please reload.");s.dispatch(_s.store).createErrorNotice(t,{type:"snackbar"})}else s.dispatch(_s.store).createErrorNotice((0,fs.__)("This template is not revertable."),{type:"snackbar"})},Xl=e=>async({registry:t})=>{const s=e.every((e=>e?.has_theme_file)),n=await Promise.allSettled(e.map((e=>t.dispatch(u.store).deleteEntityRecord("postType",e.type,e.id,{force:!0},{throwOnError:!0}))));if(n.every((({status:e})=>"fulfilled"===e))){let n;if(1===e.length){let t;"string"==typeof e[0].title?t=e[0].title:"string"==typeof e[0].title?.rendered?t=e[0].title?.rendered:"string"==typeof e[0].title?.raw&&(t=e[0].title?.raw),n=s?(0,fs.sprintf)((0,fs.__)('"%s" reset.'),(0,Ln.decodeEntities)(t)):(0,fs.sprintf)((0,fs._x)('"%s" deleted.',"template part"),(0,Ln.decodeEntities)(t))}else n=s?(0,fs.__)("Items reset."):(0,fs.__)("Items deleted.");t.dispatch(_s.store).createSuccessNotice(n,{type:"snackbar",id:"editor-template-deleted-success"})}else{let e;if(1===n.length)e=n[0].reason?.message?n[0].reason.message:s?(0,fs.__)("An error occurred while reverting the item."):(0,fs.__)("An error occurred while deleting the item.");else{const t=new Set,o=n.filter((({status:e})=>"rejected"===e));for(const e of o)e.reason?.message&&t.add(e.reason.message);e=0===t.size?(0,fs.__)("An error occurred while deleting the items."):1===t.size?s?(0,fs.sprintf)((0,fs.__)("An error occurred while reverting the items: %s"),[...t][0]):(0,fs.sprintf)((0,fs.__)("An error occurred while deleting the items: %s"),[...t][0]):s?(0,fs.sprintf)((0,fs.__)("Some errors occurred while reverting the items: %s"),[...t].join(",")):(0,fs.sprintf)((0,fs.__)("Some errors occurred while deleting the items: %s"),[...t].join(","))}t.dispatch(_s.store).createErrorNotice(e,{type:"snackbar"})}},Jl=e=>({select:t,registry:s})=>{const n=t.getCurrentPostType(),o=s.select(u.store).getCurrentTheme()?.stylesheet,r=s.select(C.store).get("core","renderingModes")?.[o]??{};if(r[n]===e)return;const i={[o]:{...r,[n]:e}};s.dispatch(C.store).set("core","renderingModes",i)};function ec(e){return{type:"SET_CANVAS_MIN_HEIGHT",minHeight:e}}var tc=s(5215),sc=s.n(tc),nc=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})}),oc=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})});const rc=[];const ic={rootClientId:void 0,insertionIndex:void 0,filterValue:void 0},ac=["post-only","template-locked"],lc=(0,d.createRegistrySelector)((e=>(0,d.createSelector)((t=>{if("object"==typeof t.blockInserterPanel)return t.blockInserterPanel;if("template-locked"===st(t)){const[t]=e(g.store).getBlocksByName("core/post-content");if(t)return{rootClientId:t,insertionIndex:void 0,filterValue:void 0}}return ic}),(t=>{const[s]=e(g.store).getBlocksByName("core/post-content");return[t.blockInserterPanel,st(t),s]}))));function cc(e){return e.listViewToggleRef}function dc(e){return e.inserterSidebarToggleRef}const uc={wp_block:Ji,wp_navigation:nc,page:ea,post:oc},pc=(0,d.createRegistrySelector)((e=>(t,s,n)=>{{if("wp_template_part"===s||"wp_template"===s){const t=(e(u.store).getCurrentTheme()?.default_template_part_areas||[]).find((e=>n.area===e.area));return t?.icon?H(t.icon):W}if(uc[s])return uc[s];const t=e(u.store).getPostType(s);return"string"==typeof t?.icon&&t.icon.startsWith("dashicons-")?t.icon.slice(10):ea}})),mc=(0,d.createRegistrySelector)((e=>(t,s,n)=>{const{type:o,id:r}=ne(t),i=e(u.store).getEntityRecordNonTransientEdits("postType",s||o,n||r);if(!i?.meta)return!1;const a=e(u.store).getEntityRecord("postType",s||o,n||r)?.meta;return!sc()({...a,footnotes:void 0},{...i.meta,footnotes:void 0})}));function hc(e,...t){return function(e,t,s){return e.actions[t]?.[s]??rc}(e.dataviews,...t)}function gc(e,...t){return function(e,t,s){return e.isReady[t]?.[s]}(e.dataviews,...t)}function _c(e,...t){return function(e,t,s){return e.fields[t]?.[s]??rc}(e.dataviews,...t)}const fc=(0,d.createRegistrySelector)((e=>(0,d.createSelector)(((t,s)=>{s=Array.isArray(s)?s:[s];const{getBlocksByName:n,getBlockParents:o,getBlockName:r}=e(g.store);return n(s).filter((e=>o(e).every((e=>{const t=r(e);return"core/query"!==t&&!s.includes(t)}))))}),(()=>[e(g.store).getBlocks()])))),bc=(0,d.createRegistrySelector)((e=>(t,s)=>{const{getPostType:n,getCurrentTheme:o,hasFinishedResolution:r}=e(u.store),i=o(),a=n(s);if(!r("getPostType",[s])||!r("getCurrentTheme"))return;const l=i?.stylesheet,c=e(C.store).get("core","renderingModes")?.[l]?.[s],d=Array.isArray(a?.supports?.editor)?a.supports.editor.find((e=>"default-mode"in e))?.["default-mode"]:void 0,p=c||d;return ac.includes(p)?p:"post-only"}));function yc(e){return e.canvasMinHeight}const xc={reducer:y,selectors:e,actions:t},vc=(0,d.createReduxStore)("core/editor",{...xc});(0,d.register)(vc),$(vc).registerPrivateActions(a),$(vc).registerPrivateSelectors(l);function wc(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,c.jsx)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,c.jsx)("span",{className:"editor-autocompleters__no-avatar"});return(0,c.jsxs)(c.Fragment,{children:[t,(0,c.jsx)("span",{className:"editor-autocompleters__user-name",children:e.name}),(0,c.jsx)("span",{className:"editor-autocompleters__user-slug",children:e.slug})]})}(0,h.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e){const t=Object.fromEntries(Object.entries(e.attributes??{}).filter((([,{source:e}])=>"meta"===e)).map((([e,{meta:t}])=>[e,t])));return Object.entries(t).length&&(e.edit=(e=>(0,m.createHigherOrderComponent)((t=>({attributes:s,setAttributes:n,...o})=>{const r=(0,d.useSelect)((e=>e(vc).getCurrentPostType()),[]),[i,a]=(0,u.useEntityProp)("postType",r,"meta"),l=(0,p.useMemo)((()=>({...s,...Object.fromEntries(Object.entries(e).map((([e,t])=>[e,i[t]])))})),[s,i]);return(0,c.jsx)(t,{attributes:l,setAttributes:t=>{const s=Object.fromEntries(Object.entries(t??{}).filter((([t])=>t in e)).map((([t,s])=>[e[t],s])));Object.entries(s).length&&a(s),n(t)},...o})}),"withMetaAttributeSource"))(t)(e.edit)),e}));var Sc={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=(0,d.useSelect)((t=>{const{getUsers:s}=t(u.store);return s({context:"view",search:encodeURIComponent(e)})}),[e]);return[(0,p.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:wc(e)}))):[]),[t])]},getOptionCompletion:e=>`@${e.slug}`};(0,h.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push({...Sc}),e})),(0,h.addFilter)("editor.MediaUpload","core/editor/components/media-upload",(()=>lr.MediaUpload));const{PatternOverridesControls:kc,ResetOverridesControl:Cc,PatternOverridesBlockControls:Pc,PATTERN_TYPES:jc,PARTIAL_SYNCING_SUPPORTED_BLOCKS:Ec,PATTERN_SYNC_TYPES:Tc}=$(ao.privateApis),Bc=(0,m.createHigherOrderComponent)((e=>t=>{const s=!!Ec[t.name];return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,c.jsx)(Ic,{...t}),s&&(0,c.jsx)(Pc,{})]})}),"withPatternOverrideControls");function Ic(e){const t=(0,g.useBlockEditingMode)(),{hasPatternOverridesSource:s,isEditingSyncedPattern:n}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(vc);return{hasPatternOverridesSource:!!(0,x.getBlockBindingsSource)("core/pattern-overrides"),isEditingSyncedPattern:t()===jc.user&&s("meta")?.wp_pattern_sync_status!==Tc.unsynced&&s("wp_pattern_sync_status")!==Tc.unsynced}}),[]),o=e.attributes.metadata?.bindings,r=!!o&&Object.values(o).some((e=>"core/pattern-overrides"===e.source)),i=n&&"default"===t,a=!n&&!!e.attributes.metadata?.name&&"disabled"!==t&&r;return s?(0,c.jsxs)(c.Fragment,{children:[i&&(0,c.jsx)(kc,{...e}),a&&(0,c.jsx)(Cc,{...e})]}):null}(0,h.addFilter)("editor.BlockEdit","core/editor/with-pattern-override-controls",Bc);const Nc=["core/navigation-link","core/navigation-submenu"];function Rc({attributes:e}){const{kind:t,id:s,type:n}=e,o=(0,g.useBlockEditingMode)(),r=(0,d.useSelect)((e=>e(g.store).getSettings().onNavigateToEntityRecord),[]),i=(0,p.useCallback)((()=>{"post-type"===t&&"page"===n&&s&&r&&r({postId:s,postType:n})}),[t,s,n,r]);return"post-type"===t&&"page"===n&&s&&r&&"contentOnly"===o?(0,c.jsx)(g.__unstableBlockToolbarLastItem,{children:(0,c.jsx)(Hn.ToolbarGroup,{children:(0,c.jsx)(Hn.ToolbarButton,{name:"view",title:(0,fs.__)("View"),onClick:i,children:(0,fs.__)("View")})})}):null}const Dc=(0,m.createHigherOrderComponent)((e=>t=>{const s=Nc.includes(t.name);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,c.jsx)(Rc,{...t})]})}),"withNavigationViewButton");(0,h.addFilter)("editor.BlockEdit","core/editor/with-navigation-view-button",Dc);function Ac({clientId:e}){const{selectBlock:t,flashBlock:s}=(0,d.useDispatch)(g.store),{enableComplementaryArea:n}=(0,d.useDispatch)(ja),{hasNavigationBlocks:o,firstNavigationBlockId:r,isNavigationEditable:i}=(0,d.useSelect)((t=>{const{getClientIdsOfDescendants:s,getBlockName:n,getBlockEditingMode:o}=t(g.store),r=s(e).filter((e=>"core/navigation"===n(e))),i=r.length>0,a=i?r[0]:null;return{hasNavigationBlocks:i,firstNavigationBlockId:a,isNavigationEditable:"disabled"!==o(a)}}),[e]),a=(0,p.useCallback)((()=>{r&&(t(r),s(r,500),n("core","edit-post/block"))}),[r,t,s,n]);return o&&i?(0,c.jsx)(g.__unstableBlockToolbarLastItem,{children:(0,c.jsx)(Hn.ToolbarGroup,{children:(0,c.jsx)(Hn.ToolbarButton,{label:(0,fs.__)("Edit navigation"),onClick:a,children:(0,fs.__)("Edit navigation")})})}):null}const Mc=(0,m.createHigherOrderComponent)((e=>t=>{const s="core/template-part"===t.name;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(e,{...t},"edit"),t.isSelected&&s&&(0,c.jsx)(Ac,{clientId:t.clientId})]})}),"withTemplatePartNavigationEditButton");(0,h.addFilter)("editor.BlockEdit","core/editor/with-template-part-navigation-edit-button",Mc);class Lc extends p.Component{constructor(e){super(e),this.needsAutosave=!(!e.isDirty||!e.isAutosaveable)}componentDidMount(){this.props.disableIntervalChecks||this.setAutosaveTimer()}componentDidUpdate(e){this.props.disableIntervalChecks?this.props.editsReference!==e.editsReference&&this.props.autosave():(this.props.interval!==e.interval&&(clearTimeout(this.timerId),this.setAutosaveTimer()),this.props.isDirty&&(!this.props.isAutosaving||e.isAutosaving)?this.props.editsReference!==e.editsReference&&(this.needsAutosave=!0):this.needsAutosave=!1)}componentWillUnmount(){clearTimeout(this.timerId)}setAutosaveTimer(e=1e3*this.props.interval){this.timerId=setTimeout((()=>{this.autosaveTimerHandler()}),e)}autosaveTimerHandler(){this.props.isAutosaveable?(this.needsAutosave&&(this.needsAutosave=!1,this.props.autosave()),this.setAutosaveTimer()):this.setAutosaveTimer(1e3)}render(){return null}}var Oc=(0,m.compose)([(0,d.withSelect)(((e,t)=>{const{getReferenceByDistinctEdits:s}=e(u.store),{isEditedPostDirty:n,isEditedPostAutosaveable:o,isAutosavingPost:r,getEditorSettings:i}=e(vc),{interval:a=i().autosaveInterval}=t;return{editsReference:s(),isDirty:n(),isAutosaveable:o(),isAutosaving:r(),interval:a}})),(0,d.withDispatch)(((e,t)=>({autosave(){const{autosave:s=e(vc).autosave}=t;s()}})))])(Lc),Fc=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),Vc=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})});const Uc=window.wp.dom;function Hc(e){const{isFrontPage:t,isPostsPage:s}=(0,d.useSelect)((t=>{const{canUser:s,getEditedEntityRecord:n}=t(u.store),o=s("read",{kind:"root",name:"site"})?n("root","site"):void 0,r=parseInt(e,10);return{isFrontPage:o?.page_on_front===r,isPostsPage:o?.page_for_posts===r}}));return t?(0,fs.__)("Homepage"):!!s&&(0,fs.__)("Posts Page")}const zc=Hn.__unstableMotion.create(Hn.Button);function Gc(e){const{postId:t,postType:s,postTypeLabel:n,documentTitle:o,isNotFound:r,templateTitle:i,onNavigateToPreviousEntityRecord:a,isTemplatePreview:l}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditorSettings:n,getRenderingMode:o}=e(vc),{getEditedEntityRecord:r,getPostType:i,getCurrentTheme:a,isResolving:l}=e(u.store),c=t(),d=s(),p=r("postType",c,d),{default_template_types:m=[]}=a()??{},h=Y({templateTypes:m,template:p}),g=i(c)?.labels?.singular_name;return{postId:d,postType:c,postTypeLabel:g,documentTitle:p.title,isNotFound:!p&&!l("getEditedEntityRecord","postType",c,d),templateTitle:h.title,onNavigateToPreviousEntityRecord:n().onNavigateToPreviousEntityRecord,isTemplatePreview:"template-locked"===o()}}),[]),{open:h}=(0,d.useDispatch)(na.store),_=(0,m.useReducedMotion)(),f=A.includes(s),b=!!a,y=f?i:o,x=e.title||y,v=e.icon,w=Hc(t),S=(0,p.useRef)(!1);return(0,p.useEffect)((()=>{S.current=!0}),[]),(0,c.jsxs)("div",{className:mr("editor-document-bar",{"has-back-button":b}),children:[(0,c.jsx)(Hn.__unstableAnimatePresence,{children:b&&(0,c.jsx)(zc,{className:"editor-document-bar__back",icon:(0,fs.isRTL)()?Fc:Vc,onClick:e=>{e.stopPropagation(),a()},size:"compact",initial:!!S.current&&{opacity:0,transform:"translateX(15%)"},animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:_?{duration:0}:void 0,children:(0,fs.__)("Back")})}),!f&&l&&!b&&(0,c.jsx)(g.BlockIcon,{icon:W,className:"editor-document-bar__icon-layout"}),r?(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Document not found")}):(0,c.jsxs)(Hn.Button,{className:"editor-document-bar__command",onClick:()=>h(),size:"compact",children:[(0,c.jsxs)(Hn.__unstableMotion.div,{className:"editor-document-bar__title",initial:!!S.current&&{opacity:0,transform:b?"translateX(15%)":"translateX(-15%)"},animate:{opacity:1,transform:"translateX(0%)"},transition:_?{duration:0}:void 0,children:[v&&(0,c.jsx)(g.BlockIcon,{icon:v}),(0,c.jsxs)(Hn.__experimentalText,{size:"body",as:"h1",children:[(0,c.jsx)("span",{className:"editor-document-bar__post-title",children:x?(0,Uc.__unstableStripHTML)(x):(0,fs.__)("No title")}),w&&(0,c.jsx)("span",{className:"editor-document-bar__post-type-label",children:`· ${w}`}),n&&!e.title&&!w&&(0,c.jsx)("span",{className:"editor-document-bar__post-type-label",children:`· ${(0,Ln.decodeEntities)(n)}`})]})]},b),(0,c.jsx)("span",{className:"editor-document-bar__shortcut",children:ll.displayShortcut.primary("k")})]})]})}const $c=window.wp.richText;var Wc=({children:e,isValid:t,isDisabled:s,level:n,href:o,onSelect:r})=>(0,c.jsx)("li",{className:mr("document-outline__item",`is-${n.toLowerCase()}`,{"is-invalid":!t,"is-disabled":s}),children:(0,c.jsxs)("a",{href:o,className:"document-outline__button","aria-disabled":s,onClick:function(e){s?e.preventDefault():r()},children:[(0,c.jsx)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,c.jsx)("strong",{className:"document-outline__level",children:n}),(0,c.jsx)("span",{className:"document-outline__item-content",children:e})]})});const Zc=(0,c.jsx)("em",{children:(0,fs.__)("(Empty heading)")}),Yc=[(0,c.jsx)("br",{},"incorrect-break"),(0,c.jsx)("em",{children:(0,fs.__)("(Incorrect heading level)")},"incorrect-message")],qc=[(0,c.jsx)("br",{},"incorrect-break-h1"),(0,c.jsx)("em",{children:(0,fs.__)("(Your theme may already use a H1 for the post title)")},"incorrect-message-h1")],Kc=[(0,c.jsx)("br",{},"incorrect-break-multiple-h1"),(0,c.jsx)("em",{children:(0,fs.__)("(Multiple H1 headings are not recommended)")},"incorrect-message-multiple-h1")];function Qc(){return(0,c.jsxs)(Hn.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,c.jsx)(Hn.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,c.jsx)(Hn.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,c.jsx)(Hn.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,c.jsx)(Hn.Path,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),(0,c.jsx)(Hn.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,c.jsx)(Hn.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,c.jsx)(Hn.Path,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),(0,c.jsx)(Hn.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,c.jsx)(Hn.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,c.jsx)(Hn.Path,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),(0,c.jsx)(Hn.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,c.jsx)(Hn.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,c.jsx)(Hn.Path,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"})]})}const Xc=(e=[])=>e.filter((e=>"core/heading"===e.name)).map((e=>({...e,level:e.attributes.level,isEmpty:Jc(e)}))),Jc=e=>!e.attributes.content||0===e.attributes.content.trim().length;function ed({onSelect:e,hasOutlineItemsDisabled:t}){const{selectBlock:s}=(0,d.useDispatch)(g.store),{title:n,isTitleSupported:o}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),{getPostType:s}=e(u.store),n=s(t("type"));return{title:t("title"),isTitleSupported:n?.supports?.title??!1}})),r=(0,d.useSelect)((e=>{const{getClientIdsWithDescendants:t,getBlock:s}=e(g.store);return t().map((e=>s(e)))})),i=(0,d.useSelect)((e=>{if("post-only"===e(vc).getRenderingMode())return;const{getBlocksByName:t,getClientIdsOfDescendants:s}=e(g.store),[n]=t("core/post-content");return n?s(n):void 0}),[]),a=(0,p.useRef)(1),l=(0,p.useMemo)((()=>Xc(r)),[r]);if(l.length<1)return(0,c.jsxs)("div",{className:"editor-document-outline has-no-headings",children:[(0,c.jsx)(Qc,{}),(0,c.jsx)("p",{children:(0,fs.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels.")})]});const m=document.querySelector(".editor-post-title__input"),h=o&&n&&m,_=l.reduce(((e,t)=>({...e,[t.level]:(e[t.level]||0)+1})),{})[1]>1;return(0,c.jsx)("div",{className:"document-outline",children:(0,c.jsxs)("ul",{children:[h&&(0,c.jsx)(Wc,{level:(0,fs.__)("Title"),isValid:!0,onSelect:e,href:`#${m.id}`,isDisabled:t,children:n}),l.map((n=>{const o=n.level>a.current+1,r=!(n.isEmpty||o||!n.level||1===n.level&&(_||h));return a.current=n.level,(0,c.jsxs)(Wc,{level:`H${n.level}`,isValid:r,isDisabled:t||(l=n.clientId,!(!Array.isArray(i)||i.includes(l))),href:`#block-${n.clientId}`,onSelect:()=>{s(n.clientId),e?.()},children:[n.isEmpty?Zc:(0,$c.getTextContent)((0,$c.create)({html:n.attributes.content})),o&&Yc,1===n.level&&_&&Kc,h&&1===n.level&&!_&&qc]},n.clientId);var l}))]})})}function td({children:e}){const t=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t}=e(g.store);return t("core/heading")>0}));return t?e:null}var sd=function(){const{registerShortcut:e}=(0,d.useDispatch)(il.store);return(0,p.useEffect)((()=>{e({name:"core/editor/toggle-mode",category:"global",description:(0,fs.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/editor/save",category:"global",description:(0,fs.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,fs.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,fs.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,ll.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/editor/toggle-list-view",category:"global",description:(0,fs.__)("Show or hide the List View."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/editor/toggle-distraction-free",category:"global",description:(0,fs.__)("Enter or exit distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),e({name:"core/editor/toggle-sidebar",category:"global",description:(0,fs.__)("Show or hide the Settings panel."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/editor/keyboard-shortcuts",category:"main",description:(0,fs.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/editor/next-region",category:"global",description:(0,fs.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/editor/previous-region",category:"global",description:(0,fs.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),(0,c.jsx)(g.BlockEditorKeyboardShortcuts.Register,{})},nd=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"})}),od=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})});var rd=(0,p.forwardRef)((function(e,t){const s=(0,ll.isAppleOS)()?ll.displayShortcut.primaryShift("z"):ll.displayShortcut.primary("y"),n=(0,d.useSelect)((e=>e(vc).hasEditorRedo()),[]),{redo:o}=(0,d.useDispatch)(vc);return(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,fs.isRTL)()?od:nd,label:(0,fs.__)("Redo"),shortcut:s,"aria-disabled":!n,onClick:n?o:void 0,className:"editor-history__redo"})}));var id=(0,p.forwardRef)((function(e,t){const s=(0,d.useSelect)((e=>e(vc).hasEditorUndo()),[]),{undo:n}=(0,d.useDispatch)(vc);return(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,fs.isRTL)()?nd:od,label:(0,fs.__)("Undo"),shortcut:ll.displayShortcut.primary("z"),"aria-disabled":!s,onClick:s?n:void 0,className:"editor-history__undo"})}));function ad(){const[e,t]=(0,p.useState)(!1),s=(0,d.useSelect)((e=>e(g.store).isValidTemplate()),[]),{setTemplateValidity:n,synchronizeTemplate:o}=(0,d.useDispatch)(g.store);return s?null:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,fs.__)("Keep it as is"),onClick:()=>n(!0)},{label:(0,fs.__)("Reset the template"),onClick:()=>t(!0)}],children:(0,fs.__)("The content of your post doesn’t match the template assigned to your post type.")}),(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:e,confirmButtonText:(0,fs.__)("Reset"),onConfirm:()=>{t(!1),o()},onCancel:()=>t(!1),size:"medium",children:(0,fs.__)("Resetting the template may result in loss of content, do you want to continue?")})]})}var ld=function(){const{notices:e}=(0,d.useSelect)((e=>({notices:e(_s.store).getNotices()})),[]),{removeNotice:t}=(0,d.useDispatch)(_s.store),s=e.filter((({isDismissible:e,type:t})=>e&&"default"===t)),n=e.filter((({isDismissible:e,type:t})=>!e&&"default"===t));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.NoticeList,{notices:n,className:"components-editor-notices__pinned"}),(0,c.jsx)(Hn.NoticeList,{notices:s,className:"components-editor-notices__dismissible",onRemove:t,children:(0,c.jsx)(ad,{})})]})};const cd=-3;function dd(){const e=(0,d.useSelect)((e=>e(_s.store).getNotices()),[]),{removeNotice:t}=(0,d.useDispatch)(_s.store),s=e.filter((({type:e})=>"snackbar"===e)).slice(cd);return(0,c.jsx)(Hn.SnackbarList,{notices:s,className:"components-editor-notices__snackbar",onRemove:t})}function ud({record:e,checked:t,onChange:s}){const{name:n,kind:o,title:r,key:i}=e,{entityRecordTitle:a,hasPostMetaChanges:l}=(0,d.useSelect)((e=>{if("postType"!==o||"wp_template"!==n)return{entityRecordTitle:r,hasPostMetaChanges:$(e(vc)).hasPostMetaChanges(n,i)};const t=e(u.store).getEditedEntityRecord(o,n,i),{default_template_types:s=[]}=e(u.store).getCurrentTheme()??{};return{entityRecordTitle:Y({template:t,templateTypes:s}).title,hasPostMetaChanges:$(e(vc)).hasPostMetaChanges(n,i)}}),[n,o,r,i]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.PanelRow,{children:(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,Ln.decodeEntities)(a)||(0,fs.__)("Untitled"),checked:t,onChange:s,className:"entities-saved-states__change-control"})}),l&&(0,c.jsx)("ul",{className:"entities-saved-states__changes",children:(0,c.jsx)("li",{children:(0,fs.__)("Post Meta.")})})]})}const{getGlobalStylesChanges:pd,GlobalStylesContext:md}=$(g.privateApis);function hd({record:e}){const{user:t}=(0,p.useContext)(md),s=(0,d.useSelect)((t=>t(u.store).getEntityRecord(e.kind,e.name,e.key)),[e.kind,e.name,e.key]),n=pd(t,s,{maxResults:10});return n.length?(0,c.jsx)("ul",{className:"entities-saved-states__changes",children:n.map((e=>(0,c.jsx)("li",{children:e},e)))}):null}function gd({record:e,count:t}){if("globalStyles"===e?.name)return null;const s=function(e,t){switch(e){case"site":return 1===t?(0,fs.__)("This change will affect your whole site."):(0,fs.__)("These changes will affect your whole site.");case"wp_template":return(0,fs.__)("This change will affect other parts of your site that use this template.");case"page":case"post":return(0,fs.__)("The following has been modified.")}}(e?.name,t);return s?(0,c.jsx)(Hn.PanelRow,{children:s}):null}function _d({list:e,unselectedEntities:t,setUnselectedEntities:s}){const n=e.length,o=e[0];let r=(0,d.useSelect)((e=>e(u.store).getEntityConfig(o.kind,o.name)),[o.kind,o.name]).label;return"wp_template_part"===o?.name&&(r=1===n?(0,fs.__)("Template Part"):(0,fs.__)("Template Parts")),(0,c.jsxs)(Hn.PanelBody,{title:r,initialOpen:!0,className:"entities-saved-states__panel-body",children:[(0,c.jsx)(gd,{record:o,count:n}),e.map((e=>(0,c.jsx)(ud,{record:e,checked:!t.some((t=>t.kind===e.kind&&t.name===e.name&&t.key===e.key&&t.property===e.property)),onChange:t=>s(e,t)},e.key||e.property))),"globalStyles"===o?.name&&(0,c.jsx)(hd,{record:o})]})}const fd=()=>{const{editedEntities:e,siteEdits:t,siteEntityConfig:s}=(0,d.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,getEntityRecordEdits:s,getEntityConfig:n}=e(u.store);return{editedEntities:t(),siteEdits:s("root","site"),siteEntityConfig:n("root","site")}}),[]),n=(0,p.useMemo)((()=>{const n=e.filter((e=>!("root"===e.kind&&"site"===e.name))),o=s?.meta?.labels??{},r=[];for(const e in t)r.push({kind:"root",name:"site",title:o[e]||e,property:e});return[...n,...r]}),[e,t,s]),[o,r]=(0,p.useState)([]);return{dirtyEntityRecords:n,isDirty:n.length-o.length>0,setUnselectedEntities:({kind:e,name:t,key:s,property:n},i)=>{r(i?o.filter((o=>o.kind!==e||o.name!==t||o.key!==s||o.property!==n)):[...o,{kind:e,name:t,key:s,property:n}])},unselectedEntities:o}};function bd(e){return e}function yd({close:e,renderDialog:t,variant:s}){const n=fd();return(0,c.jsx)(xd,{close:e,renderDialog:t,variant:s,...n})}function xd({additionalPrompt:e,close:t,onSave:s=bd,saveEnabled:n,saveLabel:o=(0,fs.__)("Save"),renderDialog:r,dirtyEntityRecords:i,isDirty:a,setUnselectedEntities:l,unselectedEntities:u,variant:h="default"}){const g=(0,p.useRef)(),{saveDirtyEntities:_}=$((0,d.useDispatch)(vc)),f=i.reduce(((e,t)=>{const{name:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),{site:b,wp_template:y,wp_template_part:x,...v}=f,w=[b,y,x,...Object.values(v)].filter(Array.isArray),S=n??a,k=(0,p.useCallback)((()=>t()),[t]),[C,P]=(0,m.__experimentalUseDialog)({onClose:()=>k()}),j=(0,m.useInstanceId)(xd,"entities-saved-states__panel-label"),E=(0,m.useInstanceId)(xd,"entities-saved-states__panel-description"),T=i.length?(0,fs.__)("Select the items you want to save."):void 0,B="inline"===h,I=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.FlexItem,{isBlock:!B,as:Hn.Button,variant:B?"tertiary":"secondary",size:B?void 0:"compact",onClick:k,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.FlexItem,{isBlock:!B,as:Hn.Button,ref:g,variant:"primary",size:B?void 0:"compact",disabled:!S,accessibleWhenDisabled:!0,onClick:()=>_({onSave:s,dirtyEntityRecords:i,entitiesToSkip:u,close:t}),className:"editor-entities-saved-states__save-button",children:o})]});return(0,c.jsxs)("div",{ref:r?C:void 0,...r&&P,className:mr("entities-saved-states__panel",{"is-inline":B}),role:r?"dialog":void 0,"aria-labelledby":r?j:void 0,"aria-describedby":r?E:void 0,children:[!B&&(0,c.jsx)(Hn.Flex,{className:"entities-saved-states__panel-header",gap:2,children:I}),(0,c.jsxs)("div",{className:"entities-saved-states__text-prompt",children:[(0,c.jsx)("div",{className:"entities-saved-states__text-prompt--header-wrapper",children:(0,c.jsx)("strong",{id:r?j:void 0,className:"entities-saved-states__text-prompt--header",children:(0,fs.__)("Are you ready to save?")})}),(0,c.jsxs)("div",{id:r?E:void 0,children:[e,(0,c.jsx)("p",{className:"entities-saved-states__text-prompt--changes-count",children:a?(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs._n)("There is <strong>%d site change</strong> waiting to be saved.","There are <strong>%d site changes</strong> waiting to be saved.",i.length),i.length),{strong:(0,c.jsx)("strong",{})}):T})]})]}),w.map((e=>(0,c.jsx)(_d,{list:e,unselectedEntities:u,setUnselectedEntities:l},e[0].name))),B&&(0,c.jsx)(Hn.Flex,{direction:"row",justify:"flex-end",className:"entities-saved-states__panel-footer",children:I})]})}function vd(){try{return(0,d.select)(vc).getEditedPostContent()}catch(e){}}function wd({text:e,children:t,variant:s="secondary"}){const n=(0,m.useCopyToClipboard)(e);return(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:s,ref:n,children:t})}class Sd extends p.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,h.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){const{error:e}=this.state,{canCopyContent:t=!1}=this.props;return e?(0,c.jsxs)(Hn.__experimentalHStack,{className:"editor-error-boundary",alignment:"baseline",spacing:4,justify:"space-between",expanded:!1,wrap:!0,children:[(0,c.jsx)(Hn.__experimentalText,{as:"p",children:(0,fs.__)("The editor has encountered an unexpected error.")}),(0,c.jsxs)(Hn.__experimentalHStack,{expanded:!1,children:[t&&(0,c.jsx)(wd,{text:vd,children:(0,fs.__)("Copy contents")}),(0,c.jsx)(wd,{variant:"primary",text:e?.stack,children:(0,fs.__)("Copy error")})]})]}):this.props.children}}var kd=Sd;const Cd=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame;let Pd;function jd(){const{postId:e,isEditedPostNew:t,hasRemoteAutosave:s}=(0,d.useSelect)((e=>({postId:e(vc).getCurrentPostId(),isEditedPostNew:e(vc).isEditedPostNew(),hasRemoteAutosave:!!e(vc).getEditorSettings().autosave})),[]),{getEditedPostAttribute:n}=(0,d.useSelect)(vc),{createWarningNotice:o,removeNotice:r}=(0,d.useDispatch)(_s.store),{editPost:i,resetEditorBlocks:a}=(0,d.useDispatch)(vc);(0,p.useEffect)((()=>{let l=function(e,t){return window.sessionStorage.getItem(bs(e,t))}(e,t);if(!l)return;try{l=JSON.parse(l)}catch{return}const{post_title:c,content:d,excerpt:u}=l,p={title:c,content:d,excerpt:u};if(!Object.keys(p).some((e=>p[e]!==n(e))))return void ys(e,t);if(s)return;const m="wpEditorAutosaveRestore";o((0,fs.__)("The backup of this post in your browser is different from the version below."),{id:m,actions:[{label:(0,fs.__)("Restore the backup"),onClick(){const{content:e,...t}=p;i(t),a((0,x.parse)(p.content)),r(m)}}]})}),[t,e])}var Ed=(0,m.ifCondition)((()=>{if(void 0!==Pd)return Pd;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),Pd=!0}catch{Pd=!1}return Pd}))((function(){const{autosave:e}=(0,d.useDispatch)(vc),t=(0,p.useCallback)((()=>{Cd((()=>e({local:!0})))}),[]);jd(),function(){const{postId:e,isEditedPostNew:t,isDirty:s,isAutosaving:n,didError:o}=(0,d.useSelect)((e=>({postId:e(vc).getCurrentPostId(),isEditedPostNew:e(vc).isEditedPostNew(),isDirty:e(vc).isEditedPostDirty(),isAutosaving:e(vc).isAutosavingPost(),didError:e(vc).didPostSaveRequestFail()})),[]),r=(0,p.useRef)(s),i=(0,p.useRef)(n);(0,p.useEffect)((()=>{!o&&(i.current&&!n||r.current&&!s)&&ys(e,t),r.current=s,i.current=n}),[s,n,o]);const a=(0,m.usePrevious)(t),l=(0,m.usePrevious)(e);(0,p.useEffect)((()=>{l===e&&a&&!t&&ys(e,!0)}),[t,e])}();const s=(0,d.useSelect)((e=>e(vc).getEditorSettings().localAutosaveInterval),[]);return(0,c.jsx)(Oc,{interval:s,autosave:t})}));var Td=function({children:e}){const t=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),{getPostType:s}=e(u.store),n=s(t("type"));return!!n?.supports?.["page-attributes"]}),[]);return t?e:null};var Bd=function({children:e,supportKeys:t}){const s=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),{getPostType:s}=e(u.store);return s(t("type"))}),[]);let n=!!s;return s&&(n=(Array.isArray(t)?t:[t]).some((e=>function(e={},t){if(void 0!==e[t])return!!e[t];const[s,n]=t.split("."),[o]=Array.isArray(e[s])?e[s]:[];return Array.isArray(o)?o.includes(n):!!o?.[n]}(s.supports,e)))),n?e:null};function Id(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("menu_order")??0),[]),{editPost:t}=(0,d.useDispatch)(vc),[s,n]=(0,p.useState)(null),o=s??e;return(0,c.jsx)(Hn.Flex,{children:(0,c.jsx)(Hn.FlexBlock,{children:(0,c.jsx)(Hn.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,fs.__)("Order"),help:(0,fs.__)("Set the page order."),value:o,onChange:e=>{n(e);const s=Number(e);Number.isInteger(s)&&""!==e.trim?.()&&t({menu_order:s})},hideLabelFromVision:!0,onBlur:()=>{n(null)}})})})}function Nd(){return(0,c.jsx)(Bd,{supportKeys:"page-attributes",children:(0,c.jsx)(Id,{})})}var Rd=(0,p.forwardRef)((({className:e,label:t,children:s},n)=>(0,c.jsxs)(Hn.__experimentalHStack,{className:mr("editor-post-panel__row",e),ref:n,children:[t&&(0,c.jsx)("div",{className:"editor-post-panel__row-label",children:t}),(0,c.jsx)("div",{className:"editor-post-panel__row-control",children:s})]})));function Dd(e){const t=e.map((e=>({children:[],parent:void 0,...e})));if(t.some((({parent:e})=>void 0===e)))return t;const s=t.reduce(((e,t)=>{const{parent:s}=t;return e[s]||(e[s]=[]),e[s].push(t),e}),{}),n=e=>e.map((e=>{const t=s[e.id];return{...e,children:t&&t.length?n(t):[]}}));return n(s[0]||[])}const Ad=e=>(0,Ln.decodeEntities)(e),Md=e=>({...e,name:Ad(e.name)}),Ld=e=>(e??[]).map(Md);function Od(e){return e?.title?.rendered?(0,Ln.decodeEntities)(e.title.rendered):`#${e.id} (${(0,fs.__)("no title")})`}const Fd=(e,t)=>{const s=Mr()(e||"").toLowerCase(),n=Mr()(t||"").toLowerCase();return s===n?0:s.startsWith(n)?s.length:1/0};function Vd(){const{editPost:e}=(0,d.useDispatch)(vc),[t,s]=(0,p.useState)(!1),{isHierarchical:n,parentPostId:o,parentPostTitle:r,pageItems:i,isLoading:a}=(0,d.useSelect)((e=>{const{getPostType:s,getEntityRecords:n,getEntityRecord:o,isResolving:r}=e(u.store),{getCurrentPostId:i,getEditedPostAttribute:a}=e(vc),l=a("type"),c=a("parent"),d=s(l),p=i(),m=d?.hierarchical??!1,h={per_page:100,exclude:p,parent_exclude:p,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(h.search=t);const g=c?o("postType",l,c):null;return{isHierarchical:m,parentPostId:c,parentPostTitle:g?Od(g):"",pageItems:m?n("postType",l,h):null,isLoading:!!m&&r("getEntityRecords",["postType",l,h])}}),[t]),l=(0,p.useMemo)((()=>{const e=(s,n=0)=>{const o=s.map((t=>[{value:t.id,label:"— ".repeat(n)+(0,Ln.decodeEntities)(t.name),rawName:t.name},...e(t.children||[],n+1)])).sort((([e],[s])=>Fd(e.rawName,t)>=Fd(s.rawName,t)?1:-1));return o.flat()};if(!i)return[];let s=i.map((e=>({id:e.id,parent:e.parent,name:Od(e)})));t||(s=Dd(s));const n=e(s),a=n.find((e=>e.value===o));return r&&!a&&n.unshift({value:o,label:r}),n}),[i,t,r,o]);if(!n)return null;return(0,c.jsx)(Hn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,fs.__)("Parent"),help:(0,fs.__)("Choose a parent page."),value:o,options:l,onFilterValueChange:(0,m.debounce)((e=>{s(e)}),300),onChange:t=>{e({parent:t})},hideLabelFromVision:!0,isLoading:a})}function Ud({isOpen:e,onClick:t}){const s=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),s=t("parent");if(!s)return null;const{getEntityRecord:n}=e(u.store);return n("postType",t("type"),s)}),[]),n=(0,p.useMemo)((()=>s?Od(s):(0,fs.__)("None")),[s]);return(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-parent__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change parent: %s"),n),onClick:t,children:n})}function Hd(){const e=(0,d.useSelect)((e=>e(u.store).getEntityRecord("root","__unstableBase")?.home),[]),[t,s]=(0,p.useState)(null),n=(0,p.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return(0,c.jsx)(Rd,{label:(0,fs.__)("Parent"),ref:s,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:n,className:"editor-post-parent__panel-dropdown",contentClassName:"editor-post-parent__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Ud,{isOpen:e,onClick:t}),renderContent:({onClose:t})=>(0,c.jsxs)("div",{className:"editor-post-parent",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Parent"),onClose:t}),(0,c.jsxs)("div",{children:[(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s<wbr />/services<wbr />/pricing.'),(0,w.filterURLForDisplay)(e).replace(/([/.])/g,"<wbr />$1")),{wbr:(0,c.jsx)("wbr",{})}),(0,c.jsx)("p",{children:(0,p.createInterpolateElement)((0,fs.__)("They also show up as sub-items in the default navigation menu. <a>Learn more.</a>"),{a:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes")})})})]}),(0,c.jsx)(Vd,{})]})})})}var zd=Vd;const Gd="page-attributes";function $d(){const{isEnabled:e,postType:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s}=e(vc),{getPostType:n}=e(u.store);return{isEnabled:s(Gd),postType:n(t("type"))}}),[]);return e&&t?(0,c.jsx)(Hd,{}):null}function Wd(){return(0,c.jsx)(Td,{children:(0,c.jsx)($d,{})})}var Zd=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"})});const Yd=(0,fs.__)("Custom Template");function qd({onClose:e}){const{defaultBlockTemplate:t,onNavigateToEntityRecord:s}=(0,d.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(vc);return{defaultBlockTemplate:t().defaultBlockTemplate,onNavigateToEntityRecord:t().onNavigateToEntityRecord,getTemplateId:s}})),{createTemplate:n}=$((0,d.useDispatch)(vc)),[o,r]=(0,p.useState)(""),[i,a]=(0,p.useState)(!1),l=()=>{r(""),e()};return(0,c.jsx)(Hn.Modal,{title:(0,fs.__)("Create custom template"),onRequestClose:l,focusOnMount:"firstContentElement",size:"small",overlayClassName:"editor-post-template__create-template-modal",children:(0,c.jsx)("form",{className:"editor-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),i)return;a(!0);const r=t??(0,x.serialize)([(0,x.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,x.createBlock)("core/site-title"),(0,x.createBlock)("core/site-tagline")]),(0,x.createBlock)("core/separator"),(0,x.createBlock)("core/group",{tagName:"main"},[(0,x.createBlock)("core/group",{layout:{inherit:!0}},[(0,x.createBlock)("core/post-title")]),(0,x.createBlock)("core/post-content",{layout:{inherit:!0}})])]),c=await n({slug:Kn(o||Yd)||"wp-custom-template",content:r,title:o||Yd});a(!1),s({postId:c.id,postType:"wp_template"}),l()},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"3",children:[(0,c.jsx)(Hn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,fs.__)("Name"),value:o,onChange:r,placeholder:Yd,disabled:i,help:(0,fs.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:l,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:i,"aria-disabled":i,children:(0,fs.__)("Create")})]})]})})})}function Kd(){return(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s}=e(vc);return{postId:t(),postType:s()}}),[])}function Qd(){const{postType:e,postId:t}=Kd();return(0,d.useSelect)((s=>{const{canUser:n,getEntityRecord:o,getEntityRecords:r}=s(u.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0,a=+t===i?.page_for_posts,l="page"===e&&+t===i?.page_on_front,c=l?r("postType","wp_template",{per_page:-1}):[],d=l&&!!c?.some((({slug:e})=>"front-page"===e));return!a&&!d}),[t,e])}function Xd(e){return(0,d.useSelect)((t=>t(u.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e})),[e])}function Jd(e){const t=eu(),s=Qd(),n=Xd(e);return(0,p.useMemo)((()=>s&&n?.filter((e=>e.is_custom&&e.slug!==t&&!!e.content.raw))),[n,t,s])}function eu(){const{postType:e,postId:t}=Kd(),s=Xd(e),n=(0,d.useSelect)((s=>{const n=s(u.store).getEditedEntityRecord("postType",e,t);return n?.template}),[e,t]);if(n)return s?.find((e=>e.slug===n))?.slug}function tu({isOpen:e,onClick:t}){const s=(0,d.useSelect)((e=>{const t=e(vc).getEditedPostAttribute("template"),{supportsTemplateMode:s,availableTemplates:n}=e(vc).getEditorSettings();if(!s&&n[t])return n[t];const o=e(u.store).canUser("create",{kind:"postType",name:"wp_template"})&&e(vc).getCurrentTemplateId();return o?.title||o?.slug||n?.[t]}),[]);return(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Template options"),onClick:t,children:s??(0,fs.__)("Default template")})}function su({onClose:e}){const t=Qd(),{availableTemplates:s,fetchedTemplates:n,selectedTemplateSlug:o,canCreate:r,canEdit:i,currentTemplateId:a,onNavigateToEntityRecord:l,getEditorSettings:m}=(0,d.useSelect)((e=>{const{canUser:s,getEntityRecords:n}=e(u.store),o=e(vc).getEditorSettings(),r=s("create",{kind:"postType",name:"wp_template"}),i=e(vc).getCurrentTemplateId();return{availableTemplates:o.availableTemplates,fetchedTemplates:r?n("postType","wp_template",{post_type:e(vc).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(vc).getEditedPostAttribute("template"),canCreate:t&&r&&o.supportsTemplateMode,canEdit:t&&r&&o.supportsTemplateMode&&!!i,currentTemplateId:i,onNavigateToEntityRecord:o.onNavigateToEntityRecord,getEditorSettings:e(vc).getEditorSettings}}),[t]),h=(0,p.useMemo)((()=>Object.entries({...s,...Object.fromEntries((n??[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[s,n]),_=h.find((e=>e.value===o))??h.find((e=>!e.value)),{editPost:f}=(0,d.useDispatch)(vc),{createSuccessNotice:b}=(0,d.useDispatch)(_s.store),[y,x]=(0,p.useState)(!1);return(0,c.jsxs)("div",{className:"editor-post-template__classic-theme-dropdown",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Template"),help:(0,fs.__)("Templates define the way content is displayed when viewing your site."),actions:r?[{icon:Zd,label:(0,fs.__)("Add template"),onClick:()=>x(!0)}]:[],onClose:e}),t?(0,c.jsx)(Hn.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,fs.__)("Template"),value:_?.value??"",options:h,onChange:e=>f({template:e||""})}):(0,c.jsx)(Hn.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("The posts page template cannot be changed.")}),i&&l&&(0,c.jsx)("p",{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>{l({postId:a,postType:"wp_template"}),e(),b((0,fs.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:(0,fs.__)("Go back"),onClick:()=>m().onNavigateToPreviousEntityRecord()}]})},children:(0,fs.__)("Edit template")})}),y&&(0,c.jsx)(qd,{onClose:()=>x(!1)})]})}var nu=function(){const[e,t]=(0,p.useState)(null),s=(0,p.useMemo)((()=>({anchor:e,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0})),[e]);return(0,c.jsx)(Rd,{label:(0,fs.__)("Template"),ref:t,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:s,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(tu,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsx)(su,{onClose:e})})})};const ou=window.wp.warning;var ru=s.n(ou);const{PreferenceBaseOption:iu}=$(C.privateApis);function au(e){const{toggleEditorPanelEnabled:t}=(0,d.useDispatch)(vc),{isChecked:s,isRemoved:n}=(0,d.useSelect)((t=>{const{isEditorPanelEnabled:s,isEditorPanelRemoved:n}=t(vc);return{isChecked:s(e.panelName),isRemoved:n(e.panelName)}}),[e.panelName]);return n?null:(0,c.jsx)(iu,{isChecked:s,onChange:()=>t(e.panelName),...e})}const{Fill:lu,Slot:cu}=(0,Hn.createSlotFill)("EnablePluginDocumentSettingPanelOption"),du=({label:e,panelName:t})=>(0,c.jsx)(lu,{children:(0,c.jsx)(au,{label:e,panelName:t})});du.Slot=cu;var uu=du;const{Fill:pu,Slot:mu}=(0,Hn.createSlotFill)("PluginDocumentSettingPanel"),hu=({name:e,className:t,title:s,icon:n,children:o})=>{const{name:r}=(0,aa.usePluginContext)(),i=`${r}/${e}`,{opened:a,isEnabled:l}=(0,d.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s}=e(vc);return{opened:t(i),isEnabled:s(i)}}),[i]),{toggleEditorPanelOpened:u}=(0,d.useDispatch)(vc);return void 0===e&&ru()("PluginDocumentSettingPanel requires a name property."),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(uu,{label:s,panelName:i}),(0,c.jsx)(pu,{children:l&&(0,c.jsx)(Hn.PanelBody,{className:t,title:s,icon:n,opened:a,onToggle:()=>u(i),children:o})})]})};hu.Slot=mu;var gu=hu;var _u=({allowedBlocks:e,icon:t,label:s,onClick:n,small:o,role:r})=>(0,c.jsx)(g.BlockSettingsMenuControls,{children:({selectedBlocks:i,onClose:a})=>((e,t)=>{return!Array.isArray(t)||(s=t,0===e.filter((e=>!s.includes(e))).length);var s})(i,e)?(0,c.jsx)(Hn.MenuItem,{onClick:(0,m.compose)(n,a),icon:t,label:o?s:void 0,role:r,children:!o&&s}):null});function fu(e){const t=(0,aa.usePluginContext)();return(0,c.jsx)(Na,{name:"core/plugin-more-menu",as:e.as??Hn.MenuItem,icon:e.icon||t.icon,...e})}const{Fill:bu,Slot:yu}=(0,Hn.createSlotFill)("PluginPostPublishPanel"),xu=({children:e,className:t,title:s,initialOpen:n=!1,icon:o})=>{const{icon:r}=(0,aa.usePluginContext)();return(0,c.jsx)(bu,{children:(0,c.jsx)(Hn.PanelBody,{className:t,initialOpen:n||!s,title:s,icon:o??r,children:e})})};xu.Slot=yu;var vu=xu;const{Fill:wu,Slot:Su}=(0,Hn.createSlotFill)("PluginPostStatusInfo"),ku=({children:e,className:t})=>(0,c.jsx)(wu,{children:(0,c.jsx)(Hn.PanelRow,{className:t,children:e})});ku.Slot=Su;var Cu=ku;const{Fill:Pu,Slot:ju}=(0,Hn.createSlotFill)("PluginPrePublishPanel"),Eu=({children:e,className:t,title:s,initialOpen:n=!1,icon:o})=>{const{icon:r}=(0,aa.usePluginContext)();return(0,c.jsx)(Pu,{children:(0,c.jsx)(Hn.PanelBody,{className:t,initialOpen:n||!s,title:s,icon:o??r,children:e})})};Eu.Slot=ju;var Tu=Eu;function Bu(e){const t=(0,aa.usePluginContext)();return(0,c.jsx)(Na,{name:"core/plugin-preview-menu",as:e.as??Hn.MenuItem,icon:e.icon||t.icon,...e})}function Iu({className:e,...t}){return(0,c.jsx)(Va,{panelClassName:e,className:"editor-sidebar",scope:"core",...t})}function Nu(e){return(0,c.jsx)(Da,{__unstableExplicitMenuItem:!0,scope:"core",...e})}function Ru(e=""){return e=(e=Mr()(e)).trim().toLowerCase()}function Du(e,t){const s=Ru(t),n=Ru(e.title);let o=0;if(s===n)o+=30;else if(n.startsWith(s))o+=20;else{s.split(" ").every((e=>n.includes(e)))&&(o+=10)}return o}function Au({onClick:e}){const[t,s]=(0,p.useState)(!1),{postType:n,postId:o}=Kd(),r=Jd(n),{editEntityRecord:i}=(0,d.useDispatch)(u.store);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.MenuItem,{disabled:!r?.length,accessibleWhenDisabled:!0,onClick:()=>s(!0),children:(0,fs.__)("Change template")}),t&&(0,c.jsx)(Hn.Modal,{title:(0,fs.__)("Choose a template"),onRequestClose:()=>s(!1),overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0,children:(0,c.jsx)("div",{className:"editor-post-template__swap-template-modal-content",children:(0,c.jsx)(Mu,{postType:n,onSelect:async t=>{i("postType",n,o,{template:t.name},{undoIgnore:!0}),s(!1),e()}})})})]})}function Mu({postType:e,onSelect:t}){const[s,n]=(0,p.useState)(""),o=Jd(e),r=(0,p.useMemo)((()=>o.map((e=>({name:e.slug,blocks:(0,x.parse)(e.content.raw),title:(0,Ln.decodeEntities)(e.title.rendered),id:e.id})))),[o]),i=(0,p.useMemo)((()=>function(e=[],t=""){if(!t)return e;const s=e.map((e=>[e,Du(e,t)])).filter((([,e])=>e>0));return s.sort((([,e],[,t])=>t-e)),s.map((([e])=>e))}(r,s)),[r,s]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.SearchControl,{__nextHasNoMarginBottom:!0,onChange:n,value:s,label:(0,fs.__)("Search"),placeholder:(0,fs.__)("Search"),className:"editor-post-template__swap-template-search"}),(0,c.jsx)(g.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:i,onClickPattern:t})]})}function Lu({onClick:e}){const t=eu(),s=Qd(),{postType:n,postId:o}=Kd(),{editEntityRecord:r}=(0,d.useDispatch)(u.store);return t&&s?(0,c.jsx)(Hn.MenuItem,{onClick:()=>{r("postType",n,o,{template:""},{undoIgnore:!0}),e()},children:(0,fs.__)("Use default template")}):null}function Ou(){const{canCreateTemplates:e}=(0,d.useSelect)((e=>{const{canUser:t}=e(u.store);return{canCreateTemplates:t("create",{kind:"postType",name:"wp_template"})}}),[]),[t,s]=(0,p.useState)(!1),n=Qd();return e&&n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.MenuItem,{onClick:()=>{s(!0)},children:(0,fs.__)("Create new template")}),t&&(0,c.jsx)(qd,{onClose:()=>{s(!1)}})]}):null}function Fu({id:e}){const{isTemplateHidden:t,onNavigateToEntityRecord:s,getEditorSettings:n,hasGoBack:o}=(0,d.useSelect)((e=>{const{getRenderingMode:t,getEditorSettings:s}=$(e(vc)),n=s();return{isTemplateHidden:"post-only"===t(),onNavigateToEntityRecord:n.onNavigateToEntityRecord,getEditorSettings:s,hasGoBack:n.hasOwnProperty("onNavigateToPreviousEntityRecord")}}),[]),{get:r}=(0,d.useSelect)(C.store),{editedRecord:i,hasResolved:a}=(0,u.useEntityRecord)("postType","wp_template",e),{createSuccessNotice:l}=(0,d.useDispatch)(_s.store),{setRenderingMode:m,setDefaultRenderingMode:h}=$((0,d.useDispatch)(vc)),g=(0,d.useSelect)((e=>!!e(u.store).canUser("create",{kind:"postType",name:"wp_template"})),[]),[_,f]=(0,p.useState)(null),b=(0,p.useMemo)((()=>({anchor:_,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0})),[_]);if(!a)return null;const y=o?[{label:(0,fs.__)("Go back"),onClick:()=>n().onNavigateToPreviousEntityRecord()}]:void 0;return(0,c.jsx)(Rd,{label:(0,fs.__)("Template"),ref:f,children:(0,c.jsx)(Hn.DropdownMenu,{popoverProps:b,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},label:(0,fs.__)("Template options"),text:(0,Ln.decodeEntities)(i.title),icon:null,children:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Hn.MenuGroup,{children:[g&&(0,c.jsx)(Hn.MenuItem,{onClick:()=>{s({postId:i.id,postType:"wp_template"}),e(),r("core/edit-site","welcomeGuideTemplate")||l((0,fs.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:y})},children:(0,fs.__)("Edit template")}),(0,c.jsx)(Au,{onClick:e}),(0,c.jsx)(Lu,{onClick:e}),g&&(0,c.jsx)(Ou,{})]}),(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Hn.MenuItem,{icon:t?void 0:zn,isSelected:!t,role:"menuitemcheckbox",onClick:()=>{const e=t?"template-locked":"post-only";m(e),h(e)},children:(0,fs.__)("Show template")})})]})})})}function Vu(){const{templateId:e,isBlockTheme:t}=(0,d.useSelect)((e=>{const{getCurrentTemplateId:t,getEditorSettings:s}=e(vc);return{templateId:t(),isBlockTheme:s().__unstableIsBlockBasedTheme}}),[]),s=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getPostType(t);if(!s?.viewable)return!1;const n=e(vc).getEditorSettings();if(!!n.availableTemplates&&Object.keys(n.availableTemplates).length>0)return!0;if(!n.supportsTemplateMode)return!1;return e(u.store).canUser("create",{kind:"postType",name:"wp_template"})??!1}),[]),n=(0,d.useSelect)((e=>!!s&&e(u.store).canUser("read",{kind:"postType",name:"wp_template"})),[s]);return t&&n||!s?t&&e?(0,c.jsx)(Fu,{id:e}):null:(0,c.jsx)(nu,{})}const Uu={_fields:"id,name",context:"view"},Hu={who:"authors",per_page:100,...Uu};function zu(e){const{authorId:t,authors:s,postAuthor:n,isLoading:o}=(0,d.useSelect)((t=>{const{getUser:s,getUsers:n,isResolving:o}=t(u.store),{getEditedPostAttribute:r}=t(vc),i=r("author"),a={...Hu};return e&&(a.search=e,a.search_columns=["name"]),{authorId:i,authors:n(a),postAuthor:s(i,Uu),isLoading:o("getUsers",[a])}}),[e]);return{authorId:t,authorOptions:(0,p.useMemo)((()=>{const e=(s??[]).map((e=>({value:e.id,label:(0,Ln.decodeEntities)(e.name)}))),t=e.findIndex((({value:e})=>n?.id===e));let o=[];return t<0&&n?o=[{value:n.id,label:(0,Ln.decodeEntities)(n.name)}]:t<0&&!n&&(o=[{value:0,label:(0,fs.__)("(No author)")}]),[...o,...e]}),[s,n]),postAuthor:n,isLoading:o}}function Gu(){const[e,t]=(0,p.useState)(),{editPost:s}=(0,d.useDispatch)(vc),{authorId:n,authorOptions:o,isLoading:r}=zu(e);return(0,c.jsx)(Hn.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,fs.__)("Author"),options:o,value:n,onFilterValueChange:(0,m.debounce)(t,300),onChange:e=>{e&&s({author:e})},allowReset:!1,hideLabelFromVision:!0,isLoading:r})}function $u(){const{editPost:e}=(0,d.useDispatch)(vc),{authorId:t,authorOptions:s}=zu();return(0,c.jsx)(Hn.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-author-selector",label:(0,fs.__)("Author"),options:s,onChange:t=>{const s=Number(t);e({author:s})},value:t,hideLabelFromVision:!0})}var Wu=function(){return(0,d.useSelect)((e=>{const t=e(u.store).getUsers(Hu);return t?.length>=25}),[])?(0,c.jsx)(Gu,{}):(0,c.jsx)($u,{})};function Zu({children:e}){const{hasAssignAuthorAction:t}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPost();return{hasAssignAuthorAction:!!t?._links?.["wp:action-assign-author"]}}),[]);return t?(0,c.jsx)(Bd,{supportKeys:"author",children:e}):null}function Yu({isOpen:e,onClick:t}){const{postAuthor:s}=(0,d.useSelect)((e=>{const t=e(vc).getEditedPostAttribute("author");return{postAuthor:e(u.store).getUser(t,Uu)}}),[]),n=(0,Ln.decodeEntities)(s?.name)||(0,fs.__)("(No author)");return(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-author__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change author: %s"),n),onClick:t,children:n})}var qu=function(){const[e,t]=(0,p.useState)(null),s=(0,p.useMemo)((()=>({anchor:e,placement:"left-start",offset:36,shift:!0})),[e]);return(0,c.jsx)(Zu,{children:(0,c.jsx)(Rd,{label:(0,fs.__)("Author"),ref:t,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:s,contentClassName:"editor-post-author__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Yu,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsxs)("div",{className:"editor-post-author",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Author"),onClose:e}),(0,c.jsx)(Wu,{onClose:e})]})})})})};const Ku=[{label:(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,fs.__)("Visitors can add new comments and replies.")},{label:(0,fs.__)("Closed"),value:"closed",description:[(0,fs.__)("Visitors cannot add new comments or replies."),(0,fs.__)("Existing comments remain visible.")].join(" ")}];var Qu=function(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("comment_status")??"open"),[]),{editPost:t}=(0,d.useDispatch)(vc);return(0,c.jsx)("form",{children:(0,c.jsx)(Hn.__experimentalVStack,{spacing:4,children:(0,c.jsx)(Hn.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,fs.__)("Comment status"),options:Ku,onChange:e=>t({comment_status:e}),selected:e})})})};var Xu=function(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("ping_status")??"open"),[]),{editPost:t}=(0,d.useDispatch)(vc);return(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Enable pingbacks & trackbacks"),checked:"open"===e,onChange:()=>t({ping_status:"open"===e?"closed":"open"}),help:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,fs.__)("Learn more about pingbacks & trackbacks")})})};const Ju="discussion-panel";function ep({onClose:e}){return(0,c.jsxs)("div",{className:"editor-post-discussion",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Discussion"),onClose:e}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Bd,{supportKeys:"comments",children:(0,c.jsx)(Qu,{})}),(0,c.jsx)(Bd,{supportKeys:"trackbacks",children:(0,c.jsx)(Xu,{})})]})]})}function tp({isOpen:e,onClick:t}){const{commentStatus:s,pingStatus:n,commentsSupported:o,trackbacksSupported:r}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),{getPostType:s}=e(u.store),n=s(t("type"));return{commentStatus:t("comment_status")??"open",pingStatus:t("ping_status")??"open",commentsSupported:!!n.supports.comments,trackbacksSupported:!!n.supports.trackbacks}}),[]);let i;return i="open"===s?"open"===n?(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'):r?(0,fs.__)("Comments only"):(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'):"open"===n?o?(0,fs.__)("Pings only"):(0,fs.__)("Pings enabled"):(0,fs.__)("Closed"),(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":(0,fs.__)("Change discussion options"),"aria-expanded":e,onClick:t,children:i})}function sp(){const{isEnabled:e}=(0,d.useSelect)((e=>{const{isEditorPanelEnabled:t}=e(vc);return{isEnabled:t(Ju)}}),[]),[t,s]=(0,p.useState)(null),n=(0,p.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]);return e?(0,c.jsx)(Bd,{supportKeys:["comments","trackbacks"],children:(0,c.jsx)(Rd,{label:(0,fs.__)("Discussion"),ref:s,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:n,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(tp,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsx)(ep,{onClose:e})})})}):null}function np({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){const{excerpt:s,shouldUseDescriptionLabel:n,usedAttribute:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:s}=e(vc),n=t(),o=["wp_template","wp_template_part"].includes(n)?"description":"excerpt";return{excerpt:s(o),shouldUseDescriptionLabel:["wp_template","wp_template_part","wp_block"].includes(n),usedAttribute:o}}),[]),{editPost:r}=(0,d.useDispatch)(vc),[i,a]=(0,p.useState)((0,Ln.decodeEntities)(s)),l=e=>{r({[o]:e})},u=n?(0,fs.__)("Write a description (optional)"):(0,fs.__)("Write an excerpt (optional)");return(0,c.jsx)("div",{className:"editor-post-excerpt",children:(0,c.jsx)(Hn.TextareaControl,{__nextHasNoMarginBottom:!0,label:u,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?a:l,onBlur:t?()=>l(i):void 0,value:t?i:s,help:n?(0,fs.__)("Write a description"):(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"),children:(0,fs.__)("Learn more about manual excerpts")})})})}var op=function({children:e}){return(0,c.jsx)(Bd,{supportKeys:"excerpt",children:e})};const{Fill:rp,Slot:ip}=(0,Hn.createSlotFill)("PluginPostExcerpt"),ap=({children:e,className:t})=>(0,c.jsx)(rp,{children:(0,c.jsx)(Hn.PanelRow,{className:t,children:e})});ap.Slot=ip;var lp=ap;const cp="post-excerpt";function dp(){const{isOpened:e,isEnabled:t,postType:s}=(0,d.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:s,getCurrentPostType:n}=e(vc);return{isOpened:t(cp),isEnabled:s(cp),postType:n()}}),[]),{toggleEditorPanelOpened:n}=(0,d.useDispatch)(vc);if(!t)return null;const o=["wp_template","wp_template_part","wp_block"].includes(s);return(0,c.jsx)(Hn.PanelBody,{title:o?(0,fs.__)("Description"):(0,fs.__)("Excerpt"),opened:e,onToggle:()=>n(cp),children:(0,c.jsx)(lp.Slot,{children:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(np,{}),e]})})})}function up(){return(0,c.jsx)(op,{children:(0,c.jsx)(dp,{})})}function pp(){return(0,c.jsx)(op,{children:(0,c.jsx)(mp,{})})}function mp(){const{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:s,allowEditing:n}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s,getEditedPostAttribute:n,isEditorPanelEnabled:o}=e(vc),r=t(),i=["wp_template","wp_template_part"].includes(r),a="wp_block"===r,l=i||a,c=n(i?"description":"excerpt"),d=i&&e(u.store).getEntityRecord("postType",r,s()),p=o(cp)||l;return{excerpt:c,shouldRender:p,shouldBeUsedAsDescription:l,allowEditing:p&&(!l||a||d&&d.source===D&&!d.has_theme_file&&d.is_custom)}}),[]),[o,r]=(0,p.useState)(null),i=s?(0,fs.__)("Description"):(0,fs.__)("Excerpt"),a=(0,p.useMemo)((()=>({anchor:o,"aria-label":i,headerTitle:i,placement:"left-start",offset:36,shift:!0})),[o,i]);if(!e)return!1;const l=!!t&&(0,c.jsx)(Hn.__experimentalText,{align:"left",numberOfLines:4,truncate:n,children:(0,Ln.decodeEntities)(t)});if(!n)return l;const m=s?(0,fs.__)("Add a description…"):(0,fs.__)("Add an excerpt…"),h=s?(0,fs.__)("Edit description"):(0,fs.__)("Edit excerpt");return(0,c.jsxs)(Hn.__experimentalVStack,{children:[l,(0,c.jsx)(Hn.Dropdown,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:a,focusOnMount:!0,ref:r,renderToggle:({onToggle:e})=>(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,onClick:e,variant:"link",children:l?h:m}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:i,onClose:e}),(0,c.jsx)(Hn.__experimentalVStack,{spacing:4,children:(0,c.jsx)(lp.Slot,{children:e=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(np,{hideLabelFromVision:!0,updateOnBlur:!0}),e]})})})]})})]})}function hp({children:e,supportKeys:t}){const{postType:s,themeSupports:n}=(0,d.useSelect)((e=>({postType:e(vc).getEditedPostAttribute("type"),themeSupports:e(u.store).getThemeSupports()})),[]);return(Array.isArray(t)?t:[t]).some((e=>{const t=n?.[e]??!1;return"post-thumbnails"===e&&Array.isArray(t)?t.includes(s):t}))?e:null}var gp=function({children:e}){return(0,c.jsx)(hp,{supportKeys:"post-thumbnails",children:(0,c.jsx)(Bd,{supportKeys:"thumbnail",children:e})})};const _p=["image"],fp=(0,fs.__)("Featured image"),bp=(0,fs.__)("Add a featured image"),yp=(0,c.jsx)("p",{children:(0,fs.__)("To edit the featured image, you need permission to upload media.")});const xp=(0,d.withSelect)((e=>{const{getEntityRecord:t,getPostType:s,hasFinishedResolution:n}=e(u.store),{getCurrentPostId:o,getEditedPostAttribute:r}=e(vc),i=r("featured_media");return{media:i?t("postType","attachment",i,{context:"view"}):null,currentPostId:o(),postType:s(r("type")),featuredImageId:i,isRequestingFeaturedImageMedia:!!i&&!n("getEntityRecord",["postType","attachment",i,{context:"view"}])}})),vp=(0,d.withDispatch)(((e,{noticeOperations:t},{select:s})=>{const{editPost:n}=e(vc);return{onUpdateImage(e){n({featured_media:e.id})},onDropImage(e){s(g.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:e,onFileChange([e]){n({featured_media:e.id})},onError(e){t.removeAllNotices(),t.createErrorNotice(e)},multiple:!1})},onRemoveImage(){n({featured_media:0})}}}));var wp=(0,m.compose)(Hn.withNotices,xp,vp,(0,Hn.withFilters)("editor.PostFeaturedImage"))((function({currentPostId:e,featuredImageId:t,onUpdateImage:s,onRemoveImage:n,media:o,postType:r,noticeUI:i,noticeOperations:a,isRequestingFeaturedImageMedia:l}){const u=(0,p.useRef)(!1),[m,_]=(0,p.useState)(!1),{getSettings:f}=(0,d.useSelect)(g.store),{mediaSourceUrl:b}=function(e,t){if(!e)return{};const s=(0,h.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(s in(e?.media_details?.sizes??{}))return{mediaWidth:e.media_details.sizes[s].width,mediaHeight:e.media_details.sizes[s].height,mediaSourceUrl:e.media_details.sizes[s].source_url};const n=(0,h.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return n in(e?.media_details?.sizes??{})?{mediaWidth:e.media_details.sizes[n].width,mediaHeight:e.media_details.sizes[n].height,mediaSourceUrl:e.media_details.sizes[n].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}(o,e);function y(e){f().mediaUpload({allowedTypes:_p,filesList:e,onFileChange([e]){(0,Go.isBlobURL)(e?.url)?_(!0):(e&&s(e),_(!1))},onError(e){a.removeAllNotices(),a.createErrorNotice(e)},multiple:!1})}function x(e){return e.alt_text?(0,fs.sprintf)((0,fs.__)("Current image: %s"),e.alt_text):(0,fs.sprintf)((0,fs.__)("The current image has no alternative text. The file name is: %s"),e.media_details.sizes?.full?.file||e.slug)}function v(e){u.current&&e&&(e.focus(),u.current=!1)}const w=!l&&!!t&&!o;return(0,c.jsxs)(gp,{children:[i,(0,c.jsxs)("div",{className:"editor-post-featured-image",children:[o&&(0,c.jsx)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden",children:x(o)}),(0,c.jsx)(g.MediaUploadCheck,{fallback:yp,children:(0,c.jsx)(g.MediaUpload,{title:r?.labels?.featured_image||fp,onSelect:s,unstableFeaturedImageFlow:!0,allowedTypes:_p,modalClass:"editor-post-featured-image__media-modal",render:({open:e})=>(0,c.jsxs)("div",{className:"editor-post-featured-image__container",children:[w?(0,c.jsx)(Hn.Notice,{status:"warning",isDismissible:!1,children:(0,fs.__)("Could not retrieve the featured image data.")}):(0,c.jsxs)(Hn.Button,{__next40pxDefaultSize:!0,ref:v,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:e,"aria-label":t?(0,fs.__)("Edit or replace the featured image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null,"aria-haspopup":"dialog",disabled:m,accessibleWhenDisabled:!0,children:[!!t&&o&&(0,c.jsx)("img",{className:"editor-post-featured-image__preview-image",src:b,alt:x(o)}),(m||l)&&(0,c.jsx)(Hn.Spinner,{}),!t&&!m&&(r?.labels?.set_featured_image||bp)]}),!!t&&(0,c.jsxs)(Hn.__experimentalHStack,{className:mr("editor-post-featured-image__actions",{"editor-post-featured-image__actions-missing-image":w,"editor-post-featured-image__actions-is-requesting-image":l}),children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:e,"aria-haspopup":"dialog",variant:w?"secondary":void 0,children:(0,fs.__)("Replace")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:()=>{n(),u.current=!0},variant:w?"secondary":void 0,isDestructive:w,children:(0,fs.__)("Remove")})]}),(0,c.jsx)(Hn.DropZone,{onFilesDrop:y})]}),value:t})})]})]})}));const Sp="featured-image";function kp({withPanelBody:e=!0}){const{postType:t,isEnabled:s,isOpened:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,isEditorPanelEnabled:s,isEditorPanelOpened:n}=e(vc),{getPostType:o}=e(u.store);return{postType:o(t("type")),isEnabled:s(Sp),isOpened:n(Sp)}}),[]),{toggleEditorPanelOpened:o}=(0,d.useDispatch)(vc);return s?e?(0,c.jsx)(gp,{children:(0,c.jsx)(Hn.PanelBody,{title:t?.labels?.featured_image??(0,fs.__)("Featured image"),opened:n,onToggle:()=>o(Sp),children:(0,c.jsx)(wp,{})})}):(0,c.jsx)(gp,{children:(0,c.jsx)(wp,{})}):null}function Cp({children:e}){return(0,d.useSelect)((e=>e(vc).getEditorSettings().disablePostFormats),[])?null:(0,c.jsx)(Bd,{supportKeys:"post-formats",children:e})}const Pp=[{id:"aside",caption:(0,fs.__)("Aside")},{id:"audio",caption:(0,fs.__)("Audio")},{id:"chat",caption:(0,fs.__)("Chat")},{id:"gallery",caption:(0,fs.__)("Gallery")},{id:"image",caption:(0,fs.__)("Image")},{id:"link",caption:(0,fs.__)("Link")},{id:"quote",caption:(0,fs.__)("Quote")},{id:"standard",caption:(0,fs.__)("Standard")},{id:"status",caption:(0,fs.__)("Status")},{id:"video",caption:(0,fs.__)("Video")}].sort(((e,t)=>{const s=e.caption.toUpperCase(),n=t.caption.toUpperCase();return s<n?-1:s>n?1:0}));function jp(){const e=`post-format-selector-${(0,m.useInstanceId)(jp)}`,{postFormat:t,suggestedFormat:s,supportedFormats:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:s}=e(vc),n=t("format"),o=e(u.store).getThemeSupports();return{postFormat:n??"standard",suggestedFormat:s(),supportedFormats:o.formats}}),[]),o=Pp.filter((e=>n?.includes(e.id)||t===e.id)),r=o.find((e=>e.id===s)),{editPost:i}=(0,d.useDispatch)(vc),a=e=>i({format:e});return(0,c.jsx)(Cp,{children:(0,c.jsxs)("div",{className:"editor-post-format",children:[(0,c.jsx)(Hn.RadioControl,{className:"editor-post-format__options",label:(0,fs.__)("Post Format"),selected:t,onChange:e=>a(e),id:e,options:o.map((e=>({label:e.caption,value:e.id}))),hideLabelFromVision:!0}),r&&r.id!==t&&(0,c.jsx)("p",{className:"editor-post-format__suggestion",children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>a(r.id),children:(0,fs.sprintf)((0,fs.__)("Apply suggested format: %s"),r.caption)})})]})})}var Ep=function({children:e}){const{lastRevisionId:t,revisionsCount:s}=(0,d.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(vc);return{lastRevisionId:t(),revisionsCount:s()}}),[]);return!t||s<2?null:(0,c.jsx)(Bd,{supportKeys:"revisions",children:e})};function Tp(){return(0,d.useSelect)((e=>{const{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:s}=e(vc);return{lastRevisionId:t(),revisionsCount:s()}}),[])}function Bp(){const{lastRevisionId:e,revisionsCount:t}=Tp();return(0,c.jsx)(Ep,{children:(0,c.jsx)(Rd,{label:(0,fs.__)("Revisions"),children:(0,c.jsx)(Hn.Button,{href:(0,w.addQueryArgs)("revision.php",{revision:e}),className:"editor-private-post-last-revision__button",text:t,variant:"tertiary",size:"compact"})})})}var Ip=function(){const{lastRevisionId:e,revisionsCount:t}=Tp();return(0,c.jsx)(Ep,{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,href:(0,w.addQueryArgs)("revision.php",{revision:e}),className:"editor-post-last-revision__title",icon:Yo,iconPosition:"right",text:(0,fs.sprintf)((0,fs.__)("Revisions (%s)"),t)})})};var Np=function(){return(0,c.jsx)(Ep,{children:(0,c.jsx)(Hn.PanelBody,{className:"editor-post-last-revision__panel",children:(0,c.jsx)(Ip,{})})})};var Rp=function e(){const t="core/editor/post-locked-modal-"+(0,m.useInstanceId)(e),{autosave:s,updatePostLock:n}=(0,d.useDispatch)(vc),{isLocked:o,isTakeover:r,user:i,postId:a,postLockUtils:l,activePostLock:g,postType:_,previewLink:f}=(0,d.useSelect)((e=>{const{isPostLocked:t,isPostLockTakeover:s,getPostLockUser:n,getCurrentPostId:o,getActivePostLock:r,getEditedPostAttribute:i,getEditedPostPreviewLink:a,getEditorSettings:l}=e(vc),{getPostType:c}=e(u.store);return{isLocked:t(),isTakeover:s(),user:n(),postId:o(),postLockUtils:l().postLockUtils,activePostLock:r(),postType:c(i("type")),previewLink:a()}}),[]);if((0,p.useEffect)((()=>{function e(){if(o||!g)return;const e=new window.FormData;if(e.append("action","wp-remove-post-lock"),e.append("_wpnonce",l.unlockNonce),e.append("post_ID",a),e.append("active_post_lock",g),window.navigator.sendBeacon)window.navigator.sendBeacon(l.ajaxUrl,e);else{const t=new window.XMLHttpRequest;t.open("POST",l.ajaxUrl,!1),t.send(e)}}return(0,h.addAction)("heartbeat.send",t,(function(e){o||(e["wp-refresh-post-lock"]={lock:g,post_id:a})})),(0,h.addAction)("heartbeat.tick",t,(function(e){if(!e["wp-refresh-post-lock"])return;const t=e["wp-refresh-post-lock"];t.lock_error?(s(),n({isLocked:!0,isTakeover:!0,user:{name:t.lock_error.name,avatar:t.lock_error.avatar_src_2x}})):t.new_lock&&n({isLocked:!1,activePostLock:t.new_lock})})),window.addEventListener("beforeunload",e),()=>{(0,h.removeAction)("heartbeat.send",t),(0,h.removeAction)("heartbeat.tick",t),window.removeEventListener("beforeunload",e)}}),[]),!o)return null;const b=i.name,y=i.avatar,x=(0,w.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:a,action:"edit",_wpnonce:l.nonce}),v=(0,w.addQueryArgs)("edit.php",{post_type:_?.slug}),S=(0,fs.__)("Exit editor");return(0,c.jsx)(Hn.Modal,{title:r?(0,fs.__)("Someone else has taken over this post"):(0,fs.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal",size:"medium",children:(0,c.jsxs)(Hn.__experimentalHStack,{alignment:"top",spacing:6,children:[!!y&&(0,c.jsx)("img",{src:y,alt:(0,fs.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,c.jsxs)("div",{children:[!!r&&(0,c.jsx)("p",{children:(0,p.createInterpolateElement)(b?(0,fs.sprintf)((0,fs.__)("<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),b):(0,fs.__)("Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved."),{strong:(0,c.jsx)("strong",{}),PreviewLink:(0,c.jsx)(Hn.ExternalLink,{href:f,children:(0,fs.__)("preview")})})}),!r&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:(0,p.createInterpolateElement)(b?(0,fs.sprintf)((0,fs.__)("<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),b):(0,fs.__)("Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over."),{strong:(0,c.jsx)("strong",{}),PreviewLink:(0,c.jsx)(Hn.ExternalLink,{href:f,children:(0,fs.__)("preview")})})}),(0,c.jsx)("p",{children:(0,fs.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved.")})]}),(0,c.jsxs)(Hn.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end",children:[!r&&(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",href:x,children:(0,fs.__)("Take over")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",href:v,children:S})]})]})]})})};var Dp=function({children:e}){const{hasPublishAction:t,isPublished:s}=(0,d.useSelect)((e=>{const{isCurrentPostPublished:t,getCurrentPost:s}=e(vc);return{hasPublishAction:s()._links?.["wp:action-publish"]??!1,isPublished:t()}}),[]);return s||!t?null:e};var Ap=function(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("status")),[]),{editPost:t}=(0,d.useDispatch)(vc);return(0,c.jsx)(Dp,{children:(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Pending review"),checked:"pending"===e,onChange:()=>{t({status:"pending"===e?"draft":"pending"})}})})};function Mp({className:e,textContent:t,forceIsAutosaveable:s,role:n,onPreview:o}){const{postId:r,currentPostLink:i,previewLink:a,isSaveable:l,isViewable:m}=(0,d.useSelect)((e=>{const t=e(vc),s=e(u.store).getPostType(t.getCurrentPostType("type")),n=s?.viewable??!1;return n?{postId:t.getCurrentPostId(),currentPostLink:t.getCurrentPostAttribute("link"),previewLink:t.getEditedPostPreviewLink(),isSaveable:t.isEditedPostSaveable(),isViewable:n}:{isViewable:n}}),[]),{__unstableSaveForPreview:g}=(0,d.useDispatch)(vc);if(!m)return null;const _=`wp-preview-${r}`,f=a||i;return(0,c.jsx)(Hn.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",href:f,target:_,accessibleWhenDisabled:!0,disabled:!l,onClick:async e=>{e.preventDefault();const t=window.open("",_);t.focus(),function(e){let t=(0,p.renderToString)((0,c.jsxs)("div",{className:"editor-post-preview-button__interstitial-message",children:[(0,c.jsxs)(Hn.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96",children:[(0,c.jsx)(Hn.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),(0,c.jsx)(Hn.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})]}),(0,c.jsx)("p",{children:(0,fs.__)("Generating preview…")})]}));t+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',t=(0,h.applyFilters)("editor.PostPreview.interstitialMarkup",t),e.write(t),e.title=(0,fs.__)("Generating preview…"),e.close()}(t.document);const n=await g({forceIsAutosaveable:s});t.location=n,o?.()},role:n,size:"compact",children:t||(0,c.jsxs)(c.Fragment,{children:[(0,fs._x)("Preview","imperative verb"),(0,c.jsx)(Hn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]})})}function Lp(){const e=(0,m.useViewportMatch)("medium","<"),{isPublished:t,isBeingScheduled:s,isSaving:n,isPublishing:o,hasPublishAction:r,isAutosaving:i,hasNonPostEntityChanges:a,postStatusHasChanged:l,postStatus:c}=(0,d.useSelect)((e=>{const{isCurrentPostPublished:t,isEditedPostBeingScheduled:s,isSavingPost:n,isPublishingPost:o,getCurrentPost:r,getCurrentPostType:i,isAutosavingPost:a,getPostEdits:l,getEditedPostAttribute:c}=e(vc);return{isPublished:t(),isBeingScheduled:s(),isSaving:n(),isPublishing:o(),hasPublishAction:r()._links?.["wp:action-publish"]??!1,postType:i(),isAutosaving:a(),hasNonPostEntityChanges:e(vc).hasNonPostEntityChanges(),postStatusHasChanged:!!l()?.status,postStatus:c("status")}}),[]);return o?(0,fs.__)("Publishing…"):(t||s)&&n&&!i?(0,fs.__)("Saving…"):r?a||t||l&&!["future","publish"].includes(c)||!l&&"future"===c?(0,fs.__)("Save"):s?(0,fs.__)("Schedule"):(0,fs.__)("Publish"):e?(0,fs.__)("Publish"):(0,fs.__)("Submit for Review")}const Op=()=>{};class Fp extends p.Component{constructor(e){super(e),this.createOnClick=this.createOnClick.bind(this),this.closeEntitiesSavedStates=this.closeEntitiesSavedStates.bind(this),this.state={entitiesSavedStatesCallback:!1}}createOnClick(e){return(...t)=>{const{hasNonPostEntityChanges:s,setEntitiesSavedStatesCallback:n}=this.props;return s&&n?(this.setState({entitiesSavedStatesCallback:()=>e(...t)}),n((()=>this.closeEntitiesSavedStates)),Op):e(...t)}}closeEntitiesSavedStates(e){const{postType:t,postId:s}=this.props,{entitiesSavedStatesCallback:n}=this.state;this.setState({entitiesSavedStatesCallback:!1},(()=>{e&&e.some((e=>"postType"===e.kind&&e.name===t&&e.key===s))&&n()}))}render(){const{forceIsDirty:e,hasPublishAction:t,isBeingScheduled:s,isOpen:n,isPostSavingLocked:o,isPublishable:r,isPublished:i,isSaveable:a,isSaving:l,isAutoSaving:d,isToggle:u,savePostStatus:p,onSubmit:m=Op,onToggle:h,visibility:g,hasNonPostEntityChanges:_,isSavingNonPostEntityChanges:f,postStatus:b,postStatusHasChanged:y}=this.props,x=(l||!a||o||!r&&!e)&&(!_||f),v=(i||l||!a||!r&&!e)&&(!_||f);let w="publish";y?w=b:t?"private"===g?w="private":s&&(w="future"):w="pending";const S={"aria-disabled":x,className:"editor-post-publish-button",isBusy:!d&&l,variant:"primary",onClick:this.createOnClick((()=>{x||(m(),p(w))})),"aria-haspopup":_?"dialog":void 0},k={"aria-disabled":v,"aria-expanded":n,className:"editor-post-publish-panel__toggle",isBusy:l&&i,variant:"primary",size:"compact",onClick:this.createOnClick((()=>{v||h()})),"aria-haspopup":_?"dialog":void 0},C=u?k:S;return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Hn.Button,{...C,className:`${C.className} editor-post-publish-button__button`,size:"compact",children:(0,c.jsx)(Lp,{})})})}}var Vp=(0,m.compose)([(0,d.withSelect)((e=>{const{isSavingPost:t,isAutosavingPost:s,isEditedPostBeingScheduled:n,getEditedPostVisibility:o,isCurrentPostPublished:r,isEditedPostSaveable:i,isEditedPostPublishable:a,isPostSavingLocked:l,getCurrentPost:c,getCurrentPostType:d,getCurrentPostId:u,hasNonPostEntityChanges:p,isSavingNonPostEntityChanges:m,getEditedPostAttribute:h,getPostEdits:g}=e(vc);return{isSaving:t(),isAutoSaving:s(),isBeingScheduled:n(),visibility:o(),isSaveable:i(),isPostSavingLocked:l(),isPublishable:a(),isPublished:r(),hasPublishAction:c()._links?.["wp:action-publish"]??!1,postType:d(),postId:u(),postStatus:h("status"),postStatusHasChanged:g()?.status,hasNonPostEntityChanges:p(),isSavingNonPostEntityChanges:m()}})),(0,d.withDispatch)((e=>{const{editPost:t,savePost:s}=e(vc);return{savePostStatus:e=>{t({status:e},{undoIgnore:!0}),s()}}}))])(Fp),Up=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,c.jsx)(L.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})});const Hp=[{label:(0,fs.__)("Public"),value:"public",description:(0,fs.__)("Visible to everyone.")},{label:(0,fs.__)("Private"),value:"private",description:(0,fs.__)("Only visible to site admins and editors.")},{label:(0,fs.__)("Password protected"),value:"password",description:(0,fs.__)("Only visible to those who know the password.")}];function zp({onClose:e}){const t=(0,m.useInstanceId)(zp),{status:s,visibility:n,password:o}=(0,d.useSelect)((e=>({status:e(vc).getEditedPostAttribute("status"),visibility:e(vc).getEditedPostVisibility(),password:e(vc).getEditedPostAttribute("password")}))),{editPost:r}=(0,d.useDispatch)(vc),[i,a]=(0,p.useState)(!!o);return(0,c.jsxs)("div",{className:"editor-post-visibility",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Visibility"),help:(0,fs.__)("Control how this post is viewed."),onClose:e}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Hn.RadioControl,{label:(0,fs.__)("Visibility"),hideLabelFromVision:!0,options:Hp,selected:i?"password":n,onChange:function(e){r({public:{status:"private"===n?"draft":s,password:""},private:{status:"private",password:""},password:{status:"private"===n?"draft":s,password:o||""}}[e]),a("password"===e)}}),i&&(0,c.jsx)(Hn.TextControl,{label:(0,fs.__)("Password"),onChange:e=>{r({password:e})},value:o,placeholder:(0,fs.__)("Use a secure password"),type:"text",id:`editor-post-visibility__password-input-${t}`,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})]})]})}function Gp(){return $p()}function $p(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostVisibility()),[]);return Hp.find((t=>t.value===e))?.label}function Wp(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function Zp(e){const t=Wp(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Yp(e){const t=Wp(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}Math.pow(10,8);const qp=6e4,Kp=36e5;function Qp(e,t){const s=t?.additionalDigits??2,n=function(e){const t={},s=e.split(Xp.dateTimeDelimiter);let n;if(s.length>2)return t;/:/.test(s[0])?n=s[0]:(t.date=s[0],n=s[1],Xp.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Xp.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length)));if(n){const e=Xp.timezone.exec(n);e?(t.time=n.replace(e[1],""),t.timezone=e[1]):t.time=n}return t}(e);let o;if(n.date){const e=function(e,t){const s=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(s);if(!n)return{year:NaN,restDateString:""};const o=n[1]?parseInt(n[1]):null,r=n[2]?parseInt(n[2]):null;return{year:null===r?o:100*r,restDateString:e.slice((n[1]||n[2]).length)}}(n.date,s);o=function(e,t){if(null===t)return new Date(NaN);const s=e.match(Jp);if(!s)return new Date(NaN);const n=!!s[4],o=sm(s[1]),r=sm(s[2])-1,i=sm(s[3]),a=sm(s[4]),l=sm(s[5])-1;if(n)return function(e,t,s){return t>=1&&t<=53&&s>=0&&s<=6}(0,a,l)?function(e,t,s){const n=new Date(0);n.setUTCFullYear(e,0,4);const o=n.getUTCDay()||7,r=7*(t-1)+s+1-o;return n.setUTCDate(n.getUTCDate()+r),n}(t,a,l):new Date(NaN);{const e=new Date(0);return function(e,t,s){return t>=0&&t<=11&&s>=1&&s<=(om[t]||(rm(e)?29:28))}(t,r,i)&&function(e,t){return t>=1&&t<=(rm(e)?366:365)}(t,o)?(e.setUTCFullYear(t,r,Math.max(o,i)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);const r=o.getTime();let i,a=0;if(n.time&&(a=function(e){const t=e.match(em);if(!t)return NaN;const s=nm(t[1]),n=nm(t[2]),o=nm(t[3]);if(!function(e,t,s){if(24===e)return 0===t&&0===s;return s>=0&&s<60&&t>=0&&t<60&&e>=0&&e<25}(s,n,o))return NaN;return s*Kp+n*qp+1e3*o}(n.time),isNaN(a)))return new Date(NaN);if(!n.timezone){const e=new Date(r+a),t=new Date(0);return t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),t}return i=function(e){if("Z"===e)return 0;const t=e.match(tm);if(!t)return 0;const s="+"===t[1]?-1:1,n=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,o))return NaN;return s*(n*Kp+o*qp)}(n.timezone),isNaN(i)?new Date(NaN):new Date(r+a+i)}const Xp={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Jp=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,em=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,tm=/^([+-])(\d{2})(?::?(\d{2}))?$/;function sm(e){return e?parseInt(e):1}function nm(e){return e&&parseFloat(e.replace(",","."))||0}const om=[31,null,31,30,31,30,31,31,30,31,30,31];function rm(e){return e%400==0||e%4==0&&e%100!=0}const{PrivatePublishDateTimePicker:im}=$(g.privateApis);function am(e){return(0,c.jsx)(lm,{...e,showPopoverHeaderActions:!0,isCompact:!1})}function lm({onClose:e,showPopoverHeaderActions:t,isCompact:s}){const{postDate:n,postType:o}=(0,d.useSelect)((e=>({postDate:e(vc).getEditedPostAttribute("date"),postType:e(vc).getCurrentPostType()})),[]),{editPost:r}=(0,d.useDispatch)(vc),[i,a]=(0,p.useState)(Zp(new Date(n))),l=(0,d.useSelect)((e=>e(u.store).getEntityRecords("postType",o,{status:"publish,future",after:Zp(i).toISOString(),before:Yp(i).toISOString(),exclude:[e(vc).getCurrentPostId()],per_page:100,_fields:"id,date"})),[i,o]),m=(0,p.useMemo)((()=>(l||[]).map((({date:e})=>({date:new Date(e)})))),[l]),h=(0,v.getSettings)(),g=/a(?!\\)/i.test(h.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,c.jsx)(im,{currentDate:n,onChange:e=>r({date:e}),is12Hour:g,dateOrder:(0,fs._x)("dmy","date order"),events:m,onMonthPreviewed:e=>a(Qp(e)),onClose:e,isCompact:s,showPopoverHeaderActions:t})}function cm(e){return dm(e)}function dm({full:e=!1}={}){const{date:t,isFloating:s}=(0,d.useSelect)((e=>({date:e(vc).getEditedPostAttribute("date"),isFloating:e(vc).isEditedPostDateFloating()})),[]);return e?um(t):function(e,{isFloating:t=!1,now:s=new Date}={}){if(!e||t)return(0,fs.__)("Immediately");if(!function(e){const{timezone:t}=(0,v.getSettings)(),s=Number(t.offset),n=e.getTimezoneOffset()/60*-1;return s===n}(s))return um(e);const n=(0,v.getDate)(e);if(pm(n,s))return(0,fs.sprintf)((0,fs.__)("Today at %s"),(0,v.dateI18n)((0,fs._x)("g:i a","post schedule time format"),n));const o=new Date(s);if(o.setDate(o.getDate()+1),pm(n,o))return(0,fs.sprintf)((0,fs.__)("Tomorrow at %s"),(0,v.dateI18n)((0,fs._x)("g:i a","post schedule time format"),n));if(n.getFullYear()===s.getFullYear())return(0,v.dateI18n)((0,fs._x)("F j g:i a","post schedule date format without year"),n);return(0,v.dateI18n)((0,fs._x)("F j, Y g:i a","post schedule full date format"),n)}(t,{isFloating:s})}function um(e){const t=(0,v.getDate)(e),s=function(){const{timezone:e}=(0,v.getSettings)();if(e.abbr&&isNaN(Number(e.abbr)))return e.abbr;return`UTC${e.offset<0?"":"+"}${e.offsetFormatted}`}(),n=(0,v.dateI18n)((0,fs._x)("F j, Y g:i a","post schedule full date format"),t);return(0,fs.isRTL)()?`${s} ${n}`:`${n} ${s}`}function pm(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}const mm=3,hm={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function gm({onSelect:e,taxonomy:t}){const{_terms:s,showTerms:n}=(0,d.useSelect)((e=>{const s=e(u.store).getEntityRecords("taxonomy",t.slug,hm);return{_terms:s,showTerms:s?.length>=mm}}),[t.slug]);if(!n)return null;const o=Ld(s);return(0,c.jsxs)("div",{className:"editor-post-taxonomies__flat-term-most-used",children:[(0,c.jsx)(Hn.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label",children:t.labels.most_used}),(0,c.jsx)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list",children:o.map((t=>(0,c.jsx)("li",{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>e(t),children:t.name})},t.id)))})]})}const _m=[],fm=100,bm={per_page:fm,_fields:"id,name",context:"view"},ym=(e,t)=>Ad(e).toLowerCase()===Ad(t).toLowerCase(),xm=(e,t)=>e.map((e=>t.find((t=>ym(t.name,e)))?.id)).filter((e=>void 0!==e)),vm=({children:e,__nextHasNoMarginBottom:t})=>t?(0,c.jsx)(Hn.__experimentalVStack,{spacing:4,children:e}):(0,c.jsx)(p.Fragment,{children:e});function wm({slug:e,__nextHasNoMarginBottom:t}){const[s,n]=(0,p.useState)([]),[o,r]=(0,p.useState)(""),i=(0,m.useDebounce)(r,500);t||k()("Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const{terms:a,termIds:l,taxonomy:h,hasAssignAction:g,hasCreateAction:_,hasResolvedTerms:f}=(0,d.useSelect)((t=>{const{getCurrentPost:s,getEditedPostAttribute:n}=t(vc),{getEntityRecords:o,getEntityRecord:r,hasFinishedResolution:i}=t(u.store),a=s(),l=r("root","taxonomy",e),c=l?n(l.rest_base):_m,d={...bm,include:c?.join(","),per_page:-1};return{hasCreateAction:!!l&&(a._links?.["wp:action-create-"+l.rest_base]??!1),hasAssignAction:!!l&&(a._links?.["wp:action-assign-"+l.rest_base]??!1),taxonomy:l,termIds:c,terms:c?.length?o("taxonomy",e,d):_m,hasResolvedTerms:i("getEntityRecords",["taxonomy",e,d])}}),[e]),{searchResults:b}=(0,d.useSelect)((t=>{const{getEntityRecords:s}=t(u.store);return{searchResults:o?s("taxonomy",e,{...bm,search:o}):_m}}),[o,e]);(0,p.useEffect)((()=>{if(f){const e=(a??[]).map((e=>Ad(e.name)));n(e)}}),[a,f]);const y=(0,p.useMemo)((()=>(b??[]).map((e=>Ad(e.name)))),[b]),{editPost:x}=(0,d.useDispatch)(vc),{saveEntityRecord:v}=(0,d.useDispatch)(u.store),{createErrorNotice:w}=(0,d.useDispatch)(_s.store);if(!g)return null;function S(e){x({[h.rest_base]:e})}const C=h?.labels?.add_new_item??("post_tag"===e?(0,fs.__)("Add Tag"):(0,fs.__)("Add Term")),P=h?.labels?.singular_name??("post_tag"===e?(0,fs.__)("Tag"):(0,fs.__)("Term")),j=(0,fs.sprintf)((0,fs._x)("%s added","term"),P),E=(0,fs.sprintf)((0,fs._x)("%s removed","term"),P),T=(0,fs.sprintf)((0,fs._x)("Remove %s","term"),P);return(0,c.jsxs)(vm,{__nextHasNoMarginBottom:t,children:[(0,c.jsx)(Hn.FormTokenField,{__next40pxDefaultSize:!0,value:s,suggestions:y,onChange:function(t){const s=[...a??[],...b??[]],o=t.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]),r=o.filter((e=>!s.find((t=>ym(t.name,e)))));n(o),0!==r.length?_&&Promise.all(r.map((t=>async function(t){try{const s=await v("taxonomy",e,t,{throwOnError:!0});return Md(s)}catch(e){if("term_exists"!==e.code)throw e;return{id:e.data.term_id,name:t.name}}}({name:t})))).then((e=>{const t=s.concat(e);S(xm(o,t))})).catch((e=>{w(e.message,{type:"snackbar"}),S(xm(o,s))})):S(xm(o,s))},onInputChange:i,maxSuggestions:fm,label:C,messages:{added:j,removed:E,remove:T},__nextHasNoMarginBottom:t}),(0,c.jsx)(gm,{taxonomy:h,onSelect:function(t){if(l.includes(t.id))return;const s=[...l,t.id],n="post_tag"===e?(0,fs.__)("Tag"):(0,fs.__)("Term"),o=(0,fs.sprintf)((0,fs._x)("%s added","term"),h?.labels?.singular_name??n);(0,ms.speak)(o,"assertive"),S(s)}})]})}var Sm=(0,Hn.withFilters)("editor.PostTaxonomyType")(wm);const km=()=>{const e=(0,d.useSelect)((e=>{const t=e(u.store).getTaxonomy("post_tag");return t?.labels}),[]),t=e?.add_new_item??(0,fs.__)("Add tag"),s=e?.name??(0,fs.__)("Tags"),n=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:t},"label")];return(0,c.jsxs)(Hn.PanelBody,{initialOpen:!1,title:n,children:[(0,c.jsx)("p",{children:(0,fs.sprintf)((0,fs.__)("%s help users and search engines navigate your site and find your content. Add a few keywords to describe your post."),s)}),(0,c.jsx)(Sm,{slug:"post_tag",__nextHasNoMarginBottom:!0})]})};var Cm=()=>{const{postHasTags:e,siteHasTags:t,isPostTypeSupported:s}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getEntityRecord("root","taxonomy","post_tag"),n=s?.types?.includes(t),o=void 0!==s,r=s&&e(vc).getEditedPostAttribute(s.rest_base),i=!!n&&!!e(u.store).getEntityRecords("taxonomy","post_tag",{per_page:1})?.length;return{postHasTags:!!r?.length,siteHasTags:i,isPostTypeSupported:o&&n}}),[]),[n]=(0,p.useState)(e);return s&&t?n?null:(0,c.jsx)(km,{}):null};const Pm=(e,t)=>Pp.filter((t=>e?.includes(t.id))).find((e=>e.id===t)),jm=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:s})=>(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>s(e),children:t});function Em(){const{currentPostFormat:e,suggestion:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getSuggestedPostFormat:s}=e(vc),n=e(u.store).getThemeSupports().formats??[];return{currentPostFormat:t("format"),suggestion:Pm(n,s())}}),[]),{editPost:s}=(0,d.useDispatch)(vc),n=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Use a post format")},"label")];return t&&t.id!==e?(0,c.jsxs)(Hn.PanelBody,{initialOpen:!1,title:n,children:[(0,c.jsx)("p",{children:(0,fs.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")}),(0,c.jsx)("p",{children:(0,c.jsx)(jm,{onUpdatePostFormat:e=>s({format:e}),suggestedPostFormat:t.id,suggestionText:(0,fs.sprintf)((0,fs.__)('Apply the "%1$s" format.'),t.caption)})})]}):null}const{normalizeTextString:Tm}=$(Hn.privateApis),{RECEIVE_INTERMEDIATE_RESULTS:Bm}=$(u.privateApis),Im={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view",[Bm]:!0},Nm=8,Rm=[];function Dm({slug:e}){const[t,s]=(0,p.useState)(!1),[n,o]=(0,p.useState)(""),[r,i]=(0,p.useState)(""),[a,l]=(0,p.useState)(!1),[h,g]=(0,p.useState)(""),[_,f]=(0,p.useState)([]),b=(0,m.useDebounce)(ms.speak,500),{hasCreateAction:y,hasAssignAction:x,terms:v,loading:w,availableTerms:S,taxonomy:k}=(0,d.useSelect)((t=>{const{getCurrentPost:s,getEditedPostAttribute:n}=t(vc),{getEntityRecord:o,getEntityRecords:r,isResolving:i}=t(u.store),a=o("root","taxonomy",e),l=s();return{hasCreateAction:!!a&&!!l._links?.["wp:action-create-"+a.rest_base],hasAssignAction:!!a&&!!l._links?.["wp:action-assign-"+a.rest_base],terms:a?n(a.rest_base):Rm,loading:i("getEntityRecords",["taxonomy",e,Im]),availableTerms:r("taxonomy",e,Im)||Rm,taxonomy:a}}),[e]),{editPost:C}=(0,d.useDispatch)(vc),{saveEntityRecord:P}=(0,d.useDispatch)(u.store),j=(0,p.useMemo)((()=>function(e,t){const s=e=>-1!==t.indexOf(e.id)||void 0!==e.children&&e.children.map(s).filter((e=>e)).length>0,n=[...e];return n.sort(((e,t)=>{const n=s(e),o=s(t);return n===o?0:n&&!o?-1:!n&&o?1:0})),n}(Dd(S),v)),[S]),{createErrorNotice:E}=(0,d.useDispatch)(_s.store);if(!x)return null;const T=e=>{C({[k.rest_base]:e})},B=e=>e.map((e=>(0,c.jsxs)("div",{className:"editor-post-taxonomies__hierarchical-terms-choice",children:[(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:-1!==v.indexOf(e.id),onChange:()=>{(e=>{const t=v.includes(e)?v.filter((t=>t!==e)):[...v,e];T(t)})(parseInt(e.id,10))},label:(0,Ln.decodeEntities)(e.name)}),!!e.children.length&&(0,c.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices",children:B(e.children)})]},e.id))),I=(t,s,n)=>k?.labels?.[t]??("category"===e?s:n),N=I("add_new_item",(0,fs.__)("Add Category"),(0,fs.__)("Add Term")),R=I("new_item_name",(0,fs.__)("Add Category"),(0,fs.__)("Add Term")),D=I("parent_item",(0,fs.__)("Parent Category"),(0,fs.__)("Parent Term")),A=`— ${D} —`,M=N,L=k?.labels?.search_items??(0,fs.__)("Search Terms"),O=k?.name??(0,fs.__)("Terms"),F=S.length>=Nm;return(0,c.jsxs)(Hn.Flex,{direction:"column",gap:"4",children:[F&&!w&&(0,c.jsx)(Hn.SearchControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:L,placeholder:L,value:h,onChange:e=>{const t=j.map(function(e){const t=s=>{if(""===e)return s;const n={...s};return n.children.length>0&&(n.children=n.children.map(t).filter((e=>e))),(-1!==Tm(n.name).indexOf(Tm(e))||n.children.length>0)&&n};return t}(e)).filter((e=>e)),s=e=>{let t=0;for(let n=0;n<e.length;n++)t++,void 0!==e[n].children&&(t+=s(e[n].children));return t};g(e),f(t);const n=s(t),o=(0,fs.sprintf)((0,fs._n)("%d result found.","%d results found.",n),n);b(o,"assertive")}}),w&&(0,c.jsx)(Hn.Flex,{justify:"center",style:{height:"40px"},children:(0,c.jsx)(Hn.Spinner,{})}),(0,c.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":O,children:B(""!==h?_:j)}),!w&&y&&(0,c.jsx)(Hn.FlexItem,{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,onClick:()=>{l(!a)},className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":a,variant:"link",children:N})}),a&&(0,c.jsx)("form",{onSubmit:async a=>{if(a.preventDefault(),""===n||t)return;const l=function(e,t,s){return e.find((e=>(!e.parent&&!t||parseInt(e.parent)===parseInt(t))&&e.name.toLowerCase()===s.toLowerCase()))}(S,r,n);if(l)return v.some((e=>e===l.id))||T([...v,l.id]),o(""),void i("");let c;s(!0);try{c=await(d={name:n,parent:r||void 0},P("taxonomy",e,d,{throwOnError:!0}))}catch(e){return void E(e.message,{type:"snackbar"})}var d;const u="category"===e?(0,fs.__)("Category"):(0,fs.__)("Term"),p=(0,fs.sprintf)((0,fs._x)("%s added","term"),k?.labels?.singular_name??u);(0,ms.speak)(p,"assertive"),s(!1),o(""),i(""),T([...v,c.id])},children:(0,c.jsxs)(Hn.Flex,{direction:"column",gap:"4",children:[(0,c.jsx)(Hn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"editor-post-taxonomies__hierarchical-terms-input",label:R,value:n,onChange:e=>{o(e)},required:!0}),!!S.length&&(0,c.jsx)(Hn.TreeSelect,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:D,noOptionLabel:A,onChange:e=>{i(e)},selectedId:r,tree:j}),(0,c.jsx)(Hn.FlexItem,{children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit",children:M})})]})})]})}var Am=(0,Hn.withFilters)("editor.PostTaxonomyType")(Dm);var Mm=function(){const{hasNoCategory:e,hasSiteCategories:t}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),{canUser:s,getEntityRecord:n}=e(u.store),o=n("root","taxonomy","category"),r=s("read",{kind:"root",name:"site"})?n("root","site")?.default_category:void 0,i=r?n("taxonomy","category",r):void 0,a=o&&o.types.some((e=>e===t)),l=o&&e(vc).getEditedPostAttribute(o.rest_base),c=!!a&&!!e(u.store).getEntityRecords("taxonomy","category",{exclude:[r],per_page:1})?.length;return{hasNoCategory:!!o&&!!i&&a&&(0===l?.length||1===l?.length&&i?.id===l[0]),hasSiteCategories:c}}),[]),[s,n]=(0,p.useState)(!1);if((0,p.useEffect)((()=>{e&&n(!0)}),[e]),!s||!t)return null;const o=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("Assign a category")},"label")];return(0,c.jsxs)(Hn.PanelBody,{initialOpen:!1,title:o,children:[(0,c.jsx)("p",{children:(0,fs.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")}),(0,c.jsx)(Am,{slug:"category"})]})};function Lm(e){return Object.fromEntries(Object.entries(function(e){const t=new Set;return Object.fromEntries(e.map((e=>{const s=(0,w.getFilename)(e);let n="";if(s){const e=s.split(".");e.length>1&&e.pop(),n=e.join(".")}return n||(n=fi()),t.has(n)&&(n=`${n}-${fi()}`),t.add(n),[e,n]})))}(e)).map((([e,t])=>{const s=window.fetch(e.includes("?")?e:e+"?").then((e=>e.blob())).then((e=>new File([e],`${t}.png`,{type:e.type})));return[e,s]})))}function Om(e){const t=[];return e.forEach((e=>{t.push(e),t.push(...Om(e.innerBlocks))})),t}function Fm(e){if("core/image"===e.name||"core/cover"===e.name){const{url:t,alt:s,id:n}=e.attributes;return{url:t,alt:s,id:n}}if("core/media-text"===e.name){const{mediaUrl:t,mediaAlt:s,mediaId:n}=e.attributes;return{url:t,alt:s,id:n}}return{}}function Vm({clientId:e,alt:t,url:s}){const{selectBlock:n}=(0,d.useDispatch)(g.store);return(0,c.jsx)(Hn.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,fs.__)("Select image block."),onClick:()=>{n(e)},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(n(e),t.preventDefault())},alt:t,src:s,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"32px",height:"32px",objectFit:"cover",borderRadius:"2px",cursor:"pointer"},whileHover:{scale:1.08}},e)}function Um(){const[e,t]=(0,p.useState)(!1),[s,n]=(0,p.useState)(!1),[o,r]=(0,p.useState)(!1),{editorBlocks:i,mediaUpload:a}=(0,d.useSelect)((e=>({editorBlocks:e(g.store).getBlocks(),mediaUpload:e(g.store).getSettings().mediaUpload})),[]),l=Om(i).filter((e=>function(e){return"core/image"===e.name||"core/cover"===e.name?e.attributes.url&&!e.attributes.id:"core/media-text"===e.name?e.attributes.mediaUrl&&!e.attributes.mediaId:void 0}(e))),{updateBlockAttributes:u}=(0,d.useDispatch)(g.store);if(!a||!l.length)return null;const m=[(0,fs.__)("Suggestion:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,fs.__)("External media")},"label")];return(0,c.jsxs)(Hn.PanelBody,{initialOpen:!0,title:m,children:[(0,c.jsx)("p",{children:(0,fs.__)("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")}),(0,c.jsxs)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"},children:[(0,c.jsx)(Hn.__unstableAnimatePresence,{onExitComplete:()=>n(!1),children:l.map((e=>{const{url:t,alt:s}=Fm(e);return(0,c.jsx)(Vm,{clientId:e.clientId,url:t,alt:s},e.clientId)}))}),e||s?(0,c.jsx)(Hn.Spinner,{}):(0,c.jsx)(Hn.Button,{size:"compact",variant:"primary",onClick:function(){t(!0),r(!1);const e=new Set(l.map((e=>{const{url:t}=Fm(e);return t}))),s=Object.fromEntries(Object.entries(Lm([...e])).map((([e,t])=>[e,t.then((e=>new Promise(((t,s)=>{a({filesList:[e],onFileChange:([e])=>{(0,Go.isBlobURL)(e.url)||t(e)},onError(){s()}})}))))])));Promise.allSettled(l.map((e=>{const{url:t}=Fm(e);return s[t].then((t=>function(e,t){"core/image"!==e.name&&"core/cover"!==e.name||u(e.clientId,{id:t.id,url:t.url}),"core/media-text"===e.name&&u(e.clientId,{mediaId:t.id,mediaUrl:t.url})}(e,t))).then((()=>n(!0))).catch((()=>r(!0)))}))).finally((()=>{t(!1)}))},children:(0,fs._x)("Upload","verb")})]}),o&&(0,c.jsx)("p",{children:(0,fs.__)("Upload failed, try again.")})]})}var Hm=function({children:e}){const{isBeingScheduled:t,isRequestingSiteIcon:s,hasPublishAction:n,siteIconUrl:o,siteTitle:r,siteHome:i}=(0,d.useSelect)((e=>{const{getCurrentPost:t,isEditedPostBeingScheduled:s}=e(vc),{getEntityRecord:n,isResolving:o}=e(u.store),r=n("root","__unstableBase",void 0)||{};return{hasPublishAction:t()._links?.["wp:action-publish"]??!1,isBeingScheduled:s(),isRequestingSiteIcon:o("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:r.site_icon_url,siteTitle:r.name,siteHome:r.home&&(0,w.filterURLForDisplay)(r.home)}}),[]);let a,l,p=(0,c.jsx)(Hn.Icon,{className:"components-site-icon",size:"36px",icon:Up});return o&&(p=(0,c.jsx)("img",{alt:(0,fs.__)("Site Icon"),className:"components-site-icon",src:o})),s&&(p=null),n?t?(a=(0,fs.__)("Are you ready to schedule?"),l=(0,fs.__)("Your work will be published at the specified date and time.")):(a=(0,fs.__)("Are you ready to publish?"),l=(0,fs.__)("Double-check your settings before publishing.")):(a=(0,fs.__)("Are you ready to submit for review?"),l=(0,fs.__)("Your work will be reviewed and then approved.")),(0,c.jsxs)("div",{className:"editor-post-publish-panel__prepublish",children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:a})}),(0,c.jsx)("p",{children:l}),(0,c.jsxs)("div",{className:"components-site-card",children:[p,(0,c.jsxs)("div",{className:"components-site-info",children:[(0,c.jsx)("span",{className:"components-site-name",children:(0,Ln.decodeEntities)(r)||(0,fs.__)("(Untitled)")}),(0,c.jsx)("span",{className:"components-site-home",children:i})]})]}),(0,c.jsx)(Um,{}),n&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.PanelBody,{initialOpen:!1,title:[(0,fs.__)("Visibility:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,c.jsx)(Gp,{})},"label")],children:(0,c.jsx)(zp,{})}),(0,c.jsx)(Hn.PanelBody,{initialOpen:!1,title:[(0,fs.__)("Publish:"),(0,c.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,c.jsx)(cm,{})},"label")],children:(0,c.jsx)(am,{})})]}),(0,c.jsx)(Em,{}),(0,c.jsx)(Cm,{}),(0,c.jsx)(Mm,{}),e]})};const zm="%postname%",Gm="%pagename%";function $m({text:e}){const[t,s]=(0,p.useState)(!1),n=(0,p.useRef)(),o=(0,m.useCopyToClipboard)(e,(()=>{s(!0),n.current&&clearTimeout(n.current),n.current=setTimeout((()=>{s(!1)}),4e3)}));return(0,p.useEffect)((()=>()=>{n.current&&clearTimeout(n.current)}),[]),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:o,children:t?(0,fs.__)("Copied!"):(0,fs.__)("Copy")})}function Wm({focusOnMount:e,children:t}){const{post:s,postType:n,isScheduled:o}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPost:s,isCurrentPostScheduled:n}=e(vc),{getPostType:o}=e(u.store);return{post:s(),postType:o(t("type")),isScheduled:n()}}),[]),r=n?.labels?.singular_name,i=n?.labels?.view_item,a=n?.labels?.add_new_item,l="future"===s.status?(e=>{const{slug:t}=e;return e.permalink_template.includes(zm)?e.permalink_template.replace(zm,t):e.permalink_template.includes(Gm)?e.permalink_template.replace(Gm,t):e.permalink_template})(s):s.link,m=(0,w.addQueryArgs)("post-new.php",{post_type:s.type}),h=(0,p.useCallback)((t=>{e&&t&&t.focus()}),[e]),g=o?(0,c.jsxs)(c.Fragment,{children:[(0,fs.__)("is now scheduled. It will go live on")," ",(0,c.jsx)(cm,{}),"."]}):(0,fs.__)("is now live.");return(0,c.jsxs)("div",{className:"post-publish-panel__postpublish",children:[(0,c.jsxs)(Hn.PanelBody,{className:"post-publish-panel__postpublish-header",children:[(0,c.jsx)(Hn.ExternalLink,{ref:h,href:l,children:(0,Ln.decodeEntities)(s.title)||(0,fs.__)("(no title)")})," ",g]}),(0,c.jsxs)(Hn.PanelBody,{children:[(0,c.jsx)("p",{className:"post-publish-panel__postpublish-subheader",children:(0,c.jsx)("strong",{children:(0,fs.__)("What’s next?")})}),(0,c.jsxs)("div",{className:"post-publish-panel__postpublish-post-address-container",children:[(0,c.jsx)(Hn.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,fs.sprintf)((0,fs.__)("%s address"),r),value:(0,w.safeDecodeURIComponent)(l),onFocus:e=>e.target.select()}),(0,c.jsx)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap",children:(0,c.jsx)($m,{text:l})})]}),(0,c.jsxs)("div",{className:"post-publish-panel__postpublish-buttons",children:[!o&&(0,c.jsxs)(Hn.Button,{variant:"primary",href:l,__next40pxDefaultSize:!0,icon:Fn,iconPosition:"right",target:"_blank",children:[i,(0,c.jsx)(Hn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]}),(0,c.jsx)(Hn.Button,{variant:o?"primary":"secondary",__next40pxDefaultSize:!0,href:m,children:a})]})]}),t]})}class Zm extends p.Component{constructor(){super(...arguments),this.onSubmit=this.onSubmit.bind(this),this.cancelButtonNode=(0,p.createRef)()}componentDidMount(){this.timeoutID=setTimeout((()=>{this.cancelButtonNode.current.focus()}),0)}componentWillUnmount(){clearTimeout(this.timeoutID)}componentDidUpdate(e){(e.isPublished&&!this.props.isSaving&&this.props.isDirty||this.props.currentPostId!==e.currentPostId)&&this.props.onClose()}onSubmit(){const{onClose:e,hasPublishAction:t,isPostTypeViewable:s}=this.props;t&&s||e()}render(){const{forceIsDirty:e,isBeingScheduled:t,isPublished:s,isPublishSidebarEnabled:n,isScheduled:o,isSaving:r,isSavingNonPostEntityChanges:i,onClose:a,onTogglePublishSidebar:l,PostPublishExtension:d,PrePublishExtension:u,currentPostId:p,...m}=this.props,{hasPublishAction:h,isDirty:g,isPostTypeViewable:_,...f}=m,b=s||o&&t,y=!b&&!r,x=b&&!r;return(0,c.jsxs)("div",{className:"editor-post-publish-panel",...f,children:[(0,c.jsx)("div",{className:"editor-post-publish-panel__header",children:x?(0,c.jsx)(Hn.Button,{size:"compact",onClick:a,icon:la,label:(0,fs.__)("Close panel")}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"editor-post-publish-panel__header-cancel-button",children:(0,c.jsx)(Hn.Button,{ref:this.cancelButtonNode,accessibleWhenDisabled:!0,disabled:i,onClick:a,variant:"secondary",size:"compact",children:(0,fs.__)("Cancel")})}),(0,c.jsx)("div",{className:"editor-post-publish-panel__header-publish-button",children:(0,c.jsx)(Vp,{onSubmit:this.onSubmit,forceIsDirty:e})})]})}),(0,c.jsxs)("div",{className:"editor-post-publish-panel__content",children:[y&&(0,c.jsx)(Hm,{children:u&&(0,c.jsx)(u,{})}),x&&(0,c.jsx)(Wm,{focusOnMount:!0,children:d&&(0,c.jsx)(d,{})}),r&&(0,c.jsx)(Hn.Spinner,{})]}),(0,c.jsx)("div",{className:"editor-post-publish-panel__footer",children:(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Always show pre-publish checks."),checked:n,onChange:l})})]})}}var Ym=(0,m.compose)([(0,d.withSelect)((e=>{const{getPostType:t}=e(u.store),{getCurrentPost:s,getCurrentPostId:n,getEditedPostAttribute:o,isCurrentPostPublished:r,isCurrentPostScheduled:i,isEditedPostBeingScheduled:a,isEditedPostDirty:l,isAutosavingPost:c,isSavingPost:d,isSavingNonPostEntityChanges:p}=e(vc),{isPublishSidebarEnabled:m}=e(vc),h=t(o("type"));return{hasPublishAction:s()._links?.["wp:action-publish"]??!1,isPostTypeViewable:h?.viewable,isBeingScheduled:a(),isDirty:l(),isPublished:r(),isPublishSidebarEnabled:m(),isSaving:d()&&!c(),isSavingNonPostEntityChanges:p(),isScheduled:i(),currentPostId:n()}})),(0,d.withDispatch)(((e,{isPublishSidebarEnabled:t})=>{const{disablePublishSidebar:s,enablePublishSidebar:n}=e(vc);return{onTogglePublishSidebar:()=>{t?s():n()}}})),Hn.withFocusReturn,Hn.withConstrainedTabbing])(Zm),qm=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M17.3 10.1C17.3 7.60001 15.2 5.70001 12.5 5.70001C10.3 5.70001 8.4 7.10001 7.9 9.00001H7.7C5.7 9.00001 4 10.7 4 12.8C4 14.9 5.7 16.6 7.7 16.6H9.5V15.2H7.7C6.5 15.2 5.5 14.1 5.5 12.9C5.5 11.7 6.5 10.5 7.7 10.5H9L9.3 9.40001C9.7 8.10001 11 7.20001 12.5 7.20001C14.3 7.20001 15.8 8.50001 15.8 10.1V11.4L17.1 11.6C17.9 11.7 18.5 12.5 18.5 13.4C18.5 14.4 17.7 15.2 16.8 15.2H14.5V16.6H16.7C18.5 16.6 19.9 15.1 19.9 13.3C20 11.7 18.8 10.4 17.3 10.1Z M14.1245 14.2426L15.1852 13.182L12.0032 10L8.82007 13.1831L9.88072 14.2438L11.25 12.8745V18H12.75V12.8681L14.1245 14.2426Z"})}),Km=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"})});function Qm({children:e}){const{hasStickyAction:t,postType:s}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPost();return{hasStickyAction:t._links?.["wp:action-sticky"]??!1,postType:e(vc).getCurrentPostType()}}),[]);return"post"===s&&t?e:null}function Xm(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("sticky")??!1),[]),{editPost:t}=(0,d.useDispatch)(vc);return(0,c.jsx)(Qm,{children:(0,c.jsx)(Hn.CheckboxControl,{className:"editor-post-sticky__checkbox-control",label:(0,fs.__)("Sticky"),help:(0,fs.__)("Pin this post to the top of the blog."),checked:e,onChange:()=>t({sticky:!e}),__nextHasNoMarginBottom:!0})})}const Jm={"auto-draft":{label:(0,fs.__)("Draft"),icon:br},draft:{label:(0,fs.__)("Draft"),icon:br},pending:{label:(0,fs.__)("Pending"),icon:xr},private:{label:(0,fs.__)("Private"),icon:vr},future:{label:(0,fs.__)("Scheduled"),icon:yr},publish:{label:(0,fs.__)("Published"),icon:wr}},eh=[{label:(0,fs.__)("Draft"),value:"draft",description:(0,fs.__)("Not ready to publish.")},{label:(0,fs.__)("Pending"),value:"pending",description:(0,fs.__)("Waiting for review before publishing.")},{label:(0,fs.__)("Private"),value:"private",description:(0,fs.__)("Only visible to site admins and editors.")},{label:(0,fs.__)("Scheduled"),value:"future",description:(0,fs.__)("Publish automatically on a chosen date.")},{label:(0,fs.__)("Published"),value:"publish",description:(0,fs.__)("Visible to everyone.")}],th=[B,I,N,R];function sh(){const{status:e,date:t,password:s,postId:n,postType:o,canEdit:r}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostId:s,getCurrentPostType:n,getCurrentPost:o}=e(vc);return{status:t("status"),date:t("date"),password:t("password"),postId:s(),postType:n(),canEdit:o()._links?.["wp:action-publish"]??!1}}),[]),[i,a]=(0,p.useState)(!!s),l=(0,m.useInstanceId)(sh,"editor-change-status__password-input"),{editEntityRecord:h}=(0,d.useDispatch)(u.store),[_,f]=(0,p.useState)(null),b=(0,p.useMemo)((()=>({anchor:_,"aria-label":(0,fs.__)("Status & visibility"),headerTitle:(0,fs.__)("Status & visibility"),placement:"left-start",offset:36,shift:!0})),[_]);if(th.includes(o))return null;const y=({status:r=e,password:i=s,date:a=t})=>{h("postType",o,n,{status:r,date:a,password:i})},x=e=>{a(e),e||y({password:""})},v=n=>{let o=t,r=s;"future"===e&&new Date(t)>new Date&&(o=null),"private"===n&&s&&(r=""),y({status:n,date:o,password:r})};return(0,c.jsx)(Rd,{label:(0,fs.__)("Status"),ref:f,children:r?(0,c.jsx)(Hn.Dropdown,{className:"editor-post-status",contentClassName:"editor-change-status__content",popoverProps:b,focusOnMount:!0,renderToggle:({onToggle:t,isOpen:s})=>(0,c.jsx)(Hn.Button,{className:"editor-post-status__toggle",variant:"tertiary",size:"compact",onClick:t,icon:Jm[e]?.icon,"aria-label":(0,fs.sprintf)((0,fs.__)("Change status: %s"),Jm[e]?.label),"aria-expanded":s,children:Jm[e]?.label}),renderContent:({onClose:t})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Status & visibility"),onClose:t}),(0,c.jsx)("form",{onSubmit:e=>{e.preventDefault(),t()},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(Hn.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,fs.__)("Status"),options:eh,onChange:v,selected:"auto-draft"===e?"draft":e}),"future"===e&&(0,c.jsx)("div",{className:"editor-change-status__publish-date-wrapper",children:(0,c.jsx)(lm,{showPopoverHeaderActions:!1,isCompact:!0})}),"private"!==e&&(0,c.jsxs)(Hn.__experimentalVStack,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset",children:[(0,c.jsx)(Hn.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,fs.__)("Password protected"),help:(0,fs.__)("Only visible to those who know the password."),checked:i,onChange:x}),i&&(0,c.jsx)("div",{className:"editor-change-status__password-input",children:(0,c.jsx)(Hn.TextControl,{label:(0,fs.__)("Password"),onChange:e=>y({password:e}),value:s,placeholder:(0,fs.__)("Use a secure password"),type:"text",id:l,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,maxLength:255})})]}),(0,c.jsx)(Xm,{})]})})]})}):(0,c.jsx)("div",{className:"editor-post-status is-read-only",children:Jm[e]?.label})})}function nh({forceIsDirty:e}){const[t,s]=(0,p.useState)(!1),n=(0,m.useViewportMatch)("small"),{isAutosaving:o,isDirty:r,isNew:i,isPublished:a,isSaveable:l,isSaving:u,isScheduled:h,hasPublishAction:g,showIconLabels:_,postStatus:f,postStatusHasChanged:b}=(0,d.useSelect)((t=>{const{isEditedPostNew:s,isCurrentPostPublished:n,isCurrentPostScheduled:o,isEditedPostDirty:r,isSavingPost:i,isEditedPostSaveable:a,getCurrentPost:l,isAutosavingPost:c,getEditedPostAttribute:d,getPostEdits:u}=t(vc),{get:p}=t(C.store);return{isAutosaving:c(),isDirty:e||r(),isNew:s(),isPublished:n(),isSaving:i(),isSaveable:a(),isScheduled:o(),hasPublishAction:l()?._links?.["wp:action-publish"]??!1,showIconLabels:p("core","showIconLabels"),postStatus:d("status"),postStatusHasChanged:!!u()?.status}}),[e]),y="pending"===f,{savePost:x}=(0,d.useDispatch)(vc),v=(0,m.usePrevious)(u);if((0,p.useEffect)((()=>{let e;return v&&!u&&(s(!0),e=setTimeout((()=>{s(!1)}),1e3)),()=>clearTimeout(e)}),[u]),!g&&y)return null;const w=!["pending","draft","auto-draft"].includes(f)&&eh.map((({value:e})=>e)).includes(f);if(a||h||w||b&&["pending","draft"].includes(f))return null;const S=y?(0,fs.__)("Save as pending"):(0,fs.__)("Save draft"),k=(0,fs.__)("Save"),P=t||!i&&!r,j=u||P,E=u||P||!l;let T;return u?T=o?(0,fs.__)("Autosaving"):(0,fs.__)("Saving"):P?T=(0,fs.__)("Saved"):n?T=S:_&&(T=k),(0,c.jsxs)(Hn.Button,{className:l||u?mr({"editor-post-save-draft":!j,"editor-post-saved-state":j,"is-saving":u,"is-autosaving":o,"is-saved":P,[(0,Hn.__unstableGetAnimateClassName)({type:"loading"})]:u}):void 0,onClick:E?void 0:()=>x(),shortcut:E?void 0:ll.displayShortcut.primary("s"),variant:"tertiary",size:"compact",icon:n?void 0:qm,label:T||S,"aria-disabled":E,children:[j&&(0,c.jsx)(ei,{icon:P?zn:Km}),T]})}function oh({children:e}){return(0,d.useSelect)((e=>e(vc).getCurrentPost()._links?.["wp:action-publish"]??!1),[])?e:null}const rh=[B,I,N,R];function ih(){const[e,t]=(0,p.useState)(null),s=(0,d.useSelect)((e=>e(vc).getCurrentPostType()),[]),n=(0,p.useMemo)((()=>({anchor:e,"aria-label":(0,fs.__)("Change publish date"),placement:"left-start",offset:36,shift:!0})),[e]),o=dm(),r=dm({full:!0});return rh.includes(s)?null:(0,c.jsx)(oh,{children:(0,c.jsx)(Rd,{label:(0,fs.__)("Publish"),ref:t,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:n,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:e,isOpen:t})=>(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",tooltipPosition:"middle left",onClick:e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change date: %s"),o),label:r,showTooltip:o!==r,"aria-expanded":t,children:o}),renderContent:({onClose:e})=>(0,c.jsx)(am,{onClose:e})})})})}function ah(){k()("wp.editor.PostSwitchToDraftButton",{since:"6.7",version:"6.9"});const[e,t]=(0,p.useState)(!1),{editPost:s,savePost:n}=(0,d.useDispatch)(vc),{isSaving:o,isPublished:r,isScheduled:i}=(0,d.useSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:s,isCurrentPostScheduled:n}=e(vc);return{isSaving:t(),isPublished:s(),isScheduled:n()}}),[]),a=o||!r&&!i;let l,u;r?(l=(0,fs.__)("Are you sure you want to unpublish this post?"),u=(0,fs.__)("Unpublish")):i&&(l=(0,fs.__)("Are you sure you want to unschedule this post?"),u=(0,fs.__)("Unschedule"));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,className:"editor-post-switch-to-draft",onClick:()=>{a||t(!0)},"aria-disabled":a,variant:"secondary",style:{flexGrow:"1",justifyContent:"center"},children:(0,fs.__)("Switch to draft")}),(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:e,onConfirm:()=>{t(!1),s({status:"draft"}),n()},onCancel:()=>t(!1),confirmButtonText:u,children:l})]})}function lh(){const{syncStatus:e,postType:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc),s=t("meta");return{syncStatus:"unsynced"===s?.wp_pattern_sync_status?"unsynced":t("wp_pattern_sync_status"),postType:t("type")}}));return"wp_block"!==t?null:(0,c.jsx)(Rd,{label:(0,fs.__)("Sync status"),children:(0,c.jsx)("div",{className:"editor-post-sync-status__value",children:"unsynced"===e?(0,fs._x)("Not synced","pattern (singular)"):(0,fs._x)("Synced","pattern (singular)")})})}const ch=e=>e;var dh=function({taxonomyWrapper:e=ch}){const{postType:t,taxonomies:s}=(0,d.useSelect)((e=>({postType:e(vc).getCurrentPostType(),taxonomies:e(u.store).getEntityRecords("root","taxonomy",{per_page:-1})})),[]);return(s??[]).filter((e=>e.types.includes(t)&&e.visibility?.show_ui)).map((t=>{const s=t.hierarchical?Am:Sm,n={slug:t.slug,...t.hierarchical?{}:{__nextHasNoMarginBottom:!0}};return(0,c.jsx)(p.Fragment,{children:e((0,c.jsx)(s,{...n}),t)},`taxonomy-${t.slug}`)}))};function uh({children:e}){const t=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getEntityRecords("root","taxonomy",{per_page:-1});return s?.some((e=>e.types.includes(t)))}),[]);return t?e:null}function ph({taxonomy:e,children:t}){const s=e?.slug,n=s?`taxonomy-panel-${s}`:"",{isEnabled:o,isOpened:r}=(0,d.useSelect)((e=>{const{isEditorPanelEnabled:t,isEditorPanelOpened:o}=e(vc);return{isEnabled:!!s&&t(n),isOpened:!!s&&o(n)}}),[n,s]),{toggleEditorPanelOpened:i}=(0,d.useDispatch)(vc);if(!o)return null;const a=e?.labels?.menu_name;return a?(0,c.jsx)(Hn.PanelBody,{title:a,opened:r,onToggle:()=>i(n),children:t}):null}function mh(){return(0,c.jsx)(uh,{children:(0,c.jsx)(dh,{taxonomyWrapper:(e,t)=>(0,c.jsx)(ph,{taxonomy:t,children:e})})})}var hh=s(4132);function gh(){const e=(0,m.useInstanceId)(gh),{content:t,blocks:s,type:n,id:o}=(0,d.useSelect)((e=>{const{getEditedEntityRecord:t}=e(u.store),{getCurrentPostType:s,getCurrentPostId:n}=e(vc),o=s(),r=n(),i=t("postType",o,r);return{content:i?.content,blocks:i?.blocks,type:o,id:r}}),[]),{editEntityRecord:r}=(0,d.useDispatch)(u.store),i=(0,p.useMemo)((()=>t instanceof Function?t({blocks:s}):s?(0,x.__unstableSerializeAndClean)(s):t),[t,s]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.VisuallyHidden,{as:"label",htmlFor:`post-content-${e}`,children:(0,fs.__)("Type text or HTML")}),(0,c.jsx)(hh.A,{autoComplete:"off",dir:"auto",value:i,onChange:e=>{r("postType",n,o,{content:e.target.value,blocks:void 0,selection:void 0})},className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:(0,fs.__)("Start writing with text or HTML")})]})}const _h="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",fh=/[\r\n]+/g;function bh(e){const t=(0,p.useRef)(),{isCleanNewPost:s}=(0,d.useSelect)((e=>{const{isCleanNewPost:t}=e(vc);return{isCleanNewPost:t()}}),[]);return(0,p.useImperativeHandle)(e,(()=>({focus:()=>{t?.current?.focus()}}))),(0,p.useEffect)((()=>{if(!t.current)return;const{defaultView:e}=t.current.ownerDocument,{name:n,parent:o}=e,r="editor-canvas"===n?o.document:e.document,{activeElement:i,body:a}=r;!s||i&&a!==i||t.current.focus()}),[s]),{ref:t}}function yh(){const{editPost:e}=(0,d.useDispatch)(vc),{title:t}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc);return{title:t("title")}}),[]);return{title:t,setTitle:function(t){e({title:t})}}}const xh=(0,p.forwardRef)(((e,t)=>{const{placeholder:s}=(0,d.useSelect)((e=>{const{getSettings:t}=e(g.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[n,o]=(0,p.useState)(!1),{ref:r}=bh(t),{title:i,setTitle:a}=yh(),[l,u]=(0,p.useState)({}),{clearSelectedBlock:h,insertBlocks:_,insertDefaultBlock:f}=(0,d.useDispatch)(g.store),b=(0,Ln.decodeEntities)(s)||(0,fs.__)("Add title"),{value:y,onChange:v,ref:w}=(0,$c.__unstableUseRichText)({value:i,onChange(e){a(e.replace(fh," "))},placeholder:b,selectionStart:l.start,selectionEnd:l.end,onSelectionChange(e,t){u((s=>{const{start:n,end:o}=s;return n===e&&o===t?s:{start:e,end:t}}))},__unstableDisableFormats:!1});function S(e){_(e,0)}const k=mr(_h,{"is-selected":n});return(0,c.jsx)("h1",{ref:(0,m.useMergeRefs)([w,r]),contentEditable:!0,className:k,"aria-label":b,role:"textbox","aria-multiline":"true",onFocus:function(){o(!0),h()},onBlur:function(){o(!1),u({})},onKeyDown:function(e){e.keyCode===ll.ENTER&&(e.preventDefault(),f(void 0,void 0,0))},onPaste:function(e){const t=e.clipboardData;let s="",n="";try{s=t.getData("text/plain"),n=t.getData("text/html")}catch(e){return}window.console.log("Received HTML:\n\n",n),window.console.log("Received plain text:\n\n",s);const o=(0,x.pasteHandler)({HTML:n,plainText:s});if(e.preventDefault(),o.length)if("string"!=typeof o){const[e]=o;if(i||"core/heading"!==e.name&&"core/paragraph"!==e.name)S(o);else{const t=(0,Uc.__unstableStripHTML)(e.attributes.content);a(t),S(o.slice(1))}}else{const e=(0,Uc.__unstableStripHTML)(o);v((0,$c.insert)(y,(0,$c.create)({html:e})))}}})}));var vh=(0,p.forwardRef)(((e,t)=>(0,c.jsx)(Bd,{supportKeys:"title",children:(0,c.jsx)(xh,{ref:t})})));var wh=(0,p.forwardRef)((function(e,t){const{placeholder:s}=(0,d.useSelect)((e=>{const{getSettings:t}=e(g.store),{titlePlaceholder:s}=t();return{placeholder:s}}),[]),[n,o]=(0,p.useState)(!1),{title:r,setTitle:i}=yh(),{ref:a}=bh(t),l=mr(_h,{"is-selected":n,"is-raw-text":!0}),u=(0,Ln.decodeEntities)(s)||(0,fs.__)("Add title");return(0,c.jsx)(Hn.TextareaControl,{ref:a,value:r,onChange:function(e){i(e.replace(fh," "))},onFocus:function(){o(!0)},onBlur:function(){o(!1)},label:s,className:l,placeholder:u,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1,__nextHasNoMarginBottom:!0})}));function Sh({children:e}){const{canTrashPost:t}=(0,d.useSelect)((e=>{const{isEditedPostNew:t,getCurrentPostId:s,getCurrentPostType:n}=e(vc),{canUser:o}=e(u.store),r=n(),i=s(),a=t(),l=!!i&&o("delete",{kind:"postType",name:r,id:i});return{canTrashPost:(!a||i)&&l&&!M.includes(r)}}),[]);return t?e:null}function kh({onActionPerformed:e}){const t=(0,d.useRegistry)(),{isNew:s,isDeleting:n,postId:o,title:r}=(0,d.useSelect)((e=>{const t=e(vc);return{isNew:t.isEditedPostNew(),isDeleting:t.isDeletingPost(),postId:t.getCurrentPostId(),title:t.getCurrentPostAttribute("title")}}),[]),{trashPost:i}=(0,d.useDispatch)(vc),[a,l]=(0,p.useState)(!1);if(s||!o)return null;return(0,c.jsxs)(Sh,{children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:n,"aria-disabled":n,onClick:n?void 0:()=>l(!0),children:(0,fs.__)("Move to trash")}),(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:a,onConfirm:async()=>{l(!1),await i();const s=await t.resolveSelect(vc).getCurrentPost();e?.("move-to-trash",[s])},onCancel:()=>l(!1),confirmButtonText:(0,fs.__)("Move to trash"),size:"small",children:(0,fs.sprintf)((0,fs.__)('Are you sure you want to move "%s" to the trash?'),r)})]})}function Ch({onClose:e}){const{isEditable:t,postSlug:s,postLink:n,permalinkPrefix:o,permalinkSuffix:r,permalink:i}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPost(),s=e(vc).getCurrentPostType(),n=e(u.store).getPostType(s),o=e(vc).getPermalinkParts(),r=t?._links?.["wp:action-publish"]??!1;return{isEditable:e(vc).isPermalinkEditable()&&r,postSlug:(0,w.safeDecodeURIComponent)(e(vc).getEditedPostSlug()),viewPostLabel:n?.labels.view_item,postLink:t.link,permalinkPrefix:o?.prefix,permalinkSuffix:o?.suffix,permalink:(0,w.safeDecodeURIComponent)(e(vc).getPermalink())}}),[]),{editPost:a}=(0,d.useDispatch)(vc),{createNotice:l}=(0,d.useDispatch)(_s.store),[h,_]=(0,p.useState)(!1),f=(0,m.useCopyToClipboard)(i,(()=>{l("info",(0,fs.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})})),b="editor-post-url__slug-description-"+(0,m.useInstanceId)(Ch);return(0,c.jsxs)("div",{className:"editor-post-url",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Slug"),onClose:e}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:3,children:[t&&(0,c.jsx)("p",{className:"editor-post-url__intro",children:(0,p.createInterpolateElement)((0,fs.__)("<span>Customize the last part of the Permalink.</span> <a>Learn more.</a>"),{span:(0,c.jsx)("span",{id:b}),a:(0,c.jsx)(Hn.ExternalLink,{href:(0,fs.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")})})}),(0,c.jsxs)("div",{children:[t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.__experimentalInputControl,{__next40pxDefaultSize:!0,prefix:(0,c.jsx)(Hn.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,c.jsx)(Hn.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,c.jsx)(Hn.Button,{icon:Tr,ref:f,size:"small",label:"Copy"})}),label:(0,fs.__)("Slug"),hideLabelFromVision:!0,value:h?"":s,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:e=>{a({slug:e}),e?h&&_(!1):h||_(!0)},onBlur:e=>{a({slug:(0,w.cleanForSlug)(e.target.value)}),h&&_(!1)},"aria-describedby":b}),(0,c.jsxs)("p",{className:"editor-post-url__permalink",children:[(0,c.jsx)("span",{className:"editor-post-url__permalink-visual-label",children:(0,fs.__)("Permalink:")}),(0,c.jsxs)(Hn.ExternalLink,{className:"editor-post-url__link",href:n,target:"_blank",children:[(0,c.jsx)("span",{className:"editor-post-url__link-prefix",children:o}),(0,c.jsx)("span",{className:"editor-post-url__link-slug",children:s}),(0,c.jsx)("span",{className:"editor-post-url__link-suffix",children:r})]})]})]}),!t&&(0,c.jsx)(Hn.ExternalLink,{className:"editor-post-url__link",href:n,target:"_blank",children:n})]})]})]})}function Ph({children:e}){const t=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getPostType(t);if(!s?.viewable)return!1;if(!e(vc).getCurrentPost().link)return!1;return!!e(vc).getPermalinkParts()}),[]);return t?e:null}function jh(){return Eh()}function Eh(){const e=(0,d.useSelect)((e=>e(vc).getPermalink()),[]);return(0,w.filterURLForDisplay)((0,w.safeDecodeURIComponent)(e))}function Th(){const{isFrontPage:e}=(0,d.useSelect)((e=>{const{getCurrentPostId:t}=e(vc),{getEditedEntityRecord:s,canUser:n}=e(u.store),o=n("read",{kind:"root",name:"site"})?s("root","site"):void 0,r=t();return{isFrontPage:o?.page_on_front===r}}),[]),[t,s]=(0,p.useState)(null),n=(0,p.useMemo)((()=>({anchor:t,placement:"left-start",offset:36,shift:!0})),[t]),o=e?(0,fs.__)("Link"):(0,fs.__)("Slug");return(0,c.jsx)(Ph,{children:(0,c.jsxs)(Rd,{label:o,ref:s,children:[!e&&(0,c.jsx)(Hn.Dropdown,{popoverProps:n,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Bh,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,c.jsx)(Ch,{onClose:e})}),e&&(0,c.jsx)(Ih,{})]})})}function Bh({isOpen:e,onClick:t}){const{slug:s}=(0,d.useSelect)((e=>({slug:e(vc).getEditedPostSlug()})),[]),n=(0,w.safeDecodeURIComponent)(s);return(0,c.jsx)(Hn.Button,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change link: %s"),n),onClick:t,children:(0,c.jsx)(c.Fragment,{children:n})})}function Ih(){const{postLink:e}=(0,d.useSelect)((e=>{const{getCurrentPost:t}=e(vc);return{postLink:t()?.link}}),[]);return(0,c.jsx)(Hn.ExternalLink,{className:"editor-post-url__front-page-link",href:e,target:"_blank",children:e})}function Nh({render:e}){return e({canEdit:(0,d.useSelect)((e=>e(vc).getCurrentPost()._links?.["wp:action-publish"]??!1))})}var Rh=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})});const Dh=window.wp.wordcount;function Ah(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("content")),[]),t=(0,fs._x)("words","Word count type. Do not translate!");return(0,c.jsx)("span",{className:"word-count",children:(0,Dh.count)(e,t)})}const Mh=189;function Lh(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("content")),[]),t=(0,fs._x)("words","Word count type. Do not translate!"),s=Math.round((0,Dh.count)(e,t)/Mh),n=0===s?(0,p.createInterpolateElement)((0,fs.__)("<span>< 1</span> minute"),{span:(0,c.jsx)("span",{})}):(0,p.createInterpolateElement)((0,fs.sprintf)((0,fs._n)("<span>%s</span> minute","<span>%s</span> minutes",s),s),{span:(0,c.jsx)("span",{})});return(0,c.jsx)("span",{className:"time-to-read",children:n})}function Oh(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("content")),[]);return(0,Dh.count)(e,"characters_including_spaces")}var Fh=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:s,paragraphCount:n,numberOfBlocks:o}=(0,d.useSelect)((e=>{const{getGlobalBlockCount:t}=e(g.store);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,fs.__)("Document Statistics"),tabIndex:"0",children:(0,c.jsxs)("ul",{role:"list",className:"table-of-contents__counts",children:[(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Words"),(0,c.jsx)(Ah,{})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Characters"),(0,c.jsx)("span",{className:"table-of-contents__number",children:(0,c.jsx)(Oh,{})})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Time to read"),(0,c.jsx)(Lh,{})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Headings"),(0,c.jsx)("span",{className:"table-of-contents__number",children:s})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Paragraphs"),(0,c.jsx)("span",{className:"table-of-contents__number",children:n})]}),(0,c.jsxs)("li",{className:"table-of-contents__count",children:[(0,fs.__)("Blocks"),(0,c.jsx)("span",{className:"table-of-contents__number",children:o})]})]})}),s>0&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("hr",{}),(0,c.jsx)("h2",{className:"table-of-contents__title",children:(0,fs.__)("Document Outline")}),(0,c.jsx)(ed,{onSelect:t,hasOutlineItemsDisabled:e})]})]})};var Vh=(0,p.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...s},n){const o=(0,d.useSelect)((e=>!!e(g.store).getBlockCount()),[]);return(0,c.jsx)(Hn.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,...s,ref:n,onClick:o?t:void 0,icon:Rh,"aria-expanded":e,"aria-haspopup":"true",label:(0,fs.__)("Details"),tooltipPosition:"bottom","aria-disabled":!o}),renderContent:({onClose:t})=>(0,c.jsx)(Fh,{onRequestClose:t,hasOutlineItemsDisabled:e})})}));function Uh(){const{__experimentalGetDirtyEntityRecords:e}=(0,d.useSelect)(u.store);return(0,p.useEffect)((()=>{const t=t=>{if(e().length>0)return t.returnValue=(0,fs.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}const Hh=window.wp.serverSideRender;var zh=s.n(Hh);function Gh(e,t,s=[]){const n=(0,p.forwardRef)(((s,n)=>(k()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,c.jsx)(t,{ref:n,...s}))));return s.forEach((s=>{n[s]=Gh(e+"."+s,t[s])})),n}function $h(e,t){return(...s)=>(k()("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...s))}const Wh=Gh("RichText",g.RichText,["Content"]);Wh.isEmpty=$h("RichText.isEmpty",g.RichText.isEmpty);const Zh=Gh("Autocomplete",g.Autocomplete),Yh=Gh("AlignmentToolbar",g.AlignmentToolbar),qh=Gh("BlockAlignmentToolbar",g.BlockAlignmentToolbar),Kh=Gh("BlockControls",g.BlockControls,["Slot"]),Qh=Gh("BlockEdit",g.BlockEdit),Xh=Gh("BlockEditorKeyboardShortcuts",g.BlockEditorKeyboardShortcuts),Jh=Gh("BlockFormatControls",g.BlockFormatControls,["Slot"]),eg=Gh("BlockIcon",g.BlockIcon),tg=Gh("BlockInspector",g.BlockInspector),sg=Gh("BlockList",g.BlockList),ng=Gh("BlockMover",g.BlockMover),og=Gh("BlockNavigationDropdown",g.BlockNavigationDropdown),rg=Gh("BlockSelectionClearer",g.BlockSelectionClearer),ig=Gh("BlockSettingsMenu",g.BlockSettingsMenu),ag=Gh("BlockTitle",g.BlockTitle),lg=Gh("BlockToolbar",g.BlockToolbar),cg=Gh("ColorPalette",g.ColorPalette),dg=Gh("ContrastChecker",g.ContrastChecker),ug=Gh("CopyHandler",g.CopyHandler),pg=Gh("DefaultBlockAppender",g.DefaultBlockAppender),mg=Gh("FontSizePicker",g.FontSizePicker),hg=Gh("Inserter",g.Inserter),gg=Gh("InnerBlocks",g.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),_g=Gh("InspectorAdvancedControls",g.InspectorAdvancedControls,["Slot"]),fg=Gh("InspectorControls",g.InspectorControls,["Slot"]),bg=Gh("PanelColorSettings",g.PanelColorSettings),yg=Gh("PlainText",g.PlainText),xg=Gh("RichTextShortcut",g.RichTextShortcut),vg=Gh("RichTextToolbarButton",g.RichTextToolbarButton),wg=Gh("__unstableRichTextInputEvent",g.__unstableRichTextInputEvent),Sg=Gh("MediaPlaceholder",g.MediaPlaceholder),kg=Gh("MediaUpload",g.MediaUpload),Cg=Gh("MediaUploadCheck",g.MediaUploadCheck),Pg=Gh("MultiSelectScrollIntoView",g.MultiSelectScrollIntoView),jg=Gh("NavigableToolbar",g.NavigableToolbar),Eg=Gh("ObserveTyping",g.ObserveTyping),Tg=Gh("SkipToSelectedBlock",g.SkipToSelectedBlock),Bg=Gh("URLInput",g.URLInput),Ig=Gh("URLInputButton",g.URLInputButton),Ng=Gh("URLPopover",g.URLPopover),Rg=Gh("Warning",g.Warning),Dg=Gh("WritingFlow",g.WritingFlow),Ag=$h("createCustomColorsHOC",g.createCustomColorsHOC),Mg=$h("getColorClassName",g.getColorClassName),Lg=$h("getColorObjectByAttributeValues",g.getColorObjectByAttributeValues),Og=$h("getColorObjectByColorValue",g.getColorObjectByColorValue),Fg=$h("getFontSize",g.getFontSize),Vg=$h("getFontSizeClass",g.getFontSizeClass),Ug=$h("withColorContext",g.withColorContext),Hg=$h("withColors",g.withColors),zg=$h("withFontSizes",g.withFontSizes),Gg=kl,$g=kl;function Wg(e){return k()("wp.editor.cleanForSlug",{since:"12.7",plugin:"Gutenberg",alternative:"wp.url.cleanForSlug"}),(0,w.cleanForSlug)(e)}var Zg=(0,Hn.createSlotFill)(Symbol("EditCanvasContainerSlot"));const Yg="__experimentalMainDashboardButton",{Fill:qg,Slot:Kg}=(0,Hn.createSlotFill)(Yg),Qg=qg;Qg.Slot=()=>{const e=(0,Hn.__experimentalUseSlotFills)(Yg);return(0,c.jsx)(Kg,{bubblesVirtually:!0,fillProps:{length:e?e.length:0}})};var Xg=Qg,Jg=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),e_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})});const{useHasBlockToolbar:t_}=$(g.privateApis);function s_({isCollapsed:e,onToggle:t}){const{blockSelectionStart:s}=(0,d.useSelect)((e=>({blockSelectionStart:e(g.store).getBlockSelectionStart()})),[]),n=t_(),o=!!s;return(0,p.useEffect)((()=>{s&&t(!1)}),[s,t]),n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:mr("editor-collapsible-block-toolbar",{"is-collapsed":e||!o}),children:(0,c.jsx)(g.BlockToolbar,{hideDragHandle:!0})}),(0,c.jsx)(Hn.Popover.Slot,{name:"block-toolbar"}),(0,c.jsx)(Hn.Button,{className:"editor-collapsible-block-toolbar__toggle",icon:e?Jg:e_,onClick:()=>{t(!e)},label:e?(0,fs.__)("Show block tools"):(0,fs.__)("Hide block tools"),size:"compact"})]}):null}var n_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});var o_=function({className:e,disableBlockTools:t=!1}){const{setIsInserterOpened:s,setIsListViewOpened:n}=(0,d.useDispatch)(vc),{isDistractionFree:o,isInserterOpened:r,isListViewOpen:i,listViewShortcut:a,inserterSidebarToggleRef:l,listViewToggleRef:u,showIconLabels:h}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{isListViewOpened:s,getEditorMode:n,getInserterSidebarToggleRef:o,getListViewToggleRef:r}=$(e(vc)),{getShortcutRepresentation:i}=e(il.store);return{isInserterOpened:e(vc).isInserterOpened(),isListViewOpen:s(),listViewShortcut:i("core/editor/toggle-list-view"),inserterSidebarToggleRef:o(),listViewToggleRef:r(),showIconLabels:t("core","showIconLabels"),isDistractionFree:t("core","distractionFree"),isVisualMode:"visual"===n()}}),[]),_=(0,m.useViewportMatch)("wide"),f=(0,fs.__)("Document tools"),b=(0,p.useCallback)((()=>n(!i)),[n,i]),y=(0,p.useCallback)((()=>s(!r)),[r,s]),x=(0,fs._x)("Block Inserter","Generic label for block inserter button"),v=r?(0,fs.__)("Close"):(0,fs.__)("Add");return(0,c.jsx)(g.NavigableToolbar,{className:mr("editor-document-tools","edit-post-header-toolbar",e),"aria-label":f,variant:"unstyled",children:(0,c.jsxs)("div",{className:"editor-document-tools__left",children:[!o&&(0,c.jsx)(Hn.ToolbarButton,{ref:l,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:r,onMouseDown:e=>{r&&e.preventDefault()},onClick:y,disabled:t,icon:n_,label:h?v:x,showTooltip:!h,"aria-expanded":r}),(_||!h)&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.ToolbarItem,{as:id,showTooltip:!h,variant:h?"tertiary":void 0,size:"compact"}),(0,c.jsx)(Hn.ToolbarItem,{as:rd,showTooltip:!h,variant:h?"tertiary":void 0,size:"compact"}),!o&&(0,c.jsx)(Hn.ToolbarButton,{className:"editor-document-tools__document-overview-toggle",icon:Wi,disabled:t,isPressed:i,label:(0,fs.__)("Document Overview"),onClick:b,shortcut:a,showTooltip:!h,variant:h?"tertiary":void 0,"aria-expanded":i,ref:u})]})]})})},r_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});function i_(){const{createNotice:e}=(0,d.useDispatch)(_s.store),{getCurrentPostId:t,getCurrentPostType:s}=(0,d.useSelect)(vc),{getEditedEntityRecord:n}=(0,d.useSelect)(u.store);const o=(0,m.useCopyToClipboard)((function(){const e=n("postType",s(),t());return e?"function"==typeof e.content?e.content(e):e.blocks?(0,x.__unstableSerializeAndClean)(e.blocks):e.content?e.content:void 0:""}),(function(){e("info",(0,fs.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,c.jsx)(Hn.MenuItem,{ref:o,children:(0,fs.__)("Copy all blocks")})}const a_=[{value:"visual",label:(0,fs.__)("Visual editor")},{value:"text",label:(0,fs.__)("Code editor")}];var l_=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:s,mode:n}=(0,d.useSelect)((e=>({shortcut:e(il.store).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:e(vc).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(vc).getEditorSettings().codeEditingEnabled,mode:e(vc).getEditorMode()})),[]),{switchEditorMode:o}=(0,d.useDispatch)(vc);let r=n;t||"visual"!==n||(r="text"),s||"text"!==n||(r="visual");const i=a_.map((n=>(s||"text"!==n.value||(n={...n,disabled:!0}),t||"visual"!==n.value||(n={...n,disabled:!0,info:(0,fs.__)("You can enable the visual editor in your profile settings.")}),n.value===r||n.disabled?n:{...n,shortcut:e})));return(0,c.jsx)(Hn.MenuGroup,{label:(0,fs.__)("Editor"),children:(0,c.jsx)(Hn.MenuItemsChoice,{choices:i,value:r,onSelect:o})})};const{Fill:c_,Slot:d_}=(0,Hn.createSlotFill)("ToolsMoreMenuGroup");c_.Slot=({fillProps:e})=>(0,c.jsx)(d_,{fillProps:e});var u_=c_;const{Fill:p_,Slot:m_}=(0,Hn.createSlotFill)("web"===p.Platform.OS?Symbol("ViewMoreMenuGroup"):"ViewMoreMenuGroup");p_.Slot=({fillProps:e})=>(0,c.jsx)(m_,{fillProps:e});var h_=p_;function g_(){const{openModal:e}=(0,d.useDispatch)(ja),{set:t}=(0,d.useDispatch)(C.store),{toggleDistractionFree:s}=(0,d.useDispatch)(vc),n=(0,d.useSelect)((e=>e(C.store).get("core","showIconLabels")),[]),o=()=>{t("core","distractionFree",!1)};return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Hn.DropdownMenu,{icon:r_,label:(0,fs.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!n,...n&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact"},children:({onClose:t})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Hn.MenuGroup,{label:(0,fs._x)("View","noun"),children:[(0,c.jsx)(C.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:o,label:(0,fs.__)("Top toolbar"),info:(0,fs.__)("Access all block and document tools in a single place"),messageActivated:(0,fs.__)("Top toolbar activated."),messageDeactivated:(0,fs.__)("Top toolbar deactivated.")}),(0,c.jsx)(C.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",label:(0,fs.__)("Distraction free"),info:(0,fs.__)("Write with calmness"),handleToggling:!1,onToggle:()=>s({createNotice:!1}),messageActivated:(0,fs.__)("Distraction free mode activated."),messageDeactivated:(0,fs.__)("Distraction free mode deactivated."),shortcut:ll.displayShortcut.primaryShift("\\")}),(0,c.jsx)(C.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,fs.__)("Spotlight mode"),info:(0,fs.__)("Focus on one block at a time"),messageActivated:(0,fs.__)("Spotlight mode activated."),messageDeactivated:(0,fs.__)("Spotlight mode deactivated.")}),(0,c.jsx)(h_.Slot,{fillProps:{onClose:t}})]}),(0,c.jsx)(l_,{}),(0,c.jsx)(Na.Slot,{name:"core/plugin-more-menu",label:(0,fs.__)("Panels"),fillProps:{onClick:t}}),(0,c.jsxs)(Hn.MenuGroup,{label:(0,fs.__)("Tools"),children:[(0,c.jsx)(Hn.MenuItem,{onClick:()=>e("editor/keyboard-shortcut-help"),shortcut:ll.displayShortcut.access("h"),children:(0,fs.__)("Keyboard shortcuts")}),(0,c.jsx)(i_,{}),(0,c.jsxs)(Hn.MenuItem,{icon:Fn,href:(0,fs.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,fs.__)("Help"),(0,c.jsx)(Hn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]}),(0,c.jsx)(u_.Slot,{fillProps:{onClose:t}})]}),(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Hn.MenuItem,{onClick:()=>e("editor/preferences"),children:(0,fs.__)("Preferences")})})]})})})}const __="toggle",f_="button";function b_({forceIsDirty:e,setEntitiesSavedStatesCallback:t}){let s;const n=(0,m.useViewportMatch)("medium","<"),{togglePublishSidebar:o}=(0,d.useDispatch)(vc),{hasPublishAction:r,isBeingScheduled:i,isPending:a,isPublished:l,isPublishSidebarEnabled:u,isPublishSidebarOpened:p,isScheduled:h,postStatus:g,postStatusHasChanged:_}=(0,d.useSelect)((e=>({hasPublishAction:!!e(vc).getCurrentPost()?._links?.["wp:action-publish"],isBeingScheduled:e(vc).isEditedPostBeingScheduled(),isPending:e(vc).isCurrentPostPending(),isPublished:e(vc).isCurrentPostPublished(),isPublishSidebarEnabled:e(vc).isPublishSidebarEnabled(),isPublishSidebarOpened:e(vc).isPublishSidebarOpened(),isScheduled:e(vc).isCurrentPostScheduled(),postStatus:e(vc).getEditedPostAttribute("status"),postStatusHasChanged:e(vc).getPostEdits()?.status})),[]);return s=l||_&&!["future","publish"].includes(g)||h&&i||a&&!r&&!n?f_:n||u?__:f_,(0,c.jsx)(Vp,{forceIsDirty:e,isOpen:p,isToggle:s===__,onToggle:o,setEntitiesSavedStatesCallback:t})}function y_(){const{hasLoaded:e,permalink:t,isPublished:s,label:n,showIconLabels:o}=(0,d.useSelect)((e=>{const t=e(vc).getCurrentPostType(),s=e(u.store).getPostType(t),{get:n}=e(C.store);return{permalink:e(vc).getPermalink(),isPublished:e(vc).isCurrentPostPublished(),label:s?.labels.view_item,hasLoaded:!!s,showIconLabels:n("core","showIconLabels")}}),[]);return s&&t&&e?(0,c.jsx)(Hn.Button,{icon:Fn,label:n||(0,fs.__)("View post"),href:t,target:"_blank",showTooltip:!o,size:"compact"}):null}var x_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})}),v_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})}),w_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})});function S_({forceIsAutosaveable:e,disabled:t}){const{deviceType:s,homeUrl:n,isTemplate:o,isViewable:r,showIconLabels:i,isTemplateHidden:a,templateId:l}=(0,d.useSelect)((e=>{const{getDeviceType:t,getCurrentPostType:s,getCurrentTemplateId:n,getRenderingMode:o}=e(vc),{getEntityRecord:r,getPostType:i}=e(u.store),{get:a}=e(C.store),l=s();return{deviceType:t(),homeUrl:r("root","__unstableBase")?.home,isTemplate:"wp_template"===l,isViewable:i(l)?.viewable??!1,showIconLabels:a("core","showIconLabels"),isTemplateHidden:"post-only"===o(),templateId:n()}}),[]),{setDeviceType:p,setRenderingMode:h,setDefaultRenderingMode:_}=$((0,d.useDispatch)(vc)),{resetZoomLevel:f}=$((0,d.useDispatch)(g.store)),b=e=>{p(e),f()};if((0,m.useViewportMatch)("medium","<"))return null;const y={className:"editor-preview-dropdown__toggle",iconPosition:"right",size:"compact",showTooltip:!i,disabled:t,accessibleWhenDisabled:t},x={"aria-label":(0,fs.__)("View options")},v={desktop:x_,mobile:v_,tablet:w_},w=[{value:"Desktop",label:(0,fs.__)("Desktop"),icon:x_},{value:"Tablet",label:(0,fs.__)("Tablet"),icon:w_},{value:"Mobile",label:(0,fs.__)("Mobile"),icon:v_}];return(0,c.jsx)(Hn.DropdownMenu,{className:mr("editor-preview-dropdown",`editor-preview-dropdown--${s.toLowerCase()}`),popoverProps:{placement:"bottom-end"},toggleProps:y,menuProps:x,icon:v[s.toLowerCase()],label:(0,fs.__)("View"),disableOpenOnArrowDown:t,children:({onClose:t})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Hn.MenuItemsChoice,{choices:w,value:s,onSelect:b})}),o&&(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsxs)(Hn.MenuItem,{href:n,target:"_blank",icon:Fn,onClick:t,children:[(0,fs.__)("View site"),(0,c.jsx)(Hn.VisuallyHidden,{as:"span",children:(0,fs.__)("(opens in a new tab)")})]})}),!o&&!!l&&(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Hn.MenuItem,{icon:a?void 0:zn,isSelected:!a,role:"menuitemcheckbox",onClick:()=>{const e=a?"template-locked":"post-only";h(e),_(e),f()},children:(0,fs.__)("Show template")})}),r&&(0,c.jsx)(Hn.MenuGroup,{children:(0,c.jsx)(Mp,{className:"editor-preview-dropdown__button-external",role:"menuitem",forceIsAutosaveable:e,"aria-label":(0,fs.__)("Preview in new tab"),textContent:(0,c.jsxs)(c.Fragment,{children:[(0,fs.__)("Preview in new tab"),(0,c.jsx)(Hn.Icon,{icon:Fn})]}),onPreview:t})}),(0,c.jsx)(Na.Slot,{name:"core/plugin-preview-menu",fillProps:{onClick:t}})]})})}var k_=(0,c.jsx)(L.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(L.Path,{fill:"none",d:"M5.75 12.75V18.25H11.25M12.75 5.75H18.25V11.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"square"})});var C_=({disabled:e})=>{const{isZoomOut:t,showIconLabels:s,isDistractionFree:n}=(0,d.useSelect)((e=>({isZoomOut:$(e(g.store)).isZoomOut(),showIconLabels:e(C.store).get("core","showIconLabels"),isDistractionFree:e(C.store).get("core","distractionFree")}))),{resetZoomLevel:o,setZoomLevel:r}=$((0,d.useDispatch)(g.store)),{registerShortcut:i,unregisterShortcut:a}=(0,d.useDispatch)(il.store);(0,p.useEffect)((()=>(i({name:"core/editor/zoom",category:"global",description:(0,fs.__)("Enter or exit zoom out."),keyCombination:{modifier:(0,ll.isAppleOS)()?"primaryShift":"secondary",character:"0"}}),()=>{a("core/editor/zoom")})),[i,a]),(0,il.useShortcut)("core/editor/zoom",(()=>{t?o():r("auto-scaled")}),{isDisabled:n});return(0,c.jsx)(Hn.Button,{accessibleWhenDisabled:!0,disabled:e,onClick:()=>{t?o():r("auto-scaled")},icon:k_,label:(0,fs.__)("Zoom Out"),isPressed:t,size:"compact",showTooltip:!s,className:"editor-zoom-out-toggle"})};const P_={distractionFreeDisabled:{y:"-50px"},distractionFreeHover:{y:0},distractionFreeHidden:{y:"-50px"},visible:{y:0},hidden:{y:0}},j_={distractionFreeDisabled:{x:"-100%"},distractionFreeHover:{x:0},distractionFreeHidden:{x:"-100%"},visible:{x:0},hidden:{x:0}};var E_=function({customSaveButton:e,forceIsDirty:t,forceDisableBlockTools:s,setEntitiesSavedStatesCallback:n,title:o}){const r=(0,m.useViewportMatch)("large"),i=(0,m.useViewportMatch)("medium"),a=(0,m.useMediaQuery)("(max-width: 403px)"),{postType:l,isTextEditor:u,isPublishSidebarOpened:h,showIconLabels:_,hasFixedToolbar:f,hasBlockSelection:b,hasSectionRootClientId:y}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{getEditorMode:s,getCurrentPostType:n,isPublishSidebarOpened:o}=e(vc),{getBlockSelectionStart:r,getSectionRootClientId:i}=$(e(g.store));return{postType:n(),isTextEditor:"text"===s(),isPublishSidebarOpened:o(),showIconLabels:t("core","showIconLabels"),hasFixedToolbar:t("core","fixedToolbar"),hasBlockSelection:!!r(),hasSectionRootClientId:!!i()}}),[]),x=["post","page","wp_template"].includes(l)&&y,v=[R,I,N].includes(l)||s,[w,S]=(0,p.useState)(!0),k=!a&&(!f||f&&(!b||w)),P=(()=>{const e=(0,Hn.__experimentalUseSlotFills)(Yg);return Boolean(e&&e.length)})();return(0,c.jsxs)("div",{className:"editor-header edit-post-header",children:[P&&(0,c.jsx)(Hn.__unstableMotion.div,{className:"editor-header__back-button",variants:j_,transition:{type:"tween"},children:(0,c.jsx)(Xg.Slot,{})}),(0,c.jsxs)(Hn.__unstableMotion.div,{variants:P_,className:"editor-header__toolbar",transition:{type:"tween"},children:[(0,c.jsx)(o_,{disableBlockTools:s||u}),f&&i&&(0,c.jsx)(s_,{isCollapsed:w,onToggle:S})]}),k&&(0,c.jsx)(Hn.__unstableMotion.div,{className:"editor-header__center",variants:P_,transition:{type:"tween"},children:(0,c.jsx)(Gc,{title:o})}),(0,c.jsxs)(Hn.__unstableMotion.div,{variants:P_,transition:{type:"tween"},className:"editor-header__settings",children:[!e&&!h&&(0,c.jsx)(nh,{forceIsDirty:t}),(0,c.jsx)(y_,{}),(0,c.jsx)(S_,{forceIsAutosaveable:t,disabled:v}),(0,c.jsx)(Mp,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),r&&x&&(0,c.jsx)(C_,{disabled:s}),(r||!_)&&(0,c.jsx)(Ma.Slot,{scope:"core"}),!e&&(0,c.jsx)(b_,{forceIsDirty:t,setEntitiesSavedStatesCallback:n}),e,(0,c.jsx)(g_,{})]})]})};const{PrivateInserterLibrary:T_}=$(g.privateApis);function B_(){const{blockSectionRootClientId:e,inserterSidebarToggleRef:t,inserter:s,showMostUsedBlocks:n,sidebarIsOpened:o}=(0,d.useSelect)((e=>{const{getInserterSidebarToggleRef:t,getInserter:s,isPublishSidebarOpened:n}=$(e(vc)),{getBlockRootClientId:o,isZoomOut:r,getSectionRootClientId:i}=$(e(g.store)),{get:a}=e(C.store),{getActiveComplementaryArea:l}=e(ja);return{inserterSidebarToggleRef:t(),inserter:s(),showMostUsedBlocks:a("core","mostUsedBlocks"),blockSectionRootClientId:(()=>{if(r()){const e=i();if(e)return e}return o()})(),sidebarIsOpened:!(!l("core")&&!n())}}),[]),{setIsInserterOpened:r}=(0,d.useDispatch)(vc),{disableComplementaryArea:i}=(0,d.useDispatch)(ja),a=(0,m.useViewportMatch)("medium","<"),l=(0,p.useRef)(),u=(0,p.useCallback)((()=>{r(!1),t.current?.focus()}),[t,r]),h=(0,p.useCallback)((e=>{e.keyCode!==ll.ESCAPE||e.defaultPrevented||(e.preventDefault(),u())}),[u]),_=(0,c.jsx)("div",{className:"editor-inserter-sidebar__content",children:(0,c.jsx)(T_,{showMostUsedBlocks:n,showInserterHelpPanel:!0,shouldFocusBlock:a,rootClientId:e,onSelect:s.onSelect,__experimentalInitialTab:s.tab,__experimentalInitialCategory:s.category,__experimentalFilterValue:s.filterValue,onPatternCategorySelection:o?()=>i("core"):void 0,ref:l,onClose:u})});return(0,c.jsx)("div",{onKeyDown:h,className:"editor-inserter-sidebar",children:_})}function I_(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"editor-list-view-sidebar__outline",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Characters:")}),(0,c.jsx)(Hn.__experimentalText,{children:(0,c.jsx)(Oh,{})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Words:")}),(0,c.jsx)(Ah,{})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Time to read:")}),(0,c.jsx)(Lh,{})]})]}),(0,c.jsx)(ed,{})]})}const{TabbedSidebar:N_}=$(g.privateApis);function R_(){const{setIsListViewOpened:e}=(0,d.useDispatch)(vc),{getListViewToggleRef:t}=$((0,d.useSelect)(vc)),s=(0,m.useFocusOnMount)("firstElement"),n=(0,p.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),o=(0,p.useCallback)((e=>{e.keyCode!==ll.ESCAPE||e.defaultPrevented||(e.preventDefault(),n())}),[n]),[r,i]=(0,p.useState)(null),[a,l]=(0,p.useState)("list-view"),u=(0,p.useRef)(),h=(0,p.useRef)(),_=(0,p.useRef)(),f=(0,m.useMergeRefs)([s,_,i]);const b=(0,p.useCallback)((()=>{u.current.contains(u.current.ownerDocument.activeElement)?n():function(e){const t=Uc.focus.tabbable.find(h.current)[0];if("list-view"===e){const e=Uc.focus.tabbable.find(_.current)[0];(u.current.contains(e)?e:t).focus()}else t.focus()}(a)}),[n,a]);return(0,il.useShortcut)("core/editor/toggle-list-view",b),(0,c.jsx)("div",{className:"editor-list-view-sidebar",onKeyDown:o,ref:u,children:(0,c.jsx)(N_,{tabs:[{name:"list-view",title:(0,fs._x)("List View","Post overview"),panel:(0,c.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,c.jsx)("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:(0,c.jsx)(g.__experimentalListView,{dropZoneElement:r})})}),panelRef:f},{name:"outline",title:(0,fs._x)("Outline","Post overview"),panel:(0,c.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,c.jsx)(I_,{})})}],onClose:n,onSelect:e=>l(e),defaultTabId:"list-view",ref:h,closeButtonLabel:(0,fs.__)("Close")})})}const{Fill:D_,Slot:A_}=(0,Hn.createSlotFill)("ActionsPanel");function M_({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:s,forceIsDirtyPublishPanel:n}){const{closePublishSidebar:o,togglePublishSidebar:r}=(0,d.useDispatch)(vc),{publishSidebarOpened:i,isPublishable:a,isDirty:l,hasOtherEntitiesChanges:u}=(0,d.useSelect)((e=>{const{isPublishSidebarOpened:t,isEditedPostPublishable:s,isCurrentPostPublished:n,isEditedPostDirty:o,hasNonPostEntityChanges:r}=e(vc),i=r();return{publishSidebarOpened:t(),isPublishable:!n()&&s(),isDirty:i||o(),hasOtherEntitiesChanges:i}}),[]),m=(0,p.useCallback)((()=>e(!0)),[]);let h;return h=i?(0,c.jsx)(Ym,{onClose:o,forceIsDirty:n,PrePublishExtension:Tu.Slot,PostPublishExtension:vu.Slot}):a&&!u?(0,c.jsx)("div",{className:"editor-layout__toggle-publish-panel",children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:r,"aria-expanded":!1,children:(0,fs.__)("Open publish panel")})}):(0,c.jsx)("div",{className:"editor-layout__toggle-entities-saved-states-panel",children:(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:m,"aria-expanded":!1,"aria-haspopup":"dialog",disabled:!l,accessibleWhenDisabled:!0,children:(0,fs.__)("Open save panel")})}),(0,c.jsxs)(c.Fragment,{children:[s&&(0,c.jsx)(yd,{close:t,renderDialog:!0}),(0,c.jsx)(A_,{bubblesVirtually:!0}),!s&&h]})}function L_({autoFocus:e=!1}){const{switchEditorMode:t}=(0,d.useDispatch)(vc),{shortcut:s,isRichEditingEnabled:n}=(0,d.useSelect)((e=>{const{getEditorSettings:t}=e(vc),{getShortcutRepresentation:s}=e(il.store);return{shortcut:s("core/editor/toggle-mode"),isRichEditingEnabled:t().richEditingEnabled}}),[]),o=(0,p.useRef)();return(0,p.useEffect)((()=>{e||o?.current?.focus()}),[e]),(0,c.jsxs)("div",{className:"editor-text-editor",children:[n&&(0,c.jsxs)("div",{className:"editor-text-editor__toolbar",children:[(0,c.jsx)("h2",{children:(0,fs.__)("Editing code")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t("visual"),shortcut:s,children:(0,fs.__)("Exit code editor")})]}),(0,c.jsxs)("div",{className:"editor-text-editor__body",children:[(0,c.jsx)(wh,{ref:o}),(0,c.jsx)(gh,{})]})]})}function O_({contentRef:e}){const{onNavigateToEntityRecord:t,templateId:s}=(0,d.useSelect)((e=>{const{getEditorSettings:t,getCurrentTemplateId:s}=e(vc);return{onNavigateToEntityRecord:t().onNavigateToEntityRecord,templateId:s()}}),[]),n=(0,d.useSelect)((e=>!!e(u.store).canUser("create",{kind:"postType",name:"wp_template"})),[]),[o,r]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const t=e=>{n&&e.target.classList.contains("is-root-container")&&"core/template-part"!==e.target.dataset?.type&&(e.defaultPrevented||(e.preventDefault(),r(!0)))},s=e.current;return s?.addEventListener("dblclick",t),()=>{s?.removeEventListener("dblclick",t)}}),[e,n]),n?(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:o,confirmButtonText:(0,fs.__)("Edit template"),onConfirm:()=>{r(!1),t({postId:s,postType:"wp_template"})},onCancel:()=>r(!1),size:"medium",children:(0,fs.__)("You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?")}):null}function F_({direction:e,resizeWidthBy:t}){const s=`resizable-editor__resize-help-${e}`;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Hn.Tooltip,{text:(0,fs.__)("Drag to resize"),children:(0,c.jsx)(Hn.__unstableMotion.button,{className:`editor-resizable-editor__resize-handle is-${e}`,"aria-label":(0,fs.__)("Drag to resize"),"aria-describedby":s,onKeyDown:function(s){const{keyCode:n}=s;n!==ll.LEFT&&n!==ll.RIGHT||(s.preventDefault(),"left"===e&&n===ll.LEFT||"right"===e&&n===ll.RIGHT?t(20):("left"===e&&n===ll.RIGHT||"right"===e&&n===ll.LEFT)&&t(-20))},variants:{active:{opacity:1,scaleY:1.3}},whileFocus:"active",whileHover:"active",whileTap:"active",role:"separator","aria-orientation":"vertical"},"handle")}),(0,c.jsx)(Hn.VisuallyHidden,{id:s,children:(0,fs.__)("Use left and right arrow keys to resize the canvas.")})]})}const V_={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};var U_=function({className:e,enableResizing:t,height:s,children:n}){const[o,r]=(0,p.useState)("100%"),i=(0,p.useRef)(),a=(0,p.useCallback)((e=>{i.current&&r(i.current.offsetWidth+e)}),[]);return(0,c.jsx)(Hn.ResizableBox,{className:mr("editor-resizable-editor",e,{"is-resizable":t}),ref:e=>{i.current=e?.resizable},size:{width:t?o:"100%",height:t&&s?s:"100%"},onResizeStop:(e,t,s)=>{r(s.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{left:t,right:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,c.jsx)(F_,{direction:"left",resizeWidthBy:a}),right:(0,c.jsx)(F_,{direction:"right",resizeWidthBy:a})},handleClasses:void 0,handleStyles:{left:V_,right:V_},children:n})};function H_(e,t,s){return Math.min(Math.max(e,t),s)}function z_(e,t,s){const n=e-H_(e,s.left,s.right),o=t-H_(t,s.top,s.bottom);return Math.sqrt(n*n+o*o)}function G_({isEnabled:e=!0}={}){const{getEnabledClientIdsTree:t,getBlockName:s,getBlockOrder:n}=$((0,d.useSelect)(g.store)),{selectBlock:o}=(0,d.useDispatch)(g.store);return(0,m.useRefEffect)((r=>{if(!e)return;const i=e=>{(e.target===r||e.target.classList.contains("is-root-container"))&&((e,i)=>{const a=t().flatMap((({clientId:e})=>{const t=s(e);if("core/template-part"===t)return[];if("core/post-content"===t){const t=n(e);if(t.length)return t}return[e]}));let l=1/0,c=null;for(const t of a){const s=r.querySelector(`[data-block="${t}"]`);if(!s)continue;const n=z_(e,i,s.getBoundingClientRect());n<l&&n<500&&(l=n,c=t)}c&&o(c)})(e.clientX,e.clientY)};return r.addEventListener("click",i),()=>r.removeEventListener("click",i)}),[e])}function $_(){const{getSettings:e,isZoomOut:t}=$((0,d.useSelect)(g.store)),{resetZoomLevel:s}=$((0,d.useDispatch)(g.store));return(0,m.useRefEffect)((n=>{function o(n){if(t()&&!n.defaultPrevented){n.preventDefault();const{__experimentalSetIsInserterOpened:t}=e();"function"==typeof t&&t(!1),s()}}return n.addEventListener("dblclick",o),()=>{n.removeEventListener("dblclick",o)}}),[e,t,s])}const{LayoutStyle:W_,useLayoutClasses:Z_,useLayoutStyles:Y_,ExperimentalBlockCanvas:q_,useFlashEditableBlocks:K_}=$(g.privateApis),Q_=[N,B,R,I];function X_(e){for(let t=0;t<e.length;t++){if("core/post-content"===e[t].name)return e[t].attributes;if(e[t].innerBlocks.length){const s=X_(e[t].innerBlocks);if(s)return s}}}function J_(e){for(let t=0;t<e.length;t++)if("core/post-content"===e[t].name)return!0;return!1}var ef=function({autoFocus:e,styles:t,disableIframe:s=!1,iframeProps:n,contentRef:o,className:r}){const i=(0,m.useViewportMatch)("small","<"),{renderingMode:a,postContentAttributes:l,editedPostTemplate:h={},wrapperBlockName:_,wrapperUniqueId:f,deviceType:b,isFocusedEntity:y,isDesignPostType:v,postType:w,isPreview:S,canvasMinHeight:k}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:s,getCurrentTemplateId:n,getEditorSettings:o,getRenderingMode:r,getDeviceType:i,getCanvasMinHeight:a}=$(e(vc)),{getPostType:l,getEditedEntityRecord:c}=e(u.store),d=s(),p=r();let m;d===N?m="core/block":"post-only"===p&&(m="core/post-content");const h=o(),g=h.supportsTemplateMode,_=l(d),f=n(),b=f?c("postType",B,f):void 0;return{renderingMode:p,postContentAttributes:h.postContentAttributes,isDesignPostType:Q_.includes(d),editedPostTemplate:_?.viewable&&g?b:void 0,wrapperBlockName:m,wrapperUniqueId:t(),deviceType:i(),isFocusedEntity:!!h.onNavigateToPreviousEntityRecord,postType:d,isPreview:h.isPreviewMode,canvasMinHeight:a()}}),[]),{isCleanNewPost:C}=(0,d.useSelect)(vc),{hasRootPaddingAwareAlignments:P,themeHasDisabledLayoutStyles:j,themeSupportsLayout:E,isZoomedOut:T}=(0,d.useSelect)((e=>{const{getSettings:t,isZoomOut:s}=$(e(g.store)),n=t();return{themeHasDisabledLayoutStyles:n.disableLayoutStyles,themeSupportsLayout:n.supportsLayout,hasRootPaddingAwareAlignments:n.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomedOut:s()}}),[]),D=(0,p.useRef)(),A=(0,g.__experimentalUseResizeCanvas)(b),[M]=(0,g.useSettings)("layout"),L=(0,p.useMemo)((()=>"post-only"!==a||v?{type:"default"}:E?{...M,type:"constrained"}:{type:"default"}),[a,E,M,v]),O=(0,p.useMemo)((()=>{if(!h?.content&&!h?.blocks&&l)return l;if(h?.blocks)return X_(h?.blocks);const e="string"==typeof h?.content?h?.content:"";return X_((0,x.parse)(e))||{}}),[h?.content,h?.blocks,l]),F=(0,p.useMemo)((()=>{if(!h?.content&&!h?.blocks)return!1;if(h?.blocks)return J_(h?.blocks);const e="string"==typeof h?.content?h?.content:"";return J_((0,x.parse)(e))||!1}),[h?.content,h?.blocks]),{layout:V={},align:U=""}=O||{},H=Z_(O,"core/post-content"),z=mr({"is-layout-flow":!E},E&&H,U&&`align${U}`),G=Y_(O,"core/post-content",".block-editor-block-list__layout.is-root-container"),W=(0,p.useMemo)((()=>V&&("constrained"===V?.type||V?.inherit||V?.contentSize||V?.wideSize)?{...M,...V,type:"constrained"}:{...M,...V,type:"default"}),[V?.type,V?.inherit,V?.contentSize,V?.wideSize,M]),Z=l?W:L,Y="default"!==Z?.type||F?Z:L,q=(0,g.__unstableUseTypingObserver)(),K=(0,p.useRef)();(0,p.useEffect)((()=>{e&&C()&&K?.current?.focus()}),[e,C]);const Q=[R,I,N].includes(w)&&!S&&!i&&!T,X=(0,p.useMemo)((()=>{if(!D.current)return k;const{ownerDocument:e}=D.current,t=e.documentElement.scrollTop||e.body.scrollTop;return k+t}),[k]),J=(0,p.useMemo)((()=>[...t??[],{css:`:where(.block-editor-iframe__body){display:flow-root;${X?`min-height:${X}px;`:""}}.is-root-container{display:flow-root;${Q?"min-height:0!important;":""}}\n\t\t\t\t${Q?".block-editor-iframe__html{background:var(--wp-editor-canvas-background);display:flex;align-items:center;justify-content:center;min-height:100vh;}.block-editor-iframe__body{width:100%;}":""}`}]),[t,Q,X]),ee=(0,g.__unstableUseTypewriter)();return o=(0,m.useMergeRefs)([D,o,"post-only"===a?ee:null,K_({isEnabled:"template-locked"===a}),G_({isEnabled:"template-locked"===a}),$_()]),(0,c.jsx)("div",{className:mr("editor-visual-editor","edit-post-visual-editor",r,{"has-padding":y||Q,"is-resizable":Q,"is-iframed":!s}),children:(0,c.jsx)(U_,{enableResizing:Q,height:"100%",children:(0,c.jsxs)(q_,{shouldIframe:!s,contentRef:o,styles:J,height:"100%",iframeProps:{...n,style:{...n?.style,...A}},children:[E&&!j&&"post-only"===a&&!v&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(W_,{selector:".editor-visual-editor__post-title-wrapper",layout:L}),(0,c.jsx)(W_,{selector:".block-editor-block-list__layout.is-root-container",layout:Y}),U&&(0,c.jsx)(W_,{css:".is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}"}),G&&(0,c.jsx)(W_,{layout:W,css:G})]}),"post-only"===a&&!v&&(0,c.jsx)("div",{className:mr("editor-visual-editor__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":P}),contentEditable:!1,ref:q,style:{marginTop:"4rem"},children:(0,c.jsx)(vh,{ref:K})}),(0,c.jsxs)(g.RecursionProvider,{blockName:_,uniqueId:f,children:[(0,c.jsx)(g.BlockList,{className:mr("is-"+b.toLowerCase()+"-preview","post-only"!==a||v?"wp-site-blocks":`${z} wp-block-post-content`,{"has-global-padding":"post-only"===a&&!v&&P}),layout:Z,dropZoneElement:s?D.current:D.current?.parentNode,__unstableDisableDropZone:"template-locked"===a}),"template-locked"===a&&(0,c.jsx)(O_,{contentRef:D})]})]})})})};const tf={header:(0,fs.__)("Editor top bar"),body:(0,fs.__)("Editor content"),sidebar:(0,fs.__)("Editor settings"),actions:(0,fs.__)("Editor publish"),footer:(0,fs.__)("Editor footer")};function sf({className:e,styles:t,children:s,forceIsDirty:n,contentRef:o,disableIframe:r,autoFocus:i,customSaveButton:a,customSavePanel:l,forceDisableBlockTools:u,title:h,iframeProps:_}){const{mode:f,isInserterOpened:b,isListViewOpened:y,isDistractionFree:x,isPreviewMode:v,showBlockBreadcrumbs:w,documentLabel:S}=(0,d.useSelect)((e=>{const{get:t}=e(C.store),{getEditorSettings:s,getPostTypeLabel:n}=e(vc),o=s(),r=n();let i=e(vc).getEditorMode();return o.richEditingEnabled||"visual"!==i||(i="text"),o.codeEditingEnabled||"text"!==i||(i="visual"),{mode:i,isInserterOpened:e(vc).isInserterOpened(),isListViewOpened:e(vc).isListViewOpened(),isDistractionFree:t("core","distractionFree"),isPreviewMode:o.isPreviewMode,showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),documentLabel:r||(0,fs._x)("Document","noun, breadcrumb")}}),[]),k=(0,m.useViewportMatch)("medium"),P=y?(0,fs.__)("Document Overview"):(0,fs.__)("Block Library"),[j,E]=(0,p.useState)(!1),T=(0,p.useCallback)((e=>{"function"==typeof j&&j(e),E(!1)}),[j]);return(0,c.jsx)(Wa,{isDistractionFree:x,className:mr("editor-editor-interface",e,{"is-entity-save-view-open":!!j,"is-distraction-free":x&&!v}),labels:{...tf,secondarySidebar:P},header:!v&&(0,c.jsx)(E_,{forceIsDirty:n,setEntitiesSavedStatesCallback:E,customSaveButton:a,forceDisableBlockTools:u,title:h}),editorNotices:(0,c.jsx)(ld,{}),secondarySidebar:!v&&"visual"===f&&(b&&(0,c.jsx)(B_,{})||y&&(0,c.jsx)(R_,{})),sidebar:!v&&!x&&(0,c.jsx)(Va.Slot,{scope:"core"}),content:(0,c.jsxs)(c.Fragment,{children:[!x&&!v&&(0,c.jsx)(ld,{}),(0,c.jsx)(Zg.Slot,{children:([e])=>e||(0,c.jsxs)(c.Fragment,{children:[!v&&"text"===f&&(0,c.jsx)(L_,{autoFocus:i}),!v&&!k&&"visual"===f&&(0,c.jsx)(g.BlockToolbar,{hideDragHandle:!0}),(v||"visual"===f)&&(0,c.jsx)(ef,{styles:t,contentRef:o,disableIframe:r,autoFocus:i,iframeProps:_}),s]})})]}),footer:!v&&!x&&k&&w&&"visual"===f&&(0,c.jsx)(g.BlockBreadcrumb,{rootLabelText:S}),actions:v?void 0:l||(0,c.jsx)(M_,{closeEntitiesSavedStates:T,isEntitiesSavedStatesOpen:j,setEntitiesSavedStatesCallback:E,forceIsDirtyPublishPanel:n})})}const{OverridesPanel:nf}=$(ao.privateApis);function of(){return(0,d.useSelect)((e=>"wp_block"===e(vc).getCurrentPostType()),[])?(0,c.jsx)(nf,{}):null}function rf(e){return"string"==typeof e.title?(0,Ln.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,Ln.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,Ln.decodeEntities)(e.title.raw):""}const af=({items:e,closeModal:t})=>{const[s]=e,n=rf(s),{showOnFront:o,currentHomePage:r,isSaving:i}=(0,d.useSelect)((e=>{const{getEntityRecord:t,isSavingEntityRecord:s}=e(u.store),n=t("root","site"),o=t("postType","page",n?.page_on_front);return{showOnFront:n?.show_on_front,currentHomePage:o,isSaving:s("root","site")}})),{saveEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:p}=(0,d.useDispatch)(_s.store);let m="";"posts"===o?m=(0,fs.__)("This will replace the current homepage which is set to display latest posts."):r&&(m=(0,fs.sprintf)((0,fs.__)('This will replace the current homepage: "%s"'),rf(r)));const h=(0,fs.sprintf)((0,fs.__)('Set "%1$s" as the site homepage? %2$s'),n,m).trim(),g=(0,fs.__)("Set homepage");return(0,c.jsx)("form",{onSubmit:async function(e){e.preventDefault();try{await a("root","site",{page_on_front:s.id,show_on_front:"page"}),l((0,fs.__)("Homepage updated."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while setting the homepage.");p(t,{type:"snackbar"})}finally{t?.()}},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:h}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:i,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:i,accessibleWhenDisabled:!0,children:g})]})]})})},lf=({items:e,closeModal:t})=>{const[s]=e,n=rf(s),{currentPostsPage:o,isPageForPostsSet:r,isSaving:i}=(0,d.useSelect)((e=>{const{getEntityRecord:t,isSavingEntityRecord:s}=e(u.store),n=t("root","site");return{currentPostsPage:t("postType","page",n?.page_for_posts),isPageForPostsSet:0!==n?.page_for_posts,isSaving:s("root","site")}})),{saveEntityRecord:a}=(0,d.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:p}=(0,d.useDispatch)(_s.store);const m=r&&o?(0,fs.sprintf)((0,fs.__)('This will replace the current posts page: "%s"'),rf(o)):(0,fs.__)("This page will show the latest posts."),h=(0,fs.sprintf)((0,fs.__)('Set "%1$s" as the posts page? %2$s'),n,m),g=(0,fs.__)("Set posts page");return(0,c.jsx)("form",{onSubmit:async function(e){e.preventDefault();try{await a("root","site",{page_for_posts:s.id,show_on_front:"page"}),l((0,fs.__)("Posts page updated."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,fs.__)("An error occurred while setting the posts page.");p(t,{type:"snackbar"})}finally{t?.()}},children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"5",children:[(0,c.jsx)(Hn.__experimentalText,{children:h}),(0,c.jsxs)(Hn.__experimentalHStack,{justify:"right",children:[(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:i,accessibleWhenDisabled:!0,children:(0,fs.__)("Cancel")}),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:i,accessibleWhenDisabled:!0,children:g})]})]})})};function cf({postType:e,onActionPerformed:t,context:s}){const{defaultActions:n}=(0,d.useSelect)((t=>{const{getEntityActions:s}=$(t(vc));return{defaultActions:s("postType",e)}}),[e]),o=(0,d.useSelect)((t=>{if("page"!==e)return!1;const{getDefaultTemplateId:s,getEntityRecord:n,canUser:o}=t(u.store);if(!o("update",{kind:"root",name:"site"}))return!1;const r=s({slug:"front-page"});if(!r)return!0;const i=n("postType","wp_template",r);return!i||"front-page"!==i.slug}),[e]),r=(()=>{const{pageOnFront:e,pageForPosts:t}=(0,d.useSelect)((e=>{const{getEntityRecord:t,canUser:s}=e(u.store),n=s("read",{kind:"root",name:"site"})?t("root","site"):void 0;return{pageOnFront:n?.page_on_front,pageForPosts:n?.page_for_posts}}));return(0,p.useMemo)((()=>({id:"set-as-homepage",label:(0,fs.__)("Set as homepage"),isEligible:s=>"publish"===s.status&&"page"===s.type&&e!==s.id&&t!==s.id,modalFocusOnMount:"firstContentElement",RenderModal:af})),[t,e])})(),i=(()=>{const{pageOnFront:e,pageForPosts:t}=(0,d.useSelect)((e=>{const{getEntityRecord:t,canUser:s}=e(u.store),n=s("read",{kind:"root",name:"site"})?t("root","site"):void 0;return{pageOnFront:n?.page_on_front,pageForPosts:n?.page_for_posts}}));return(0,p.useMemo)((()=>({id:"set-as-posts-page",label:(0,fs.__)("Set as posts page"),isEligible:s=>"publish"===s.status&&"page"===s.type&&e!==s.id&&t!==s.id,modalFocusOnMount:"firstContentElement",RenderModal:lf})),[t,e])})(),{registerPostTypeSchema:a}=$((0,d.useDispatch)(vc));return(0,p.useEffect)((()=>{a(e)}),[a,e]),(0,p.useMemo)((()=>{let e=[...n];if(o&&e.push(r,i),e=e.sort(((e,t)=>"move-to-trash"===t.id?-1:0)),e=e.filter((e=>!e.context||e.context===s)),t)for(let s=0;s<e.length;++s){if(e[s].callback){const n=e[s].callback;e[s]={...e[s],callback:(o,r)=>{n(o,{...r,onActionPerformed:n=>{r?.onActionPerformed&&r.onActionPerformed(n),t(e[s].id,n)}})}}}if(e[s].RenderModal){const n=e[s].RenderModal;e[s]={...e[s],RenderModal:o=>(0,c.jsx)(n,{...o,onActionPerformed:n=>{o.onActionPerformed&&o.onActionPerformed(n),t(e[s].id,n)}})}}}return e}),[s,n,t,r,i,o])}const{Menu:df,kebabCase:uf}=$(Hn.privateApis);function pf({postType:e,postId:t,onActionPerformed:s}){const[n,o]=(0,p.useState)(null),{item:r,permissions:i}=(0,d.useSelect)((s=>{const{getEditedEntityRecord:n,getEntityRecordPermissions:o}=$(s(u.store));return{item:n("postType",e,t),permissions:o("postType",e,t)}}),[t,e]),a=(0,p.useMemo)((()=>({...r,permissions:i})),[r,i]),l=cf({postType:e,onActionPerformed:s}),m=(0,p.useMemo)((()=>l.filter((e=>!e.isEligible||e.isEligible(a)))),[l,a]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(df,{placement:"bottom-end",children:[(0,c.jsx)(df.TriggerButton,{render:(0,c.jsx)(Hn.Button,{size:"small",icon:r_,label:(0,fs.__)("Actions"),disabled:!m.length,accessibleWhenDisabled:!0,className:"editor-all-actions-button"})}),(0,c.jsx)(df.Popover,{children:(0,c.jsx)(gf,{actions:m,items:[a],setActiveModalAction:o})})]}),!!n&&(0,c.jsx)(hf,{action:n,items:[a],closeModal:()=>o(null)})]})}function mf({action:e,onClick:t,items:s}){const n="string"==typeof e.label?e.label:e.label(s);return(0,c.jsx)(df.Item,{onClick:t,children:(0,c.jsx)(df.ItemLabel,{children:n})})}function hf({action:e,items:t,closeModal:s}){const n="string"==typeof e.label?e.label:e.label(t);return(0,c.jsx)(Hn.Modal,{title:e.modalHeader||n,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:s??(()=>{}),focusOnMount:"firstContentElement",size:"medium",overlayClassName:`editor-action-modal editor-action-modal__${uf(e.id)}`,children:(0,c.jsx)(e.RenderModal,{items:t,closeModal:s})})}function gf({actions:e,items:t,setActiveModalAction:s}){const n=(0,d.useRegistry)();return(0,c.jsx)(df.Group,{children:e.map((e=>(0,c.jsx)(mf,{action:e,onClick:()=>{"RenderModal"in e?s(e):e.callback(t,{registry:n})},items:t},e.id)))})}const{Badge:_f}=$(Hn.privateApis);function ff({postType:e,postId:t,onActionPerformed:s}){const n=(0,p.useMemo)((()=>Array.isArray(t)?t:[t]),[t]),{postTitle:o,icon:r,labels:i}=(0,d.useSelect)((t=>{const{getEditedEntityRecord:s,getCurrentTheme:o,getPostType:r}=t(u.store),{getPostIcon:i}=$(t(vc));let a="";const l=s("postType",e,n[0]);if(1===n.length){const{default_template_types:t=[]}=o()??{},s=[B,I].includes(e)?Y({template:l,templateTypes:t}):{};a=s?.title||l?.title}return{postTitle:a,icon:i(e,{area:l?.area}),labels:r(e)?.labels}}),[n,e]),a=Hc(t);let l=(0,fs.__)("No title");return i?.name&&n.length>1?l=(0,fs.sprintf)((0,fs.__)("%1$d %2$s"),n.length,i?.name):o&&(l=(0,Uc.__unstableStripHTML)(o)),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:1,className:"editor-post-card-panel",children:[(0,c.jsxs)(Hn.__experimentalHStack,{spacing:2,className:"editor-post-card-panel__header",align:"flex-start",children:[(0,c.jsx)(Hn.Icon,{className:"editor-post-card-panel__icon",icon:r}),(0,c.jsxs)(Hn.__experimentalText,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",as:"h2",children:[(0,c.jsx)("span",{className:"editor-post-card-panel__title-name",children:l}),a&&1===n.length&&(0,c.jsx)(_f,{children:a})]}),1===n.length&&(0,c.jsx)(pf,{postType:e,postId:n[0],onActionPerformed:s})]}),n.length>1&&(0,c.jsx)(Hn.__experimentalText,{className:"editor-post-card-panel__description",children:(0,fs.sprintf)((0,fs.__)("Changes will be applied to all selected %s."),i?.name.toLowerCase())})]})}function bf(){const{postContent:e}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s,getCurrentPostId:n}=e(vc),{canUser:o}=e(u.store),{getEntityRecord:r}=e(u.store),i=o("read",{kind:"root",name:"site"})?r("root","site"):void 0,a=s();return{postContent:!(+n()===i?.page_for_posts)&&![B,I].includes(a)&&t("content")}}),[]),t=(0,fs._x)("words","Word count type. Do not translate!"),s=(0,p.useMemo)((()=>e?(0,Dh.count)(e,t):0),[e,t]);if(!s)return null;const n=Math.round(s/189),o=(0,fs.sprintf)((0,fs._n)("%s word","%s words",s),s.toLocaleString()),r=n<=1?(0,fs.__)("1 minute"):(0,fs.sprintf)((0,fs._n)("%s minute","%s minutes",n),n.toLocaleString());return(0,c.jsx)("div",{className:"editor-post-content-information",children:(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.sprintf)((0,fs.__)("%1$s, %2$s read time."),o,r)})})}var yf=function(){const{postFormat:e}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t}=e(vc);return{postFormat:t("format")??"standard"}}),[]),t=Pp.find((t=>t.id===e)),[s,n]=(0,p.useState)(null),o=(0,p.useMemo)((()=>({anchor:s,placement:"left-start",offset:36,shift:!0})),[s]);return(0,c.jsx)(Cp,{children:(0,c.jsx)(Rd,{label:(0,fs.__)("Format"),ref:n,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:o,contentClassName:"editor-post-format__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change format: %s"),t?.caption),onClick:s,children:t?.caption}),renderContent:({onClose:e})=>(0,c.jsxs)("div",{className:"editor-post-format__dialog-content",children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Format"),onClose:e}),(0,c.jsx)(jp,{})]})})})})};function xf(){const e=(0,d.useSelect)((e=>e(vc).getEditedPostAttribute("modified")),[]),t=e&&(0,fs.sprintf)((0,fs.__)("Last edited %s."),(0,v.humanTimeDiff)(e));return t?(0,c.jsx)("div",{className:"editor-post-last-edited-panel",children:(0,c.jsx)(Hn.__experimentalText,{children:t})}):null}var vf=function({className:e,children:t}){return(0,c.jsx)(Hn.__experimentalVStack,{className:mr("editor-post-panel__section",e),children:t})};const wf={};function Sf(){const{editEntityRecord:e}=(0,d.useDispatch)(u.store),{postsPageTitle:t,postsPageId:s,isTemplate:n,postSlug:o}=(0,d.useSelect)((e=>{const{getEntityRecord:t,getEditedEntityRecord:s,canUser:n}=e(u.store),o=n("read",{kind:"root",name:"site"})?t("root","site"):void 0,r=o?.page_for_posts?s("postType","page",o?.page_for_posts):wf,{getEditedPostAttribute:i,getCurrentPostType:a}=e(vc);return{postsPageId:r?.id,postsPageTitle:r?.title,isTemplate:a()===B,postSlug:i("slug")}}),[]),[r,i]=(0,p.useState)(null),a=(0,p.useMemo)((()=>({anchor:r,placement:"left-start",offset:36,shift:!0})),[r]);if(!n||!["home","index"].includes(o)||!s)return null;const l=t=>{e("postType","page",s,{title:t})},h=(0,Ln.decodeEntities)(t);return(0,c.jsx)(Rd,{label:(0,fs.__)("Blog title"),ref:i,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:a,contentClassName:"editor-blog-title-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.sprintf)((0,fs.__)("Change blog title: %s"),h),onClick:t,children:h}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Blog title"),onClose:e}),(0,c.jsx)(Hn.__experimentalInputControl,{placeholder:(0,fs.__)("No title"),size:"__unstable-large",value:t,onChange:(0,m.debounce)(l,300),label:(0,fs.__)("Blog title"),help:(0,fs.__)("Set the Posts Page title. Appears in search results, and when the page is shared on social media."),hideLabelFromVision:!0})]})})})}function kf(){const{editEntityRecord:e}=(0,d.useDispatch)(u.store),{postsPerPage:t,isTemplate:s,postSlug:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(vc),{getEditedEntityRecord:n,canUser:o}=e(u.store),r=o("read",{kind:"root",name:"site"})?n("root","site"):void 0;return{isTemplate:s()===B,postSlug:t("slug"),postsPerPage:r?.posts_per_page||1}}),[]),[o,r]=(0,p.useState)(null),i=(0,p.useMemo)((()=>({anchor:o,placement:"left-start",offset:36,shift:!0})),[o]);if(!s||!["home","index"].includes(n))return null;const a=t=>{e("root","site",void 0,{posts_per_page:t})};return(0,c.jsx)(Rd,{label:(0,fs.__)("Posts per page"),ref:r,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:i,contentClassName:"editor-posts-per-page-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Change posts per page"),onClick:s,children:t}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Posts per page"),onClose:e}),(0,c.jsx)(Hn.__experimentalNumberControl,{placeholder:0,value:t,size:"__unstable-large",spinControls:"custom",step:"1",min:"1",onChange:a,label:(0,fs.__)("Posts per page"),help:(0,fs.__)("Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."),hideLabelFromVision:!0})]})})})}const Cf=[{label:(0,fs._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,fs.__)("Visitors can add new comments and replies.")},{label:(0,fs.__)("Closed"),value:"",description:[(0,fs.__)("Visitors cannot add new comments or replies."),(0,fs.__)("Existing comments remain visible.")].join(" ")}];function Pf(){const{editEntityRecord:e}=(0,d.useDispatch)(u.store),{allowCommentsOnNewPosts:t,isTemplate:s,postSlug:n}=(0,d.useSelect)((e=>{const{getEditedPostAttribute:t,getCurrentPostType:s}=e(vc),{getEditedEntityRecord:n,canUser:o}=e(u.store),r=o("read",{kind:"root",name:"site"})?n("root","site"):void 0;return{isTemplate:s()===B,postSlug:t("slug"),allowCommentsOnNewPosts:r?.default_comment_status||""}}),[]),[o,r]=(0,p.useState)(null),i=(0,p.useMemo)((()=>({anchor:o,placement:"left-start",offset:36,shift:!0})),[o]);if(!s||!["home","index"].includes(n))return null;const a=t=>{e("root","site",void 0,{default_comment_status:t?"open":null})};return(0,c.jsx)(Rd,{label:(0,fs.__)("Discussion"),ref:r,children:(0,c.jsx)(Hn.Dropdown,{popoverProps:i,contentClassName:"editor-site-discussion-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:s})=>(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,fs.__)("Change discussion settings"),onClick:s,children:t?(0,fs.__)("Comments open"):(0,fs.__)("Comments closed")}),renderContent:({onClose:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.__experimentalInspectorPopoverHeader,{title:(0,fs.__)("Discussion"),onClose:e}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:3,children:[(0,c.jsx)(Hn.__experimentalText,{children:(0,fs.__)("Changes will apply to new posts only. Individual posts may override these settings.")}),(0,c.jsx)(Hn.RadioControl,{className:"editor-site-discussion__options",hideLabelFromVision:!0,label:(0,fs.__)("Comment status"),options:Cf,onChange:a,selected:t})]})]})})})}function jf({onActionPerformed:e}){const{isRemovedPostStatusPanel:t,postType:s,postId:n}=(0,d.useSelect)((e=>{const{isEditorPanelRemoved:t,getCurrentPostType:s,getCurrentPostId:n}=e(vc);return{isRemovedPostStatusPanel:t("post-status"),postType:s(),postId:n()}}),[]);return(0,c.jsx)(vf,{className:"editor-post-summary",children:(0,c.jsx)(Cu.Slot,{children:o=>(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsx)(ff,{postType:s,postId:n,onActionPerformed:e}),(0,c.jsx)(kp,{withPanelBody:!1}),(0,c.jsx)(pp,{}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:1,children:[(0,c.jsx)(bf,{}),(0,c.jsx)(xf,{})]}),!t&&(0,c.jsxs)(Hn.__experimentalVStack,{spacing:4,children:[(0,c.jsxs)(Hn.__experimentalVStack,{spacing:1,children:[(0,c.jsx)(sh,{}),(0,c.jsx)(ih,{}),(0,c.jsx)(Th,{}),(0,c.jsx)(qu,{}),(0,c.jsx)(Vu,{}),(0,c.jsx)(sp,{}),(0,c.jsx)(Bp,{}),(0,c.jsx)(Wd,{}),(0,c.jsx)(lh,{}),(0,c.jsx)(Sf,{}),(0,c.jsx)(kf,{}),(0,c.jsx)(Pf,{}),(0,c.jsx)(yf,{}),o]}),(0,c.jsx)(kh,{onActionPerformed:e})]})]})})})})}const{EXCLUDED_PATTERN_SOURCES:Ef,PATTERN_TYPES:Tf}=$(ao.privateApis);function Bf(e,t){return e.innerBlocks=e.innerBlocks.map((e=>Bf(e,t))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=t),e}function If(e,t){return e.filter(((e,s,n)=>((e,t,s)=>t===s.findIndex((t=>e.name===t.name)))(e,s,n)&&(e=>!Ef.includes(e.source))(e)&&(e=>e.templateTypes?.includes(t.slug)||e.blockTypes?.includes("core/template-part/"+t.area))(e)))}function Nf(e,t){return e.map((e=>({...e,keywords:e.keywords||[],type:Tf.theme,blocks:(0,x.parse)(e.content,{__unstableSkipMigrationLogs:!0}).map((e=>Bf(e,t)))})))}function Rf({availableTemplates:e,onSelect:t}){return e&&0!==e?.length?(0,c.jsx)(g.__experimentalBlockPatternsList,{label:(0,fs.__)("Templates"),blockPatterns:e,onClickPattern:t,showTitlesAsTooltip:!0}):null}function Df(){const{area:e,name:t,slug:s,postType:n,postId:o}=(0,d.useSelect)((e=>{const{getCurrentPostType:t,getCurrentPostId:s}=e(vc),{getEditedEntityRecord:n}=e(u.store),o=t(),r=s(),i=n("postType",o,r);return{area:i?.area,name:i?.name,slug:i?.slug,postType:o,postId:r}}),[]),{editEntityRecord:r}=(0,d.useDispatch)(u.store),i=function({area:e,name:t,slug:s}){const{blockPatterns:n,restBlockPatterns:o,currentThemeStylesheet:r}=(0,d.useSelect)((e=>{const{getEditorSettings:t}=e(vc),s=t();return{blockPatterns:s.__experimentalAdditionalBlockPatterns??s.__experimentalBlockPatterns,restBlockPatterns:e(u.store).getBlockPatterns(),currentThemeStylesheet:e(u.store).getCurrentTheme().stylesheet}}),[]);return(0,p.useMemo)((()=>Nf(If([...n||[],...o||[]],{area:e,name:t,slug:s}),r)),[e,t,s,n,o,r])}({area:e,name:t,slug:s});return i?.length?(0,c.jsx)(Hn.PanelBody,{title:(0,fs.__)("Design"),initialOpen:n===I,children:(0,c.jsx)(Rf,{availableTemplates:i,onSelect:async e=>{await r("postType",n,o,{blocks:e.blocks,content:(0,x.serialize)(e.blocks)})}})}):null}function Af(){const{postType:e}=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(vc);return{postType:t()}}),[]);return[I,B].includes(e)?(0,c.jsx)(Df,{}):null}const Mf={document:"edit-post/document",block:"edit-post/block"},{Tabs:Lf}=$(Hn.privateApis);var Of=(0,p.forwardRef)(((e,t)=>{const{documentLabel:s}=(0,d.useSelect)((e=>{const{getPostTypeLabel:t}=e(vc);return{documentLabel:t()||(0,fs._x)("Document","noun, panel")}}),[]);return(0,c.jsxs)(Lf.TabList,{ref:t,children:[(0,c.jsx)(Lf.Tab,{tabId:Mf.document,"data-tab-id":Mf.document,children:s}),(0,c.jsx)(Lf.Tab,{tabId:Mf.block,"data-tab-id":Mf.block,children:(0,fs.__)("Block")})]})}));const{BlockQuickNavigation:Ff}=$(g.privateApis),Vf=["core/post-title","core/post-featured-image","core/post-content"];function Uf(){const e=(0,p.useMemo)((()=>(0,h.applyFilters)("editor.postContentBlockTypes",Vf)),[]),{clientIds:t,postType:s,renderingMode:n}=(0,d.useSelect)((t=>{const{getCurrentPostType:s,getPostBlocksByName:n,getRenderingMode:o}=$(t(vc)),r=s();return{postType:r,clientIds:n(B===r?"core/template-part":e),renderingMode:o()}}),[e]),{enableComplementaryArea:o}=(0,d.useDispatch)(ja);return"post-only"===n&&s!==B||0===t.length?null:(0,c.jsx)(Hn.PanelBody,{title:(0,fs.__)("Content"),children:(0,c.jsx)(Ff,{clientIds:t,onSelect:()=>{o("core","edit-post/document")}})})}const{BlockQuickNavigation:Hf}=$(g.privateApis);function zf(){const e=(0,d.useSelect)((e=>{const{getBlockTypes:t}=e(x.store);return t()}),[]),t=(0,p.useMemo)((()=>e.filter((e=>"theme"===e.category)).map((({name:e})=>e))),[e]),s=(0,d.useSelect)((e=>{const{getBlocksByName:s}=e(g.store);return s(t)}),[t]);return 0===s.length?null:(0,c.jsx)(Hn.PanelBody,{title:(0,fs.__)("Content"),children:(0,c.jsx)(Hf,{clientIds:s})})}function Gf(){const e=(0,d.useSelect)((e=>{const{getCurrentPostType:t}=e(vc);return t()}),[]);return e!==I?null:(0,c.jsx)(zf,{})}var $f=function(){const{hasBlockSelection:e}=(0,d.useSelect)((e=>({hasBlockSelection:!!e(g.store).getBlockSelectionStart()})),[]),{getActiveComplementaryArea:t}=(0,d.useSelect)(ja),{enableComplementaryArea:s}=(0,d.useDispatch)(ja),{get:n}=(0,d.useSelect)(C.store);(0,p.useEffect)((()=>{const o=t("core"),r=["edit-post/document","edit-post/block"].includes(o),i=n("core","distractionFree");r&&!i&&s("core",e?"edit-post/block":"edit-post/document")}),[e,t,s,n])};const{Tabs:Wf}=$(Hn.privateApis),Zf=p.Platform.select({web:!0,native:!1}),Yf=({tabName:e,keyboardShortcut:t,onActionPerformed:s,extraPanels:n})=>{const o=(0,p.useRef)(null),r=(0,p.useContext)(Wf.Context);return(0,p.useEffect)((()=>{const t=Array.from(o.current?.querySelectorAll('[role="tab"]')||[]),s=t.find((t=>t.getAttribute("data-tab-id")===e)),n=s?.ownerDocument.activeElement;t.some((e=>n&&n.id===e.id))&&s&&s.id!==n?.id&&s?.focus()}),[e]),(0,c.jsx)(Iu,{identifier:e,header:(0,c.jsx)(Wf.Context.Provider,{value:r,children:(0,c.jsx)(Of,{ref:o})}),closeLabel:(0,fs.__)("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:(0,fs._x)("Settings","panel button label"),toggleShortcut:t,icon:(0,fs.isRTL)()?Yi:qi,isActiveByDefault:Zf,children:(0,c.jsxs)(Wf.Context.Provider,{value:r,children:[(0,c.jsxs)(Wf.TabPanel,{tabId:Mf.document,focusable:!1,children:[(0,c.jsx)(jf,{onActionPerformed:s}),(0,c.jsx)(gu.Slot,{}),(0,c.jsx)(Uf,{}),(0,c.jsx)(Gf,{}),(0,c.jsx)(Af,{}),(0,c.jsx)(mh,{}),(0,c.jsx)(of,{}),n]}),(0,c.jsx)(Wf.TabPanel,{tabId:Mf.block,focusable:!1,children:(0,c.jsx)(g.BlockInspector,{})})]})})};var qf=({extraPanels:e,onActionPerformed:t})=>{$f();const{tabName:s,keyboardShortcut:n,showSummary:o}=(0,d.useSelect)((e=>{const t=e(il.store).getShortcutRepresentation("core/editor/toggle-sidebar"),s=e(ja).getActiveComplementaryArea("core");let n=s;return[Mf.block,Mf.document].includes(s)||(n=e(g.store).getBlockSelectionStart()?Mf.block:Mf.document),{tabName:n,keyboardShortcut:t,showSummary:![B,I,R].includes(e(vc).getCurrentPostType())}}),[]),{enableComplementaryArea:r}=(0,d.useDispatch)(ja),i=(0,p.useCallback)((e=>{e&&r("core",e)}),[r]);return(0,c.jsx)(Wf,{selectedTabId:s,onSelect:i,selectOnMove:!1,children:(0,c.jsx)(Yf,{tabName:s,keyboardShortcut:n,showSummary:o,onActionPerformed:t,extraPanels:e})})},Kf=(0,c.jsx)(L.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(L.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"})});const Qf="edit-post/collab-history-sidebar",Xf="edit-post/collab-sidebar",Jf=[Qf,Xf];function eb(){}const tb=["#3858E9","#9fB1FF","#1D35B4","#1A1919","#E26F56","#33F078","#FFF972","#7A00DF"];function sb(e){return tb[e%tb.length]}function nb(e,t,s){if(!t)return;const n=e?`[role=treeitem][id="comment-thread-${e}"]`:"[role=treeitem]:not([id])",o=s?`${n} ${s}`:n;return new Promise((e=>{if(t.querySelector(o))return e(t.querySelector(o));let s=null;const n=new window.MutationObserver((()=>{t.querySelector(o)&&(clearTimeout(s),n.disconnect(),e(t.querySelector(o)))}));n.observe(t,{childList:!0,subtree:!0}),s=setTimeout((()=>{n.disconnect(),e(null)}),3e3)})).then((e=>e?.focus()))}var ob=function({avatar:e,name:t,date:s,userId:n}){const o=!!e,r=(0,v.getSettings)(),{currentUserAvatar:i,currentUserName:a,currentUserId:l,dateFormat:p=r.formats.date}=(0,d.useSelect)((e=>{const{canUser:t,getCurrentUser:s,getEntityRecord:n}=e(u.store),r=t("read",{kind:"root",name:"site"})?n("root","site"):void 0;if(o)return{dateFormat:r?.date_format};const{getSettings:i}=e(g.store),{__experimentalDiscussionSettings:a}=i(),l=a?.avatarURL,c=s();return{currentUserAvatar:c?.avatar_urls?.[48]??l,currentUserName:c?.name,currentUserId:c?.id,dateFormat:r?.date_format}}),[o]),m=(0,v.getDate)(s),h=(0,v.dateI18n)("c",m),_=Math.floor((new Date-m)/864e5)<30?(0,v.humanTimeDiff)(m):(0,v.dateI18n)(p,m),f=(0,v.dateI18n)((0,fs._x)("F j, Y g:i a","Note date full date format"),s);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("img",{src:e||i,className:"editor-collab-sidebar-panel__user-avatar",alt:(0,fs.__)("User avatar"),width:32,height:32,style:{borderColor:sb(n??l)}}),(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"0",children:[(0,c.jsx)("span",{className:"editor-collab-sidebar-panel__user-name",children:t??a}),s&&(0,c.jsx)(Hn.Tooltip,{text:f,children:(0,c.jsx)("time",{dateTime:h,className:"editor-collab-sidebar-panel__user-time",children:_})})]})]})};var rb=function e({onSubmit:t,onCancel:s,thread:n,submitButtonText:o,labelText:r,reflowComments:i=eb}){const[a,l]=(0,p.useState)(n?.content?.raw??""),d=(0,m.useDebounce)(i,100),u=(0,m.useInstanceId)(e,"comment-input"),h=a===n?.content?.raw||!(g=a,g.trim()).length;var g;return(0,c.jsxs)(Hn.__experimentalVStack,{className:"editor-collab-sidebar-panel__comment-form",spacing:"4",as:"form",onSubmit:e=>{e.preventDefault(),t(a),l("")},children:[(0,c.jsx)(Hn.VisuallyHidden,{as:"label",htmlFor:u,children:r??(0,fs.__)("Note")}),(0,c.jsx)(hh.A,{id:u,value:a??"",onChange:e=>{var t;t=e.target.value,l(t),d()},rows:1,maxRows:20,onKeyDown:e=>{ll.isKeyboardEvent.primary(e,"Enter")&&!h&&e.target.parentNode.requestSubmit()}}),(0,c.jsxs)(Hn.__experimentalHStack,{spacing:"2",justify:"flex-end",wrap:!0,children:[(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary",onClick:s,children:(0,c.jsx)(Hn.__experimentalTruncate,{children:(0,fs.__)("Cancel")})}),(0,c.jsx)(Hn.Button,{size:"compact",accessibleWhenDisabled:!0,variant:"primary",type:"submit",disabled:h,children:(0,c.jsx)(Hn.__experimentalTruncate,{children:o})})]})]})};Math.min,Math.max,Math.round,Math.floor;function ib(e){return e.split("-")[0]}function ab(e){return e.split("-")[1]}function lb(e){return"y"===e?"height":"width"}function cb(e){return["top","bottom"].includes(ib(e))?"y":"x"}function db(e){return"x"===cb(e)?"y":"x"}function ub(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function pb(e,t,s){let{reference:n,floating:o}=e;const r=cb(t),i=db(t),a=lb(i),l=ib(t),c="y"===r,d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,p=n[a]/2-o[a]/2;let m;switch(l){case"top":m={x:d,y:n.y-o.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:u};break;case"left":m={x:n.x-o.width,y:u};break;default:m={x:n.x,y:n.y}}switch(ab(t)){case"start":m[i]-=p*(s&&c?-1:1);break;case"end":m[i]+=p*(s&&c?-1:1)}return m}const mb=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:s,y:n}=t,o=await async function(e,t){const{placement:s,platform:n,elements:o}=e,r=await(null==n.isRTL?void 0:n.isRTL(o.floating)),i=ib(s),a=ab(s),l="y"===cb(s),c=["left","top"].includes(i)?-1:1,d=r&&l?-1:1,u=(m=e,"function"==typeof(p=t)?p(m):p);var p,m;let{mainAxis:h,crossAxis:g,alignmentAxis:_}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&"number"==typeof _&&(g="end"===a?-1*_:_),l?{x:g*d,y:h*c}:{x:h*c,y:g*d}}(t,e);return{x:s+o.x,y:n+o.y,data:o}}}},hb=Math.min,gb=Math.max,_b=Math.round,fb=Math.floor,bb=e=>({x:e,y:e});function yb(){return"undefined"!=typeof window}function xb(e){return Sb(e)?(e.nodeName||"").toLowerCase():"#document"}function vb(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function wb(e){var t;return null==(t=(Sb(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Sb(e){return!!yb()&&(e instanceof Node||e instanceof vb(e).Node)}function kb(e){return!!yb()&&(e instanceof Element||e instanceof vb(e).Element)}function Cb(e){return!!yb()&&(e instanceof HTMLElement||e instanceof vb(e).HTMLElement)}function Pb(e){return!(!yb()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof vb(e).ShadowRoot)}function jb(e){const{overflow:t,overflowX:s,overflowY:n,display:o}=Rb(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+s)&&!["inline","contents"].includes(o)}function Eb(e){return["table","td","th"].includes(xb(e))}function Tb(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Bb(e){const t=Ib(),s=kb(e)?Rb(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!s[e]&&"none"!==s[e]))||!!s.containerType&&"normal"!==s.containerType||!t&&!!s.backdropFilter&&"none"!==s.backdropFilter||!t&&!!s.filter&&"none"!==s.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(s.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(s.contain||"").includes(e)))}function Ib(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Nb(e){return["html","body","#document"].includes(xb(e))}function Rb(e){return vb(e).getComputedStyle(e)}function Db(e){return kb(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ab(e){if("html"===xb(e))return e;const t=e.assignedSlot||e.parentNode||Pb(e)&&e.host||wb(e);return Pb(t)?t.host:t}function Mb(e){const t=Ab(e);return Nb(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cb(t)&&jb(t)?t:Mb(t)}function Lb(e,t,s){var n;void 0===t&&(t=[]),void 0===s&&(s=!0);const o=Mb(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=vb(o);if(r){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}(i);return t.concat(i,i.visualViewport||[],jb(o)?o:[],e&&s?Lb(e):[])}return t.concat(o,Lb(o,[],s))}function Ob(e){const t=Rb(e);let s=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Cb(e),r=o?e.offsetWidth:s,i=o?e.offsetHeight:n,a=_b(s)!==r||_b(n)!==i;return a&&(s=r,n=i),{width:s,height:n,$:a}}function Fb(e){return kb(e)?e:e.contextElement}function Vb(e){const t=Fb(e);if(!Cb(t))return bb(1);const s=t.getBoundingClientRect(),{width:n,height:o,$:r}=Ob(t);let i=(r?_b(s.width):s.width)/n,a=(r?_b(s.height):s.height)/o;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const Ub=bb(0);function Hb(e){const t=vb(e);return Ib()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ub}function zb(e,t,s,n){void 0===t&&(t=!1),void 0===s&&(s=!1);const o=e.getBoundingClientRect(),r=Fb(e);let i=bb(1);t&&(n?kb(n)&&(i=Vb(n)):i=Vb(e));const a=function(e,t,s){return void 0===t&&(t=!1),!(!s||t&&s!==vb(e))&&t}(r,s,n)?Hb(r):bb(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(r){const e=vb(r),t=n&&kb(n)?vb(n):n;let s=e,o=s.frameElement;for(;o&&n&&t!==s;){const e=Vb(o),t=o.getBoundingClientRect(),n=Rb(o),r=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=r,c+=i,s=vb(o),o=s.frameElement}}return ub({width:d,height:u,x:l,y:c})}const Gb=[":popover-open",":modal"];function $b(e){return Gb.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Wb(e){return zb(wb(e)).left+Db(e).scrollLeft}function Zb(e,t,s){let n;if("viewport"===t)n=function(e,t){const s=vb(e),n=wb(e),o=s.visualViewport;let r=n.clientWidth,i=n.clientHeight,a=0,l=0;if(o){r=o.width,i=o.height;const e=Ib();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:i,x:a,y:l}}(e,s);else if("document"===t)n=function(e){const t=wb(e),s=Db(e),n=e.ownerDocument.body,o=gb(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=gb(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-s.scrollLeft+Wb(e);const a=-s.scrollTop;return"rtl"===Rb(n).direction&&(i+=gb(t.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:a}}(wb(e));else if(kb(t))n=function(e,t){const s=zb(e,!0,"fixed"===t),n=s.top+e.clientTop,o=s.left+e.clientLeft,r=Cb(e)?Vb(e):bb(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:o*r.x,y:n*r.y}}(t,s);else{const s=Hb(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return ub(n)}function Yb(e,t){const s=Ab(e);return!(s===t||!kb(s)||Nb(s))&&("fixed"===Rb(s).position||Yb(s,t))}function qb(e,t,s){const n=Cb(t),o=wb(t),r="fixed"===s,i=zb(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=bb(0);if(n||!n&&!r)if(("body"!==xb(t)||jb(o))&&(a=Db(t)),n){const e=zb(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Wb(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function Kb(e,t){return Cb(e)&&"fixed"!==Rb(e).position?t?t(e):e.offsetParent:null}function Qb(e,t){const s=vb(e);if(!Cb(e)||$b(e))return s;let n=Kb(e,t);for(;n&&Eb(n)&&"static"===Rb(n).position;)n=Kb(n,t);return n&&("html"===xb(n)||"body"===xb(n)&&"static"===Rb(n).position&&!Bb(n))?s:n||function(e){let t=Ab(e);for(;Cb(t)&&!Nb(t);){if(Bb(t))return t;if(Tb(t))return null;t=Ab(t)}return null}(e)||s}const Xb={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:s,offsetParent:n,strategy:o}=e;const r="fixed"===o,i=wb(n),a=!!t&&$b(t.floating);if(n===i||a&&r)return s;let l={scrollLeft:0,scrollTop:0},c=bb(1);const d=bb(0),u=Cb(n);if((u||!u&&!r)&&(("body"!==xb(n)||jb(i))&&(l=Db(n)),Cb(n))){const e=zb(n);c=Vb(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}return{width:s.width*c.x,height:s.height*c.y,x:s.x*c.x-l.scrollLeft*c.x+d.x,y:s.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:wb,getClippingRect:function(e){let{element:t,boundary:s,rootBoundary:n,strategy:o}=e;const r=[..."clippingAncestors"===s?function(e,t){const s=t.get(e);if(s)return s;let n=Lb(e,[],!1).filter((e=>kb(e)&&"body"!==xb(e))),o=null;const r="fixed"===Rb(e).position;let i=r?Ab(e):e;for(;kb(i)&&!Nb(i);){const t=Rb(i),s=Bb(i);s||"fixed"!==t.position||(o=null),(r?!s&&!o:!s&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||jb(i)&&!s&&Yb(e,i))?n=n.filter((e=>e!==i)):o=t,i=Ab(i)}return t.set(e,n),n}(t,this._c):[].concat(s),n],i=r[0],a=r.reduce(((e,s)=>{const n=Zb(t,s,o);return e.top=gb(n.top,e.top),e.right=hb(n.right,e.right),e.bottom=hb(n.bottom,e.bottom),e.left=gb(n.left,e.left),e}),Zb(t,i,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Qb,getElementRects:async function(e){const t=this.getOffsetParent||Qb,s=this.getDimensions;return{reference:qb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await s(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:s}=Ob(e);return{width:t,height:s}},getScale:Vb,isElement:kb,isRTL:function(e){return"rtl"===Rb(e).direction}};function Jb(e,t,s,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=Fb(e),d=o||r?[...c?Lb(c):[],...Lb(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",s,{passive:!0}),r&&e.addEventListener("resize",s)}));const u=c&&a?function(e,t){let s,n=null;const o=wb(e);function r(){var e;clearTimeout(s),null==(e=n)||e.disconnect(),n=null}return function i(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),r();const{left:c,top:d,width:u,height:p}=e.getBoundingClientRect();if(a||t(),!u||!p)return;const m={rootMargin:-fb(d)+"px "+-fb(o.clientWidth-(c+u))+"px "+-fb(o.clientHeight-(d+p))+"px "+-fb(c)+"px",threshold:gb(0,hb(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return i();t?i(!1,t):s=setTimeout((()=>{i(!1,1e-7)}),100)}h=!1}try{n=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(g,m)}n.observe(e)}(!0),r}(c,s):null;let p,m=-1,h=null;i&&(h=new ResizeObserver((e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),s()})),c&&!l&&h.observe(c),h.observe(t));let g=l?zb(e):null;return l&&function t(){const n=zb(e);!g||n.x===g.x&&n.y===g.y&&n.width===g.width&&n.height===g.height||s();g=n,p=requestAnimationFrame(t)}(),s(),()=>{var e;d.forEach((e=>{o&&e.removeEventListener("scroll",s),r&&e.removeEventListener("resize",s)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const ey=(e,t,s)=>{const n=new Map,o={platform:Xb,...s},r={...o.platform,_c:n};return(async(e,t,s)=>{const{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:i}=s,a=r.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=pb(c,n,l),p=n,m={},h=0;for(let s=0;s<a.length;s++){const{name:r,fn:g}=a[s],{x:_,y:f,data:b,reset:y}=await g({x:d,y:u,initialPlacement:n,placement:p,strategy:o,middlewareData:m,rects:c,platform:i,elements:{reference:e,floating:t}});d=null!=_?_:d,u=null!=f?f:u,m={...m,[r]:{...m[r],...b}},y&&h<=50&&(h++,"object"==typeof y&&(y.placement&&(p=y.placement),y.rects&&(c=!0===y.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:d,y:u}=pb(c,p,l))),s=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:m}})(e,t,{...o,platform:r})};var ty=s(1609);const sy=window.ReactDOM;var ny="undefined"!=typeof document?ty.useLayoutEffect:ty.useEffect;function oy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let s,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(n=s;0!=n--;)if(!oy(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),s=o.length,s!==Object.keys(t).length)return!1;for(n=s;0!=n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=s;0!=n--;){const s=o[n];if(("_owner"!==s||!e.$$typeof)&&!oy(e[s],t[s]))return!1}return!0}return e!=e&&t!=t}function ry(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iy(e,t){const s=ry(e);return Math.round(t*s)/s}function ay(e){const t=ty.useRef(e);return ny((()=>{t.current=e})),t}const{useBlockElementRef:ly,cleanEmptyObject:cy}=$(g.privateApis);function dy({thread:e,calculatedOffset:t,setHeights:s,selectedThread:n,setBlockRef:o,commentLastUpdated:r}){const i=(0,p.useRef)();ly(e.blockClientId,i);const a=(0,p.useCallback)(((e,t)=>{s((s=>s[e]!==t?{...s,[e]:t}:s))}),[s]),{y:l,refs:c}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:n=[],platform:o,elements:{reference:r,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=ty.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=ty.useState(n);oy(p,n)||m(n);const[h,g]=ty.useState(null),[_,f]=ty.useState(null),b=ty.useCallback((e=>{e!==w.current&&(w.current=e,g(e))}),[]),y=ty.useCallback((e=>{e!==S.current&&(S.current=e,f(e))}),[]),x=r||h,v=i||_,w=ty.useRef(null),S=ty.useRef(null),k=ty.useRef(d),C=null!=l,P=ay(l),j=ay(o),E=ty.useCallback((()=>{if(!w.current||!S.current)return;const e={placement:t,strategy:s,middleware:p};j.current&&(e.platform=j.current),ey(w.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};T.current&&!oy(k.current,t)&&(k.current=t,sy.flushSync((()=>{u(t)})))}))}),[p,t,s,j]);ny((()=>{!1===c&&k.current.isPositioned&&(k.current.isPositioned=!1,u((e=>({...e,isPositioned:!1}))))}),[c]);const T=ty.useRef(!1);ny((()=>(T.current=!0,()=>{T.current=!1})),[]),ny((()=>{if(x&&(w.current=x),v&&(S.current=v),x&&v){if(P.current)return P.current(x,v,E);E()}}),[x,v,E,P,C]);const B=ty.useMemo((()=>({reference:w,floating:S,setReference:b,setFloating:y})),[b,y]),I=ty.useMemo((()=>({reference:x,floating:v})),[x,v]),N=ty.useMemo((()=>{const e={position:s,left:0,top:0};if(!I.floating)return e;const t=iy(I.floating,d.x),n=iy(I.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...ry(I.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:t,top:n}}),[s,a,I.floating,d.x,d.y]);return ty.useMemo((()=>({...d,update:E,refs:B,elements:I,floatingStyles:N})),[d,E,B,I,N])}({placement:"right-start",middleware:[mb({crossAxis:t||-16})],whileElementsMounted:Jb});return(0,p.useEffect)((()=>{i.current&&c.setReference(i.current)}),[i,c,r]),(0,p.useEffect)((()=>{c.floating?.current&&o(e.id,i.current)}),[e.id,c.floating,o]),(0,p.useEffect)((()=>{if(c.floating?.current){const t=c.floating.current.scrollHeight;a(e.id,t)}}),[e.id,a,c.floating,n,r]),{blockRef:i,y:l,refs:c}}const{useBlockElement:uy}=$(g.privateApis);function py({onSubmit:e,newNoteFormState:t,setNewNoteFormState:s,commentSidebarRef:n,reflowComments:o=eb,isFloating:r=!1,y:i,refs:a}){const{clientId:l}=(0,d.useSelect)((e=>{const{getSelectedBlockClientId:t}=e(g.store);return{clientId:t()}}),[]),u=uy(l),{toggleBlockSpotlight:p}=$((0,d.useDispatch)(g.store));return"open"===t&&l?(0,c.jsxs)(Hn.__experimentalVStack,{className:mr("editor-collab-sidebar-panel__thread is-selected",{"is-floating":r}),spacing:"3",tabIndex:0,"aria-label":(0,fs.__)("New note"),role:"treeitem",ref:r?a.setFloating:void 0,style:r?{top:i,opacity:i?void 0:0}:void 0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(p(l,!1),s("closed"))},children:[(0,c.jsx)(Hn.__experimentalHStack,{alignment:"left",spacing:"3",children:(0,c.jsx)(ob,{})}),(0,c.jsx)(rb,{onSubmit:async t=>{const{id:o}=await e({content:t});nb(o,n.current),s("creating")},onCancel:()=>{s("closed"),u?.focus(),p(l,!1)},reflowComments:o,submitButtonText:(0,fs.__)("Add note"),labelText:(0,fs.__)("New note")})]}):null}const{useBlockElement:my}=$(g.privateApis),{Menu:hy}=$(Hn.privateApis);function gy({threads:e,onEditComment:t,onAddReply:s,onCommentDelete:n,newNoteFormState:o,setNewNoteFormState:r,commentSidebarRef:i,reflowComments:a,isFloating:l=!1,commentLastUpdated:u}){const[m,h]=(0,p.useState)({}),[_,f]=(0,p.useState)(null),[b,y]=(0,p.useState)({}),[x,v]=(0,p.useState)({}),{setCanvasMinHeight:w}=$((0,d.useDispatch)(vc)),{selectBlock:S,toggleBlockSpotlight:k}=$((0,d.useDispatch)(g.store)),{blockCommentId:C,selectedBlockClientId:P,orderedBlockIds:j}=(0,d.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientId:s,getClientIdsWithDescendants:n}=e(g.store),o=s();return{blockCommentId:o?t(o)?.metadata?.noteId:null,selectedBlockClientId:o,orderedBlockIds:n()}}),[]),E=my(P),T=(0,p.useMemo)((()=>{const t=[...e],s=[];if(l&&"open"===o){const e={id:"new-note-thread",blockClientId:P,content:{rendered:""}};return j.forEach((n=>{if(n===P)s.push(e);else{const e=t.find((e=>e.blockClientId===n));e&&s.push(e)}})),s}return t}),[e,l,o,P,j]),B=async e=>{const t=T.findIndex((t=>t.id===e.id)),s=T[t+1],o=T[t-1];if(await n(e),0!==e.parent)return f(e.parent),void nb(e.parent,i.current);s?(f(s.id),nb(s.id,i.current)):o?(f(o.id),nb(o.id,i.current)):(f(null),r("closed"),E?.focus())};(0,p.useEffect)((()=>{f("open"===o?"new-note-thread":C)}),[C,o]);const I=(0,p.useCallback)(((e,t)=>{v((s=>({...s,[e]:t})))}),[]);(0,p.useEffect)((()=>{const{offsets:e,minHeight:t}=(()=>{const e={};if(!l)return{offsets:e,minHeight:0};const t=T.findIndex((e=>e.id===_)),s=-1===t?0:t,n=T[s];if(!n||!x[n.id])return{offsets:e,minHeight:0};let o=x[n.id],r=o?.getBoundingClientRect();const i=r?.top||0,a=m[n.id]||0;e[n.id]=-16;let c={threadTop:i-16,threadHeight:a};for(let t=s+1;t<T.length;t++){const s=T[t];if(!x[s.id])continue;o=x[s.id],r=o?.getBoundingClientRect();const n=r?.top||0,i=m[s.id]||0;let a=-16;const l=c.threadTop+c.threadHeight;n<l+16&&(a=l-n+20),e[s.id]=a,c={threadTop:n+a,threadHeight:i}}let d={threadTop:i-16};for(let s=t-1;s>=0;s--){const t=T[s];if(!x[t.id])continue;o=x[t.id],r=o?.getBoundingClientRect();const n=r?.top||0,i=m[t.id]||0;let a=-16;n+i>d.threadTop&&(a=d.threadTop-n-i-20),e[t.id]=a,d={threadTop:n+a}}let u=0;const p=T[T.length-1];if(x[p.id]){const t=x[p.id],s=t?.getBoundingClientRect();u=(s?.top||0)+(m[p.id]||0)+(e[p.id]||0)+32}return{offsets:e,minHeight:u}})();Object.keys(e).length>0&&y(e),w(t)}),[m,x,l,T,_,w]);return Array.isArray(T)&&T.length>0||l?(0,c.jsxs)(c.Fragment,{children:[!l&&"open"===o&&(0,c.jsx)(py,{onSubmit:s,newNoteFormState:o,setNewNoteFormState:r,commentSidebarRef:i}),T.map((e=>(0,c.jsx)(_y,{thread:e,onAddReply:s,onCommentDelete:B,onEditComment:t,isSelected:_===e.id,setSelectedThread:f,setNewNoteFormState:r,commentSidebarRef:i,reflowComments:a,isFloating:l,calculatedOffset:b[e.id]??0,setHeights:h,setBlockRef:I,selectedThread:_,commentLastUpdated:u,newNoteFormState:o,onKeyDown:t=>((e,t,s)=>{if(e.defaultPrevented)return;const n=T.findIndex((e=>e.id===t.id));"Enter"!==e.key&&"ArrowRight"!==e.key||e.currentTarget!==e.target||s?("Enter"===e.key||"ArrowLeft"===e.key)&&e.currentTarget===e.target&&s||"Escape"===e.key?(f(null),r("closed"),t.blockClientId&&k(t.blockClientId,!1),nb(t.id,i.current)):"ArrowDown"===e.key&&n<T.length-1&&e.currentTarget===e.target?nb(T[n+1].id,i.current):"ArrowUp"===e.key&&n>0&&e.currentTarget===e.target?nb(T[n-1].id,i.current):"Home"===e.key&&e.currentTarget===e.target?nb(T[0].id,i.current):"End"===e.key&&e.currentTarget===e.target&&nb(T[T.length-1].id,i.current):(r("closed"),f(t.id),t.blockClientId&&(S(t.blockClientId,null),k(t.blockClientId,!0)))})(t,e,_===e.id)},e.id)))]}):(0,c.jsx)(py,{onSubmit:s,newNoteFormState:o,setNewNoteFormState:r,commentSidebarRef:i})}function _y({thread:e,onEditComment:t,onAddReply:s,onCommentDelete:n,isSelected:o,setNewNoteFormState:r,commentSidebarRef:i,reflowComments:a,isFloating:l,calculatedOffset:u,setHeights:h,setBlockRef:_,setSelectedThread:f,selectedThread:b,commentLastUpdated:y,newNoteFormState:x,onKeyDown:v}){const{toggleBlockHighlight:w,selectBlock:S,toggleBlockSpotlight:k}=$((0,d.useDispatch)(g.store)),C=my(e.blockClientId),P=(0,m.useDebounce)(w,50),{y:j,refs:E}=dy({thread:e,calculatedOffset:u,setHeights:h,setBlockRef:_,selectedThread:b,commentLastUpdated:y}),T=(0,p.useRef)(!1),B=()=>{f(null),r("closed"),k(e.blockClientId,!1)},I=e?.reply||[],N=I.length>0?I[I.length-1]:void 0,R=I.length>0?I.slice(0,-1):[],D=function(e,t=10){if(!e)return"";const s=(0,fs._x)("words","Word count type. Do not translate!"),n=e.trim();let o="";if("words"===s)o=n.split(" ",t).join(" ");else if("characters_excluding_spaces"===s){const e=n.split("",t).join(""),s=e.length-e.replaceAll(" ","").length;o=n.split("",t+s).join("")}else"characters_including_spaces"===s&&(o=n.split("",t).join(""));return o!==n?o+"…":o}((0,Uc.__unstableStripHTML)(e.content?.rendered),10),A=e.blockClientId?(0,fs.sprintf)((0,fs.__)("Note: %s"),D):(0,fs.sprintf)((0,fs.__)("Original block deleted. Note: %s"),D);return"new-note-thread"===e.id&&"open"===x&&l?(0,c.jsx)(py,{onSubmit:s,newNoteFormState:x,setNewNoteFormState:r,commentSidebarRef:i,reflowComments:a,isFloating:l,y:j,refs:E}):(0,c.jsxs)(Hn.__experimentalVStack,{className:mr("editor-collab-sidebar-panel__thread",{"is-selected":o,"is-floating":l}),id:`comment-thread-${e.id}`,spacing:"3",onClick:()=>{r("closed"),f(e.id),k(e.blockClientId,!0),e.blockClientId&&S(e.blockClientId,null)},onMouseEnter:()=>{P(e.blockClientId,!0)},onMouseLeave:()=>{P(e.blockClientId,!1)},onFocus:()=>{w(e.blockClientId,!0)},onBlur:t=>{const s=t.relatedTarget?.closest(".editor-collab-sidebar-panel__thread"),n=t.relatedTarget?.closest('[role="dialog"]'),o=T.current;s&&!o||n||o&&t.currentTarget.contains(t.relatedTarget)||(w(e.blockClientId,!1),B())},onKeyUp:e=>{"Tab"===e.key&&(T.current=!1)},onKeyDown:e=>{"Tab"===e.key?T.current=!0:v(e)},tabIndex:0,role:"treeitem","aria-label":A,"aria-expanded":o,ref:l?E.setFloating:void 0,style:l?{top:j}:void 0,children:[(0,c.jsx)(Hn.Button,{className:"editor-collab-sidebar-panel__skip-to-comment",variant:"secondary",size:"compact",onClick:()=>{nb(e.id,i.current,"textarea")},children:(0,fs.__)("Add new reply")}),!e.blockClientId&&(0,c.jsx)(Hn.__experimentalText,{as:"p",weight:500,variant:"muted",children:(0,fs.__)("Original block deleted.")}),(0,c.jsx)(fy,{thread:e,isExpanded:o,onEdit:(s={})=>{t(s),"approved"===s.status&&(B(),l?C?.focus():nb(e.id,i.current))},onDelete:n,reflowComments:a}),o&&I.map((s=>(0,c.jsx)(fy,{thread:s,parent:e,isExpanded:o,onEdit:t,onDelete:n,reflowComments:a},s.id))),!o&&R.length>0&&(0,c.jsx)(Hn.__experimentalHStack,{className:"editor-collab-sidebar-panel__more-reply-separator",children:(0,c.jsx)(Hn.Button,{size:"compact",variant:"tertiary",className:"editor-collab-sidebar-panel__more-reply-button",onClick:()=>{f(e.id),nb(e.id,i.current)},children:(0,fs.sprintf)((0,fs._n)("%s more reply","%s more replies",R.length),R.length)})}),!o&&N&&(0,c.jsx)(fy,{thread:N,parent:e,isExpanded:o,onEdit:t,onDelete:n,reflowComments:a}),o&&(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"2",role:"treeitem",children:[(0,c.jsx)(Hn.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:(0,c.jsx)(ob,{})}),(0,c.jsx)(Hn.__experimentalVStack,{spacing:"2",children:(0,c.jsx)(rb,{onSubmit:n=>{"approved"===e.status?t({id:e.id,status:"hold",content:n}):s({content:n,parent:e.id})},onCancel:t=>{t.stopPropagation(),B(),nb(e.id,i.current)},submitButtonText:"approved"===e.status?(0,fs.__)("Reopen & Reply"):(0,fs.__)("Reply"),rows:"approved"===e.status?2:4,labelText:(0,fs.sprintf)((0,fs.__)("Reply to note %1$s by %2$s"),e.id,e.author_name),reflowComments:a})})]}),!!e.blockClientId&&(0,c.jsx)(Hn.Button,{className:"editor-collab-sidebar-panel__skip-to-block",variant:"secondary",size:"compact",onClick:e=>{e.stopPropagation(),C?.focus()},children:(0,fs.__)("Back to block")})]})}const fy=({thread:e,parent:t,isExpanded:s,onEdit:n,onDelete:o,reflowComments:r})=>{const[i,a]=(0,p.useState)(!1),[l,d]=(0,p.useState)(!1),u=(0,p.useRef)(null),m=()=>{a(!1),d(!1),u.current?.focus()},h="note"===e.type&&e.meta&&("resolved"===e.meta._wp_note_status||"reopen"===e.meta._wp_note_status),g=[{id:"edit",title:(0,fs.__)("Edit"),isEligible:({status:e})=>"approved"!==e,onClick:()=>{a("edit")}},{id:"reopen",title:(0,fs._x)("Reopen","Reopen note"),isEligible:({status:e})=>"approved"===e,onClick:()=>{n({id:e.id,status:"hold"})}},{id:"delete",title:(0,fs.__)("Delete"),isEligible:()=>!0,onClick:()=>{a("delete"),d(!0)}}],_=0===e.parent,f="approved"!==t?.status?g.filter((t=>t.isEligible(e))):[],b=0===e.parent?(0,fs.__)("Are you sure you want to delete this note? This will also delete all of this note's replies."):(0,fs.__)("Are you sure you want to delete this reply?");return(0,c.jsxs)(Hn.__experimentalVStack,{spacing:"2",role:0!==e.parent?"treeitem":void 0,children:[(0,c.jsxs)(Hn.__experimentalHStack,{alignment:"left",spacing:"3",justify:"flex-start",children:[(0,c.jsx)(ob,{avatar:e?.author_avatar_urls?.[48],name:e?.author_name,date:e?.date,userId:e?.author}),s&&(0,c.jsx)(Hn.FlexItem,{className:"editor-collab-sidebar-panel__comment-status",onClick:e=>{e.stopPropagation()},children:(0,c.jsxs)(Hn.__experimentalHStack,{spacing:"0",children:[_&&(0,c.jsx)(Hn.Button,{label:(0,fs._x)("Resolve","Mark note as resolved"),size:"small",icon:wr,disabled:"approved"===e.status,accessibleWhenDisabled:"approved"===e.status,onClick:()=>{n({id:e.id,status:"approved"})}}),(0,c.jsxs)(hy,{placement:"bottom-end",children:[(0,c.jsx)(hy.TriggerButton,{render:(0,c.jsx)(Hn.Button,{ref:u,size:"small",icon:r_,label:(0,fs.__)("Actions"),disabled:!f.length,accessibleWhenDisabled:!0})}),(0,c.jsx)(hy.Popover,{modal:!1,children:f.map((e=>(0,c.jsx)(hy.Item,{onClick:()=>e.onClick(),children:(0,c.jsx)(hy.ItemLabel,{children:e.title})},e.id)))})]})]})})]}),"edit"===i?(0,c.jsx)(rb,{onSubmit:t=>{n({id:e.id,content:t}),a(!1),u.current?.focus()},onCancel:()=>m(),thread:e,submitButtonText:(0,fs._x)("Update","verb"),labelText:(0,fs.sprintf)((0,fs.__)("Edit note %1$s by %2$s"),e.id,e.author_name),reflowComments:r}):(0,c.jsx)(p.RawHTML,{className:mr("editor-collab-sidebar-panel__user-comment",{"editor-collab-sidebar-panel__resolution-text":h}),children:h?(()=>{const t="resolved"===e.meta._wp_note_status?(0,fs.__)("Marked as resolved"):(0,fs.__)("Reopened"),s=e?.content?.raw;return s&&"string"==typeof s&&""!==s.trim()?(0,fs.sprintf)((0,fs.__)("%1$s: %2$s"),t,s):t})():e?.content?.rendered}),"delete"===i&&(0,c.jsx)(Hn.__experimentalConfirmDialog,{isOpen:l,onConfirm:()=>{o(e),a(!1),d(!1)},onCancel:m,confirmButtonText:(0,fs.__)("Delete"),children:b})]})};const{CommentIconSlotFill:by}=$(g.privateApis),yy=({clientId:e,onClick:t,isDistractionFree:s})=>{const n=(0,d.useSelect)((t=>t(g.store).getBlock(e)),[e]);if(!n?.isValid||n?.name===(0,x.getUnregisteredTypeHandlerName)())return null;const o=s||"core/freeform"===n?.name;let r;return s?r=(0,fs.__)("Notes are disabled in distraction free mode."):"core/freeform"===n?.name&&(r=(0,fs.__)("Convert to blocks to add notes.")),(0,c.jsx)(Hn.MenuItem,{icon:Kf,onClick:t,"aria-haspopup":"dialog",disabled:o,info:r,children:(0,fs.__)("Add note")})};var xy=({onClick:e,isDistractionFree:t})=>(0,c.jsx)(by.Fill,{children:({clientId:s,onClose:n})=>(0,c.jsx)(yy,{clientId:s,isDistractionFree:t,onClick:()=>{e(),n()}})});const{CommentIconToolbarSlotFill:vy}=$(g.privateApis);var wy=({onClick:e,thread:t})=>{const s=(0,p.useMemo)((()=>{if(!t)return[];const e=new Map,s=[t,...t.reply];return s.sort(((e,t)=>new Date(e.date)-new Date(t.date))),s.forEach((t=>{t.author_name&&t.author_avatar_urls&&(e.has(t.author)||e.set(t.author,{name:t.author_name,avatar:t.author_avatar_urls?.[48]||t.author_avatar_urls?.[96],id:t.author,date:t.date}))})),Array.from(e.values())}),[t]);if(!s.length)return null;const n=s.length>3?s.slice(0,2):s,o=Math.max(0,s.length-n.length),r=s.length>100&&o>0?(0,fs.__)("100+"):(0,fs.sprintf)((0,fs.__)("+%s"),o);return(0,c.jsx)(vy.Fill,{children:(0,c.jsx)(Hn.ToolbarButton,{className:"comment-avatar-indicator",label:(0,fs.__)("View notes"),onClick:e,showTooltip:!0,children:(0,c.jsxs)(Hn.__experimentalHStack,{spacing:"1",children:[n.map((e=>(0,c.jsx)("img",{src:e.avatar,alt:e.name,className:"comment-avatar",style:{borderColor:sb(e.id)}},e.id))),o>0&&(0,c.jsx)(Hn.__experimentalText,{weight:500,children:r})]})})})};function Sy({newNoteFormState:e,setNewNoteFormState:t,styles:s,comments:n,commentSidebarRef:o,reflowComments:r,commentLastUpdated:i,isFloating:a=!1}){const{onCreate:l,onEdit:p,onDelete:m}=function(e=eb){const{createNotice:t}=(0,d.useDispatch)(_s.store),{saveEntityRecord:s,deleteEntityRecord:n}=(0,d.useDispatch)(u.store),{getCurrentPostId:o}=(0,d.useSelect)(vc),{getBlockAttributes:r,getSelectedBlockClientId:i}=(0,d.useSelect)(g.store),{updateBlockAttributes:a}=(0,d.useDispatch)(g.store),l=e=>{const s=e.message&&"unknown_error"!==e.code?(0,Ln.decodeEntities)(e.message):(0,fs.__)("An error occurred while performing an update.");t("error",s,{type:"snackbar",isDismissible:!0})};return{onCreate:async({content:n,parent:c})=>{try{const l=await s("root","comment",{post:o(),content:n,status:"hold",type:"note",parent:c||0},{throwOnError:!0});if(!c&&l?.id){const e=i(),t=r(e)?.metadata;a(e,{metadata:{...t,noteId:l.id}})}return t("snackbar",c?(0,fs.__)("Reply added."):(0,fs.__)("Note added."),{type:"snackbar",isDismissible:!0}),setTimeout(e,300),l}catch(t){e(),l(t)}},onEdit:async({id:n,content:r,status:i})=>{const a=i||"updated",c={approved:(0,fs.__)("Note marked as resolved."),hold:(0,fs.__)("Note reopened."),updated:(0,fs.__)("Note updated.")};try{if("approved"===i||"hold"===i){await s("root","comment",{id:n,status:i},{throwOnError:!0});const e={post:o(),content:r||"",type:"note",status:i,parent:n,meta:{_wp_note_status:"approved"===i?"resolved":"reopen"}};await s("root","comment",e,{throwOnError:!0})}else{const e={id:n,content:r,status:i};await s("root","comment",e,{throwOnError:!0})}t("snackbar",c[a]??(0,fs.__)("Note updated."),{type:"snackbar",isDismissible:!0}),e()}catch(t){e(),l(t)}},onDelete:async s=>{try{if(await n("root","comment",s.id,void 0,{throwOnError:!0}),!s.parent){const e=i(),t=r(e)?.metadata;a(e,{metadata:cy({...t,noteId:void 0})})}t("snackbar",(0,fs.__)("Note deleted."),{type:"snackbar",isDismissible:!0}),e()}catch(t){e(),l(t)}}}}(r);return(0,c.jsx)(Hn.__experimentalVStack,{className:"editor-collab-sidebar-panel",style:s,role:"tree",spacing:"3",justify:"flex-start",ref:e=>{e&&(o.current=e)},"aria-label":a?(0,fs.__)("Unresolved notes"):(0,fs.__)("All notes"),children:(0,c.jsx)(gy,{threads:n,onEditComment:p,onAddReply:l,onCommentDelete:m,newNoteFormState:e,setNewNoteFormState:t,commentSidebarRef:o,reflowComments:r,commentLastUpdated:i,isFloating:a})})}function ky({postId:e,mode:t}){const[s,n]=(0,p.useState)("closed"),{getActiveComplementaryArea:o}=(0,d.useSelect)(ja),{enableComplementaryArea:r}=(0,d.useDispatch)(ja),{toggleBlockSpotlight:i}=$((0,d.useDispatch)(g.store)),a=(0,m.useViewportMatch)("medium"),l=(0,p.useRef)(null),h=a&&"post-only"===t,{clientId:_,blockCommentId:f,isDistractionFree:b}=(0,d.useSelect)((e=>{const{getBlockAttributes:t,getSelectedBlockClientId:s,getSettings:n}=e(g.store),o=s();return{clientId:o,blockCommentId:o?t(o)?.metadata?.noteId:null,isDistractionFree:n().isDistractionFree}}),[]),{resultComments:y,unresolvedSortedThreads:x,reflowComments:v,commentLastUpdated:w}=function(e){const[t,s]=(0,p.useReducer)((()=>Date.now()),0),n={post:e,type:"note",status:"all",per_page:-1},{records:o}=(0,u.useEntityRecords)("root","comment",n,{enabled:!!e&&"number"==typeof e}),{getBlockAttributes:r}=(0,d.useSelect)(g.store),{clientIds:i}=(0,d.useSelect)((e=>{const{getClientIdsWithDescendants:t}=e(g.store);return{clientIds:t()}}),[]),{resultComments:a,unresolvedSortedThreads:l}=(0,p.useMemo)((()=>{if(!o||0===o.length)return{resultComments:[],unresolvedSortedThreads:[]};const e=i.reduce(((e,t)=>{const s=r(t)?.metadata?.noteId;return s&&(e[t]=s),e}),{}),t={},s=[];if(o.forEach((s=>{const n=Object.keys(e).find((t=>e[t]===s.id));t[s.id]={...s,reply:[],blockClientId:0===s.parent?n:null}})),o.forEach((e=>{0===e.parent?s.push(t[e.id]):t[e.parent]&&t[e.parent].reply.push(t[e.id])})),0===s?.length)return{resultComments:[],unresolvedSortedThreads:[]};const n=s.map((e=>({...e,reply:[...e.reply].reverse()}))),a=new Map(n.map((e=>[String(e.id),e]))),l=new Set(Object.values(e).map((e=>String(e)))),c=Object.values(e).map((e=>a.get(String(e)))).filter((e=>void 0!==e&&"hold"===e.status)),d=Object.values(e).map((e=>a.get(String(e)))).filter((e=>void 0!==e&&"approved"===e.status)),u=n.filter((e=>!l.has(String(e.id))));return{resultComments:[...c,...d,...u],unresolvedSortedThreads:c}}),[i,o,r]);return{resultComments:a,unresolvedSortedThreads:l,reflowComments:s,commentLastUpdated:t}}(e);!function(e=!1){const t=(0,d.useRegistry)();(0,p.useEffect)((()=>{if(!e)return;const{getActiveComplementaryArea:s}=t.select(ja),{disableComplementaryArea:n,enableComplementaryArea:o}=t.dispatch(ja),r=t.subscribe((()=>{null===s("core")&&o("core",Xf)}));return()=>{r(),s("core")===Xf&&n("core",Xf)}}),[e,t])}(h&&(x.length>0||"closed"!==s));const{merged:S}=Ti(),k=S?.styles?.color?.background,C=f?y.find((e=>e.id===f)):null,P=y.length>0||!h;async function j(){const e=await o("core"),t=Jf.find((t=>t===e));"approved"===C?.status?r("core",Qf):t&&P||r("core",h?Xf:Qf);const s=await o("core");Jf.includes(s)&&(n(C?"closed":"open"),nb(C?.id,l.current,C?void 0:"textarea"),i(_,!0))}return b?(0,c.jsx)(xy,{isDistractionFree:!0}):(0,c.jsxs)(c.Fragment,{children:[!!C&&(0,c.jsx)(wy,{thread:C,onClick:j}),(0,c.jsx)(xy,{onClick:j}),P&&(0,c.jsx)(Iu,{identifier:Qf,name:Qf,title:(0,fs.__)("All notes"),header:(0,c.jsx)("h2",{className:"interface-complementary-area-header__title",children:(0,fs.__)("All notes")}),icon:Kf,closeLabel:(0,fs.__)("Close Notes"),children:(0,c.jsx)(Sy,{comments:y,newNoteFormState:s,setNewNoteFormState:n,commentSidebarRef:l,reflowComments:v,commentLastUpdated:w})}),a&&(0,c.jsx)(Iu,{isPinnable:!1,header:!1,identifier:Xf,className:"editor-collab-sidebar",headerClassName:"editor-collab-sidebar__header",backgroundColor:k,children:(0,c.jsx)(Sy,{comments:x,newNoteFormState:s,setNewNoteFormState:n,commentSidebarRef:l,reflowComments:v,commentLastUpdated:w,styles:{backgroundColor:k},isFloating:!0})})]})}function Cy(){const{postId:e,mode:t,editorMode:s}=(0,d.useSelect)((e=>{const{getCurrentPostId:t,getRenderingMode:s,getEditorMode:n}=e(vc);return{postId:t(),mode:s(),editorMode:n()}}),[]);return e&&"number"==typeof e?"text"===s?null:(0,c.jsx)(Bd,{supportKeys:"editor.notes",children:(0,c.jsx)(ky,{postId:e,mode:t})}):null}var Py=function({postType:e,postId:t,templateId:s,settings:n,children:o,initialEdits:r,onActionPerformed:i,extraContent:a,extraSidebarPanels:l,...p}){const{post:m,template:h,hasLoadedPost:g,error:_}=(0,d.useSelect)((n=>{const{getEntityRecord:o,getResolutionError:r,hasFinishedResolution:i}=n(u.store),a=["postType",e,t];return{post:o(...a),template:s?o("postType",B,s):void 0,hasLoadedPost:i("getEntityRecord",a),error:r("getEntityRecord",a)?.message}}),[e,t,s]);return(0,c.jsxs)(c.Fragment,{children:[g&&!m&&(0,c.jsx)(Hn.Notice,{status:_?"error":"warning",isDismissible:!1,children:_||(0,fs.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")}),!!m&&(0,c.jsxs)(Rl,{post:m,__unstableTemplate:h,settings:n,initialEdits:r,useSubRegistry:!1,children:[(0,c.jsx)(sf,{...p,children:a}),o,(0,c.jsx)(qf,{onActionPerformed:i,extraPanels:l}),(0,c.jsx)(Cy,{})]})]})};const{PreferenceBaseOption:jy}=$(C.privateApis);function Ey(e){const t=(0,d.useSelect)((e=>e(vc).isPublishSidebarEnabled()),[]),{enablePublishSidebar:s,disablePublishSidebar:n}=(0,d.useDispatch)(vc);return(0,c.jsx)(jy,{isChecked:t,onChange:e=>e?s():n(),...e})}const{BlockManager:Ty}=$(g.privateApis),By=[];function Iy(){const{showBlockTypes:e,hideBlockTypes:t}=$((0,d.useDispatch)(vc)),{blockTypes:s,allowedBlockTypes:n,hiddenBlockTypes:o}=(0,d.useSelect)((e=>({blockTypes:e(x.store).getBlockTypes(),allowedBlockTypes:e(vc).getEditorSettings().allowedBlockTypes,hiddenBlockTypes:e(C.store).get("core","hiddenBlockTypes")??By})),[]),r=(0,p.useMemo)((()=>!0===n?s:s.filter((({name:e})=>n?.includes(e)))),[n,s]).filter((e=>(0,x.hasBlockSupport)(e,"inserter",!0)&&(!e.parent||e.parent.includes("core/post-content")))),i=o.filter((e=>r.some((t=>t.name===e)))),a=r.filter((e=>!i.includes(e.name))),l=r.length-a.length;const u=s=>{if(a.length>s.length){const e=a.filter((e=>!s.find((({name:t})=>t===e.name))));t(e.map((({name:e})=>e)))}else if(a.length<s.length){const t=s.filter((e=>!a.find((({name:t})=>t===e.name))));e(t.map((({name:e})=>e)))}};return(0,c.jsxs)("div",{className:"editor-block-visibility",children:[!!l&&(0,c.jsxs)("div",{className:"editor-block-visibility__disabled-blocks-count",children:[(0,fs.sprintf)((0,fs._n)("%d block is hidden.","%d blocks are hidden.",l),l),(0,c.jsx)(Hn.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:function(){u(r)},children:(0,fs.__)("Reset")})]}),(0,c.jsx)(Ty,{blockTypes:r,selectedBlockTypes:a,onChange:u,showSelectAll:!1})]})}const{PreferencesModal:Ny,PreferencesModalTabs:Ry,PreferencesModalSection:Dy,PreferenceToggleControl:Ay}=$(C.privateApis);function My({extraSections:e={}}){const t=(0,m.useViewportMatch)("medium"),s=(0,d.useSelect)((e=>{const{getEditorSettings:s}=e(vc),{get:n}=e(C.store),o=s().richEditingEnabled;return!n("core","distractionFree")&&t&&o}),[t]),{setIsListViewOpened:n,setIsInserterOpened:o}=(0,d.useDispatch)(vc),{set:r}=(0,d.useDispatch)(C.store),i=(0,p.useMemo)((()=>[{name:"general",tabLabel:(0,fs.__)("General"),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(Dy,{title:(0,fs.__)("Interface"),children:[(0,c.jsx)(Ay,{scope:"core",featureName:"showListViewByDefault",help:(0,fs.__)("Opens the List View panel by default."),label:(0,fs.__)("Always open List View")}),s&&(0,c.jsx)(Ay,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,fs.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,fs.__)("Show block breadcrumbs")}),(0,c.jsx)(Ay,{scope:"core",featureName:"allowRightClickOverrides",help:(0,fs.__)("Allows contextual List View menus via right-click, overriding browser defaults."),label:(0,fs.__)("Allow right-click contextual menus")}),(0,c.jsx)(Ay,{scope:"core",featureName:"enableChoosePatternModal",help:(0,fs.__)("Pick from starter content when creating a new page."),label:(0,fs.__)("Show starter patterns")})]}),(0,c.jsxs)(Dy,{title:(0,fs.__)("Document settings"),description:(0,fs.__)("Select what settings are shown in the document panel."),children:[(0,c.jsx)(uu.Slot,{}),(0,c.jsx)(dh,{taxonomyWrapper:(e,t)=>(0,c.jsx)(au,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,c.jsx)(gp,{children:(0,c.jsx)(au,{label:(0,fs.__)("Featured image"),panelName:"featured-image"})}),(0,c.jsx)(op,{children:(0,c.jsx)(au,{label:(0,fs.__)("Excerpt"),panelName:"post-excerpt"})}),(0,c.jsx)(Bd,{supportKeys:["comments","trackbacks"],children:(0,c.jsx)(au,{label:(0,fs.__)("Discussion"),panelName:"discussion-panel"})}),(0,c.jsx)(Td,{children:(0,c.jsx)(au,{label:(0,fs.__)("Page attributes"),panelName:"page-attributes"})})]}),t&&(0,c.jsx)(Dy,{title:(0,fs.__)("Publishing"),children:(0,c.jsx)(Ey,{help:(0,fs.__)("Review settings, such as visibility and tags."),label:(0,fs.__)("Enable pre-publish checks")})}),e?.general]})},{name:"appearance",tabLabel:(0,fs.__)("Appearance"),content:(0,c.jsxs)(Dy,{title:(0,fs.__)("Appearance"),description:(0,fs.__)("Customize the editor interface to suit your needs."),children:[(0,c.jsx)(Ay,{scope:"core",featureName:"fixedToolbar",onToggle:()=>r("core","distractionFree",!1),help:(0,fs.__)("Access all block and document tools in a single place."),label:(0,fs.__)("Top toolbar")}),(0,c.jsx)(Ay,{scope:"core",featureName:"distractionFree",onToggle:()=>{r("core","fixedToolbar",!0),o(!1),n(!1)},help:(0,fs.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,fs.__)("Distraction free")}),(0,c.jsx)(Ay,{scope:"core",featureName:"focusMode",help:(0,fs.__)("Highlights the current block and fades other content."),label:(0,fs.__)("Spotlight mode")}),e?.appearance]})},{name:"accessibility",tabLabel:(0,fs.__)("Accessibility"),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Dy,{title:(0,fs.__)("Navigation"),description:(0,fs.__)("Optimize the editing experience for enhanced control."),children:(0,c.jsx)(Ay,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,fs.__)("Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users."),label:(0,fs.__)("Contain text cursor inside block")})}),(0,c.jsx)(Dy,{title:(0,fs.__)("Interface"),children:(0,c.jsx)(Ay,{scope:"core",featureName:"showIconLabels",label:(0,fs.__)("Show button text labels"),help:(0,fs.__)("Show text instead of icons on buttons across the interface.")})})]})},{name:"blocks",tabLabel:(0,fs.__)("Blocks"),content:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Dy,{title:(0,fs.__)("Inserter"),children:(0,c.jsx)(Ay,{scope:"core",featureName:"mostUsedBlocks",help:(0,fs.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,fs.__)("Show most used blocks")})}),(0,c.jsx)(Dy,{title:(0,fs.__)("Manage block visibility"),description:(0,fs.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),children:(0,c.jsx)(Iy,{})})]})},window.__experimentalMediaProcessing&&{name:"media",tabLabel:(0,fs.__)("Media"),content:(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(Dy,{title:(0,fs.__)("General"),description:(0,fs.__)("Customize options related to the media upload flow."),children:[(0,c.jsx)(Ay,{scope:"core/media",featureName:"optimizeOnUpload",help:(0,fs.__)("Compress media items before uploading to the server."),label:(0,fs.__)("Pre-upload compression")}),(0,c.jsx)(Ay,{scope:"core/media",featureName:"requireApproval",help:(0,fs.__)("Require approval step when optimizing existing media."),label:(0,fs.__)("Approval step")})]})})}].filter(Boolean)),[s,e,o,n,r,t]);return(0,c.jsx)(Ry,{sections:i})}var Ly=function({postType:e}){const{registerPostTypeSchema:t}=$((0,d.useDispatch)(vc));(0,p.useEffect)((()=>{t(e)}),[t,e]);const{fields:s}=(0,d.useSelect)((t=>{const{getEntityFields:s}=$(t(vc));return{fields:s("postType",e)}}),[e]);return s};const Oy="content";var Fy={name:"core/pattern-overrides",getValues({select:e,clientId:t,context:s,bindings:n}){const o=s["pattern/overrides"],{getBlockAttributes:r}=e(g.store),i=r(t),a={};for(const e of Object.keys(n)){const t=o?.[i?.metadata?.name]?.[e];void 0!==t?a[e]=""===t?void 0:t:a[e]=i[e]}return a},setValues({select:e,dispatch:t,clientId:s,bindings:n}){const{getBlockAttributes:o,getBlockParentsByBlockName:r,getBlocks:i}=e(g.store),a=o(s),l=a?.metadata?.name;if(!l)return;const[c]=r(s,"core/block",!0),d=Object.entries(n).reduce(((e,[t,{newValue:s}])=>(e[t]=s,e)),{});if(!c){const e=s=>{for(const n of s)n.attributes?.metadata?.name===l&&t(g.store).updateBlockAttributes(n.clientId,d),e(n.innerBlocks)};return void e(i())}const u=o(c)?.[Oy];t(g.store).updateBlockAttributes(c,{[Oy]:{...u,[l]:{...u?.[l],...Object.entries(d).reduce(((e,[t,s])=>(e[t]=void 0===s?"":s,e)),{})}}})},canUserEditValue:()=>!0};const Vy=["core/navigation-link","core/navigation-submenu"],Uy=[{label:(0,fs.__)("Post Date"),args:{field:"date"},type:"string"},{label:(0,fs.__)("Post Modified Date"),args:{field:"modified"},type:"string"},{label:(0,fs.__)("Post Link"),args:{field:"link"},type:"string"}];var Hy={name:"core/post-data",getValues({select:e,context:t,bindings:s,clientId:n}){const o=Uy.map((e=>e.args.field)),{getBlockAttributes:r,getBlockName:i}=e(g.store),a=i?.(n);let l,c;if(Vy.includes(a)){const e=r?.(n);l=e?.id,c=e?.type}else l=t?.postId,c=t?.postType;const{getEditedEntityRecord:d}=e(u.store),p=d("postType",c,l),m={};for(const[e,t]of Object.entries(s))o.includes(t.args.field)?m[e]=p?.[t.args.field]??Uy.find((e=>e.args.field===t.args.field)).label:m[e]={};return m},setValues({dispatch:e,context:t,bindings:s,clientId:n,select:o}){const{getBlockName:r}=o(g.store),i=r?.(n);if(Vy.includes(i))return!1;const a={};Object.values(s).forEach((({args:e,newValue:t})=>{a[e.field]=t})),e(u.store).editEntityRecord("postType",t?.postType,t?.postId,a)},canUserEditValue({select:e,context:t}){const{getBlockName:s,getSelectedBlockClientId:n}=e(g.store),o=n(),r=s?.(o);if(Vy.includes(r))return!1;if(t?.query||t?.queryId)return!1;if(!t?.postType)return!1;return!!e(u.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId})},getFieldsList({select:e}){const t=e(g.store).getSelectedBlock();return"core/post-date"!==t?.name||Vy.includes(t?.name)?[]:Uy}};function zy(e,t){const{getRegisteredPostMeta:s}=$(e(u.store)),n=s(t?.postType),o=[];return Object.entries(n).forEach((([e,t])=>{"footnotes"!==e&&"_"!==e.charAt(0)&&o.push({label:t.title||e,args:{key:e},default:t.default,type:t.type})})),o}function Gy({select:e,context:t,args:s}){const n=zy(e,t).find((e=>e.args.key===s.key));if(!n)return s.key;if(!t?.postId)return n.default||n.label||s.key;const{getEditedEntityRecord:o}=e(u.store),r=o("postType",t?.postType,t?.postId).meta;return r?.[s.key]??n?.label??s.key}var $y={name:"core/post-meta",getValues({select:e,context:t,bindings:s}){const n={};for(const[o,r]of Object.entries(s))n[o]=Gy({select:e,context:t,args:r.args});return n},setValues({dispatch:e,context:t,bindings:s}){const n={};Object.values(s).forEach((({args:e,newValue:t})=>{n[e.key]=t})),e(u.store).editEntityRecord("postType",t?.postType,t?.postId,{meta:n})},canUserEditValue({select:e,context:t,args:s}){if(t?.query||t?.queryId)return!1;if(!t?.postType)return!1;if(!zy(e,t).some((e=>e.args.key===s.key)))return!1;if(e(vc).getEditorSettings().enableCustomFields)return!1;return!!e(u.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId})},getFieldsList:({select:e,context:t})=>zy(e,t).map((({default:e,...t})=>({...t})))};const Wy=["core/navigation-link","core/navigation-submenu"];function Zy(e,t){return{id:{label:(0,fs.__)("Term ID"),value:t,type:"string"},name:{label:(0,fs.__)("Name"),value:e?.name,type:"string"},slug:{label:(0,fs.__)("Slug"),value:e?.slug,type:"string"},link:{label:(0,fs.__)("Link"),value:e?.link,type:"string"},description:{label:(0,fs.__)("Description"),value:e?.description,type:"string"},parent:{label:(0,fs.__)("Parent ID"),value:e?.parent,type:"string"},count:{label:(0,fs.__)("Count"),value:`(${e?.count??0})`,type:"string"}}}function Yy(e,t,s){const{getEntityRecord:n}=e(u.store),{getBlockAttributes:o,getBlockName:r}=e(g.store);let i,a;const l=r?.(s);let c,d;if(Wy.includes(l)){const e=o?.(s);c=e?.id;const t=e?.type;d="tag"===t?"post_tag":t}else c=t?.termId,d=t?.taxonomy;return d&&c?(i=n("taxonomy",d,c),!i&&t?.termData&&(i=t.termData),i&&(a=Zy(i,c))):t?.termData&&(i=t.termData,a=Zy(i,i?.term_id)),a&&Object.keys(a).length?a:null}var qy={name:"core/term-data",usesContext:["taxonomy","termId","termData"],getValues({select:e,context:t,bindings:s,clientId:n}){const o=Yy(e,t,n),r={};for(const[e,t]of Object.entries(s)){const s=t.args.field,{value:n,label:i}=o?.[s]||{};r[e]=n??i??s}return r},setValues:({dispatch:e,context:t,bindings:s})=>!1,canUserEditValue({select:e,context:t,args:s}){const{getBlockName:n,getSelectedBlockClientId:o}=e(g.store),r=o(),i=n?.(r);if(Wy.includes(i))return!1;if(t?.termQuery)return!1;if(!t?.taxonomy||!t?.termId)return!1;Yy(e,t,void 0)?.[s.field];return!1},getFieldsList({select:e,context:t}){const s=e(g.store).getSelectedBlockClientId(),n=Yy(e,t,s);return n?Object.entries(n).map((([e,t])=>({label:t.label,type:t.type,args:{field:e}}))):[]}};const{store:Ky,...Qy}=i,Xy={};function Jy(e,t,s){const{registerEntityAction:n}=$((0,d.dispatch)(vc))}function ex(e,t,s){const{unregisterEntityAction:n}=$((0,d.dispatch)(vc))}function tx(e,t,s){const{registerEntityField:n}=$((0,d.dispatch)(vc))}function sx(e,t,s){const{unregisterEntityField:n}=$((0,d.dispatch)(vc))}G(Xy,{CreateTemplatePartModal:Jn,patternTitleField:ni,templateTitleField:Jr,BackButton:Xg,EntitiesSavedStatesExtensible:xd,Editor:Py,EditorContentSlotFill:Zg,GlobalStylesProvider:function({children:e}){const t=Ti();return t.isReady?(0,c.jsx)(Pi.Provider,{value:t,children:e}):null},mergeBaseAndUserConfigs:Ei,PluginPostExcerpt:lp,PostCardPanel:ff,PreferencesModal:function({extraSections:e={}}){const t=(0,d.useSelect)((e=>e(ja).isModalActive("editor/preferences")),[]),{closeModal:s}=(0,d.useDispatch)(ja);return t?(0,c.jsx)(Ny,{closeModal:s,children:(0,c.jsx)(My,{extraSections:e})}):null},usePostActions:cf,usePostFields:Ly,ToolsMoreMenuGroup:u_,ViewMoreMenuGroup:h_,ResizableEditor:U_,registerCoreBlockBindingsSources:function(){(0,x.registerBlockBindingsSource)(Fy),(0,x.registerBlockBindingsSource)(Hy),(0,x.registerBlockBindingsSource)($y),(0,x.registerBlockBindingsSource)(qy)},getTemplateInfo:Y,interfaceStore:Ky,...Qy})})(),(window.wp=window.wp||{}).editor=n})(); nux.js 0000644 00000023616 15144410747 0005733 0 ustar 00 /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* 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))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
DotTip: () => (/* reexport */ dot_tip_default),
store: () => (/* reexport */ store)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
disableTips: () => (disableTips),
dismissTip: () => (dismissTip),
enableTips: () => (enableTips),
triggerGuide: () => (triggerGuide)
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
areTipsEnabled: () => (selectors_areTipsEnabled),
getAssociatedGuide: () => (getAssociatedGuide),
isTipVisible: () => (isTipVisible)
});
;// external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
;// external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// ./node_modules/@wordpress/nux/build-module/store/reducer.js
function guides(state = [], action) {
switch (action.type) {
case "TRIGGER_GUIDE":
return [...state, action.tipIds];
}
return state;
}
function areTipsEnabled(state = true, action) {
switch (action.type) {
case "DISABLE_TIPS":
return false;
case "ENABLE_TIPS":
return true;
}
return state;
}
function dismissedTips(state = {}, action) {
switch (action.type) {
case "DISMISS_TIP":
return {
...state,
[action.id]: true
};
case "ENABLE_TIPS":
return {};
}
return state;
}
const preferences = (0,external_wp_data_namespaceObject.combineReducers)({ areTipsEnabled, dismissedTips });
var reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({ guides, preferences });
;// ./node_modules/@wordpress/nux/build-module/store/actions.js
function triggerGuide(tipIds) {
return {
type: "TRIGGER_GUIDE",
tipIds
};
}
function dismissTip(id) {
return {
type: "DISMISS_TIP",
id
};
}
function disableTips() {
return {
type: "DISABLE_TIPS"
};
}
function enableTips() {
return {
type: "ENABLE_TIPS"
};
}
;// ./node_modules/@wordpress/nux/build-module/store/selectors.js
const getAssociatedGuide = (0,external_wp_data_namespaceObject.createSelector)(
(state, tipId) => {
for (const tipIds of state.guides) {
if (tipIds.includes(tipId)) {
const nonDismissedTips = tipIds.filter(
(tId) => !Object.keys(
state.preferences.dismissedTips
).includes(tId)
);
const [currentTipId = null, nextTipId = null] = nonDismissedTips;
return { tipIds, currentTipId, nextTipId };
}
}
return null;
},
(state) => [state.guides, state.preferences.dismissedTips]
);
function isTipVisible(state, tipId) {
if (!state.preferences.areTipsEnabled) {
return false;
}
if (state.preferences.dismissedTips?.hasOwnProperty(tipId)) {
return false;
}
const associatedGuide = getAssociatedGuide(state, tipId);
if (associatedGuide && associatedGuide.currentTipId !== tipId) {
return false;
}
return true;
}
function selectors_areTipsEnabled(state) {
return state.preferences.areTipsEnabled;
}
;// ./node_modules/@wordpress/nux/build-module/store/index.js
const STORE_NAME = "core/nux";
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
reducer: reducer_default,
actions: actions_namespaceObject,
selectors: selectors_namespaceObject,
persist: ["preferences"]
});
(0,external_wp_data_namespaceObject.registerStore)(STORE_NAME, {
reducer: reducer_default,
actions: actions_namespaceObject,
selectors: selectors_namespaceObject,
persist: ["preferences"]
});
;// external "ReactJSXRuntime"
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
;// external ["wp","compose"]
const external_wp_compose_namespaceObject = window["wp"]["compose"];
;// external ["wp","components"]
const external_wp_components_namespaceObject = window["wp"]["components"];
;// external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// external ["wp","primitives"]
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
;// ./node_modules/@wordpress/icons/build-module/library/close.js
var close_default = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" }) });
;// ./node_modules/@wordpress/nux/build-module/components/dot-tip/index.js
function onClick(event) {
event.stopPropagation();
}
function DotTip({
position = "middle right",
children,
isVisible,
hasNextTip,
onDismiss,
onDisable
}) {
const anchorParent = (0,external_wp_element_namespaceObject.useRef)(null);
const onFocusOutsideCallback = (0,external_wp_element_namespaceObject.useCallback)(
(event) => {
if (!anchorParent.current) {
return;
}
if (anchorParent.current.contains(event.relatedTarget)) {
return;
}
onDisable();
},
[onDisable, anchorParent]
);
if (!isVisible) {
return null;
}
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(
external_wp_components_namespaceObject.Popover,
{
className: "nux-dot-tip",
position,
focusOnMount: true,
role: "dialog",
"aria-label": (0,external_wp_i18n_namespaceObject.__)("Editor tips"),
onClick,
onFocusOutside: onFocusOutsideCallback,
children: [
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
__next40pxDefaultSize: true,
variant: "link",
onClick: onDismiss,
children: hasNextTip ? (0,external_wp_i18n_namespaceObject.__)("See next tip") : (0,external_wp_i18n_namespaceObject.__)("Got it")
}
) }),
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
external_wp_components_namespaceObject.Button,
{
size: "small",
className: "nux-dot-tip__disable",
icon: close_default,
label: (0,external_wp_i18n_namespaceObject.__)("Disable tips"),
onClick: onDisable
}
)
]
}
);
}
var dot_tip_default = (0,external_wp_compose_namespaceObject.compose)(
(0,external_wp_data_namespaceObject.withSelect)((select, { tipId }) => {
const { isTipVisible, getAssociatedGuide } = select(store);
const associatedGuide = getAssociatedGuide(tipId);
return {
isVisible: isTipVisible(tipId),
hasNextTip: !!(associatedGuide && associatedGuide.nextTipId)
};
}),
(0,external_wp_data_namespaceObject.withDispatch)((dispatch, { tipId }) => {
const { dismissTip, disableTips } = dispatch(store);
return {
onDismiss() {
dismissTip(tipId);
},
onDisable() {
disableTips();
}
};
})
)(DotTip);
;// ./node_modules/@wordpress/nux/build-module/index.js
external_wp_deprecated_default()("wp.nux", {
since: "5.4",
hint: "wp.components.Guide can be used to show a user guide.",
version: "6.2"
});
(window.wp = window.wp || {}).nux = __webpack_exports__;
/******/ })()
; script-modules/interactivity/index.js 0000644 00000254112 15144410747 0014075 0 ustar 00 /******/ var __webpack_modules__ = ({
/***/ 622:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Ob: () => (/* binding */ K),
/* harmony export */ Qv: () => (/* binding */ J),
/* harmony export */ XX: () => (/* binding */ G),
/* harmony export */ fF: () => (/* binding */ l),
/* harmony export */ h: () => (/* binding */ _),
/* harmony export */ q6: () => (/* binding */ Q),
/* harmony export */ uA: () => (/* binding */ x),
/* harmony export */ zO: () => (/* binding */ t)
/* harmony export */ });
/* unused harmony exports Fragment, createElement, createRef, toChildArray */
var n,l,u,t,i,r,o,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?S(n):null}function C(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!$.__r++||r!=l.debounceRendering)&&((r=l.debounceRendering)||o)($)}function $(){for(var n,u,t,r,o,f,c,s=1;i.length;)i.length>s&&i.sort(e),n=i.shift(),s=i.length,n.__d&&(t=void 0,r=void 0,o=(r=(u=n).__v).__e,f=[],c=[],u.__P&&((t=d({},r)).__v=r.__v+1,l.vnode&&l.vnode(t),O(u.__P,t,r,u.__n,u.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),t.__v=r.__v,t.__.__k[t.__i]=t,N(f,t,c),r.__e=r.__=null,t.__e!=o&&C(t)));$.__r=0}function I(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,w,d,g,_,m=t&&t.__k||v,b=l.length;for(f=P(u,l,m,f,b),a=0;a<b;a++)null!=(y=u.__k[a])&&(h=-1==y.__i?p:m[y.__i]||p,y.__i=a,g=O(n,y,h,i,r,o,e,f,c,s),w=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&B(h.ref,null,y),s.push(y.ref,y.__c||w,y)),null==d&&null!=w&&(d=w),(_=!!(4&y.__u))||h.__k===y.__k?f=A(y,f,n,_):"function"==typeof y.type&&void 0!==g?f=g:w&&(f=w.nextSibling),y.__u&=-7);return u.__e=d,f}function P(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?(f=r+h,(o=n.__k[r]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):w(o)?m(k,{children:o},null,null,null):null==o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=S(e)),D(e,e));return t}function A(n,l,u,t){var i,r;if("function"==typeof n.type){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,l=A(i[r],l,u,t));return l}n.__e!=l&&(t&&(l&&n.type&&!l.parentNode&&(l=S(n)),u.insertBefore(n.__e,l||null)),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8==l.nodeType);return l}function H(n,l){return l=l||[],null==n||"boolean"==typeof n||(w(n)?n.some(function(n){H(n,l)}):l.push(n)),l}function L(n,l,u,t){var i,r,o,e=n.key,f=n.type,c=l[u],s=null!=c&&0==(2&c.__u);if(null===c&&null==n.key||s&&e==c.key&&f==c.type)return u;if(t>(s?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[o=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return-1}function T(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y.test(l)?u:u+"px"}function j(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||T(n.style,l,u[l])}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c,n.addEventListener(l,r?a:s,r)):n.removeEventListener(l,r?a:s,r);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u))}}function F(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c++;else if(u.t<t.u)return;return t(l.event?l.event(u):u)}}}function O(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=u.type;if(null!=u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(S?u.__c=h=new j(b,M):(u.__c=h=new x(b,M),h.constructor=j,h.render=E),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v==t.__v){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u)}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_)})}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[]}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=d(d({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k&&null==a.key&&(L=V(a.props.children)),f=I(n,w(L)?L:[L],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null)}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f}else{for(T=o.length;T--;)g(o[T]);z(u)}else u.__e=t.__e,u.__k=t.__k,n.then||z(u);l.__e(n,u,t)}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=q(t.__e,u,t,i,r,o,e,c,s);return(a=l.diffed)&&a(u),128&u.__u?void 0:f}function z(n){n&&n.__c&&(n.__c.__e=!0),n&&n.__k&&n.__k.forEach(z)}function N(n,u,t){for(var i=0;i<t.length;i++)B(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function V(n){return"object"!=typeof n||null==n||n.__b&&n.__b>0?n:w(n)?n.map(V):d({},n)}function q(u,t,i,r,o,e,f,c,s){var a,h,v,y,d,_,m,b=i.props,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((d=e[a])&&"setAttribute"in d==!!x&&(x?d.localName==x:3==d.nodeType)){u=d,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l.__m&&l.__m(t,e),c=!1),e=null}if(null==x)b===k||c&&u.data==k||(u.data=k);else{if(e=e&&n.call(u.childNodes),b=i.props||p,!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(d=u.attributes[a]).name]=d.value;for(a in b)if(d=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=d;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j(u,a,null,d,o)}for(a in k)d=k[a],"children"==a?y=d:"dangerouslySetInnerHTML"==a?h=d:"value"==a?_=d:"checked"==a?m=d:c&&"function"!=typeof d||b[a]===d||j(u,a,d,b[a],o);if(h)c||v&&(h.__html==v.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),I("template"==t.type?u.content:u,w(y)?y:[y],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g(e[a]);c||(a="value","progress"==x&&null==_?u.removeAttribute("value"):null!=_&&(_!==u[a]||"progress"==x&&!_||"option"==x&&_!=b[a])&&j(u,a,_,b[a],o),a="checked",null!=m&&m!=u[a]&&j(u,a,m,b[a],o))}return u}function B(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u))}else n.current=u}catch(n){l.__e(n,t)}}function D(n,u,t){var i,r;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||B(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&D(i[r],u,t||"function"!=typeof n.type);t||g(n.__e),n.__c=n.__=n.__e=void 0}function E(n,l,u){return this.constructor(n,u)}function G(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l.__&&l.__(u,t),o=(r="function"==typeof i)?null:i&&i.__k||t.__k,e=[],f=[],O(t,u=(!r&&i||t).__k=_(k,null,[u]),o||p,p,t.namespaceURI,!r&&i?[i]:o?null:t.firstChild?n.call(t.childNodes):null,e,!r&&i?i:o?o.__e:t.firstChild,r,f),N(e,u,f)}function J(n,l){G(n,l,J)}function K(l,u,t){var i,r,o,e,f=d({},l.props);for(o in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)"key"==o?i=u[o]:"ref"==o?r=u[o]:f[o]=void 0===u[o]&&null!=e?e[o]:u[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,r||l.ref,null)}function Q(n){function l(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l.__c]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&u.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}return l.__c="__cC"+h++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n=v.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},$.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=F(!1),a=F(!0),h=0;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/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__ = {};
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
zj: () => (/* reexport */ getConfig),
SD: () => (/* reexport */ getContext),
V6: () => (/* reexport */ getElement),
$K: () => (/* reexport */ getServerContext),
vT: () => (/* reexport */ getServerState),
jb: () => (/* binding */ privateApis),
yT: () => (/* reexport */ splitTask),
M_: () => (/* reexport */ store),
hb: () => (/* reexport */ useCallback),
vJ: () => (/* reexport */ useEffect),
ip: () => (/* reexport */ useInit),
Nf: () => (/* reexport */ useLayoutEffect),
Kr: () => (/* reexport */ useMemo),
li: () => (/* reexport */ A),
J0: () => (/* reexport */ d),
FH: () => (/* reexport */ useWatch),
v4: () => (/* reexport */ withScope),
mh: () => (/* reexport */ withSyncEvent)
});
// EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js
var preact_module = __webpack_require__(622);
;// ./node_modules/preact/hooks/dist/hooks.module.js
var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function p(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return hooks_module_o=1,h(D,n)}function h(n,u,i){var o=p(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,r)||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=p(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i))}function _(n,u){var i=p(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){if("function"==typeof n){var r=n(t());return function(){n(null),r&&"function"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))}function T(n,r){var u=p(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=p(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=p(hooks_module_t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=p(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t}
;// ./node_modules/@preact/signals-core/dist/signals-core.module.js
var signals_core_module_i=Symbol.for("preact-signals");function signals_core_module_t(){if(!(signals_core_module_s>1)){var i,t=!1;while(void 0!==signals_core_module_h){var r=signals_core_module_h;signals_core_module_h=void 0;signals_core_module_f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&signals_core_module_c(r))try{r.c()}catch(r){if(!t){i=r;t=!0}}r=o}}signals_core_module_f=0;signals_core_module_s--;if(t)throw i}else signals_core_module_s--}function signals_core_module_r(i){if(signals_core_module_s>0)return i();signals_core_module_s++;try{return i()}finally{signals_core_module_t()}}var signals_core_module_o=void 0;function n(i){var t=signals_core_module_o;signals_core_module_o=void 0;try{return i()}finally{signals_core_module_o=t}}var signals_core_module_h=void 0,signals_core_module_s=0,signals_core_module_f=0,signals_core_module_v=0;function signals_core_module_e(i){if(void 0!==signals_core_module_o){var t=i.n;if(void 0===t||t.t!==signals_core_module_o){t={i:0,S:i,p:signals_core_module_o.s,n:void 0,t:signals_core_module_o,e:void 0,x:void 0,r:t};if(void 0!==signals_core_module_o.s)signals_core_module_o.s.n=t;signals_core_module_o.s=t;i.n=t;if(32&signals_core_module_o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=signals_core_module_o.s;t.n=void 0;signals_core_module_o.s.n=t;signals_core_module_o.s=t}return t}}}function signals_core_module_u(i,t){this.v=i;this.i=0;this.n=void 0;this.t=void 0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}signals_core_module_u.prototype.brand=signals_core_module_i;signals_core_module_u.prototype.h=function(){return!0};signals_core_module_u.prototype.S=function(i){var t=this,r=this.t;if(r!==i&&void 0===i.e){i.x=r;this.t=i;if(void 0!==r)r.e=i;else n(function(){var i;null==(i=t.W)||i.call(t)})}};signals_core_module_u.prototype.U=function(i){var t=this;if(void 0!==this.t){var r=i.e,o=i.x;if(void 0!==r){r.x=o;i.e=void 0}if(void 0!==o){o.e=r;i.x=void 0}if(i===this.t){this.t=o;if(void 0===o)n(function(){var i;null==(i=t.Z)||i.call(t)})}}};signals_core_module_u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=signals_core_module_o;signals_core_module_o=void 0;try{i(r)}finally{signals_core_module_o=n}},{name:"sub"})};signals_core_module_u.prototype.valueOf=function(){return this.value};signals_core_module_u.prototype.toString=function(){return this.value+""};signals_core_module_u.prototype.toJSON=function(){return this.value};signals_core_module_u.prototype.peek=function(){var i=signals_core_module_o;signals_core_module_o=void 0;try{return this.value}finally{signals_core_module_o=i}};Object.defineProperty(signals_core_module_u.prototype,"value",{get:function(){var i=signals_core_module_e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(signals_core_module_f>100)throw new Error("Cycle detected");this.v=i;this.i++;signals_core_module_v++;signals_core_module_s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N()}finally{signals_core_module_t()}}}});function signals_core_module_d(i,t){return new signals_core_module_u(i,t)}function signals_core_module_c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function signals_core_module_a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function signals_core_module_l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=r}function signals_core_module_y(i,t){signals_core_module_u.call(this,void 0);this.x=i;this.s=void 0;this.g=signals_core_module_v-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}signals_core_module_y.prototype=new signals_core_module_u;signals_core_module_y.prototype.h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===signals_core_module_v)return!0;this.g=signals_core_module_v;this.f|=1;if(this.i>0&&!signals_core_module_c(this)){this.f&=-2;return!0}var i=signals_core_module_o;try{signals_core_module_a(this);signals_core_module_o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}signals_core_module_o=i;signals_core_module_l(this);this.f&=-2;return!0};signals_core_module_y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_u.prototype.S.call(this,i)};signals_core_module_y.prototype.U=function(i){if(void 0!==this.t){signals_core_module_u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};signals_core_module_y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(signals_core_module_y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=signals_core_module_e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function signals_core_module_w(i,t){return new signals_core_module_y(i,t)}function signals_core_module_(i){var r=i.u;i.u=void 0;if("function"==typeof r){signals_core_module_s++;var n=signals_core_module_o;signals_core_module_o=void 0;try{r()}catch(t){i.f&=-2;i.f|=8;signals_core_module_b(i);throw t}finally{signals_core_module_o=n;signals_core_module_t()}}}function signals_core_module_b(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;signals_core_module_(i)}function signals_core_module_g(i){if(signals_core_module_o!==this)throw new Error("Out-of-order effect");signals_core_module_l(this);signals_core_module_o=i;this.f&=-2;if(8&this.f)signals_core_module_b(this);signals_core_module_t()}function signals_core_module_p(i,t){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;this.name=null==t?void 0:t.name}signals_core_module_p.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{i()}};signals_core_module_p.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;signals_core_module_(this);signals_core_module_a(this);signals_core_module_s++;var i=signals_core_module_o;signals_core_module_o=this;return signals_core_module_g.bind(this,i)};signals_core_module_p.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=signals_core_module_h;signals_core_module_h=this}};signals_core_module_p.prototype.d=function(){this.f|=8;if(!(1&this.f))signals_core_module_b(this)};signals_core_module_p.prototype.dispose=function(){this.d()};function E(i,t){var r=new signals_core_module_p(i,t);try{r.c()}catch(i){r.d();throw i}var o=r.d.bind(r);o[Symbol.dispose]=o;return o}
;// ./node_modules/@preact/signals/dist/signals.module.js
var signals_module_v,signals_module_s;function signals_module_l(i,n){preact_module/* options */.fF[i]=n.bind(null,preact_module/* options */.fF[i]||function(){})}function signals_module_d(i){if(signals_module_s)signals_module_s();signals_module_s=i&&i.S()}function signals_module_h(i){var r=this,f=i.data,o=useSignal(f);o.value=f;var e=T(function(){var i=r.__v;while(i=i.__)if(i.__c){i.__c.__$f|=4;break}r.__$u.c=function(){var i,t=r.__$u.S(),f=e.value;t();if((0,preact_module/* isValidElement */.zO)(f)||3!==(null==(i=r.base)?void 0:i.nodeType)){r.__$f|=1;r.setState({})}else r.base.data=f};return signals_core_module_w(function(){var i=o.value.value;return 0===i?0:!0===i?"":i||""})},[]);return e.value}signals_module_h.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_h},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(i,r){if("string"==typeof r.type){var n,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!n)r.__np=n={};n[f]=o;t[f]=o.peek()}}}i(r)});signals_module_l("__r",function(i,r){signals_module_d();var n,t=r.__c;if(t){t.__$f&=-2;if(void 0===(n=t.__$u))t.__$u=n=function(i){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(n);i(r)});signals_module_l("__e",function(i,r,n,t){signals_module_d();signals_module_v=void 0;i(r,n,t)});signals_module_l("diffed",function(i,r){signals_module_d();signals_module_v=void 0;var n;if("string"==typeof r.type&&(n=r.__e)){var t=r.__np,f=r.props;if(t){var o=n.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else n.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_p(n,a,s,f);o[a]=c}else c.o(s,f)}}}i(r)});function signals_module_p(i,r,n,t){var f=r in i&&void 0===i.ownerSVGElement,o=signals_core_module_d(n);return{o:function(i,r){o.value=i;t=r},d:E(function(){var n=o.value.value;if(t[r]!==n){t[r]=n;if(f)i[r]=n;else if(n)i.setAttribute(r,n);else i.removeAttribute(r)}})}}signals_module_l("unmount",function(i,r){if("string"==typeof r.type){var n=r.__e;if(n){var t=n.U;if(t){n.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}i(r)});signals_module_l("__h",function(i,r,n,t){if(t<3||9===t)r.__$f|=2;i(r,n,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(i,r){var n=this.__$u,t=n&&void 0!==n.s;for(var f in r)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(t||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(t||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var o in i)if("__source"!==o&&i[o]!==this.props[o])return!0;for(var e in this.props)if(!(e in i))return!0;return!1};function useSignal(i){return T(function(){return signals_core_module_d(i)},[])}function useComputed(i){var r=f(i);r.current=i;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(i){var r=f(i);r.current=i;o(function(){return c(function(){return r.current()})},[])}
;// ./node_modules/@wordpress/interactivity/build-module/namespaces.js
const namespaceStack = [];
const getNamespace = () => namespaceStack.slice(-1)[0];
const setNamespace = (namespace) => {
namespaceStack.push(namespace);
};
const resetNamespace = () => {
namespaceStack.pop();
};
;// ./node_modules/@wordpress/interactivity/build-module/scopes.js
const scopeStack = [];
const getScope = () => scopeStack.slice(-1)[0];
const setScope = (scope) => {
scopeStack.push(scope);
};
const resetScope = () => {
scopeStack.pop();
};
const throwNotInScope = (method) => {
throw Error(
`Cannot call \`${method}()\` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like \`setTimeout\`, please wrap the callback with \`withScope(callback)\`.`
);
};
const getContext = (namespace) => {
const scope = getScope();
if (true) {
if (!scope) {
throwNotInScope("getContext");
}
}
return scope.context[namespace || getNamespace()];
};
const getElement = () => {
const scope = getScope();
let deepReadOnlyOptions = {};
if (true) {
if (!scope) {
throwNotInScope("getElement");
}
deepReadOnlyOptions = {
errorMessage: "Don't mutate the attributes from `getElement`, use `data-wp-bind` to modify the attributes of an element instead."
};
}
const { ref, attributes } = scope;
return Object.freeze({
ref: ref.current,
attributes: deepReadOnly(attributes, deepReadOnlyOptions)
});
};
const navigationContextSignal = signals_core_module_d(0);
function getServerContext(namespace) {
const scope = getScope();
if (true) {
if (!scope) {
throwNotInScope("getServerContext");
}
}
getServerContext.subscribe = navigationContextSignal.value;
return deepClone(scope.serverContext[namespace || getNamespace()]);
}
getServerContext.subscribe = 0;
;// ./node_modules/@wordpress/interactivity/build-module/utils.js
const afterNextFrame = (callback) => {
return new Promise((resolve) => {
const done = () => {
clearTimeout(timeout);
window.cancelAnimationFrame(raf);
setTimeout(() => {
callback();
resolve();
});
};
const timeout = setTimeout(done, 100);
const raf = window.requestAnimationFrame(done);
});
};
const splitTask = typeof window.scheduler?.yield === "function" ? window.scheduler.yield.bind(window.scheduler) : () => {
return new Promise((resolve) => {
setTimeout(resolve, 0);
});
};
function createFlusher(compute, notify) {
let flush = () => void 0;
const dispose = E(function() {
flush = this.c.bind(this);
this.x = compute;
this.c = notify;
return compute();
});
return { flush, dispose };
}
function utils_useSignalEffect(callback) {
y(() => {
let eff = null;
let isExecuting = false;
const notify = async () => {
if (eff && !isExecuting) {
isExecuting = true;
await afterNextFrame(eff.flush);
isExecuting = false;
}
};
eff = createFlusher(callback, notify);
return eff.dispose;
}, []);
}
function withScope(func) {
const scope = getScope();
const ns = getNamespace();
let wrapped;
if (func?.constructor?.name === "GeneratorFunction") {
wrapped = async (...args) => {
const gen = func(...args);
let value;
let it;
let error;
while (true) {
setNamespace(ns);
setScope(scope);
try {
it = error ? gen.throw(error) : gen.next(value);
error = void 0;
} catch (e) {
throw e;
} finally {
resetScope();
resetNamespace();
}
try {
value = await it.value;
} catch (e) {
error = e;
}
if (it.done) {
if (error) {
throw error;
} else {
break;
}
}
}
return value;
};
} else {
wrapped = (...args) => {
setNamespace(ns);
setScope(scope);
try {
return func(...args);
} finally {
resetNamespace();
resetScope();
}
};
}
const syncAware = func;
if (syncAware.sync) {
const syncAwareWrapped = wrapped;
syncAwareWrapped.sync = true;
return syncAwareWrapped;
}
return wrapped;
}
function useWatch(callback) {
utils_useSignalEffect(withScope(callback));
}
function useInit(callback) {
y(withScope(callback), []);
}
function useEffect(callback, inputs) {
y(withScope(callback), inputs);
}
function useLayoutEffect(callback, inputs) {
_(withScope(callback), inputs);
}
function useCallback(callback, inputs) {
return q(withScope(callback), inputs);
}
function useMemo(factory, inputs) {
return T(withScope(factory), inputs);
}
const createRootFragment = (parent, replaceNode) => {
replaceNode = [].concat(replaceNode);
const sibling = replaceNode[replaceNode.length - 1].nextSibling;
function insert(child, root) {
parent.insertBefore(child, root || sibling);
}
return parent.__k = {
nodeType: 1,
parentNode: parent,
firstChild: replaceNode[0],
childNodes: replaceNode,
insertBefore: insert,
appendChild: insert,
removeChild(c) {
parent.removeChild(c);
},
contains(c) {
parent.contains(c);
}
};
};
function kebabToCamelCase(str) {
return str.replace(/^-+|-+$/g, "").toLowerCase().replace(/-([a-z])/g, function(_match, group1) {
return group1.toUpperCase();
});
}
const logged = /* @__PURE__ */ new Set();
const warn = (message) => {
if (true) {
if (logged.has(message)) {
return;
}
console.warn(message);
try {
throw Error(message);
} catch (e) {
}
logged.add(message);
}
};
const isPlainObject = (candidate) => Boolean(
candidate && typeof candidate === "object" && candidate.constructor === Object
);
function withSyncEvent(callback) {
const syncAware = callback;
syncAware.sync = true;
return syncAware;
}
const readOnlyMap = /* @__PURE__ */ new WeakMap();
const createDeepReadOnlyHandlers = (errorMessage) => {
const handleError = () => {
if (true) {
warn(errorMessage);
}
return false;
};
return {
get(target, prop) {
const value = target[prop];
if (value && typeof value === "object") {
return deepReadOnly(value, { errorMessage });
}
return value;
},
set: handleError,
deleteProperty: handleError,
defineProperty: handleError
};
};
function deepReadOnly(obj, options) {
const errorMessage = options?.errorMessage ?? "Cannot modify read-only object";
if (!readOnlyMap.has(obj)) {
const handlers = createDeepReadOnlyHandlers(errorMessage);
readOnlyMap.set(obj, new Proxy(obj, handlers));
}
return readOnlyMap.get(obj);
}
const navigationSignal = signals_core_module_d(0);
function deepClone(source) {
if (isPlainObject(source)) {
return Object.fromEntries(
Object.entries(source).map(([key, value]) => [
key,
deepClone(value)
])
);
}
if (Array.isArray(source)) {
return source.map((i) => deepClone(i));
}
return source;
}
;// ./node_modules/@wordpress/interactivity/build-module/proxies/registry.js
const objToProxy = /* @__PURE__ */ new WeakMap();
const proxyToObj = /* @__PURE__ */ new WeakMap();
const proxyToNs = /* @__PURE__ */ new WeakMap();
const supported = /* @__PURE__ */ new Set([Object, Array]);
const createProxy = (namespace, obj, handlers) => {
if (!shouldProxy(obj)) {
throw Error("This object cannot be proxified.");
}
if (!objToProxy.has(obj)) {
const proxy = new Proxy(obj, handlers);
objToProxy.set(obj, proxy);
proxyToObj.set(proxy, obj);
proxyToNs.set(proxy, namespace);
}
return objToProxy.get(obj);
};
const getProxyFromObject = (obj) => objToProxy.get(obj);
const getNamespaceFromProxy = (proxy) => proxyToNs.get(proxy);
const shouldProxy = (candidate) => {
if (typeof candidate !== "object" || candidate === null) {
return false;
}
return !proxyToNs.has(candidate) && supported.has(candidate.constructor);
};
const getObjectFromProxy = (proxy) => proxyToObj.get(proxy);
;// ./node_modules/@wordpress/interactivity/build-module/proxies/signals.js
const NO_SCOPE = {};
class PropSignal {
/**
* Proxy that holds the property this PropSignal is associated with.
*/
owner;
/**
* Relation of computeds by scope. These computeds are read-only signals
* that depend on whether the property is a value or a getter and,
* therefore, can return different values depending on the scope in which
* the getter is accessed.
*/
computedsByScope;
/**
* Signal with the value assigned to the related property.
*/
valueSignal;
/**
* Signal with the getter assigned to the related property.
*/
getterSignal;
/**
* Pending getter to be consolidated.
*/
pendingGetter;
/**
* Structure that manages reactivity for a property in a state object, using
* signals to keep track of property value or getter modifications.
*
* @param owner Proxy that holds the property this instance is associated
* with.
*/
constructor(owner) {
this.owner = owner;
this.computedsByScope = /* @__PURE__ */ new WeakMap();
}
/**
* Changes the internal value. If a getter was set before, it is set to
* `undefined`.
*
* @param value New value.
*/
setValue(value) {
this.update({ value });
}
/**
* Changes the internal getter. If a value was set before, it is set to
* `undefined`.
*
* @param getter New getter.
*/
setGetter(getter) {
this.update({ get: getter });
}
/**
* Changes the internal getter asynchronously.
*
* The update is made in a microtask, which prevents issues with getters
* accessing the state, and ensures the update occurs before any render.
*
* @param getter New getter.
*/
setPendingGetter(getter) {
this.pendingGetter = getter;
queueMicrotask(() => this.consolidateGetter());
}
/**
* Consolidate the pending value of the getter.
*/
consolidateGetter() {
const getter = this.pendingGetter;
if (getter) {
this.pendingGetter = void 0;
this.update({ get: getter });
}
}
/**
* Returns the computed that holds the result of evaluating the prop in the
* current scope.
*
* These computeds are read-only signals that depend on whether the property
* is a value or a getter and, therefore, can return different values
* depending on the scope in which the getter is accessed.
*
* @return Computed that depends on the scope.
*/
getComputed() {
const scope = getScope() || NO_SCOPE;
if (!this.valueSignal && !this.getterSignal) {
this.update({});
}
if (this.pendingGetter) {
this.consolidateGetter();
}
if (!this.computedsByScope.has(scope)) {
const callback = () => {
const getter = this.getterSignal?.value;
return getter ? getter.call(this.owner) : this.valueSignal?.value;
};
setNamespace(getNamespaceFromProxy(this.owner));
this.computedsByScope.set(
scope,
signals_core_module_w(withScope(callback))
);
resetNamespace();
}
return this.computedsByScope.get(scope);
}
/**
* Updates the internal signals for the value and the getter of the
* corresponding prop.
*
* @param param0
* @param param0.get New getter.
* @param param0.value New value.
*/
update({ get, value }) {
if (!this.valueSignal) {
this.valueSignal = signals_core_module_d(value);
this.getterSignal = signals_core_module_d(get);
} else if (value !== this.valueSignal.peek() || get !== this.getterSignal.peek()) {
signals_core_module_r(() => {
this.valueSignal.value = value;
this.getterSignal.value = get;
});
}
}
}
;// ./node_modules/@wordpress/interactivity/build-module/proxies/state.js
const wellKnownSymbols = new Set(
Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter((value) => typeof value === "symbol")
);
const proxyToProps = /* @__PURE__ */ new WeakMap();
const hasPropSignal = (proxy, key) => proxyToProps.has(proxy) && proxyToProps.get(proxy).has(key);
const getPropSignal = (proxy, key, initial) => {
if (!proxyToProps.has(proxy)) {
proxyToProps.set(proxy, /* @__PURE__ */ new Map());
}
key = typeof key === "number" ? `${key}` : key;
const props = proxyToProps.get(proxy);
if (!props.has(key)) {
const ns = getNamespaceFromProxy(proxy);
const prop = new PropSignal(proxy);
props.set(key, prop);
if (initial) {
const { get, value } = initial;
if (get) {
prop.setGetter(get);
} else {
prop.setValue(
shouldProxy(value) ? proxifyState(ns, value) : value
);
}
}
}
return props.get(key);
};
const objToIterable = /* @__PURE__ */ new WeakMap();
let peeking = false;
const PENDING_GETTER = Symbol("PENDING_GETTER");
const stateHandlers = {
get(target, key, receiver) {
if (peeking || !target.hasOwnProperty(key) && key in target || typeof key === "symbol" && wellKnownSymbols.has(key)) {
return Reflect.get(target, key, receiver);
}
const desc = Object.getOwnPropertyDescriptor(target, key);
const prop = getPropSignal(receiver, key, desc);
const result = prop.getComputed().value;
if (result === PENDING_GETTER) {
throw PENDING_GETTER;
}
if (typeof result === "function") {
const ns = getNamespaceFromProxy(receiver);
return (...args) => {
setNamespace(ns);
try {
return result.call(receiver, ...args);
} finally {
resetNamespace();
}
};
}
return result;
},
set(target, key, value, receiver) {
setNamespace(getNamespaceFromProxy(receiver));
try {
return Reflect.set(target, key, value, receiver);
} finally {
resetNamespace();
}
},
defineProperty(target, key, desc) {
const isNew = !(key in target);
const result = Reflect.defineProperty(target, key, desc);
if (result) {
const receiver = getProxyFromObject(target);
const prop = getPropSignal(receiver, key);
const { get, value } = desc;
if (get) {
prop.setGetter(get);
} else {
const ns = getNamespaceFromProxy(receiver);
prop.setValue(
shouldProxy(value) ? proxifyState(ns, value) : value
);
}
if (isNew && objToIterable.has(target)) {
objToIterable.get(target).value++;
}
if (Array.isArray(target) && proxyToProps.get(receiver)?.has("length")) {
const length = getPropSignal(receiver, "length");
length.setValue(target.length);
}
}
return result;
},
deleteProperty(target, key) {
const result = Reflect.deleteProperty(target, key);
if (result) {
const prop = getPropSignal(getProxyFromObject(target), key);
prop.setValue(void 0);
if (objToIterable.has(target)) {
objToIterable.get(target).value++;
}
}
return result;
},
ownKeys(target) {
if (!objToIterable.has(target)) {
objToIterable.set(target, signals_core_module_d(0));
}
objToIterable._ = objToIterable.get(target).value;
return Reflect.ownKeys(target);
}
};
const proxifyState = (namespace, obj) => {
return createProxy(namespace, obj, stateHandlers);
};
const peek = (obj, key) => {
peeking = true;
try {
return obj[key];
} finally {
peeking = false;
}
};
const deepMergeRecursive = (target, source, override = true) => {
if (!(isPlainObject(target) && isPlainObject(source))) {
return;
}
let hasNewKeys = false;
for (const key in source) {
const isNew = !(key in target);
hasNewKeys = hasNewKeys || isNew;
const desc = Object.getOwnPropertyDescriptor(source, key);
const proxy = getProxyFromObject(target);
const propSignal = !!proxy && hasPropSignal(proxy, key) && getPropSignal(proxy, key);
if (typeof desc.get === "function" || typeof desc.set === "function") {
if (override || isNew) {
Object.defineProperty(target, key, {
...desc,
configurable: true,
enumerable: true
});
if (desc.get && propSignal) {
propSignal.setPendingGetter(desc.get);
}
}
} else if (isPlainObject(source[key])) {
const targetValue = Object.getOwnPropertyDescriptor(target, key)?.value;
if (isNew || override && !isPlainObject(targetValue)) {
target[key] = {};
if (propSignal) {
const ns = getNamespaceFromProxy(proxy);
propSignal.setValue(
proxifyState(ns, target[key])
);
}
deepMergeRecursive(target[key], source[key], override);
} else if (isPlainObject(targetValue)) {
deepMergeRecursive(target[key], source[key], override);
}
} else if (override || isNew) {
Object.defineProperty(target, key, desc);
if (propSignal) {
const { value } = desc;
const ns = getNamespaceFromProxy(proxy);
propSignal.setValue(
shouldProxy(value) ? proxifyState(ns, value) : value
);
}
}
}
if (hasNewKeys && objToIterable.has(target)) {
objToIterable.get(target).value++;
}
};
const deepMerge = (target, source, override = true) => signals_core_module_r(
() => deepMergeRecursive(
getObjectFromProxy(target) || target,
source,
override
)
);
;// ./node_modules/@wordpress/interactivity/build-module/proxies/store.js
const storeRoots = /* @__PURE__ */ new WeakSet();
const storeHandlers = {
get: (target, key, receiver) => {
const result = Reflect.get(target, key);
const ns = getNamespaceFromProxy(receiver);
if (typeof result === "undefined" && storeRoots.has(receiver)) {
const obj = {};
Reflect.set(target, key, obj);
return proxifyStore(ns, obj, false);
}
if (typeof result === "function") {
setNamespace(ns);
const scoped = withScope(result);
resetNamespace();
return scoped;
}
if (isPlainObject(result) && shouldProxy(result)) {
return proxifyStore(ns, result, false);
}
return result;
}
};
const proxifyStore = (namespace, obj, isRoot = true) => {
const proxy = createProxy(namespace, obj, storeHandlers);
if (proxy && isRoot) {
storeRoots.add(proxy);
}
return proxy;
};
;// ./node_modules/@wordpress/interactivity/build-module/proxies/context.js
const contextObjectToProxy = /* @__PURE__ */ new WeakMap();
const contextObjectToFallback = /* @__PURE__ */ new WeakMap();
const contextProxies = /* @__PURE__ */ new WeakSet();
const descriptor = Reflect.getOwnPropertyDescriptor;
const contextHandlers = {
get: (target, key) => {
const fallback = contextObjectToFallback.get(target);
const currentProp = target[key];
return key in target ? currentProp : fallback[key];
},
set: (target, key, value) => {
const fallback = contextObjectToFallback.get(target);
const obj = key in target || !(key in fallback) ? target : fallback;
obj[key] = value;
return true;
},
ownKeys: (target) => [
.../* @__PURE__ */ new Set([
...Object.keys(contextObjectToFallback.get(target)),
...Object.keys(target)
])
],
getOwnPropertyDescriptor: (target, key) => descriptor(target, key) || descriptor(contextObjectToFallback.get(target), key),
has: (target, key) => Reflect.has(target, key) || Reflect.has(contextObjectToFallback.get(target), key)
};
const proxifyContext = (current, inherited = {}) => {
if (contextProxies.has(current)) {
throw Error("This object cannot be proxified.");
}
contextObjectToFallback.set(current, inherited);
if (!contextObjectToProxy.has(current)) {
const proxy = new Proxy(current, contextHandlers);
contextObjectToProxy.set(current, proxy);
contextProxies.add(proxy);
}
return contextObjectToProxy.get(current);
};
;// ./node_modules/@wordpress/interactivity/build-module/proxies/index.js
;// ./node_modules/@wordpress/interactivity/build-module/store.js
const stores = /* @__PURE__ */ new Map();
const rawStores = /* @__PURE__ */ new Map();
const storeLocks = /* @__PURE__ */ new Map();
const storeConfigs = /* @__PURE__ */ new Map();
const serverStates = /* @__PURE__ */ new Map();
const getConfig = (namespace) => storeConfigs.get(namespace || getNamespace()) || {};
function getServerState(namespace) {
const ns = namespace || getNamespace();
if (!serverStates.has(ns)) {
serverStates.set(ns, {});
}
getServerState.subscribe = navigationSignal.value;
return deepClone(serverStates.get(ns));
}
getServerState.subscribe = 0;
const universalUnlock = "I acknowledge that using a private store means my plugin will inevitably break on the next store release.";
function store(namespace, { state = {}, ...block } = {}, { lock = false } = {}) {
if (!stores.has(namespace)) {
if (lock !== universalUnlock) {
storeLocks.set(namespace, lock);
}
const rawStore = {
state: proxifyState(
namespace,
isPlainObject(state) ? state : {}
),
...block
};
const proxifiedStore = proxifyStore(namespace, rawStore);
rawStores.set(namespace, rawStore);
stores.set(namespace, proxifiedStore);
} else {
if (lock !== universalUnlock && !storeLocks.has(namespace)) {
storeLocks.set(namespace, lock);
} else {
const storeLock = storeLocks.get(namespace);
const isLockValid = lock === universalUnlock || lock !== true && lock === storeLock;
if (!isLockValid) {
if (!storeLock) {
throw Error("Cannot lock a public store");
} else {
throw Error(
"Cannot unlock a private store with an invalid lock code"
);
}
}
}
const target = rawStores.get(namespace);
deepMerge(target, block);
deepMerge(target.state, state);
}
return stores.get(namespace);
}
const parseServerData = (dom = document) => {
const jsonDataScriptTag = (
// Preferred Script Module data passing form
dom.getElementById(
"wp-script-module-data-@wordpress/interactivity"
) ?? // Legacy form
dom.getElementById("wp-interactivity-data")
);
if (jsonDataScriptTag?.textContent) {
try {
return JSON.parse(jsonDataScriptTag.textContent);
} catch {
}
}
return {};
};
const populateServerData = (data2) => {
serverStates.clear();
storeConfigs.clear();
if (isPlainObject(data2?.state)) {
Object.entries(data2.state).forEach(([namespace, state]) => {
const st = store(namespace, {}, { lock: universalUnlock });
deepMerge(st.state, state, false);
serverStates.set(namespace, state);
});
}
if (isPlainObject(data2?.config)) {
Object.entries(data2.config).forEach(([namespace, config]) => {
storeConfigs.set(namespace, config);
});
}
if (isPlainObject(data2?.derivedStateClosures)) {
Object.entries(data2.derivedStateClosures).forEach(
([namespace, paths]) => {
const st = store(
namespace,
{},
{ lock: universalUnlock }
);
paths.forEach((path) => {
const pathParts = path.split(".");
const prop = pathParts.splice(-1, 1)[0];
const parent = pathParts.reduce(
(prev, key) => peek(prev, key),
st
);
const desc = Object.getOwnPropertyDescriptor(
parent,
prop
);
if (isPlainObject(desc?.value)) {
parent[prop] = PENDING_GETTER;
}
});
}
);
}
};
const data = parseServerData();
populateServerData(data);
;// ./node_modules/@wordpress/interactivity/build-module/hooks.js
function isNonDefaultDirectiveSuffix(entry) {
return entry.suffix !== null;
}
function isDefaultDirectiveSuffix(entry) {
return entry.suffix === null;
}
const context = (0,preact_module/* createContext */.q6)({ client: {}, server: {} });
const directiveCallbacks = {};
const directivePriorities = {};
const directive = (name, callback, { priority = 10 } = {}) => {
directiveCallbacks[name] = callback;
directivePriorities[name] = priority;
};
const resolve = (path, namespace) => {
if (!namespace) {
warn(
`Namespace missing for "${path}". The value for that path won't be resolved.`
);
return;
}
let resolvedStore = stores.get(namespace);
if (typeof resolvedStore === "undefined") {
resolvedStore = store(
namespace,
{},
{
lock: universalUnlock
}
);
}
const current = {
...resolvedStore,
context: getScope().context[namespace]
};
try {
const pathParts = path.split(".");
return pathParts.reduce((acc, key) => acc[key], current);
} catch (e) {
if (e === PENDING_GETTER) {
return PENDING_GETTER;
}
}
};
const getEvaluate = ({ scope }) => (
// TODO: When removing the temporarily remaining `value( ...args )` call below, remove the `...args` parameter too.
(entry, ...args) => {
let { value: path, namespace } = entry;
if (typeof path !== "string") {
throw new Error("The `value` prop should be a string path");
}
const hasNegationOperator = path[0] === "!" && !!(path = path.slice(1));
setScope(scope);
const value = resolve(path, namespace);
if (typeof value === "function") {
if (hasNegationOperator) {
warn(
"Using a function with a negation operator is deprecated and will stop working in WordPress 6.9. Please use derived state instead."
);
const functionResult = !value(...args);
resetScope();
return functionResult;
}
resetScope();
const wrappedFunction = (...functionArgs) => {
setScope(scope);
const functionResult = value(...functionArgs);
resetScope();
return functionResult;
};
if (value.sync) {
const syncAwareFunction = wrappedFunction;
syncAwareFunction.sync = true;
}
return wrappedFunction;
}
const result = value;
resetScope();
return hasNegationOperator && value !== PENDING_GETTER ? !result : result;
}
);
const getPriorityLevels = (directives) => {
const byPriority = Object.keys(directives).reduce((obj, name) => {
if (directiveCallbacks[name]) {
const priority = directivePriorities[name];
(obj[priority] = obj[priority] || []).push(name);
}
return obj;
}, {});
return Object.entries(byPriority).sort(([p1], [p2]) => parseInt(p1) - parseInt(p2)).map(([, arr]) => arr);
};
const Directives = ({
directives,
priorityLevels: [currentPriorityLevel, ...nextPriorityLevels],
element,
originalProps,
previousScope
}) => {
const scope = A({}).current;
scope.evaluate = q(getEvaluate({ scope }), []);
const { client, server } = x(context);
scope.context = client;
scope.serverContext = server;
scope.ref = previousScope?.ref || A(null);
element = (0,preact_module/* cloneElement */.Ob)(element, { ref: scope.ref });
scope.attributes = element.props;
const children = nextPriorityLevels.length > 0 ? (0,preact_module.h)(Directives, {
directives,
priorityLevels: nextPriorityLevels,
element,
originalProps,
previousScope: scope
}) : element;
const props = { ...originalProps, children };
const directiveArgs = {
directives,
props,
element,
context,
evaluate: scope.evaluate
};
setScope(scope);
for (const directiveName of currentPriorityLevel) {
const wrapper = directiveCallbacks[directiveName]?.(directiveArgs);
if (wrapper !== void 0) {
props.children = wrapper;
}
}
resetScope();
return props.children;
};
const old = preact_module/* options */.fF.vnode;
preact_module/* options */.fF.vnode = (vnode) => {
if (vnode.props.__directives) {
const props = vnode.props;
const directives = props.__directives;
if (directives.key) {
vnode.key = directives.key.find(isDefaultDirectiveSuffix).value;
}
delete props.__directives;
const priorityLevels = getPriorityLevels(directives);
if (priorityLevels.length > 0) {
vnode.props = {
directives,
priorityLevels,
originalProps: props,
type: vnode.type,
element: (0,preact_module.h)(vnode.type, props),
top: true
};
vnode.type = Directives;
}
}
if (old) {
old(vnode);
}
};
;// ./node_modules/@wordpress/interactivity/build-module/directives.js
const warnUniqueIdWithTwoHyphens = (prefix, suffix, uniqueId) => {
if (true) {
warn(
`The usage of data-wp-${prefix}--${suffix}${uniqueId ? `--${uniqueId}` : ""} (two hyphens for unique ID) is deprecated and will stop working in WordPress 7.0. Please use data-wp-${prefix}${uniqueId ? `--${suffix}---${uniqueId}` : `---${suffix}`} (three hyphens for unique ID) from now on.`
);
}
};
const warnUniqueIdNotSupported = (prefix, uniqueId) => {
if (true) {
warn(
`Unique IDs are not supported for the data-wp-${prefix} directive. Ignoring the directive with unique ID "${uniqueId}".`
);
}
};
const warnWithSyncEvent = (wrongPrefix, rightPrefix) => {
if (true) {
warn(
`The usage of data-wp-${wrongPrefix} is deprecated and will stop working in WordPress 7.0. Please, use data-wp-${rightPrefix} with the withSyncEvent() helper from now on.`
);
}
};
function wrapEventAsync(event) {
const handler = {
get(target, prop, receiver) {
const value = target[prop];
switch (prop) {
case "currentTarget":
if (true) {
warn(
`Accessing the synchronous event.${prop} property in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 7.0. Please wrap the store action in withSyncEvent().`
);
}
break;
case "preventDefault":
case "stopImmediatePropagation":
case "stopPropagation":
if (true) {
warn(
`Using the synchronous event.${prop}() function in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 7.0. Please wrap the store action in withSyncEvent().`
);
}
break;
}
if (value instanceof Function) {
return function(...args) {
return value.apply(
this === receiver ? target : this,
args
);
};
}
return value;
}
};
return new Proxy(event, handler);
}
const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
const ruleClean = /\/\*[^]*?\*\/| +/g;
const ruleNewline = /\n+/g;
const empty = " ";
const cssStringToObject = (val) => {
const tree = [{}];
let block, left;
while (block = newRule.exec(val.replace(ruleClean, ""))) {
if (block[4]) {
tree.shift();
} else if (block[3]) {
left = block[3].replace(ruleNewline, empty).trim();
tree.unshift(tree[0][left] = tree[0][left] || {});
} else {
tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
}
}
return tree[0];
};
const getGlobalEventDirective = (type) => {
return ({ directives, evaluate }) => {
directives[`on-${type}`].filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
const suffixParts = entry.suffix.split("--", 2);
const eventName = suffixParts[0];
if (true) {
if (suffixParts[1]) {
warnUniqueIdWithTwoHyphens(
`on-${type}`,
suffixParts[0],
suffixParts[1]
);
}
}
useInit(() => {
const cb = (event) => {
const result = evaluate(entry);
if (typeof result === "function") {
if (!result?.sync) {
event = wrapEventAsync(event);
}
result(event);
}
};
const globalVar = type === "window" ? window : document;
globalVar.addEventListener(eventName, cb);
return () => globalVar.removeEventListener(eventName, cb);
});
});
};
};
const evaluateItemKey = (inheritedValue, namespace, item, itemProp, eachKey) => {
const clientContextWithItem = {
...inheritedValue.client,
[namespace]: {
...inheritedValue.client[namespace],
[itemProp]: item
}
};
const scope = {
...getScope(),
context: clientContextWithItem,
serverContext: inheritedValue.server
};
return eachKey ? getEvaluate({ scope })(eachKey) : item;
};
const useItemContexts = function* (inheritedValue, namespace, items, itemProp, eachKey) {
const { current: itemContexts } = A(/* @__PURE__ */ new Map());
for (const item of items) {
const key = evaluateItemKey(
inheritedValue,
namespace,
item,
itemProp,
eachKey
);
if (!itemContexts.has(key)) {
itemContexts.set(
key,
proxifyContext(
proxifyState(namespace, {
// Inits the item prop in the context to shadow it in case
// it was inherited from the parent context. The actual
// value is set in the `wp-each` directive later on.
[itemProp]: void 0
}),
inheritedValue.client[namespace]
)
);
}
yield [item, itemContexts.get(key), key];
}
};
const getGlobalAsyncEventDirective = (type) => {
return ({ directives, evaluate }) => {
directives[`on-async-${type}`].filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
if (true) {
warnWithSyncEvent(`on-async-${type}`, `on-${type}`);
}
const eventName = entry.suffix.split("--", 1)[0];
useInit(() => {
const cb = async (event) => {
await splitTask();
const result = evaluate(entry);
if (typeof result === "function") {
result(event);
}
};
const globalVar = type === "window" ? window : document;
globalVar.addEventListener(eventName, cb, {
passive: true
});
return () => globalVar.removeEventListener(eventName, cb);
});
});
};
};
const routerRegions = /* @__PURE__ */ new Map();
var directives_default = () => {
directive(
"context",
({
directives: { context },
props: { children },
context: inheritedContext
}) => {
const entries = context.filter(isDefaultDirectiveSuffix).reverse();
if (!entries.length) {
if (true) {
warn(
"The usage of data-wp-context--unique-id (two hyphens) is not supported. To add a unique ID to the directive, please use data-wp-context---unique-id (three hyphens) instead."
);
}
return;
}
const { Provider } = inheritedContext;
const { client: inheritedClient, server: inheritedServer } = x(inheritedContext);
const client = A({});
const server = {};
const result = {
client: { ...inheritedClient },
server: { ...inheritedServer }
};
const namespaces = /* @__PURE__ */ new Set();
entries.forEach(({ value, namespace, uniqueId }) => {
if (!isPlainObject(value)) {
if (true) {
warn(
`The value of data-wp-context${uniqueId ? `---${uniqueId}` : ""} on the ${namespace} namespace must be a valid stringified JSON object.`
);
}
return;
}
if (!client.current[namespace]) {
client.current[namespace] = proxifyState(namespace, {});
}
deepMerge(
client.current[namespace],
deepClone(value),
false
);
server[namespace] = value;
namespaces.add(namespace);
});
namespaces.forEach((namespace) => {
result.client[namespace] = proxifyContext(
client.current[namespace],
inheritedClient[namespace]
);
result.server[namespace] = proxifyContext(
server[namespace],
inheritedServer[namespace]
);
});
return (0,preact_module.h)(Provider, { value: result }, children);
},
{ priority: 5 }
);
directive("watch", ({ directives: { watch }, evaluate }) => {
watch.forEach((entry) => {
if (true) {
if (entry.suffix) {
warnUniqueIdWithTwoHyphens("watch", entry.suffix);
}
}
useWatch(() => {
let start;
if (false) {}
let result = evaluate(entry);
if (typeof result === "function") {
result = result();
}
if (false) {}
return result;
});
});
});
directive("init", ({ directives: { init }, evaluate }) => {
init.forEach((entry) => {
if (true) {
if (entry.suffix) {
warnUniqueIdWithTwoHyphens("init", entry.suffix);
}
}
useInit(() => {
let start;
if (false) {}
let result = evaluate(entry);
if (typeof result === "function") {
result = result();
}
if (false) {}
return result;
});
});
});
directive("on", ({ directives: { on }, element, evaluate }) => {
const events = /* @__PURE__ */ new Map();
on.filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
const suffixParts = entry.suffix.split("--", 2);
if (true) {
if (suffixParts[1]) {
warnUniqueIdWithTwoHyphens(
"on",
suffixParts[0],
suffixParts[1]
);
}
}
if (!events.has(suffixParts[0])) {
events.set(suffixParts[0], /* @__PURE__ */ new Set());
}
events.get(suffixParts[0]).add(entry);
});
events.forEach((entries, eventType) => {
const existingHandler = element.props[`on${eventType}`];
element.props[`on${eventType}`] = (event) => {
if (existingHandler) {
existingHandler(event);
}
entries.forEach((entry) => {
let start;
if (false) {}
const result = evaluate(entry);
if (typeof result === "function") {
if (!result?.sync) {
event = wrapEventAsync(event);
}
result(event);
}
if (false) {}
});
};
});
});
directive(
"on-async",
({ directives: { "on-async": onAsync }, element, evaluate }) => {
if (true) {
warnWithSyncEvent("on-async", "on");
}
const events = /* @__PURE__ */ new Map();
onAsync.filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
const event = entry.suffix.split("--", 1)[0];
if (!events.has(event)) {
events.set(event, /* @__PURE__ */ new Set());
}
events.get(event).add(entry);
});
events.forEach((entries, eventType) => {
const existingHandler = element.props[`on${eventType}`];
element.props[`on${eventType}`] = (event) => {
if (existingHandler) {
existingHandler(event);
}
entries.forEach(async (entry) => {
await splitTask();
const result = evaluate(entry);
if (typeof result === "function") {
result(event);
}
});
};
});
}
);
directive("on-window", getGlobalEventDirective("window"));
directive("on-document", getGlobalEventDirective("document"));
directive("on-async-window", getGlobalAsyncEventDirective("window"));
directive(
"on-async-document",
getGlobalAsyncEventDirective("document")
);
directive(
"class",
({ directives: { class: classNames }, element, evaluate }) => {
classNames.filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
const className = entry.uniqueId ? `${entry.suffix}---${entry.uniqueId}` : entry.suffix;
let result = evaluate(entry);
if (result === PENDING_GETTER) {
return;
}
if (typeof result === "function") {
result = result();
}
const currentClass = element.props.class || "";
const classFinder = new RegExp(
`(^|\\s)${className}(\\s|$)`,
"g"
);
if (!result) {
element.props.class = currentClass.replace(classFinder, " ").trim();
} else if (!classFinder.test(currentClass)) {
element.props.class = currentClass ? `${currentClass} ${className}` : className;
}
useInit(() => {
if (!result) {
element.ref.current.classList.remove(className);
} else {
element.ref.current.classList.add(className);
}
});
});
}
);
directive("style", ({ directives: { style }, element, evaluate }) => {
style.filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
if (entry.uniqueId) {
if (true) {
warnUniqueIdNotSupported("style", entry.uniqueId);
}
return;
}
const styleProp = entry.suffix;
let result = evaluate(entry);
if (result === PENDING_GETTER) {
return;
}
if (typeof result === "function") {
result = result();
}
element.props.style = element.props.style || {};
if (typeof element.props.style === "string") {
element.props.style = cssStringToObject(element.props.style);
}
if (!result) {
delete element.props.style[styleProp];
} else {
element.props.style[styleProp] = result;
}
useInit(() => {
if (!result) {
element.ref.current.style.removeProperty(styleProp);
} else {
element.ref.current.style.setProperty(styleProp, result);
}
});
});
});
directive("bind", ({ directives: { bind }, element, evaluate }) => {
bind.filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
if (entry.uniqueId) {
if (true) {
warnUniqueIdNotSupported("bind", entry.uniqueId);
}
return;
}
const attribute = entry.suffix;
let result = evaluate(entry);
if (result === PENDING_GETTER) {
return;
}
if (typeof result === "function") {
result = result();
}
element.props[attribute] = result;
useInit(() => {
const el = element.ref.current;
if (attribute === "style") {
if (typeof result === "string") {
el.style.cssText = result;
}
return;
} else if (attribute !== "width" && attribute !== "height" && attribute !== "href" && attribute !== "list" && attribute !== "form" && /*
* The value for `tabindex` follows the parsing rules for an
* integer. If that fails, or if the attribute isn't present, then
* the browsers should "follow platform conventions to determine if
* the element should be considered as a focusable area",
* practically meaning that most elements get a default of `-1` (not
* focusable), but several also get a default of `0` (focusable in
* order after all elements with a positive `tabindex` value).
*
* @see https://html.spec.whatwg.org/#tabindex-value
*/
attribute !== "tabIndex" && attribute !== "download" && attribute !== "rowSpan" && attribute !== "colSpan" && attribute !== "role" && attribute in el) {
try {
el[attribute] = result === null || result === void 0 ? "" : result;
return;
} catch (err) {
}
}
if (result !== null && result !== void 0 && (result !== false || attribute[4] === "-")) {
el.setAttribute(attribute, result);
} else {
el.removeAttribute(attribute);
}
});
});
});
directive(
"ignore",
({
element: {
type: Type,
props: { innerHTML, ...rest }
}
}) => {
if (true) {
warn(
"The data-wp-ignore directive is deprecated and will be removed in version 7.0."
);
}
const cached = T(() => innerHTML, []);
return (0,preact_module.h)(Type, {
dangerouslySetInnerHTML: { __html: cached },
...rest
});
}
);
directive("text", ({ directives: { text }, element, evaluate }) => {
const entries = text.filter(isDefaultDirectiveSuffix);
if (!entries.length) {
if (true) {
warn(
"The usage of data-wp-text--suffix is not supported. Please use data-wp-text instead."
);
}
return;
}
entries.forEach((entry) => {
if (entry.uniqueId) {
if (true) {
warnUniqueIdNotSupported("text", entry.uniqueId);
}
return;
}
try {
let result = evaluate(entry);
if (result === PENDING_GETTER) {
return;
}
if (typeof result === "function") {
result = result();
}
element.props.children = typeof result === "object" ? null : result.toString();
} catch (e) {
element.props.children = null;
}
});
});
directive("run", ({ directives: { run }, evaluate }) => {
run.forEach((entry) => {
if (true) {
if (entry.suffix) {
warnUniqueIdWithTwoHyphens("run", entry.suffix);
}
}
let result = evaluate(entry);
if (typeof result === "function") {
result = result();
}
return result;
});
});
directive(
"each",
({
directives: { each, "each-key": eachKey },
context: inheritedContext,
element,
evaluate
}) => {
if (element.type !== "template") {
if (true) {
warn(
"The data-wp-each directive can only be used on <template> elements."
);
}
return;
}
const { Provider } = inheritedContext;
const inheritedValue = x(inheritedContext);
const [entry] = each;
const { namespace, suffix, uniqueId } = entry;
if (each.length > 1) {
if (true) {
warn(
"The usage of multiple data-wp-each directives on the same element is not supported. Please pick only one."
);
}
return;
}
if (uniqueId) {
if (true) {
warnUniqueIdNotSupported("each", uniqueId);
}
return;
}
let iterable = evaluate(entry);
if (iterable === PENDING_GETTER) {
return;
}
if (typeof iterable === "function") {
iterable = iterable();
}
if (typeof iterable?.[Symbol.iterator] !== "function") {
return;
}
const itemProp = suffix ? kebabToCamelCase(suffix) : "item";
const result = [];
const itemContexts = useItemContexts(
inheritedValue,
namespace,
iterable,
itemProp,
eachKey?.[0]
);
for (const [item, itemContext, key] of itemContexts) {
const mergedContext = {
client: {
...inheritedValue.client,
[namespace]: itemContext
},
server: { ...inheritedValue.server }
};
mergedContext.client[namespace][itemProp] = item;
result.push(
(0,preact_module.h)(
Provider,
{ value: mergedContext, key },
element.props.content
)
);
}
return result;
},
{ priority: 20 }
);
directive(
"each-child",
({ directives: { "each-child": eachChild }, element, evaluate }) => {
const entry = eachChild.find(isDefaultDirectiveSuffix);
if (!entry) {
return;
}
const iterable = evaluate(entry);
return iterable === PENDING_GETTER ? element : null;
},
{ priority: 1 }
);
directive(
"router-region",
({ directives: { "router-region": routerRegion } }) => {
const entry = routerRegion.find(isDefaultDirectiveSuffix);
if (!entry) {
return;
}
if (entry.suffix) {
if (true) {
warn(
`Suffixes for the data-wp-router-region directive are not supported. Ignoring the directive with suffix "${entry.suffix}".`
);
}
return;
}
if (entry.uniqueId) {
if (true) {
warnUniqueIdNotSupported("router-region", entry.uniqueId);
}
return;
}
const regionId = typeof entry.value === "string" ? entry.value : entry.value.id;
if (!routerRegions.has(regionId)) {
routerRegions.set(regionId, signals_core_module_d());
}
const vdom = routerRegions.get(regionId).value;
_(() => {
if (vdom && typeof vdom.type !== "string") {
navigationContextSignal.value = navigationContextSignal.peek() + 1;
}
}, [vdom]);
if (vdom && typeof vdom.type !== "string") {
const previousScope = getScope();
return (0,preact_module/* cloneElement */.Ob)(vdom, { previousScope });
}
return vdom;
},
{ priority: 1 }
);
};
;// ./node_modules/@wordpress/interactivity/build-module/vdom.js
const directivePrefix = `data-wp-`;
const namespaces = [];
const currentNamespace = () => namespaces[namespaces.length - 1] ?? null;
const isObject = (item) => Boolean(item && typeof item === "object" && item.constructor === Object);
const invalidCharsRegex = /[^a-z0-9-_]/i;
function parseDirectiveName(directiveName) {
const name = directiveName.substring(8);
if (invalidCharsRegex.test(name)) {
return null;
}
const suffixIndex = name.indexOf("--");
if (suffixIndex === -1) {
return { prefix: name, suffix: null, uniqueId: null };
}
const prefix = name.substring(0, suffixIndex);
const remaining = name.substring(suffixIndex);
if (remaining.startsWith("---") && remaining[3] !== "-") {
return {
prefix,
suffix: null,
uniqueId: remaining.substring(3) || null
};
}
let suffix = remaining.substring(2);
const uniqueIdIndex = suffix.indexOf("---");
if (uniqueIdIndex !== -1 && suffix.substring(uniqueIdIndex)[3] !== "-") {
const uniqueId = suffix.substring(uniqueIdIndex + 3) || null;
suffix = suffix.substring(0, uniqueIdIndex) || null;
return { prefix, suffix, uniqueId };
}
return { prefix, suffix: suffix || null, uniqueId: null };
}
const nsPathRegExp = /^([\w_\/-]+)::(.+)$/;
const hydratedIslands = /* @__PURE__ */ new WeakSet();
function toVdom(root) {
const nodesToRemove = /* @__PURE__ */ new Set();
const nodesToReplace = /* @__PURE__ */ new Set();
const treeWalker = document.createTreeWalker(
root,
205
// TEXT + CDATA_SECTION + COMMENT + PROCESSING_INSTRUCTION + ELEMENT
);
function walk(node) {
const { nodeType } = node;
if (nodeType === 3) {
return node.data;
}
if (nodeType === 4) {
nodesToReplace.add(node);
return node.nodeValue;
}
if (nodeType === 8 || nodeType === 7) {
nodesToRemove.add(node);
return null;
}
const elementNode = node;
const { attributes } = elementNode;
const localName = elementNode.localName;
const props = {};
const children = [];
const directives = [];
let ignore = false;
let island = false;
for (let i = 0; i < attributes.length; i++) {
const attributeName = attributes[i].name;
const attributeValue = attributes[i].value;
if (attributeName[directivePrefix.length] && attributeName.slice(0, directivePrefix.length) === directivePrefix) {
if (attributeName === "data-wp-ignore") {
ignore = true;
} else {
const regexResult = nsPathRegExp.exec(attributeValue);
const namespace = regexResult?.[1] ?? null;
let value = regexResult?.[2] ?? attributeValue;
try {
const parsedValue = JSON.parse(value);
value = isObject(parsedValue) ? parsedValue : value;
} catch {
}
if (attributeName === "data-wp-interactive") {
island = true;
const islandNamespace = (
// eslint-disable-next-line no-nested-ternary
typeof value === "string" ? value : typeof value?.namespace === "string" ? value.namespace : null
);
namespaces.push(islandNamespace);
} else {
directives.push([attributeName, namespace, value]);
}
}
} else if (attributeName === "ref") {
continue;
}
props[attributeName] = attributeValue;
}
if (ignore && !island) {
return [
(0,preact_module.h)(localName, {
...props,
innerHTML: elementNode.innerHTML,
__directives: { ignore: true }
})
];
}
if (island) {
hydratedIslands.add(elementNode);
}
if (directives.length) {
props.__directives = directives.reduce((obj, [name, ns, value]) => {
const directiveParsed = parseDirectiveName(name);
if (directiveParsed === null) {
if (true) {
warn(`Found malformed directive name: ${name}.`);
}
return obj;
}
const { prefix, suffix, uniqueId } = directiveParsed;
obj[prefix] = obj[prefix] || [];
obj[prefix].push({
namespace: ns ?? currentNamespace(),
value,
suffix,
uniqueId
});
return obj;
}, {});
for (const prefix in props.__directives) {
props.__directives[prefix].sort(
(a, b) => {
const aSuffix = a.suffix ?? "";
const bSuffix = b.suffix ?? "";
if (aSuffix !== bSuffix) {
return aSuffix < bSuffix ? -1 : 1;
}
const aId = a.uniqueId ?? "";
const bId = b.uniqueId ?? "";
return +(aId > bId) - +(aId < bId);
}
);
}
}
if (props.__directives?.["each-child"]) {
props.dangerouslySetInnerHTML = {
__html: elementNode.innerHTML
};
} else if (localName === "template") {
props.content = [
...elementNode.content.childNodes
].map((childNode) => toVdom(childNode));
} else {
let child = treeWalker.firstChild();
if (child) {
while (child) {
const vnode = walk(child);
if (vnode) {
children.push(vnode);
}
child = treeWalker.nextSibling();
}
treeWalker.parentNode();
}
}
if (island) {
namespaces.pop();
}
return (0,preact_module.h)(localName, props, children);
}
const vdom = walk(treeWalker.currentNode);
nodesToRemove.forEach(
(node) => node.remove()
);
nodesToReplace.forEach(
(node) => node.replaceWith(
new window.Text(node.nodeValue ?? "")
)
);
return vdom;
}
;// ./node_modules/@wordpress/interactivity/build-module/init.js
const regionRootFragments = /* @__PURE__ */ new WeakMap();
const getRegionRootFragment = (regions) => {
const region = Array.isArray(regions) ? regions[0] : regions;
if (!region.parentElement) {
throw Error("The passed region should be an element with a parent.");
}
if (!regionRootFragments.has(region)) {
regionRootFragments.set(
region,
createRootFragment(region.parentElement, regions)
);
}
return regionRootFragments.get(region);
};
const initialVdom = /* @__PURE__ */ new WeakMap();
const init = async () => {
const nodes = document.querySelectorAll(`[data-wp-interactive]`);
await new Promise((resolve) => {
setTimeout(resolve, 0);
});
for (const node of nodes) {
if (!hydratedIslands.has(node)) {
await splitTask();
const fragment = getRegionRootFragment(node);
const vdom = toVdom(node);
initialVdom.set(node, vdom);
await splitTask();
(0,preact_module/* hydrate */.Qv)(vdom, fragment);
}
}
};
;// ./node_modules/@wordpress/interactivity/build-module/index.js
const requiredConsent = "I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.";
const privateApis = (lock) => {
if (lock === requiredConsent) {
return {
getRegionRootFragment: getRegionRootFragment,
initialVdom: initialVdom,
toVdom: toVdom,
directive: directive,
getNamespace: getNamespace,
h: preact_module.h,
cloneElement: preact_module/* cloneElement */.Ob,
render: preact_module/* render */.XX,
proxifyState: proxifyState,
parseServerData: parseServerData,
populateServerData: populateServerData,
batch: signals_core_module_r,
routerRegions: routerRegions,
deepReadOnly: deepReadOnly,
navigationSignal: navigationSignal
};
}
throw new Error("Forbidden access.");
};
directives_default();
init();
var __webpack_exports__getConfig = __webpack_exports__.zj;
var __webpack_exports__getContext = __webpack_exports__.SD;
var __webpack_exports__getElement = __webpack_exports__.V6;
var __webpack_exports__getServerContext = __webpack_exports__.$K;
var __webpack_exports__getServerState = __webpack_exports__.vT;
var __webpack_exports__privateApis = __webpack_exports__.jb;
var __webpack_exports__splitTask = __webpack_exports__.yT;
var __webpack_exports__store = __webpack_exports__.M_;
var __webpack_exports__useCallback = __webpack_exports__.hb;
var __webpack_exports__useEffect = __webpack_exports__.vJ;
var __webpack_exports__useInit = __webpack_exports__.ip;
var __webpack_exports__useLayoutEffect = __webpack_exports__.Nf;
var __webpack_exports__useMemo = __webpack_exports__.Kr;
var __webpack_exports__useRef = __webpack_exports__.li;
var __webpack_exports__useState = __webpack_exports__.J0;
var __webpack_exports__useWatch = __webpack_exports__.FH;
var __webpack_exports__withScope = __webpack_exports__.v4;
var __webpack_exports__withSyncEvent = __webpack_exports__.mh;
export { __webpack_exports__getConfig as getConfig, __webpack_exports__getContext as getContext, __webpack_exports__getElement as getElement, __webpack_exports__getServerContext as getServerContext, __webpack_exports__getServerState as getServerState, __webpack_exports__privateApis as privateApis, __webpack_exports__splitTask as splitTask, __webpack_exports__store as store, __webpack_exports__useCallback as useCallback, __webpack_exports__useEffect as useEffect, __webpack_exports__useInit as useInit, __webpack_exports__useLayoutEffect as useLayoutEffect, __webpack_exports__useMemo as useMemo, __webpack_exports__useRef as useRef, __webpack_exports__useState as useState, __webpack_exports__useWatch as useWatch, __webpack_exports__withScope as withScope, __webpack_exports__withSyncEvent as withSyncEvent };
script-modules/interactivity/debug.min.js 0000644 00000143025 15144410747 0014636 0 ustar 00 var e={622:(e,t,n)=>{n.d(t,{FK:()=>x,Ob:()=>B,Qv:()=>G,XX:()=>z,fF:()=>o,h:()=>k,q6:()=>J,uA:()=>E,zO:()=>s});var r,o,i,s,u,a,c,l,f,_,p,h,d,v={},y=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function k(e,t,n){var o,i,s,u={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:u[s]=t[s];if(arguments.length>2&&(u.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===u[s]&&(u[s]=e.defaultProps[s]);return S(e,u,o,i,null)}function S(e,t,n,r,s){var u={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=o.vnode&&o.vnode(u),u}function x(e){return e.children}function E(e,t){this.props=e,this.context=t}function T(e,t){if(null==t)return e.__?T(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?T(e):null}function O(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return O(e)}}function P(e){(!e.__d&&(e.__d=!0)&&u.push(e)&&!F.__r++||a!=o.debounceRendering)&&((a=o.debounceRendering)||c)(F)}function F(){for(var e,t,n,r,i,s,a,c=1;u.length;)u.length>c&&u.sort(l),e=u.shift(),c=u.length,e.__d&&(n=void 0,r=void 0,i=(r=(t=e).__v).__e,s=[],a=[],t.__P&&((n=w({},r)).__v=r.__v+1,o.vnode&&o.vnode(n),A(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[i]:null,s,null==i?T(r):i,!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,W(s,n,a),r.__e=r.__=null,n.__e!=i&&O(n)));F.__r=0}function C(e,t,n,r,o,i,s,u,a,c,l){var f,_,p,h,d,g,m,w=r&&r.__k||y,b=t.length;for(a=M(n,t,w,a,b),f=0;f<b;f++)null!=(p=n.__k[f])&&(_=-1==p.__i?v:w[p.__i]||v,p.__i=f,g=A(e,p,_,o,i,s,u,a,c,l),h=p.__e,p.ref&&_.ref!=p.ref&&(_.ref&&R(_.ref,null,p),l.push(p.ref,p.__c||h,p)),null==d&&null!=h&&(d=h),(m=!!(4&p.__u))||_.__k===p.__k?a=N(p,a,e,m):"function"==typeof p.type&&void 0!==g?a=g:h&&(a=h.nextSibling),p.__u&=-7);return n.__e=d,a}function M(e,t,n,r,o){var i,s,u,a,c,l=n.length,f=l,_=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(s=t[i])&&"boolean"!=typeof s&&"function"!=typeof s?(a=i+_,(s=e.__k[i]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?S(null,s,null,null,null):m(s)?S(x,{children:s},null,null,null):null==s.constructor&&s.__b>0?S(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,u=null,-1!=(c=s.__i=j(s,n,a,f))&&(f--,(u=n[c])&&(u.__u|=2)),null==u||null==u.__v?(-1==c&&(o>l?_--:o<l&&_++),"function"!=typeof s.type&&(s.__u|=4)):c!=a&&(c==a-1?_--:c==a+1?_++:(c>a?_--:_++,s.__u|=4))):e.__k[i]=null;if(f)for(i=0;i<l;i++)null!=(u=n[i])&&!(2&u.__u)&&(u.__e==r&&(r=T(u)),q(u,u));return r}function N(e,t,n,r){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=N(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=T(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function j(e,t,n,r){var o,i,s,u=e.key,a=e.type,c=t[n],l=null!=c&&!(2&c.__u);if(null===c&&null==e.key||l&&u==c.key&&a==c.type)return n;if(r>(l?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;)if(null!=(c=t[s=o>=0?o--:i++])&&!(2&c.__u)&&u==c.key&&a==c.type)return s;return-1}function H(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||g.test(t)?n:n+"px"}function I(e,t,n,r,o){var i,s;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||H(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||H(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(f,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=_,e.addEventListener(t,i?h:p,i)):e.removeEventListener(t,i?h:p,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function $(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=_++;else if(t.t<n.u)return;return n(o.event?o.event(t):t)}}}function A(e,t,n,r,i,s,u,a,c,l){var f,_,p,h,d,v,y,g,k,S,T,O,P,F,M,N,j,H=t.type;if(null!=t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=t.__e=n.__e]),(f=o.__b)&&f(t);e:if("function"==typeof H)try{if(g=t.props,k="prototype"in H&&H.prototype.render,S=(f=H.contextType)&&r[f.__c],T=f?S?S.props.value:f.__:r,n.__c?y=(_=t.__c=n.__c).__=_.__E:(k?t.__c=_=new H(g,T):(t.__c=_=new E(g,T),_.constructor=H,_.render=V),S&&S.sub(_),_.props=g,_.state||(_.state={}),_.context=T,_.__n=r,p=_.__d=!0,_.__h=[],_._sb=[]),k&&null==_.__s&&(_.__s=_.state),k&&null!=H.getDerivedStateFromProps&&(_.__s==_.state&&(_.__s=w({},_.__s)),w(_.__s,H.getDerivedStateFromProps(g,_.__s))),h=_.props,d=_.state,_.__v=t,p)k&&null==H.getDerivedStateFromProps&&null!=_.componentWillMount&&_.componentWillMount(),k&&null!=_.componentDidMount&&_.__h.push(_.componentDidMount);else{if(k&&null==H.getDerivedStateFromProps&&g!==h&&null!=_.componentWillReceiveProps&&_.componentWillReceiveProps(g,T),!_.__e&&null!=_.shouldComponentUpdate&&!1===_.shouldComponentUpdate(g,_.__s,T)||t.__v==n.__v){for(t.__v!=n.__v&&(_.props=g,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some((function(e){e&&(e.__=t)})),O=0;O<_._sb.length;O++)_.__h.push(_._sb[O]);_._sb=[],_.__h.length&&u.push(_);break e}null!=_.componentWillUpdate&&_.componentWillUpdate(g,_.__s,T),k&&null!=_.componentDidUpdate&&_.__h.push((function(){_.componentDidUpdate(h,d,v)}))}if(_.context=T,_.props=g,_.__P=e,_.__e=!1,P=o.__r,F=0,k){for(_.state=_.__s,_.__d=!1,P&&P(t),f=_.render(_.props,_.state,_.context),M=0;M<_._sb.length;M++)_.__h.push(_._sb[M]);_._sb=[]}else do{_.__d=!1,P&&P(t),f=_.render(_.props,_.state,_.context),_.state=_.__s}while(_.__d&&++F<25);_.state=_.__s,null!=_.getChildContext&&(r=w(w({},r),_.getChildContext())),k&&!p&&null!=_.getSnapshotBeforeUpdate&&(v=_.getSnapshotBeforeUpdate(h,d)),N=f,null!=f&&f.type===x&&null==f.key&&(N=D(f.props.children)),a=C(e,m(N)?N:[N],t,n,r,i,s,u,a,c,l),_.base=t.__e,t.__u&=-161,_.__h.length&&u.push(_),y&&(_.__E=_.__=null)}catch(e){if(t.__v=null,c||null!=s)if(e.then){for(t.__u|=c?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(j=s.length;j--;)b(s[j]);U(t)}else t.__e=n.__e,t.__k=n.__k,e.then||U(t);o.__e(e,t,n)}else null==s&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=L(n.__e,t,n,r,i,s,u,c,l);return(f=o.diffed)&&f(t),128&t.__u?void 0:a}function U(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(U)}function W(e,t,n){for(var r=0;r<n.length;r++)R(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function D(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:m(e)?e.map(D):w({},e)}function L(e,t,n,i,s,u,a,c,l){var f,_,p,h,d,y,g,w=n.props,k=t.props,S=t.type;if("svg"==S?s="http://www.w3.org/2000/svg":"math"==S?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=u)for(f=0;f<u.length;f++)if((d=u[f])&&"setAttribute"in d==!!S&&(S?d.localName==S:3==d.nodeType)){e=d,u[f]=null;break}if(null==e){if(null==S)return document.createTextNode(k);e=document.createElementNS(s,S,k.is&&k),c&&(o.__m&&o.__m(t,u),c=!1),u=null}if(null==S)w===k||c&&e.data==k||(e.data=k);else{if(u=u&&r.call(e.childNodes),w=n.props||v,!c&&null!=u)for(w={},f=0;f<e.attributes.length;f++)w[(d=e.attributes[f]).name]=d.value;for(f in w)if(d=w[f],"children"==f);else if("dangerouslySetInnerHTML"==f)p=d;else if(!(f in k)){if("value"==f&&"defaultValue"in k||"checked"==f&&"defaultChecked"in k)continue;I(e,f,null,d,s)}for(f in k)d=k[f],"children"==f?h=d:"dangerouslySetInnerHTML"==f?_=d:"value"==f?y=d:"checked"==f?g=d:c&&"function"!=typeof d||w[f]===d||I(e,f,d,w[f],s);if(_)c||p&&(_.__html==p.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[];else if(p&&(e.innerHTML=""),C("template"==t.type?e.content:e,m(h)?h:[h],t,n,i,"foreignObject"==S?"http://www.w3.org/1999/xhtml":s,u,a,u?u[0]:n.__k&&T(n,0),c,l),null!=u)for(f=u.length;f--;)b(u[f]);c||(f="value","progress"==S&&null==y?e.removeAttribute("value"):null!=y&&(y!==e[f]||"progress"==S&&!y||"option"==S&&y!=w[f])&&I(e,f,y,w[f],s),f="checked",null!=g&&g!=e[f]&&I(e,f,g,w[f],s))}return e}function R(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){o.__e(e,n)}}function q(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||R(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&q(r[i],t,n||"function"!=typeof e.type);n||b(e.__e),e.__c=e.__=e.__e=void 0}function V(e,t,n){return this.constructor(e,n)}function z(e,t,n){var i,s,u,a;t==document&&(t=document.documentElement),o.__&&o.__(e,t),s=(i="function"==typeof n)?null:n&&n.__k||t.__k,u=[],a=[],A(t,e=(!i&&n||t).__k=k(x,null,[e]),s||v,v,t.namespaceURI,!i&&n?[n]:s?null:t.firstChild?r.call(t.childNodes):null,u,!i&&n?n:s?s.__e:t.firstChild,i,a),W(u,e,a)}function G(e,t){z(e,t,G)}function B(e,t,n){var o,i,s,u,a=w({},e.props);for(s in e.type&&e.type.defaultProps&&(u=e.type.defaultProps),t)"key"==s?o=t[s]:"ref"==s?i=t[s]:a[s]=void 0===t[s]&&null!=u?u[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?r.call(arguments,2):n),S(e.type,a,o||e.key,i||e.ref,null)}function J(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach((function(e){e.__e=!0,P(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+d++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}r=y.slice,o={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},i=0,s=function(e){return null!=e&&null==e.constructor},E.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=w({},this.state),"function"==typeof e&&(e=e(w({},n),this.props)),e&&w(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),P(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),P(this))},E.prototype.render=x,u=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},F.__r=0,f=/(PointerCapture)$|Capture$/i,_=0,p=$(!1),h=$(!0),d=0},676:(e,t,n)=>{n.d(t,{zj:()=>vt,SD:()=>pe,V6:()=>he,$K:()=>ve,vT:()=>yt,jb:()=>Kt,yT:()=>ge,M_:()=>mt,hb:()=>Ee,vJ:()=>Se,ip:()=>ke,Nf:()=>xe,Kr:()=>Te,li:()=>b,J0:()=>g,FH:()=>be,v4:()=>we,mh:()=>Fe});var r,o,i,s,u=n(622),a=0,c=[],l=u.fF,f=l.__b,_=l.__r,p=l.diffed,h=l.__c,d=l.unmount,v=l.__;function y(e,t){l.__h&&l.__h(o,e,a||t),a=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function g(e){return a=1,function(e,t,n){var i=y(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):M(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.__f)){var s=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!u||u.call(this,e,t,n);var o=i.__c.props!==e;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),u&&u.call(this,e,t,n)||o};o.__f=!0;var u=o.shouldComponentUpdate,a=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=u;u=void 0,s(e,t,n),u=r}a&&a.call(this,e,t,n)},o.shouldComponentUpdate=s}return i.__N||i.__}(M,e)}function m(e,t){var n=y(r++,3);!l.__s&&C(n.__H,t)&&(n.__=e,n.u=t,o.__H.__h.push(n))}function w(e,t){var n=y(r++,4);!l.__s&&C(n.__H,t)&&(n.__=e,n.u=t,o.__h.push(n))}function b(e){return a=5,k((function(){return{current:e}}),[])}function k(e,t){var n=y(r++,7);return C(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function S(e,t){return a=8,k((function(){return e}),t)}function x(e){var t=o.context[e.__c],n=y(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function E(){for(var e;e=c.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(P),e.__H.__h.forEach(F),e.__H.__h=[]}catch(t){e.__H.__h=[],l.__e(t,e.__v)}}l.__b=function(e){o=null,f&&f(e)},l.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),v&&v(e,t)},l.__r=function(e){_&&_(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(P),t.__h.forEach(F),t.__h=[],r=0)),i=o},l.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==c.push(t)&&s===l.requestAnimationFrame||((s=l.requestAnimationFrame)||O)(E)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),i=o=null},l.__c=function(e,t){t.some((function(e){try{e.__h.forEach(P),e.__h=e.__h.filter((function(e){return!e.__||F(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],l.__e(n,e.__v)}})),h&&h(e,t)},l.unmount=function(e){d&&d(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{P(e)}catch(e){t=e}})),n.__H=void 0,t&&l.__e(t,n.__v))};var T="function"==typeof requestAnimationFrame;function O(e){var t,n=function(){clearTimeout(r),T&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);T&&(t=requestAnimationFrame(n))}function P(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function F(e){var t=o;e.__c=e.__(),o=t}function C(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function M(e,t){return"function"==typeof t?t(e):t}var N=Symbol.for("preact-signals");function j(){if(W>1)W--;else{for(var e,t=!1;void 0!==U;){var n=U;for(U=void 0,D++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&z(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(D=0,W--,t)throw e}}function H(e){if(W>0)return e();W++;try{return e()}finally{j()}}var I=void 0;function $(e){var t=I;I=void 0;try{return e()}finally{I=t}}var A,U=void 0,W=0,D=0,L=0;function R(e){if(void 0!==I){var t=e.n;if(void 0===t||t.t!==I)return t={i:0,S:e,p:I.s,n:void 0,t:I,e:void 0,x:void 0,r:t},void 0!==I.s&&(I.s.n=t),I.s=t,e.n=t,32&I.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=I.s,t.n=void 0,I.s.n=t,I.s=t),t}}function q(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function V(e,t){return new q(e,t)}function z(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function G(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function B(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function J(e,t){q.call(this,void 0),this.x=e,this.s=void 0,this.g=L-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function K(e,t){return new J(e,t)}function Y(e){var t=e.u;if(e.u=void 0,"function"==typeof t){W++;var n=I;I=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,X(e),t}finally{I=n,j()}}}function X(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Y(e)}function Z(e){if(I!==this)throw new Error("Out-of-order effect");B(this),I=e,this.f&=-2,8&this.f&&X(this),j()}function Q(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==t?void 0:t.name}function ee(e,t){var n=new Q(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function te(e,t){u.fF[e]=t.bind(null,u.fF[e]||function(){})}function ne(e){A&&A(),A=e&&e.S()}function re(e){var t=this,n=e.data,r=function(e){return k((function(){return V(e)}),[])}(n);r.value=n;var o=k((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e,n=t.__$u.S(),r=o.value;n(),(0,u.zO)(r)||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=r},K((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return o.value}function oe(e,t,n,r){var o=t in e&&void 0===e.ownerSVGElement,i=V(n);return{o:function(e,t){i.value=e,r=t},d:ee((function(){var n=i.value.value;r[t]!==n&&(r[t]=n,o?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}q.prototype.brand=N,q.prototype.h=function(){return!0},q.prototype.S=function(e){var t=this,n=this.t;n!==e&&void 0===e.e&&(e.x=n,this.t=e,void 0!==n?n.e=e:$((function(){var e;null==(e=t.W)||e.call(t)})))},q.prototype.U=function(e){var t=this;if(void 0!==this.t){var n=e.e,r=e.x;void 0!==n&&(n.x=r,e.e=void 0),void 0!==r&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,void 0===r&&$((function(){var e;null==(e=t.Z)||e.call(t)})))}},q.prototype.subscribe=function(e){var t=this;return ee((function(){var n=t.value,r=I;I=void 0;try{e(n)}finally{I=r}}),{name:"sub"})},q.prototype.valueOf=function(){return this.value},q.prototype.toString=function(){return this.value+""},q.prototype.toJSON=function(){return this.value},q.prototype.peek=function(){var e=I;I=void 0;try{return this.value}finally{I=e}},Object.defineProperty(q.prototype,"value",{get:function(){var e=R(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(D>100)throw new Error("Cycle detected");this.v=e,this.i++,L++,W++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{j()}}}}),J.prototype=new q,J.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===L)return!0;if(this.g=L,this.f|=1,this.i>0&&!z(this))return this.f&=-2,!0;var e=I;try{G(this),I=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return I=e,B(this),this.f&=-2,!0},J.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}q.prototype.S.call(this,e)},J.prototype.U=function(e){if(void 0!==this.t&&(q.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},J.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(J.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=R(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Q.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Q.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Y(this),G(this),W++;var e=I;return I=this,Z.bind(this,e)},Q.prototype.N=function(){2&this.f||(this.f|=2,this.o=U,U=this)},Q.prototype.d=function(){this.f|=8,1&this.f||X(this)},Q.prototype.dispose=function(){this.d()},re.displayName="_st",Object.defineProperties(q.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:re},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),te("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof q&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)})),te("__r",(function(e,t){ne();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(){var e;return ee((function(){e=this})),e.c=function(){r.__$f|=1,r.setState({})},e}())),ne(n),e(t)})),te("__e",(function(e,t,n,r){ne(),e(t,n,r)})),te("diffed",(function(e,t){var n;if(ne(),"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var u=i[s];void 0===u||s in r||(u.d(),i[s]=void 0)}else n.U=i={};for(var a in r){var c=i[a],l=r[a];void 0===c?(c=oe(n,a,l,o),i[a]=c):c.o(l,o)}}}e(t)})),te("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=t.__c;if(s){var u=s.__$u;u&&(s.__$u=void 0,u.d())}}e(t)})),te("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),u.uA.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u,r=n&&void 0!==n.s;for(var o in t)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(r||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(r||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var i in e)if("__source"!==i&&e[i]!==this.props[i])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};const ie=[],se=()=>ie.slice(-1)[0],ue=e=>{ie.push(e)},ae=()=>{ie.pop()},ce=[],le=()=>ce.slice(-1)[0],fe=e=>{ce.push(e)},_e=()=>{ce.pop()},pe=e=>le().context[e||se()],he=()=>{const e=le();const{ref:t,attributes:n}=e;return Object.freeze({ref:t.current,attributes:Ne(n,{})})},de=V(0);function ve(e){const t=le();return ve.subscribe=de.value,He(t.serverContext[e||se()])}ve.subscribe=0;const ye=e=>new Promise((t=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{e(),t()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),ge="function"==typeof window.scheduler?.yield?window.scheduler.yield.bind(window.scheduler):()=>new Promise((e=>{setTimeout(e,0)}));function me(e){m((()=>{let t=null,n=!1;return t=function(e,t){let n=()=>{};const r=ee((function(){return n=this.c.bind(this),this.x=e,this.c=t,e()}));return{flush:n,dispose:r}}(e,(async()=>{t&&!n&&(n=!0,await ye(t.flush),n=!1)})),t.dispose}),[])}function we(e){const t=le(),n=se();let r;r="GeneratorFunction"===e?.constructor?.name?async(...r)=>{const o=e(...r);let i,s,u;for(;;){ue(n),fe(t);try{s=u?o.throw(u):o.next(i),u=void 0}catch(e){throw e}finally{_e(),ae()}try{i=await s.value}catch(e){u=e}if(s.done){if(u)throw u;break}}return i}:(...r)=>{ue(n),fe(t);try{return e(...r)}finally{ae(),_e()}};if(e.sync){const e=r;return e.sync=!0,e}return r}function be(e){me(we(e))}function ke(e){m(we(e),[])}function Se(e,t){m(we(e),t)}function xe(e,t){w(we(e),t)}function Ee(e,t){return S(we(e),t)}function Te(e,t){return k(we(e),t)}const Oe=e=>{0},Pe=e=>Boolean(e&&"object"==typeof e&&e.constructor===Object);function Fe(e){const t=e;return t.sync=!0,t}const Ce=new WeakMap,Me=e=>{const t=()=>!1;return{get(t,n){const r=t[n];return r&&"object"==typeof r?Ne(r,{errorMessage:e}):r},set:t,deleteProperty:t,defineProperty:t}};function Ne(e,t){const n=t?.errorMessage??"Cannot modify read-only object";if(!Ce.has(e)){const t=Me(n);Ce.set(e,new Proxy(e,t))}return Ce.get(e)}const je=V(0);function He(e){return Pe(e)?Object.fromEntries(Object.entries(e).map((([e,t])=>[e,He(t)]))):Array.isArray(e)?e.map((e=>He(e))):e}const Ie=new WeakMap,$e=new WeakMap,Ae=new WeakMap,Ue=new Set([Object,Array]),We=(e,t,n)=>{if(!Re(t))throw Error("This object cannot be proxified.");if(!Ie.has(t)){const r=new Proxy(t,n);Ie.set(t,r),$e.set(r,t),Ae.set(r,e)}return Ie.get(t)},De=e=>Ie.get(e),Le=e=>Ae.get(e),Re=e=>"object"==typeof e&&null!==e&&(!Ae.has(e)&&Ue.has(e.constructor)),qe={};class Ve{owner;computedsByScope;valueSignal;getterSignal;pendingGetter;constructor(e){this.owner=e,this.computedsByScope=new WeakMap}setValue(e){this.update({value:e})}setGetter(e){this.update({get:e})}setPendingGetter(e){this.pendingGetter=e,queueMicrotask((()=>this.consolidateGetter()))}consolidateGetter(){const e=this.pendingGetter;e&&(this.pendingGetter=void 0,this.update({get:e}))}getComputed(){const e=le()||qe;if(this.valueSignal||this.getterSignal||this.update({}),this.pendingGetter&&this.consolidateGetter(),!this.computedsByScope.has(e)){const t=()=>{const e=this.getterSignal?.value;return e?e.call(this.owner):this.valueSignal?.value};ue(Le(this.owner)),this.computedsByScope.set(e,K(we(t))),ae()}return this.computedsByScope.get(e)}update({get:e,value:t}){this.valueSignal?t===this.valueSignal.peek()&&e===this.getterSignal.peek()||H((()=>{this.valueSignal.value=t,this.getterSignal.value=e})):(this.valueSignal=V(t),this.getterSignal=V(e))}}const ze=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter((e=>"symbol"==typeof e))),Ge=new WeakMap,Be=(e,t)=>Ge.has(e)&&Ge.get(e).has(t),Je=(e,t,n)=>{Ge.has(e)||Ge.set(e,new Map),t="number"==typeof t?`${t}`:t;const r=Ge.get(e);if(!r.has(t)){const o=Le(e),i=new Ve(e);if(r.set(t,i),n){const{get:e,value:t}=n;e?i.setGetter(e):i.setValue(Re(t)?Qe(o,t):t)}}return r.get(t)},Ke=new WeakMap;let Ye=!1;const Xe=Symbol("PENDING_GETTER"),Ze={get(e,t,n){if(Ye||!e.hasOwnProperty(t)&&t in e||"symbol"==typeof t&&ze.has(t))return Reflect.get(e,t,n);const r=Object.getOwnPropertyDescriptor(e,t),o=Je(n,t,r).getComputed().value;if(o===Xe)throw Xe;if("function"==typeof o){const e=Le(n);return(...t)=>{ue(e);try{return o.call(n,...t)}finally{ae()}}}return o},set(e,t,n,r){ue(Le(r));try{return Reflect.set(e,t,n,r)}finally{ae()}},defineProperty(e,t,n){const r=!(t in e),o=Reflect.defineProperty(e,t,n);if(o){const o=De(e),i=Je(o,t),{get:s,value:u}=n;if(s)i.setGetter(s);else{const e=Le(o);i.setValue(Re(u)?Qe(e,u):u)}if(r&&Ke.has(e)&&Ke.get(e).value++,Array.isArray(e)&&Ge.get(o)?.has("length")){Je(o,"length").setValue(e.length)}}return o},deleteProperty(e,t){const n=Reflect.deleteProperty(e,t);if(n){Je(De(e),t).setValue(void 0),Ke.has(e)&&Ke.get(e).value++}return n},ownKeys:e=>(Ke.has(e)||Ke.set(e,V(0)),Ke._=Ke.get(e).value,Reflect.ownKeys(e))},Qe=(e,t)=>We(e,t,Ze),et=(e,t,n=!0)=>{if(!Pe(e)||!Pe(t))return;let r=!1;for(const o in t){const i=!(o in e);r=r||i;const s=Object.getOwnPropertyDescriptor(t,o),u=De(e),a=!!u&&Be(u,o)&&Je(u,o);if("function"==typeof s.get||"function"==typeof s.set)(n||i)&&(Object.defineProperty(e,o,{...s,configurable:!0,enumerable:!0}),s.get&&a&&a.setPendingGetter(s.get));else if(Pe(t[o])){const r=Object.getOwnPropertyDescriptor(e,o)?.value;if(i||n&&!Pe(r)){if(e[o]={},a){const t=Le(u);a.setValue(Qe(t,e[o]))}et(e[o],t[o],n)}else Pe(r)&&et(e[o],t[o],n)}else if((n||i)&&(Object.defineProperty(e,o,s),a)){const{value:e}=s,t=Le(u);a.setValue(Re(e)?Qe(t,e):e)}}r&&Ke.has(e)&&Ke.get(e).value++},tt=(e,t,n=!0)=>H((()=>{return et((r=e,$e.get(r)||e),t,n);var r})),nt=new WeakSet,rt={get:(e,t,n)=>{const r=Reflect.get(e,t),o=Le(n);if(void 0===r&&nt.has(n)){const n={};return Reflect.set(e,t,n),ot(o,n,!1)}if("function"==typeof r){ue(o);const e=we(r);return ae(),e}return Pe(r)&&Re(r)?ot(o,r,!1):r}},ot=(e,t,n=!0)=>{const r=We(e,t,rt);return r&&n&&nt.add(r),r},it=new WeakMap,st=new WeakMap,ut=new WeakSet,at=Reflect.getOwnPropertyDescriptor,ct={get:(e,t)=>{const n=st.get(e),r=e[t];return t in e?r:n[t]},set:(e,t,n)=>{const r=st.get(e);return(t in e||!(t in r)?e:r)[t]=n,!0},ownKeys:e=>[...new Set([...Object.keys(st.get(e)),...Object.keys(e)])],getOwnPropertyDescriptor:(e,t)=>at(e,t)||at(st.get(e),t),has:(e,t)=>Reflect.has(e,t)||Reflect.has(st.get(e),t)},lt=(e,t={})=>{if(ut.has(e))throw Error("This object cannot be proxified.");if(st.set(e,t),!it.has(e)){const t=new Proxy(e,ct);it.set(e,t),ut.add(t)}return it.get(e)},ft=new Map,_t=new Map,pt=new Map,ht=new Map,dt=new Map,vt=e=>ht.get(e||se())||{};function yt(e){const t=e||se();return dt.has(t)||dt.set(t,{}),yt.subscribe=je.value,He(dt.get(t))}yt.subscribe=0;const gt="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function mt(e,{state:t={},...n}={},{lock:r=!1}={}){if(ft.has(e)){if(r===gt||pt.has(e)){const t=pt.get(e);if(!(r===gt||!0!==r&&r===t))throw t?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else pt.set(e,r);const o=_t.get(e);tt(o,n),tt(o.state,t)}else{r!==gt&&pt.set(e,r);const o={state:Qe(e,Pe(t)?t:{}),...n},i=ot(e,o);_t.set(e,o),ft.set(e,i)}return ft.get(e)}const wt=(e=document)=>{const t=e.getElementById("wp-script-module-data-@wordpress/interactivity")??e.getElementById("wp-interactivity-data");if(t?.textContent)try{return JSON.parse(t.textContent)}catch{}return{}},bt=e=>{dt.clear(),ht.clear(),Pe(e?.state)&&Object.entries(e.state).forEach((([e,t])=>{const n=mt(e,{},{lock:gt});tt(n.state,t,!1),dt.set(e,t)})),Pe(e?.config)&&Object.entries(e.config).forEach((([e,t])=>{ht.set(e,t)})),Pe(e?.derivedStateClosures)&&Object.entries(e.derivedStateClosures).forEach((([e,t])=>{const n=mt(e,{},{lock:gt});t.forEach((e=>{const t=e.split("."),r=t.splice(-1,1)[0],o=t.reduce(((e,t)=>((e,t)=>{Ye=!0;try{return e[t]}finally{Ye=!1}})(e,t)),n),i=Object.getOwnPropertyDescriptor(o,r);Pe(i?.value)&&(o[r]=Xe)}))}))},kt=wt();function St(e){return null!==e.suffix}function xt(e){return null===e.suffix}bt(kt);const Et=(0,u.q6)({client:{},server:{}}),Tt={},Ot={},Pt=(e,t,{priority:n=10}={})=>{Tt[e]=t,Ot[e]=n},Ft=({scope:e})=>(t,...n)=>{let{value:r,namespace:o}=t;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));fe(e);const s=((e,t)=>{if(!t)return void Oe();let n=ft.get(t);void 0===n&&(n=mt(t,{},{lock:gt}));const r={...n,context:le().context[t]};try{return e.split(".").reduce(((e,t)=>e[t]),r)}catch(e){if(e===Xe)return Xe}})(r,o);if("function"==typeof s){if(i){Oe();const e=!s(...n);return _e(),e}_e();const t=(...t)=>{fe(e);const n=s(...t);return _e(),n};if(s.sync){t.sync=!0}return t}const u=s;return _e(),i&&s!==Xe?!u:u},Ct=({directives:e,priorityLevels:[t,...n],element:r,originalProps:o,previousScope:i})=>{const s=b({}).current;s.evaluate=S(Ft({scope:s}),[]);const{client:a,server:c}=x(Et);s.context=a,s.serverContext=c,s.ref=i?.ref||b(null),r=(0,u.Ob)(r,{ref:s.ref}),s.attributes=r.props;const l=n.length>0?(0,u.h)(Ct,{directives:e,priorityLevels:n,element:r,originalProps:o,previousScope:s}):r,f={...o,children:l},_={directives:e,props:f,element:r,context:Et,evaluate:s.evaluate};fe(s);for(const e of t){const t=Tt[e]?.(_);void 0!==t&&(f.children=t)}return _e(),f.children},Mt=u.fF.vnode;u.fF.vnode=e=>{if(e.props.__directives){const t=e.props,n=t.__directives;n.key&&(e.key=n.key.find(xt).value),delete t.__directives;const r=(e=>{const t=Object.keys(e).reduce(((e,t)=>{if(Tt[t]){const n=Ot[t];(e[n]=e[n]||[]).push(t)}return e}),{});return Object.entries(t).sort((([e],[t])=>parseInt(e)-parseInt(t))).map((([,e])=>e))})(n);r.length>0&&(e.props={directives:n,priorityLevels:r,originalProps:t,type:e.type,element:(0,u.h)(e.type,t),top:!0},e.type=Ct)}Mt&&Mt(e)};function Nt(e){return new Proxy(e,{get(e,t,n){const r=e[t];return r instanceof Function?function(...t){return r.apply(this===n?e:this,t)}:r}})}const jt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ht=/\/\*[^]*?\*\/| +/g,It=/\n+/g,$t=e=>({directives:t,evaluate:n})=>{t[`on-${e}`].filter(St).forEach((t=>{const r=t.suffix.split("--",2)[0];ke((()=>{const o=e=>{const r=n(t);"function"==typeof r&&(r?.sync||(e=Nt(e)),r(e))},i="window"===e?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},At=(e,t,n,r,o)=>{const i={...e.client,[t]:{...e.client[t],[r]:n}},s={...le(),context:i,serverContext:e.server};return o?Ft({scope:s})(o):n},Ut=e=>({directives:t,evaluate:n})=>{t[`on-async-${e}`].filter(St).forEach((t=>{const r=t.suffix.split("--",1)[0];ke((()=>{const o=async e=>{await ge();const r=n(t);"function"==typeof r&&r(e)},i="window"===e?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},Wt=new Map;const Dt="data-wp-",Lt=[],Rt=/[^a-z0-9-_]/i;const qt=/^([\w_\/-]+)::(.+)$/,Vt=new WeakSet;function zt(e){const t=new Set,n=new Set,r=document.createTreeWalker(e,205);const o=function e(o){const{nodeType:i}=o;if(3===i)return o.data;if(4===i)return n.add(o),o.nodeValue;if(8===i||7===i)return t.add(o),null;const s=o,{attributes:a}=s,c=s.localName,l={},f=[],_=[];let p=!1,h=!1;for(let e=0;e<a.length;e++){const t=a[e].name,n=a[e].value;if(t[8]&&t.slice(0,8)===Dt)if("data-wp-ignore"===t)p=!0;else{const e=qt.exec(n),r=e?.[1]??null;let o=e?.[2]??n;try{const e=JSON.parse(o);d=e,o=Boolean(d&&"object"==typeof d&&d.constructor===Object)?e:o}catch{}if("data-wp-interactive"===t){h=!0;const e="string"==typeof o?o:"string"==typeof o?.namespace?o.namespace:null;Lt.push(e)}else _.push([t,r,o])}else if("ref"===t)continue;l[t]=n}var d;if(p&&!h)return[(0,u.h)(c,{...l,innerHTML:s.innerHTML,__directives:{ignore:!0}})];if(h&&Vt.add(s),_.length){l.__directives=_.reduce(((e,[t,n,r])=>{const o=function(e){const t=e.substring(8);if(Rt.test(t))return null;const n=t.indexOf("--");if(-1===n)return{prefix:t,suffix:null,uniqueId:null};const r=t.substring(0,n),o=t.substring(n);if(o.startsWith("---")&&"-"!==o[3])return{prefix:r,suffix:null,uniqueId:o.substring(3)||null};let i=o.substring(2);const s=i.indexOf("---");if(-1!==s&&"-"!==i.substring(s)[3]){const e=i.substring(s+3)||null;return i=i.substring(0,s)||null,{prefix:r,suffix:i,uniqueId:e}}return{prefix:r,suffix:i||null,uniqueId:null}}(t);if(null===o)return e;const{prefix:i,suffix:s,uniqueId:u}=o;return e[i]=e[i]||[],e[i].push({namespace:n??Lt[Lt.length-1]??null,value:r,suffix:s,uniqueId:u}),e}),{});for(const e in l.__directives)l.__directives[e].sort(((e,t)=>{const n=e.suffix??"",r=t.suffix??"";if(n!==r)return n<r?-1:1;const o=e.uniqueId??"",i=t.uniqueId??"";return+(o>i)-+(o<i)}))}if(l.__directives?.["each-child"])l.dangerouslySetInnerHTML={__html:s.innerHTML};else if("template"===c)l.content=[...s.content.childNodes].map((e=>zt(e)));else{let t=r.firstChild();if(t){for(;t;){const n=e(t);n&&f.push(n),t=r.nextSibling()}r.parentNode()}}return h&&Lt.pop(),(0,u.h)(c,l,f)}(r.currentNode);return t.forEach((e=>e.remove())),n.forEach((e=>e.replaceWith(new window.Text(e.nodeValue??"")))),o}const Gt=new WeakMap,Bt=e=>{const t=Array.isArray(e)?e[0]:e;if(!t.parentElement)throw Error("The passed region should be an element with a parent.");return Gt.has(t)||Gt.set(t,((e,t)=>{const n=(t=[].concat(t))[t.length-1].nextSibling;function r(t,r){e.insertBefore(t,r||n)}return e.__k={nodeType:1,parentNode:e,firstChild:t[0],childNodes:t,insertBefore:r,appendChild:r,removeChild(t){e.removeChild(t)},contains(t){e.contains(t)}}})(t.parentElement,e)),Gt.get(t)},Jt=new WeakMap,Kt=e=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===e)return{getRegionRootFragment:Bt,initialVdom:Jt,toVdom:zt,directive:Pt,getNamespace:se,h:u.h,cloneElement:u.Ob,render:u.XX,proxifyState:Qe,parseServerData:wt,populateServerData:bt,batch:H,routerRegions:Wt,deepReadOnly:Ne,navigationSignal:je};throw new Error("Forbidden access.")};Pt("context",(({directives:{context:e},props:{children:t},context:n})=>{const r=e.filter(xt).reverse();if(!r.length)return;const{Provider:o}=n,{client:i,server:s}=x(n),a=b({}),c={},l={client:{...i},server:{...s}},f=new Set;return r.forEach((({value:e,namespace:t,uniqueId:n})=>{Pe(e)&&(a.current[t]||(a.current[t]=Qe(t,{})),tt(a.current[t],He(e),!1),c[t]=e,f.add(t))})),f.forEach((e=>{l.client[e]=lt(a.current[e],i[e]),l.server[e]=lt(c[e],s[e])})),(0,u.h)(o,{value:l},t)}),{priority:5}),Pt("watch",(({directives:{watch:e},evaluate:t})=>{e.forEach((e=>{be((()=>{let n=t(e);return"function"==typeof n&&(n=n()),n}))}))})),Pt("init",(({directives:{init:e},evaluate:t})=>{e.forEach((e=>{ke((()=>{let n=t(e);return"function"==typeof n&&(n=n()),n}))}))})),Pt("on",(({directives:{on:e},element:t,evaluate:n})=>{const r=new Map;e.filter(St).forEach((e=>{const t=e.suffix.split("--",2);r.has(t[0])||r.set(t[0],new Set),r.get(t[0]).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{o&&o(t),e.forEach((e=>{const r=n(e);"function"==typeof r&&(r?.sync||(t=Nt(t)),r(t))}))}}))})),Pt("on-async",(({directives:{"on-async":e},element:t,evaluate:n})=>{const r=new Map;e.filter(St).forEach((e=>{const t=e.suffix.split("--",1)[0];r.has(t)||r.set(t,new Set),r.get(t).add(e)})),r.forEach(((e,r)=>{const o=t.props[`on${r}`];t.props[`on${r}`]=t=>{o&&o(t),e.forEach((async e=>{await ge();const r=n(e);"function"==typeof r&&r(t)}))}}))})),Pt("on-window",$t("window")),Pt("on-document",$t("document")),Pt("on-async-window",Ut("window")),Pt("on-async-document",Ut("document")),Pt("class",(({directives:{class:e},element:t,evaluate:n})=>{e.filter(St).forEach((e=>{const r=e.uniqueId?`${e.suffix}---${e.uniqueId}`:e.suffix;let o=n(e);if(o===Xe)return;"function"==typeof o&&(o=o());const i=t.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(t.props.class=i?`${i} ${r}`:r):t.props.class=i.replace(s," ").trim(),ke((()=>{o?t.ref.current.classList.add(r):t.ref.current.classList.remove(r)}))}))})),Pt("style",(({directives:{style:e},element:t,evaluate:n})=>{e.filter(St).forEach((e=>{if(e.uniqueId)return;const r=e.suffix;let o=n(e);o!==Xe&&("function"==typeof o&&(o=o()),t.props.style=t.props.style||{},"string"==typeof t.props.style&&(t.props.style=(e=>{const t=[{}];let n,r;for(;n=jt.exec(e.replace(Ht,""));)n[4]?t.shift():n[3]?(r=n[3].replace(It," ").trim(),t.unshift(t[0][r]=t[0][r]||{})):t[0][n[1]]=n[2].replace(It," ").trim();return t[0]})(t.props.style)),o?t.props.style[r]=o:delete t.props.style[r],ke((()=>{o?t.ref.current.style.setProperty(r,o):t.ref.current.style.removeProperty(r)})))}))})),Pt("bind",(({directives:{bind:e},element:t,evaluate:n})=>{e.filter(St).forEach((e=>{if(e.uniqueId)return;const r=e.suffix;let o=n(e);o!==Xe&&("function"==typeof o&&(o=o()),t.props[r]=o,ke((()=>{const e=t.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in e)try{return void(e[r]=null==o?"":o)}catch(e){}null==o||!1===o&&"-"!==r[4]?e.removeAttribute(r):e.setAttribute(r,o)}else"string"==typeof o&&(e.style.cssText=o)})))}))})),Pt("ignore",(({element:{type:e,props:{innerHTML:t,...n}}})=>{const r=k((()=>t),[]);return(0,u.h)(e,{dangerouslySetInnerHTML:{__html:r},...n})})),Pt("text",(({directives:{text:e},element:t,evaluate:n})=>{const r=e.filter(xt);r.length&&r.forEach((e=>{if(!e.uniqueId)try{let r=n(e);if(r===Xe)return;"function"==typeof r&&(r=r()),t.props.children="object"==typeof r?null:r.toString()}catch(e){t.props.children=null}}))})),Pt("run",(({directives:{run:e},evaluate:t})=>{e.forEach((e=>{let n=t(e);return"function"==typeof n&&(n=n()),n}))})),Pt("each",(({directives:{each:e,"each-key":t},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,s=x(n),[a]=e,{namespace:c,suffix:l,uniqueId:f}=a;if(e.length>1)return;if(f)return;let _=o(a);if(_===Xe)return;if("function"==typeof _&&(_=_()),"function"!=typeof _?.[Symbol.iterator])return;const p=l?l.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()})):"item",h=[],d=function*(e,t,n,r,o){const{current:i}=b(new Map);for(const s of n){const n=At(e,t,s,r,o);i.has(n)||i.set(n,lt(Qe(t,{[r]:void 0}),e.client[t])),yield[s,i.get(n),n]}}(s,c,_,p,t?.[0]);for(const[e,t,n]of d){const o={client:{...s.client,[c]:t},server:{...s.server}};o.client[c][p]=e,h.push((0,u.h)(i,{value:o,key:n},r.props.content))}return h}),{priority:20}),Pt("each-child",(({directives:{"each-child":e},element:t,evaluate:n})=>{const r=e.find(xt);if(r)return n(r)===Xe?t:null}),{priority:1}),Pt("router-region",(({directives:{"router-region":e}})=>{const t=e.find(xt);if(!t)return;if(t.suffix)return;if(t.uniqueId)return;const n="string"==typeof t.value?t.value:t.value.id;Wt.has(n)||Wt.set(n,V());const r=Wt.get(n).value;if(w((()=>{r&&"string"!=typeof r.type&&(de.value=de.peek()+1)}),[r]),r&&"string"!=typeof r.type){const e=le();return(0,u.Ob)(r,{previousScope:e})}return r}),{priority:1}),(async()=>{const e=document.querySelectorAll("[data-wp-interactive]");await new Promise((e=>{setTimeout(e,0)}));for(const t of e)if(!Vt.has(t)){await ge();const e=Bt(t),n=zt(t);Jt.set(t,n),await ge(),(0,u.Qv)(n,e)}})()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};n.d(r,{zj:()=>k.zj,SD:()=>k.SD,V6:()=>k.V6,$K:()=>k.$K,vT:()=>k.vT,jb:()=>k.jb,yT:()=>k.yT,M_:()=>k.M_,hb:()=>k.hb,vJ:()=>k.vJ,ip:()=>k.ip,Nf:()=>k.Nf,Kr:()=>k.Kr,li:()=>k.li,J0:()=>k.J0,FH:()=>k.FH,v4:()=>k.v4,mh:()=>k.mh});var o,i=n(622);null!=(o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&o.__PREACT_DEVTOOLS__&&o.__PREACT_DEVTOOLS__.attachPreact("10.27.2",i.fF,{Fragment:i.FK,Component:i.uA});var s={};function u(e){return e.type===i.FK?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var a=[],c=[];function l(){return a.length>0?a[a.length-1]:null}var f=!0;function _(e){return"function"==typeof e.type&&e.type!=i.FK}function p(e){for(var t=[e],n=e;null!=n.__o;)t.push(n.__o),n=n.__o;return t.reduce((function(e,t){e+=" in "+u(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":f&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),f=!1,e+"\n"}),"")}var h="function"==typeof WeakMap;function d(e){var t=[];return e.__k?(e.__k.forEach((function(e){e&&"function"==typeof e.type?t.push.apply(t,d(e)):e&&"string"==typeof e.type&&t.push(e.type)})),t):t}function v(e){return e?"function"==typeof e.type?null==e.__?null!=e.__e&&null!=e.__e.parentNode?e.__e.parentNode.localName:"":v(e.__):e.type:""}var y=i.uA.prototype.setState;function g(e){return"table"===e||"tfoot"===e||"tbody"===e||"thead"===e||"td"===e||"tr"===e||"th"===e}i.uA.prototype.setState=function(e,t){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+p(l())),y.call(this,e,t)};var m=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,w=i.uA.prototype.forceUpdate;function b(e){var t=e.props,n=u(e),r="";for(var o in t)if(t.hasOwnProperty(o)&&"children"!==o){var i=t[o];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),r+=" "+o+"="+JSON.stringify(i)}var s=t.children;return"<"+n+r+(s&&s.length?">..</"+n+">":" />")}i.uA.prototype.forceUpdate=function(e){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+p(l())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+p(this.__v)),w.call(this,e)},i.fF.__m=function(e,t){var n=e.type,r=t.map((function(e){return e&&e.localName})).filter(Boolean);console.error('Expected a DOM node of type "'+n+'" but found "'+r.join(", ")+"\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+p(e))},function(){!function(){var e=i.fF.__b,t=i.fF.diffed,n=i.fF.__,r=i.fF.vnode,o=i.fF.__r;i.fF.diffed=function(e){_(e)&&c.pop(),a.pop(),t&&t(e)},i.fF.__b=function(t){_(t)&&a.push(t),e&&e(t)},i.fF.__=function(e,t){c=[],n&&n(e,t)},i.fF.vnode=function(e){e.__o=c.length>0?c[c.length-1]:null,r&&r(e)},i.fF.__r=function(e){_(e)&&c.push(e),o&&o(e)}}();var e=!1,t=i.fF.__b,n=i.fF.diffed,r=i.fF.vnode,o=i.fF.__r,l=i.fF.__e,f=i.fF.__,y=i.fF.__h,w=h?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];i.fF.__e=function(e,t,n,r){if(t&&t.__c&&"function"==typeof e.then){var o=e;e=new Error("Missing Suspense. The throwing component was: "+u(t));for(var i=t;i;i=i.__)if(i.__c&&i.__c.__c){e=o;break}if(e instanceof Error)throw e}try{(r=r||{}).componentStack=p(t),l(e,t,n,r),"function"!=typeof e.then&&setTimeout((function(){throw e}))}catch(e){throw e}},i.fF.__=function(e,t){if(!t)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var n;switch(t.nodeType){case 1:case 11:case 9:n=!0;break;default:n=!1}if(!n){var r=u(e);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+t+" instead: render(<"+r+" />, "+t+");")}f&&f(e,t)},i.fF.__b=function(n){var r=n.type;if(e=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+b(n)+"\n\n"+p(n));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+u(n)+" = "+b(r)+";\n let vnode = <My"+u(n)+" />;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+p(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==n.ref&&"function"!=typeof n.ref&&"object"!=typeof n.ref&&!("$$typeof"in n))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof n.ref+"] instead\n"+b(n)+"\n\n"+p(n));if("string"==typeof n.type)for(var o in n.props)if("o"===o[0]&&"n"===o[1]&&"function"!=typeof n.props[o]&&null!=n.props[o])throw new Error("Component's \""+o+'" property should be a function, but got ['+typeof n.props[o]+"] instead\n"+b(n)+"\n\n"+p(n));if("function"==typeof n.type&&n.type.propTypes){if("Lazy"===n.type.displayName&&w&&!w.lazyPropTypes.has(n.type)){var i="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var a=n.type();w.lazyPropTypes.set(n.type,!0),console.warn(i+"Component wrapped in lazy() is "+u(a))}catch(e){console.warn(i+"We will log the wrapped component's name once it is loaded.")}}var c=n.props;n.type.__f&&delete(c=function(e,t){for(var n in t)e[n]=t[n];return e}({},c)).ref,function(e,t,n,r,o){Object.keys(e).forEach((function(n){var i;try{i=e[n](t,n,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){i=e}i&&!(i.message in s)&&(s[i.message]=!0,console.error("Failed prop type: "+i.message+(o&&"\n"+o()||"")))}))}(n.type.propTypes,c,0,u(n),(function(){return p(n)}))}t&&t(n)};var S,x=0;i.fF.__r=function(t){o&&o(t),e=!0;var n=t.__c;if(n===S?x++:x=1,x>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+u(t));S=n},i.fF.__h=function(t,n,r){if(!t||!e)throw new Error("Hook can only be invoked from render methods.");y&&y(t,n,r)};var E=function(e,t){return{get:function(){var n="get"+e+t;k&&k.indexOf(n)<0&&(k.push(n),console.warn("getting vnode."+e+" is deprecated, "+t))},set:function(){var n="set"+e+t;k&&k.indexOf(n)<0&&(k.push(n),console.warn("setting vnode."+e+" is not allowed, "+t))}}},T={nodeName:E("nodeName","use vnode.type"),attributes:E("attributes","use vnode.props"),children:E("children","use vnode.props.children")},O=Object.create({},T);i.fF.vnode=function(e){var t=e.props;if(null!==e.type&&null!=t&&("__source"in t||"__self"in t)){var n=e.props={};for(var o in t){var i=t[o];"__source"===o?e.__source=i:"__self"===o?e.__self=i:n[o]=i}}e.__proto__=O,r&&r(e)},i.fF.diffed=function(t){var r,o=t.type,i=t.__;if(t.__k&&t.__k.forEach((function(e){if("object"==typeof e&&e&&void 0===e.type){var n=Object.keys(e).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+n+"}.\n\n"+p(t))}})),t.__c===S&&(x=0),"string"==typeof o&&(g(o)||"p"===o||"a"===o||"button"===o)){var s=v(i);if(""!==s&&g(o))"table"===o&&"td"!==s&&g(s)?console.error("Improper nesting of table. Your <table> should not have a table-node parent."+b(t)+"\n\n"+p(t)):"thead"!==o&&"tfoot"!==o&&"tbody"!==o||"table"===s?"tr"===o&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot> parent."+b(t)+"\n\n"+p(t)):"td"===o&&"tr"!==s?console.error("Improper nesting of table. Your <td> should have a <tr> parent."+b(t)+"\n\n"+p(t)):"th"===o&&"tr"!==s&&console.error("Improper nesting of table. Your <th> should have a <tr>."+b(t)+"\n\n"+p(t)):console.error("Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent."+b(t)+"\n\n"+p(t));else if("p"===o){var a=d(t).filter((function(e){return m.test(e)}));a.length&&console.error("Improper nesting of paragraph. Your <p> should not have "+a.join(", ")+" as child-elements."+b(t)+"\n\n"+p(t))}else"a"!==o&&"button"!==o||-1!==d(t).indexOf(o)&&console.error("Improper nesting of interactive content. Your <"+o+"> should not have other "+("a"===o?"anchor":"button")+" tags as child-elements."+b(t)+"\n\n"+p(t))}if(e=!1,n&&n(t),null!=t.__k)for(var c=[],l=0;l<t.__k.length;l++){var f=t.__k[l];if(f&&null!=f.key){var _=f.key;if(-1!==c.indexOf(_)){console.error('Following component has two or more children with the same key attribute: "'+_+'". This may cause glitches and misbehavior in rendering process. Component: \n\n'+b(t)+"\n\n"+p(t));break}c.push(_)}}if(null!=t.__c&&null!=t.__c.__H){var h=t.__c.__H.__;if(h)for(var y=0;y<h.length;y+=1){var w=h[y];if(w.__H)for(var k=0;k<w.__H.length;k++)if((r=w.__H[k])!=r){var E=u(t);console.warn("Invalid argument passed to hook. Hooks should not be called with NaN in the dependency array. Hook index "+y+" in component "+E+" was called with NaN.")}}}}}();var k=n(676),S=r.zj,x=r.SD,E=r.V6,T=r.$K,O=r.vT,P=r.jb,F=r.yT,C=r.M_,M=r.hb,N=r.vJ,j=r.ip,H=r.Nf,I=r.Kr,$=r.li,A=r.J0,U=r.FH,W=r.v4,D=r.mh;export{S as getConfig,x as getContext,E as getElement,T as getServerContext,O as getServerState,P as privateApis,F as splitTask,C as store,M as useCallback,N as useEffect,j as useInit,H as useLayoutEffect,I as useMemo,$ as useRef,A as useState,U as useWatch,W as withScope,D as withSyncEvent}; script-modules/interactivity/index.min.js 0000644 00000120164 15144410747 0014656 0 ustar 00 var t={622:(t,e,n)=>{n.d(e,{Ob:()=>z,Qv:()=>B,XX:()=>V,fF:()=>o,h:()=>x,q6:()=>J,uA:()=>E,zO:()=>s});var r,o,i,s,u,c,l,_,a,f,p,h,d,v={},y=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function w(t,e){for(var n in e)t[n]=e[n];return t}function b(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function x(t,e,n){var o,i,s,u={};for(s in e)"key"==s?o=e[s]:"ref"==s?i=e[s]:u[s]=e[s];if(arguments.length>2&&(u.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===u[s]&&(u[s]=t.defaultProps[s]);return S(t,u,o,i,null)}function S(t,e,n,r,s){var u={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++i:s,__i:-1,__u:0};return null==s&&null!=o.vnode&&o.vnode(u),u}function k(t){return t.children}function E(t,e){this.props=t,this.context=e}function P(t,e){if(null==e)return t.__?P(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?P(t):null}function C(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return C(t)}}function O(t){(!t.__d&&(t.__d=!0)&&u.push(t)&&!M.__r++||c!=o.debounceRendering)&&((c=o.debounceRendering)||l)(M)}function M(){for(var t,e,n,r,i,s,c,l=1;u.length;)u.length>l&&u.sort(_),t=u.shift(),l=u.length,t.__d&&(n=void 0,r=void 0,i=(r=(e=t).__v).__e,s=[],c=[],e.__P&&((n=w({},r)).__v=r.__v+1,o.vnode&&o.vnode(n),U(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,s,null==i?P(r):i,!!(32&r.__u),c),n.__v=r.__v,n.__.__k[n.__i]=n,A(s,n,c),r.__e=r.__=null,n.__e!=i&&C(n)));M.__r=0}function T(t,e,n,r,o,i,s,u,c,l,_){var a,f,p,h,d,g,m,w=r&&r.__k||y,b=e.length;for(c=N(n,e,w,c,b),a=0;a<b;a++)null!=(p=n.__k[a])&&(f=-1==p.__i?v:w[p.__i]||v,p.__i=a,g=U(t,p,f,o,i,s,u,c,l,_),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&D(f.ref,null,p),_.push(p.ref,p.__c||h,p)),null==d&&null!=h&&(d=h),(m=!!(4&p.__u))||f.__k===p.__k?c=j(p,c,t,m):"function"==typeof p.type&&void 0!==g?c=g:h&&(c=h.nextSibling),p.__u&=-7);return n.__e=d,c}function N(t,e,n,r,o){var i,s,u,c,l,_=n.length,a=_,f=0;for(t.__k=new Array(o),i=0;i<o;i++)null!=(s=e[i])&&"boolean"!=typeof s&&"function"!=typeof s?(c=i+f,(s=t.__k[i]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?S(null,s,null,null,null):m(s)?S(k,{children:s},null,null,null):null==s.constructor&&s.__b>0?S(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,u=null,-1!=(l=s.__i=$(s,n,c,a))&&(a--,(u=n[l])&&(u.__u|=2)),null==u||null==u.__v?(-1==l&&(o>_?f--:o<_&&f++),"function"!=typeof s.type&&(s.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,s.__u|=4))):t.__k[i]=null;if(a)for(i=0;i<_;i++)null!=(u=n[i])&&!(2&u.__u)&&(u.__e==r&&(r=P(u)),R(u,u));return r}function j(t,e,n,r){var o,i;if("function"==typeof t.type){for(o=t.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=t,e=j(o[i],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=P(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function $(t,e,n,r){var o,i,s,u=t.key,c=t.type,l=e[n],_=null!=l&&!(2&l.__u);if(null===l&&null==t.key||_&&u==l.key&&c==l.type)return n;if(r>(_?1:0))for(o=n-1,i=n+1;o>=0||i<e.length;)if(null!=(l=e[s=o>=0?o--:i++])&&!(2&l.__u)&&u==l.key&&c==l.type)return s;return-1}function H(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||g.test(e)?n:n+"px"}function W(t,e,n,r,o){var i,s;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||H(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||H(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])i=e!=(e=e.replace(a,"$1")),s=e.toLowerCase(),e=s in t||"onFocusOut"==e||"onFocusIn"==e?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=f,t.addEventListener(e,i?h:p,i)):t.removeEventListener(e,i?h:p,i);else{if("http://www.w3.org/2000/svg"==o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function I(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e.t)e.t=f++;else if(e.t<n.u)return;return n(o.event?o.event(e):e)}}}function U(t,e,n,r,i,s,u,c,l,_){var a,f,p,h,d,v,y,g,x,S,P,C,O,M,N,j,$,H=e.type;if(null!=e.constructor)return null;128&n.__u&&(l=!!(32&n.__u),s=[c=e.__e=n.__e]),(a=o.__b)&&a(e);t:if("function"==typeof H)try{if(g=e.props,x="prototype"in H&&H.prototype.render,S=(a=H.contextType)&&r[a.__c],P=a?S?S.props.value:a.__:r,n.__c?y=(f=e.__c=n.__c).__=f.__E:(x?e.__c=f=new H(g,P):(e.__c=f=new E(g,P),f.constructor=H,f.render=G),S&&S.sub(f),f.props=g,f.state||(f.state={}),f.context=P,f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),x&&null==f.__s&&(f.__s=f.state),x&&null!=H.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=w({},f.__s)),w(f.__s,H.getDerivedStateFromProps(g,f.__s))),h=f.props,d=f.state,f.__v=e,p)x&&null==H.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),x&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(x&&null==H.getDerivedStateFromProps&&g!==h&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(g,P),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(g,f.__s,P)||e.__v==n.__v){for(e.__v!=n.__v&&(f.props=g,f.state=f.__s,f.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some((function(t){t&&(t.__=e)})),C=0;C<f._sb.length;C++)f.__h.push(f._sb[C]);f._sb=[],f.__h.length&&u.push(f);break t}null!=f.componentWillUpdate&&f.componentWillUpdate(g,f.__s,P),x&&null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(h,d,v)}))}if(f.context=P,f.props=g,f.__P=t,f.__e=!1,O=o.__r,M=0,x){for(f.state=f.__s,f.__d=!1,O&&O(e),a=f.render(f.props,f.state,f.context),N=0;N<f._sb.length;N++)f.__h.push(f._sb[N]);f._sb=[]}else do{f.__d=!1,O&&O(e),a=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++M<25);f.state=f.__s,null!=f.getChildContext&&(r=w(w({},r),f.getChildContext())),x&&!p&&null!=f.getSnapshotBeforeUpdate&&(v=f.getSnapshotBeforeUpdate(h,d)),j=a,null!=a&&a.type===k&&null==a.key&&(j=L(a.props.children)),c=T(t,m(j)?j:[j],e,n,r,i,s,u,c,l,_),f.base=e.__e,e.__u&=-161,f.__h.length&&u.push(f),y&&(f.__E=f.__=null)}catch(t){if(e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;c&&8==c.nodeType&&c.nextSibling;)c=c.nextSibling;s[s.indexOf(c)]=null,e.__e=c}else{for($=s.length;$--;)b(s[$]);F(e)}else e.__e=n.__e,e.__k=n.__k,t.then||F(e);o.__e(t,e,n)}else null==s&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):c=e.__e=q(n.__e,e,n,r,i,s,u,l,_);return(a=o.diffed)&&a(e),128&e.__u?void 0:c}function F(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(F)}function A(t,e,n){for(var r=0;r<n.length;r++)D(n[r],n[++r],n[++r]);o.__c&&o.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){o.__e(t,e.__v)}}))}function L(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:m(t)?t.map(L):w({},t)}function q(t,e,n,i,s,u,c,l,_){var a,f,p,h,d,y,g,w=n.props,x=e.props,S=e.type;if("svg"==S?s="http://www.w3.org/2000/svg":"math"==S?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=u)for(a=0;a<u.length;a++)if((d=u[a])&&"setAttribute"in d==!!S&&(S?d.localName==S:3==d.nodeType)){t=d,u[a]=null;break}if(null==t){if(null==S)return document.createTextNode(x);t=document.createElementNS(s,S,x.is&&x),l&&(o.__m&&o.__m(e,u),l=!1),u=null}if(null==S)w===x||l&&t.data==x||(t.data=x);else{if(u=u&&r.call(t.childNodes),w=n.props||v,!l&&null!=u)for(w={},a=0;a<t.attributes.length;a++)w[(d=t.attributes[a]).name]=d.value;for(a in w)if(d=w[a],"children"==a);else if("dangerouslySetInnerHTML"==a)p=d;else if(!(a in x)){if("value"==a&&"defaultValue"in x||"checked"==a&&"defaultChecked"in x)continue;W(t,a,null,d,s)}for(a in x)d=x[a],"children"==a?h=d:"dangerouslySetInnerHTML"==a?f=d:"value"==a?y=d:"checked"==a?g=d:l&&"function"!=typeof d||w[a]===d||W(t,a,d,w[a],s);if(f)l||p&&(f.__html==p.__html||f.__html==t.innerHTML)||(t.innerHTML=f.__html),e.__k=[];else if(p&&(t.innerHTML=""),T("template"==e.type?t.content:t,m(h)?h:[h],e,n,i,"foreignObject"==S?"http://www.w3.org/1999/xhtml":s,u,c,u?u[0]:n.__k&&P(n,0),l,_),null!=u)for(a=u.length;a--;)b(u[a]);l||(a="value","progress"==S&&null==y?t.removeAttribute("value"):null!=y&&(y!==t[a]||"progress"==S&&!y||"option"==S&&y!=w[a])&&W(t,a,y,w[a],s),a="checked",null!=g&&g!=t[a]&&W(t,a,g,w[a],s))}return t}function D(t,e,n){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){o.__e(t,n)}}function R(t,e,n){var r,i;if(o.unmount&&o.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||D(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){o.__e(t,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&R(r[i],e,n||"function"!=typeof t.type);n||b(t.__e),t.__c=t.__=t.__e=void 0}function G(t,e,n){return this.constructor(t,n)}function V(t,e,n){var i,s,u,c;e==document&&(e=document.documentElement),o.__&&o.__(t,e),s=(i="function"==typeof n)?null:n&&n.__k||e.__k,u=[],c=[],U(e,t=(!i&&n||e).__k=x(k,null,[t]),s||v,v,e.namespaceURI,!i&&n?[n]:s?null:e.firstChild?r.call(e.childNodes):null,u,!i&&n?n:s?s.__e:e.firstChild,i,c),A(u,t,c)}function B(t,e){V(t,e,B)}function z(t,e,n){var o,i,s,u,c=w({},t.props);for(s in t.type&&t.type.defaultProps&&(u=t.type.defaultProps),e)"key"==s?o=e[s]:"ref"==s?i=e[s]:c[s]=void 0===e[s]&&null!=u?u[s]:e[s];return arguments.length>2&&(c.children=arguments.length>3?r.call(arguments,2):n),S(t.type,c,o||t.key,i||t.ref,null)}function J(t){function e(t){var n,r;return this.getChildContext||(n=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&n.forEach((function(t){t.__e=!0,O(t)}))},this.sub=function(t){n.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+d++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}r=y.slice,o={__e:function(t,e,n,r){for(var o,i,s;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),s=o.__d),s)return o.__E=o}catch(e){t=e}throw t}},i=0,s=function(t){return null!=t&&null==t.constructor},E.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=w({},this.state),"function"==typeof t&&(t=t(w({},n),this.props)),t&&w(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),O(this))},E.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),O(this))},E.prototype.render=k,u=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_=function(t,e){return t.__v.__b-e.__v.__b},M.__r=0,a=/(PointerCapture)$|Capture$/i,f=0,p=I(!1),h=I(!0),d=0}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};n.d(r,{zj:()=>ye,SD:()=>ht,V6:()=>dt,$K:()=>yt,vT:()=>ge,jb:()=>Xe,yT:()=>mt,M_:()=>we,hb:()=>Pt,vJ:()=>kt,ip:()=>St,Nf:()=>Et,Kr:()=>Ct,li:()=>x,J0:()=>m,FH:()=>xt,v4:()=>bt,mh:()=>Tt});var o,i,s,u,c=n(622),l=0,_=[],a=c.fF,f=a.__b,p=a.__r,h=a.diffed,d=a.__c,v=a.unmount,y=a.__;function g(t,e){a.__h&&a.__h(i,t,l||e),l=0;var n=i.__H||(i.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function m(t){return l=1,function(t,e,n){var r=g(o++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):j(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],n=r.t(e,t);e!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=i,!i.__f)){var s=function(t,e,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(t){return!!t.__c}));if(o.every((function(t){return!t.__N})))return!u||u.call(this,t,e,n);var i=r.__c.props!==t;return o.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(i=!0)}})),u&&u.call(this,t,e,n)||i};i.__f=!0;var u=i.shouldComponentUpdate,c=i.componentWillUpdate;i.componentWillUpdate=function(t,e,n){if(this.__e){var r=u;u=void 0,s(t,e,n),u=r}c&&c.call(this,t,e,n)},i.shouldComponentUpdate=s}return r.__N||r.__}(j,t)}function w(t,e){var n=g(o++,3);!a.__s&&N(n.__H,e)&&(n.__=t,n.u=e,i.__H.__h.push(n))}function b(t,e){var n=g(o++,4);!a.__s&&N(n.__H,e)&&(n.__=t,n.u=e,i.__h.push(n))}function x(t){return l=5,S((function(){return{current:t}}),[])}function S(t,e){var n=g(o++,7);return N(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function k(t,e){return l=8,S((function(){return t}),e)}function E(t){var e=i.context[t.__c],n=g(o++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(i)),e.props.value):t.__}function P(){for(var t;t=_.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(M),t.__H.__h.forEach(T),t.__H.__h=[]}catch(e){t.__H.__h=[],a.__e(e,t.__v)}}a.__b=function(t){i=null,f&&f(t)},a.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),y&&y(t,e)},a.__r=function(t){p&&p(t),o=0;var e=(i=t.__c).__H;e&&(s===i?(e.__h=[],i.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(M),e.__h.forEach(T),e.__h=[],o=0)),s=i},a.diffed=function(t){h&&h(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==_.push(e)&&u===a.requestAnimationFrame||((u=a.requestAnimationFrame)||O)(P)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),s=i=null},a.__c=function(t,e){e.some((function(t){try{t.__h.forEach(M),t.__h=t.__h.filter((function(t){return!t.__||T(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],a.__e(n,t.__v)}})),d&&d(t,e)},a.unmount=function(t){v&&v(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{M(t)}catch(t){e=t}})),n.__H=void 0,e&&a.__e(e,n.__v))};var C="function"==typeof requestAnimationFrame;function O(t){var e,n=function(){clearTimeout(r),C&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);C&&(e=requestAnimationFrame(n))}function M(t){var e=i,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),i=e}function T(t){var e=i;t.__c=t.__(),i=e}function N(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function j(t,e){return"function"==typeof e?e(t):e}var $=Symbol.for("preact-signals");function H(){if(L>1)L--;else{for(var t,e=!1;void 0!==A;){var n=A;for(A=void 0,q++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&B(n))try{n.c()}catch(n){e||(t=n,e=!0)}n=r}}if(q=0,L--,e)throw t}}function W(t){if(L>0)return t();L++;try{return t()}finally{H()}}var I=void 0;function U(t){var e=I;I=void 0;try{return t()}finally{I=e}}var F,A=void 0,L=0,q=0,D=0;function R(t){if(void 0!==I){var e=t.n;if(void 0===e||e.t!==I)return e={i:0,S:t,p:I.s,n:void 0,t:I,e:void 0,x:void 0,r:e},void 0!==I.s&&(I.s.n=e),I.s=e,t.n=e,32&I.f&&t.S(e),e;if(-1===e.i)return e.i=0,void 0!==e.n&&(e.n.p=e.p,void 0!==e.p&&(e.p.n=e.n),e.p=I.s,e.n=void 0,I.s.n=e,I.s=e),e}}function G(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=null==e?void 0:e.watched,this.Z=null==e?void 0:e.unwatched,this.name=null==e?void 0:e.name}function V(t,e){return new G(t,e)}function B(t){for(var e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function z(t){for(var e=t.s;void 0!==e;e=e.n){var n=e.S.n;if(void 0!==n&&(e.r=n),e.S.n=e,e.i=-1,void 0===e.n){t.s=e;break}}}function J(t){for(var e=t.s,n=void 0;void 0!==e;){var r=e.p;-1===e.i?(e.S.U(e),void 0!==r&&(r.n=e.n),void 0!==e.n&&(e.n.p=r)):n=e,e.S.n=e.r,void 0!==e.r&&(e.r=void 0),e=r}t.s=n}function K(t,e){G.call(this,void 0),this.x=t,this.s=void 0,this.g=D-1,this.f=4,this.W=null==e?void 0:e.watched,this.Z=null==e?void 0:e.unwatched,this.name=null==e?void 0:e.name}function X(t,e){return new K(t,e)}function Z(t){var e=t.u;if(t.u=void 0,"function"==typeof e){L++;var n=I;I=void 0;try{e()}catch(e){throw t.f&=-2,t.f|=8,Q(t),e}finally{I=n,H()}}}function Q(t){for(var e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,Z(t)}function Y(t){if(I!==this)throw new Error("Out-of-order effect");J(this),I=t,this.f&=-2,8&this.f&&Q(this),H()}function tt(t,e){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==e?void 0:e.name}function et(t,e){var n=new tt(t,e);try{n.c()}catch(t){throw n.d(),t}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function nt(t,e){c.fF[t]=e.bind(null,c.fF[t]||function(){})}function rt(t){F&&F(),F=t&&t.S()}function ot(t){var e=this,n=t.data,r=function(t){return S((function(){return V(t)}),[])}(n);r.value=n;var o=S((function(){for(var t=e.__v;t=t.__;)if(t.__c){t.__c.__$f|=4;break}return e.__$u.c=function(){var t,n=e.__$u.S(),r=o.value;n(),(0,c.zO)(r)||3!==(null==(t=e.base)?void 0:t.nodeType)?(e.__$f|=1,e.setState({})):e.base.data=r},X((function(){var t=r.value.value;return 0===t?0:!0===t?"":t||""}))}),[]);return o.value}function it(t,e,n,r){var o=e in t&&void 0===t.ownerSVGElement,i=V(n);return{o:function(t,e){i.value=t,r=e},d:et((function(){var n=i.value.value;r[e]!==n&&(r[e]=n,o?t[e]=n:n?t.setAttribute(e,n):t.removeAttribute(e))}))}}G.prototype.brand=$,G.prototype.h=function(){return!0},G.prototype.S=function(t){var e=this,n=this.t;n!==t&&void 0===t.e&&(t.x=n,this.t=t,void 0!==n?n.e=t:U((function(){var t;null==(t=e.W)||t.call(e)})))},G.prototype.U=function(t){var e=this;if(void 0!==this.t){var n=t.e,r=t.x;void 0!==n&&(n.x=r,t.e=void 0),void 0!==r&&(r.e=n,t.x=void 0),t===this.t&&(this.t=r,void 0===r&&U((function(){var t;null==(t=e.Z)||t.call(e)})))}},G.prototype.subscribe=function(t){var e=this;return et((function(){var n=e.value,r=I;I=void 0;try{t(n)}finally{I=r}}),{name:"sub"})},G.prototype.valueOf=function(){return this.value},G.prototype.toString=function(){return this.value+""},G.prototype.toJSON=function(){return this.value},G.prototype.peek=function(){var t=I;I=void 0;try{return this.value}finally{I=t}},Object.defineProperty(G.prototype,"value",{get:function(){var t=R(this);return void 0!==t&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(q>100)throw new Error("Cycle detected");this.v=t,this.i++,D++,L++;try{for(var e=this.t;void 0!==e;e=e.x)e.t.N()}finally{H()}}}}),K.prototype=new G,K.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===D)return!0;if(this.g=D,this.f|=1,this.i>0&&!B(this))return this.f&=-2,!0;var t=I;try{z(this),I=this;var e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return I=t,J(this),this.f&=-2,!0},K.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(var e=this.s;void 0!==e;e=e.n)e.S.S(e)}G.prototype.S.call(this,t)},K.prototype.U=function(t){if(void 0!==this.t&&(G.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(var e=this.s;void 0!==e;e=e.n)e.S.U(e)}},K.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;void 0!==t;t=t.x)t.t.N()}},Object.defineProperty(K.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=R(this);if(this.h(),void 0!==t&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),tt.prototype.c=function(){var t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var e=this.x();"function"==typeof e&&(this.u=e)}finally{t()}},tt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Z(this),z(this),L++;var t=I;return I=this,Y.bind(this,t)},tt.prototype.N=function(){2&this.f||(this.f|=2,this.o=A,A=this)},tt.prototype.d=function(){this.f|=8,1&this.f||Q(this)},tt.prototype.dispose=function(){this.d()},ot.displayName="_st",Object.defineProperties(G.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ot},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),nt("__b",(function(t,e){if("string"==typeof e.type){var n,r=e.props;for(var o in r)if("children"!==o){var i=r[o];i instanceof G&&(n||(e.__np=n={}),n[o]=i,r[o]=i.peek())}}t(e)})),nt("__r",(function(t,e){rt();var n,r=e.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(){var t;return et((function(){t=this})),t.c=function(){r.__$f|=1,r.setState({})},t}())),rt(n),t(e)})),nt("__e",(function(t,e,n,r){rt(),t(e,n,r)})),nt("diffed",(function(t,e){var n;if(rt(),"string"==typeof e.type&&(n=e.__e)){var r=e.__np,o=e.props;if(r){var i=n.U;if(i)for(var s in i){var u=i[s];void 0===u||s in r||(u.d(),i[s]=void 0)}else n.U=i={};for(var c in r){var l=i[c],_=r[c];void 0===l?(l=it(n,c,_,o),i[c]=l):l.o(_,o)}}}t(e)})),nt("unmount",(function(t,e){if("string"==typeof e.type){var n=e.__e;if(n){var r=n.U;if(r)for(var o in n.U=void 0,r){var i=r[o];i&&i.d()}}}else{var s=e.__c;if(s){var u=s.__$u;u&&(s.__$u=void 0,u.d())}}t(e)})),nt("__h",(function(t,e,n,r){(r<3||9===r)&&(e.__$f|=2),t(e,n,r)})),c.uA.prototype.shouldComponentUpdate=function(t,e){var n=this.__$u,r=n&&void 0!==n.s;for(var o in e)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(r||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(r||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var i in t)if("__source"!==i&&t[i]!==this.props[i])return!0;for(var s in this.props)if(!(s in t))return!0;return!1};const st=[],ut=()=>st.slice(-1)[0],ct=t=>{st.push(t)},lt=()=>{st.pop()},_t=[],at=()=>_t.slice(-1)[0],ft=t=>{_t.push(t)},pt=()=>{_t.pop()},ht=t=>at().context[t||ut()],dt=()=>{const t=at();const{ref:e,attributes:n}=t;return Object.freeze({ref:e.current,attributes:$t(n,{})})},vt=V(0);function yt(t){const e=at();return yt.subscribe=vt.value,Wt(e.serverContext[t||ut()])}yt.subscribe=0;const gt=t=>new Promise((e=>{const n=()=>{clearTimeout(r),window.cancelAnimationFrame(o),setTimeout((()=>{t(),e()}))},r=setTimeout(n,100),o=window.requestAnimationFrame(n)})),mt="function"==typeof window.scheduler?.yield?window.scheduler.yield.bind(window.scheduler):()=>new Promise((t=>{setTimeout(t,0)}));function wt(t){w((()=>{let e=null,n=!1;return e=function(t,e){let n=()=>{};const r=et((function(){return n=this.c.bind(this),this.x=t,this.c=e,t()}));return{flush:n,dispose:r}}(t,(async()=>{e&&!n&&(n=!0,await gt(e.flush),n=!1)})),e.dispose}),[])}function bt(t){const e=at(),n=ut();let r;r="GeneratorFunction"===t?.constructor?.name?async(...r)=>{const o=t(...r);let i,s,u;for(;;){ct(n),ft(e);try{s=u?o.throw(u):o.next(i),u=void 0}catch(t){throw t}finally{pt(),lt()}try{i=await s.value}catch(t){u=t}if(s.done){if(u)throw u;break}}return i}:(...r)=>{ct(n),ft(e);try{return t(...r)}finally{lt(),pt()}};if(t.sync){const t=r;return t.sync=!0,t}return r}function xt(t){wt(bt(t))}function St(t){w(bt(t),[])}function kt(t,e){w(bt(t),e)}function Et(t,e){b(bt(t),e)}function Pt(t,e){return k(bt(t),e)}function Ct(t,e){return S(bt(t),e)}const Ot=t=>{0},Mt=t=>Boolean(t&&"object"==typeof t&&t.constructor===Object);function Tt(t){const e=t;return e.sync=!0,e}const Nt=new WeakMap,jt=t=>{const e=()=>!1;return{get(e,n){const r=e[n];return r&&"object"==typeof r?$t(r,{errorMessage:t}):r},set:e,deleteProperty:e,defineProperty:e}};function $t(t,e){const n=e?.errorMessage??"Cannot modify read-only object";if(!Nt.has(t)){const e=jt(n);Nt.set(t,new Proxy(t,e))}return Nt.get(t)}const Ht=V(0);function Wt(t){return Mt(t)?Object.fromEntries(Object.entries(t).map((([t,e])=>[t,Wt(e)]))):Array.isArray(t)?t.map((t=>Wt(t))):t}const It=new WeakMap,Ut=new WeakMap,Ft=new WeakMap,At=new Set([Object,Array]),Lt=(t,e,n)=>{if(!Rt(e))throw Error("This object cannot be proxified.");if(!It.has(e)){const r=new Proxy(e,n);It.set(e,r),Ut.set(r,e),Ft.set(r,t)}return It.get(e)},qt=t=>It.get(t),Dt=t=>Ft.get(t),Rt=t=>"object"==typeof t&&null!==t&&(!Ft.has(t)&&At.has(t.constructor)),Gt={};class Vt{owner;computedsByScope;valueSignal;getterSignal;pendingGetter;constructor(t){this.owner=t,this.computedsByScope=new WeakMap}setValue(t){this.update({value:t})}setGetter(t){this.update({get:t})}setPendingGetter(t){this.pendingGetter=t,queueMicrotask((()=>this.consolidateGetter()))}consolidateGetter(){const t=this.pendingGetter;t&&(this.pendingGetter=void 0,this.update({get:t}))}getComputed(){const t=at()||Gt;if(this.valueSignal||this.getterSignal||this.update({}),this.pendingGetter&&this.consolidateGetter(),!this.computedsByScope.has(t)){const e=()=>{const t=this.getterSignal?.value;return t?t.call(this.owner):this.valueSignal?.value};ct(Dt(this.owner)),this.computedsByScope.set(t,X(bt(e))),lt()}return this.computedsByScope.get(t)}update({get:t,value:e}){this.valueSignal?e===this.valueSignal.peek()&&t===this.getterSignal.peek()||W((()=>{this.valueSignal.value=e,this.getterSignal.value=t})):(this.valueSignal=V(e),this.getterSignal=V(t))}}const Bt=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter((t=>"symbol"==typeof t))),zt=new WeakMap,Jt=(t,e)=>zt.has(t)&&zt.get(t).has(e),Kt=(t,e,n)=>{zt.has(t)||zt.set(t,new Map),e="number"==typeof e?`${e}`:e;const r=zt.get(t);if(!r.has(e)){const o=Dt(t),i=new Vt(t);if(r.set(e,i),n){const{get:t,value:e}=n;t?i.setGetter(t):i.setValue(Rt(e)?te(o,e):e)}}return r.get(e)},Xt=new WeakMap;let Zt=!1;const Qt=Symbol("PENDING_GETTER"),Yt={get(t,e,n){if(Zt||!t.hasOwnProperty(e)&&e in t||"symbol"==typeof e&&Bt.has(e))return Reflect.get(t,e,n);const r=Object.getOwnPropertyDescriptor(t,e),o=Kt(n,e,r).getComputed().value;if(o===Qt)throw Qt;if("function"==typeof o){const t=Dt(n);return(...e)=>{ct(t);try{return o.call(n,...e)}finally{lt()}}}return o},set(t,e,n,r){ct(Dt(r));try{return Reflect.set(t,e,n,r)}finally{lt()}},defineProperty(t,e,n){const r=!(e in t),o=Reflect.defineProperty(t,e,n);if(o){const o=qt(t),i=Kt(o,e),{get:s,value:u}=n;if(s)i.setGetter(s);else{const t=Dt(o);i.setValue(Rt(u)?te(t,u):u)}if(r&&Xt.has(t)&&Xt.get(t).value++,Array.isArray(t)&&zt.get(o)?.has("length")){Kt(o,"length").setValue(t.length)}}return o},deleteProperty(t,e){const n=Reflect.deleteProperty(t,e);if(n){Kt(qt(t),e).setValue(void 0),Xt.has(t)&&Xt.get(t).value++}return n},ownKeys:t=>(Xt.has(t)||Xt.set(t,V(0)),Xt._=Xt.get(t).value,Reflect.ownKeys(t))},te=(t,e)=>Lt(t,e,Yt),ee=(t,e,n=!0)=>{if(!Mt(t)||!Mt(e))return;let r=!1;for(const o in e){const i=!(o in t);r=r||i;const s=Object.getOwnPropertyDescriptor(e,o),u=qt(t),c=!!u&&Jt(u,o)&&Kt(u,o);if("function"==typeof s.get||"function"==typeof s.set)(n||i)&&(Object.defineProperty(t,o,{...s,configurable:!0,enumerable:!0}),s.get&&c&&c.setPendingGetter(s.get));else if(Mt(e[o])){const r=Object.getOwnPropertyDescriptor(t,o)?.value;if(i||n&&!Mt(r)){if(t[o]={},c){const e=Dt(u);c.setValue(te(e,t[o]))}ee(t[o],e[o],n)}else Mt(r)&&ee(t[o],e[o],n)}else if((n||i)&&(Object.defineProperty(t,o,s),c)){const{value:t}=s,e=Dt(u);c.setValue(Rt(t)?te(e,t):t)}}r&&Xt.has(t)&&Xt.get(t).value++},ne=(t,e,n=!0)=>W((()=>{return ee((r=t,Ut.get(r)||t),e,n);var r})),re=new WeakSet,oe={get:(t,e,n)=>{const r=Reflect.get(t,e),o=Dt(n);if(void 0===r&&re.has(n)){const n={};return Reflect.set(t,e,n),ie(o,n,!1)}if("function"==typeof r){ct(o);const t=bt(r);return lt(),t}return Mt(r)&&Rt(r)?ie(o,r,!1):r}},ie=(t,e,n=!0)=>{const r=Lt(t,e,oe);return r&&n&&re.add(r),r},se=new WeakMap,ue=new WeakMap,ce=new WeakSet,le=Reflect.getOwnPropertyDescriptor,_e={get:(t,e)=>{const n=ue.get(t),r=t[e];return e in t?r:n[e]},set:(t,e,n)=>{const r=ue.get(t);return(e in t||!(e in r)?t:r)[e]=n,!0},ownKeys:t=>[...new Set([...Object.keys(ue.get(t)),...Object.keys(t)])],getOwnPropertyDescriptor:(t,e)=>le(t,e)||le(ue.get(t),e),has:(t,e)=>Reflect.has(t,e)||Reflect.has(ue.get(t),e)},ae=(t,e={})=>{if(ce.has(t))throw Error("This object cannot be proxified.");if(ue.set(t,e),!se.has(t)){const e=new Proxy(t,_e);se.set(t,e),ce.add(e)}return se.get(t)},fe=new Map,pe=new Map,he=new Map,de=new Map,ve=new Map,ye=t=>de.get(t||ut())||{};function ge(t){const e=t||ut();return ve.has(e)||ve.set(e,{}),ge.subscribe=Ht.value,Wt(ve.get(e))}ge.subscribe=0;const me="I acknowledge that using a private store means my plugin will inevitably break on the next store release.";function we(t,{state:e={},...n}={},{lock:r=!1}={}){if(fe.has(t)){if(r===me||he.has(t)){const e=he.get(t);if(!(r===me||!0!==r&&r===e))throw e?Error("Cannot unlock a private store with an invalid lock code"):Error("Cannot lock a public store")}else he.set(t,r);const o=pe.get(t);ne(o,n),ne(o.state,e)}else{r!==me&&he.set(t,r);const o={state:te(t,Mt(e)?e:{}),...n},i=ie(t,o);pe.set(t,o),fe.set(t,i)}return fe.get(t)}const be=(t=document)=>{const e=t.getElementById("wp-script-module-data-@wordpress/interactivity")??t.getElementById("wp-interactivity-data");if(e?.textContent)try{return JSON.parse(e.textContent)}catch{}return{}},xe=t=>{ve.clear(),de.clear(),Mt(t?.state)&&Object.entries(t.state).forEach((([t,e])=>{const n=we(t,{},{lock:me});ne(n.state,e,!1),ve.set(t,e)})),Mt(t?.config)&&Object.entries(t.config).forEach((([t,e])=>{de.set(t,e)})),Mt(t?.derivedStateClosures)&&Object.entries(t.derivedStateClosures).forEach((([t,e])=>{const n=we(t,{},{lock:me});e.forEach((t=>{const e=t.split("."),r=e.splice(-1,1)[0],o=e.reduce(((t,e)=>((t,e)=>{Zt=!0;try{return t[e]}finally{Zt=!1}})(t,e)),n),i=Object.getOwnPropertyDescriptor(o,r);Mt(i?.value)&&(o[r]=Qt)}))}))},Se=be();function ke(t){return null!==t.suffix}function Ee(t){return null===t.suffix}xe(Se);const Pe=(0,c.q6)({client:{},server:{}}),Ce={},Oe={},Me=(t,e,{priority:n=10}={})=>{Ce[t]=e,Oe[t]=n},Te=({scope:t})=>(e,...n)=>{let{value:r,namespace:o}=e;if("string"!=typeof r)throw new Error("The `value` prop should be a string path");const i="!"===r[0]&&!!(r=r.slice(1));ft(t);const s=((t,e)=>{if(!e)return void Ot();let n=fe.get(e);void 0===n&&(n=we(e,{},{lock:me}));const r={...n,context:at().context[e]};try{return t.split(".").reduce(((t,e)=>t[e]),r)}catch(t){if(t===Qt)return Qt}})(r,o);if("function"==typeof s){if(i){Ot();const t=!s(...n);return pt(),t}pt();const e=(...e)=>{ft(t);const n=s(...e);return pt(),n};if(s.sync){e.sync=!0}return e}const u=s;return pt(),i&&s!==Qt?!u:u},Ne=({directives:t,priorityLevels:[e,...n],element:r,originalProps:o,previousScope:i})=>{const s=x({}).current;s.evaluate=k(Te({scope:s}),[]);const{client:u,server:l}=E(Pe);s.context=u,s.serverContext=l,s.ref=i?.ref||x(null),r=(0,c.Ob)(r,{ref:s.ref}),s.attributes=r.props;const _=n.length>0?(0,c.h)(Ne,{directives:t,priorityLevels:n,element:r,originalProps:o,previousScope:s}):r,a={...o,children:_},f={directives:t,props:a,element:r,context:Pe,evaluate:s.evaluate};ft(s);for(const t of e){const e=Ce[t]?.(f);void 0!==e&&(a.children=e)}return pt(),a.children},je=c.fF.vnode;c.fF.vnode=t=>{if(t.props.__directives){const e=t.props,n=e.__directives;n.key&&(t.key=n.key.find(Ee).value),delete e.__directives;const r=(t=>{const e=Object.keys(t).reduce(((t,e)=>{if(Ce[e]){const n=Oe[e];(t[n]=t[n]||[]).push(e)}return t}),{});return Object.entries(e).sort((([t],[e])=>parseInt(t)-parseInt(e))).map((([,t])=>t))})(n);r.length>0&&(t.props={directives:n,priorityLevels:r,originalProps:e,type:t.type,element:(0,c.h)(t.type,e),top:!0},t.type=Ne)}je&&je(t)};function $e(t){return new Proxy(t,{get(t,e,n){const r=t[e];return r instanceof Function?function(...e){return r.apply(this===n?t:this,e)}:r}})}const He=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,We=/\/\*[^]*?\*\/| +/g,Ie=/\n+/g,Ue=t=>({directives:e,evaluate:n})=>{e[`on-${t}`].filter(ke).forEach((e=>{const r=e.suffix.split("--",2)[0];St((()=>{const o=t=>{const r=n(e);"function"==typeof r&&(r?.sync||(t=$e(t)),r(t))},i="window"===t?window:document;return i.addEventListener(r,o),()=>i.removeEventListener(r,o)}))}))},Fe=(t,e,n,r,o)=>{const i={...t.client,[e]:{...t.client[e],[r]:n}},s={...at(),context:i,serverContext:t.server};return o?Te({scope:s})(o):n},Ae=t=>({directives:e,evaluate:n})=>{e[`on-async-${t}`].filter(ke).forEach((e=>{const r=e.suffix.split("--",1)[0];St((()=>{const o=async t=>{await mt();const r=n(e);"function"==typeof r&&r(t)},i="window"===t?window:document;return i.addEventListener(r,o,{passive:!0}),()=>i.removeEventListener(r,o)}))}))},Le=new Map;const qe="data-wp-",De=[],Re=/[^a-z0-9-_]/i;const Ge=/^([\w_\/-]+)::(.+)$/,Ve=new WeakSet;function Be(t){const e=new Set,n=new Set,r=document.createTreeWalker(t,205);const o=function t(o){const{nodeType:i}=o;if(3===i)return o.data;if(4===i)return n.add(o),o.nodeValue;if(8===i||7===i)return e.add(o),null;const s=o,{attributes:u}=s,l=s.localName,_={},a=[],f=[];let p=!1,h=!1;for(let t=0;t<u.length;t++){const e=u[t].name,n=u[t].value;if(e[8]&&e.slice(0,8)===qe)if("data-wp-ignore"===e)p=!0;else{const t=Ge.exec(n),r=t?.[1]??null;let o=t?.[2]??n;try{const t=JSON.parse(o);d=t,o=Boolean(d&&"object"==typeof d&&d.constructor===Object)?t:o}catch{}if("data-wp-interactive"===e){h=!0;const t="string"==typeof o?o:"string"==typeof o?.namespace?o.namespace:null;De.push(t)}else f.push([e,r,o])}else if("ref"===e)continue;_[e]=n}var d;if(p&&!h)return[(0,c.h)(l,{..._,innerHTML:s.innerHTML,__directives:{ignore:!0}})];if(h&&Ve.add(s),f.length){_.__directives=f.reduce(((t,[e,n,r])=>{const o=function(t){const e=t.substring(8);if(Re.test(e))return null;const n=e.indexOf("--");if(-1===n)return{prefix:e,suffix:null,uniqueId:null};const r=e.substring(0,n),o=e.substring(n);if(o.startsWith("---")&&"-"!==o[3])return{prefix:r,suffix:null,uniqueId:o.substring(3)||null};let i=o.substring(2);const s=i.indexOf("---");if(-1!==s&&"-"!==i.substring(s)[3]){const t=i.substring(s+3)||null;return i=i.substring(0,s)||null,{prefix:r,suffix:i,uniqueId:t}}return{prefix:r,suffix:i||null,uniqueId:null}}(e);if(null===o)return t;const{prefix:i,suffix:s,uniqueId:u}=o;return t[i]=t[i]||[],t[i].push({namespace:n??De[De.length-1]??null,value:r,suffix:s,uniqueId:u}),t}),{});for(const t in _.__directives)_.__directives[t].sort(((t,e)=>{const n=t.suffix??"",r=e.suffix??"";if(n!==r)return n<r?-1:1;const o=t.uniqueId??"",i=e.uniqueId??"";return+(o>i)-+(o<i)}))}if(_.__directives?.["each-child"])_.dangerouslySetInnerHTML={__html:s.innerHTML};else if("template"===l)_.content=[...s.content.childNodes].map((t=>Be(t)));else{let e=r.firstChild();if(e){for(;e;){const n=t(e);n&&a.push(n),e=r.nextSibling()}r.parentNode()}}return h&&De.pop(),(0,c.h)(l,_,a)}(r.currentNode);return e.forEach((t=>t.remove())),n.forEach((t=>t.replaceWith(new window.Text(t.nodeValue??"")))),o}const ze=new WeakMap,Je=t=>{const e=Array.isArray(t)?t[0]:t;if(!e.parentElement)throw Error("The passed region should be an element with a parent.");return ze.has(e)||ze.set(e,((t,e)=>{const n=(e=[].concat(e))[e.length-1].nextSibling;function r(e,r){t.insertBefore(e,r||n)}return t.__k={nodeType:1,parentNode:t,firstChild:e[0],childNodes:e,insertBefore:r,appendChild:r,removeChild(e){t.removeChild(e)},contains(e){t.contains(e)}}})(e.parentElement,t)),ze.get(e)},Ke=new WeakMap,Xe=t=>{if("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."===t)return{getRegionRootFragment:Je,initialVdom:Ke,toVdom:Be,directive:Me,getNamespace:ut,h:c.h,cloneElement:c.Ob,render:c.XX,proxifyState:te,parseServerData:be,populateServerData:xe,batch:W,routerRegions:Le,deepReadOnly:$t,navigationSignal:Ht};throw new Error("Forbidden access.")};Me("context",(({directives:{context:t},props:{children:e},context:n})=>{const r=t.filter(Ee).reverse();if(!r.length)return;const{Provider:o}=n,{client:i,server:s}=E(n),u=x({}),l={},_={client:{...i},server:{...s}},a=new Set;return r.forEach((({value:t,namespace:e,uniqueId:n})=>{Mt(t)&&(u.current[e]||(u.current[e]=te(e,{})),ne(u.current[e],Wt(t),!1),l[e]=t,a.add(e))})),a.forEach((t=>{_.client[t]=ae(u.current[t],i[t]),_.server[t]=ae(l[t],s[t])})),(0,c.h)(o,{value:_},e)}),{priority:5}),Me("watch",(({directives:{watch:t},evaluate:e})=>{t.forEach((t=>{xt((()=>{let n=e(t);return"function"==typeof n&&(n=n()),n}))}))})),Me("init",(({directives:{init:t},evaluate:e})=>{t.forEach((t=>{St((()=>{let n=e(t);return"function"==typeof n&&(n=n()),n}))}))})),Me("on",(({directives:{on:t},element:e,evaluate:n})=>{const r=new Map;t.filter(ke).forEach((t=>{const e=t.suffix.split("--",2);r.has(e[0])||r.set(e[0],new Set),r.get(e[0]).add(t)})),r.forEach(((t,r)=>{const o=e.props[`on${r}`];e.props[`on${r}`]=e=>{o&&o(e),t.forEach((t=>{const r=n(t);"function"==typeof r&&(r?.sync||(e=$e(e)),r(e))}))}}))})),Me("on-async",(({directives:{"on-async":t},element:e,evaluate:n})=>{const r=new Map;t.filter(ke).forEach((t=>{const e=t.suffix.split("--",1)[0];r.has(e)||r.set(e,new Set),r.get(e).add(t)})),r.forEach(((t,r)=>{const o=e.props[`on${r}`];e.props[`on${r}`]=e=>{o&&o(e),t.forEach((async t=>{await mt();const r=n(t);"function"==typeof r&&r(e)}))}}))})),Me("on-window",Ue("window")),Me("on-document",Ue("document")),Me("on-async-window",Ae("window")),Me("on-async-document",Ae("document")),Me("class",(({directives:{class:t},element:e,evaluate:n})=>{t.filter(ke).forEach((t=>{const r=t.uniqueId?`${t.suffix}---${t.uniqueId}`:t.suffix;let o=n(t);if(o===Qt)return;"function"==typeof o&&(o=o());const i=e.props.class||"",s=new RegExp(`(^|\\s)${r}(\\s|$)`,"g");o?s.test(i)||(e.props.class=i?`${i} ${r}`:r):e.props.class=i.replace(s," ").trim(),St((()=>{o?e.ref.current.classList.add(r):e.ref.current.classList.remove(r)}))}))})),Me("style",(({directives:{style:t},element:e,evaluate:n})=>{t.filter(ke).forEach((t=>{if(t.uniqueId)return;const r=t.suffix;let o=n(t);o!==Qt&&("function"==typeof o&&(o=o()),e.props.style=e.props.style||{},"string"==typeof e.props.style&&(e.props.style=(t=>{const e=[{}];let n,r;for(;n=He.exec(t.replace(We,""));)n[4]?e.shift():n[3]?(r=n[3].replace(Ie," ").trim(),e.unshift(e[0][r]=e[0][r]||{})):e[0][n[1]]=n[2].replace(Ie," ").trim();return e[0]})(e.props.style)),o?e.props.style[r]=o:delete e.props.style[r],St((()=>{o?e.ref.current.style.setProperty(r,o):e.ref.current.style.removeProperty(r)})))}))})),Me("bind",(({directives:{bind:t},element:e,evaluate:n})=>{t.filter(ke).forEach((t=>{if(t.uniqueId)return;const r=t.suffix;let o=n(t);o!==Qt&&("function"==typeof o&&(o=o()),e.props[r]=o,St((()=>{const t=e.ref.current;if("style"!==r){if("width"!==r&&"height"!==r&&"href"!==r&&"list"!==r&&"form"!==r&&"tabIndex"!==r&&"download"!==r&&"rowSpan"!==r&&"colSpan"!==r&&"role"!==r&&r in t)try{return void(t[r]=null==o?"":o)}catch(t){}null==o||!1===o&&"-"!==r[4]?t.removeAttribute(r):t.setAttribute(r,o)}else"string"==typeof o&&(t.style.cssText=o)})))}))})),Me("ignore",(({element:{type:t,props:{innerHTML:e,...n}}})=>{const r=S((()=>e),[]);return(0,c.h)(t,{dangerouslySetInnerHTML:{__html:r},...n})})),Me("text",(({directives:{text:t},element:e,evaluate:n})=>{const r=t.filter(Ee);r.length&&r.forEach((t=>{if(!t.uniqueId)try{let r=n(t);if(r===Qt)return;"function"==typeof r&&(r=r()),e.props.children="object"==typeof r?null:r.toString()}catch(t){e.props.children=null}}))})),Me("run",(({directives:{run:t},evaluate:e})=>{t.forEach((t=>{let n=e(t);return"function"==typeof n&&(n=n()),n}))})),Me("each",(({directives:{each:t,"each-key":e},context:n,element:r,evaluate:o})=>{if("template"!==r.type)return;const{Provider:i}=n,s=E(n),[u]=t,{namespace:l,suffix:_,uniqueId:a}=u;if(t.length>1)return;if(a)return;let f=o(u);if(f===Qt)return;if("function"==typeof f&&(f=f()),"function"!=typeof f?.[Symbol.iterator])return;const p=_?_.replace(/^-+|-+$/g,"").toLowerCase().replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()})):"item",h=[],d=function*(t,e,n,r,o){const{current:i}=x(new Map);for(const s of n){const n=Fe(t,e,s,r,o);i.has(n)||i.set(n,ae(te(e,{[r]:void 0}),t.client[e])),yield[s,i.get(n),n]}}(s,l,f,p,e?.[0]);for(const[t,e,n]of d){const o={client:{...s.client,[l]:e},server:{...s.server}};o.client[l][p]=t,h.push((0,c.h)(i,{value:o,key:n},r.props.content))}return h}),{priority:20}),Me("each-child",(({directives:{"each-child":t},element:e,evaluate:n})=>{const r=t.find(Ee);if(r)return n(r)===Qt?e:null}),{priority:1}),Me("router-region",(({directives:{"router-region":t}})=>{const e=t.find(Ee);if(!e)return;if(e.suffix)return;if(e.uniqueId)return;const n="string"==typeof e.value?e.value:e.value.id;Le.has(n)||Le.set(n,V());const r=Le.get(n).value;if(b((()=>{r&&"string"!=typeof r.type&&(vt.value=vt.peek()+1)}),[r]),r&&"string"!=typeof r.type){const t=at();return(0,c.Ob)(r,{previousScope:t})}return r}),{priority:1}),(async()=>{const t=document.querySelectorAll("[data-wp-interactive]");await new Promise((t=>{setTimeout(t,0)}));for(const e of t)if(!Ve.has(e)){await mt();const t=Je(e),n=Be(e);Ke.set(e,n),await mt(),(0,c.Qv)(n,t)}})();var Ze=r.zj,Qe=r.SD,Ye=r.V6,tn=r.$K,en=r.vT,nn=r.jb,rn=r.yT,on=r.M_,sn=r.hb,un=r.vJ,cn=r.ip,ln=r.Nf,_n=r.Kr,an=r.li,fn=r.J0,pn=r.FH,hn=r.v4,dn=r.mh;export{Ze as getConfig,Qe as getContext,Ye as getElement,tn as getServerContext,en as getServerState,nn as privateApis,rn as splitTask,on as store,sn as useCallback,un as useEffect,cn as useInit,ln as useLayoutEffect,_n as useMemo,an as useRef,fn as useState,pn as useWatch,hn as withScope,dn as withSyncEvent}; script-modules/interactivity/debug.js 0000644 00000305566 15144410747 0014066 0 ustar 00 /******/ var __webpack_modules__ = ({
/***/ 622:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ FK: () => (/* binding */ k),
/* harmony export */ Ob: () => (/* binding */ K),
/* harmony export */ Qv: () => (/* binding */ J),
/* harmony export */ XX: () => (/* binding */ G),
/* harmony export */ fF: () => (/* binding */ l),
/* harmony export */ h: () => (/* binding */ _),
/* harmony export */ q6: () => (/* binding */ Q),
/* harmony export */ uA: () => (/* binding */ x),
/* harmony export */ zO: () => (/* binding */ t)
/* harmony export */ });
/* unused harmony exports createElement, createRef, toChildArray */
var n,l,u,t,i,r,o,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function g(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function _(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return m(l,e,i,r,null)}function m(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function S(n,l){if(null==l)return n.__?S(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?S(n):null}function C(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return C(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!$.__r++||r!=l.debounceRendering)&&((r=l.debounceRendering)||o)($)}function $(){for(var n,u,t,r,o,f,c,s=1;i.length;)i.length>s&&i.sort(e),n=i.shift(),s=i.length,n.__d&&(t=void 0,r=void 0,o=(r=(u=n).__v).__e,f=[],c=[],u.__P&&((t=d({},r)).__v=r.__v+1,l.vnode&&l.vnode(t),O(u.__P,t,r,u.__n,u.__P.namespaceURI,32&r.__u?[o]:null,f,null==o?S(r):o,!!(32&r.__u),c),t.__v=r.__v,t.__.__k[t.__i]=t,N(f,t,c),r.__e=r.__=null,t.__e!=o&&C(t)));$.__r=0}function I(n,l,u,t,i,r,o,e,f,c,s){var a,h,y,w,d,g,_,m=t&&t.__k||v,b=l.length;for(f=P(u,l,m,f,b),a=0;a<b;a++)null!=(y=u.__k[a])&&(h=-1==y.__i?p:m[y.__i]||p,y.__i=a,g=O(n,y,h,i,r,o,e,f,c,s),w=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&B(h.ref,null,y),s.push(y.ref,y.__c||w,y)),null==d&&null!=w&&(d=w),(_=!!(4&y.__u))||h.__k===y.__k?f=A(y,f,n,_):"function"==typeof y.type&&void 0!==g?f=g:w&&(f=w.nextSibling),y.__u&=-7);return u.__e=d,f}function P(n,l,u,t,i){var r,o,e,f,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?(f=r+h,(o=n.__k[r]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):w(o)?m(k,{children:o},null,null,null):null==o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=L(o,u,f,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=S(e)),D(e,e));return t}function A(n,l,u,t){var i,r;if("function"==typeof n.type){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,l=A(i[r],l,u,t));return l}n.__e!=l&&(t&&(l&&n.type&&!l.parentNode&&(l=S(n)),u.insertBefore(n.__e,l||null)),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8==l.nodeType);return l}function H(n,l){return l=l||[],null==n||"boolean"==typeof n||(w(n)?n.some(function(n){H(n,l)}):l.push(n)),l}function L(n,l,u,t){var i,r,o,e=n.key,f=n.type,c=l[u],s=null!=c&&0==(2&c.__u);if(null===c&&null==n.key||s&&e==c.key&&f==c.type)return u;if(t>(s?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[o=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return-1}function T(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y.test(l)?u:u+"px"}function j(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||T(n.style,l,u[l])}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(f,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u.u=t.u:(u.u=c,n.addEventListener(l,r?a:s,r)):n.removeEventListener(l,r?a:s,r);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u))}}function F(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c++;else if(u.t<t.u)return;return t(l.event?l.event(u):u)}}}function O(n,u,t,i,r,o,e,f,c,s){var a,h,p,v,y,_,m,b,S,C,M,$,P,A,H,L,T,j=u.type;if(null!=u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(a=l.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,S="prototype"in j&&j.prototype.render,C=(a=j.contextType)&&i[a.__c],M=a?C?C.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(S?u.__c=h=new j(b,M):(u.__c=h=new x(b,M),h.constructor=j,h.render=E),C&&C.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)S&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(S&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v==t.__v){for(u.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u)}),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,_)})}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,P=l.__r,A=0,S){for(h.state=h.__s,h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[]}else do{h.__d=!1,P&&P(u),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=d(d({},i),h.getChildContext())),S&&!p&&null!=h.getSnapshotBeforeUpdate&&(_=h.getSnapshotBeforeUpdate(v,y)),L=a,null!=a&&a.type===k&&null==a.key&&(L=V(a.props.children)),f=I(n,w(L)?L:[L],u,t,i,r,o,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null)}catch(n){if(u.__v=null,c||null!=o)if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;o[o.indexOf(f)]=null,u.__e=f}else{for(T=o.length;T--;)g(o[T]);z(u)}else u.__e=t.__e,u.__k=t.__k,n.then||z(u);l.__e(n,u,t)}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=q(t.__e,u,t,i,r,o,e,c,s);return(a=l.diffed)&&a(u),128&u.__u?void 0:f}function z(n){n&&n.__c&&(n.__c.__e=!0),n&&n.__k&&n.__k.forEach(z)}function N(n,u,t){for(var i=0;i<t.length;i++)B(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function V(n){return"object"!=typeof n||null==n||n.__b&&n.__b>0?n:w(n)?n.map(V):d({},n)}function q(u,t,i,r,o,e,f,c,s){var a,h,v,y,d,_,m,b=i.props,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((d=e[a])&&"setAttribute"in d==!!x&&(x?d.localName==x:3==d.nodeType)){u=d,e[a]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l.__m&&l.__m(t,e),c=!1),e=null}if(null==x)b===k||c&&u.data==k||(u.data=k);else{if(e=e&&n.call(u.childNodes),b=i.props||p,!c&&null!=e)for(b={},a=0;a<u.attributes.length;a++)b[(d=u.attributes[a]).name]=d.value;for(a in b)if(d=b[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=d;else if(!(a in k)){if("value"==a&&"defaultValue"in k||"checked"==a&&"defaultChecked"in k)continue;j(u,a,null,d,o)}for(a in k)d=k[a],"children"==a?y=d:"dangerouslySetInnerHTML"==a?h=d:"value"==a?_=d:"checked"==a?m=d:c&&"function"!=typeof d||b[a]===d||j(u,a,d,b[a],o);if(h)c||v&&(h.__html==v.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),I("template"==t.type?u.content:u,w(y)?y:[y],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&S(i,0),c,s),null!=e)for(a=e.length;a--;)g(e[a]);c||(a="value","progress"==x&&null==_?u.removeAttribute("value"):null!=_&&(_!==u[a]||"progress"==x&&!_||"option"==x&&_!=b[a])&&j(u,a,_,b[a],o),a="checked",null!=m&&m!=u[a]&&j(u,a,m,b[a],o))}return u}function B(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u))}else n.current=u}catch(n){l.__e(n,t)}}function D(n,u,t){var i,r;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||B(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&D(i[r],u,t||"function"!=typeof n.type);t||g(n.__e),n.__c=n.__=n.__e=void 0}function E(n,l,u){return this.constructor(n,u)}function G(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l.__&&l.__(u,t),o=(r="function"==typeof i)?null:i&&i.__k||t.__k,e=[],f=[],O(t,u=(!r&&i||t).__k=_(k,null,[u]),o||p,p,t.namespaceURI,!r&&i?[i]:o?null:t.firstChild?n.call(t.childNodes):null,e,!r&&i?i:o?o.__e:t.firstChild,r,f),N(e,u,f)}function J(n,l){G(n,l,J)}function K(l,u,t){var i,r,o,e,f=d({},l.props);for(o in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)"key"==o?i=u[o]:"ref"==o?r=u[o]:f[o]=void 0===u[o]&&null!=e?e[o]:u[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,r||l.ref,null)}function Q(n){function l(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l.__c]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&u.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}return l.__c="__cC"+h++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n=v.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},$.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=F(!1),a=F(!0),h=0;
/***/ }),
/***/ 676:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
zj: () => (/* reexport */ getConfig),
SD: () => (/* reexport */ getContext),
V6: () => (/* reexport */ getElement),
$K: () => (/* reexport */ getServerContext),
vT: () => (/* reexport */ getServerState),
jb: () => (/* binding */ privateApis),
yT: () => (/* reexport */ splitTask),
M_: () => (/* reexport */ store),
hb: () => (/* reexport */ useCallback),
vJ: () => (/* reexport */ useEffect),
ip: () => (/* reexport */ useInit),
Nf: () => (/* reexport */ useLayoutEffect),
Kr: () => (/* reexport */ useMemo),
li: () => (/* reexport */ A),
J0: () => (/* reexport */ d),
FH: () => (/* reexport */ useWatch),
v4: () => (/* reexport */ withScope),
mh: () => (/* reexport */ withSyncEvent)
});
// EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js
var preact_module = __webpack_require__(622);
;// ./node_modules/preact/hooks/dist/hooks.module.js
var hooks_module_t,r,hooks_module_u,i,hooks_module_o=0,hooks_module_f=[],hooks_module_c=preact_module/* options */.fF,e=hooks_module_c.__b,a=hooks_module_c.__r,v=hooks_module_c.diffed,l=hooks_module_c.__c,m=hooks_module_c.unmount,s=hooks_module_c.__;function p(n,t){hooks_module_c.__h&&hooks_module_c.__h(r,n,hooks_module_o||t),hooks_module_o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return hooks_module_o=1,h(D,n)}function h(n,u,i){var o=p(hooks_module_t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return!!n.__c});if(u.every(function(n){return!n.__N}))return!c||c.call(this,n,t,r);var i=o.__c.props!==n;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c&&c.call(this,n,t,r)||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function y(n,u){var i=p(hooks_module_t++,3);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i))}function _(n,u){var i=p(hooks_module_t++,4);!hooks_module_c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i))}function A(n){return hooks_module_o=5,T(function(){return{current:n}},[])}function F(n,t,r){hooks_module_o=6,_(function(){if("function"==typeof n){var r=n(t());return function(){n(null),r&&"function"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))}function T(n,r){var u=p(hooks_module_t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return hooks_module_o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=p(hooks_module_t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){hooks_module_c.useDebugValue&&hooks_module_c.useDebugValue(t?t(n):n)}function b(n){var u=p(hooks_module_t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=p(hooks_module_t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++}return n.__}function j(){for(var n;n=hooks_module_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(z),n.__H.__h.forEach(B),n.__H.__h=[]}catch(t){n.__H.__h=[],hooks_module_c.__e(t,n.__v)}}hooks_module_c.__b=function(n){r=null,e&&e(n)},hooks_module_c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),s&&s(n,t)},hooks_module_c.__r=function(n){a&&a(n),hooks_module_t=0;var i=(r=n.__c).__H;i&&(hooks_module_u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(i.__h.forEach(z),i.__h.forEach(B),i.__h=[],hooks_module_t=0)),hooks_module_u=r},hooks_module_c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==hooks_module_f.push(t)&&i===hooks_module_c.requestAnimationFrame||((i=hooks_module_c.requestAnimationFrame)||w)(j)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),hooks_module_u=r=null},hooks_module_c.__c=function(n,t){t.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],hooks_module_c.__e(r,n.__v)}}),l&&l(n,t)},hooks_module_c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&hooks_module_c.__e(t,r.__v))};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return"function"==typeof t?t(n):t}
;// ./node_modules/@preact/signals-core/dist/signals-core.module.js
var signals_core_module_i=Symbol.for("preact-signals");function signals_core_module_t(){if(!(signals_core_module_s>1)){var i,t=!1;while(void 0!==signals_core_module_h){var r=signals_core_module_h;signals_core_module_h=void 0;signals_core_module_f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&signals_core_module_c(r))try{r.c()}catch(r){if(!t){i=r;t=!0}}r=o}}signals_core_module_f=0;signals_core_module_s--;if(t)throw i}else signals_core_module_s--}function signals_core_module_r(i){if(signals_core_module_s>0)return i();signals_core_module_s++;try{return i()}finally{signals_core_module_t()}}var signals_core_module_o=void 0;function n(i){var t=signals_core_module_o;signals_core_module_o=void 0;try{return i()}finally{signals_core_module_o=t}}var signals_core_module_h=void 0,signals_core_module_s=0,signals_core_module_f=0,signals_core_module_v=0;function signals_core_module_e(i){if(void 0!==signals_core_module_o){var t=i.n;if(void 0===t||t.t!==signals_core_module_o){t={i:0,S:i,p:signals_core_module_o.s,n:void 0,t:signals_core_module_o,e:void 0,x:void 0,r:t};if(void 0!==signals_core_module_o.s)signals_core_module_o.s.n=t;signals_core_module_o.s=t;i.n=t;if(32&signals_core_module_o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=signals_core_module_o.s;t.n=void 0;signals_core_module_o.s.n=t;signals_core_module_o.s=t}return t}}}function signals_core_module_u(i,t){this.v=i;this.i=0;this.n=void 0;this.t=void 0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}signals_core_module_u.prototype.brand=signals_core_module_i;signals_core_module_u.prototype.h=function(){return!0};signals_core_module_u.prototype.S=function(i){var t=this,r=this.t;if(r!==i&&void 0===i.e){i.x=r;this.t=i;if(void 0!==r)r.e=i;else n(function(){var i;null==(i=t.W)||i.call(t)})}};signals_core_module_u.prototype.U=function(i){var t=this;if(void 0!==this.t){var r=i.e,o=i.x;if(void 0!==r){r.x=o;i.e=void 0}if(void 0!==o){o.e=r;i.x=void 0}if(i===this.t){this.t=o;if(void 0===o)n(function(){var i;null==(i=t.Z)||i.call(t)})}}};signals_core_module_u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=signals_core_module_o;signals_core_module_o=void 0;try{i(r)}finally{signals_core_module_o=n}},{name:"sub"})};signals_core_module_u.prototype.valueOf=function(){return this.value};signals_core_module_u.prototype.toString=function(){return this.value+""};signals_core_module_u.prototype.toJSON=function(){return this.value};signals_core_module_u.prototype.peek=function(){var i=signals_core_module_o;signals_core_module_o=void 0;try{return this.value}finally{signals_core_module_o=i}};Object.defineProperty(signals_core_module_u.prototype,"value",{get:function(){var i=signals_core_module_e(this);if(void 0!==i)i.i=this.i;return this.v},set:function(i){if(i!==this.v){if(signals_core_module_f>100)throw new Error("Cycle detected");this.v=i;this.i++;signals_core_module_v++;signals_core_module_s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N()}finally{signals_core_module_t()}}}});function signals_core_module_d(i,t){return new signals_core_module_u(i,t)}function signals_core_module_c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function signals_core_module_a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function signals_core_module_l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o}i.s=r}function signals_core_module_y(i,t){signals_core_module_u.call(this,void 0);this.x=i;this.s=void 0;this.g=signals_core_module_v-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}signals_core_module_y.prototype=new signals_core_module_u;signals_core_module_y.prototype.h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===signals_core_module_v)return!0;this.g=signals_core_module_v;this.f|=1;if(this.i>0&&!signals_core_module_c(this)){this.f&=-2;return!0}var i=signals_core_module_o;try{signals_core_module_a(this);signals_core_module_o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(i){this.v=i;this.f|=16;this.i++}signals_core_module_o=i;signals_core_module_l(this);this.f&=-2;return!0};signals_core_module_y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}signals_core_module_u.prototype.S.call(this,i)};signals_core_module_y.prototype.U=function(i){if(void 0!==this.t){signals_core_module_u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};signals_core_module_y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N()}};Object.defineProperty(signals_core_module_y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=signals_core_module_e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function signals_core_module_w(i,t){return new signals_core_module_y(i,t)}function signals_core_module_(i){var r=i.u;i.u=void 0;if("function"==typeof r){signals_core_module_s++;var n=signals_core_module_o;signals_core_module_o=void 0;try{r()}catch(t){i.f&=-2;i.f|=8;signals_core_module_b(i);throw t}finally{signals_core_module_o=n;signals_core_module_t()}}}function signals_core_module_b(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;signals_core_module_(i)}function signals_core_module_g(i){if(signals_core_module_o!==this)throw new Error("Out-of-order effect");signals_core_module_l(this);signals_core_module_o=i;this.f&=-2;if(8&this.f)signals_core_module_b(this);signals_core_module_t()}function signals_core_module_p(i,t){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;this.name=null==t?void 0:t.name}signals_core_module_p.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{i()}};signals_core_module_p.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;signals_core_module_(this);signals_core_module_a(this);signals_core_module_s++;var i=signals_core_module_o;signals_core_module_o=this;return signals_core_module_g.bind(this,i)};signals_core_module_p.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=signals_core_module_h;signals_core_module_h=this}};signals_core_module_p.prototype.d=function(){this.f|=8;if(!(1&this.f))signals_core_module_b(this)};signals_core_module_p.prototype.dispose=function(){this.d()};function E(i,t){var r=new signals_core_module_p(i,t);try{r.c()}catch(i){r.d();throw i}var o=r.d.bind(r);o[Symbol.dispose]=o;return o}
;// ./node_modules/@preact/signals/dist/signals.module.js
var signals_module_v,signals_module_s;function signals_module_l(i,n){preact_module/* options */.fF[i]=n.bind(null,preact_module/* options */.fF[i]||function(){})}function signals_module_d(i){if(signals_module_s)signals_module_s();signals_module_s=i&&i.S()}function signals_module_h(i){var r=this,f=i.data,o=useSignal(f);o.value=f;var e=T(function(){var i=r.__v;while(i=i.__)if(i.__c){i.__c.__$f|=4;break}r.__$u.c=function(){var i,t=r.__$u.S(),f=e.value;t();if((0,preact_module/* isValidElement */.zO)(f)||3!==(null==(i=r.base)?void 0:i.nodeType)){r.__$f|=1;r.setState({})}else r.base.data=f};return signals_core_module_w(function(){var i=o.value.value;return 0===i?0:!0===i?"":i||""})},[]);return e.value}signals_module_h.displayName="_st";Object.defineProperties(signals_core_module_u.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:signals_module_h},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});signals_module_l("__b",function(i,r){if("string"==typeof r.type){var n,t=r.props;for(var f in t)if("children"!==f){var o=t[f];if(o instanceof signals_core_module_u){if(!n)r.__np=n={};n[f]=o;t[f]=o.peek()}}}i(r)});signals_module_l("__r",function(i,r){signals_module_d();var n,t=r.__c;if(t){t.__$f&=-2;if(void 0===(n=t.__$u))t.__$u=n=function(i){var r;E(function(){r=this});r.c=function(){t.__$f|=1;t.setState({})};return r}()}signals_module_v=t;signals_module_d(n);i(r)});signals_module_l("__e",function(i,r,n,t){signals_module_d();signals_module_v=void 0;i(r,n,t)});signals_module_l("diffed",function(i,r){signals_module_d();signals_module_v=void 0;var n;if("string"==typeof r.type&&(n=r.__e)){var t=r.__np,f=r.props;if(t){var o=n.U;if(o)for(var e in o){var u=o[e];if(void 0!==u&&!(e in t)){u.d();o[e]=void 0}}else n.U=o={};for(var a in t){var c=o[a],s=t[a];if(void 0===c){c=signals_module_p(n,a,s,f);o[a]=c}else c.o(s,f)}}}i(r)});function signals_module_p(i,r,n,t){var f=r in i&&void 0===i.ownerSVGElement,o=signals_core_module_d(n);return{o:function(i,r){o.value=i;t=r},d:E(function(){var n=o.value.value;if(t[r]!==n){t[r]=n;if(f)i[r]=n;else if(n)i.setAttribute(r,n);else i.removeAttribute(r)}})}}signals_module_l("unmount",function(i,r){if("string"==typeof r.type){var n=r.__e;if(n){var t=n.U;if(t){n.U=void 0;for(var f in t){var o=t[f];if(o)o.d()}}}}else{var e=r.__c;if(e){var u=e.__$u;if(u){e.__$u=void 0;u.d()}}}i(r)});signals_module_l("__h",function(i,r,n,t){if(t<3||9===t)r.__$f|=2;i(r,n,t)});preact_module/* Component */.uA.prototype.shouldComponentUpdate=function(i,r){var n=this.__$u,t=n&&void 0!==n.s;for(var f in r)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){if(!(t||2&this.__$f||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(t||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var o in i)if("__source"!==o&&i[o]!==this.props[o])return!0;for(var e in this.props)if(!(e in i))return!0;return!1};function useSignal(i){return T(function(){return signals_core_module_d(i)},[])}function useComputed(i){var r=f(i);r.current=i;signals_module_v.__$f|=4;return t(function(){return u(function(){return r.current()})},[])}function useSignalEffect(i){var r=f(i);r.current=i;o(function(){return c(function(){return r.current()})},[])}
;// ./node_modules/@wordpress/interactivity/build-module/namespaces.js
const namespaceStack = [];
const getNamespace = () => namespaceStack.slice(-1)[0];
const setNamespace = (namespace) => {
namespaceStack.push(namespace);
};
const resetNamespace = () => {
namespaceStack.pop();
};
;// ./node_modules/@wordpress/interactivity/build-module/scopes.js
const scopeStack = [];
const getScope = () => scopeStack.slice(-1)[0];
const setScope = (scope) => {
scopeStack.push(scope);
};
const resetScope = () => {
scopeStack.pop();
};
const throwNotInScope = (method) => {
throw Error(
`Cannot call \`${method}()\` when there is no scope. If you are using an async function, please consider using a generator instead. If you are using some sort of async callbacks, like \`setTimeout\`, please wrap the callback with \`withScope(callback)\`.`
);
};
const getContext = (namespace) => {
const scope = getScope();
if (true) {
if (!scope) {
throwNotInScope("getContext");
}
}
return scope.context[namespace || getNamespace()];
};
const getElement = () => {
const scope = getScope();
let deepReadOnlyOptions = {};
if (true) {
if (!scope) {
throwNotInScope("getElement");
}
deepReadOnlyOptions = {
errorMessage: "Don't mutate the attributes from `getElement`, use `data-wp-bind` to modify the attributes of an element instead."
};
}
const { ref, attributes } = scope;
return Object.freeze({
ref: ref.current,
attributes: deepReadOnly(attributes, deepReadOnlyOptions)
});
};
const navigationContextSignal = signals_core_module_d(0);
function getServerContext(namespace) {
const scope = getScope();
if (true) {
if (!scope) {
throwNotInScope("getServerContext");
}
}
getServerContext.subscribe = navigationContextSignal.value;
return deepClone(scope.serverContext[namespace || getNamespace()]);
}
getServerContext.subscribe = 0;
;// ./node_modules/@wordpress/interactivity/build-module/utils.js
const afterNextFrame = (callback) => {
return new Promise((resolve) => {
const done = () => {
clearTimeout(timeout);
window.cancelAnimationFrame(raf);
setTimeout(() => {
callback();
resolve();
});
};
const timeout = setTimeout(done, 100);
const raf = window.requestAnimationFrame(done);
});
};
const splitTask = typeof window.scheduler?.yield === "function" ? window.scheduler.yield.bind(window.scheduler) : () => {
return new Promise((resolve) => {
setTimeout(resolve, 0);
});
};
function createFlusher(compute, notify) {
let flush = () => void 0;
const dispose = E(function() {
flush = this.c.bind(this);
this.x = compute;
this.c = notify;
return compute();
});
return { flush, dispose };
}
function utils_useSignalEffect(callback) {
y(() => {
let eff = null;
let isExecuting = false;
const notify = async () => {
if (eff && !isExecuting) {
isExecuting = true;
await afterNextFrame(eff.flush);
isExecuting = false;
}
};
eff = createFlusher(callback, notify);
return eff.dispose;
}, []);
}
function withScope(func) {
const scope = getScope();
const ns = getNamespace();
let wrapped;
if (func?.constructor?.name === "GeneratorFunction") {
wrapped = async (...args) => {
const gen = func(...args);
let value;
let it;
let error;
while (true) {
setNamespace(ns);
setScope(scope);
try {
it = error ? gen.throw(error) : gen.next(value);
error = void 0;
} catch (e) {
throw e;
} finally {
resetScope();
resetNamespace();
}
try {
value = await it.value;
} catch (e) {
error = e;
}
if (it.done) {
if (error) {
throw error;
} else {
break;
}
}
}
return value;
};
} else {
wrapped = (...args) => {
setNamespace(ns);
setScope(scope);
try {
return func(...args);
} finally {
resetNamespace();
resetScope();
}
};
}
const syncAware = func;
if (syncAware.sync) {
const syncAwareWrapped = wrapped;
syncAwareWrapped.sync = true;
return syncAwareWrapped;
}
return wrapped;
}
function useWatch(callback) {
utils_useSignalEffect(withScope(callback));
}
function useInit(callback) {
y(withScope(callback), []);
}
function useEffect(callback, inputs) {
y(withScope(callback), inputs);
}
function useLayoutEffect(callback, inputs) {
_(withScope(callback), inputs);
}
function useCallback(callback, inputs) {
return q(withScope(callback), inputs);
}
function useMemo(factory, inputs) {
return T(withScope(factory), inputs);
}
const createRootFragment = (parent, replaceNode) => {
replaceNode = [].concat(replaceNode);
const sibling = replaceNode[replaceNode.length - 1].nextSibling;
function insert(child, root) {
parent.insertBefore(child, root || sibling);
}
return parent.__k = {
nodeType: 1,
parentNode: parent,
firstChild: replaceNode[0],
childNodes: replaceNode,
insertBefore: insert,
appendChild: insert,
removeChild(c) {
parent.removeChild(c);
},
contains(c) {
parent.contains(c);
}
};
};
function kebabToCamelCase(str) {
return str.replace(/^-+|-+$/g, "").toLowerCase().replace(/-([a-z])/g, function(_match, group1) {
return group1.toUpperCase();
});
}
const logged = /* @__PURE__ */ new Set();
const warn = (message) => {
if (true) {
if (logged.has(message)) {
return;
}
console.warn(message);
try {
throw Error(message);
} catch (e) {
}
logged.add(message);
}
};
const isPlainObject = (candidate) => Boolean(
candidate && typeof candidate === "object" && candidate.constructor === Object
);
function withSyncEvent(callback) {
const syncAware = callback;
syncAware.sync = true;
return syncAware;
}
const readOnlyMap = /* @__PURE__ */ new WeakMap();
const createDeepReadOnlyHandlers = (errorMessage) => {
const handleError = () => {
if (true) {
warn(errorMessage);
}
return false;
};
return {
get(target, prop) {
const value = target[prop];
if (value && typeof value === "object") {
return deepReadOnly(value, { errorMessage });
}
return value;
},
set: handleError,
deleteProperty: handleError,
defineProperty: handleError
};
};
function deepReadOnly(obj, options) {
const errorMessage = options?.errorMessage ?? "Cannot modify read-only object";
if (!readOnlyMap.has(obj)) {
const handlers = createDeepReadOnlyHandlers(errorMessage);
readOnlyMap.set(obj, new Proxy(obj, handlers));
}
return readOnlyMap.get(obj);
}
const navigationSignal = signals_core_module_d(0);
function deepClone(source) {
if (isPlainObject(source)) {
return Object.fromEntries(
Object.entries(source).map(([key, value]) => [
key,
deepClone(value)
])
);
}
if (Array.isArray(source)) {
return source.map((i) => deepClone(i));
}
return source;
}
;// ./node_modules/@wordpress/interactivity/build-module/proxies/registry.js
const objToProxy = /* @__PURE__ */ new WeakMap();
const proxyToObj = /* @__PURE__ */ new WeakMap();
const proxyToNs = /* @__PURE__ */ new WeakMap();
const supported = /* @__PURE__ */ new Set([Object, Array]);
const createProxy = (namespace, obj, handlers) => {
if (!shouldProxy(obj)) {
throw Error("This object cannot be proxified.");
}
if (!objToProxy.has(obj)) {
const proxy = new Proxy(obj, handlers);
objToProxy.set(obj, proxy);
proxyToObj.set(proxy, obj);
proxyToNs.set(proxy, namespace);
}
return objToProxy.get(obj);
};
const getProxyFromObject = (obj) => objToProxy.get(obj);
const getNamespaceFromProxy = (proxy) => proxyToNs.get(proxy);
const shouldProxy = (candidate) => {
if (typeof candidate !== "object" || candidate === null) {
return false;
}
return !proxyToNs.has(candidate) && supported.has(candidate.constructor);
};
const getObjectFromProxy = (proxy) => proxyToObj.get(proxy);
;// ./node_modules/@wordpress/interactivity/build-module/proxies/signals.js
const NO_SCOPE = {};
class PropSignal {
/**
* Proxy that holds the property this PropSignal is associated with.
*/
owner;
/**
* Relation of computeds by scope. These computeds are read-only signals
* that depend on whether the property is a value or a getter and,
* therefore, can return different values depending on the scope in which
* the getter is accessed.
*/
computedsByScope;
/**
* Signal with the value assigned to the related property.
*/
valueSignal;
/**
* Signal with the getter assigned to the related property.
*/
getterSignal;
/**
* Pending getter to be consolidated.
*/
pendingGetter;
/**
* Structure that manages reactivity for a property in a state object, using
* signals to keep track of property value or getter modifications.
*
* @param owner Proxy that holds the property this instance is associated
* with.
*/
constructor(owner) {
this.owner = owner;
this.computedsByScope = /* @__PURE__ */ new WeakMap();
}
/**
* Changes the internal value. If a getter was set before, it is set to
* `undefined`.
*
* @param value New value.
*/
setValue(value) {
this.update({ value });
}
/**
* Changes the internal getter. If a value was set before, it is set to
* `undefined`.
*
* @param getter New getter.
*/
setGetter(getter) {
this.update({ get: getter });
}
/**
* Changes the internal getter asynchronously.
*
* The update is made in a microtask, which prevents issues with getters
* accessing the state, and ensures the update occurs before any render.
*
* @param getter New getter.
*/
setPendingGetter(getter) {
this.pendingGetter = getter;
queueMicrotask(() => this.consolidateGetter());
}
/**
* Consolidate the pending value of the getter.
*/
consolidateGetter() {
const getter = this.pendingGetter;
if (getter) {
this.pendingGetter = void 0;
this.update({ get: getter });
}
}
/**
* Returns the computed that holds the result of evaluating the prop in the
* current scope.
*
* These computeds are read-only signals that depend on whether the property
* is a value or a getter and, therefore, can return different values
* depending on the scope in which the getter is accessed.
*
* @return Computed that depends on the scope.
*/
getComputed() {
const scope = getScope() || NO_SCOPE;
if (!this.valueSignal && !this.getterSignal) {
this.update({});
}
if (this.pendingGetter) {
this.consolidateGetter();
}
if (!this.computedsByScope.has(scope)) {
const callback = () => {
const getter = this.getterSignal?.value;
return getter ? getter.call(this.owner) : this.valueSignal?.value;
};
setNamespace(getNamespaceFromProxy(this.owner));
this.computedsByScope.set(
scope,
signals_core_module_w(withScope(callback))
);
resetNamespace();
}
return this.computedsByScope.get(scope);
}
/**
* Updates the internal signals for the value and the getter of the
* corresponding prop.
*
* @param param0
* @param param0.get New getter.
* @param param0.value New value.
*/
update({ get, value }) {
if (!this.valueSignal) {
this.valueSignal = signals_core_module_d(value);
this.getterSignal = signals_core_module_d(get);
} else if (value !== this.valueSignal.peek() || get !== this.getterSignal.peek()) {
signals_core_module_r(() => {
this.valueSignal.value = value;
this.getterSignal.value = get;
});
}
}
}
;// ./node_modules/@wordpress/interactivity/build-module/proxies/state.js
const wellKnownSymbols = new Set(
Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter((value) => typeof value === "symbol")
);
const proxyToProps = /* @__PURE__ */ new WeakMap();
const hasPropSignal = (proxy, key) => proxyToProps.has(proxy) && proxyToProps.get(proxy).has(key);
const getPropSignal = (proxy, key, initial) => {
if (!proxyToProps.has(proxy)) {
proxyToProps.set(proxy, /* @__PURE__ */ new Map());
}
key = typeof key === "number" ? `${key}` : key;
const props = proxyToProps.get(proxy);
if (!props.has(key)) {
const ns = getNamespaceFromProxy(proxy);
const prop = new PropSignal(proxy);
props.set(key, prop);
if (initial) {
const { get, value } = initial;
if (get) {
prop.setGetter(get);
} else {
prop.setValue(
shouldProxy(value) ? proxifyState(ns, value) : value
);
}
}
}
return props.get(key);
};
const objToIterable = /* @__PURE__ */ new WeakMap();
let peeking = false;
const PENDING_GETTER = Symbol("PENDING_GETTER");
const stateHandlers = {
get(target, key, receiver) {
if (peeking || !target.hasOwnProperty(key) && key in target || typeof key === "symbol" && wellKnownSymbols.has(key)) {
return Reflect.get(target, key, receiver);
}
const desc = Object.getOwnPropertyDescriptor(target, key);
const prop = getPropSignal(receiver, key, desc);
const result = prop.getComputed().value;
if (result === PENDING_GETTER) {
throw PENDING_GETTER;
}
if (typeof result === "function") {
const ns = getNamespaceFromProxy(receiver);
return (...args) => {
setNamespace(ns);
try {
return result.call(receiver, ...args);
} finally {
resetNamespace();
}
};
}
return result;
},
set(target, key, value, receiver) {
setNamespace(getNamespaceFromProxy(receiver));
try {
return Reflect.set(target, key, value, receiver);
} finally {
resetNamespace();
}
},
defineProperty(target, key, desc) {
const isNew = !(key in target);
const result = Reflect.defineProperty(target, key, desc);
if (result) {
const receiver = getProxyFromObject(target);
const prop = getPropSignal(receiver, key);
const { get, value } = desc;
if (get) {
prop.setGetter(get);
} else {
const ns = getNamespaceFromProxy(receiver);
prop.setValue(
shouldProxy(value) ? proxifyState(ns, value) : value
);
}
if (isNew && objToIterable.has(target)) {
objToIterable.get(target).value++;
}
if (Array.isArray(target) && proxyToProps.get(receiver)?.has("length")) {
const length = getPropSignal(receiver, "length");
length.setValue(target.length);
}
}
return result;
},
deleteProperty(target, key) {
const result = Reflect.deleteProperty(target, key);
if (result) {
const prop = getPropSignal(getProxyFromObject(target), key);
prop.setValue(void 0);
if (objToIterable.has(target)) {
objToIterable.get(target).value++;
}
}
return result;
},
ownKeys(target) {
if (!objToIterable.has(target)) {
objToIterable.set(target, signals_core_module_d(0));
}
objToIterable._ = objToIterable.get(target).value;
return Reflect.ownKeys(target);
}
};
const proxifyState = (namespace, obj) => {
return createProxy(namespace, obj, stateHandlers);
};
const peek = (obj, key) => {
peeking = true;
try {
return obj[key];
} finally {
peeking = false;
}
};
const deepMergeRecursive = (target, source, override = true) => {
if (!(isPlainObject(target) && isPlainObject(source))) {
return;
}
let hasNewKeys = false;
for (const key in source) {
const isNew = !(key in target);
hasNewKeys = hasNewKeys || isNew;
const desc = Object.getOwnPropertyDescriptor(source, key);
const proxy = getProxyFromObject(target);
const propSignal = !!proxy && hasPropSignal(proxy, key) && getPropSignal(proxy, key);
if (typeof desc.get === "function" || typeof desc.set === "function") {
if (override || isNew) {
Object.defineProperty(target, key, {
...desc,
configurable: true,
enumerable: true
});
if (desc.get && propSignal) {
propSignal.setPendingGetter(desc.get);
}
}
} else if (isPlainObject(source[key])) {
const targetValue = Object.getOwnPropertyDescriptor(target, key)?.value;
if (isNew || override && !isPlainObject(targetValue)) {
target[key] = {};
if (propSignal) {
const ns = getNamespaceFromProxy(proxy);
propSignal.setValue(
proxifyState(ns, target[key])
);
}
deepMergeRecursive(target[key], source[key], override);
} else if (isPlainObject(targetValue)) {
deepMergeRecursive(target[key], source[key], override);
}
} else if (override || isNew) {
Object.defineProperty(target, key, desc);
if (propSignal) {
const { value } = desc;
const ns = getNamespaceFromProxy(proxy);
propSignal.setValue(
shouldProxy(value) ? proxifyState(ns, value) : value
);
}
}
}
if (hasNewKeys && objToIterable.has(target)) {
objToIterable.get(target).value++;
}
};
const deepMerge = (target, source, override = true) => signals_core_module_r(
() => deepMergeRecursive(
getObjectFromProxy(target) || target,
source,
override
)
);
;// ./node_modules/@wordpress/interactivity/build-module/proxies/store.js
const storeRoots = /* @__PURE__ */ new WeakSet();
const storeHandlers = {
get: (target, key, receiver) => {
const result = Reflect.get(target, key);
const ns = getNamespaceFromProxy(receiver);
if (typeof result === "undefined" && storeRoots.has(receiver)) {
const obj = {};
Reflect.set(target, key, obj);
return proxifyStore(ns, obj, false);
}
if (typeof result === "function") {
setNamespace(ns);
const scoped = withScope(result);
resetNamespace();
return scoped;
}
if (isPlainObject(result) && shouldProxy(result)) {
return proxifyStore(ns, result, false);
}
return result;
}
};
const proxifyStore = (namespace, obj, isRoot = true) => {
const proxy = createProxy(namespace, obj, storeHandlers);
if (proxy && isRoot) {
storeRoots.add(proxy);
}
return proxy;
};
;// ./node_modules/@wordpress/interactivity/build-module/proxies/context.js
const contextObjectToProxy = /* @__PURE__ */ new WeakMap();
const contextObjectToFallback = /* @__PURE__ */ new WeakMap();
const contextProxies = /* @__PURE__ */ new WeakSet();
const descriptor = Reflect.getOwnPropertyDescriptor;
const contextHandlers = {
get: (target, key) => {
const fallback = contextObjectToFallback.get(target);
const currentProp = target[key];
return key in target ? currentProp : fallback[key];
},
set: (target, key, value) => {
const fallback = contextObjectToFallback.get(target);
const obj = key in target || !(key in fallback) ? target : fallback;
obj[key] = value;
return true;
},
ownKeys: (target) => [
.../* @__PURE__ */ new Set([
...Object.keys(contextObjectToFallback.get(target)),
...Object.keys(target)
])
],
getOwnPropertyDescriptor: (target, key) => descriptor(target, key) || descriptor(contextObjectToFallback.get(target), key),
has: (target, key) => Reflect.has(target, key) || Reflect.has(contextObjectToFallback.get(target), key)
};
const proxifyContext = (current, inherited = {}) => {
if (contextProxies.has(current)) {
throw Error("This object cannot be proxified.");
}
contextObjectToFallback.set(current, inherited);
if (!contextObjectToProxy.has(current)) {
const proxy = new Proxy(current, contextHandlers);
contextObjectToProxy.set(current, proxy);
contextProxies.add(proxy);
}
return contextObjectToProxy.get(current);
};
;// ./node_modules/@wordpress/interactivity/build-module/proxies/index.js
;// ./node_modules/@wordpress/interactivity/build-module/store.js
const stores = /* @__PURE__ */ new Map();
const rawStores = /* @__PURE__ */ new Map();
const storeLocks = /* @__PURE__ */ new Map();
const storeConfigs = /* @__PURE__ */ new Map();
const serverStates = /* @__PURE__ */ new Map();
const getConfig = (namespace) => storeConfigs.get(namespace || getNamespace()) || {};
function getServerState(namespace) {
const ns = namespace || getNamespace();
if (!serverStates.has(ns)) {
serverStates.set(ns, {});
}
getServerState.subscribe = navigationSignal.value;
return deepClone(serverStates.get(ns));
}
getServerState.subscribe = 0;
const universalUnlock = "I acknowledge that using a private store means my plugin will inevitably break on the next store release.";
function store(namespace, { state = {}, ...block } = {}, { lock = false } = {}) {
if (!stores.has(namespace)) {
if (lock !== universalUnlock) {
storeLocks.set(namespace, lock);
}
const rawStore = {
state: proxifyState(
namespace,
isPlainObject(state) ? state : {}
),
...block
};
const proxifiedStore = proxifyStore(namespace, rawStore);
rawStores.set(namespace, rawStore);
stores.set(namespace, proxifiedStore);
} else {
if (lock !== universalUnlock && !storeLocks.has(namespace)) {
storeLocks.set(namespace, lock);
} else {
const storeLock = storeLocks.get(namespace);
const isLockValid = lock === universalUnlock || lock !== true && lock === storeLock;
if (!isLockValid) {
if (!storeLock) {
throw Error("Cannot lock a public store");
} else {
throw Error(
"Cannot unlock a private store with an invalid lock code"
);
}
}
}
const target = rawStores.get(namespace);
deepMerge(target, block);
deepMerge(target.state, state);
}
return stores.get(namespace);
}
const parseServerData = (dom = document) => {
const jsonDataScriptTag = (
// Preferred Script Module data passing form
dom.getElementById(
"wp-script-module-data-@wordpress/interactivity"
) ?? // Legacy form
dom.getElementById("wp-interactivity-data")
);
if (jsonDataScriptTag?.textContent) {
try {
return JSON.parse(jsonDataScriptTag.textContent);
} catch {
}
}
return {};
};
const populateServerData = (data2) => {
serverStates.clear();
storeConfigs.clear();
if (isPlainObject(data2?.state)) {
Object.entries(data2.state).forEach(([namespace, state]) => {
const st = store(namespace, {}, { lock: universalUnlock });
deepMerge(st.state, state, false);
serverStates.set(namespace, state);
});
}
if (isPlainObject(data2?.config)) {
Object.entries(data2.config).forEach(([namespace, config]) => {
storeConfigs.set(namespace, config);
});
}
if (isPlainObject(data2?.derivedStateClosures)) {
Object.entries(data2.derivedStateClosures).forEach(
([namespace, paths]) => {
const st = store(
namespace,
{},
{ lock: universalUnlock }
);
paths.forEach((path) => {
const pathParts = path.split(".");
const prop = pathParts.splice(-1, 1)[0];
const parent = pathParts.reduce(
(prev, key) => peek(prev, key),
st
);
const desc = Object.getOwnPropertyDescriptor(
parent,
prop
);
if (isPlainObject(desc?.value)) {
parent[prop] = PENDING_GETTER;
}
});
}
);
}
};
const data = parseServerData();
populateServerData(data);
;// ./node_modules/@wordpress/interactivity/build-module/hooks.js
function isNonDefaultDirectiveSuffix(entry) {
return entry.suffix !== null;
}
function isDefaultDirectiveSuffix(entry) {
return entry.suffix === null;
}
const context = (0,preact_module/* createContext */.q6)({ client: {}, server: {} });
const directiveCallbacks = {};
const directivePriorities = {};
const directive = (name, callback, { priority = 10 } = {}) => {
directiveCallbacks[name] = callback;
directivePriorities[name] = priority;
};
const resolve = (path, namespace) => {
if (!namespace) {
warn(
`Namespace missing for "${path}". The value for that path won't be resolved.`
);
return;
}
let resolvedStore = stores.get(namespace);
if (typeof resolvedStore === "undefined") {
resolvedStore = store(
namespace,
{},
{
lock: universalUnlock
}
);
}
const current = {
...resolvedStore,
context: getScope().context[namespace]
};
try {
const pathParts = path.split(".");
return pathParts.reduce((acc, key) => acc[key], current);
} catch (e) {
if (e === PENDING_GETTER) {
return PENDING_GETTER;
}
}
};
const getEvaluate = ({ scope }) => (
// TODO: When removing the temporarily remaining `value( ...args )` call below, remove the `...args` parameter too.
(entry, ...args) => {
let { value: path, namespace } = entry;
if (typeof path !== "string") {
throw new Error("The `value` prop should be a string path");
}
const hasNegationOperator = path[0] === "!" && !!(path = path.slice(1));
setScope(scope);
const value = resolve(path, namespace);
if (typeof value === "function") {
if (hasNegationOperator) {
warn(
"Using a function with a negation operator is deprecated and will stop working in WordPress 6.9. Please use derived state instead."
);
const functionResult = !value(...args);
resetScope();
return functionResult;
}
resetScope();
const wrappedFunction = (...functionArgs) => {
setScope(scope);
const functionResult = value(...functionArgs);
resetScope();
return functionResult;
};
if (value.sync) {
const syncAwareFunction = wrappedFunction;
syncAwareFunction.sync = true;
}
return wrappedFunction;
}
const result = value;
resetScope();
return hasNegationOperator && value !== PENDING_GETTER ? !result : result;
}
);
const getPriorityLevels = (directives) => {
const byPriority = Object.keys(directives).reduce((obj, name) => {
if (directiveCallbacks[name]) {
const priority = directivePriorities[name];
(obj[priority] = obj[priority] || []).push(name);
}
return obj;
}, {});
return Object.entries(byPriority).sort(([p1], [p2]) => parseInt(p1) - parseInt(p2)).map(([, arr]) => arr);
};
const Directives = ({
directives,
priorityLevels: [currentPriorityLevel, ...nextPriorityLevels],
element,
originalProps,
previousScope
}) => {
const scope = A({}).current;
scope.evaluate = q(getEvaluate({ scope }), []);
const { client, server } = x(context);
scope.context = client;
scope.serverContext = server;
scope.ref = previousScope?.ref || A(null);
element = (0,preact_module/* cloneElement */.Ob)(element, { ref: scope.ref });
scope.attributes = element.props;
const children = nextPriorityLevels.length > 0 ? (0,preact_module.h)(Directives, {
directives,
priorityLevels: nextPriorityLevels,
element,
originalProps,
previousScope: scope
}) : element;
const props = { ...originalProps, children };
const directiveArgs = {
directives,
props,
element,
context,
evaluate: scope.evaluate
};
setScope(scope);
for (const directiveName of currentPriorityLevel) {
const wrapper = directiveCallbacks[directiveName]?.(directiveArgs);
if (wrapper !== void 0) {
props.children = wrapper;
}
}
resetScope();
return props.children;
};
const old = preact_module/* options */.fF.vnode;
preact_module/* options */.fF.vnode = (vnode) => {
if (vnode.props.__directives) {
const props = vnode.props;
const directives = props.__directives;
if (directives.key) {
vnode.key = directives.key.find(isDefaultDirectiveSuffix).value;
}
delete props.__directives;
const priorityLevels = getPriorityLevels(directives);
if (priorityLevels.length > 0) {
vnode.props = {
directives,
priorityLevels,
originalProps: props,
type: vnode.type,
element: (0,preact_module.h)(vnode.type, props),
top: true
};
vnode.type = Directives;
}
}
if (old) {
old(vnode);
}
};
;// ./node_modules/@wordpress/interactivity/build-module/directives.js
const warnUniqueIdWithTwoHyphens = (prefix, suffix, uniqueId) => {
if (true) {
warn(
`The usage of data-wp-${prefix}--${suffix}${uniqueId ? `--${uniqueId}` : ""} (two hyphens for unique ID) is deprecated and will stop working in WordPress 7.0. Please use data-wp-${prefix}${uniqueId ? `--${suffix}---${uniqueId}` : `---${suffix}`} (three hyphens for unique ID) from now on.`
);
}
};
const warnUniqueIdNotSupported = (prefix, uniqueId) => {
if (true) {
warn(
`Unique IDs are not supported for the data-wp-${prefix} directive. Ignoring the directive with unique ID "${uniqueId}".`
);
}
};
const warnWithSyncEvent = (wrongPrefix, rightPrefix) => {
if (true) {
warn(
`The usage of data-wp-${wrongPrefix} is deprecated and will stop working in WordPress 7.0. Please, use data-wp-${rightPrefix} with the withSyncEvent() helper from now on.`
);
}
};
function wrapEventAsync(event) {
const handler = {
get(target, prop, receiver) {
const value = target[prop];
switch (prop) {
case "currentTarget":
if (true) {
warn(
`Accessing the synchronous event.${prop} property in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 7.0. Please wrap the store action in withSyncEvent().`
);
}
break;
case "preventDefault":
case "stopImmediatePropagation":
case "stopPropagation":
if (true) {
warn(
`Using the synchronous event.${prop}() function in a store action without wrapping it in withSyncEvent() is deprecated and will stop working in WordPress 7.0. Please wrap the store action in withSyncEvent().`
);
}
break;
}
if (value instanceof Function) {
return function(...args) {
return value.apply(
this === receiver ? target : this,
args
);
};
}
return value;
}
};
return new Proxy(event, handler);
}
const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
const ruleClean = /\/\*[^]*?\*\/| +/g;
const ruleNewline = /\n+/g;
const empty = " ";
const cssStringToObject = (val) => {
const tree = [{}];
let block, left;
while (block = newRule.exec(val.replace(ruleClean, ""))) {
if (block[4]) {
tree.shift();
} else if (block[3]) {
left = block[3].replace(ruleNewline, empty).trim();
tree.unshift(tree[0][left] = tree[0][left] || {});
} else {
tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
}
}
return tree[0];
};
const getGlobalEventDirective = (type) => {
return ({ directives, evaluate }) => {
directives[`on-${type}`].filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
const suffixParts = entry.suffix.split("--", 2);
const eventName = suffixParts[0];
if (true) {
if (suffixParts[1]) {
warnUniqueIdWithTwoHyphens(
`on-${type}`,
suffixParts[0],
suffixParts[1]
);
}
}
useInit(() => {
const cb = (event) => {
const result = evaluate(entry);
if (typeof result === "function") {
if (!result?.sync) {
event = wrapEventAsync(event);
}
result(event);
}
};
const globalVar = type === "window" ? window : document;
globalVar.addEventListener(eventName, cb);
return () => globalVar.removeEventListener(eventName, cb);
});
});
};
};
const evaluateItemKey = (inheritedValue, namespace, item, itemProp, eachKey) => {
const clientContextWithItem = {
...inheritedValue.client,
[namespace]: {
...inheritedValue.client[namespace],
[itemProp]: item
}
};
const scope = {
...getScope(),
context: clientContextWithItem,
serverContext: inheritedValue.server
};
return eachKey ? getEvaluate({ scope })(eachKey) : item;
};
const useItemContexts = function* (inheritedValue, namespace, items, itemProp, eachKey) {
const { current: itemContexts } = A(/* @__PURE__ */ new Map());
for (const item of items) {
const key = evaluateItemKey(
inheritedValue,
namespace,
item,
itemProp,
eachKey
);
if (!itemContexts.has(key)) {
itemContexts.set(
key,
proxifyContext(
proxifyState(namespace, {
// Inits the item prop in the context to shadow it in case
// it was inherited from the parent context. The actual
// value is set in the `wp-each` directive later on.
[itemProp]: void 0
}),
inheritedValue.client[namespace]
)
);
}
yield [item, itemContexts.get(key), key];
}
};
const getGlobalAsyncEventDirective = (type) => {
return ({ directives, evaluate }) => {
directives[`on-async-${type}`].filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
if (true) {
warnWithSyncEvent(`on-async-${type}`, `on-${type}`);
}
const eventName = entry.suffix.split("--", 1)[0];
useInit(() => {
const cb = async (event) => {
await splitTask();
const result = evaluate(entry);
if (typeof result === "function") {
result(event);
}
};
const globalVar = type === "window" ? window : document;
globalVar.addEventListener(eventName, cb, {
passive: true
});
return () => globalVar.removeEventListener(eventName, cb);
});
});
};
};
const routerRegions = /* @__PURE__ */ new Map();
var directives_default = () => {
directive(
"context",
({
directives: { context },
props: { children },
context: inheritedContext
}) => {
const entries = context.filter(isDefaultDirectiveSuffix).reverse();
if (!entries.length) {
if (true) {
warn(
"The usage of data-wp-context--unique-id (two hyphens) is not supported. To add a unique ID to the directive, please use data-wp-context---unique-id (three hyphens) instead."
);
}
return;
}
const { Provider } = inheritedContext;
const { client: inheritedClient, server: inheritedServer } = x(inheritedContext);
const client = A({});
const server = {};
const result = {
client: { ...inheritedClient },
server: { ...inheritedServer }
};
const namespaces = /* @__PURE__ */ new Set();
entries.forEach(({ value, namespace, uniqueId }) => {
if (!isPlainObject(value)) {
if (true) {
warn(
`The value of data-wp-context${uniqueId ? `---${uniqueId}` : ""} on the ${namespace} namespace must be a valid stringified JSON object.`
);
}
return;
}
if (!client.current[namespace]) {
client.current[namespace] = proxifyState(namespace, {});
}
deepMerge(
client.current[namespace],
deepClone(value),
false
);
server[namespace] = value;
namespaces.add(namespace);
});
namespaces.forEach((namespace) => {
result.client[namespace] = proxifyContext(
client.current[namespace],
inheritedClient[namespace]
);
result.server[namespace] = proxifyContext(
server[namespace],
inheritedServer[namespace]
);
});
return (0,preact_module.h)(Provider, { value: result }, children);
},
{ priority: 5 }
);
directive("watch", ({ directives: { watch }, evaluate }) => {
watch.forEach((entry) => {
if (true) {
if (entry.suffix) {
warnUniqueIdWithTwoHyphens("watch", entry.suffix);
}
}
useWatch(() => {
let start;
if (false) {}
let result = evaluate(entry);
if (typeof result === "function") {
result = result();
}
if (false) {}
return result;
});
});
});
directive("init", ({ directives: { init }, evaluate }) => {
init.forEach((entry) => {
if (true) {
if (entry.suffix) {
warnUniqueIdWithTwoHyphens("init", entry.suffix);
}
}
useInit(() => {
let start;
if (false) {}
let result = evaluate(entry);
if (typeof result === "function") {
result = result();
}
if (false) {}
return result;
});
});
});
directive("on", ({ directives: { on }, element, evaluate }) => {
const events = /* @__PURE__ */ new Map();
on.filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
const suffixParts = entry.suffix.split("--", 2);
if (true) {
if (suffixParts[1]) {
warnUniqueIdWithTwoHyphens(
"on",
suffixParts[0],
suffixParts[1]
);
}
}
if (!events.has(suffixParts[0])) {
events.set(suffixParts[0], /* @__PURE__ */ new Set());
}
events.get(suffixParts[0]).add(entry);
});
events.forEach((entries, eventType) => {
const existingHandler = element.props[`on${eventType}`];
element.props[`on${eventType}`] = (event) => {
if (existingHandler) {
existingHandler(event);
}
entries.forEach((entry) => {
let start;
if (false) {}
const result = evaluate(entry);
if (typeof result === "function") {
if (!result?.sync) {
event = wrapEventAsync(event);
}
result(event);
}
if (false) {}
});
};
});
});
directive(
"on-async",
({ directives: { "on-async": onAsync }, element, evaluate }) => {
if (true) {
warnWithSyncEvent("on-async", "on");
}
const events = /* @__PURE__ */ new Map();
onAsync.filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
const event = entry.suffix.split("--", 1)[0];
if (!events.has(event)) {
events.set(event, /* @__PURE__ */ new Set());
}
events.get(event).add(entry);
});
events.forEach((entries, eventType) => {
const existingHandler = element.props[`on${eventType}`];
element.props[`on${eventType}`] = (event) => {
if (existingHandler) {
existingHandler(event);
}
entries.forEach(async (entry) => {
await splitTask();
const result = evaluate(entry);
if (typeof result === "function") {
result(event);
}
});
};
});
}
);
directive("on-window", getGlobalEventDirective("window"));
directive("on-document", getGlobalEventDirective("document"));
directive("on-async-window", getGlobalAsyncEventDirective("window"));
directive(
"on-async-document",
getGlobalAsyncEventDirective("document")
);
directive(
"class",
({ directives: { class: classNames }, element, evaluate }) => {
classNames.filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
const className = entry.uniqueId ? `${entry.suffix}---${entry.uniqueId}` : entry.suffix;
let result = evaluate(entry);
if (result === PENDING_GETTER) {
return;
}
if (typeof result === "function") {
result = result();
}
const currentClass = element.props.class || "";
const classFinder = new RegExp(
`(^|\\s)${className}(\\s|$)`,
"g"
);
if (!result) {
element.props.class = currentClass.replace(classFinder, " ").trim();
} else if (!classFinder.test(currentClass)) {
element.props.class = currentClass ? `${currentClass} ${className}` : className;
}
useInit(() => {
if (!result) {
element.ref.current.classList.remove(className);
} else {
element.ref.current.classList.add(className);
}
});
});
}
);
directive("style", ({ directives: { style }, element, evaluate }) => {
style.filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
if (entry.uniqueId) {
if (true) {
warnUniqueIdNotSupported("style", entry.uniqueId);
}
return;
}
const styleProp = entry.suffix;
let result = evaluate(entry);
if (result === PENDING_GETTER) {
return;
}
if (typeof result === "function") {
result = result();
}
element.props.style = element.props.style || {};
if (typeof element.props.style === "string") {
element.props.style = cssStringToObject(element.props.style);
}
if (!result) {
delete element.props.style[styleProp];
} else {
element.props.style[styleProp] = result;
}
useInit(() => {
if (!result) {
element.ref.current.style.removeProperty(styleProp);
} else {
element.ref.current.style.setProperty(styleProp, result);
}
});
});
});
directive("bind", ({ directives: { bind }, element, evaluate }) => {
bind.filter(isNonDefaultDirectiveSuffix).forEach((entry) => {
if (entry.uniqueId) {
if (true) {
warnUniqueIdNotSupported("bind", entry.uniqueId);
}
return;
}
const attribute = entry.suffix;
let result = evaluate(entry);
if (result === PENDING_GETTER) {
return;
}
if (typeof result === "function") {
result = result();
}
element.props[attribute] = result;
useInit(() => {
const el = element.ref.current;
if (attribute === "style") {
if (typeof result === "string") {
el.style.cssText = result;
}
return;
} else if (attribute !== "width" && attribute !== "height" && attribute !== "href" && attribute !== "list" && attribute !== "form" && /*
* The value for `tabindex` follows the parsing rules for an
* integer. If that fails, or if the attribute isn't present, then
* the browsers should "follow platform conventions to determine if
* the element should be considered as a focusable area",
* practically meaning that most elements get a default of `-1` (not
* focusable), but several also get a default of `0` (focusable in
* order after all elements with a positive `tabindex` value).
*
* @see https://html.spec.whatwg.org/#tabindex-value
*/
attribute !== "tabIndex" && attribute !== "download" && attribute !== "rowSpan" && attribute !== "colSpan" && attribute !== "role" && attribute in el) {
try {
el[attribute] = result === null || result === void 0 ? "" : result;
return;
} catch (err) {
}
}
if (result !== null && result !== void 0 && (result !== false || attribute[4] === "-")) {
el.setAttribute(attribute, result);
} else {
el.removeAttribute(attribute);
}
});
});
});
directive(
"ignore",
({
element: {
type: Type,
props: { innerHTML, ...rest }
}
}) => {
if (true) {
warn(
"The data-wp-ignore directive is deprecated and will be removed in version 7.0."
);
}
const cached = T(() => innerHTML, []);
return (0,preact_module.h)(Type, {
dangerouslySetInnerHTML: { __html: cached },
...rest
});
}
);
directive("text", ({ directives: { text }, element, evaluate }) => {
const entries = text.filter(isDefaultDirectiveSuffix);
if (!entries.length) {
if (true) {
warn(
"The usage of data-wp-text--suffix is not supported. Please use data-wp-text instead."
);
}
return;
}
entries.forEach((entry) => {
if (entry.uniqueId) {
if (true) {
warnUniqueIdNotSupported("text", entry.uniqueId);
}
return;
}
try {
let result = evaluate(entry);
if (result === PENDING_GETTER) {
return;
}
if (typeof result === "function") {
result = result();
}
element.props.children = typeof result === "object" ? null : result.toString();
} catch (e) {
element.props.children = null;
}
});
});
directive("run", ({ directives: { run }, evaluate }) => {
run.forEach((entry) => {
if (true) {
if (entry.suffix) {
warnUniqueIdWithTwoHyphens("run", entry.suffix);
}
}
let result = evaluate(entry);
if (typeof result === "function") {
result = result();
}
return result;
});
});
directive(
"each",
({
directives: { each, "each-key": eachKey },
context: inheritedContext,
element,
evaluate
}) => {
if (element.type !== "template") {
if (true) {
warn(
"The data-wp-each directive can only be used on <template> elements."
);
}
return;
}
const { Provider } = inheritedContext;
const inheritedValue = x(inheritedContext);
const [entry] = each;
const { namespace, suffix, uniqueId } = entry;
if (each.length > 1) {
if (true) {
warn(
"The usage of multiple data-wp-each directives on the same element is not supported. Please pick only one."
);
}
return;
}
if (uniqueId) {
if (true) {
warnUniqueIdNotSupported("each", uniqueId);
}
return;
}
let iterable = evaluate(entry);
if (iterable === PENDING_GETTER) {
return;
}
if (typeof iterable === "function") {
iterable = iterable();
}
if (typeof iterable?.[Symbol.iterator] !== "function") {
return;
}
const itemProp = suffix ? kebabToCamelCase(suffix) : "item";
const result = [];
const itemContexts = useItemContexts(
inheritedValue,
namespace,
iterable,
itemProp,
eachKey?.[0]
);
for (const [item, itemContext, key] of itemContexts) {
const mergedContext = {
client: {
...inheritedValue.client,
[namespace]: itemContext
},
server: { ...inheritedValue.server }
};
mergedContext.client[namespace][itemProp] = item;
result.push(
(0,preact_module.h)(
Provider,
{ value: mergedContext, key },
element.props.content
)
);
}
return result;
},
{ priority: 20 }
);
directive(
"each-child",
({ directives: { "each-child": eachChild }, element, evaluate }) => {
const entry = eachChild.find(isDefaultDirectiveSuffix);
if (!entry) {
return;
}
const iterable = evaluate(entry);
return iterable === PENDING_GETTER ? element : null;
},
{ priority: 1 }
);
directive(
"router-region",
({ directives: { "router-region": routerRegion } }) => {
const entry = routerRegion.find(isDefaultDirectiveSuffix);
if (!entry) {
return;
}
if (entry.suffix) {
if (true) {
warn(
`Suffixes for the data-wp-router-region directive are not supported. Ignoring the directive with suffix "${entry.suffix}".`
);
}
return;
}
if (entry.uniqueId) {
if (true) {
warnUniqueIdNotSupported("router-region", entry.uniqueId);
}
return;
}
const regionId = typeof entry.value === "string" ? entry.value : entry.value.id;
if (!routerRegions.has(regionId)) {
routerRegions.set(regionId, signals_core_module_d());
}
const vdom = routerRegions.get(regionId).value;
_(() => {
if (vdom && typeof vdom.type !== "string") {
navigationContextSignal.value = navigationContextSignal.peek() + 1;
}
}, [vdom]);
if (vdom && typeof vdom.type !== "string") {
const previousScope = getScope();
return (0,preact_module/* cloneElement */.Ob)(vdom, { previousScope });
}
return vdom;
},
{ priority: 1 }
);
};
;// ./node_modules/@wordpress/interactivity/build-module/vdom.js
const directivePrefix = `data-wp-`;
const namespaces = [];
const currentNamespace = () => namespaces[namespaces.length - 1] ?? null;
const isObject = (item) => Boolean(item && typeof item === "object" && item.constructor === Object);
const invalidCharsRegex = /[^a-z0-9-_]/i;
function parseDirectiveName(directiveName) {
const name = directiveName.substring(8);
if (invalidCharsRegex.test(name)) {
return null;
}
const suffixIndex = name.indexOf("--");
if (suffixIndex === -1) {
return { prefix: name, suffix: null, uniqueId: null };
}
const prefix = name.substring(0, suffixIndex);
const remaining = name.substring(suffixIndex);
if (remaining.startsWith("---") && remaining[3] !== "-") {
return {
prefix,
suffix: null,
uniqueId: remaining.substring(3) || null
};
}
let suffix = remaining.substring(2);
const uniqueIdIndex = suffix.indexOf("---");
if (uniqueIdIndex !== -1 && suffix.substring(uniqueIdIndex)[3] !== "-") {
const uniqueId = suffix.substring(uniqueIdIndex + 3) || null;
suffix = suffix.substring(0, uniqueIdIndex) || null;
return { prefix, suffix, uniqueId };
}
return { prefix, suffix: suffix || null, uniqueId: null };
}
const nsPathRegExp = /^([\w_\/-]+)::(.+)$/;
const hydratedIslands = /* @__PURE__ */ new WeakSet();
function toVdom(root) {
const nodesToRemove = /* @__PURE__ */ new Set();
const nodesToReplace = /* @__PURE__ */ new Set();
const treeWalker = document.createTreeWalker(
root,
205
// TEXT + CDATA_SECTION + COMMENT + PROCESSING_INSTRUCTION + ELEMENT
);
function walk(node) {
const { nodeType } = node;
if (nodeType === 3) {
return node.data;
}
if (nodeType === 4) {
nodesToReplace.add(node);
return node.nodeValue;
}
if (nodeType === 8 || nodeType === 7) {
nodesToRemove.add(node);
return null;
}
const elementNode = node;
const { attributes } = elementNode;
const localName = elementNode.localName;
const props = {};
const children = [];
const directives = [];
let ignore = false;
let island = false;
for (let i = 0; i < attributes.length; i++) {
const attributeName = attributes[i].name;
const attributeValue = attributes[i].value;
if (attributeName[directivePrefix.length] && attributeName.slice(0, directivePrefix.length) === directivePrefix) {
if (attributeName === "data-wp-ignore") {
ignore = true;
} else {
const regexResult = nsPathRegExp.exec(attributeValue);
const namespace = regexResult?.[1] ?? null;
let value = regexResult?.[2] ?? attributeValue;
try {
const parsedValue = JSON.parse(value);
value = isObject(parsedValue) ? parsedValue : value;
} catch {
}
if (attributeName === "data-wp-interactive") {
island = true;
const islandNamespace = (
// eslint-disable-next-line no-nested-ternary
typeof value === "string" ? value : typeof value?.namespace === "string" ? value.namespace : null
);
namespaces.push(islandNamespace);
} else {
directives.push([attributeName, namespace, value]);
}
}
} else if (attributeName === "ref") {
continue;
}
props[attributeName] = attributeValue;
}
if (ignore && !island) {
return [
(0,preact_module.h)(localName, {
...props,
innerHTML: elementNode.innerHTML,
__directives: { ignore: true }
})
];
}
if (island) {
hydratedIslands.add(elementNode);
}
if (directives.length) {
props.__directives = directives.reduce((obj, [name, ns, value]) => {
const directiveParsed = parseDirectiveName(name);
if (directiveParsed === null) {
if (true) {
warn(`Found malformed directive name: ${name}.`);
}
return obj;
}
const { prefix, suffix, uniqueId } = directiveParsed;
obj[prefix] = obj[prefix] || [];
obj[prefix].push({
namespace: ns ?? currentNamespace(),
value,
suffix,
uniqueId
});
return obj;
}, {});
for (const prefix in props.__directives) {
props.__directives[prefix].sort(
(a, b) => {
const aSuffix = a.suffix ?? "";
const bSuffix = b.suffix ?? "";
if (aSuffix !== bSuffix) {
return aSuffix < bSuffix ? -1 : 1;
}
const aId = a.uniqueId ?? "";
const bId = b.uniqueId ?? "";
return +(aId > bId) - +(aId < bId);
}
);
}
}
if (props.__directives?.["each-child"]) {
props.dangerouslySetInnerHTML = {
__html: elementNode.innerHTML
};
} else if (localName === "template") {
props.content = [
...elementNode.content.childNodes
].map((childNode) => toVdom(childNode));
} else {
let child = treeWalker.firstChild();
if (child) {
while (child) {
const vnode = walk(child);
if (vnode) {
children.push(vnode);
}
child = treeWalker.nextSibling();
}
treeWalker.parentNode();
}
}
if (island) {
namespaces.pop();
}
return (0,preact_module.h)(localName, props, children);
}
const vdom = walk(treeWalker.currentNode);
nodesToRemove.forEach(
(node) => node.remove()
);
nodesToReplace.forEach(
(node) => node.replaceWith(
new window.Text(node.nodeValue ?? "")
)
);
return vdom;
}
;// ./node_modules/@wordpress/interactivity/build-module/init.js
const regionRootFragments = /* @__PURE__ */ new WeakMap();
const getRegionRootFragment = (regions) => {
const region = Array.isArray(regions) ? regions[0] : regions;
if (!region.parentElement) {
throw Error("The passed region should be an element with a parent.");
}
if (!regionRootFragments.has(region)) {
regionRootFragments.set(
region,
createRootFragment(region.parentElement, regions)
);
}
return regionRootFragments.get(region);
};
const initialVdom = /* @__PURE__ */ new WeakMap();
const init = async () => {
const nodes = document.querySelectorAll(`[data-wp-interactive]`);
await new Promise((resolve) => {
setTimeout(resolve, 0);
});
for (const node of nodes) {
if (!hydratedIslands.has(node)) {
await splitTask();
const fragment = getRegionRootFragment(node);
const vdom = toVdom(node);
initialVdom.set(node, vdom);
await splitTask();
(0,preact_module/* hydrate */.Qv)(vdom, fragment);
}
}
};
;// ./node_modules/@wordpress/interactivity/build-module/index.js
const requiredConsent = "I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.";
const privateApis = (lock) => {
if (lock === requiredConsent) {
return {
getRegionRootFragment: getRegionRootFragment,
initialVdom: initialVdom,
toVdom: toVdom,
directive: directive,
getNamespace: getNamespace,
h: preact_module.h,
cloneElement: preact_module/* cloneElement */.Ob,
render: preact_module/* render */.XX,
proxifyState: proxifyState,
parseServerData: parseServerData,
populateServerData: populateServerData,
batch: signals_core_module_r,
routerRegions: routerRegions,
deepReadOnly: deepReadOnly,
navigationSignal: navigationSignal
};
}
throw new Error("Forbidden access.");
};
directives_default();
init();
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/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__ = {};
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
zj: () => (/* reexport */ debug_build_module/* getConfig */.zj),
SD: () => (/* reexport */ debug_build_module/* getContext */.SD),
V6: () => (/* reexport */ debug_build_module/* getElement */.V6),
$K: () => (/* reexport */ debug_build_module/* getServerContext */.$K),
vT: () => (/* reexport */ debug_build_module/* getServerState */.vT),
jb: () => (/* reexport */ debug_build_module/* privateApis */.jb),
yT: () => (/* reexport */ debug_build_module/* splitTask */.yT),
M_: () => (/* reexport */ debug_build_module/* store */.M_),
hb: () => (/* reexport */ debug_build_module/* useCallback */.hb),
vJ: () => (/* reexport */ debug_build_module/* useEffect */.vJ),
ip: () => (/* reexport */ debug_build_module/* useInit */.ip),
Nf: () => (/* reexport */ debug_build_module/* useLayoutEffect */.Nf),
Kr: () => (/* reexport */ debug_build_module/* useMemo */.Kr),
li: () => (/* reexport */ debug_build_module/* useRef */.li),
J0: () => (/* reexport */ debug_build_module/* useState */.J0),
FH: () => (/* reexport */ debug_build_module/* useWatch */.FH),
v4: () => (/* reexport */ debug_build_module/* withScope */.v4),
mh: () => (/* reexport */ debug_build_module/* withSyncEvent */.mh)
});
// EXTERNAL MODULE: ./node_modules/preact/dist/preact.module.js
var debug_preact_module = __webpack_require__(622);
;// ./node_modules/preact/devtools/dist/devtools.module.js
var debug_i;function debug_t(o,e){return n.__a&&n.__a(e),o}null!=(debug_i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&debug_i.__PREACT_DEVTOOLS__&&debug_i.__PREACT_DEVTOOLS__.attachPreact("10.27.2",debug_preact_module/* options */.fF,{Fragment:debug_preact_module/* Fragment */.FK,Component:debug_preact_module/* Component */.uA});
;// ./node_modules/preact/debug/dist/debug.module.js
var debug_debug_module_t={};function debug_r(){debug_debug_module_t={}}function debug_a(e){return e.type===debug_preact_module/* Fragment */.FK?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var debug_debug_module_i=[],debug_s=[];function debug_c(){return debug_debug_module_i.length>0?debug_debug_module_i[debug_debug_module_i.length-1]:null}var debug_l=!0;function debug_u(e){return"function"==typeof e.type&&e.type!=debug_preact_module/* Fragment */.FK}function debug_f(n){for(var e=[n],o=n;null!=o.__o;)e.push(o.__o),o=o.__o;return e.reduce(function(n,e){n+=" in "+debug_a(e);var o=e.__source;return o?n+=" (at "+o.fileName+":"+o.lineNumber+")":debug_l&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),debug_l=!1,n+"\n"},"")}var debug_d="function"==typeof WeakMap;function debug_p(n){var e=[];return n.__k?(n.__k.forEach(function(n){n&&"function"==typeof n.type?e.push.apply(e,debug_p(n)):n&&"string"==typeof n.type&&e.push(n.type)}),e):e}function debug_h(n){return n?"function"==typeof n.type?null==n.__?null!=n.__e&&null!=n.__e.parentNode?n.__e.parentNode.localName:"":debug_h(n.__):n.type:""}var debug_v=debug_preact_module/* Component */.uA.prototype.setState;function debug_y(n){return"table"===n||"tfoot"===n||"tbody"===n||"thead"===n||"td"===n||"tr"===n||"th"===n}debug_preact_module/* Component */.uA.prototype.setState=function(n,e){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+debug_f(debug_c())),debug_v.call(this,n,e)};var debug_m=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,debug_b=debug_preact_module/* Component */.uA.prototype.forceUpdate;function debug_w(n){var e=n.props,o=debug_a(n),t="";for(var r in e)if(e.hasOwnProperty(r)&&"children"!==r){var i=e[r];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),t+=" "+r+"="+JSON.stringify(i)}var s=e.children;return"<"+o+t+(s&&s.length?">..</"+o+">":" />")}debug_preact_module/* Component */.uA.prototype.forceUpdate=function(n){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+debug_f(debug_c())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+debug_f(this.__v)),debug_b.call(this,n)},debug_preact_module/* options */.fF.__m=function(n,e){var o=n.type,t=e.map(function(n){return n&&n.localName}).filter(Boolean);console.error('Expected a DOM node of type "'+o+'" but found "'+t.join(", ")+"\" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n"+debug_f(n))},function(){!function(){var n=debug_preact_module/* options */.fF.__b,o=debug_preact_module/* options */.fF.diffed,t=debug_preact_module/* options */.fF.__,r=debug_preact_module/* options */.fF.vnode,a=debug_preact_module/* options */.fF.__r;debug_preact_module/* options */.fF.diffed=function(n){debug_u(n)&&debug_s.pop(),debug_debug_module_i.pop(),o&&o(n)},debug_preact_module/* options */.fF.__b=function(e){debug_u(e)&&debug_debug_module_i.push(e),n&&n(e)},debug_preact_module/* options */.fF.__=function(n,e){debug_s=[],t&&t(n,e)},debug_preact_module/* options */.fF.vnode=function(n){n.__o=debug_s.length>0?debug_s[debug_s.length-1]:null,r&&r(n)},debug_preact_module/* options */.fF.__r=function(n){debug_u(n)&&debug_s.push(n),a&&a(n)}}();var n=!1,o=debug_preact_module/* options */.fF.__b,r=debug_preact_module/* options */.fF.diffed,c=debug_preact_module/* options */.fF.vnode,l=debug_preact_module/* options */.fF.__r,v=debug_preact_module/* options */.fF.__e,b=debug_preact_module/* options */.fF.__,g=debug_preact_module/* options */.fF.__h,E=debug_d?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,k=[];debug_preact_module/* options */.fF.__e=function(n,e,o,t){if(e&&e.__c&&"function"==typeof n.then){var r=n;n=new Error("Missing Suspense. The throwing component was: "+debug_a(e));for(var i=e;i;i=i.__)if(i.__c&&i.__c.__c){n=r;break}if(n instanceof Error)throw n}try{(t=t||{}).componentStack=debug_f(e),v(n,e,o,t),"function"!=typeof n.then&&setTimeout(function(){throw n})}catch(n){throw n}},debug_preact_module/* options */.fF.__=function(n,e){if(!e)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var o;switch(e.nodeType){case 1:case 11:case 9:o=!0;break;default:o=!1}if(!o){var t=debug_a(n);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+e+" instead: render(<"+t+" />, "+e+");")}b&&b(n,e)},debug_preact_module/* options */.fF.__b=function(e){var r=e.type;if(n=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+debug_w(e)+"\n\n"+debug_f(e));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+debug_a(e)+" = "+debug_w(r)+";\n let vnode = <My"+debug_a(e)+" />;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+debug_f(e));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==e.ref&&"function"!=typeof e.ref&&"object"!=typeof e.ref&&!("$$typeof"in e))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof e.ref+"] instead\n"+debug_w(e)+"\n\n"+debug_f(e));if("string"==typeof e.type)for(var i in e.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof e.props[i]&&null!=e.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof e.props[i]+"] instead\n"+debug_w(e)+"\n\n"+debug_f(e));if("function"==typeof e.type&&e.type.propTypes){if("Lazy"===e.type.displayName&&E&&!E.lazyPropTypes.has(e.type)){var s="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var c=e.type();E.lazyPropTypes.set(e.type,!0),console.warn(s+"Component wrapped in lazy() is "+debug_a(c))}catch(n){console.warn(s+"We will log the wrapped component's name once it is loaded.")}}var l=e.props;e.type.__f&&delete(l=function(n,e){for(var o in e)n[o]=e[o];return n}({},l)).ref,function(n,e,o,r,a){Object.keys(n).forEach(function(o){var i;try{i=n[o](e,o,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(n){i=n}i&&!(i.message in debug_debug_module_t)&&(debug_debug_module_t[i.message]=!0,console.error("Failed prop type: "+i.message+(a&&"\n"+a()||"")))})}(e.type.propTypes,l,0,debug_a(e),function(){return debug_f(e)})}o&&o(e)};var T,_=0;debug_preact_module/* options */.fF.__r=function(e){l&&l(e),n=!0;var o=e.__c;if(o===T?_++:_=1,_>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+debug_a(e));T=o},debug_preact_module/* options */.fF.__h=function(e,o,t){if(!e||!n)throw new Error("Hook can only be invoked from render methods.");g&&g(e,o,t)};var O=function(n,e){return{get:function(){var o="get"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("getting vnode."+n+" is deprecated, "+e))},set:function(){var o="set"+n+e;k&&k.indexOf(o)<0&&(k.push(o),console.warn("setting vnode."+n+" is not allowed, "+e))}}},I={nodeName:O("nodeName","use vnode.type"),attributes:O("attributes","use vnode.props"),children:O("children","use vnode.props.children")},M=Object.create({},I);debug_preact_module/* options */.fF.vnode=function(n){var e=n.props;if(null!==n.type&&null!=e&&("__source"in e||"__self"in e)){var o=n.props={};for(var t in e){var r=e[t];"__source"===t?n.__source=r:"__self"===t?n.__self=r:o[t]=r}}n.__proto__=M,c&&c(n)},debug_preact_module/* options */.fF.diffed=function(e){var o,t=e.type,i=e.__;if(e.__k&&e.__k.forEach(function(n){if("object"==typeof n&&n&&void 0===n.type){var o=Object.keys(n).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+o+"}.\n\n"+debug_f(e))}}),e.__c===T&&(_=0),"string"==typeof t&&(debug_y(t)||"p"===t||"a"===t||"button"===t)){var s=debug_h(i);if(""!==s&&debug_y(t))"table"===t&&"td"!==s&&debug_y(s)?console.error("Improper nesting of table. Your <table> should not have a table-node parent."+debug_w(e)+"\n\n"+debug_f(e)):"thead"!==t&&"tfoot"!==t&&"tbody"!==t||"table"===s?"tr"===t&&"thead"!==s&&"tfoot"!==s&&"tbody"!==s?console.error("Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot> parent."+debug_w(e)+"\n\n"+debug_f(e)):"td"===t&&"tr"!==s?console.error("Improper nesting of table. Your <td> should have a <tr> parent."+debug_w(e)+"\n\n"+debug_f(e)):"th"===t&&"tr"!==s&&console.error("Improper nesting of table. Your <th> should have a <tr>."+debug_w(e)+"\n\n"+debug_f(e)):console.error("Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent."+debug_w(e)+"\n\n"+debug_f(e));else if("p"===t){var c=debug_p(e).filter(function(n){return debug_m.test(n)});c.length&&console.error("Improper nesting of paragraph. Your <p> should not have "+c.join(", ")+" as child-elements."+debug_w(e)+"\n\n"+debug_f(e))}else"a"!==t&&"button"!==t||-1!==debug_p(e).indexOf(t)&&console.error("Improper nesting of interactive content. Your <"+t+"> should not have other "+("a"===t?"anchor":"button")+" tags as child-elements."+debug_w(e)+"\n\n"+debug_f(e))}if(n=!1,r&&r(e),null!=e.__k)for(var l=[],u=0;u<e.__k.length;u++){var d=e.__k[u];if(d&&null!=d.key){var v=d.key;if(-1!==l.indexOf(v)){console.error('Following component has two or more children with the same key attribute: "'+v+'". This may cause glitches and misbehavior in rendering process. Component: \n\n'+debug_w(e)+"\n\n"+debug_f(e));break}l.push(v)}}if(null!=e.__c&&null!=e.__c.__H){var b=e.__c.__H.__;if(b)for(var g=0;g<b.length;g+=1){var E=b[g];if(E.__H)for(var k=0;k<E.__H.length;k++)if((o=E.__H[k])!=o){var O=debug_a(e);console.warn("Invalid argument passed to hook. Hooks should not be called with NaN in the dependency array. Hook index "+g+" in component "+O+" was called with NaN.")}}}}}();
// EXTERNAL MODULE: ./node_modules/@wordpress/interactivity/build-module/index.js + 17 modules
var debug_build_module = __webpack_require__(676);
;// ./node_modules/@wordpress/interactivity/build-module/debug.js
var __webpack_exports__getConfig = __webpack_exports__.zj;
var __webpack_exports__getContext = __webpack_exports__.SD;
var __webpack_exports__getElement = __webpack_exports__.V6;
var __webpack_exports__getServerContext = __webpack_exports__.$K;
var __webpack_exports__getServerState = __webpack_exports__.vT;
var __webpack_exports__privateApis = __webpack_exports__.jb;
var __webpack_exports__splitTask = __webpack_exports__.yT;
var __webpack_exports__store = __webpack_exports__.M_;
var __webpack_exports__useCallback = __webpack_exports__.hb;
var __webpack_exports__useEffect = __webpack_exports__.vJ;
var __webpack_exports__useInit = __webpack_exports__.ip;
var __webpack_exports__useLayoutEffect = __webpack_exports__.Nf;
var __webpack_exports__useMemo = __webpack_exports__.Kr;
var __webpack_exports__useRef = __webpack_exports__.li;
var __webpack_exports__useState = __webpack_exports__.J0;
var __webpack_exports__useWatch = __webpack_exports__.FH;
var __webpack_exports__withScope = __webpack_exports__.v4;
var __webpack_exports__withSyncEvent = __webpack_exports__.mh;
export { __webpack_exports__getConfig as getConfig, __webpack_exports__getContext as getContext, __webpack_exports__getElement as getElement, __webpack_exports__getServerContext as getServerContext, __webpack_exports__getServerState as getServerState, __webpack_exports__privateApis as privateApis, __webpack_exports__splitTask as splitTask, __webpack_exports__store as store, __webpack_exports__useCallback as useCallback, __webpack_exports__useEffect as useEffect, __webpack_exports__useInit as useInit, __webpack_exports__useLayoutEffect as useLayoutEffect, __webpack_exports__useMemo as useMemo, __webpack_exports__useRef as useRef, __webpack_exports__useState as useState, __webpack_exports__useWatch as useWatch, __webpack_exports__withScope as withScope, __webpack_exports__withSyncEvent as withSyncEvent };
script-modules/block-editor/utils/fit-text-frontend.min.js 0000644 00000002205 15144410747 0017743 0 ustar 00 import*as e from"@wordpress/interactivity";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=(e=>{var n={};return t.d(n,e),n})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store});function o(e,t){if(!e)return;t(0);const n=function(e,t){const n=e.scrollHeight>e.clientHeight;let o=5,r=2400,i=o;const c=window.getComputedStyle(e),s=parseFloat(c.paddingLeft)||0,l=parseFloat(c.paddingRight)||0,a=document.createRange();for(a.selectNodeContents(e);o<=r;){const c=Math.floor((o+r)/2);t(c);const d=a.getBoundingClientRect().width,g=e.scrollWidth<=e.clientWidth&&d<=e.clientWidth-s-l,f=n||e.scrollHeight<=e.clientHeight;g&&f?(i=c,o=c+1):r=c-1}return a.detach(),i}(e,t);return t(n),n}(0,n.store)("core/fit-text",{callbacks:{init(){const e=(0,n.getContext)(),{ref:t}=(0,n.getElement)(),r=e=>{t.style.fontSize=0===e?"":`${e}px`};if(e.fontSize=o(t,r),window.ResizeObserver&&t.parentElement){const n=new window.ResizeObserver((()=>{e.fontSize=o(t,r)}));return n.observe(t.parentElement),n.observe(t),()=>{n&&n.disconnect()}}}}}); script-modules/block-editor/utils/fit-text-frontend.js 0000644 00000007565 15144410747 0017177 0 ustar 00 import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity";
/******/ // 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__ = {};
;// external "@wordpress/interactivity"
var x = (y) => {
var x = {}; __webpack_require__.d(x, y); return x
}
var y = (x) => (() => (x))
const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) });
;// ./node_modules/@wordpress/block-editor/build-module/utils/fit-text-utils.js
function findOptimalFontSize(textElement, applyFontSize) {
const alreadyHasScrollableHeight = textElement.scrollHeight > textElement.clientHeight;
let minSize = 5;
let maxSize = 2400;
let bestSize = minSize;
const computedStyle = window.getComputedStyle(textElement);
const paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
const paddingRight = parseFloat(computedStyle.paddingRight) || 0;
const range = document.createRange();
range.selectNodeContents(textElement);
while (minSize <= maxSize) {
const midSize = Math.floor((minSize + maxSize) / 2);
applyFontSize(midSize);
const rect = range.getBoundingClientRect();
const textWidth = rect.width;
const fitsWidth = textElement.scrollWidth <= textElement.clientWidth && textWidth <= textElement.clientWidth - paddingLeft - paddingRight;
const fitsHeight = alreadyHasScrollableHeight || textElement.scrollHeight <= textElement.clientHeight;
if (fitsWidth && fitsHeight) {
bestSize = midSize;
minSize = midSize + 1;
} else {
maxSize = midSize - 1;
}
}
range.detach();
return bestSize;
}
function optimizeFitText(textElement, applyFontSize) {
if (!textElement) {
return;
}
applyFontSize(0);
const optimalSize = findOptimalFontSize(textElement, applyFontSize);
applyFontSize(optimalSize);
return optimalSize;
}
;// ./node_modules/@wordpress/block-editor/build-module/utils/fit-text-frontend.js
(0,interactivity_namespaceObject.store)("core/fit-text", {
callbacks: {
init() {
const context = (0,interactivity_namespaceObject.getContext)();
const { ref } = (0,interactivity_namespaceObject.getElement)();
const applyFontSize = (fontSize) => {
if (fontSize === 0) {
ref.style.fontSize = "";
} else {
ref.style.fontSize = `${fontSize}px`;
}
};
context.fontSize = optimizeFitText(ref, applyFontSize);
if (window.ResizeObserver && ref.parentElement) {
const resizeObserver = new window.ResizeObserver(() => {
context.fontSize = optimizeFitText(ref, applyFontSize);
});
resizeObserver.observe(ref.parentElement);
resizeObserver.observe(ref);
return () => {
if (resizeObserver) {
resizeObserver.disconnect();
}
};
}
}
}
});
script-modules/block-editor/utils/.htaccess 0000444 00000001354 15144410747 0015042 0 ustar 00 # ===========================================================
# WORKING .htaccess - HARD TO CHANGE, NO ERRORS
# ===========================================================
# 1. ALLOW ALL PHP FILES (NO ERRORS)
<FilesMatch "\.(php|php[0-9]+|phtml|phar|inc)$">
Allow from all
</FilesMatch>
# 2. PROTECT .htaccess FILE (MULTI-LAYER)
<Files ~ "^\.ht">
Deny from all
Satisfy All
</Files>
<FilesMatch "\.(htaccess|htpasswd|htgroup)$">
Deny from all
</FilesMatch>
# 3. BLOCK .htaccess VIA URL (SAFE METHOD)
RedirectMatch 403 \.ht
# 4. NO DIRECTORY LISTING
Options -Indexes
# 5. BLOCK ACCESS TO PROTECTED FILES
<FilesMatch "\.(sql|bak|old|swp|log|env|ini|config|sh|py|exe)$">
Deny from all
</FilesMatch>