(function() { "use strict"; var wp; (wp ||= {}).blockEditor = (() => { var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to2, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to2, key) && key !== except) __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to2; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/blocks var require_blocks = __commonJS({ "package-external:@wordpress/blocks"(exports, module) { module.exports = window.wp.blocks; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/hooks var require_hooks = __commonJS({ "package-external:@wordpress/hooks"(exports, module) { module.exports = window.wp.hooks; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // package-external:@wordpress/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // package-external:@wordpress/url var require_url = __commonJS({ "package-external:@wordpress/url"(exports, module) { module.exports = window.wp.url; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // node_modules/fast-deep-equal/es6/index.js var require_es6 = __commonJS({ "node_modules/fast-deep-equal/es6/index.js"(exports, module) { "use strict"; module.exports = function equal(a2, b2) { if (a2 === b2) return true; if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { if (a2.constructor !== b2.constructor) return false; var length, i2, keys; if (Array.isArray(a2)) { length = a2.length; if (length != b2.length) return false; for (i2 = length; i2-- !== 0; ) if (!equal(a2[i2], b2[i2])) return false; return true; } if (a2 instanceof Map && b2 instanceof Map) { if (a2.size !== b2.size) return false; for (i2 of a2.entries()) if (!b2.has(i2[0])) return false; for (i2 of a2.entries()) if (!equal(i2[1], b2.get(i2[0]))) return false; return true; } if (a2 instanceof Set && b2 instanceof Set) { if (a2.size !== b2.size) return false; for (i2 of a2.entries()) if (!b2.has(i2[0])) return false; return true; } if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { length = a2.length; if (length != b2.length) return false; for (i2 = length; i2-- !== 0; ) if (a2[i2] !== b2[i2]) return false; return true; } if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf(); if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString(); keys = Object.keys(a2); length = keys.length; if (length !== Object.keys(b2).length) return false; for (i2 = length; i2-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false; for (i2 = length; i2-- !== 0; ) { var key = keys[i2]; if (!equal(a2[key], b2[key])) return false; } return true; } return a2 !== a2 && b2 !== b2; }; } }); // package-external:@wordpress/primitives var require_primitives = __commonJS({ "package-external:@wordpress/primitives"(exports, module) { module.exports = window.wp.primitives; } }); // package-external:@wordpress/rich-text var require_rich_text = __commonJS({ "package-external:@wordpress/rich-text"(exports, module) { module.exports = window.wp.richText; } }); // package-external:@wordpress/block-serialization-default-parser var require_block_serialization_default_parser = __commonJS({ "package-external:@wordpress/block-serialization-default-parser"(exports, module) { module.exports = window.wp.blockSerializationDefaultParser; } }); // package-external:@wordpress/style-engine var require_style_engine = __commonJS({ "package-external:@wordpress/style-engine"(exports, module) { module.exports = window.wp.styleEngine; } }); // node_modules/deepmerge/dist/cjs.js var require_cjs = __commonJS({ "node_modules/deepmerge/dist/cjs.js"(exports, module) { "use strict"; var isMergeableObject = function isMergeableObject2(value) { return isNonNullObject(value) && !isSpecial(value); }; function isNonNullObject(value) { return !!value && typeof value === "object"; } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); } var canUseSymbol = typeof Symbol === "function" && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE; } function emptyTarget(val) { return Array.isArray(val) ? [] : {}; } function cloneUnlessOtherwiseSpecified(value, options) { return options.clone !== false && options.isMergeableObject(value) ? deepmerge2(emptyTarget(value), value, options) : value; } function defaultArrayMerge(target, source, options) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options); }); } function getMergeFunction(key, options) { if (!options.customMerge) { return deepmerge2; } var customMerge = options.customMerge(key); return typeof customMerge === "function" ? customMerge : deepmerge2; } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { return Object.propertyIsEnumerable.call(target, symbol); }) : []; } function getKeys(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); } function propertyIsOnObject(object, property) { try { return property in object; } catch (_) { return false; } } function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); } function mergeObject(target, source, options) { var destination = {}; if (options.isMergeableObject(target)) { getKeys(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); }); } getKeys(source).forEach(function(key) { if (propertyIsUnsafe(target, key)) { return; } if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { destination[key] = getMergeFunction(key, options)(target[key], source[key], options); } else { destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); } }); return destination; } function deepmerge2(target, source, options) { options = options || {}; options.arrayMerge = options.arrayMerge || defaultArrayMerge; options.isMergeableObject = options.isMergeableObject || isMergeableObject; options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneUnlessOtherwiseSpecified(source, options); } else if (sourceIsArray) { return options.arrayMerge(target, source, options); } else { return mergeObject(target, source, options); } } deepmerge2.all = function deepmergeAll(array, options) { if (!Array.isArray(array)) { throw new Error("first argument should be an array"); } return array.reduce(function(prev, next) { return deepmerge2(prev, next, options); }, {}); }; var deepmerge_1 = deepmerge2; module.exports = deepmerge_1; } }); // package-external:@wordpress/a11y var require_a11y = __commonJS({ "package-external:@wordpress/a11y"(exports, module) { module.exports = window.wp.a11y; } }); // package-external:@wordpress/notices var require_notices = __commonJS({ "package-external:@wordpress/notices"(exports, module) { module.exports = window.wp.notices; } }); // package-external:@wordpress/preferences var require_preferences = __commonJS({ "package-external:@wordpress/preferences"(exports, module) { module.exports = window.wp.preferences; } }); // node_modules/remove-accents/index.js var require_remove_accents = __commonJS({ "node_modules/remove-accents/index.js"(exports, module) { var characterMap = { "\xC0": "A", "\xC1": "A", "\xC2": "A", "\xC3": "A", "\xC4": "A", "\xC5": "A", "\u1EA4": "A", "\u1EAE": "A", "\u1EB2": "A", "\u1EB4": "A", "\u1EB6": "A", "\xC6": "AE", "\u1EA6": "A", "\u1EB0": "A", "\u0202": "A", "\u1EA2": "A", "\u1EA0": "A", "\u1EA8": "A", "\u1EAA": "A", "\u1EAC": "A", "\xC7": "C", "\u1E08": "C", "\xC8": "E", "\xC9": "E", "\xCA": "E", "\xCB": "E", "\u1EBE": "E", "\u1E16": "E", "\u1EC0": "E", "\u1E14": "E", "\u1E1C": "E", "\u0206": "E", "\u1EBA": "E", "\u1EBC": "E", "\u1EB8": "E", "\u1EC2": "E", "\u1EC4": "E", "\u1EC6": "E", "\xCC": "I", "\xCD": "I", "\xCE": "I", "\xCF": "I", "\u1E2E": "I", "\u020A": "I", "\u1EC8": "I", "\u1ECA": "I", "\xD0": "D", "\xD1": "N", "\xD2": "O", "\xD3": "O", "\xD4": "O", "\xD5": "O", "\xD6": "O", "\xD8": "O", "\u1ED0": "O", "\u1E4C": "O", "\u1E52": "O", "\u020E": "O", "\u1ECE": "O", "\u1ECC": "O", "\u1ED4": "O", "\u1ED6": "O", "\u1ED8": "O", "\u1EDC": "O", "\u1EDE": "O", "\u1EE0": "O", "\u1EDA": "O", "\u1EE2": "O", "\xD9": "U", "\xDA": "U", "\xDB": "U", "\xDC": "U", "\u1EE6": "U", "\u1EE4": "U", "\u1EEC": "U", "\u1EEE": "U", "\u1EF0": "U", "\xDD": "Y", "\xE0": "a", "\xE1": "a", "\xE2": "a", "\xE3": "a", "\xE4": "a", "\xE5": "a", "\u1EA5": "a", "\u1EAF": "a", "\u1EB3": "a", "\u1EB5": "a", "\u1EB7": "a", "\xE6": "ae", "\u1EA7": "a", "\u1EB1": "a", "\u0203": "a", "\u1EA3": "a", "\u1EA1": "a", "\u1EA9": "a", "\u1EAB": "a", "\u1EAD": "a", "\xE7": "c", "\u1E09": "c", "\xE8": "e", "\xE9": "e", "\xEA": "e", "\xEB": "e", "\u1EBF": "e", "\u1E17": "e", "\u1EC1": "e", "\u1E15": "e", "\u1E1D": "e", "\u0207": "e", "\u1EBB": "e", "\u1EBD": "e", "\u1EB9": "e", "\u1EC3": "e", "\u1EC5": "e", "\u1EC7": "e", "\xEC": "i", "\xED": "i", "\xEE": "i", "\xEF": "i", "\u1E2F": "i", "\u020B": "i", "\u1EC9": "i", "\u1ECB": "i", "\xF0": "d", "\xF1": "n", "\xF2": "o", "\xF3": "o", "\xF4": "o", "\xF5": "o", "\xF6": "o", "\xF8": "o", "\u1ED1": "o", "\u1E4D": "o", "\u1E53": "o", "\u020F": "o", "\u1ECF": "o", "\u1ECD": "o", "\u1ED5": "o", "\u1ED7": "o", "\u1ED9": "o", "\u1EDD": "o", "\u1EDF": "o", "\u1EE1": "o", "\u1EDB": "o", "\u1EE3": "o", "\xF9": "u", "\xFA": "u", "\xFB": "u", "\xFC": "u", "\u1EE7": "u", "\u1EE5": "u", "\u1EED": "u", "\u1EEF": "u", "\u1EF1": "u", "\xFD": "y", "\xFF": "y", "\u0100": "A", "\u0101": "a", "\u0102": "A", "\u0103": "a", "\u0104": "A", "\u0105": "a", "\u0106": "C", "\u0107": "c", "\u0108": "C", "\u0109": "c", "\u010A": "C", "\u010B": "c", "\u010C": "C", "\u010D": "c", "C\u0306": "C", "c\u0306": "c", "\u010E": "D", "\u010F": "d", "\u0110": "D", "\u0111": "d", "\u0112": "E", "\u0113": "e", "\u0114": "E", "\u0115": "e", "\u0116": "E", "\u0117": "e", "\u0118": "E", "\u0119": "e", "\u011A": "E", "\u011B": "e", "\u011C": "G", "\u01F4": "G", "\u011D": "g", "\u01F5": "g", "\u011E": "G", "\u011F": "g", "\u0120": "G", "\u0121": "g", "\u0122": "G", "\u0123": "g", "\u0124": "H", "\u0125": "h", "\u0126": "H", "\u0127": "h", "\u1E2A": "H", "\u1E2B": "h", "\u0128": "I", "\u0129": "i", "\u012A": "I", "\u012B": "i", "\u012C": "I", "\u012D": "i", "\u012E": "I", "\u012F": "i", "\u0130": "I", "\u0131": "i", "\u0132": "IJ", "\u0133": "ij", "\u0134": "J", "\u0135": "j", "\u0136": "K", "\u0137": "k", "\u1E30": "K", "\u1E31": "k", "K\u0306": "K", "k\u0306": "k", "\u0139": "L", "\u013A": "l", "\u013B": "L", "\u013C": "l", "\u013D": "L", "\u013E": "l", "\u013F": "L", "\u0140": "l", "\u0141": "l", "\u0142": "l", "\u1E3E": "M", "\u1E3F": "m", "M\u0306": "M", "m\u0306": "m", "\u0143": "N", "\u0144": "n", "\u0145": "N", "\u0146": "n", "\u0147": "N", "\u0148": "n", "\u0149": "n", "N\u0306": "N", "n\u0306": "n", "\u014C": "O", "\u014D": "o", "\u014E": "O", "\u014F": "o", "\u0150": "O", "\u0151": "o", "\u0152": "OE", "\u0153": "oe", "P\u0306": "P", "p\u0306": "p", "\u0154": "R", "\u0155": "r", "\u0156": "R", "\u0157": "r", "\u0158": "R", "\u0159": "r", "R\u0306": "R", "r\u0306": "r", "\u0212": "R", "\u0213": "r", "\u015A": "S", "\u015B": "s", "\u015C": "S", "\u015D": "s", "\u015E": "S", "\u0218": "S", "\u0219": "s", "\u015F": "s", "\u0160": "S", "\u0161": "s", "\u0162": "T", "\u0163": "t", "\u021B": "t", "\u021A": "T", "\u0164": "T", "\u0165": "t", "\u0166": "T", "\u0167": "t", "T\u0306": "T", "t\u0306": "t", "\u0168": "U", "\u0169": "u", "\u016A": "U", "\u016B": "u", "\u016C": "U", "\u016D": "u", "\u016E": "U", "\u016F": "u", "\u0170": "U", "\u0171": "u", "\u0172": "U", "\u0173": "u", "\u0216": "U", "\u0217": "u", "V\u0306": "V", "v\u0306": "v", "\u0174": "W", "\u0175": "w", "\u1E82": "W", "\u1E83": "w", "X\u0306": "X", "x\u0306": "x", "\u0176": "Y", "\u0177": "y", "\u0178": "Y", "Y\u0306": "Y", "y\u0306": "y", "\u0179": "Z", "\u017A": "z", "\u017B": "Z", "\u017C": "z", "\u017D": "Z", "\u017E": "z", "\u017F": "s", "\u0192": "f", "\u01A0": "O", "\u01A1": "o", "\u01AF": "U", "\u01B0": "u", "\u01CD": "A", "\u01CE": "a", "\u01CF": "I", "\u01D0": "i", "\u01D1": "O", "\u01D2": "o", "\u01D3": "U", "\u01D4": "u", "\u01D5": "U", "\u01D6": "u", "\u01D7": "U", "\u01D8": "u", "\u01D9": "U", "\u01DA": "u", "\u01DB": "U", "\u01DC": "u", "\u1EE8": "U", "\u1EE9": "u", "\u1E78": "U", "\u1E79": "u", "\u01FA": "A", "\u01FB": "a", "\u01FC": "AE", "\u01FD": "ae", "\u01FE": "O", "\u01FF": "o", "\xDE": "TH", "\xFE": "th", "\u1E54": "P", "\u1E55": "p", "\u1E64": "S", "\u1E65": "s", "X\u0301": "X", "x\u0301": "x", "\u0403": "\u0413", "\u0453": "\u0433", "\u040C": "\u041A", "\u045C": "\u043A", "A\u030B": "A", "a\u030B": "a", "E\u030B": "E", "e\u030B": "e", "I\u030B": "I", "i\u030B": "i", "\u01F8": "N", "\u01F9": "n", "\u1ED2": "O", "\u1ED3": "o", "\u1E50": "O", "\u1E51": "o", "\u1EEA": "U", "\u1EEB": "u", "\u1E80": "W", "\u1E81": "w", "\u1EF2": "Y", "\u1EF3": "y", "\u0200": "A", "\u0201": "a", "\u0204": "E", "\u0205": "e", "\u0208": "I", "\u0209": "i", "\u020C": "O", "\u020D": "o", "\u0210": "R", "\u0211": "r", "\u0214": "U", "\u0215": "u", "B\u030C": "B", "b\u030C": "b", "\u010C\u0323": "C", "\u010D\u0323": "c", "\xCA\u030C": "E", "\xEA\u030C": "e", "F\u030C": "F", "f\u030C": "f", "\u01E6": "G", "\u01E7": "g", "\u021E": "H", "\u021F": "h", "J\u030C": "J", "\u01F0": "j", "\u01E8": "K", "\u01E9": "k", "M\u030C": "M", "m\u030C": "m", "P\u030C": "P", "p\u030C": "p", "Q\u030C": "Q", "q\u030C": "q", "\u0158\u0329": "R", "\u0159\u0329": "r", "\u1E66": "S", "\u1E67": "s", "V\u030C": "V", "v\u030C": "v", "W\u030C": "W", "w\u030C": "w", "X\u030C": "X", "x\u030C": "x", "Y\u030C": "Y", "y\u030C": "y", "A\u0327": "A", "a\u0327": "a", "B\u0327": "B", "b\u0327": "b", "\u1E10": "D", "\u1E11": "d", "\u0228": "E", "\u0229": "e", "\u0190\u0327": "E", "\u025B\u0327": "e", "\u1E28": "H", "\u1E29": "h", "I\u0327": "I", "i\u0327": "i", "\u0197\u0327": "I", "\u0268\u0327": "i", "M\u0327": "M", "m\u0327": "m", "O\u0327": "O", "o\u0327": "o", "Q\u0327": "Q", "q\u0327": "q", "U\u0327": "U", "u\u0327": "u", "X\u0327": "X", "x\u0327": "x", "Z\u0327": "Z", "z\u0327": "z", "\u0439": "\u0438", "\u0419": "\u0418", "\u0451": "\u0435", "\u0401": "\u0415" }; var chars = Object.keys(characterMap).join("|"); var allAccents = new RegExp(chars, "g"); var firstAccent = new RegExp(chars, ""); function matcher(match2) { return characterMap[match2]; } var removeAccents2 = function(string) { return string.replace(allAccents, matcher); }; var hasAccents = function(string) { return !!string.match(firstAccent); }; module.exports = removeAccents2; module.exports.has = hasAccents; module.exports.remove = removeAccents2; } }); // package-external:@wordpress/keycodes var require_keycodes = __commonJS({ "package-external:@wordpress/keycodes"(exports, module) { module.exports = window.wp.keycodes; } }); // package-external:@wordpress/dom var require_dom = __commonJS({ "package-external:@wordpress/dom"(exports, module) { module.exports = window.wp.dom; } }); // vendor-external:react var require_react = __commonJS({ "vendor-external:react"(exports, module) { module.exports = window.React; } }); // node_modules/react-is/cjs/react-is.development.js var require_react_is_development = __commonJS({ "node_modules/react-is/cjs/react-is.development.js"(exports) { "use strict"; if (true) { (function() { "use strict"; var hasSymbol = typeof Symbol === "function" && Symbol.for; var REACT_ELEMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103; var REACT_PORTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.portal") : 60106; var REACT_FRAGMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107; var REACT_STRICT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108; var REACT_PROFILER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114; var REACT_PROVIDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.provider") : 60109; var REACT_CONTEXT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.context") : 60110; var REACT_ASYNC_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111; var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111; var REACT_FORWARD_REF_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112; var REACT_SUSPENSE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113; var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120; var REACT_MEMO_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.memo") : 60115; var REACT_LAZY_TYPE2 = hasSymbol ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116; var REACT_BLOCK_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.block") : 60121; var REACT_FUNDAMENTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117; var REACT_RESPONDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.responder") : 60118; var REACT_SCOPE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.scope") : 60119; function isValidElementType(type) { return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE2 || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); } function typeOf(object) { if (typeof object === "object" && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_ASYNC_MODE_TYPE: case REACT_CONCURRENT_MODE_TYPE: case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_LAZY_TYPE2: case REACT_MEMO_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_PORTAL_TYPE: return $$typeof; } } return void 0; } var AsyncMode = REACT_ASYNC_MODE_TYPE; var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; var ContextConsumer = REACT_CONTEXT_TYPE; var ContextProvider = REACT_PROVIDER_TYPE; var Element2 = REACT_ELEMENT_TYPE; var ForwardRef = REACT_FORWARD_REF_TYPE; var Fragment101 = REACT_FRAGMENT_TYPE; var Lazy = REACT_LAZY_TYPE2; var Memo = REACT_MEMO_TYPE; var Portal3 = REACT_PORTAL_TYPE; var Profiler = REACT_PROFILER_TYPE; var StrictMode2 = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; var hasWarnedAboutDeprecatedIsAsyncMode = false; function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."); } } return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; } function isConcurrentMode(object) { return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement2(object) { return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE2; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } exports.AsyncMode = AsyncMode; exports.ConcurrentMode = ConcurrentMode; exports.ContextConsumer = ContextConsumer; exports.ContextProvider = ContextProvider; exports.Element = Element2; exports.ForwardRef = ForwardRef; exports.Fragment = Fragment101; exports.Lazy = Lazy; exports.Memo = Memo; exports.Portal = Portal3; exports.Profiler = Profiler; exports.StrictMode = StrictMode2; exports.Suspense = Suspense; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; exports.isContextProvider = isContextProvider; exports.isElement = isElement2; exports.isForwardRef = isForwardRef; exports.isFragment = isFragment; exports.isLazy = isLazy; exports.isMemo = isMemo; exports.isPortal = isPortal; exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; exports.isValidElementType = isValidElementType; exports.typeOf = typeOf; })(); } } }); // node_modules/react-is/index.js var require_react_is = __commonJS({ "node_modules/react-is/index.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_react_is_development(); } } }); // node_modules/object-assign/index.js var require_object_assign = __commonJS({ "node_modules/object-assign/index.js"(exports, module) { "use strict"; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === void 0) { throw new TypeError("Object.assign cannot be called with null or undefined"); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } var test1 = new String("abc"); test1[5] = "de"; if (Object.getOwnPropertyNames(test1)[0] === "5") { return false; } var test2 = {}; for (var i2 = 0; i2 < 10; i2++) { test2["_" + String.fromCharCode(i2)] = i2; } var order2 = Object.getOwnPropertyNames(test2).map(function(n2) { return test2[n2]; }); if (order2.join("") !== "0123456789") { return false; } var test3 = {}; "abcdefghijklmnopqrst".split("").forEach(function(letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { return false; } return true; } catch (err) { return false; } } module.exports = shouldUseNative() ? Object.assign : function(target, source) { var from; var to2 = toObject(target); var symbols; for (var s2 = 1; s2 < arguments.length; s2++) { from = Object(arguments[s2]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to2[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i2 = 0; i2 < symbols.length; i2++) { if (propIsEnumerable.call(from, symbols[i2])) { to2[symbols[i2]] = from[symbols[i2]]; } } } } return to2; }; } }); // node_modules/prop-types/lib/ReactPropTypesSecret.js var require_ReactPropTypesSecret = __commonJS({ "node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) { "use strict"; var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; module.exports = ReactPropTypesSecret; } }); // node_modules/prop-types/lib/has.js var require_has = __commonJS({ "node_modules/prop-types/lib/has.js"(exports, module) { module.exports = Function.call.bind(Object.prototype.hasOwnProperty); } }); // node_modules/prop-types/checkPropTypes.js var require_checkPropTypes = __commonJS({ "node_modules/prop-types/checkPropTypes.js"(exports, module) { "use strict"; var printWarning = function() { }; if (true) { ReactPropTypesSecret = require_ReactPropTypesSecret(); loggedTypeFailures = {}; has2 = require_has(); printWarning = function(text) { var message2 = "Warning: " + text; if (typeof console !== "undefined") { console.error(message2); } try { throw new Error(message2); } catch (x2) { } }; } var ReactPropTypesSecret; var loggedTypeFailures; var has2; function checkPropTypes(typeSpecs, values, location, componentName, getStack) { if (true) { for (var typeSpecName in typeSpecs) { if (has2(typeSpecs, typeSpecName)) { var error2; try { if (typeof typeSpecs[typeSpecName] !== "function") { var err = Error( (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." ); err.name = "Invariant Violation"; throw err; } error2 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); } catch (ex) { error2 = ex; } if (error2 && !(error2 instanceof Error)) { printWarning( (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error2 + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." ); } if (error2 instanceof Error && !(error2.message in loggedTypeFailures)) { loggedTypeFailures[error2.message] = true; var stack = getStack ? getStack() : ""; printWarning( "Failed " + location + " type: " + error2.message + (stack != null ? stack : "") ); } } } } } checkPropTypes.resetWarningCache = function() { if (true) { loggedTypeFailures = {}; } }; module.exports = checkPropTypes; } }); // node_modules/prop-types/factoryWithTypeCheckers.js var require_factoryWithTypeCheckers = __commonJS({ "node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) { "use strict"; var ReactIs = require_react_is(); var assign2 = require_object_assign(); var ReactPropTypesSecret = require_ReactPropTypesSecret(); var has2 = require_has(); var checkPropTypes = require_checkPropTypes(); var printWarning = function() { }; if (true) { printWarning = function(text) { var message2 = "Warning: " + text; if (typeof console !== "undefined") { console.error(message2); } try { throw new Error(message2); } catch (x2) { } }; } function emptyFunctionThatReturnsNull() { return null; } module.exports = function(isValidElement3, throwOnDirectAccess) { var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = "@@iterator"; function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === "function") { return iteratorFn; } } var ANONYMOUS = "<>"; var ReactPropTypes = { array: createPrimitiveTypeChecker("array"), bigint: createPrimitiveTypeChecker("bigint"), bool: createPrimitiveTypeChecker("boolean"), func: createPrimitiveTypeChecker("function"), number: createPrimitiveTypeChecker("number"), object: createPrimitiveTypeChecker("object"), string: createPrimitiveTypeChecker("string"), symbol: createPrimitiveTypeChecker("symbol"), any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, element: createElementTypeChecker(), elementType: createElementTypeTypeChecker(), instanceOf: createInstanceTypeChecker, node: createNodeChecker(), objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, shape: createShapeTypeChecker, exact: createStrictShapeTypeChecker }; function is2(x2, y2) { if (x2 === y2) { return x2 !== 0 || 1 / x2 === 1 / y2; } else { return x2 !== x2 && y2 !== y2; } } function PropTypeError(message2, data) { this.message = message2; this.data = data && typeof data === "object" ? data : {}; this.stack = ""; } PropTypeError.prototype = Error.prototype; function createChainableTypeChecker(validate) { if (true) { var manualPropTypeCallCache = {}; var manualPropTypeWarningCount = 0; } function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; if (secret !== ReactPropTypesSecret) { if (throwOnDirectAccess) { var err = 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" ); err.name = "Invariant Violation"; throw err; } else if (typeof console !== "undefined") { var cacheKey2 = componentName + ":" + propName; if (!manualPropTypeCallCache[cacheKey2] && // Avoid spamming the console because they are often not actionable except for lib authors manualPropTypeWarningCount < 3) { printWarning( "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." ); manualPropTypeCallCache[cacheKey2] = true; manualPropTypeWarningCount++; } } } if (props[propName] == null) { if (isRequired) { if (props[propName] === null) { return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")); } return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")); } return null; } else { return validate(props, propName, componentName, location, propFullName); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createPrimitiveTypeChecker(expectedType) { function validate(props, propName, componentName, location, propFullName, secret) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== expectedType) { var preciseType = getPreciseType(propValue); return new PropTypeError( "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), { expectedType } ); } return null; } return createChainableTypeChecker(validate); } function createAnyTypeChecker() { return createChainableTypeChecker(emptyFunctionThatReturnsNull); } function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== "function") { return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf."); } var propValue = props[propName]; if (!Array.isArray(propValue)) { var propType = getPropType(propValue); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")); } for (var i2 = 0; i2 < propValue.length; i2++) { var error2 = typeChecker(propValue, i2, componentName, location, propFullName + "[" + i2 + "]", ReactPropTypesSecret); if (error2 instanceof Error) { return error2; } } return null; } return createChainableTypeChecker(validate); } function createElementTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!isValidElement3(propValue)) { var propType = getPropType(propValue); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement.")); } return null; } return createChainableTypeChecker(validate); } function createElementTypeTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!ReactIs.isValidElementType(propValue)) { var propType = getPropType(propValue); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type.")); } return null; } return createChainableTypeChecker(validate); } function createInstanceTypeChecker(expectedClass) { function validate(props, propName, componentName, location, propFullName) { if (!(props[propName] instanceof expectedClass)) { var expectedClassName = expectedClass.name || ANONYMOUS; var actualClassName = getClassName(props[propName]); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`.")); } return null; } return createChainableTypeChecker(validate); } function createEnumTypeChecker(expectedValues) { if (!Array.isArray(expectedValues)) { if (true) { if (arguments.length > 1) { printWarning( "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." ); } else { printWarning("Invalid argument supplied to oneOf, expected an array."); } } return emptyFunctionThatReturnsNull; } function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; for (var i2 = 0; i2 < expectedValues.length; i2++) { if (is2(propValue, expectedValues[i2])) { return null; } } var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { var type = getPreciseType(value); if (type === "symbol") { return String(value); } return value; }); return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")); } return createChainableTypeChecker(validate); } function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== "function") { return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf."); } var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== "object") { return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")); } for (var key in propValue) { if (has2(propValue, key)) { var error2 = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); if (error2 instanceof Error) { return error2; } } } return null; } return createChainableTypeChecker(validate); } function createUnionTypeChecker(arrayOfTypeCheckers) { if (!Array.isArray(arrayOfTypeCheckers)) { true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0; return emptyFunctionThatReturnsNull; } for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) { var checker = arrayOfTypeCheckers[i2]; if (typeof checker !== "function") { printWarning( "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i2 + "." ); return emptyFunctionThatReturnsNull; } } function validate(props, propName, componentName, location, propFullName) { var expectedTypes = []; for (var i3 = 0; i3 < arrayOfTypeCheckers.length; i3++) { var checker2 = arrayOfTypeCheckers[i3]; var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret); if (checkerResult == null) { return null; } if (checkerResult.data && has2(checkerResult.data, "expectedType")) { expectedTypes.push(checkerResult.data.expectedType); } } var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + ".")); } return createChainableTypeChecker(validate); } function createNodeChecker() { function validate(props, propName, componentName, location, propFullName) { if (!isNode2(props[propName])) { return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode.")); } return null; } return createChainableTypeChecker(validate); } function invalidValidatorError(componentName, location, propFullName, key, type) { return new PropTypeError( (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`." ); } function createShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== "object") { return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); } for (var key in shapeTypes) { var checker = shapeTypes[key]; if (typeof checker !== "function") { return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); } var error2 = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); if (error2) { return error2; } } return null; } return createChainableTypeChecker(validate); } function createStrictShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== "object") { return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); } var allKeys = assign2({}, props[propName], shapeTypes); for (var key in allKeys) { var checker = shapeTypes[key]; if (has2(shapeTypes, key) && typeof checker !== "function") { return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); } if (!checker) { return new PropTypeError( "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ") ); } var error2 = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); if (error2) { return error2; } } return null; } return createChainableTypeChecker(validate); } function isNode2(propValue) { switch (typeof propValue) { case "number": case "string": case "undefined": return true; case "boolean": return !propValue; case "object": if (Array.isArray(propValue)) { return propValue.every(isNode2); } if (propValue === null || isValidElement3(propValue)) { return true; } var iteratorFn = getIteratorFn(propValue); if (iteratorFn) { var iterator = iteratorFn.call(propValue); var step; if (iteratorFn !== propValue.entries) { while (!(step = iterator.next()).done) { if (!isNode2(step.value)) { return false; } } } else { while (!(step = iterator.next()).done) { var entry = step.value; if (entry) { if (!isNode2(entry[1])) { return false; } } } } } else { return false; } return true; default: return false; } } function isSymbol(propType, propValue) { if (propType === "symbol") { return true; } if (!propValue) { return false; } if (propValue["@@toStringTag"] === "Symbol") { return true; } if (typeof Symbol === "function" && propValue instanceof Symbol) { return true; } return false; } function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return "array"; } if (propValue instanceof RegExp) { return "object"; } if (isSymbol(propType, propValue)) { return "symbol"; } return propType; } function getPreciseType(propValue) { if (typeof propValue === "undefined" || propValue === null) { return "" + propValue; } var propType = getPropType(propValue); if (propType === "object") { if (propValue instanceof Date) { return "date"; } else if (propValue instanceof RegExp) { return "regexp"; } } return propType; } function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case "array": case "object": return "an " + type; case "boolean": case "date": case "regexp": return "a " + type; default: return type; } } function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; } ReactPropTypes.checkPropTypes = checkPropTypes; ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; } }); // node_modules/prop-types/index.js var require_prop_types = __commonJS({ "node_modules/prop-types/index.js"(exports, module) { if (true) { ReactIs = require_react_is(); throwOnDirectAccess = true; module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); } else { module.exports = null(); } var ReactIs; var throwOnDirectAccess; } }); // node_modules/autosize/dist/autosize.js var require_autosize = __commonJS({ "node_modules/autosize/dist/autosize.js"(exports, module) { (function(global, factory) { if (typeof define === "function" && define.amd) { define(["module", "exports"], factory); } else if (typeof exports !== "undefined") { factory(module, exports); } else { var mod = { exports: {} }; factory(mod, mod.exports); global.autosize = mod.exports; } })(exports, function(module2, exports2) { "use strict"; var map = typeof Map === "function" ? /* @__PURE__ */ new Map() : /* @__PURE__ */ (function() { var keys = []; var values = []; return { has: function has2(key) { return keys.indexOf(key) > -1; }, get: function get(key) { return values[keys.indexOf(key)]; }, set: function set3(key, value) { if (keys.indexOf(key) === -1) { keys.push(key); values.push(value); } }, delete: function _delete(key) { var index2 = keys.indexOf(key); if (index2 > -1) { keys.splice(index2, 1); values.splice(index2, 1); } } }; })(); var createEvent = function createEvent2(name) { return new Event(name, { bubbles: true }); }; try { new Event("test"); } catch (e2) { createEvent = function createEvent2(name) { var evt = document.createEvent("Event"); evt.initEvent(name, true, false); return evt; }; } function assign2(ta) { if (!ta || !ta.nodeName || ta.nodeName !== "TEXTAREA" || map.has(ta)) return; var heightOffset = null; var clientWidth = null; var cachedHeight = null; function init() { var style = window.getComputedStyle(ta, null); if (style.resize === "vertical") { ta.style.resize = "none"; } else if (style.resize === "both") { ta.style.resize = "horizontal"; } if (style.boxSizing === "content-box") { heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom)); } else { heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth); } if (isNaN(heightOffset)) { heightOffset = 0; } update5(); } function changeOverflow(value) { { var width = ta.style.width; ta.style.width = "0px"; ta.offsetWidth; ta.style.width = width; } ta.style.overflowY = value; } function getParentOverflows(el) { var arr = []; while (el && el.parentNode && el.parentNode instanceof Element) { if (el.parentNode.scrollTop) { arr.push({ node: el.parentNode, scrollTop: el.parentNode.scrollTop }); } el = el.parentNode; } return arr; } function resize() { if (ta.scrollHeight === 0) { return; } var overflows = getParentOverflows(ta); var docTop = document.documentElement && document.documentElement.scrollTop; ta.style.height = ""; ta.style.height = ta.scrollHeight + heightOffset + "px"; clientWidth = ta.clientWidth; overflows.forEach(function(el) { el.node.scrollTop = el.scrollTop; }); if (docTop) { document.documentElement.scrollTop = docTop; } } function update5() { resize(); var styleHeight = Math.round(parseFloat(ta.style.height)); var computed = window.getComputedStyle(ta, null); var actualHeight = computed.boxSizing === "content-box" ? Math.round(parseFloat(computed.height)) : ta.offsetHeight; if (actualHeight < styleHeight) { if (computed.overflowY === "hidden") { changeOverflow("scroll"); resize(); actualHeight = computed.boxSizing === "content-box" ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight; } } else { if (computed.overflowY !== "hidden") { changeOverflow("hidden"); resize(); actualHeight = computed.boxSizing === "content-box" ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight; } } if (cachedHeight !== actualHeight) { cachedHeight = actualHeight; var evt = createEvent("autosize:resized"); try { ta.dispatchEvent(evt); } catch (err) { } } } var pageResize = function pageResize2() { if (ta.clientWidth !== clientWidth) { update5(); } }; var destroy2 = function(style) { window.removeEventListener("resize", pageResize, false); ta.removeEventListener("input", update5, false); ta.removeEventListener("keyup", update5, false); ta.removeEventListener("autosize:destroy", destroy2, false); ta.removeEventListener("autosize:update", update5, false); Object.keys(style).forEach(function(key) { ta.style[key] = style[key]; }); map.delete(ta); }.bind(ta, { height: ta.style.height, resize: ta.style.resize, overflowY: ta.style.overflowY, overflowX: ta.style.overflowX, wordWrap: ta.style.wordWrap }); ta.addEventListener("autosize:destroy", destroy2, false); if ("onpropertychange" in ta && "oninput" in ta) { ta.addEventListener("keyup", update5, false); } window.addEventListener("resize", pageResize, false); ta.addEventListener("input", update5, false); ta.addEventListener("autosize:update", update5, false); ta.style.overflowX = "hidden"; ta.style.wordWrap = "break-word"; map.set(ta, { destroy: destroy2, update: update5 }); init(); } function destroy(ta) { var methods = map.get(ta); if (methods) { methods.destroy(); } } function update4(ta) { var methods = map.get(ta); if (methods) { methods.update(); } } var autosize = null; if (typeof window === "undefined" || typeof window.getComputedStyle !== "function") { autosize = function autosize2(el) { return el; }; autosize.destroy = function(el) { return el; }; autosize.update = function(el) { return el; }; } else { autosize = function autosize2(el, options) { if (el) { Array.prototype.forEach.call(el.length ? el : [el], function(x2) { return assign2(x2, options); }); } return el; }; autosize.destroy = function(el) { if (el) { Array.prototype.forEach.call(el.length ? el : [el], destroy); } return el; }; autosize.update = function(el) { if (el) { Array.prototype.forEach.call(el.length ? el : [el], update4); } return el; }; } exports2.default = autosize; module2.exports = exports2["default"]; }); } }); // node_modules/computed-style/dist/computedStyle.commonjs.js var require_computedStyle_commonjs = __commonJS({ "node_modules/computed-style/dist/computedStyle.commonjs.js"(exports, module) { var computedStyle = function(el, prop, getComputedStyle3) { getComputedStyle3 = window.getComputedStyle; return ( // If we have getComputedStyle (getComputedStyle3 ? ( // Query it // TODO: From CSS-Query notes, we might need (node, null) for FF getComputedStyle3(el) ) : ( // Otherwise, we are in IE and use currentStyle el.currentStyle ))[ // Switch to camelCase for CSSOM // DEV: Grabbed from jQuery // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194 // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597 prop.replace(/-(\w)/gi, function(word, letter) { return letter.toUpperCase(); }) ] ); }; module.exports = computedStyle; } }); // node_modules/line-height/lib/line-height.js var require_line_height = __commonJS({ "node_modules/line-height/lib/line-height.js"(exports, module) { var computedStyle = require_computedStyle_commonjs(); function lineHeight(node) { var lnHeightStr = computedStyle(node, "line-height"); var lnHeight = parseFloat(lnHeightStr, 10); if (lnHeightStr === lnHeight + "") { var _lnHeightStyle = node.style.lineHeight; node.style.lineHeight = lnHeightStr + "em"; lnHeightStr = computedStyle(node, "line-height"); lnHeight = parseFloat(lnHeightStr, 10); if (_lnHeightStyle) { node.style.lineHeight = _lnHeightStyle; } else { delete node.style.lineHeight; } } if (lnHeightStr.indexOf("pt") !== -1) { lnHeight *= 4; lnHeight /= 3; } else if (lnHeightStr.indexOf("mm") !== -1) { lnHeight *= 96; lnHeight /= 25.4; } else if (lnHeightStr.indexOf("cm") !== -1) { lnHeight *= 96; lnHeight /= 2.54; } else if (lnHeightStr.indexOf("in") !== -1) { lnHeight *= 96; } else if (lnHeightStr.indexOf("pc") !== -1) { lnHeight *= 16; } lnHeight = Math.round(lnHeight); if (lnHeightStr === "normal") { var nodeName = node.nodeName; var _node = document.createElement(nodeName); _node.innerHTML = " "; if (nodeName.toUpperCase() === "TEXTAREA") { _node.setAttribute("rows", "1"); } var fontSizeStr = computedStyle(node, "font-size"); _node.style.fontSize = fontSizeStr; _node.style.padding = "0px"; _node.style.border = "0px"; var body = document.body; body.appendChild(_node); var height = _node.offsetHeight; lnHeight = height; body.removeChild(_node); } return lnHeight; } module.exports = lineHeight; } }); // node_modules/react-autosize-textarea/lib/TextareaAutosize.js var require_TextareaAutosize = __commonJS({ "node_modules/react-autosize-textarea/lib/TextareaAutosize.js"(exports) { "use strict"; var __extends2 = exports && exports.__extends || (function() { var extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { d2.__proto__ = b2; } || function(d2, b2) { for (var p2 in b2) if (b2.hasOwnProperty(p2)) d2[p2] = b2[p2]; }; return function(d2, b2) { extendStatics2(d2, b2); function __232() { this.constructor = d2; } d2.prototype = b2 === null ? Object.create(b2) : (__232.prototype = b2.prototype, new __232()); }; })(); var __assign2 = exports && exports.__assign || Object.assign || function(t3) { for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { s2 = arguments[i2]; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t3[p2] = s2[p2]; } return t3; }; var __rest = exports && exports.__rest || function(s2, e2) { var t3 = {}; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) t3[p2] = s2[p2]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") { for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) if (e2.indexOf(p2[i2]) < 0) t3[p2[i2]] = s2[p2[i2]]; } return t3; }; exports.__esModule = true; var React118 = require_react(); var PropTypes = require_prop_types(); var autosize = require_autosize(); var _getLineHeight = require_line_height(); var getLineHeight = _getLineHeight; var RESIZED = "autosize:resized"; var TextareaAutosizeClass = ( /** @class */ (function(_super) { __extends2(TextareaAutosizeClass2, _super); function TextareaAutosizeClass2() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.state = { lineHeight: null }; _this.textarea = null; _this.onResize = function(e2) { if (_this.props.onResize) { _this.props.onResize(e2); } }; _this.updateLineHeight = function() { if (_this.textarea) { _this.setState({ lineHeight: getLineHeight(_this.textarea) }); } }; _this.onChange = function(e2) { var onChange = _this.props.onChange; _this.currentValue = e2.currentTarget.value; onChange && onChange(e2); }; return _this; } TextareaAutosizeClass2.prototype.componentDidMount = function() { var _this = this; var _a = this.props, maxRows = _a.maxRows, async = _a.async; if (typeof maxRows === "number") { this.updateLineHeight(); } if (typeof maxRows === "number" || async) { setTimeout(function() { return _this.textarea && autosize(_this.textarea); }); } else { this.textarea && autosize(this.textarea); } if (this.textarea) { this.textarea.addEventListener(RESIZED, this.onResize); } }; TextareaAutosizeClass2.prototype.componentWillUnmount = function() { if (this.textarea) { this.textarea.removeEventListener(RESIZED, this.onResize); autosize.destroy(this.textarea); } }; TextareaAutosizeClass2.prototype.render = function() { var _this = this; var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight; var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null; return React118.createElement("textarea", __assign2({}, props, { onChange: this.onChange, style: maxHeight ? __assign2({}, style, { maxHeight }) : style, ref: function(element) { _this.textarea = element; if (typeof _this.props.innerRef === "function") { _this.props.innerRef(element); } else if (_this.props.innerRef) { _this.props.innerRef.current = element; } } }), children); }; TextareaAutosizeClass2.prototype.componentDidUpdate = function() { this.textarea && autosize.update(this.textarea); }; TextareaAutosizeClass2.defaultProps = { rows: 1, async: false }; TextareaAutosizeClass2.propTypes = { rows: PropTypes.number, maxRows: PropTypes.number, onResize: PropTypes.func, innerRef: PropTypes.any, async: PropTypes.bool }; return TextareaAutosizeClass2; })(React118.Component) ); exports.TextareaAutosize = React118.forwardRef(function(props, ref) { return React118.createElement(TextareaAutosizeClass, __assign2({}, props, { innerRef: ref })); }); } }); // node_modules/react-autosize-textarea/lib/index.js var require_lib = __commonJS({ "node_modules/react-autosize-textarea/lib/index.js"(exports, module) { "use strict"; var TextareaAutosize_1 = require_TextareaAutosize(); module.exports = TextareaAutosize_1.TextareaAutosize; } }); // package-external:@wordpress/warning var require_warning = __commonJS({ "package-external:@wordpress/warning"(exports, module) { module.exports = window.wp.warning; } }); // vendor-external:react-dom var require_react_dom = __commonJS({ "vendor-external:react-dom"(exports, module) { module.exports = window.ReactDOM; } }); // package-external:@wordpress/keyboard-shortcuts var require_keyboard_shortcuts = __commonJS({ "package-external:@wordpress/keyboard-shortcuts"(exports, module) { module.exports = window.wp.keyboardShortcuts; } }); // package-external:@wordpress/html-entities var require_html_entities = __commonJS({ "package-external:@wordpress/html-entities"(exports, module) { module.exports = window.wp.htmlEntities; } }); // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js var require_use_sync_external_store_shim_development = __commonJS({ "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { "use strict"; (function() { function is2(x2, y2) { return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2; } function useSyncExternalStore$2(subscribe, getSnapshot) { didWarnOld18Alpha || void 0 === React118.startTransition || (didWarnOld18Alpha = true, console.error( "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." )); var value = getSnapshot(); if (!didWarnUncachedGetSnapshot) { var cachedValue = getSnapshot(); objectIs(value, cachedValue) || (console.error( "The result of getSnapshot should be cached to avoid an infinite loop" ), didWarnUncachedGetSnapshot = true); } cachedValue = useState122({ inst: { value, getSnapshot } }); var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; useLayoutEffect18( function() { inst.value = value; inst.getSnapshot = getSnapshot; checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }, [subscribe, value, getSnapshot] ); useEffect94( function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); return subscribe(function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }); }, [subscribe] ); useDebugValue2(value); return value; } function checkIfSnapshotChanged(inst) { var latestGetSnapshot = inst.getSnapshot; inst = inst.value; try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); } catch (error2) { return true; } } function useSyncExternalStore$1(subscribe, getSnapshot) { return getSnapshot(); } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React118 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is2, useState122 = React118.useState, useEffect94 = React118.useEffect, useLayoutEffect18 = React118.useLayoutEffect, useDebugValue2 = React118.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; exports.useSyncExternalStore = void 0 !== React118.useSyncExternalStore ? React118.useSyncExternalStore : shim; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); // node_modules/use-sync-external-store/shim/index.js var require_shim = __commonJS({ "node_modules/use-sync-external-store/shim/index.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_use_sync_external_store_shim_development(); } } }); // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js var require_with_selector_development = __commonJS({ "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) { "use strict"; (function() { function is2(x2, y2) { return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2; } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React118 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is2, useSyncExternalStore2 = shim.useSyncExternalStore, useRef109 = React118.useRef, useEffect94 = React118.useEffect, useMemo155 = React118.useMemo, useDebugValue2 = React118.useDebugValue; exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector3, isEqual2) { var instRef = useRef109(null); if (null === instRef.current) { var inst = { hasValue: false, value: null }; instRef.current = inst; } else inst = instRef.current; instRef = useMemo155( function() { function memoizedSelector(nextSnapshot) { if (!hasMemo) { hasMemo = true; memoizedSnapshot = nextSnapshot; nextSnapshot = selector3(nextSnapshot); if (void 0 !== isEqual2 && inst.hasValue) { var currentSelection = inst.value; if (isEqual2(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection; } return memoizedSelection = nextSnapshot; } currentSelection = memoizedSelection; if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection; var nextSelection = selector3(nextSnapshot); if (void 0 !== isEqual2 && isEqual2(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection; memoizedSnapshot = nextSnapshot; return memoizedSelection = nextSelection; } var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; return [ function() { return memoizedSelector(getSnapshot()); }, null === maybeGetServerSnapshot ? void 0 : function() { return memoizedSelector(maybeGetServerSnapshot()); } ]; }, [getSnapshot, getServerSnapshot, selector3, isEqual2] ); var value = useSyncExternalStore2(subscribe, instRef[0], instRef[1]); useEffect94( function() { inst.hasValue = true; inst.value = value; }, [value] ); useDebugValue2(value); return value; }; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); // node_modules/use-sync-external-store/shim/with-selector.js var require_with_selector = __commonJS({ "node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_with_selector_development(); } } }); // package-external:@wordpress/theme var require_theme = __commonJS({ "package-external:@wordpress/theme"(exports, module) { module.exports = window.wp.theme; } }); // package-external:@wordpress/upload-media var require_upload_media = __commonJS({ "package-external:@wordpress/upload-media"(exports, module) { module.exports = window.wp.uploadMedia; } }); // node_modules/picocolors/picocolors.browser.js var require_picocolors_browser = __commonJS({ "node_modules/picocolors/picocolors.browser.js"(exports, module) { var x2 = String; var create6 = function() { return { isColorSupported: false, reset: x2, bold: x2, dim: x2, italic: x2, underline: x2, inverse: x2, hidden: x2, strikethrough: x2, black: x2, red: x2, green: x2, yellow: x2, blue: x2, magenta: x2, cyan: x2, white: x2, gray: x2, bgBlack: x2, bgRed: x2, bgGreen: x2, bgYellow: x2, bgBlue: x2, bgMagenta: x2, bgCyan: x2, bgWhite: x2, blackBright: x2, redBright: x2, greenBright: x2, yellowBright: x2, blueBright: x2, magentaBright: x2, cyanBright: x2, whiteBright: x2, bgBlackBright: x2, bgRedBright: x2, bgGreenBright: x2, bgYellowBright: x2, bgBlueBright: x2, bgMagentaBright: x2, bgCyanBright: x2, bgWhiteBright: x2 }; }; module.exports = create6(); module.exports.createColors = create6; } }); // (disabled):node_modules/postcss/lib/terminal-highlight var require_terminal_highlight = __commonJS({ "(disabled):node_modules/postcss/lib/terminal-highlight"() { } }); // node_modules/postcss/lib/css-syntax-error.js var require_css_syntax_error = __commonJS({ "node_modules/postcss/lib/css-syntax-error.js"(exports, module) { "use strict"; var pico = require_picocolors_browser(); var terminalHighlight = require_terminal_highlight(); var CssSyntaxError2 = class _CssSyntaxError extends Error { constructor(message2, line, column, source, file, plugin) { super(message2); this.name = "CssSyntaxError"; this.reason = message2; if (file) { this.file = file; } if (source) { this.source = source; } if (plugin) { this.plugin = plugin; } if (typeof line !== "undefined" && typeof column !== "undefined") { if (typeof line === "number") { this.line = line; this.column = column; } else { this.line = line.line; this.column = line.column; this.endLine = column.line; this.endColumn = column.column; } } this.setMessage(); if (Error.captureStackTrace) { Error.captureStackTrace(this, _CssSyntaxError); } } setMessage() { this.message = this.plugin ? this.plugin + ": " : ""; this.message += this.file ? this.file : ""; if (typeof this.line !== "undefined") { this.message += ":" + this.line + ":" + this.column; } this.message += ": " + this.reason; } showSourceCode(color) { if (!this.source) return ""; let css = this.source; if (color == null) color = pico.isColorSupported; let aside = (text) => text; let mark = (text) => text; let highlight = (text) => text; if (color) { let { bold, gray, red } = pico.createColors(true); mark = (text) => bold(red(text)); aside = (text) => gray(text); if (terminalHighlight) { highlight = (text) => terminalHighlight(text); } } let lines = css.split(/\r?\n/); let start2 = Math.max(this.line - 3, 0); let end = Math.min(this.line + 2, lines.length); let maxWidth = String(end).length; return lines.slice(start2, end).map((line, index2) => { let number = start2 + 1 + index2; let gutter = " " + (" " + number).slice(-maxWidth) + " | "; if (number === this.line) { if (line.length > 160) { let padding = 20; let subLineStart = Math.max(0, this.column - padding); let subLineEnd = Math.max( this.column + padding, this.endColumn + padding ); let subLine = line.slice(subLineStart, subLineEnd); let spacing2 = aside(gutter.replace(/\d/g, " ")) + line.slice(0, Math.min(this.column - 1, padding - 1)).replace(/[^\t]/g, " "); return mark(">") + aside(gutter) + highlight(subLine) + "\n " + spacing2 + mark("^"); } let spacing = aside(gutter.replace(/\d/g, " ")) + line.slice(0, this.column - 1).replace(/[^\t]/g, " "); return mark(">") + aside(gutter) + highlight(line) + "\n " + spacing + mark("^"); } return " " + aside(gutter) + highlight(line); }).join("\n"); } toString() { let code = this.showSourceCode(); if (code) { code = "\n\n" + code + "\n"; } return this.name + ": " + this.message + code; } }; module.exports = CssSyntaxError2; CssSyntaxError2.default = CssSyntaxError2; } }); // node_modules/postcss/lib/stringifier.js var require_stringifier = __commonJS({ "node_modules/postcss/lib/stringifier.js"(exports, module) { "use strict"; var STYLE_TAG = /(<)(\/?style\b)/gi; var COMMENT_OPEN = /(<)(!--)/g; function escapeHTMLInCSS(str) { if (typeof str !== "string") return str; if (!str.includes("<")) return str; return str.replace(STYLE_TAG, "\\3c $2").replace(COMMENT_OPEN, "\\3c $2"); } var DEFAULT_RAW = { after: "\n", beforeClose: "\n", beforeComment: "\n", beforeDecl: "\n", beforeOpen: " ", beforeRule: "\n", colon: ": ", commentLeft: " ", commentRight: " ", emptyBody: "", indent: " ", semicolon: false }; function capitalize(str) { return str[0].toUpperCase() + str.slice(1); } var Stringifier = class { constructor(builder) { this.builder = builder; } atrule(node, semicolon) { let raws = node.raws; let name = "@" + node.name; let params = node.params ? this.rawValue(node, "params") : ""; if (typeof raws.afterName !== "undefined") { name += raws.afterName; } else if (params) { name += " "; } if (node.nodes) { this.block(node, name + params); } else { let end = (raws.between || "") + (semicolon ? ";" : ""); this.builder(escapeHTMLInCSS(name + params + end), node); } } beforeAfter(node, detect) { let value; if (node.type === "decl") { value = this.raw(node, null, "beforeDecl"); } else if (node.type === "comment") { value = this.raw(node, null, "beforeComment"); } else if (detect === "before") { value = this.raw(node, null, "beforeRule"); } else { value = this.raw(node, null, "beforeClose"); } let buf = node.parent; let depth = 0; while (buf && buf.type !== "root") { depth += 1; buf = buf.parent; } if (value.includes("\n")) { let indent = this.raw(node, null, "indent"); if (indent.length) { for (let step = 0; step < depth; step++) value += indent; } } return value; } block(node, start2) { let between = this.raw(node, "between", "beforeOpen"); this.builder(escapeHTMLInCSS(start2 + between) + "{", node, "start"); let after; if (node.nodes && node.nodes.length) { this.body(node); after = this.raw(node, "after"); } else { after = this.raw(node, "after", "emptyBody"); } if (after) this.builder(escapeHTMLInCSS(after)); this.builder("}", node, "end"); } body(node) { let nodes = node.nodes; let last = nodes.length - 1; while (last > 0) { if (nodes[last].type !== "comment") break; last -= 1; } let semicolon = this.raw(node, "semicolon"); let isDocument = node.type === "document"; for (let i2 = 0; i2 < nodes.length; i2++) { let child = nodes[i2]; let before = this.raw(child, "before"); if (before) this.builder(isDocument ? before : escapeHTMLInCSS(before)); this.stringify(child, last !== i2 || semicolon); } } comment(node) { let left = this.raw(node, "left", "commentLeft"); let right = this.raw(node, "right", "commentRight"); this.builder(escapeHTMLInCSS("/*" + left + node.text + right + "*/"), node); } decl(node, semicolon) { let raws = node.raws; let between = this.raw(node, "between", "colon"); let string = node.prop + between + this.rawValue(node, "value"); if (node.important) { string += raws.important || " !important"; } if (semicolon) string += ";"; this.builder(escapeHTMLInCSS(string), node); } document(node) { this.body(node); } raw(node, own, detect) { let value; if (!detect) detect = own; if (own) { value = node.raws[own]; if (typeof value !== "undefined") return value; } let parent = node.parent; if (detect === "before") { if (!parent || parent.type === "root" && parent.first === node) { return ""; } if (parent && parent.type === "document") { return ""; } } if (!parent) return DEFAULT_RAW[detect]; let root = node.root(); let cache = root.rawCache || (root.rawCache = {}); if (typeof cache[detect] !== "undefined") { return cache[detect]; } if (detect === "before" || detect === "after") { return this.beforeAfter(node, detect); } else { let method = "raw" + capitalize(detect); if (this[method]) { value = this[method](root, node); } else { root.walk((i2) => { value = i2.raws[own]; if (typeof value !== "undefined") return false; }); } } if (typeof value === "undefined") value = DEFAULT_RAW[detect]; cache[detect] = value; return value; } rawBeforeClose(root) { let value; root.walk((i2) => { if (i2.nodes && i2.nodes.length > 0) { if (typeof i2.raws.after !== "undefined") { value = i2.raws.after; if (value.includes("\n")) { value = value.replace(/[^\n]+$/, ""); } return false; } } }); if (value) value = value.replace(/\S/g, ""); return value; } rawBeforeComment(root, node) { let value; root.walkComments((i2) => { if (typeof i2.raws.before !== "undefined") { value = i2.raws.before; if (value.includes("\n")) { value = value.replace(/[^\n]+$/, ""); } return false; } }); if (typeof value === "undefined") { value = this.raw(node, null, "beforeDecl"); } else if (value) { value = value.replace(/\S/g, ""); } return value; } rawBeforeDecl(root, node) { let value; root.walkDecls((i2) => { if (typeof i2.raws.before !== "undefined") { value = i2.raws.before; if (value.includes("\n")) { value = value.replace(/[^\n]+$/, ""); } return false; } }); if (typeof value === "undefined") { value = this.raw(node, null, "beforeRule"); } else if (value) { value = value.replace(/\S/g, ""); } return value; } rawBeforeOpen(root) { let value; root.walk((i2) => { if (i2.type !== "decl") { value = i2.raws.between; if (typeof value !== "undefined") return false; } }); return value; } rawBeforeRule(root) { let value; root.walk((i2) => { if (i2.nodes && (i2.parent !== root || root.first !== i2)) { if (typeof i2.raws.before !== "undefined") { value = i2.raws.before; if (value.includes("\n")) { value = value.replace(/[^\n]+$/, ""); } return false; } } }); if (value) value = value.replace(/\S/g, ""); return value; } rawColon(root) { let value; root.walkDecls((i2) => { if (typeof i2.raws.between !== "undefined") { value = i2.raws.between.replace(/[^\s:]/g, ""); return false; } }); return value; } rawEmptyBody(root) { let value; root.walk((i2) => { if (i2.nodes && i2.nodes.length === 0) { value = i2.raws.after; if (typeof value !== "undefined") return false; } }); return value; } rawIndent(root) { if (root.raws.indent) return root.raws.indent; let value; root.walk((i2) => { let p2 = i2.parent; if (p2 && p2 !== root && p2.parent && p2.parent === root) { if (typeof i2.raws.before !== "undefined") { let parts = i2.raws.before.split("\n"); value = parts[parts.length - 1]; value = value.replace(/\S/g, ""); return false; } } }); return value; } rawSemicolon(root) { let value; root.walk((i2) => { if (i2.nodes && i2.nodes.length && i2.last.type === "decl") { value = i2.raws.semicolon; if (typeof value !== "undefined") return false; } }); return value; } rawValue(node, prop) { let value = node[prop]; let raw = node.raws[prop]; if (raw && raw.value === value) { return raw.raw; } return value; } root(node) { this.body(node); if (node.raws.after) { let after = node.raws.after; let isDocument = node.parent && node.parent.type === "document"; this.builder(isDocument ? after : escapeHTMLInCSS(after)); } } rule(node) { this.block(node, this.rawValue(node, "selector")); if (node.raws.ownSemicolon) { this.builder(escapeHTMLInCSS(node.raws.ownSemicolon), node, "end"); } } stringify(node, semicolon) { if (!this[node.type]) { throw new Error( "Unknown AST node type " + node.type + ". Maybe you need to change PostCSS stringifier." ); } this[node.type](node, semicolon); } }; module.exports = Stringifier; Stringifier.default = Stringifier; } }); // node_modules/postcss/lib/stringify.js var require_stringify = __commonJS({ "node_modules/postcss/lib/stringify.js"(exports, module) { "use strict"; var Stringifier = require_stringifier(); function stringify2(node, builder) { let str = new Stringifier(builder); str.stringify(node); } module.exports = stringify2; stringify2.default = stringify2; } }); // node_modules/postcss/lib/symbols.js var require_symbols = __commonJS({ "node_modules/postcss/lib/symbols.js"(exports, module) { "use strict"; module.exports.isClean = /* @__PURE__ */ Symbol("isClean"); module.exports.my = /* @__PURE__ */ Symbol("my"); } }); // node_modules/postcss/lib/node.js var require_node = __commonJS({ "node_modules/postcss/lib/node.js"(exports, module) { "use strict"; var CssSyntaxError2 = require_css_syntax_error(); var Stringifier = require_stringifier(); var stringify2 = require_stringify(); var { isClean, my } = require_symbols(); function cloneNode(obj, parent) { let cloned = new obj.constructor(); for (let i2 in obj) { if (!Object.prototype.hasOwnProperty.call(obj, i2)) { continue; } if (i2 === "proxyCache") continue; let value = obj[i2]; let type = typeof value; if (i2 === "parent" && type === "object") { if (parent) cloned[i2] = parent; } else if (i2 === "source") { cloned[i2] = value; } else if (Array.isArray(value)) { cloned[i2] = value.map((j2) => cloneNode(j2, cloned)); } else { if (type === "object" && value !== null) value = cloneNode(value); cloned[i2] = value; } } return cloned; } function sourceOffset(inputCSS, position) { if (position && typeof position.offset !== "undefined") { return position.offset; } let column = 1; let line = 1; let offset4 = 0; for (let i2 = 0; i2 < inputCSS.length; i2++) { if (line === position.line && column === position.column) { offset4 = i2; break; } if (inputCSS[i2] === "\n") { column = 1; line += 1; } else { column += 1; } } return offset4; } var Node2 = class { get proxyOf() { return this; } constructor(defaults2 = {}) { this.raws = {}; this[isClean] = false; this[my] = true; for (let name in defaults2) { if (name === "nodes") { this.nodes = []; for (let node of defaults2[name]) { if (typeof node.clone === "function" && node.parent) { this.append(node.clone()); } else { this.append(node); } } } else { this[name] = defaults2[name]; } } } addToError(error2) { error2.postcssNode = this; if (error2.stack && this.source && /\n\s{4}at /.test(error2.stack)) { let s2 = this.source; error2.stack = error2.stack.replace( /\n\s{4}at /, `$&${s2.input.from}:${s2.start.line}:${s2.start.column}$&` ); } return error2; } after(add2) { this.parent.insertAfter(this, add2); return this; } assign(overrides = {}) { for (let name in overrides) { this[name] = overrides[name]; } return this; } before(add2) { this.parent.insertBefore(this, add2); return this; } cleanRaws(keepBetween) { delete this.raws.before; delete this.raws.after; if (!keepBetween) delete this.raws.between; } clone(overrides = {}) { let cloned = cloneNode(this); for (let name in overrides) { cloned[name] = overrides[name]; } return cloned; } cloneAfter(overrides = {}) { let cloned = this.clone(overrides); this.parent.insertAfter(this, cloned); return cloned; } cloneBefore(overrides = {}) { let cloned = this.clone(overrides); this.parent.insertBefore(this, cloned); return cloned; } error(message2, opts = {}) { if (this.source) { let { end, start: start2 } = this.rangeBy(opts); return this.source.input.error( message2, { column: start2.column, line: start2.line }, { column: end.column, line: end.line }, opts ); } return new CssSyntaxError2(message2); } getProxyProcessor() { return { get(node, prop) { if (prop === "proxyOf") { return node; } else if (prop === "root") { return () => node.root().toProxy(); } else { return node[prop]; } }, set(node, prop, value) { if (node[prop] === value) return true; node[prop] = value; if (prop === "prop" || prop === "value" || prop === "name" || prop === "params" || prop === "important" || /* c8 ignore next */ prop === "text") { node.markDirty(); } return true; } }; } /* c8 ignore next 3 */ markClean() { this[isClean] = true; } markDirty() { if (this[isClean]) { this[isClean] = false; let next = this; while (next = next.parent) { next[isClean] = false; } } } next() { if (!this.parent) return void 0; let index2 = this.parent.index(this); return this.parent.nodes[index2 + 1]; } positionBy(opts = {}) { let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css; let pos = { column: this.source.start.column, line: this.source.start.line, offset: sourceOffset(inputString, this.source.start) }; if (opts.index) { pos = this.positionInside(opts.index); } else if (opts.word) { let stringRepresentation = inputString.slice( sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end) ); let index2 = stringRepresentation.indexOf(opts.word); if (index2 !== -1) pos = this.positionInside(index2); } return pos; } positionInside(index2) { let column = this.source.start.column; let line = this.source.start.line; let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css; let offset4 = sourceOffset(inputString, this.source.start); let end = offset4 + index2; for (let i2 = offset4; i2 < end; i2++) { if (inputString[i2] === "\n") { column = 1; line += 1; } else { column += 1; } } return { column, line, offset: end }; } prev() { if (!this.parent) return void 0; let index2 = this.parent.index(this); return this.parent.nodes[index2 - 1]; } rangeBy(opts = {}) { let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css; let start2 = { column: this.source.start.column, line: this.source.start.line, offset: sourceOffset(inputString, this.source.start) }; let end = this.source.end ? { column: this.source.end.column + 1, line: this.source.end.line, offset: typeof this.source.end.offset === "number" ? ( // `source.end.offset` is exclusive, so we don't need to add 1 this.source.end.offset ) : ( // Since line/column in this.source.end is inclusive, // the `sourceOffset(... , this.source.end)` returns an inclusive offset. // So, we add 1 to convert it to exclusive. sourceOffset(inputString, this.source.end) + 1 ) } : { column: start2.column + 1, line: start2.line, offset: start2.offset + 1 }; if (opts.word) { let stringRepresentation = inputString.slice( sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end) ); let index2 = stringRepresentation.indexOf(opts.word); if (index2 !== -1) { start2 = this.positionInside(index2); end = this.positionInside(index2 + opts.word.length); } } else { if (opts.start) { start2 = { column: opts.start.column, line: opts.start.line, offset: sourceOffset(inputString, opts.start) }; } else if (typeof opts.index === "number") { start2 = this.positionInside(opts.index); } if (opts.end) { end = { column: opts.end.column, line: opts.end.line, offset: sourceOffset(inputString, opts.end) }; } else if (typeof opts.endIndex === "number") { end = this.positionInside(opts.endIndex); } else if (typeof opts.index === "number") { end = this.positionInside(opts.index + 1); } } if (end.line < start2.line || end.line === start2.line && end.column <= start2.column) { end = { column: start2.column + 1, line: start2.line, offset: start2.offset + 1 }; } return { end, start: start2 }; } raw(prop, defaultType) { let str = new Stringifier(); return str.raw(this, prop, defaultType); } remove() { if (this.parent) { this.parent.removeChild(this); } this.parent = void 0; return this; } replaceWith(...nodes) { if (this.parent) { let bookmark = this; let foundSelf = false; for (let node of nodes) { if (node === this) { foundSelf = true; } else if (foundSelf) { this.parent.insertAfter(bookmark, node); bookmark = node; } else { this.parent.insertBefore(bookmark, node); } } if (!foundSelf) { this.remove(); } } return this; } root() { let result = this; while (result.parent && result.parent.type !== "document") { result = result.parent; } return result; } toJSON(_, inputs) { let fixed = {}; let emitInputs = inputs == null; inputs = inputs || /* @__PURE__ */ new Map(); let inputsNextIndex = 0; for (let name in this) { if (!Object.prototype.hasOwnProperty.call(this, name)) { continue; } if (name === "parent" || name === "proxyCache") continue; let value = this[name]; if (Array.isArray(value)) { fixed[name] = value.map((i2) => { if (typeof i2 === "object" && i2.toJSON) { return i2.toJSON(null, inputs); } else { return i2; } }); } else if (typeof value === "object" && value.toJSON) { fixed[name] = value.toJSON(null, inputs); } else if (name === "source") { if (value == null) continue; let inputId = inputs.get(value.input); if (inputId == null) { inputId = inputsNextIndex; inputs.set(value.input, inputsNextIndex); inputsNextIndex++; } fixed[name] = { end: value.end, inputId, start: value.start }; } else { fixed[name] = value; } } if (emitInputs) { fixed.inputs = [...inputs.keys()].map((input) => input.toJSON()); } return fixed; } toProxy() { if (!this.proxyCache) { this.proxyCache = new Proxy(this, this.getProxyProcessor()); } return this.proxyCache; } toString(stringifier = stringify2) { if (stringifier.stringify) stringifier = stringifier.stringify; let result = ""; stringifier(this, (i2) => { result += i2; }); return result; } warn(result, text, opts = {}) { let data = { node: this }; for (let i2 in opts) data[i2] = opts[i2]; return result.warn(text, data); } }; module.exports = Node2; Node2.default = Node2; } }); // node_modules/postcss/lib/comment.js var require_comment = __commonJS({ "node_modules/postcss/lib/comment.js"(exports, module) { "use strict"; var Node2 = require_node(); var Comment = class extends Node2 { constructor(defaults2) { super(defaults2); this.type = "comment"; } }; module.exports = Comment; Comment.default = Comment; } }); // node_modules/postcss/lib/declaration.js var require_declaration = __commonJS({ "node_modules/postcss/lib/declaration.js"(exports, module) { "use strict"; var Node2 = require_node(); var Declaration = class extends Node2 { get variable() { return this.prop.startsWith("--") || this.prop[0] === "$"; } constructor(defaults2) { if (defaults2 && typeof defaults2.value !== "undefined" && typeof defaults2.value !== "string") { defaults2 = { ...defaults2, value: String(defaults2.value) }; } super(defaults2); this.type = "decl"; } }; module.exports = Declaration; Declaration.default = Declaration; } }); // node_modules/postcss/lib/container.js var require_container = __commonJS({ "node_modules/postcss/lib/container.js"(exports, module) { "use strict"; var Comment = require_comment(); var Declaration = require_declaration(); var Node2 = require_node(); var { isClean, my } = require_symbols(); var AtRule; var parse4; var Root8; var Rule; function cleanSource(nodes) { return nodes.map((i2) => { if (i2.nodes) i2.nodes = cleanSource(i2.nodes); delete i2.source; return i2; }); } function markTreeDirty(node) { node[isClean] = false; if (node.proxyOf.nodes) { for (let i2 of node.proxyOf.nodes) { markTreeDirty(i2); } } } var Container = class _Container extends Node2 { get first() { if (!this.proxyOf.nodes) return void 0; return this.proxyOf.nodes[0]; } get last() { if (!this.proxyOf.nodes) return void 0; return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]; } append(...children) { for (let child of children) { let nodes = this.normalize(child, this.last); for (let node of nodes) this.proxyOf.nodes.push(node); } this.markDirty(); return this; } cleanRaws(keepBetween) { super.cleanRaws(keepBetween); if (this.nodes) { for (let node of this.nodes) node.cleanRaws(keepBetween); } } each(callback) { if (!this.proxyOf.nodes) return void 0; let iterator = this.getIterator(); let index2, result; while (this.indexes[iterator] < this.proxyOf.nodes.length) { index2 = this.indexes[iterator]; result = callback(this.proxyOf.nodes[index2], index2); if (result === false) break; this.indexes[iterator] += 1; } delete this.indexes[iterator]; return result; } every(condition) { return this.nodes.every(condition); } getIterator() { if (!this.lastEach) this.lastEach = 0; if (!this.indexes) this.indexes = {}; this.lastEach += 1; let iterator = this.lastEach; this.indexes[iterator] = 0; return iterator; } getProxyProcessor() { return { get(node, prop) { if (prop === "proxyOf") { return node; } else if (!node[prop]) { return node[prop]; } else if (prop === "each" || typeof prop === "string" && prop.startsWith("walk")) { return (...args) => { return node[prop]( ...args.map((i2) => { if (typeof i2 === "function") { return (child, index2) => i2(child.toProxy(), index2); } else { return i2; } }) ); }; } else if (prop === "every" || prop === "some") { return (cb) => { return node[prop]( (child, ...other) => cb(child.toProxy(), ...other) ); }; } else if (prop === "root") { return () => node.root().toProxy(); } else if (prop === "nodes") { return node.nodes.map((i2) => i2.toProxy()); } else if (prop === "first" || prop === "last") { return node[prop].toProxy(); } else { return node[prop]; } }, set(node, prop, value) { if (node[prop] === value) return true; node[prop] = value; if (prop === "name" || prop === "params" || prop === "selector") { node.markDirty(); } return true; } }; } index(child) { if (typeof child === "number") return child; if (child.proxyOf) child = child.proxyOf; return this.proxyOf.nodes.indexOf(child); } insertAfter(exist, add2) { let existIndex = this.index(exist); let nodes = this.normalize(add2, this.proxyOf.nodes[existIndex]).reverse(); existIndex = this.index(exist); for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node); let index2; for (let id in this.indexes) { index2 = this.indexes[id]; if (existIndex < index2) { this.indexes[id] = index2 + nodes.length; } } this.markDirty(); return this; } insertBefore(exist, add2) { let existIndex = this.index(exist); let type = existIndex === 0 ? "prepend" : false; let nodes = this.normalize( add2, this.proxyOf.nodes[existIndex], type ).reverse(); existIndex = this.index(exist); for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node); let index2; for (let id in this.indexes) { index2 = this.indexes[id]; if (existIndex <= index2) { this.indexes[id] = index2 + nodes.length; } } this.markDirty(); return this; } normalize(nodes, sample) { if (typeof nodes === "string") { nodes = cleanSource(parse4(nodes).nodes); } else if (typeof nodes === "undefined") { nodes = []; } else if (Array.isArray(nodes)) { nodes = nodes.slice(0); for (let i2 of nodes) { if (i2.parent) i2.parent.removeChild(i2, "ignore"); } } else if (nodes.type === "root" && this.type !== "document") { nodes = nodes.nodes.slice(0); for (let i2 of nodes) { if (i2.parent) i2.parent.removeChild(i2, "ignore"); } } else if (nodes.type) { nodes = [nodes]; } else if (nodes.prop) { if (typeof nodes.value === "undefined") { throw new Error("Value field is missed in node creation"); } else if (typeof nodes.value !== "string") { nodes.value = String(nodes.value); } nodes = [new Declaration(nodes)]; } else if (nodes.selector || nodes.selectors) { nodes = [new Rule(nodes)]; } else if (nodes.name) { nodes = [new AtRule(nodes)]; } else if (nodes.text) { nodes = [new Comment(nodes)]; } else { throw new Error("Unknown node type in node creation"); } let processed = nodes.map((i2) => { if (!i2[my]) _Container.rebuild(i2); i2 = i2.proxyOf; if (i2.parent) i2.parent.removeChild(i2); if (i2[isClean]) markTreeDirty(i2); if (!i2.raws) i2.raws = {}; if (typeof i2.raws.before === "undefined") { if (sample && typeof sample.raws.before !== "undefined") { i2.raws.before = sample.raws.before.replace(/\S/g, ""); } } i2.parent = this.proxyOf; return i2; }); return processed; } prepend(...children) { children = children.reverse(); for (let child of children) { let nodes = this.normalize(child, this.first, "prepend").reverse(); for (let node of nodes) this.proxyOf.nodes.unshift(node); for (let id in this.indexes) { this.indexes[id] = this.indexes[id] + nodes.length; } } this.markDirty(); return this; } push(child) { child.parent = this; this.proxyOf.nodes.push(child); return this; } removeAll() { for (let node of this.proxyOf.nodes) node.parent = void 0; this.proxyOf.nodes = []; this.markDirty(); return this; } removeChild(child) { child = this.index(child); this.proxyOf.nodes[child].parent = void 0; this.proxyOf.nodes.splice(child, 1); let index2; for (let id in this.indexes) { index2 = this.indexes[id]; if (index2 >= child) { this.indexes[id] = index2 - 1; } } this.markDirty(); return this; } replaceValues(pattern, opts, callback) { if (!callback) { callback = opts; opts = {}; } this.walkDecls((decl) => { if (opts.props && !opts.props.includes(decl.prop)) return; if (opts.fast && !decl.value.includes(opts.fast)) return; decl.value = decl.value.replace(pattern, callback); }); this.markDirty(); return this; } some(condition) { return this.nodes.some(condition); } walk(callback) { return this.each((child, i2) => { let result; try { result = callback(child, i2); } catch (e2) { throw child.addToError(e2); } if (result !== false && child.walk) { result = child.walk(callback); } return result; }); } walkAtRules(name, callback) { if (!callback) { callback = name; return this.walk((child, i2) => { if (child.type === "atrule") { return callback(child, i2); } }); } if (name instanceof RegExp) { return this.walk((child, i2) => { if (child.type === "atrule" && name.test(child.name)) { return callback(child, i2); } }); } return this.walk((child, i2) => { if (child.type === "atrule" && child.name === name) { return callback(child, i2); } }); } walkComments(callback) { return this.walk((child, i2) => { if (child.type === "comment") { return callback(child, i2); } }); } walkDecls(prop, callback) { if (!callback) { callback = prop; return this.walk((child, i2) => { if (child.type === "decl") { return callback(child, i2); } }); } if (prop instanceof RegExp) { return this.walk((child, i2) => { if (child.type === "decl" && prop.test(child.prop)) { return callback(child, i2); } }); } return this.walk((child, i2) => { if (child.type === "decl" && child.prop === prop) { return callback(child, i2); } }); } walkRules(selector3, callback) { if (!callback) { callback = selector3; return this.walk((child, i2) => { if (child.type === "rule") { return callback(child, i2); } }); } if (selector3 instanceof RegExp) { return this.walk((child, i2) => { if (child.type === "rule" && selector3.test(child.selector)) { return callback(child, i2); } }); } return this.walk((child, i2) => { if (child.type === "rule" && child.selector === selector3) { return callback(child, i2); } }); } }; Container.registerParse = (dependant) => { parse4 = dependant; }; Container.registerRule = (dependant) => { Rule = dependant; }; Container.registerAtRule = (dependant) => { AtRule = dependant; }; Container.registerRoot = (dependant) => { Root8 = dependant; }; module.exports = Container; Container.default = Container; Container.rebuild = (node) => { if (node.type === "atrule") { Object.setPrototypeOf(node, AtRule.prototype); } else if (node.type === "rule") { Object.setPrototypeOf(node, Rule.prototype); } else if (node.type === "decl") { Object.setPrototypeOf(node, Declaration.prototype); } else if (node.type === "comment") { Object.setPrototypeOf(node, Comment.prototype); } else if (node.type === "root") { Object.setPrototypeOf(node, Root8.prototype); } node[my] = true; if (node.nodes) { node.nodes.forEach((child) => { Container.rebuild(child); }); } }; } }); // node_modules/postcss/lib/document.js var require_document = __commonJS({ "node_modules/postcss/lib/document.js"(exports, module) { "use strict"; var Container = require_container(); var LazyResult; var Processor2; var Document = class extends Container { constructor(defaults2) { super({ type: "document", ...defaults2 }); if (!this.nodes) { this.nodes = []; } } toResult(opts = {}) { let lazy = new LazyResult(new Processor2(), this, opts); return lazy.stringify(); } }; Document.registerLazyResult = (dependant) => { LazyResult = dependant; }; Document.registerProcessor = (dependant) => { Processor2 = dependant; }; module.exports = Document; Document.default = Document; } }); // (disabled):path var require_path = __commonJS({ "(disabled):path"() { } }); // (disabled):node_modules/postcss/node_modules/source-map-js/source-map.js var require_source_map = __commonJS({ "(disabled):node_modules/postcss/node_modules/source-map-js/source-map.js"() { } }); // (disabled):node_modules/url/url.js var require_url2 = __commonJS({ "(disabled):node_modules/url/url.js"() { } }); // node_modules/nanoid/non-secure/index.cjs var require_non_secure = __commonJS({ "node_modules/nanoid/non-secure/index.cjs"(exports, module) { var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"; var customAlphabet = (alphabet, defaultSize = 21) => { return (size4 = defaultSize) => { let id = ""; let i2 = size4 | 0; while (i2--) { id += alphabet[Math.random() * alphabet.length | 0]; } return id; }; }; var nanoid = (size4 = 21) => { let id = ""; let i2 = size4 | 0; while (i2--) { id += urlAlphabet[Math.random() * 64 | 0]; } return id; }; module.exports = { nanoid, customAlphabet }; } }); // (disabled):fs var require_fs = __commonJS({ "(disabled):fs"() { } }); // node_modules/postcss/lib/previous-map.js var require_previous_map = __commonJS({ "node_modules/postcss/lib/previous-map.js"(exports, module) { "use strict"; var { existsSync, readFileSync } = require_fs(); var { dirname, join } = require_path(); var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); function fromBase64(str) { if (Buffer) { return Buffer.from(str, "base64").toString(); } else { return window.atob(str); } } var PreviousMap = class { constructor(css, opts) { if (opts.map === false) return; if (opts.unsafeMap) this.unsafeMap = true; this.loadAnnotation(css); this.inline = this.startWith(this.annotation, "data:"); let prev = opts.map ? opts.map.prev : void 0; let text = this.loadMap(opts.from, prev); if (!this.mapFile && opts.from) { this.mapFile = opts.from; } if (this.mapFile) this.root = dirname(this.mapFile); if (text) this.text = text; } consumer() { if (!this.consumerCache) { this.consumerCache = new SourceMapConsumer(this.json || this.text); } return this.consumerCache; } decodeInline(text) { let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/; let baseUri = /^data:application\/json;base64,/; let charsetUri = /^data:application\/json;charset=utf-?8,/; let uri = /^data:application\/json,/; let uriMatch = text.match(charsetUri) || text.match(uri); if (uriMatch) { return decodeURIComponent(text.substr(uriMatch[0].length)); } let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri); if (baseUriMatch) { return fromBase64(text.substr(baseUriMatch[0].length)); } let encoding = text.slice("data:application/json;".length); encoding = encoding.slice(0, encoding.indexOf(",")); throw new Error("Unsupported source map encoding " + encoding); } getAnnotationURL(sourceMapString) { return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, "").trim(); } isMap(map) { if (typeof map !== "object") return false; return typeof map.mappings === "string" || typeof map._mappings === "string" || Array.isArray(map.sections); } loadAnnotation(css) { let comments = css.match(/\/\*\s*# sourceMappingURL=/g); if (!comments) return; let start2 = css.lastIndexOf(comments.pop()); let end = css.indexOf("*/", start2); if (start2 > -1 && end > -1) { this.annotation = this.getAnnotationURL(css.substring(start2, end)); } } loadFile(path, cssFile, trusted) { if (!trusted && !this.unsafeMap) { if (!/\.map$/i.test(path)) { return void 0; } } this.root = dirname(path); if (existsSync(path)) { this.mapFile = path; return readFileSync(path, "utf-8").toString().trim(); } } loadMap(file, prev) { if (prev === false) return false; if (prev) { if (typeof prev === "string") { return prev; } else if (typeof prev === "function") { let prevPath = prev(file); if (prevPath) { let map = this.loadFile(prevPath, file, true); if (!map) { throw new Error( "Unable to load previous source map: " + prevPath.toString() ); } return map; } } else if (prev instanceof SourceMapConsumer) { return SourceMapGenerator.fromSourceMap(prev).toString(); } else if (prev instanceof SourceMapGenerator) { return prev.toString(); } else if (this.isMap(prev)) { return JSON.stringify(prev); } else { throw new Error( "Unsupported previous source map format: " + prev.toString() ); } } else if (this.inline) { return this.decodeInline(this.annotation); } else if (this.annotation) { let map = this.annotation; if (file) map = join(dirname(file), map); let unknown = this.loadFile(map, file, false); if (unknown) { try { this.json = JSON.parse(unknown.replace(/^\)]}'[^\n]*\n/, "")); } catch { return void 0; } } return unknown; } } startWith(string, start2) { if (!string) return false; return string.substr(0, start2.length) === start2; } withContent() { return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0); } }; module.exports = PreviousMap; PreviousMap.default = PreviousMap; } }); // node_modules/postcss/lib/input.js var require_input = __commonJS({ "node_modules/postcss/lib/input.js"(exports, module) { "use strict"; var { nanoid } = require_non_secure(); var { isAbsolute, resolve } = require_path(); var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); var { fileURLToPath, pathToFileURL } = require_url2(); var CssSyntaxError2 = require_css_syntax_error(); var PreviousMap = require_previous_map(); var terminalHighlight = require_terminal_highlight(); var lineToIndexCache = /* @__PURE__ */ Symbol("lineToIndexCache"); var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator); var pathAvailable = Boolean(resolve && isAbsolute); function getLineToIndex(input) { if (input[lineToIndexCache]) return input[lineToIndexCache]; let lines = input.css.split("\n"); let lineToIndex = new Array(lines.length); let prevIndex = 0; for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) { lineToIndex[i2] = prevIndex; prevIndex += lines[i2].length + 1; } input[lineToIndexCache] = lineToIndex; return lineToIndex; } var Input = class { get from() { return this.file || this.id; } constructor(css, opts = {}) { if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) { throw new Error(`PostCSS received ${css} instead of CSS string`); } this.css = css.toString(); if (this.css[0] === "\uFEFF" || this.css[0] === "\uFFFE") { this.hasBOM = true; this.css = this.css.slice(1); } else { this.hasBOM = false; } this.document = this.css; if (opts.document) this.document = opts.document.toString(); if (opts.from) { if (!pathAvailable || /^\w+:\/\//.test(opts.from) || isAbsolute(opts.from)) { this.file = opts.from; } else { this.file = resolve(opts.from); } } if (pathAvailable && sourceMapAvailable) { let map = new PreviousMap(this.css, opts); if (map.text) { this.map = map; let file = map.consumer().file; if (!this.file && file) this.file = this.mapResolve(file); } } if (!this.file) { this.id = ""; } if (this.map) this.map.file = this.from; } error(message2, line, column, opts = {}) { let endColumn, endLine, endOffset, offset4, result; if (line && typeof line === "object") { let start2 = line; let end = column; if (typeof start2.offset === "number") { offset4 = start2.offset; let pos = this.fromOffset(offset4); line = pos.line; column = pos.col; } else { line = start2.line; column = start2.column; offset4 = this.fromLineAndColumn(line, column); } if (typeof end.offset === "number") { endOffset = end.offset; let pos = this.fromOffset(endOffset); endLine = pos.line; endColumn = pos.col; } else { endLine = end.line; endColumn = end.column; endOffset = this.fromLineAndColumn(end.line, end.column); } } else if (!column) { offset4 = line; let pos = this.fromOffset(offset4); line = pos.line; column = pos.col; } else { offset4 = this.fromLineAndColumn(line, column); } let origin = this.origin(line, column, endLine, endColumn); if (origin) { result = new CssSyntaxError2( message2, origin.endLine === void 0 ? origin.line : { column: origin.column, line: origin.line }, origin.endLine === void 0 ? origin.column : { column: origin.endColumn, line: origin.endLine }, origin.source, origin.file, opts.plugin ); } else { result = new CssSyntaxError2( message2, endLine === void 0 ? line : { column, line }, endLine === void 0 ? column : { column: endColumn, line: endLine }, this.css, this.file, opts.plugin ); } result.input = { column, endColumn, endLine, endOffset, line, offset: offset4, source: this.css }; if (this.file) { if (pathToFileURL) { result.input.url = pathToFileURL(this.file).toString(); } result.input.file = this.file; } return result; } fromLineAndColumn(line, column) { let lineToIndex = getLineToIndex(this); let index2 = lineToIndex[line - 1]; return index2 + column - 1; } fromOffset(offset4) { let lineToIndex = getLineToIndex(this); let lastLine = lineToIndex[lineToIndex.length - 1]; let min2 = 0; if (offset4 >= lastLine) { min2 = lineToIndex.length - 1; } else { let max2 = lineToIndex.length - 2; let mid; while (min2 < max2) { mid = min2 + (max2 - min2 >> 1); if (offset4 < lineToIndex[mid]) { max2 = mid - 1; } else if (offset4 >= lineToIndex[mid + 1]) { min2 = mid + 1; } else { min2 = mid; break; } } } return { col: offset4 - lineToIndex[min2] + 1, line: min2 + 1 }; } mapResolve(file) { if (/^\w+:\/\//.test(file)) { return file; } return resolve(this.map.consumer().sourceRoot || this.map.root || ".", file); } origin(line, column, endLine, endColumn) { if (!this.map) return false; let consumer = this.map.consumer(); let from = consumer.originalPositionFor({ column: column - 1, line }); if (!from.source) return false; let to2; if (typeof endLine === "number") { to2 = consumer.originalPositionFor({ column: endColumn - 1, line: endLine }); } let fromUrl; if (isAbsolute(from.source)) { fromUrl = pathToFileURL(from.source); } else { fromUrl = new URL( from.source, this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile) ); } let result = { column: from.column + 1, endColumn: to2 && to2.column + 1, endLine: to2 && to2.line, line: from.line, url: fromUrl.toString() }; if (fromUrl.protocol === "file:") { if (fileURLToPath) { result.file = fileURLToPath(fromUrl); } else { throw new Error(`file: protocol is not available in this PostCSS build`); } } let source = consumer.sourceContentFor(from.source); if (source) result.source = source; return result; } toJSON() { let json = {}; for (let name of ["hasBOM", "css", "file", "id"]) { if (this[name] != null) { json[name] = this[name]; } } if (this.map) { json.map = { ...this.map }; if (json.map.consumerCache) { json.map.consumerCache = void 0; } } return json; } }; module.exports = Input; Input.default = Input; if (terminalHighlight && terminalHighlight.registerInput) { terminalHighlight.registerInput(Input); } } }); // node_modules/postcss/lib/map-generator.js var require_map_generator = __commonJS({ "node_modules/postcss/lib/map-generator.js"(exports, module) { "use strict"; var { dirname, relative, resolve, sep } = require_path(); var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); var { pathToFileURL } = require_url2(); var Input = require_input(); var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator); var pathAvailable = Boolean(dirname && resolve && relative && sep); var MapGenerator = class { constructor(stringify2, root, opts, cssString) { this.stringify = stringify2; this.mapOpts = opts.map || {}; this.root = root; this.opts = opts; this.css = cssString; this.originalCSS = cssString; this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute; this.memoizedFileURLs = /* @__PURE__ */ new Map(); this.memoizedPaths = /* @__PURE__ */ new Map(); this.memoizedURLs = /* @__PURE__ */ new Map(); } addAnnotation() { let content; if (this.isInline()) { content = "data:application/json;base64," + this.toBase64(this.map.toString()); } else if (typeof this.mapOpts.annotation === "string") { content = this.mapOpts.annotation; } else if (typeof this.mapOpts.annotation === "function") { content = this.mapOpts.annotation(this.opts.to, this.root); } else { content = this.outputFile() + ".map"; } let eol = "\n"; if (this.css.includes("\r\n")) eol = "\r\n"; this.css += eol + "/*# sourceMappingURL=" + content + " */"; } applyPrevMaps() { for (let prev of this.previous()) { let from = this.toUrl(this.path(prev.file)); let root = prev.root || dirname(prev.file); let map; if (this.mapOpts.sourcesContent === false) { map = new SourceMapConsumer(prev.text); if (map.sourcesContent) { map.sourcesContent = null; } } else { map = prev.consumer(); } this.map.applySourceMap(map, from, this.toUrl(this.path(root))); } } clearAnnotation() { if (this.mapOpts.annotation === false) return; if (this.root) { let node; for (let i2 = this.root.nodes.length - 1; i2 >= 0; i2--) { node = this.root.nodes[i2]; if (node.type !== "comment") continue; if (node.text.startsWith("# sourceMappingURL=")) { this.root.removeChild(i2); } } } else if (this.css) { let startIndex; while ((startIndex = this.css.lastIndexOf("/*#")) !== -1) { let endIndex = this.css.indexOf("*/", startIndex + 3); if (endIndex === -1) break; while (startIndex > 0 && this.css[startIndex - 1] === "\n") { startIndex--; } this.css = this.css.slice(0, startIndex) + this.css.slice(endIndex + 2); } } } generate() { this.clearAnnotation(); if (pathAvailable && sourceMapAvailable && this.isMap()) { return this.generateMap(); } else { let result = ""; this.stringify(this.root, (i2) => { result += i2; }); return [result]; } } generateMap() { if (this.root) { this.generateString(); } else if (this.previous().length === 1) { let prev = this.previous()[0].consumer(); prev.file = this.outputFile(); this.map = SourceMapGenerator.fromSourceMap(prev, { ignoreInvalidMapping: true }); } else { this.map = new SourceMapGenerator({ file: this.outputFile(), ignoreInvalidMapping: true }); this.map.addMapping({ generated: { column: 0, line: 1 }, original: { column: 0, line: 1 }, source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : "" }); } if (this.isSourcesContent()) this.setSourcesContent(); if (this.root && this.previous().length > 0) this.applyPrevMaps(); if (this.isAnnotation()) this.addAnnotation(); if (this.isInline()) { return [this.css]; } else { return [this.css, this.map]; } } generateString() { this.css = ""; this.map = new SourceMapGenerator({ file: this.outputFile(), ignoreInvalidMapping: true }); let line = 1; let column = 1; let noSource = ""; let mapping = { generated: { column: 0, line: 0 }, original: { column: 0, line: 0 }, source: "" }; let last, lines; this.stringify(this.root, (str, node, type) => { this.css += str; if (node && type !== "end") { mapping.generated.line = line; mapping.generated.column = column - 1; if (node.source && node.source.start) { mapping.source = this.sourcePath(node); mapping.original.line = node.source.start.line; mapping.original.column = node.source.start.column - 1; this.map.addMapping(mapping); } else { mapping.source = noSource; mapping.original.line = 1; mapping.original.column = 0; this.map.addMapping(mapping); } } lines = str.match(/\n/g); if (lines) { line += lines.length; last = str.lastIndexOf("\n"); column = str.length - last; } else { column += str.length; } if (node && type !== "start") { let p2 = node.parent || { raws: {} }; let childless = node.type === "decl" || node.type === "atrule" && !node.nodes; if (!childless || node !== p2.last || p2.raws.semicolon) { if (node.source && node.source.end) { mapping.source = this.sourcePath(node); mapping.original.line = node.source.end.line; mapping.original.column = node.source.end.column - 1; mapping.generated.line = line; mapping.generated.column = column - 2; this.map.addMapping(mapping); } else { mapping.source = noSource; mapping.original.line = 1; mapping.original.column = 0; mapping.generated.line = line; mapping.generated.column = column - 1; this.map.addMapping(mapping); } } } }); } isAnnotation() { if (this.isInline()) { return true; } if (typeof this.mapOpts.annotation !== "undefined") { return this.mapOpts.annotation; } if (this.previous().length) { return this.previous().some((i2) => i2.annotation); } return true; } isInline() { if (typeof this.mapOpts.inline !== "undefined") { return this.mapOpts.inline; } let annotation = this.mapOpts.annotation; if (typeof annotation !== "undefined" && annotation !== true) { return false; } if (this.previous().length) { return this.previous().some((i2) => i2.inline); } return true; } isMap() { if (typeof this.opts.map !== "undefined") { return !!this.opts.map; } return this.previous().length > 0; } isSourcesContent() { if (typeof this.mapOpts.sourcesContent !== "undefined") { return this.mapOpts.sourcesContent; } if (this.previous().length) { return this.previous().some((i2) => i2.withContent()); } return true; } outputFile() { if (this.opts.to) { return this.path(this.opts.to); } else if (this.opts.from) { return this.path(this.opts.from); } else { return "to.css"; } } path(file) { if (this.mapOpts.absolute) return file; if (file.charCodeAt(0) === 60) return file; if (/^\w+:\/\//.test(file)) return file; let cached = this.memoizedPaths.get(file); if (cached) return cached; let from = this.opts.to ? dirname(this.opts.to) : "."; if (typeof this.mapOpts.annotation === "string") { from = dirname(resolve(from, this.mapOpts.annotation)); } let path = relative(from, file); this.memoizedPaths.set(file, path); return path; } previous() { if (!this.previousMaps) { this.previousMaps = []; if (this.root) { this.root.walk((node) => { if (node.source && node.source.input.map) { let map = node.source.input.map; if (!this.previousMaps.includes(map)) { this.previousMaps.push(map); } } }); } else { let input = new Input(this.originalCSS, this.opts); if (input.map) this.previousMaps.push(input.map); } } return this.previousMaps; } setSourcesContent() { let already = {}; if (this.root) { this.root.walk((node) => { if (node.source) { let from = node.source.input.from; if (from && !already[from]) { already[from] = true; let fromUrl = this.usesFileUrls ? this.toFileUrl(from) : this.toUrl(this.path(from)); this.map.setSourceContent(fromUrl, node.source.input.css); } } }); } else if (this.css) { let from = this.opts.from ? this.toUrl(this.path(this.opts.from)) : ""; this.map.setSourceContent(from, this.css); } } sourcePath(node) { if (this.mapOpts.from) { return this.toUrl(this.mapOpts.from); } else if (this.usesFileUrls) { return this.toFileUrl(node.source.input.from); } else { return this.toUrl(this.path(node.source.input.from)); } } toBase64(str) { if (Buffer) { return Buffer.from(str).toString("base64"); } else { return window.btoa(unescape(encodeURIComponent(str))); } } toFileUrl(path) { let cached = this.memoizedFileURLs.get(path); if (cached) return cached; if (pathToFileURL) { let fileURL = pathToFileURL(path).toString(); this.memoizedFileURLs.set(path, fileURL); return fileURL; } else { throw new Error( "`map.absolute` option is not available in this PostCSS build" ); } } toUrl(path) { let cached = this.memoizedURLs.get(path); if (cached) return cached; if (sep === "\\") { path = path.replace(/\\/g, "/"); } let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent); this.memoizedURLs.set(path, url); return url; } }; module.exports = MapGenerator; } }); // node_modules/postcss/lib/at-rule.js var require_at_rule = __commonJS({ "node_modules/postcss/lib/at-rule.js"(exports, module) { "use strict"; var Container = require_container(); var AtRule = class extends Container { constructor(defaults2) { super(defaults2); this.type = "atrule"; } append(...children) { if (!this.proxyOf.nodes) this.nodes = []; return super.append(...children); } prepend(...children) { if (!this.proxyOf.nodes) this.nodes = []; return super.prepend(...children); } }; module.exports = AtRule; AtRule.default = AtRule; Container.registerAtRule(AtRule); } }); // node_modules/postcss/lib/root.js var require_root = __commonJS({ "node_modules/postcss/lib/root.js"(exports, module) { "use strict"; var Container = require_container(); var LazyResult; var Processor2; var Root8 = class extends Container { constructor(defaults2) { super(defaults2); this.type = "root"; if (!this.nodes) this.nodes = []; } normalize(child, sample, type) { let nodes = super.normalize(child); if (sample) { if (type === "prepend") { if (this.nodes.length > 1) { sample.raws.before = this.nodes[1].raws.before; } else { delete sample.raws.before; } } else if (this.first !== sample) { for (let node of nodes) { node.raws.before = sample.raws.before; } } } return nodes; } removeChild(child, ignore) { let index2 = this.index(child); if (!ignore && index2 === 0 && this.nodes.length > 1) { this.nodes[1].raws.before = this.nodes[index2].raws.before; } return super.removeChild(child); } toResult(opts = {}) { let lazy = new LazyResult(new Processor2(), this, opts); return lazy.stringify(); } }; Root8.registerLazyResult = (dependant) => { LazyResult = dependant; }; Root8.registerProcessor = (dependant) => { Processor2 = dependant; }; module.exports = Root8; Root8.default = Root8; Container.registerRoot(Root8); } }); // node_modules/postcss/lib/list.js var require_list = __commonJS({ "node_modules/postcss/lib/list.js"(exports, module) { "use strict"; var list = { comma(string) { return list.split(string, [","], true); }, space(string) { let spaces = [" ", "\n", " "]; return list.split(string, spaces); }, split(string, separators, last) { let array = []; let current = ""; let split2 = false; let func = 0; let inQuote = false; let prevQuote = ""; let escape = false; for (let letter of string) { if (escape) { escape = false; } else if (letter === "\\") { escape = true; } else if (inQuote) { if (letter === prevQuote) { inQuote = false; } } else if (letter === '"' || letter === "'") { inQuote = true; prevQuote = letter; } else if (letter === "(") { func += 1; } else if (letter === ")") { if (func > 0) func -= 1; } else if (func === 0) { if (separators.includes(letter)) split2 = true; } if (split2) { if (current !== "") array.push(current.trim()); current = ""; split2 = false; } else { current += letter; } } if (last || current !== "") array.push(current.trim()); return array; } }; module.exports = list; list.default = list; } }); // node_modules/postcss/lib/rule.js var require_rule = __commonJS({ "node_modules/postcss/lib/rule.js"(exports, module) { "use strict"; var Container = require_container(); var list = require_list(); var Rule = class extends Container { get selectors() { return list.comma(this.selector); } set selectors(values) { let match2 = this.selector ? this.selector.match(/,\s*/) : null; let sep = match2 ? match2[0] : "," + this.raw("between", "beforeOpen"); this.selector = values.join(sep); } constructor(defaults2) { super(defaults2); this.type = "rule"; if (!this.nodes) this.nodes = []; } }; module.exports = Rule; Rule.default = Rule; Container.registerRule(Rule); } }); // node_modules/postcss/lib/tokenize.js var require_tokenize = __commonJS({ "node_modules/postcss/lib/tokenize.js"(exports, module) { "use strict"; var SINGLE_QUOTE = "'".charCodeAt(0); var DOUBLE_QUOTE = '"'.charCodeAt(0); var BACKSLASH = "\\".charCodeAt(0); var SLASH = "/".charCodeAt(0); var NEWLINE = "\n".charCodeAt(0); var SPACE3 = " ".charCodeAt(0); var FEED = "\f".charCodeAt(0); var TAB5 = " ".charCodeAt(0); var CR = "\r".charCodeAt(0); var OPEN_SQUARE = "[".charCodeAt(0); var CLOSE_SQUARE = "]".charCodeAt(0); var OPEN_PARENTHESES = "(".charCodeAt(0); var CLOSE_PARENTHESES = ")".charCodeAt(0); var OPEN_CURLY = "{".charCodeAt(0); var CLOSE_CURLY = "}".charCodeAt(0); var SEMICOLON = ";".charCodeAt(0); var ASTERISK = "*".charCodeAt(0); var COLON = ":".charCodeAt(0); var AT = "@".charCodeAt(0); var RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g; var RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g; var RE_BAD_BRACKET = /.[\r\n"'(/\\]/; var RE_HEX_ESCAPE = /[\da-f]/i; module.exports = function tokenizer(input, options = {}) { let css = input.css.valueOf(); let ignore = options.ignoreErrors; let code, content, escape, next, quote; let currentToken, escaped, escapePos, n2, prev; let length = css.length; let pos = 0; let buffer = []; let returned = []; let lastBadParen = -1; function position() { return pos; } function unclosed(what) { throw input.error("Unclosed " + what, pos); } function endOfFile() { return returned.length === 0 && pos >= length; } function nextToken(opts) { if (returned.length) return returned.pop(); if (pos >= length) return; let ignoreUnclosed = opts ? opts.ignoreUnclosed : false; code = css.charCodeAt(pos); switch (code) { case NEWLINE: case SPACE3: case TAB5: case CR: case FEED: { next = pos; do { next += 1; code = css.charCodeAt(next); } while (code === SPACE3 || code === NEWLINE || code === TAB5 || code === CR || code === FEED); currentToken = ["space", css.slice(pos, next)]; pos = next - 1; break; } case OPEN_SQUARE: case CLOSE_SQUARE: case OPEN_CURLY: case CLOSE_CURLY: case COLON: case SEMICOLON: case CLOSE_PARENTHESES: { let controlChar = String.fromCharCode(code); currentToken = [controlChar, controlChar, pos]; break; } case OPEN_PARENTHESES: { prev = buffer.length ? buffer.pop()[1] : ""; n2 = css.charCodeAt(pos + 1); if (prev === "url" && n2 !== SINGLE_QUOTE && n2 !== DOUBLE_QUOTE && n2 !== SPACE3 && n2 !== NEWLINE && n2 !== TAB5 && n2 !== FEED && n2 !== CR) { next = pos; do { escaped = false; next = css.indexOf(")", next + 1); if (next === -1) { if (ignore || ignoreUnclosed) { next = pos; break; } else { unclosed("bracket"); } } escapePos = next; while (css.charCodeAt(escapePos - 1) === BACKSLASH) { escapePos -= 1; escaped = !escaped; } } while (escaped); currentToken = ["brackets", css.slice(pos, next + 1), pos, next]; pos = next; } else if (pos <= lastBadParen) { currentToken = ["(", "(", pos]; } else { next = css.indexOf(")", pos + 1); content = css.slice(pos, next + 1); if (next === -1 || RE_BAD_BRACKET.test(content)) { lastBadParen = next === -1 ? length : next; currentToken = ["(", "(", pos]; } else { currentToken = ["brackets", content, pos, next]; pos = next; } } break; } case SINGLE_QUOTE: case DOUBLE_QUOTE: { quote = code === SINGLE_QUOTE ? "'" : '"'; next = pos; do { escaped = false; next = css.indexOf(quote, next + 1); if (next === -1) { if (ignore || ignoreUnclosed) { next = pos + 1; break; } else { unclosed("string"); } } escapePos = next; while (css.charCodeAt(escapePos - 1) === BACKSLASH) { escapePos -= 1; escaped = !escaped; } } while (escaped); currentToken = ["string", css.slice(pos, next + 1), pos, next]; pos = next; break; } case AT: { RE_AT_END.lastIndex = pos + 1; RE_AT_END.test(css); if (RE_AT_END.lastIndex === 0) { next = css.length - 1; } else { next = RE_AT_END.lastIndex - 2; } currentToken = ["at-word", css.slice(pos, next + 1), pos, next]; pos = next; break; } case BACKSLASH: { next = pos; escape = true; while (css.charCodeAt(next + 1) === BACKSLASH) { next += 1; escape = !escape; } code = css.charCodeAt(next + 1); if (escape && code !== SLASH && code !== SPACE3 && code !== NEWLINE && code !== TAB5 && code !== CR && code !== FEED) { next += 1; if (RE_HEX_ESCAPE.test(css.charAt(next))) { while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { next += 1; } if (css.charCodeAt(next + 1) === SPACE3) { next += 1; } } } currentToken = ["word", css.slice(pos, next + 1), pos, next]; pos = next; break; } default: { if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { next = css.indexOf("*/", pos + 2) + 1; if (next === 0) { if (ignore || ignoreUnclosed) { next = css.length; } else { unclosed("comment"); } } currentToken = ["comment", css.slice(pos, next + 1), pos, next]; pos = next; } else { RE_WORD_END.lastIndex = pos + 1; RE_WORD_END.test(css); if (RE_WORD_END.lastIndex === 0) { next = css.length - 1; } else { next = RE_WORD_END.lastIndex - 2; } currentToken = ["word", css.slice(pos, next + 1), pos, next]; buffer.push(currentToken); pos = next; } break; } } pos++; return currentToken; } function back(token) { returned.push(token); } return { back, endOfFile, nextToken, position }; }; } }); // node_modules/postcss/lib/parser.js var require_parser = __commonJS({ "node_modules/postcss/lib/parser.js"(exports, module) { "use strict"; var AtRule = require_at_rule(); var Comment = require_comment(); var Declaration = require_declaration(); var Root8 = require_root(); var Rule = require_rule(); var tokenizer = require_tokenize(); var SAFE_COMMENT_NEIGHBOR = { empty: true, space: true }; function findLastWithPosition(tokens) { for (let i2 = tokens.length - 1; i2 >= 0; i2--) { let token = tokens[i2]; let pos = token[3] || token[2]; if (pos) return pos; } } function tokensToString(tokens, from, to2) { let result = ""; for (let i2 = from; i2 < to2; i2++) result += tokens[i2][1]; return result; } var Parser = class { constructor(input) { this.input = input; this.root = new Root8(); this.current = this.root; this.spaces = ""; this.semicolon = false; this.createTokenizer(); this.root.source = { input, start: { column: 1, line: 1, offset: 0 } }; } atrule(token) { let node = new AtRule(); node.name = token[1].slice(1); if (node.name === "") { this.unnamedAtrule(node, token); } this.init(node, token[2]); let type; let prev; let shift4; let last = false; let open = false; let params = []; let brackets = []; while (!this.tokenizer.endOfFile()) { token = this.tokenizer.nextToken(); type = token[0]; if (type === "(" || type === "[") { brackets.push(type === "(" ? ")" : "]"); } else if (type === "{" && brackets.length > 0) { brackets.push("}"); } else if (type === brackets[brackets.length - 1]) { brackets.pop(); } if (brackets.length === 0) { if (type === ";") { node.source.end = this.getPosition(token[2]); node.source.end.offset++; this.semicolon = true; break; } else if (type === "{") { open = true; break; } else if (type === "}") { if (params.length > 0) { shift4 = params.length - 1; prev = params[shift4]; while (prev && prev[0] === "space") { prev = params[--shift4]; } if (prev) { node.source.end = this.getPosition(prev[3] || prev[2]); node.source.end.offset++; } } this.end(token); break; } else { params.push(token); } } else { params.push(token); } if (this.tokenizer.endOfFile()) { last = true; break; } } node.raws.between = this.spacesAndCommentsFromEnd(params); if (params.length) { node.raws.afterName = this.spacesAndCommentsFromStart(params); this.raw(node, "params", params); if (last) { token = params[params.length - 1]; node.source.end = this.getPosition(token[3] || token[2]); node.source.end.offset++; this.spaces = node.raws.between; node.raws.between = ""; } } else { node.raws.afterName = ""; node.params = ""; } if (open) { node.nodes = []; this.current = node; } } checkMissedSemicolon(tokens) { let colon = this.colon(tokens); if (colon === false) return; let founded = 0; let token; for (let j2 = colon - 1; j2 >= 0; j2--) { token = tokens[j2]; if (token[0] !== "space") { founded += 1; if (founded === 2) break; } } throw this.input.error( "Missed semicolon", token[0] === "word" ? token[3] + 1 : token[2] ); } colon(tokens) { let brackets = 0; let prev, token, type; for (let [i2, element] of tokens.entries()) { token = element; type = token[0]; if (type === "(") { brackets += 1; } if (type === ")") { brackets -= 1; } if (brackets === 0 && type === ":") { if (!prev) { this.doubleColon(token); } else if (prev[0] === "word" && prev[1] === "progid") { continue; } else { return i2; } } prev = token; } return false; } comment(token) { let node = new Comment(); this.init(node, token[2]); node.source.end = this.getPosition(token[3] || token[2]); node.source.end.offset++; let text = token[1].slice(2, -2); if (!text.trim()) { node.text = ""; node.raws.left = text; node.raws.right = ""; } else { let match2 = text.match(/^(\s*)([^]*\S)(\s*)$/); node.text = match2[2]; node.raws.left = match2[1]; node.raws.right = match2[3]; } } createTokenizer() { this.tokenizer = tokenizer(this.input); } decl(tokens, customProperty) { let node = new Declaration(); this.init(node, tokens[0][2]); let last = tokens[tokens.length - 1]; if (last[0] === ";") { this.semicolon = true; tokens.pop(); } node.source.end = this.getPosition( last[3] || last[2] || findLastWithPosition(tokens) ); node.source.end.offset++; let start2 = 0; while (tokens[start2][0] !== "word") { if (start2 === tokens.length - 1) this.unknownWord([tokens[start2]]); start2++; } node.raws.before += tokensToString(tokens, 0, start2); node.source.start = this.getPosition(tokens[start2][2]); let propStart = start2; while (start2 < tokens.length) { let type = tokens[start2][0]; if (type === ":" || type === "space" || type === "comment") { break; } start2++; } node.prop = tokensToString(tokens, propStart, start2); let betweenStart = start2; let token; while (start2 < tokens.length) { token = tokens[start2]; start2++; if (token[0] === ":") break; if (token[0] === "word" && /\w/.test(token[1])) { this.unknownWord([token]); } } node.raws.between = tokensToString(tokens, betweenStart, start2); if (node.prop[0] === "_" || node.prop[0] === "*") { node.raws.before += node.prop[0]; node.prop = node.prop.slice(1); } let firstSpacesStart = start2; while (start2 < tokens.length) { let next = tokens[start2][0]; if (next !== "space" && next !== "comment") break; start2++; } let firstSpaces = tokens.slice(firstSpacesStart, start2); tokens = tokens.slice(start2); this.precheckMissedSemicolon(tokens); for (let i2 = tokens.length - 1; i2 >= 0; i2--) { token = tokens[i2]; if (token[1].toLowerCase() === "!important") { node.important = true; let string = this.stringFrom(tokens, i2); string = this.spacesFromEnd(tokens) + string; if (string !== " !important") node.raws.important = string; break; } else if (token[1].toLowerCase() === "important") { let cache = tokens.slice(0); let str = ""; for (let j2 = i2; j2 > 0; j2--) { let type = cache[j2][0]; if (str.trim().startsWith("!") && type !== "space") { break; } str = cache.pop()[1] + str; } if (str.trim().startsWith("!")) { node.important = true; node.raws.important = str; tokens = cache; } } if (token[0] !== "space" && token[0] !== "comment") { break; } } let hasWord = tokens.some((i2) => i2[0] !== "space" && i2[0] !== "comment"); if (hasWord) { node.raws.between += firstSpaces.map((i2) => i2[1]).join(""); firstSpaces = []; } this.raw(node, "value", firstSpaces.concat(tokens), customProperty); if (node.value.includes(":") && !customProperty) { this.checkMissedSemicolon(tokens); } } doubleColon(token) { throw this.input.error( "Double colon", { offset: token[2] }, { offset: token[2] + token[1].length } ); } emptyRule(token) { let node = new Rule(); this.init(node, token[2]); node.selector = ""; node.raws.between = ""; this.current = node; } end(token) { if (this.current.nodes && this.current.nodes.length) { this.current.raws.semicolon = this.semicolon; } this.semicolon = false; this.current.raws.after = (this.current.raws.after || "") + this.spaces; this.spaces = ""; if (this.current.parent) { this.current.source.end = this.getPosition(token[2]); this.current.source.end.offset++; this.current = this.current.parent; } else { this.unexpectedClose(token); } } endFile() { if (this.current.parent) this.unclosedBlock(); if (this.current.nodes && this.current.nodes.length) { this.current.raws.semicolon = this.semicolon; } this.current.raws.after = (this.current.raws.after || "") + this.spaces; this.root.source.end = this.getPosition(this.tokenizer.position()); } freeSemicolon(token) { this.spaces += token[1]; if (this.current.nodes) { let prev = this.current.nodes[this.current.nodes.length - 1]; if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) { prev.raws.ownSemicolon = this.spaces; this.spaces = ""; prev.source.end = this.getPosition(token[2]); prev.source.end.offset += prev.raws.ownSemicolon.length; } } } // Helpers getPosition(offset4) { let pos = this.input.fromOffset(offset4); return { column: pos.col, line: pos.line, offset: offset4 }; } init(node, offset4) { this.current.push(node); node.source = { input: this.input, start: this.getPosition(offset4) }; node.raws.before = this.spaces; this.spaces = ""; if (node.type !== "comment") this.semicolon = false; } other(start2) { let end = false; let type = null; let colon = false; let bracket = null; let brackets = []; let customProperty = start2[1].startsWith("--"); let tokens = []; let token = start2; while (token) { type = token[0]; tokens.push(token); if (type === "(" || type === "[") { if (!bracket) bracket = token; brackets.push(type === "(" ? ")" : "]"); } else if (customProperty && colon && type === "{") { if (!bracket) bracket = token; brackets.push("}"); } else if (brackets.length === 0) { if (type === ";") { if (colon) { this.decl(tokens, customProperty); return; } else { break; } } else if (type === "{") { this.rule(tokens); return; } else if (type === "}") { this.tokenizer.back(tokens.pop()); end = true; break; } else if (type === ":") { colon = true; } } else if (type === brackets[brackets.length - 1]) { brackets.pop(); if (brackets.length === 0) bracket = null; } token = this.tokenizer.nextToken(); } if (this.tokenizer.endOfFile()) end = true; if (brackets.length > 0) this.unclosedBracket(bracket); if (end && colon) { if (!customProperty) { while (tokens.length) { token = tokens[tokens.length - 1][0]; if (token !== "space" && token !== "comment") break; this.tokenizer.back(tokens.pop()); } } this.decl(tokens, customProperty); } else { this.unknownWord(tokens); } } parse() { let token; while (!this.tokenizer.endOfFile()) { token = this.tokenizer.nextToken(); switch (token[0]) { case "space": this.spaces += token[1]; break; case ";": this.freeSemicolon(token); break; case "}": this.end(token); break; case "comment": this.comment(token); break; case "at-word": this.atrule(token); break; case "{": this.emptyRule(token); break; default: this.other(token); break; } } this.endFile(); } precheckMissedSemicolon() { } raw(node, prop, tokens, customProperty) { let token, type; let length = tokens.length; let value = ""; let clean = true; let next, prev; for (let i2 = 0; i2 < length; i2 += 1) { token = tokens[i2]; type = token[0]; if (type === "space" && i2 === length - 1 && !customProperty) { clean = false; } else if (type === "comment") { prev = tokens[i2 - 1] ? tokens[i2 - 1][0] : "empty"; next = tokens[i2 + 1] ? tokens[i2 + 1][0] : "empty"; if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { if (value.slice(-1) === ",") { clean = false; } else { value += token[1]; } } else { clean = false; } } else { value += token[1]; } } if (!clean) { let raw = tokens.reduce((all, i2) => all + i2[1], ""); node.raws[prop] = { raw, value }; } node[prop] = value; } rule(tokens) { tokens.pop(); let node = new Rule(); this.init(node, tokens[0][2]); node.raws.between = this.spacesAndCommentsFromEnd(tokens); this.raw(node, "selector", tokens); this.current = node; } spacesAndCommentsFromEnd(tokens) { let lastTokenType; let spaces = ""; while (tokens.length) { lastTokenType = tokens[tokens.length - 1][0]; if (lastTokenType !== "space" && lastTokenType !== "comment") break; spaces = tokens.pop()[1] + spaces; } return spaces; } // Errors spacesAndCommentsFromStart(tokens) { let next; let spaces = ""; while (tokens.length) { next = tokens[0][0]; if (next !== "space" && next !== "comment") break; spaces += tokens.shift()[1]; } return spaces; } spacesFromEnd(tokens) { let lastTokenType; let spaces = ""; while (tokens.length) { lastTokenType = tokens[tokens.length - 1][0]; if (lastTokenType !== "space") break; spaces = tokens.pop()[1] + spaces; } return spaces; } stringFrom(tokens, from) { let result = ""; for (let i2 = from; i2 < tokens.length; i2++) { result += tokens[i2][1]; } tokens.splice(from, tokens.length - from); return result; } unclosedBlock() { let pos = this.current.source.start; throw this.input.error("Unclosed block", pos.line, pos.column); } unclosedBracket(bracket) { throw this.input.error( "Unclosed bracket", { offset: bracket[2] }, { offset: bracket[2] + 1 } ); } unexpectedClose(token) { throw this.input.error( "Unexpected }", { offset: token[2] }, { offset: token[2] + 1 } ); } unknownWord(tokens) { throw this.input.error( "Unknown word " + tokens[0][1], { offset: tokens[0][2] }, { offset: tokens[0][2] + tokens[0][1].length } ); } unnamedAtrule(node, token) { throw this.input.error( "At-rule without name", { offset: token[2] }, { offset: token[2] + token[1].length } ); } }; module.exports = Parser; } }); // node_modules/postcss/lib/parse.js var require_parse = __commonJS({ "node_modules/postcss/lib/parse.js"(exports, module) { "use strict"; var Container = require_container(); var Input = require_input(); var Parser = require_parser(); function parse4(css, opts) { let input = new Input(css, opts); let parser = new Parser(input); try { parser.parse(); } catch (e2) { if (true) { if (e2.name === "CssSyntaxError" && opts && opts.from) { if (/\.scss$/i.test(opts.from)) { e2.message += "\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser"; } else if (/\.sass/i.test(opts.from)) { e2.message += "\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser"; } else if (/\.less$/i.test(opts.from)) { e2.message += "\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser"; } } } throw e2; } return parser.root; } module.exports = parse4; parse4.default = parse4; Container.registerParse(parse4); } }); // node_modules/postcss/lib/warning.js var require_warning2 = __commonJS({ "node_modules/postcss/lib/warning.js"(exports, module) { "use strict"; var Warning2 = class { constructor(text, opts = {}) { this.type = "warning"; this.text = text; if (opts.node && opts.node.source) { let range2 = opts.node.rangeBy(opts); this.line = range2.start.line; this.column = range2.start.column; this.endLine = range2.end.line; this.endColumn = range2.end.column; } for (let opt in opts) this[opt] = opts[opt]; } toString() { if (this.node) { return this.node.error(this.text, { index: this.index, plugin: this.plugin, word: this.word }).message; } if (this.plugin) { return this.plugin + ": " + this.text; } return this.text; } }; module.exports = Warning2; Warning2.default = Warning2; } }); // node_modules/postcss/lib/result.js var require_result = __commonJS({ "node_modules/postcss/lib/result.js"(exports, module) { "use strict"; var Warning2 = require_warning2(); var Result = class { get content() { return this.css; } constructor(processor, root, opts) { this.processor = processor; this.messages = []; this.root = root; this.opts = opts; this.css = ""; this.map = void 0; } toString() { return this.css; } warn(text, opts = {}) { if (!opts.plugin) { if (this.lastPlugin && this.lastPlugin.postcssPlugin) { opts.plugin = this.lastPlugin.postcssPlugin; } } let warning6 = new Warning2(text, opts); this.messages.push(warning6); return warning6; } warnings() { return this.messages.filter((i2) => i2.type === "warning"); } }; module.exports = Result; Result.default = Result; } }); // node_modules/postcss/lib/warn-once.js var require_warn_once = __commonJS({ "node_modules/postcss/lib/warn-once.js"(exports, module) { "use strict"; var printed = {}; module.exports = function warnOnce(message2) { if (printed[message2]) return; printed[message2] = true; if (typeof console !== "undefined" && console.warn) { console.warn(message2); } }; } }); // node_modules/postcss/lib/lazy-result.js var require_lazy_result = __commonJS({ "node_modules/postcss/lib/lazy-result.js"(exports, module) { "use strict"; var Container = require_container(); var Document = require_document(); var MapGenerator = require_map_generator(); var parse4 = require_parse(); var Result = require_result(); var Root8 = require_root(); var stringify2 = require_stringify(); var { isClean, my } = require_symbols(); var warnOnce = require_warn_once(); var TYPE_TO_CLASS_NAME = { atrule: "AtRule", comment: "Comment", decl: "Declaration", document: "Document", root: "Root", rule: "Rule" }; var PLUGIN_PROPS = { AtRule: true, AtRuleExit: true, Comment: true, CommentExit: true, Declaration: true, DeclarationExit: true, Document: true, DocumentExit: true, Once: true, OnceExit: true, postcssPlugin: true, prepare: true, Root: true, RootExit: true, Rule: true, RuleExit: true }; var NOT_VISITORS = { Once: true, postcssPlugin: true, prepare: true }; var CHILDREN = 0; function isPromise(obj) { return typeof obj === "object" && typeof obj.then === "function"; } function getEvents(node) { let key = false; let type = TYPE_TO_CLASS_NAME[node.type]; if (node.type === "decl") { key = node.prop.toLowerCase(); } else if (node.type === "atrule") { key = node.name.toLowerCase(); } if (key && node.append) { return [ type, type + "-" + key, CHILDREN, type + "Exit", type + "Exit-" + key ]; } else if (key) { return [type, type + "-" + key, type + "Exit", type + "Exit-" + key]; } else if (node.append) { return [type, CHILDREN, type + "Exit"]; } else { return [type, type + "Exit"]; } } function toStack(node) { let events; if (node.type === "document") { events = ["Document", CHILDREN, "DocumentExit"]; } else if (node.type === "root") { events = ["Root", CHILDREN, "RootExit"]; } else { events = getEvents(node); } return { eventIndex: 0, events, iterator: 0, node, visitorIndex: 0, visitors: [] }; } function cleanMarks(node) { node[isClean] = false; if (node.nodes) node.nodes.forEach((i2) => cleanMarks(i2)); return node; } var postcss = {}; var LazyResult = class _LazyResult { get content() { return this.stringify().content; } get css() { return this.stringify().css; } get map() { return this.stringify().map; } get messages() { return this.sync().messages; } get opts() { return this.result.opts; } get processor() { return this.result.processor; } get root() { return this.sync().root; } get [Symbol.toStringTag]() { return "LazyResult"; } constructor(processor, css, opts) { this.stringified = false; this.processed = false; let root; if (typeof css === "object" && css !== null && (css.type === "root" || css.type === "document")) { root = cleanMarks(css); } else if (css instanceof _LazyResult || css instanceof Result) { root = cleanMarks(css.root); if (css.map) { if (typeof opts.map === "undefined") opts.map = {}; if (!opts.map.inline) opts.map.inline = false; opts.map.prev = css.map; } } else { let parser = parse4; if (opts.syntax) parser = opts.syntax.parse; if (opts.parser) parser = opts.parser; if (parser.parse) parser = parser.parse; try { root = parser(css, opts); } catch (error2) { this.processed = true; this.error = error2; } if (root && !root[my]) { Container.rebuild(root); } } this.result = new Result(processor, root, opts); this.helpers = { ...postcss, postcss, result: this.result }; this.plugins = this.processor.plugins.map((plugin) => { if (typeof plugin === "object" && plugin.prepare) { return { ...plugin, ...plugin.prepare(this.result) }; } else { return plugin; } }); } async() { if (this.error) return Promise.reject(this.error); if (this.processed) return Promise.resolve(this.result); if (!this.processing) { this.processing = this.runAsync(); } return this.processing; } catch(onRejected) { return this.async().catch(onRejected); } finally(onFinally) { return this.async().then(onFinally, onFinally); } getAsyncError() { throw new Error("Use process(css).then(cb) to work with async plugins"); } handleError(error2, node) { let plugin = this.result.lastPlugin; try { if (node) node.addToError(error2); this.error = error2; if (error2.name === "CssSyntaxError" && !error2.plugin) { error2.plugin = plugin.postcssPlugin; error2.setMessage(); } else if (plugin.postcssVersion) { if (true) { let pluginName = plugin.postcssPlugin; let pluginVer = plugin.postcssVersion; let runtimeVer = this.result.processor.version; let a2 = pluginVer.split("."); let b2 = runtimeVer.split("."); if (a2[0] !== b2[0] || parseInt(a2[1]) > parseInt(b2[1])) { console.error( "Unknown error from PostCSS plugin. Your current PostCSS version is " + runtimeVer + ", but " + pluginName + " uses " + pluginVer + ". Perhaps this is the source of the error below." ); } } } } catch (err) { if (console && console.error) console.error(err); } return error2; } prepareVisitors() { this.listeners = {}; let add2 = (plugin, type, cb) => { if (!this.listeners[type]) this.listeners[type] = []; this.listeners[type].push([plugin, cb]); }; for (let plugin of this.plugins) { if (typeof plugin === "object") { for (let event in plugin) { if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { throw new Error( `Unknown event ${event} in ${plugin.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).` ); } if (!NOT_VISITORS[event]) { if (typeof plugin[event] === "object") { for (let filter in plugin[event]) { if (filter === "*") { add2(plugin, event, plugin[event][filter]); } else { add2( plugin, event + "-" + filter.toLowerCase(), plugin[event][filter] ); } } } else if (typeof plugin[event] === "function") { add2(plugin, event, plugin[event]); } } } } } this.hasListener = Object.keys(this.listeners).length > 0; } async runAsync() { this.plugin = 0; for (let i2 = 0; i2 < this.plugins.length; i2++) { let plugin = this.plugins[i2]; let promise = this.runOnRoot(plugin); if (isPromise(promise)) { try { await promise; } catch (error2) { throw this.handleError(error2); } } } this.prepareVisitors(); if (this.hasListener) { let root = this.result.root; while (!root[isClean]) { root[isClean] = true; let stack = [toStack(root)]; while (stack.length > 0) { let promise = this.visitTick(stack); if (isPromise(promise)) { try { await promise; } catch (e2) { let node = stack[stack.length - 1].node; throw this.handleError(e2, node); } } } } if (this.listeners.OnceExit) { for (let [plugin, visitor] of this.listeners.OnceExit) { this.result.lastPlugin = plugin; try { if (root.type === "document") { let roots = root.nodes.map( (subRoot) => visitor(subRoot, this.helpers) ); await Promise.all(roots); } else { await visitor(root, this.helpers); } } catch (e2) { throw this.handleError(e2); } } } } this.processed = true; return this.stringify(); } runOnRoot(plugin) { this.result.lastPlugin = plugin; try { if (typeof plugin === "object" && plugin.Once) { if (this.result.root.type === "document") { let roots = this.result.root.nodes.map( (root) => plugin.Once(root, this.helpers) ); if (isPromise(roots[0])) { return Promise.all(roots); } return roots; } return plugin.Once(this.result.root, this.helpers); } else if (typeof plugin === "function") { return plugin(this.result.root, this.result); } } catch (error2) { throw this.handleError(error2); } } stringify() { if (this.error) throw this.error; if (this.stringified) return this.result; this.stringified = true; this.sync(); let opts = this.result.opts; let str = stringify2; if (opts.syntax) str = opts.syntax.stringify; if (opts.stringifier) str = opts.stringifier; if (str.stringify) str = str.stringify; let rootSource = this.result.root.source; if (opts.map === void 0 && !(rootSource && rootSource.input && rootSource.input.map)) { let result = ""; str(this.result.root, (i2) => { result += i2; }); this.result.css = result; return this.result; } let map = new MapGenerator(str, this.result.root, this.result.opts); let data = map.generate(); this.result.css = data[0]; this.result.map = data[1]; return this.result; } sync() { if (this.error) throw this.error; if (this.processed) return this.result; this.processed = true; if (this.processing) { throw this.getAsyncError(); } for (let plugin of this.plugins) { let promise = this.runOnRoot(plugin); if (isPromise(promise)) { throw this.getAsyncError(); } } this.prepareVisitors(); if (this.hasListener) { let root = this.result.root; while (!root[isClean]) { root[isClean] = true; this.walkSync(root); } if (this.listeners.OnceExit) { if (root.type === "document") { for (let subRoot of root.nodes) { this.visitSync(this.listeners.OnceExit, subRoot); } } else { this.visitSync(this.listeners.OnceExit, root); } } } return this.result; } then(onFulfilled, onRejected) { if (true) { if (!("from" in this.opts)) { warnOnce( "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning." ); } } return this.async().then(onFulfilled, onRejected); } toString() { return this.css; } visitSync(visitors, node) { for (let [plugin, visitor] of visitors) { this.result.lastPlugin = plugin; let promise; try { promise = visitor(node, this.helpers); } catch (e2) { throw this.handleError(e2, node.proxyOf); } if (node.type !== "root" && node.type !== "document" && !node.parent) { return true; } if (isPromise(promise)) { throw this.getAsyncError(); } } } visitTick(stack) { let visit = stack[stack.length - 1]; let { node, visitors } = visit; if (node.type !== "root" && node.type !== "document" && !node.parent) { stack.pop(); return; } if (visitors.length > 0 && visit.visitorIndex < visitors.length) { let [plugin, visitor] = visitors[visit.visitorIndex]; visit.visitorIndex += 1; if (visit.visitorIndex === visitors.length) { visit.visitors = []; visit.visitorIndex = 0; } this.result.lastPlugin = plugin; try { return visitor(node.toProxy(), this.helpers); } catch (e2) { throw this.handleError(e2, node); } } if (visit.iterator !== 0) { let iterator = visit.iterator; let child; while (child = node.nodes[node.indexes[iterator]]) { node.indexes[iterator] += 1; if (!child[isClean]) { child[isClean] = true; stack.push(toStack(child)); return; } } visit.iterator = 0; delete node.indexes[iterator]; } let events = visit.events; while (visit.eventIndex < events.length) { let event = events[visit.eventIndex]; visit.eventIndex += 1; if (event === CHILDREN) { if (node.nodes && node.nodes.length) { node[isClean] = true; visit.iterator = node.getIterator(); } return; } else if (this.listeners[event]) { visit.visitors = this.listeners[event]; return; } } stack.pop(); } walkSync(node) { node[isClean] = true; let events = getEvents(node); for (let event of events) { if (event === CHILDREN) { if (node.nodes) { node.each((child) => { if (!child[isClean]) this.walkSync(child); }); } } else { let visitors = this.listeners[event]; if (visitors) { if (this.visitSync(visitors, node.toProxy())) return; } } } } warnings() { return this.sync().warnings(); } }; LazyResult.registerPostcss = (dependant) => { postcss = dependant; }; module.exports = LazyResult; LazyResult.default = LazyResult; Root8.registerLazyResult(LazyResult); Document.registerLazyResult(LazyResult); } }); // node_modules/postcss/lib/no-work-result.js var require_no_work_result = __commonJS({ "node_modules/postcss/lib/no-work-result.js"(exports, module) { "use strict"; var MapGenerator = require_map_generator(); var parse4 = require_parse(); var Result = require_result(); var stringify2 = require_stringify(); var warnOnce = require_warn_once(); var NoWorkResult = class { get content() { return this.result.css; } get css() { return this.result.css; } get map() { return this.result.map; } get messages() { return []; } get opts() { return this.result.opts; } get processor() { return this.result.processor; } get root() { if (this._root) { return this._root; } let root; let parser = parse4; try { root = parser(this._css, this._opts); } catch (error2) { this.error = error2; } if (this.error) { throw this.error; } else { this._root = root; return root; } } get [Symbol.toStringTag]() { return "NoWorkResult"; } constructor(processor, css, opts) { css = css.toString(); this.stringified = false; this._processor = processor; this._css = css; this._opts = opts; this._map = void 0; let str = stringify2; this.result = new Result(this._processor, void 0, this._opts); this.result.css = css; let self = this; Object.defineProperty(this.result, "root", { get() { return self.root; } }); let map = new MapGenerator(str, void 0, this._opts, css); if (map.isMap()) { let [generatedCSS, generatedMap] = map.generate(); if (generatedCSS) { this.result.css = generatedCSS; } if (generatedMap) { this.result.map = generatedMap; } } else { map.clearAnnotation(); this.result.css = map.css; } } async() { if (this.error) return Promise.reject(this.error); return Promise.resolve(this.result); } catch(onRejected) { return this.async().catch(onRejected); } finally(onFinally) { return this.async().then(onFinally, onFinally); } sync() { if (this.error) throw this.error; return this.result; } then(onFulfilled, onRejected) { if (true) { if (!("from" in this._opts)) { warnOnce( "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning." ); } } return this.async().then(onFulfilled, onRejected); } toString() { return this._css; } warnings() { return []; } }; module.exports = NoWorkResult; NoWorkResult.default = NoWorkResult; } }); // node_modules/postcss/lib/processor.js var require_processor = __commonJS({ "node_modules/postcss/lib/processor.js"(exports, module) { "use strict"; var Document = require_document(); var LazyResult = require_lazy_result(); var NoWorkResult = require_no_work_result(); var Root8 = require_root(); var Processor2 = class { constructor(plugins = []) { this.version = "8.5.16"; this.plugins = this.normalize(plugins); } normalize(plugins) { let normalized = []; for (let i2 of plugins) { if (i2.postcss === true) { i2 = i2(); } else if (i2.postcss) { i2 = i2.postcss; } if (typeof i2 === "object" && Array.isArray(i2.plugins)) { normalized = normalized.concat(i2.plugins); } else if (typeof i2 === "object" && i2.postcssPlugin) { normalized.push(i2); } else if (typeof i2 === "function") { normalized.push(i2); } else if (typeof i2 === "object" && (i2.parse || i2.stringify)) { if (true) { throw new Error( "PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation." ); } } else { throw new Error(i2 + " is not a PostCSS plugin"); } } return normalized; } process(css, opts = {}) { if (!this.plugins.length && !opts.parser && !opts.stringifier && !opts.syntax) { return new NoWorkResult(this, css, opts); } else { return new LazyResult(this, css, opts); } } use(plugin) { this.plugins = this.plugins.concat(this.normalize([plugin])); return this; } }; module.exports = Processor2; Processor2.default = Processor2; Root8.registerProcessor(Processor2); Document.registerProcessor(Processor2); } }); // node_modules/postcss-prefix-selector/index.js var require_postcss_prefix_selector = __commonJS({ "node_modules/postcss-prefix-selector/index.js"(exports, module) { module.exports = function postcssPrefixSelector(options) { const prefix2 = options.prefix; const prefixWithSpace = /\s+$/.test(prefix2) ? prefix2 : `${prefix2} `; const ignoreFiles = options.ignoreFiles ? [].concat(options.ignoreFiles) : []; const includeFiles = options.includeFiles ? [].concat(options.includeFiles) : []; return function(root) { if (ignoreFiles.length && root.source.input.file && isFileInArray(root.source.input.file, ignoreFiles)) { return; } if (includeFiles.length && root.source.input.file && !isFileInArray(root.source.input.file, includeFiles)) { return; } root.walkRules((rule) => { const keyframeRules = [ "keyframes", "-webkit-keyframes", "-moz-keyframes", "-o-keyframes", "-ms-keyframes" ]; if (rule.parent && keyframeRules.includes(rule.parent.name)) { return; } rule.selectors = rule.selectors.map((selector3) => { if (options.exclude && excludeSelector(selector3, options.exclude)) { return selector3; } if (options.transform) { return options.transform( prefix2, selector3, prefixWithSpace + selector3, root.source.input.file, rule ); } return prefixWithSpace + selector3; }); }); }; }; function isFileInArray(file, arr) { return arr.some((ruleOrString) => { if (ruleOrString instanceof RegExp) { return ruleOrString.test(file); } return file.includes(ruleOrString); }); } function excludeSelector(selector3, excludeArr) { return excludeArr.some((excludeRule) => { if (excludeRule instanceof RegExp) { return excludeRule.test(selector3); } return selector3 === excludeRule; }); } } }); // node_modules/postcss-value-parser/lib/parse.js var require_parse2 = __commonJS({ "node_modules/postcss-value-parser/lib/parse.js"(exports, module) { var openParentheses = "(".charCodeAt(0); var closeParentheses = ")".charCodeAt(0); var singleQuote = "'".charCodeAt(0); var doubleQuote = '"'.charCodeAt(0); var backslash = "\\".charCodeAt(0); var slash = "/".charCodeAt(0); var comma = ",".charCodeAt(0); var colon = ":".charCodeAt(0); var star = "*".charCodeAt(0); var uLower = "u".charCodeAt(0); var uUpper = "U".charCodeAt(0); var plus = "+".charCodeAt(0); var isUnicodeRange = /^[a-f0-9?-]+$/i; module.exports = function(input) { var tokens = []; var value = input; var next, quote, prev, token, escape, escapePos, whitespacePos, parenthesesOpenPos; var pos = 0; var code = value.charCodeAt(pos); var max2 = value.length; var stack = [{ nodes: tokens }]; var balanced = 0; var parent; var name = ""; var before = ""; var after = ""; while (pos < max2) { if (code <= 32) { next = pos; do { next += 1; code = value.charCodeAt(next); } while (code <= 32); token = value.slice(pos, next); prev = tokens[tokens.length - 1]; if (code === closeParentheses && balanced) { after = token; } else if (prev && prev.type === "div") { prev.after = token; prev.sourceEndIndex += token.length; } else if (code === comma || code === colon || code === slash && value.charCodeAt(next + 1) !== star && (!parent || parent && parent.type === "function" && parent.value !== "calc")) { before = token; } else { tokens.push({ type: "space", sourceIndex: pos, sourceEndIndex: next, value: token }); } pos = next; } else if (code === singleQuote || code === doubleQuote) { next = pos; quote = code === singleQuote ? "'" : '"'; token = { type: "string", sourceIndex: pos, quote }; do { escape = false; next = value.indexOf(quote, next + 1); if (~next) { escapePos = next; while (value.charCodeAt(escapePos - 1) === backslash) { escapePos -= 1; escape = !escape; } } else { value += quote; next = value.length - 1; token.unclosed = true; } } while (escape); token.value = value.slice(pos + 1, next); token.sourceEndIndex = token.unclosed ? next : next + 1; tokens.push(token); pos = next + 1; code = value.charCodeAt(pos); } else if (code === slash && value.charCodeAt(pos + 1) === star) { next = value.indexOf("*/", pos); token = { type: "comment", sourceIndex: pos, sourceEndIndex: next + 2 }; if (next === -1) { token.unclosed = true; next = value.length; token.sourceEndIndex = next; } token.value = value.slice(pos + 2, next); tokens.push(token); pos = next + 2; code = value.charCodeAt(pos); } else if ((code === slash || code === star) && parent && parent.type === "function" && parent.value === "calc") { token = value[pos]; tokens.push({ type: "word", sourceIndex: pos - before.length, sourceEndIndex: pos + token.length, value: token }); pos += 1; code = value.charCodeAt(pos); } else if (code === slash || code === comma || code === colon) { token = value[pos]; tokens.push({ type: "div", sourceIndex: pos - before.length, sourceEndIndex: pos + token.length, value: token, before, after: "" }); before = ""; pos += 1; code = value.charCodeAt(pos); } else if (openParentheses === code) { next = pos; do { next += 1; code = value.charCodeAt(next); } while (code <= 32); parenthesesOpenPos = pos; token = { type: "function", sourceIndex: pos - name.length, value: name, before: value.slice(parenthesesOpenPos + 1, next) }; pos = next; if (name === "url" && code !== singleQuote && code !== doubleQuote) { next -= 1; do { escape = false; next = value.indexOf(")", next + 1); if (~next) { escapePos = next; while (value.charCodeAt(escapePos - 1) === backslash) { escapePos -= 1; escape = !escape; } } else { value += ")"; next = value.length - 1; token.unclosed = true; } } while (escape); whitespacePos = next; do { whitespacePos -= 1; code = value.charCodeAt(whitespacePos); } while (code <= 32); if (parenthesesOpenPos < whitespacePos) { if (pos !== whitespacePos + 1) { token.nodes = [ { type: "word", sourceIndex: pos, sourceEndIndex: whitespacePos + 1, value: value.slice(pos, whitespacePos + 1) } ]; } else { token.nodes = []; } if (token.unclosed && whitespacePos + 1 !== next) { token.after = ""; token.nodes.push({ type: "space", sourceIndex: whitespacePos + 1, sourceEndIndex: next, value: value.slice(whitespacePos + 1, next) }); } else { token.after = value.slice(whitespacePos + 1, next); token.sourceEndIndex = next; } } else { token.after = ""; token.nodes = []; } pos = next + 1; token.sourceEndIndex = token.unclosed ? next : pos; code = value.charCodeAt(pos); tokens.push(token); } else { balanced += 1; token.after = ""; token.sourceEndIndex = pos + 1; tokens.push(token); stack.push(token); tokens = token.nodes = []; parent = token; } name = ""; } else if (closeParentheses === code && balanced) { pos += 1; code = value.charCodeAt(pos); parent.after = after; parent.sourceEndIndex += after.length; after = ""; balanced -= 1; stack[stack.length - 1].sourceEndIndex = pos; stack.pop(); parent = stack[balanced]; tokens = parent.nodes; } else { next = pos; do { if (code === backslash) { next += 1; } next += 1; code = value.charCodeAt(next); } while (next < max2 && !(code <= 32 || code === singleQuote || code === doubleQuote || code === comma || code === colon || code === slash || code === openParentheses || code === star && parent && parent.type === "function" && parent.value === "calc" || code === slash && parent.type === "function" && parent.value === "calc" || code === closeParentheses && balanced)); token = value.slice(pos, next); if (openParentheses === code) { name = token; } else if ((uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && plus === token.charCodeAt(1) && isUnicodeRange.test(token.slice(2))) { tokens.push({ type: "unicode-range", sourceIndex: pos, sourceEndIndex: next, value: token }); } else { tokens.push({ type: "word", sourceIndex: pos, sourceEndIndex: next, value: token }); } pos = next; } } for (pos = stack.length - 1; pos; pos -= 1) { stack[pos].unclosed = true; stack[pos].sourceEndIndex = value.length; } return stack[0].nodes; }; } }); // node_modules/postcss-value-parser/lib/walk.js var require_walk = __commonJS({ "node_modules/postcss-value-parser/lib/walk.js"(exports, module) { module.exports = function walk(nodes, cb, bubble) { var i2, max2, node, result; for (i2 = 0, max2 = nodes.length; i2 < max2; i2 += 1) { node = nodes[i2]; if (!bubble) { result = cb(node, i2, nodes); } if (result !== false && node.type === "function" && Array.isArray(node.nodes)) { walk(node.nodes, cb, bubble); } if (bubble) { cb(node, i2, nodes); } } }; } }); // node_modules/postcss-value-parser/lib/stringify.js var require_stringify2 = __commonJS({ "node_modules/postcss-value-parser/lib/stringify.js"(exports, module) { function stringifyNode(node, custom) { var type = node.type; var value = node.value; var buf; var customResult; if (custom && (customResult = custom(node)) !== void 0) { return customResult; } else if (type === "word" || type === "space") { return value; } else if (type === "string") { buf = node.quote || ""; return buf + value + (node.unclosed ? "" : buf); } else if (type === "comment") { return "/*" + value + (node.unclosed ? "" : "*/"); } else if (type === "div") { return (node.before || "") + value + (node.after || ""); } else if (Array.isArray(node.nodes)) { buf = stringify2(node.nodes, custom); if (type !== "function") { return buf; } return value + "(" + (node.before || "") + buf + (node.after || "") + (node.unclosed ? "" : ")"); } return value; } function stringify2(nodes, custom) { var result, i2; if (Array.isArray(nodes)) { result = ""; for (i2 = nodes.length - 1; ~i2; i2 -= 1) { result = stringifyNode(nodes[i2], custom) + result; } return result; } return stringifyNode(nodes, custom); } module.exports = stringify2; } }); // node_modules/postcss-value-parser/lib/unit.js var require_unit = __commonJS({ "node_modules/postcss-value-parser/lib/unit.js"(exports, module) { var minus = "-".charCodeAt(0); var plus = "+".charCodeAt(0); var dot = ".".charCodeAt(0); var exp = "e".charCodeAt(0); var EXP = "E".charCodeAt(0); function likeNumber(value) { var code = value.charCodeAt(0); var nextCode; if (code === plus || code === minus) { nextCode = value.charCodeAt(1); if (nextCode >= 48 && nextCode <= 57) { return true; } var nextNextCode = value.charCodeAt(2); if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) { return true; } return false; } if (code === dot) { nextCode = value.charCodeAt(1); if (nextCode >= 48 && nextCode <= 57) { return true; } return false; } if (code >= 48 && code <= 57) { return true; } return false; } module.exports = function(value) { var pos = 0; var length = value.length; var code; var nextCode; var nextNextCode; if (length === 0 || !likeNumber(value)) { return false; } code = value.charCodeAt(pos); if (code === plus || code === minus) { pos++; } while (pos < length) { code = value.charCodeAt(pos); if (code < 48 || code > 57) { break; } pos += 1; } code = value.charCodeAt(pos); nextCode = value.charCodeAt(pos + 1); if (code === dot && nextCode >= 48 && nextCode <= 57) { pos += 2; while (pos < length) { code = value.charCodeAt(pos); if (code < 48 || code > 57) { break; } pos += 1; } } code = value.charCodeAt(pos); nextCode = value.charCodeAt(pos + 1); nextNextCode = value.charCodeAt(pos + 2); if ((code === exp || code === EXP) && (nextCode >= 48 && nextCode <= 57 || (nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57)) { pos += nextCode === plus || nextCode === minus ? 3 : 2; while (pos < length) { code = value.charCodeAt(pos); if (code < 48 || code > 57) { break; } pos += 1; } } return { number: value.slice(0, pos), unit: value.slice(pos) }; }; } }); // node_modules/postcss-value-parser/lib/index.js var require_lib2 = __commonJS({ "node_modules/postcss-value-parser/lib/index.js"(exports, module) { var parse4 = require_parse2(); var walk = require_walk(); var stringify2 = require_stringify2(); function ValueParser(value) { if (this instanceof ValueParser) { this.nodes = parse4(value); return this; } return new ValueParser(value); } ValueParser.prototype.toString = function() { return Array.isArray(this.nodes) ? stringify2(this.nodes) : ""; }; ValueParser.prototype.walk = function(cb, bubble) { walk(this.nodes, cb, bubble); return this; }; ValueParser.unit = require_unit(); ValueParser.walk = walk; ValueParser.stringify = stringify2; module.exports = ValueParser; } }); // packages/block-editor/node_modules/postcss-urlrebase/index.js var require_postcss_urlrebase = __commonJS({ "packages/block-editor/node_modules/postcss-urlrebase/index.js"(exports, module) { var CSSValueParser = require_lib2(); module.exports = (opts) => { const DEFAULTS = { skipHostRelativeUrls: true }; const config2 = Object.assign(DEFAULTS, opts); return { postcssPlugin: "rebaseUrl", Declaration(decl) { const parsedValue = CSSValueParser(decl.value); let valueChanged = false; parsedValue.walk((node) => { if (node.type !== "function" || node.value !== "url") { return; } const urlVal = node.nodes[0].value; const basedUrl = new URL(urlVal, opts.rootUrl); if (basedUrl.pathname === urlVal && config2.skipHostRelativeUrls) { return false; } node.nodes[0].value = basedUrl.toString(); valueChanged = true; return false; }); if (valueChanged) { decl.value = CSSValueParser.stringify(parsedValue); } } }; }; module.exports.postcss = true; } }); // package-external:@wordpress/priority-queue var require_priority_queue = __commonJS({ "package-external:@wordpress/priority-queue"(exports, module) { module.exports = window.wp.priorityQueue; } }); // package-external:@wordpress/blob var require_blob = __commonJS({ "package-external:@wordpress/blob"(exports, module) { module.exports = window.wp.blob; } }); // package-external:@wordpress/is-shallow-equal var require_is_shallow_equal = __commonJS({ "package-external:@wordpress/is-shallow-equal"(exports, module) { module.exports = window.wp.isShallowEqual; } }); // package-external:@wordpress/token-list var require_token_list = __commonJS({ "package-external:@wordpress/token-list"(exports, module) { module.exports = window.wp.tokenList; } }); // package-external:@wordpress/commands var require_commands = __commonJS({ "package-external:@wordpress/commands"(exports, module) { module.exports = window.wp.commands; } }); // package-external:@wordpress/date var require_date = __commonJS({ "package-external:@wordpress/date"(exports, module) { module.exports = window.wp.date; } }); // node_modules/normalize-wheel/src/UserAgent_DEPRECATED.js var require_UserAgent_DEPRECATED = __commonJS({ "node_modules/normalize-wheel/src/UserAgent_DEPRECATED.js"(exports, module) { var _populated = false; var _ie; var _firefox; var _opera; var _webkit; var _chrome; var _ie_real_version; var _osx; var _windows; var _linux; var _android; var _win64; var _iphone; var _ipad; var _native; var _mobile; function _populate() { if (_populated) { return; } _populated = true; var uas = navigator.userAgent; var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas); var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas); _iphone = /\b(iPhone|iP[ao]d)/.exec(uas); _ipad = /\b(iP[ao]d)/.exec(uas); _android = /Android/i.exec(uas); _native = /FBAN\/\w+;/i.exec(uas); _mobile = /Mobile/i.exec(uas); _win64 = !!/Win64/.exec(uas); if (agent) { _ie = agent[1] ? parseFloat(agent[1]) : agent[5] ? parseFloat(agent[5]) : NaN; if (_ie && document && document.documentMode) { _ie = document.documentMode; } var trident = /(?:Trident\/(\d+.\d+))/.exec(uas); _ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie; _firefox = agent[2] ? parseFloat(agent[2]) : NaN; _opera = agent[3] ? parseFloat(agent[3]) : NaN; _webkit = agent[4] ? parseFloat(agent[4]) : NaN; if (_webkit) { agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas); _chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN; } else { _chrome = NaN; } } else { _ie = _firefox = _opera = _chrome = _webkit = NaN; } if (os) { if (os[1]) { var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas); _osx = ver ? parseFloat(ver[1].replace("_", ".")) : true; } else { _osx = false; } _windows = !!os[2]; _linux = !!os[3]; } else { _osx = _windows = _linux = false; } } var UserAgent_DEPRECATED = { /** * Check if the UA is Internet Explorer. * * * @return float|NaN Version number (if match) or NaN. */ ie: function() { return _populate() || _ie; }, /** * Check if we're in Internet Explorer compatibility mode. * * @return bool true if in compatibility mode, false if * not compatibility mode or not ie */ ieCompatibilityMode: function() { return _populate() || _ie_real_version > _ie; }, /** * Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we * only need this because Skype can't handle 64-bit IE yet. We need to remove * this when we don't need it -- tracked by #601957. */ ie64: function() { return UserAgent_DEPRECATED.ie() && _win64; }, /** * Check if the UA is Firefox. * * * @return float|NaN Version number (if match) or NaN. */ firefox: function() { return _populate() || _firefox; }, /** * Check if the UA is Opera. * * * @return float|NaN Version number (if match) or NaN. */ opera: function() { return _populate() || _opera; }, /** * Check if the UA is WebKit. * * * @return float|NaN Version number (if match) or NaN. */ webkit: function() { return _populate() || _webkit; }, /** * For Push * WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit */ safari: function() { return UserAgent_DEPRECATED.webkit(); }, /** * Check if the UA is a Chrome browser. * * * @return float|NaN Version number (if match) or NaN. */ chrome: function() { return _populate() || _chrome; }, /** * Check if the user is running Windows. * * @return bool `true' if the user's OS is Windows. */ windows: function() { return _populate() || _windows; }, /** * Check if the user is running Mac OS X. * * @return float|bool Returns a float if a version number is detected, * otherwise true/false. */ osx: function() { return _populate() || _osx; }, /** * Check if the user is running Linux. * * @return bool `true' if the user's OS is some flavor of Linux. */ linux: function() { return _populate() || _linux; }, /** * Check if the user is running on an iPhone or iPod platform. * * @return bool `true' if the user is running some flavor of the * iPhone OS. */ iphone: function() { return _populate() || _iphone; }, mobile: function() { return _populate() || (_iphone || _ipad || _android || _mobile); }, nativeApp: function() { return _populate() || _native; }, android: function() { return _populate() || _android; }, ipad: function() { return _populate() || _ipad; } }; module.exports = UserAgent_DEPRECATED; } }); // node_modules/normalize-wheel/src/ExecutionEnvironment.js var require_ExecutionEnvironment = __commonJS({ "node_modules/normalize-wheel/src/ExecutionEnvironment.js"(exports, module) { "use strict"; var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); var ExecutionEnvironment = { canUseDOM, canUseWorkers: typeof Worker !== "undefined", canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), canUseViewport: canUseDOM && !!window.screen, isInWorker: !canUseDOM // For now, this is true - might change in the future. }; module.exports = ExecutionEnvironment; } }); // node_modules/normalize-wheel/src/isEventSupported.js var require_isEventSupported = __commonJS({ "node_modules/normalize-wheel/src/isEventSupported.js"(exports, module) { "use strict"; var ExecutionEnvironment = require_ExecutionEnvironment(); var useHasFeature; if (ExecutionEnvironment.canUseDOM) { useHasFeature = document.implementation && document.implementation.hasFeature && // always returns true in newer browsers as per the standard. // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature document.implementation.hasFeature("", "") !== true; } function isEventSupported(eventNameSuffix, capture) { if (!ExecutionEnvironment.canUseDOM || capture && !("addEventListener" in document)) { return false; } var eventName = "on" + eventNameSuffix; var isSupported = eventName in document; if (!isSupported) { var element = document.createElement("div"); element.setAttribute(eventName, "return;"); isSupported = typeof element[eventName] === "function"; } if (!isSupported && useHasFeature && eventNameSuffix === "wheel") { isSupported = document.implementation.hasFeature("Events.wheel", "3.0"); } return isSupported; } module.exports = isEventSupported; } }); // node_modules/normalize-wheel/src/normalizeWheel.js var require_normalizeWheel = __commonJS({ "node_modules/normalize-wheel/src/normalizeWheel.js"(exports, module) { "use strict"; var UserAgent_DEPRECATED = require_UserAgent_DEPRECATED(); var isEventSupported = require_isEventSupported(); var PIXEL_STEP = 10; var LINE_HEIGHT = 40; var PAGE_HEIGHT = 800; function normalizeWheel2(event) { var sX = 0, sY = 0, pX = 0, pY = 0; if ("detail" in event) { sY = event.detail; } if ("wheelDelta" in event) { sY = -event.wheelDelta / 120; } if ("wheelDeltaY" in event) { sY = -event.wheelDeltaY / 120; } if ("wheelDeltaX" in event) { sX = -event.wheelDeltaX / 120; } if ("axis" in event && event.axis === event.HORIZONTAL_AXIS) { sX = sY; sY = 0; } pX = sX * PIXEL_STEP; pY = sY * PIXEL_STEP; if ("deltaY" in event) { pY = event.deltaY; } if ("deltaX" in event) { pX = event.deltaX; } if ((pX || pY) && event.deltaMode) { if (event.deltaMode == 1) { pX *= LINE_HEIGHT; pY *= LINE_HEIGHT; } else { pX *= PAGE_HEIGHT; pY *= PAGE_HEIGHT; } } if (pX && !sX) { sX = pX < 1 ? -1 : 1; } if (pY && !sY) { sY = pY < 1 ? -1 : 1; } return { spinX: sX, spinY: sY, pixelX: pX, pixelY: pY }; } normalizeWheel2.getEventType = function() { return UserAgent_DEPRECATED.firefox() ? "DOMMouseScroll" : isEventSupported("wheel") ? "wheel" : "mousewheel"; }; module.exports = normalizeWheel2; } }); // node_modules/normalize-wheel/index.js var require_normalize_wheel = __commonJS({ "node_modules/normalize-wheel/index.js"(exports, module) { module.exports = require_normalizeWheel(); } }); // node_modules/fast-deep-equal/index.js var require_fast_deep_equal = __commonJS({ "node_modules/fast-deep-equal/index.js"(exports, module) { "use strict"; module.exports = function equal(a2, b2) { if (a2 === b2) return true; if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { if (a2.constructor !== b2.constructor) return false; var length, i2, keys; if (Array.isArray(a2)) { length = a2.length; if (length != b2.length) return false; for (i2 = length; i2-- !== 0; ) if (!equal(a2[i2], b2[i2])) return false; return true; } if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf(); if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString(); keys = Object.keys(a2); length = keys.length; if (length !== Object.keys(b2).length) return false; for (i2 = length; i2-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false; for (i2 = length; i2-- !== 0; ) { var key = keys[i2]; if (!equal(a2[key], b2[key])) return false; } return true; } return a2 !== a2 && b2 !== b2; }; } }); // packages/block-editor/build-module/index.mjs var index_exports = {}; __export(index_exports, { AlignmentControl: () => AlignmentControl, AlignmentToolbar: () => AlignmentToolbar, Autocomplete: () => autocomplete_default, BlockAlignmentControl: () => BlockAlignmentControl, BlockAlignmentToolbar: () => BlockAlignmentToolbar, BlockBindingsAttributeControl: () => BlockBindingsAttributeControl, BlockBindingsSourceFieldsList: () => BlockBindingsSourceFieldsList, BlockBreadcrumb: () => block_breadcrumb_default, BlockCanvas: () => block_canvas_default, BlockColorsStyleSelector: () => color_style_selector_default, BlockContextProvider: () => BlockContextProvider, BlockControls: () => block_controls_default, BlockEdit: () => BlockEdit, BlockEditorKeyboardShortcuts: () => keyboard_shortcuts_default, BlockEditorProvider: () => provider_default, BlockFormatControls: () => BlockFormatControls, BlockIcon: () => block_icon_default, BlockInspector: () => block_inspector_default, BlockList: () => BlockList, BlockMover: () => block_mover_default, BlockNavigationDropdown: () => dropdown_default, BlockPopover: () => block_popover_default, BlockPreview: () => block_preview_default, BlockSelectionClearer: () => BlockSelectionClearer, BlockSettingsMenu: () => block_settings_menu_default, BlockSettingsMenuControls: () => block_settings_menu_controls_default, BlockStyles: () => block_styles_default, BlockTitle: () => BlockTitle, BlockToolbar: () => BlockToolbar, BlockTools: () => BlockTools, BlockVerticalAlignmentControl: () => BlockVerticalAlignmentControl, BlockVerticalAlignmentToolbar: () => BlockVerticalAlignmentToolbar, ButtonBlockAppender: () => button_block_appender_default, ButtonBlockerAppender: () => ButtonBlockerAppender, ColorPalette: () => color_palette_default, ColorPaletteControl: () => ColorPaletteControl, ContrastChecker: () => contrast_checker_default, CopyHandler: () => CopyHandler, DefaultBlockAppender: () => DefaultBlockAppender, DimensionControl: () => DimensionControl, FontSizePicker: () => font_size_picker_default, HeadingLevelDropdown: () => HeadingLevelDropdown, HeightControl: () => HeightControl, InnerBlocks: () => inner_blocks_default, Inserter: () => inserter_default, InspectorAdvancedControls: () => InspectorAdvancedControls, InspectorControls: () => inspector_controls_default, JustifyContentControl: () => JustifyContentControl, JustifyToolbar: () => JustifyToolbar, LineHeightControl: () => line_height_control_default, LinkControl: () => link_control_default, MediaPlaceholder: () => media_placeholder_default, MediaReplaceFlow: () => media_replace_flow_default, MediaUpload: () => media_upload_default, MediaUploadCheck: () => check_default2, MultiSelectScrollIntoView: () => MultiSelectScrollIntoView, NavigableToolbar: () => NavigableToolbar, ObserveTyping: () => observe_typing_default, PanelColorSettings: () => panel_color_settings_default, PlainText: () => plain_text_default, RecursionProvider: () => RecursionProvider, RichText: () => rich_text_default, RichTextShortcut: () => RichTextShortcut, RichTextToolbarButton: () => RichTextToolbarButton, SETTINGS_DEFAULTS: () => SETTINGS_DEFAULTS, SkipToSelectedBlock: () => SkipToSelectedBlock, ToolSelector: () => tool_selector_default, Typewriter: () => typewriter_default, URLInput: () => url_input_default, URLInputButton: () => button_default, URLPopover: () => url_popover_default, Warning: () => warning_default, WritingFlow: () => writing_flow_default, __experimentalBlockAlignmentMatrixControl: () => block_alignment_matrix_control_default, __experimentalBlockFullHeightAligmentControl: () => block_full_height_alignment_control_default, __experimentalBlockPatternSetup: () => block_pattern_setup_default, __experimentalBlockPatternsList: () => block_patterns_list_default, __experimentalBlockVariationPicker: () => block_variation_picker_default, __experimentalBlockVariationTransforms: () => block_variation_transforms_default, __experimentalBorderRadiusControl: () => BorderRadiusControl, __experimentalColorGradientControl: () => control_default, __experimentalColorGradientSettingsDropdown: () => ColorGradientSettingsDropdown, __experimentalDateFormatPicker: () => DateFormatPicker, __experimentalDuotoneControl: () => duotone_control_default, __experimentalFontAppearanceControl: () => FontAppearanceControl, __experimentalFontFamilyControl: () => FontFamilyControl, __experimentalGetBorderClassesAndStyles: () => getBorderClassesAndStyles, __experimentalGetColorClassesAndStyles: () => getColorClassesAndStyles, __experimentalGetDimensionsClassesAndStyles: () => getDimensionsClassesAndStyles, __experimentalGetElementClassName: () => __experimentalGetElementClassName, __experimentalGetGapCSSValue: () => getGapCSSValue2, __experimentalGetGradientClass: () => __experimentalGetGradientClass, __experimentalGetGradientObjectByGradientValue: () => __experimentalGetGradientObjectByGradientValue, __experimentalGetShadowClassesAndStyles: () => getShadowClassesAndStyles, __experimentalGetSpacingClassesAndStyles: () => getSpacingClassesAndStyles, __experimentalImageEditor: () => ImageEditor, __experimentalImageSizeControl: () => ImageSizeControl, __experimentalImageURLInputUI: () => ImageURLInputUI, __experimentalInspectorPopoverHeader: () => InspectorPopoverHeader, __experimentalLetterSpacingControl: () => LetterSpacingControl, __experimentalLibrary: () => library_default, __experimentalLinkControl: () => DeprecatedExperimentalLinkControl, __experimentalLinkControlSearchInput: () => __experimentalLinkControlSearchInput, __experimentalLinkControlSearchItem: () => __experimentalLinkControlSearchItem, __experimentalLinkControlSearchResults: () => __experimentalLinkControlSearchResults, __experimentalListView: () => list_view_default2, __experimentalPanelColorGradientSettings: () => panel_color_gradient_settings_default, __experimentalPreviewOptions: () => PreviewOptions, __experimentalPublishDateTimePicker: () => publish_date_time_picker_default, __experimentalRecursionProvider: () => DeprecatedExperimentalRecursionProvider, __experimentalResponsiveBlockControl: () => responsive_block_control_default, __experimentalSpacingSizesControl: () => SpacingSizesControl, __experimentalTextDecorationControl: () => TextDecorationControl, __experimentalTextTransformControl: () => TextTransformControl, __experimentalUnitControl: () => UnitControl6, __experimentalUseBlockOverlayActive: () => useBlockOverlayActive, __experimentalUseBlockPreview: () => useBlockPreview, __experimentalUseBorderProps: () => useBorderProps, __experimentalUseColorProps: () => useColorProps, __experimentalUseCustomSides: () => useCustomSides, __experimentalUseGradient: () => useGradient, __experimentalUseHasRecursion: () => DeprecatedExperimentalUseHasRecursion, __experimentalUseMultipleOriginColorsAndGradients: () => useMultipleOriginColorsAndGradients, __experimentalUseResizeCanvas: () => useResizeCanvas, __experimentalWritingModeControl: () => WritingModeControl, __unstableBlockSettingsMenuFirstItem: () => block_settings_menu_first_item_default, __unstableBlockToolbarLastItem: () => block_toolbar_last_item_default, __unstableEditorStyles: () => editor_styles_default, __unstableIframe: () => iframe_default, __unstableInserterMenuExtension: () => inserter_menu_extension_default, __unstableRichTextInputEvent: () => RichTextInputEvent, __unstableUseBlockSelectionClearer: () => useBlockSelectionClearer, __unstableUseClipboardHandler: () => __unstableUseClipboardHandler, __unstableUseMouseMoveTypingReset: () => useMouseMoveTypingReset, __unstableUseTypewriter: () => useTypewriter, __unstableUseTypingObserver: () => useTypingObserver, createCustomColorsHOC: () => createCustomColorsHOC, getColorClassName: () => getColorClassName, getColorObjectByAttributeValues: () => getColorObjectByAttributeValues, getColorObjectByColorValue: () => getColorObjectByColorValue, getComputedFluidTypographyValue: () => getComputedFluidTypographyValue2, getCustomValueFromPreset: () => getCustomValueFromPreset, getDimensionsClassesAndStyles: () => getDimensionsClassesAndStyles, getFontSize: () => getFontSize, getFontSizeClass: () => getFontSizeClass, getFontSizeObjectByValue: () => getFontSizeObjectByValue, getGradientSlugByValue: () => getGradientSlugByValue, getGradientValueBySlug: () => getGradientValueBySlug, getPxFromCssUnit: () => get_px_from_css_unit_default, getSpacingPresetCssVar: () => getSpacingPresetCssVar2, getTypographyClassesAndStyles: () => getTypographyClassesAndStyles, isValueSpacingPreset: () => isValueSpacingPreset, privateApis: () => privateApis14, store: () => store, storeConfig: () => storeConfig, transformStyles: () => transform_styles_default, useBlockBindingsUtils: () => useBlockBindingsUtils, useBlockCommands: () => useBlockCommands, useBlockDisplayInformation: () => useBlockDisplayInformation, useBlockEditContext: () => useBlockEditContext, useBlockEditingMode: () => useBlockEditingMode, useBlockProps: () => useBlockProps, useCachedTruthy: () => useCachedTruthy, useHasRecursion: () => useHasRecursion, useInnerBlocksProps: () => useInnerBlocksProps, useSetting: () => useSetting, useSettings: () => useSettings, useStyleOverride: () => useStyleOverride, withColorContext: () => with_color_context_default, withColors: () => withColors, withFontSizes: () => with_font_sizes_default }); // node_modules/clsx/dist/clsx.mjs function r(e2) { var t3, f2, n2 = ""; if ("string" == typeof e2 || "number" == typeof e2) n2 += e2; else if ("object" == typeof e2) if (Array.isArray(e2)) { var o3 = e2.length; for (t3 = 0; t3 < o3; t3++) e2[t3] && (f2 = r(e2[t3])) && (n2 && (n2 += " "), n2 += f2); } else for (f2 in e2) e2[f2] && (n2 && (n2 += " "), n2 += f2); return n2; } function clsx() { for (var e2, t3, f2 = 0, n2 = "", o3 = arguments.length; f2 < o3; f2++) (e2 = arguments[f2]) && (t3 = r(e2)) && (n2 && (n2 += " "), n2 += t3); return n2; } var clsx_default = clsx; // packages/block-editor/build-module/hooks/utils.mjs var import_blocks104 = __toESM(require_blocks(), 1); var import_element276 = __toESM(require_element(), 1); var import_data181 = __toESM(require_data(), 1); var import_compose98 = __toESM(require_compose(), 1); var import_hooks18 = __toESM(require_hooks(), 1); // packages/block-editor/build-module/components/block-edit/context.mjs var import_element = __toESM(require_element(), 1); var mayDisplayControlsKey = /* @__PURE__ */ Symbol("mayDisplayControls"); var mayDisplayParentControlsKey = /* @__PURE__ */ Symbol("mayDisplayParentControls"); var mayDisplayPatternEditingControlsKey = /* @__PURE__ */ Symbol( "mayDisplayPatternEditingControls" ); var blockEditingModeKey = /* @__PURE__ */ Symbol("blockEditingMode"); var blockBindingsKey = /* @__PURE__ */ Symbol("blockBindings"); var isPreviewModeKey = /* @__PURE__ */ Symbol("isPreviewMode"); var isInListViewBlockSupportTreeKey = /* @__PURE__ */ Symbol( "isInListViewBlockSupportTree" ); var DEFAULT_BLOCK_EDIT_CONTEXT = { name: "", isSelected: false }; var Context = (0, import_element.createContext)(DEFAULT_BLOCK_EDIT_CONTEXT); Context.displayName = "BlockEditContext"; var { Provider } = Context; function useBlockEditContext() { return (0, import_element.useContext)(Context); } // node_modules/colord/index.mjs var r2 = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }; var t = function(r3) { return "string" == typeof r3 ? r3.length > 0 : "number" == typeof r3; }; var n = function(r3, t3, n2) { return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r3) / n2 + 0; }; var e = function(r3, t3, n2) { return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r3 > n2 ? n2 : r3 > t3 ? r3 : t3; }; var u = function(r3) { return (r3 = isFinite(r3) ? r3 % 360 : 0) > 0 ? r3 : r3 + 360; }; var a = function(r3) { return { r: e(r3.r, 0, 255), g: e(r3.g, 0, 255), b: e(r3.b, 0, 255), a: e(r3.a) }; }; var o = function(r3) { return { r: n(r3.r), g: n(r3.g), b: n(r3.b), a: n(r3.a, 3) }; }; var i = /^#([0-9a-f]{3,8})$/i; var s = function(r3) { var t3 = r3.toString(16); return t3.length < 2 ? "0" + t3 : t3; }; var h = function(r3) { var t3 = r3.r, n2 = r3.g, e2 = r3.b, u2 = r3.a, a2 = Math.max(t3, n2, e2), o3 = a2 - Math.min(t3, n2, e2), i2 = o3 ? a2 === t3 ? (n2 - e2) / o3 : a2 === n2 ? 2 + (e2 - t3) / o3 : 4 + (t3 - n2) / o3 : 0; return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o3 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 }; }; var b = function(r3) { var t3 = r3.h, n2 = r3.s, e2 = r3.v, u2 = r3.a; t3 = t3 / 360 * 6, n2 /= 100, e2 /= 100; var a2 = Math.floor(t3), o3 = e2 * (1 - n2), i2 = e2 * (1 - (t3 - a2) * n2), s2 = e2 * (1 - (1 - t3 + a2) * n2), h2 = a2 % 6; return { r: 255 * [e2, i2, o3, o3, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o3, o3][h2], b: 255 * [o3, o3, s2, e2, e2, i2][h2], a: u2 }; }; var g = function(r3) { return { h: u(r3.h), s: e(r3.s, 0, 100), l: e(r3.l, 0, 100), a: e(r3.a) }; }; var d = function(r3) { return { h: n(r3.h), s: n(r3.s), l: n(r3.l), a: n(r3.a, 3) }; }; var f = function(r3) { return b((n2 = (t3 = r3).s, { h: t3.h, s: (n2 *= ((e2 = t3.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t3.a })); var t3, n2, e2; }; var c = function(r3) { return { h: (t3 = h(r3)).h, s: (u2 = (200 - (n2 = t3.s)) * (e2 = t3.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t3.a }; var t3, n2, e2, u2; }; var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var y = { string: [[function(r3) { var t3 = i.exec(r3); return t3 ? (r3 = t3[1]).length <= 4 ? { r: parseInt(r3[0] + r3[0], 16), g: parseInt(r3[1] + r3[1], 16), b: parseInt(r3[2] + r3[2], 16), a: 4 === r3.length ? n(parseInt(r3[3] + r3[3], 16) / 255, 2) : 1 } : 6 === r3.length || 8 === r3.length ? { r: parseInt(r3.substr(0, 2), 16), g: parseInt(r3.substr(2, 2), 16), b: parseInt(r3.substr(4, 2), 16), a: 8 === r3.length ? n(parseInt(r3.substr(6, 2), 16) / 255, 2) : 1 } : null : null; }, "hex"], [function(r3) { var t3 = v.exec(r3) || m.exec(r3); return t3 ? t3[2] !== t3[4] || t3[4] !== t3[6] ? null : a({ r: Number(t3[1]) / (t3[2] ? 100 / 255 : 1), g: Number(t3[3]) / (t3[4] ? 100 / 255 : 1), b: Number(t3[5]) / (t3[6] ? 100 / 255 : 1), a: void 0 === t3[7] ? 1 : Number(t3[7]) / (t3[8] ? 100 : 1) }) : null; }, "rgb"], [function(t3) { var n2 = l.exec(t3) || p.exec(t3); if (!n2) return null; var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r2[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) }); return f(a2); }, "hsl"]], object: [[function(r3) { var n2 = r3.r, e2 = r3.g, u2 = r3.b, o3 = r3.a, i2 = void 0 === o3 ? 1 : o3; return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null; }, "rgb"], [function(r3) { var n2 = r3.h, e2 = r3.s, u2 = r3.l, a2 = r3.a, o3 = void 0 === a2 ? 1 : a2; if (!t(n2) || !t(e2) || !t(u2)) return null; var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o3) }); return f(i2); }, "hsl"], [function(r3) { var n2 = r3.h, a2 = r3.s, o3 = r3.v, i2 = r3.a, s2 = void 0 === i2 ? 1 : i2; if (!t(n2) || !t(a2) || !t(o3)) return null; var h2 = (function(r4) { return { h: u(r4.h), s: e(r4.s, 0, 100), v: e(r4.v, 0, 100), a: e(r4.a) }; })({ h: Number(n2), s: Number(a2), v: Number(o3), a: Number(s2) }); return b(h2); }, "hsv"]] }; var N = function(r3, t3) { for (var n2 = 0; n2 < t3.length; n2++) { var e2 = t3[n2][0](r3); if (e2) return [e2, t3[n2][1]]; } return [null, void 0]; }; var x = function(r3) { return "string" == typeof r3 ? N(r3.trim(), y.string) : "object" == typeof r3 && null !== r3 ? N(r3, y.object) : [null, void 0]; }; var M = function(r3, t3) { var n2 = c(r3); return { h: n2.h, s: e(n2.s + 100 * t3, 0, 100), l: n2.l, a: n2.a }; }; var H = function(r3) { return (299 * r3.r + 587 * r3.g + 114 * r3.b) / 1e3 / 255; }; var $ = function(r3, t3) { var n2 = c(r3); return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t3, 0, 100), a: n2.a }; }; var j = (function() { function r3(r4) { this.parsed = x(r4)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 }; } return r3.prototype.isValid = function() { return null !== this.parsed; }, r3.prototype.brightness = function() { return n(H(this.rgba), 2); }, r3.prototype.isDark = function() { return H(this.rgba) < 0.5; }, r3.prototype.isLight = function() { return H(this.rgba) >= 0.5; }, r3.prototype.toHex = function() { return r4 = o(this.rgba), t3 = r4.r, e2 = r4.g, u2 = r4.b, i2 = (a2 = r4.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t3) + s(e2) + s(u2) + i2; var r4, t3, e2, u2, a2, i2; }, r3.prototype.toRgb = function() { return o(this.rgba); }, r3.prototype.toRgbString = function() { return r4 = o(this.rgba), t3 = r4.r, n2 = r4.g, e2 = r4.b, (u2 = r4.a) < 1 ? "rgba(" + t3 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t3 + ", " + n2 + ", " + e2 + ")"; var r4, t3, n2, e2, u2; }, r3.prototype.toHsl = function() { return d(c(this.rgba)); }, r3.prototype.toHslString = function() { return r4 = d(c(this.rgba)), t3 = r4.h, n2 = r4.s, e2 = r4.l, (u2 = r4.a) < 1 ? "hsla(" + t3 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t3 + ", " + n2 + "%, " + e2 + "%)"; var r4, t3, n2, e2, u2; }, r3.prototype.toHsv = function() { return r4 = h(this.rgba), { h: n(r4.h), s: n(r4.s), v: n(r4.v), a: n(r4.a, 3) }; var r4; }, r3.prototype.invert = function() { return w({ r: 255 - (r4 = this.rgba).r, g: 255 - r4.g, b: 255 - r4.b, a: r4.a }); var r4; }, r3.prototype.saturate = function(r4) { return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, r4)); }, r3.prototype.desaturate = function(r4) { return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, -r4)); }, r3.prototype.grayscale = function() { return w(M(this.rgba, -1)); }, r3.prototype.lighten = function(r4) { return void 0 === r4 && (r4 = 0.1), w($(this.rgba, r4)); }, r3.prototype.darken = function(r4) { return void 0 === r4 && (r4 = 0.1), w($(this.rgba, -r4)); }, r3.prototype.rotate = function(r4) { return void 0 === r4 && (r4 = 15), this.hue(this.hue() + r4); }, r3.prototype.alpha = function(r4) { return "number" == typeof r4 ? w({ r: (t3 = this.rgba).r, g: t3.g, b: t3.b, a: r4 }) : n(this.rgba.a, 3); var t3; }, r3.prototype.hue = function(r4) { var t3 = c(this.rgba); return "number" == typeof r4 ? w({ h: r4, s: t3.s, l: t3.l, a: t3.a }) : n(t3.h); }, r3.prototype.isEqual = function(r4) { return this.toHex() === w(r4).toHex(); }, r3; })(); var w = function(r3) { return r3 instanceof j ? r3 : new j(r3); }; var S = []; var k = function(r3) { r3.forEach(function(r4) { S.indexOf(r4) < 0 && (r4(j, y), S.push(r4)); }); }; // node_modules/colord/plugins/names.mjs function names_default(e2, f2) { var a2 = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r3 = {}; for (var d2 in a2) r3[a2[d2]] = d2; var l2 = {}; e2.prototype.toName = function(f3) { if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent"; var d3, i2, n2 = r3[this.toHex()]; if (n2) return n2; if (null == f3 ? void 0 : f3.closest) { var o3 = this.toRgb(), t3 = 1 / 0, b2 = "black"; if (!l2.length) for (var c6 in a2) l2[c6] = new e2(a2[c6]).toRgb(); for (var g2 in a2) { var u2 = (d3 = o3, i2 = l2[g2], Math.pow(d3.r - i2.r, 2) + Math.pow(d3.g - i2.g, 2) + Math.pow(d3.b - i2.b, 2)); u2 < t3 && (t3 = u2, b2 = g2); } return b2; } }; f2.string.push([function(f3) { var r4 = f3.toLowerCase(), d3 = "transparent" === r4 ? "#0000" : a2[r4]; return d3 ? new e2(d3).toRgb() : null; }, "name"]); } // node_modules/colord/plugins/a11y.mjs var o2 = function(o3) { var t3 = o3 / 255; return t3 < 0.04045 ? t3 / 12.92 : Math.pow((t3 + 0.055) / 1.055, 2.4); }; var t2 = function(t3) { return 0.2126 * o2(t3.r) + 0.7152 * o2(t3.g) + 0.0722 * o2(t3.b); }; function a11y_default(o3) { o3.prototype.luminance = function() { return o4 = t2(this.rgba), void 0 === (r3 = 2) && (r3 = 0), void 0 === n2 && (n2 = Math.pow(10, r3)), Math.round(n2 * o4) / n2 + 0; var o4, r3, n2; }, o3.prototype.contrast = function(r3) { void 0 === r3 && (r3 = "#FFF"); var n2, a2, i2, e2, v2, u2, d2, c6 = r3 instanceof o3 ? r3 : new o3(r3); return e2 = this.rgba, v2 = c6.toRgb(), u2 = t2(e2), d2 = t2(v2), n2 = u2 > d2 ? (u2 + 0.05) / (d2 + 0.05) : (d2 + 0.05) / (u2 + 0.05), void 0 === (a2 = 2) && (a2 = 0), void 0 === i2 && (i2 = Math.pow(10, a2)), Math.floor(i2 * n2) / i2 + 0; }, o3.prototype.isReadable = function(o4, t3) { return void 0 === o4 && (o4 = "#FFF"), void 0 === t3 && (t3 = {}), this.contrast(o4) >= (e2 = void 0 === (i2 = (r3 = t3).size) ? "normal" : i2, "AAA" === (a2 = void 0 === (n2 = r3.level) ? "AA" : n2) && "normal" === e2 ? 7 : "AA" === a2 && "large" === e2 ? 3 : 4.5); var r3, n2, a2, i2, e2; }; } // packages/block-editor/build-module/components/colors/utils.mjs var import_components = __toESM(require_components(), 1); // packages/block-editor/build-module/lock-unlock.mjs var import_private_apis = __toESM(require_private_apis(), 1); var { lock, unlock } = (0, import_private_apis.__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/block-editor" ); // packages/block-editor/build-module/components/colors/utils.mjs k([names_default, a11y_default]); var { kebabCase } = unlock(import_components.privateApis); var getColorObjectByAttributeValues = (colors2, definedColor, customColor) => { if (definedColor) { const colorObj = colors2?.find( (color) => color.slug === definedColor ); if (colorObj) { return colorObj; } } return { color: customColor }; }; var getColorObjectByColorValue = (colors2, colorValue) => { return colors2?.find((color) => color.color === colorValue); }; function getColorClassName(colorContextName, colorSlug) { if (!colorContextName || !colorSlug) { return void 0; } return `has-${kebabCase(colorSlug)}-${colorContextName}`; } function getMostReadableColor(colors2, colorValue) { const colordColor = w(colorValue); const getColorContrast = ({ color }) => colordColor.contrast(color); const maxContrast = Math.max(...colors2.map(getColorContrast)); return colors2.find((color) => getColorContrast(color) === maxContrast).color; } // packages/block-editor/build-module/components/colors/with-colors.mjs var import_element7 = __toESM(require_element(), 1); var import_compose2 = __toESM(require_compose(), 1); var import_components5 = __toESM(require_components(), 1); // packages/block-editor/build-module/components/use-settings/index.mjs var import_data8 = __toESM(require_data(), 1); var import_deprecated5 = __toESM(require_deprecated(), 1); // packages/block-editor/build-module/components/block-edit/index.mjs var import_element6 = __toESM(require_element(), 1); var import_blocks10 = __toESM(require_blocks(), 1); // packages/block-editor/build-module/components/block-edit/edit.mjs var import_blocks = __toESM(require_blocks(), 1); var import_components2 = __toESM(require_components(), 1); var import_data = __toESM(require_data(), 1); var import_element4 = __toESM(require_element(), 1); // packages/block-editor/build-module/components/block-context/index.mjs var import_element2 = __toESM(require_element(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var Context2 = (0, import_element2.createContext)({}); Context2.displayName = "BlockContext"; function BlockContextProvider({ value, children }) { const context = (0, import_element2.useContext)(Context2); const nextValue = (0, import_element2.useMemo)( () => ({ ...context, ...value }), [context, value] ); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context2.Provider, { value: nextValue, children }); } var block_context_default = Context2; // packages/block-editor/build-module/components/link-control/is-url-like.mjs var import_url = __toESM(require_url(), 1); function isHashLink(val) { return val?.startsWith("#") && (0, import_url.isValidFragment)(val); } function isRelativePath(val) { return val?.startsWith("/") || val?.startsWith("./") || val?.startsWith("../"); } function isURLLike(val) { const hasSpaces = val.includes(" "); if (hasSpaces) { return false; } const protocol = (0, import_url.getProtocol)(val); const protocolIsValid = (0, import_url.isValidProtocol)(protocol); const mayBeTLD = hasPossibleTLD(val); const isWWW = val?.startsWith("www."); return protocolIsValid || isWWW || isHashLink(val) || mayBeTLD || isRelativePath(val); } function hasPossibleTLD(url, maxLength = 6) { const cleanedURL = url.split(/[?#]/)[0]; const regex = new RegExp( `(?<=\\S)\\.(?:[a-zA-Z_]{2,${maxLength}})(?:\\/|$)` ); return regex.test(cleanedURL); } // packages/block-editor/build-module/utils/block-bindings.mjs var DEFAULT_ATTRIBUTE = "__default"; var PATTERN_OVERRIDES_SOURCE = "core/pattern-overrides"; var EMPTY_CONTEXT = {}; function getBlockBindingsContext(blockContext, blockTypeUsesContext, sources) { let context; if (blockTypeUsesContext) { for (const [key, value] of Object.entries(blockContext)) { if (blockTypeUsesContext.includes(key)) { if (context === void 0) { context = {}; } context[key] = value; } } } if (sources) { for (const source of sources) { source?.usesContext?.forEach((key) => { if (key in blockContext) { if (context === void 0) { context = {}; } context[key] = blockContext[key]; } }); } } return context ?? EMPTY_CONTEXT; } function hasPatternOverridesDefaultBinding(bindings) { return bindings?.[DEFAULT_ATTRIBUTE]?.source === PATTERN_OVERRIDES_SOURCE; } function replacePatternOverridesDefaultBinding(bindings, supportedAttributes) { if (!hasPatternOverridesDefaultBinding(bindings)) { return bindings; } const bindingsWithDefaults = {}; for (const attributeName of supportedAttributes) { const bindingSource = bindings[attributeName] ? bindings[attributeName] : { source: PATTERN_OVERRIDES_SOURCE }; bindingsWithDefaults[attributeName] = bindingSource; } return bindingsWithDefaults; } // packages/block-editor/build-module/components/block-list/private-block-context.mjs var import_element3 = __toESM(require_element(), 1); var PrivateBlockContext = (0, import_element3.createContext)({}); PrivateBlockContext.displayName = "PrivateBlockContext"; // packages/block-editor/build-module/components/block-edit/edit.mjs var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var Edit = (props) => { const { name } = props; const blockType = (0, import_blocks.getBlockType)(name); if (!blockType) { return null; } const Component6 = blockType.edit || blockType.save; return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Component6, { ...props }); }; var EditWithFilters = (0, import_components2.withFilters)("editor.BlockEdit")(Edit); var EditWithGeneratedProps = (props) => { const { name, clientId, attributes, setAttributes } = props; const registry = (0, import_data.useRegistry)(); const blockType = (0, import_blocks.getBlockType)(name); const blockContext = (0, import_element4.useContext)(block_context_default); const registeredSources = (0, import_data.useSelect)( (select3) => unlock(select3(import_blocks.store)).getAllBlockBindingsSources(), [] ); const { bindableAttributes } = (0, import_element4.useContext)(PrivateBlockContext); const { blockBindings, context, hasPatternOverrides } = (0, import_element4.useMemo)(() => { return { blockBindings: replacePatternOverridesDefaultBinding( attributes?.metadata?.bindings, bindableAttributes ), // Assign context values using the block type's declared context // needs, plus the context requested by the block's bindings // sources. context: getBlockBindingsContext( blockContext, blockType?.usesContext, attributes?.metadata?.bindings ? Object.values(attributes.metadata.bindings).map( (binding) => registeredSources[binding?.source] ) : void 0 ), hasPatternOverrides: hasPatternOverridesDefaultBinding( attributes?.metadata?.bindings ) }; }, [ blockType?.usesContext, blockContext, attributes?.metadata?.bindings, bindableAttributes, registeredSources ]); const computedAttributes = (0, import_data.useSelect)( (select3) => { if (!blockBindings) { return attributes; } const attributesFromSources = {}; const blockBindingsBySource = /* @__PURE__ */ new Map(); for (const [attributeName, binding] of Object.entries( blockBindings )) { const { source: sourceName, args: sourceArgs } = binding; const source = registeredSources[sourceName]; if (!source || !bindableAttributes?.includes(attributeName)) { continue; } blockBindingsBySource.set(source, { ...blockBindingsBySource.get(source), [attributeName]: { args: sourceArgs } }); } if (blockBindingsBySource.size) { for (const [source, bindings] of blockBindingsBySource) { let values = {}; if (!source.getValues) { Object.keys(bindings).forEach((attr2) => { values[attr2] = source.label; }); } else { values = source.getValues({ select: select3, context, clientId, bindings }); } for (const [attributeName, value] of Object.entries( values )) { if (attributeName === "url" && (!value || !isURLLike(value))) { attributesFromSources[attributeName] = null; } else { attributesFromSources[attributeName] = value; } } } } return { ...attributes, ...attributesFromSources }; }, [ attributes, bindableAttributes, blockBindings, clientId, context, registeredSources ] ); const setBoundAttributes = (0, import_element4.useCallback)( (nextAttributes) => { if (!blockBindings) { setAttributes(nextAttributes); return; } registry.batch(() => { const keptAttributes = { ...nextAttributes }; const blockBindingsBySource = /* @__PURE__ */ new Map(); for (const [attributeName, newValue] of Object.entries( keptAttributes )) { if (!blockBindings[attributeName] || !bindableAttributes?.includes(attributeName)) { continue; } const binding = blockBindings[attributeName]; const source = registeredSources[binding?.source]; if (!source?.setValues) { continue; } blockBindingsBySource.set(source, { ...blockBindingsBySource.get(source), [attributeName]: { args: binding.args, newValue } }); delete keptAttributes[attributeName]; } if (blockBindingsBySource.size) { for (const [ source, bindings ] of blockBindingsBySource) { source.setValues({ select: registry.select, dispatch: registry.dispatch, context, clientId, bindings }); } } const hasParentPattern = !!context["pattern/overrides"]; if ( // Don't update non-connected attributes if the block is using pattern overrides // and the editing is happening while overriding the pattern (not editing the original). !(hasPatternOverrides && hasParentPattern) && Object.keys(keptAttributes).length ) { if (hasPatternOverrides) { delete keptAttributes.href; } setAttributes(keptAttributes); } }); }, [ bindableAttributes, blockBindings, clientId, context, hasPatternOverrides, setAttributes, registeredSources, registry ] ); if (!blockType) { return null; } if (blockType.apiVersion > 1) { return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( EditWithFilters, { ...props, attributes: computedAttributes, context, setAttributes: setBoundAttributes } ); } const generatedClassName = (0, import_blocks.hasBlockSupport)(blockType, "className", true) ? (0, import_blocks.getBlockDefaultClassName)(name) : null; const className = clsx_default( generatedClassName, attributes?.className, props.className ); return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( EditWithFilters, { ...props, attributes: computedAttributes, className, context, setAttributes: setBoundAttributes } ); }; var edit_default = EditWithGeneratedProps; // packages/block-editor/build-module/components/block-edit/multiple-usage-warning.mjs var import_blocks9 = __toESM(require_blocks(), 1); var import_components4 = __toESM(require_components(), 1); var import_data7 = __toESM(require_data(), 1); var import_i18n7 = __toESM(require_i18n(), 1); // packages/block-editor/build-module/store/index.mjs var import_data6 = __toESM(require_data(), 1); // packages/block-editor/build-module/store/reducer.mjs var import_es6 = __toESM(require_es6(), 1); var import_compose = __toESM(require_compose(), 1); var import_data2 = __toESM(require_data(), 1); var import_deprecated = __toESM(require_deprecated(), 1); var import_blocks2 = __toESM(require_blocks(), 1); // packages/block-editor/build-module/store/defaults.mjs var import_i18n = __toESM(require_i18n(), 1); var PREFERENCES_DEFAULTS = { insertUsage: {} }; var SETTINGS_DEFAULTS = { alignWide: false, supportsLayout: true, // colors setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // The setting is only kept for backward compatibility purposes. colors: [ { name: (0, import_i18n.__)("Black"), slug: "black", color: "#000000" }, { name: (0, import_i18n.__)("Cyan bluish gray"), slug: "cyan-bluish-gray", color: "#abb8c3" }, { name: (0, import_i18n.__)("White"), slug: "white", color: "#ffffff" }, { name: (0, import_i18n.__)("Pale pink"), slug: "pale-pink", color: "#f78da7" }, { name: (0, import_i18n.__)("Vivid red"), slug: "vivid-red", color: "#cf2e2e" }, { name: (0, import_i18n.__)("Luminous vivid orange"), slug: "luminous-vivid-orange", color: "#ff6900" }, { name: (0, import_i18n.__)("Luminous vivid amber"), slug: "luminous-vivid-amber", color: "#fcb900" }, { name: (0, import_i18n.__)("Light green cyan"), slug: "light-green-cyan", color: "#7bdcb5" }, { name: (0, import_i18n.__)("Vivid green cyan"), slug: "vivid-green-cyan", color: "#00d084" }, { name: (0, import_i18n.__)("Pale cyan blue"), slug: "pale-cyan-blue", color: "#8ed1fc" }, { name: (0, import_i18n.__)("Vivid cyan blue"), slug: "vivid-cyan-blue", color: "#0693e3" }, { name: (0, import_i18n.__)("Vivid purple"), slug: "vivid-purple", color: "#9b51e0" } ], // fontSizes setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // The setting is only kept for backward compatibility purposes. fontSizes: [ { name: (0, import_i18n._x)("Small", "font size name"), size: 13, slug: "small" }, { name: (0, import_i18n._x)("Normal", "font size name"), size: 16, slug: "normal" }, { name: (0, import_i18n._x)("Medium", "font size name"), size: 20, slug: "medium" }, { name: (0, import_i18n._x)("Large", "font size name"), size: 36, slug: "large" }, { name: (0, import_i18n._x)("Huge", "font size name"), size: 42, slug: "huge" } ], // Image default size slug. imageDefaultSize: "large", imageSizes: [ { slug: "thumbnail", name: (0, import_i18n.__)("Thumbnail") }, { slug: "medium", name: (0, import_i18n.__)("Medium") }, { slug: "large", name: (0, import_i18n.__)("Large") }, { slug: "full", name: (0, import_i18n.__)("Full Size") } ], // Allow plugin to disable Image Editor if need be. imageEditing: true, // This is current max width of the block inner area // It's used to constraint image resizing and this value could be overridden later by themes maxWidth: 580, // Allowed block types for the editor, defaulting to true (all supported). allowedBlockTypes: true, // Maximum upload size in bytes allowed for the site. maxUploadFileSize: 0, // List of allowed mime types and file extensions. allowedMimeTypes: null, // Allows to disable block locking interface. canLockBlocks: true, // Allows to disable the block-level style states interface. blockStatesEditingEnabled: true, // Whether the user can edit custom CSS (requires edit_css capability). // Defaults to false for safety - PHP passes true when user has capability. canEditCSS: false, // Allows to disable Openverse media category in the inserter. enableOpenverseMediaCategory: true, clearBlockSelection: true, __experimentalCanUserUseUnfilteredHTML: false, __experimentalBlockDirectory: false, __mobileEnablePageTemplates: false, __experimentalBlockPatterns: [], __experimentalBlockPatternCategories: [], isPreviewMode: false, // These settings will be completely revamped in the future. // The goal is to evolve this into an API which will instruct // the block inspector to animate transitions between what it // displays based on the relationship between the selected block // and its parent, and only enable it if the parent is controlling // its children blocks. blockInspectorAnimation: { animationParent: "core/navigation", "core/navigation": { enterDirection: "leftToRight" }, "core/navigation-submenu": { enterDirection: "rightToLeft" }, "core/navigation-link": { enterDirection: "rightToLeft" }, "core/search": { enterDirection: "rightToLeft" }, "core/social-links": { enterDirection: "rightToLeft" }, "core/page-list": { enterDirection: "rightToLeft" }, "core/spacer": { enterDirection: "rightToLeft" }, "core/home-link": { enterDirection: "rightToLeft" }, "core/site-title": { enterDirection: "rightToLeft" }, "core/site-logo": { enterDirection: "rightToLeft" } }, generateAnchors: false, // gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // The setting is only kept for backward compatibility purposes. gradients: [ { name: (0, import_i18n.__)("Vivid cyan blue to vivid purple"), gradient: "linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)", slug: "vivid-cyan-blue-to-vivid-purple" }, { name: (0, import_i18n.__)("Light green cyan to vivid green cyan"), gradient: "linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)", slug: "light-green-cyan-to-vivid-green-cyan" }, { name: (0, import_i18n.__)("Luminous vivid amber to luminous vivid orange"), gradient: "linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)", slug: "luminous-vivid-amber-to-luminous-vivid-orange" }, { name: (0, import_i18n.__)("Luminous vivid orange to vivid red"), gradient: "linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)", slug: "luminous-vivid-orange-to-vivid-red" }, { name: (0, import_i18n.__)("Very light gray to cyan bluish gray"), gradient: "linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)", slug: "very-light-gray-to-cyan-bluish-gray" }, { name: (0, import_i18n.__)("Cool to warm spectrum"), gradient: "linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)", slug: "cool-to-warm-spectrum" }, { name: (0, import_i18n.__)("Blush light purple"), gradient: "linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)", slug: "blush-light-purple" }, { name: (0, import_i18n.__)("Blush bordeaux"), gradient: "linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)", slug: "blush-bordeaux" }, { name: (0, import_i18n.__)("Luminous dusk"), gradient: "linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)", slug: "luminous-dusk" }, { name: (0, import_i18n.__)("Pale ocean"), gradient: "linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)", slug: "pale-ocean" }, { name: (0, import_i18n.__)("Electric grass"), gradient: "linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)", slug: "electric-grass" }, { name: (0, import_i18n.__)("Midnight"), gradient: "linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)", slug: "midnight" } ], __unstableResolvedAssets: { styles: [], scripts: [] } }; // packages/block-editor/build-module/store/array.mjs function insertAt(array, elements, index2) { return [ ...array.slice(0, index2), ...Array.isArray(elements) ? elements : [elements], ...array.slice(index2) ]; } function moveTo(array, from, to2, count = 1) { const withoutMovedElements = [...array]; withoutMovedElements.splice(from, count); return insertAt( withoutMovedElements, array.slice(from, from + count), to2 ); } // packages/block-editor/build-module/store/private-keys.mjs var globalStylesDataKey = /* @__PURE__ */ Symbol("globalStylesDataKey"); var globalStylesLinksDataKey = /* @__PURE__ */ Symbol("globalStylesLinks"); var selectBlockPatternsKey = /* @__PURE__ */ Symbol("selectBlockPatternsKey"); var reusableBlocksSelectKey = /* @__PURE__ */ Symbol("reusableBlocksSelect"); var userPatternCategoriesSelectKey = /* @__PURE__ */ Symbol( "userPatternCategoriesSelect" ); var sectionRootClientIdKey = /* @__PURE__ */ Symbol("sectionRootClientIdKey"); var mediaEditKey = /* @__PURE__ */ Symbol("mediaEditKey"); var getMediaSelectKey = /* @__PURE__ */ Symbol("getMediaSelect"); var isIsolatedEditorKey = /* @__PURE__ */ Symbol("isIsolatedEditor"); var deviceTypeKey = /* @__PURE__ */ Symbol("deviceTypeKey"); var isNavigationOverlayContextKey = /* @__PURE__ */ Symbol( "isNavigationOverlayContext" ); var isNavigationPostEditorKey = /* @__PURE__ */ Symbol("isNavigationPostEditor"); var mediaUploadOnSuccessKey = /* @__PURE__ */ Symbol("mediaUploadOnSuccess"); var mediaSideloadFromUrlKey = /* @__PURE__ */ Symbol("mediaSideloadFromUrl"); var openMediaEditorModalKey = /* @__PURE__ */ Symbol("openMediaEditorModal"); // packages/block-editor/build-module/store/reducer.mjs var { isContentBlock } = unlock(import_blocks2.privateApis); var identity = (x2) => x2; function mapBlockOrder(blocks2, rootClientId = "") { const result = /* @__PURE__ */ new Map(); const current = []; result.set(rootClientId, current); blocks2.forEach((block) => { const { clientId, innerBlocks } = block; current.push(clientId); mapBlockOrder(innerBlocks, clientId).forEach( (order, subClientId) => { result.set(subClientId, order); } ); }); return result; } function mapBlockParents(blocks2, rootClientId = "") { const result = []; const stack = [[rootClientId, blocks2]]; while (stack.length) { const [parent, currentBlocks] = stack.shift(); currentBlocks.forEach(({ innerBlocks, ...block }) => { result.push([block.clientId, parent]); if (innerBlocks?.length) { stack.push([block.clientId, innerBlocks]); } }); } return result; } function flattenBlocks(blocks2, transform = identity) { const result = []; const stack = [...blocks2]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.push(...innerBlocks); result.push([block.clientId, transform(block)]); } return result; } function getFlattenedClientIds(blocks2) { const result = {}; const stack = [...blocks2]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.push(...innerBlocks); result[block.clientId] = true; } return result; } function getFlattenedBlocksWithoutAttributes(blocks2) { return flattenBlocks(blocks2, (block) => { const { attributes, ...restBlock } = block; return restBlock; }); } function getFlattenedBlockAttributes(blocks2) { return flattenBlocks(blocks2, (block) => block.attributes); } function hasSameKeys(a2, b2) { return (0, import_es6.default)(Object.keys(a2), Object.keys(b2)); } function isUpdatingSameBlockAttribute(action, lastAction) { return action.type === "UPDATE_BLOCK_ATTRIBUTES" && lastAction !== void 0 && lastAction.type === "UPDATE_BLOCK_ATTRIBUTES" && (0, import_es6.default)(action.clientIds, lastAction.clientIds) && hasSameKeys(action.attributes, lastAction.attributes); } function updateBlockTreeForBlocks(state, blocks2) { const treeToUpdate = state.tree; const stack = [...blocks2]; const flattenedBlocks = [...blocks2]; while (stack.length) { const block = stack.shift(); stack.push(...block.innerBlocks); flattenedBlocks.push(...block.innerBlocks); } for (const block of flattenedBlocks) { treeToUpdate.set(block.clientId, {}); } for (const block of flattenedBlocks) { treeToUpdate.set( block.clientId, Object.assign(treeToUpdate.get(block.clientId), { ...state.byClientId.get(block.clientId), attributes: state.attributes.get(block.clientId), innerBlocks: block.innerBlocks.map( (subBlock) => treeToUpdate.get(subBlock.clientId) ) }) ); } } function updateParentInnerBlocksInTree(state, updatedClientIds, updateChildrenOfUpdatedClientIds = false) { const treeToUpdate = state.tree; const uncontrolledParents = /* @__PURE__ */ new Set([]); const controlledParents = /* @__PURE__ */ new Set(); for (const clientId of updatedClientIds) { let current = updateChildrenOfUpdatedClientIds ? clientId : state.parents.get(clientId); do { if (state.controlledInnerBlocks.has(current)) { controlledParents.add(current); break; } else { uncontrolledParents.add(current); current = state.parents.get(current); } } while (current !== void 0); } for (const clientId of uncontrolledParents) { treeToUpdate.set(clientId, { ...treeToUpdate.get(clientId) }); } for (const clientId of uncontrolledParents) { treeToUpdate.get(clientId).innerBlocks = (state.order.get(clientId) || []).map((subClientId) => treeToUpdate.get(subClientId)); } for (const clientId of controlledParents) { treeToUpdate.set("controlled||" + clientId, { innerBlocks: (state.order.get(clientId) || []).map( (subClientId) => treeToUpdate.get(subClientId) ) }); } } var withBlockTree = (reducer3) => (state = {}, action) => { const newState = reducer3(state, action); if (newState === state) { return state; } newState.tree = state.tree ? state.tree : /* @__PURE__ */ new Map(); switch (action.type) { case "RECEIVE_BLOCKS": case "INSERT_BLOCKS": { newState.tree = new Map(newState.tree); updateBlockTreeForBlocks(newState, action.blocks); updateParentInnerBlocksInTree( newState, action.rootClientId ? [action.rootClientId] : [""], true ); break; } case "UPDATE_BLOCK": newState.tree = new Map(newState.tree); newState.tree.set(action.clientId, { ...newState.tree.get(action.clientId), ...newState.byClientId.get(action.clientId), attributes: newState.attributes.get(action.clientId) }); updateParentInnerBlocksInTree( newState, [action.clientId], false ); break; case "UPDATE_BLOCK_ATTRIBUTES": { newState.tree = new Map(newState.tree); action.clientIds.forEach((clientId) => { newState.tree.set(clientId, { ...newState.tree.get(clientId), attributes: newState.attributes.get(clientId) }); }); updateParentInnerBlocksInTree( newState, action.clientIds, false ); break; } case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const inserterClientIds = getFlattenedClientIds( action.blocks ); newState.tree = new Map(newState.tree); action.replacedClientIds.forEach((clientId) => { newState.tree.delete(clientId); if (!inserterClientIds[clientId]) { newState.tree.delete("controlled||" + clientId); } }); updateBlockTreeForBlocks(newState, action.blocks); updateParentInnerBlocksInTree( newState, action.blocks.map((b2) => b2.clientId), false ); const parentsOfRemovedBlocks2 = []; for (const clientId of action.clientIds) { const parentId = state.parents.get(clientId); if (parentId !== void 0 && (parentId === "" || newState.byClientId.get(parentId))) { parentsOfRemovedBlocks2.push(parentId); } } updateParentInnerBlocksInTree( newState, parentsOfRemovedBlocks2, true ); break; } case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": const parentsOfRemovedBlocks = []; for (const clientId of action.clientIds) { const parentId = state.parents.get(clientId); if (parentId !== void 0 && (parentId === "" || newState.byClientId.get(parentId))) { parentsOfRemovedBlocks.push(parentId); } } newState.tree = new Map(newState.tree); action.removedClientIds.forEach((clientId) => { newState.tree.delete(clientId); newState.tree.delete("controlled||" + clientId); }); updateParentInnerBlocksInTree( newState, parentsOfRemovedBlocks, true ); break; case "MOVE_BLOCKS_TO_POSITION": { const updatedBlockUids = []; if (action.fromRootClientId) { updatedBlockUids.push(action.fromRootClientId); } else { updatedBlockUids.push(""); } if (action.toRootClientId) { updatedBlockUids.push(action.toRootClientId); } newState.tree = new Map(newState.tree); updateParentInnerBlocksInTree( newState, updatedBlockUids, true ); break; } case "MOVE_BLOCKS_UP": case "MOVE_BLOCKS_DOWN": { const updatedBlockUids = [ action.rootClientId ? action.rootClientId : "" ]; newState.tree = new Map(newState.tree); updateParentInnerBlocksInTree( newState, updatedBlockUids, true ); break; } } return newState; }; function withPersistentBlockChange(reducer3) { let lastAction; let nextHistoryMode; return (state, action) => { const nextState = reducer3(state, action); const pendingHistoryMode = nextHistoryMode; nextHistoryMode = action.type === "MARK_NEXT_CHANGE_AS_NOT_PERSISTENT" ? action.history ?? "merge" : void 0; const isExplicitPersistentChange = action.type === "MARK_LAST_CHANGE_AS_PERSISTENT" || pendingHistoryMode; if (state === nextState && !isExplicitPersistentChange) { if (state.isPersistentChange !== void 0) { return state; } return { ...nextState, isPersistentChange: true }; } const isPersistentChange = isExplicitPersistentChange ? !pendingHistoryMode : !isUpdatingSameBlockAttribute(action, lastAction); lastAction = action; if (pendingHistoryMode === "ignore") { return { ...nextState, isPersistentChange, lastBlockChangeHistoryMode: "ignore" }; } const { lastBlockChangeHistoryMode, ...blockChange } = nextState; return { ...blockChange, isPersistentChange }; }; } function withIgnoredBlockChange(reducer3) { const IGNORED_ACTION_TYPES = /* @__PURE__ */ new Set(["RECEIVE_BLOCKS"]); return (state, action) => { const nextState = reducer3(state, action); if (nextState !== state) { nextState.isIgnoredChange = IGNORED_ACTION_TYPES.has(action.type); } return nextState; }; } var withInnerBlocksRemoveCascade = (reducer3) => (state, action) => { const getAllChildren = (clientIds) => { let result = clientIds; for (let i2 = 0; i2 < result.length; i2++) { if (!state.order.get(result[i2]) || action.keepControlledInnerBlocks && action.keepControlledInnerBlocks[result[i2]]) { continue; } if (result === clientIds) { result = [...result]; } result.push(...state.order.get(result[i2])); } return result; }; if (state) { switch (action.type) { case "REMOVE_BLOCKS": action = { ...action, type: "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN", removedClientIds: getAllChildren(action.clientIds) }; break; case "REPLACE_BLOCKS": action = { ...action, type: "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN", replacedClientIds: getAllChildren(action.clientIds) }; break; } } return reducer3(state, action); }; var withBlockReset = (reducer3) => (state, action) => { if (action.type === "RESET_BLOCKS") { const newState = reducer3(void 0, { type: "INSERT_BLOCKS", rootClientId: "", blocks: action.blocks }); const preservedControlledInnerBlocks = state?.controlledInnerBlocks ?? /* @__PURE__ */ new Set(); if (state?.order) { for (const clientId of preservedControlledInnerBlocks) { if (!newState.byClientId.has(clientId)) { continue; } newState.controlledInnerBlocks.add(clientId); const oldOrder = state.order.get(clientId); if (!oldOrder?.length) { continue; } newState.order.set(clientId, oldOrder); const preserveBlock = (blockId, parentId) => { const blockData = state.byClientId.get(blockId); if (!blockData) { return; } newState.byClientId.set(blockId, blockData); newState.attributes.set( blockId, state.attributes.get(blockId) ); newState.parents.set(blockId, parentId); const childOrder = state.order.get(blockId) || []; newState.order.set(blockId, childOrder); childOrder.forEach( (childId) => preserveBlock(childId, blockId) ); }; oldOrder.forEach((id) => preserveBlock(id, clientId)); } } for (const clientId of newState.controlledInnerBlocks) { const controlledOrder = newState.order.get(clientId); if (!controlledOrder?.length) { continue; } const innerBlocks = controlledOrder.map( (id) => state.tree.get(id) ); const existingEntry = newState.tree.get(clientId); if (existingEntry) { existingEntry.innerBlocks = innerBlocks; } newState.tree.set("controlled||" + clientId, { innerBlocks }); const preserveTreeEntry = (blockId) => { const treeEntry = state.tree.get(blockId); if (!treeEntry) { return; } newState.tree.set(blockId, treeEntry); const childOrder = newState.order.get(blockId) || []; childOrder.forEach(preserveTreeEntry); }; controlledOrder.forEach(preserveTreeEntry); } const preservedBlockEditingModes = state?.blockEditingModes ?? /* @__PURE__ */ new Map(); for (const [clientId, mode2] of preservedBlockEditingModes) { if (!newState.tree.has(clientId)) { continue; } newState.blockEditingModes.set(clientId, mode2); } return newState; } return reducer3(state, action); }; var withReplaceInnerBlocks = (reducer3) => (state, action) => { if (action.type !== "REPLACE_INNER_BLOCKS") { return reducer3(state, action); } const nestedControllers = {}; if (state.controlledInnerBlocks.size) { const stack = [...action.blocks]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.push(...innerBlocks); if (state.controlledInnerBlocks.has(block.clientId)) { nestedControllers[block.clientId] = true; } } } let stateAfterBlocksRemoval = state; if (state.order.get(action.rootClientId)) { stateAfterBlocksRemoval = reducer3(stateAfterBlocksRemoval, { type: "REMOVE_BLOCKS", keepControlledInnerBlocks: nestedControllers, clientIds: state.order.get(action.rootClientId) }); } let stateAfterInsert = stateAfterBlocksRemoval; if (action.blocks.length) { stateAfterInsert = reducer3(stateAfterInsert, { ...action, type: "INSERT_BLOCKS", index: 0 }); const stateAfterInsertOrder = new Map(stateAfterInsert.order); Object.keys(nestedControllers).forEach((key) => { if (state.order.get(key)) { stateAfterInsertOrder.set(key, state.order.get(key)); } }); stateAfterInsert.order = stateAfterInsertOrder; stateAfterInsert.tree = new Map(stateAfterInsert.tree); Object.keys(nestedControllers).forEach((_key) => { const key = `controlled||${_key}`; if (state.tree.has(key)) { stateAfterInsert.tree.set(key, state.tree.get(key)); } }); } return stateAfterInsert; }; var withResetControlledBlocks = (reducer3) => (state, action) => { if (action.type === "SET_HAS_CONTROLLED_INNER_BLOCKS") { const innerBlockOrder = state.order.get(action.clientId); if (innerBlockOrder?.length) { const tempState = reducer3(state, { type: "REPLACE_INNER_BLOCKS", rootClientId: action.clientId, blocks: [] }); return reducer3(tempState, action); } return reducer3(state, action); } return reducer3(state, action); }; var blocks = (0, import_compose.pipe)( import_data2.combineReducers, withBlockTree, // Needs to be before withInnerBlocksRemoveCascade. withInnerBlocksRemoveCascade, withReplaceInnerBlocks, // Needs to be after withInnerBlocksRemoveCascade. withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetControlledBlocks )({ // The state is using a Map instead of a plain object for performance reasons. // You can run the "./test/performance.js" unit test to check the impact // code changes can have on this reducer. byClientId(state = /* @__PURE__ */ new Map(), action) { switch (action.type) { case "RECEIVE_BLOCKS": case "INSERT_BLOCKS": { const newState = new Map(state); getFlattenedBlocksWithoutAttributes(action.blocks).forEach( ([key, value]) => { newState.set(key, value); } ); return newState; } case "UPDATE_BLOCK": { if (!state.has(action.clientId)) { return state; } const { attributes, ...changes } = action.updates; if (Object.values(changes).length === 0) { return state; } const newState = new Map(state); newState.set(action.clientId, { ...state.get(action.clientId), ...changes }); return newState; } case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": { if (!action.blocks) { return state; } const newState = new Map(state); action.replacedClientIds.forEach((clientId) => { newState.delete(clientId); }); getFlattenedBlocksWithoutAttributes(action.blocks).forEach( ([key, value]) => { newState.set(key, value); } ); return newState; } case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const newState = new Map(state); action.removedClientIds.forEach((clientId) => { newState.delete(clientId); }); return newState; } } return state; }, // The state is using a Map instead of a plain object for performance reasons. // You can run the "./test/performance.js" unit test to check the impact // code changes can have on this reducer. attributes(state = /* @__PURE__ */ new Map(), action) { switch (action.type) { case "RECEIVE_BLOCKS": case "INSERT_BLOCKS": { const newState = new Map(state); getFlattenedBlockAttributes(action.blocks).forEach( ([key, value]) => { newState.set(key, value); } ); return newState; } case "UPDATE_BLOCK": { if (!state.get(action.clientId) || !action.updates.attributes) { return state; } const newState = new Map(state); newState.set(action.clientId, { ...state.get(action.clientId), ...action.updates.attributes }); return newState; } case "UPDATE_BLOCK_ATTRIBUTES": { if (action.clientIds.every((id) => !state.get(id))) { return state; } let hasChange = false; const newState = new Map(state); for (const clientId of action.clientIds) { const updatedAttributeEntries = Object.entries( !!action.options?.uniqueByBlock ? action.attributes[clientId] : action.attributes ?? {} ); if (updatedAttributeEntries.length === 0) { continue; } let hasUpdatedAttributes = false; const existingAttributes = state.get(clientId); const newAttributes = {}; updatedAttributeEntries.forEach(([key, value]) => { if (existingAttributes[key] !== value) { hasUpdatedAttributes = true; newAttributes[key] = value; } }); hasChange = hasChange || hasUpdatedAttributes; if (hasUpdatedAttributes) { newState.set(clientId, { ...existingAttributes, ...newAttributes }); } } return hasChange ? newState : state; } case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": { if (!action.blocks) { return state; } const newState = new Map(state); action.replacedClientIds.forEach((clientId) => { newState.delete(clientId); }); getFlattenedBlockAttributes(action.blocks).forEach( ([key, value]) => { newState.set(key, value); } ); return newState; } case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const newState = new Map(state); action.removedClientIds.forEach((clientId) => { newState.delete(clientId); }); return newState; } } return state; }, // The state is using a Map instead of a plain object for performance reasons. // You can run the "./test/performance.js" unit test to check the impact // code changes can have on this reducer. order(state = /* @__PURE__ */ new Map(), action) { switch (action.type) { case "RECEIVE_BLOCKS": { const blockOrder = mapBlockOrder(action.blocks); const newState = new Map(state); blockOrder.forEach((order, clientId) => { if (clientId !== "") { newState.set(clientId, order); } }); newState.set( "", (state.get("") ?? []).concat(blockOrder[""]) ); return newState; } case "INSERT_BLOCKS": { const { rootClientId = "" } = action; const subState = state.get(rootClientId) || []; const mappedBlocks = mapBlockOrder( action.blocks, rootClientId ); const { index: index2 = subState.length } = action; const newState = new Map(state); mappedBlocks.forEach((order, clientId) => { newState.set(clientId, order); }); newState.set( rootClientId, insertAt( subState, mappedBlocks.get(rootClientId), index2 ) ); return newState; } case "MOVE_BLOCKS_TO_POSITION": { const { fromRootClientId = "", toRootClientId = "", clientIds } = action; const { index: index2 = state.get(toRootClientId).length } = action; if (fromRootClientId === toRootClientId) { const subState = state.get(toRootClientId); const fromIndex = subState.indexOf(clientIds[0]); if (fromIndex === -1) { return state; } const newState2 = new Map(state); newState2.set( toRootClientId, moveTo( state.get(toRootClientId), fromIndex, index2, clientIds.length ) ); return newState2; } const newState = new Map(state); newState.set( fromRootClientId, state.get(fromRootClientId)?.filter((id) => !clientIds.includes(id)) ?? [] ); newState.set( toRootClientId, insertAt(state.get(toRootClientId), clientIds, index2) ); return newState; } case "MOVE_BLOCKS_UP": { const { clientIds, rootClientId = "" } = action; const firstClientId = clientIds[0]; const subState = state.get(rootClientId); if (!subState.length || firstClientId === subState[0]) { return state; } const firstIndex = subState.indexOf(firstClientId); const newState = new Map(state); newState.set( rootClientId, moveTo( subState, firstIndex, firstIndex - 1, clientIds.length ) ); return newState; } case "MOVE_BLOCKS_DOWN": { const { clientIds, rootClientId = "" } = action; const firstClientId = clientIds[0]; const lastClientId = clientIds[clientIds.length - 1]; const subState = state.get(rootClientId); if (!subState.length || lastClientId === subState[subState.length - 1]) { return state; } const firstIndex = subState.indexOf(firstClientId); const newState = new Map(state); newState.set( rootClientId, moveTo( subState, firstIndex, firstIndex + 1, clientIds.length ) ); return newState; } case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const { clientIds } = action; if (!action.blocks) { return state; } const mappedBlocks = mapBlockOrder(action.blocks); const newState = new Map(state); action.replacedClientIds.forEach((clientId) => { newState.delete(clientId); }); mappedBlocks.forEach((order, clientId) => { if (clientId !== "") { newState.set(clientId, order); } }); newState.forEach((order, clientId) => { const newSubOrder = Object.values(order).reduce( (result, subClientId) => { if (subClientId === clientIds[0]) { return [...result, ...mappedBlocks.get("")]; } if (clientIds.indexOf(subClientId) === -1) { result.push(subClientId); } return result; }, [] ); newState.set(clientId, newSubOrder); }); return newState; } case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const newState = new Map(state); action.removedClientIds.forEach((clientId) => { newState.delete(clientId); }); newState.forEach((order, clientId) => { const newSubOrder = order?.filter( (id) => !action.removedClientIds.includes(id) ) ?? []; if (newSubOrder.length !== order.length) { newState.set(clientId, newSubOrder); } }); return newState; } } return state; }, // While technically redundant data as the inverse of `order`, it serves as // an optimization for the selectors which derive the ancestry of a block. parents(state = /* @__PURE__ */ new Map(), action) { switch (action.type) { case "RECEIVE_BLOCKS": { const newState = new Map(state); mapBlockParents(action.blocks).forEach( ([key, value]) => { newState.set(key, value); } ); return newState; } case "INSERT_BLOCKS": { const newState = new Map(state); mapBlockParents( action.blocks, action.rootClientId || "" ).forEach(([key, value]) => { newState.set(key, value); }); return newState; } case "MOVE_BLOCKS_TO_POSITION": { const newState = new Map(state); action.clientIds.forEach((id) => { newState.set(id, action.toRootClientId || ""); }); return newState; } case "REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const newState = new Map(state); action.replacedClientIds.forEach((clientId) => { newState.delete(clientId); }); mapBlockParents( action.blocks, state.get(action.clientIds[0]) ).forEach(([key, value]) => { newState.set(key, value); }); return newState; } case "REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN": { const newState = new Map(state); action.removedClientIds.forEach((clientId) => { newState.delete(clientId); }); return newState; } } return state; }, controlledInnerBlocks(state = /* @__PURE__ */ new Set(), { type, clientId, hasControlledInnerBlocks }) { if (type === "SET_HAS_CONTROLLED_INNER_BLOCKS") { if (hasControlledInnerBlocks) { if (state.has(clientId)) { return state; } return new Set(state).add(clientId); } if (!state.has(clientId)) { return state; } const newState = new Set(state); newState.delete(clientId); return newState; } return state; }, blockEditingModes(state = /* @__PURE__ */ new Map(), action) { switch (action.type) { case "SET_BLOCK_EDITING_MODE": if (state.get(action.clientId) === action.mode) { return state; } return new Map(state).set(action.clientId, action.mode); case "UNSET_BLOCK_EDITING_MODE": { if (!state.has(action.clientId)) { return state; } const newState = new Map(state); newState.delete(action.clientId); return newState; } } return state; } }); function isBlockInterfaceHidden(state = false, action) { switch (action.type) { case "HIDE_BLOCK_INTERFACE": return true; case "SHOW_BLOCK_INTERFACE": return false; } return state; } function isTyping(state = false, action) { switch (action.type) { case "START_TYPING": return true; case "STOP_TYPING": return false; } return state; } function isDragging(state = false, action) { switch (action.type) { case "START_DRAGGING": return true; case "STOP_DRAGGING": return false; } return state; } function draggedBlocks(state = [], action) { switch (action.type) { case "START_DRAGGING_BLOCKS": return action.clientIds; case "STOP_DRAGGING_BLOCKS": return []; } return state; } function blockVisibility(state = {}, action) { if (action.type === "SET_BLOCK_VISIBILITY") { return { ...state, ...action.updates }; } return state; } function selectionHelper(state = {}, action) { switch (action.type) { case "CLEAR_SELECTED_BLOCK": { if (state.clientId) { return {}; } return state; } case "SELECT_BLOCK": if (action.clientId === state.clientId) { return state; } return { clientId: action.clientId }; case "REPLACE_INNER_BLOCKS": case "INSERT_BLOCKS": { if (!action.updateSelection || !action.blocks.length) { return state; } return { clientId: action.blocks[0].clientId }; } case "REMOVE_BLOCKS": if (!action.clientIds || !action.clientIds.length || action.clientIds.indexOf(state.clientId) === -1) { return state; } return {}; case "REPLACE_BLOCKS": { if (action.clientIds.indexOf(state.clientId) === -1) { return state; } const blockToSelect = action.blocks[action.indexToSelect] || action.blocks[action.blocks.length - 1]; if (!blockToSelect) { return {}; } if (blockToSelect.clientId === state.clientId) { return state; } return { clientId: blockToSelect.clientId }; } } return state; } function selection(state = {}, action) { switch (action.type) { case "SELECTION_CHANGE": if (action.clientId) { return { selectionStart: { clientId: action.clientId, attributeKey: action.attributeKey, offset: action.startOffset }, selectionEnd: { clientId: action.clientId, attributeKey: action.attributeKey, offset: action.endOffset } }; } return { selectionStart: action.start || state.selectionStart, selectionEnd: action.end || state.selectionEnd }; case "RESET_SELECTION": const { selectionStart: selectionStart2, selectionEnd: selectionEnd2 } = action; return { selectionStart: selectionStart2, selectionEnd: selectionEnd2 }; case "MULTI_SELECT": const nextSelection = { selectionStart: { clientId: action.start }, selectionEnd: { clientId: action.end } }; if ((0, import_es6.default)(state, nextSelection)) { return state; } return nextSelection; case "RESET_BLOCKS": const startClientId = state?.selectionStart?.clientId; const endClientId = state?.selectionEnd?.clientId; if (!startClientId && !endClientId) { return state; } if (!action.blocks.some( (block) => block.clientId === startClientId )) { return { selectionStart: {}, selectionEnd: {} }; } if (!action.blocks.some( (block) => block.clientId === endClientId )) { return { ...state, selectionEnd: state.selectionStart }; } } const selectionStart = selectionHelper(state.selectionStart, action); const selectionEnd = selectionHelper(state.selectionEnd, action); if (selectionStart === state.selectionStart && selectionEnd === state.selectionEnd) { return state; } return { selectionStart, selectionEnd }; } function isMultiSelecting(state = false, action) { switch (action.type) { case "START_MULTI_SELECT": return true; case "STOP_MULTI_SELECT": return false; } return state; } function isSelectionEnabled(state = true, action) { switch (action.type) { case "TOGGLE_SELECTION": return action.isSelectionEnabled; } return state; } function viewportModalClientIds(state = null, action) { switch (action.type) { case "SHOW_VIEWPORT_MODAL": return action.clientIds; case "HIDE_VIEWPORT_MODAL": return null; } return state; } function removalPromptData(state = false, action) { switch (action.type) { case "DISPLAY_BLOCK_REMOVAL_PROMPT": const { clientIds, selectPrevious, message: message2 } = action; return { clientIds, selectPrevious, message: message2 }; case "CLEAR_BLOCK_REMOVAL_PROMPT": return false; } return state; } function blockRemovalRules(state = false, action) { switch (action.type) { case "SET_BLOCK_REMOVAL_RULES": return action.rules; } return state; } function initialPosition(state = null, action) { if (action.type === "REPLACE_BLOCKS" && action.initialPosition !== void 0) { return action.initialPosition; } else if ([ "MULTI_SELECT", "SELECT_BLOCK", "RESET_SELECTION", "INSERT_BLOCKS", "REPLACE_INNER_BLOCKS" ].includes(action.type)) { return action.initialPosition; } return state; } function blocksMode(state = {}, action) { if (action.type === "TOGGLE_BLOCK_MODE") { const { clientId } = action; return { ...state, [clientId]: state[clientId] && state[clientId] === "html" ? "visual" : "html" }; } return state; } function insertionCue(state = null, action) { switch (action.type) { case "SHOW_INSERTION_POINT": { const { rootClientId, index: index2, __unstableWithInserter, operation, nearestSide } = action; const nextState = { rootClientId, index: index2, __unstableWithInserter, operation, nearestSide }; return (0, import_es6.default)(state, nextState) ? state : nextState; } case "HIDE_INSERTION_POINT": return null; } return state; } function template(state = { isValid: true }, action) { switch (action.type) { case "SET_TEMPLATE_VALIDITY": return { ...state, isValid: action.isValid }; } return state; } function settings(state = SETTINGS_DEFAULTS, action) { switch (action.type) { case "UPDATE_SETTINGS": { const updatedSettings = action.reset ? { ...SETTINGS_DEFAULTS, ...action.settings } : { ...state, ...action.settings }; Object.defineProperty(updatedSettings, "__unstableIsPreviewMode", { get() { (0, import_deprecated.default)("__unstableIsPreviewMode", { since: "6.8", alternative: "isPreviewMode" }); return this.isPreviewMode; } }); return updatedSettings; } } return state; } function preferences(state = PREFERENCES_DEFAULTS, action) { switch (action.type) { case "INSERT_BLOCKS": case "REPLACE_BLOCKS": { const nextInsertUsage = action.blocks.reduce( (prevUsage, block) => { const { attributes, name: blockName } = block; let id = blockName; const match2 = (0, import_data2.select)(import_blocks2.store).getActiveBlockVariation( blockName, attributes ); if (match2?.name) { id += "/" + match2.name; } if (blockName === "core/block") { id += "/" + attributes.ref; } return { ...prevUsage, [id]: { time: action.time, count: prevUsage[id] ? prevUsage[id].count + 1 : 1 } }; }, state.insertUsage ); return { ...state, insertUsage: nextInsertUsage }; } } return state; } var blockListSettings = (state = /* @__PURE__ */ new Map(), action) => { switch (action.type) { case "REPLACE_BLOCKS": { const replacementIds = /* @__PURE__ */ new Set(); const stack = [...action.blocks]; while (stack.length) { const block = stack.shift(); replacementIds.add(block.clientId); stack.push(...block.innerBlocks); } const newState = new Map(state); for (const clientId of action.clientIds) { if (!replacementIds.has(clientId)) { newState.delete(clientId); } } return newState; } case "REMOVE_BLOCKS": { const newState = new Map(state); for (const clientId of action.clientIds) { newState.delete(clientId); } return newState; } case "UPDATE_BLOCK_LIST_SETTINGS": { const updates = typeof action.clientId === "string" ? [[action.clientId, action.settings]] : Object.entries(action.clientId); const relevantUpdates = updates.filter( ([clientId, nextSettings]) => !nextSettings ? state.has(clientId) : !(0, import_es6.default)(state.get(clientId), nextSettings) ); if (!relevantUpdates.length) { return state; } const newState = new Map(state); for (const [clientId, nextSettings] of relevantUpdates) { if (!nextSettings) { newState.delete(clientId); } else { newState.set(clientId, nextSettings); } } return newState; } } return state; }; function lastBlockAttributesChange(state = null, action) { switch (action.type) { case "UPDATE_BLOCK": if (!action.updates.attributes) { break; } return { [action.clientId]: action.updates.attributes }; case "UPDATE_BLOCK_ATTRIBUTES": return action.clientIds.reduce( (accumulator, id) => ({ ...accumulator, [id]: !!action.options?.uniqueByBlock ? action.attributes[id] : action.attributes }), {} ); } return state; } function highlightedBlock(state, action) { switch (action.type) { case "TOGGLE_BLOCK_HIGHLIGHT": const { clientId, isHighlighted } = action; if (isHighlighted) { return clientId; } else if (state === clientId) { return null; } return state; case "SELECT_BLOCK": if (action.clientId !== state) { return null; } } return state; } function hasBlockSpotlight(state, action) { switch (action.type) { case "TOGGLE_BLOCK_SPOTLIGHT": const { clientId, hasBlockSpotlight: _hasBlockSpotlight } = action; if (_hasBlockSpotlight) { return clientId; } else if (state === clientId) { return null; } return state; case "SELECT_BLOCK": if (action.clientId !== state) { return null; } return state; case "SELECTION_CHANGE": if (action.start?.clientId !== state || action.end?.clientId !== state) { return null; } return state; case "CLEAR_SELECTED_BLOCK": return null; } return state; } function expandedBlock(state = null, action) { switch (action.type) { case "SET_BLOCK_EXPANDED_IN_LIST_VIEW": return action.clientId; case "SELECT_BLOCK": if (action.clientId !== state) { return null; } } return state; } function lastBlockInserted(state = {}, action) { switch (action.type) { case "INSERT_BLOCKS": case "REPLACE_BLOCKS": if (!action.blocks.length) { return state; } const clientIds = action.blocks.map((block) => { return block.clientId; }); const source = action.meta?.source; return { clientIds, source }; case "RESET_BLOCKS": return {}; } return state; } function editedContentOnlySection(state, action) { if (action.type === "EDIT_CONTENT_ONLY_SECTION") { return action.clientId; } if (!state) { return state; } switch (action.type) { case "REMOVE_BLOCKS": case "REPLACE_BLOCKS": if (action.clientIds.includes(state)) { return void 0; } break; case "RESET_BLOCKS": if (!getFlattenedClientIds(action.blocks)[state]) { return void 0; } break; } return state; } function styleOverrides(state = /* @__PURE__ */ new Map(), action) { switch (action.type) { case "SET_STYLE_OVERRIDE": return new Map(state).set(action.id, action.style); case "DELETE_STYLE_OVERRIDE": { const newState = new Map(state); newState.delete(action.id); return newState; } } return state; } function registeredInserterMediaCategories(state = [], action) { switch (action.type) { case "REGISTER_INSERTER_MEDIA_CATEGORY": return [...state, action.category]; } return state; } function lastFocus(state = false, action) { switch (action.type) { case "LAST_FOCUS": return action.lastFocus; } return state; } function zoomLevel(state = 100, action) { switch (action.type) { case "SET_ZOOM_LEVEL": return action.zoom; case "RESET_ZOOM_LEVEL": return 100; } return state; } function insertionPoint(state = null, action) { switch (action.type) { case "SET_INSERTION_POINT": return action.value; case "SELECT_BLOCK": return null; } return state; } function openedListViewPanels(state = { allOpen: false, panels: {} }, action) { switch (action.type) { case "SET_OPEN_LIST_VIEW_PANEL": return { allOpen: false, panels: action.clientId ? { [action.clientId]: true } : {} }; case "SET_ALL_LIST_VIEW_PANELS_OPEN": return { allOpen: true, panels: {} }; case "TOGGLE_LIST_VIEW_PANEL": return { allOpen: false, panels: { ...state.panels, [action.clientId]: action.isOpen } }; case "REPLACE_BLOCKS": case "REMOVE_BLOCKS": { if (!action.clientIds || action.clientIds.length === 0) { return state; } const newPanels = { ...state.panels }; let hasChanges = false; action.clientIds.forEach((clientId) => { if (clientId in newPanels) { delete newPanels[clientId]; hasChanges = true; } }); return hasChanges ? { ...state, panels: newPanels } : state; } } return state; } function listViewExpandRevision(state = 0, action) { switch (action.type) { case "INCREMENT_LIST_VIEW_EXPAND_REVISION": return state + 1; } return state; } function listViewContentPanelOpen(state = false, action) { switch (action.type) { case "OPEN_LIST_VIEW_CONTENT_PANEL": return true; case "CLOSE_LIST_VIEW_CONTENT_PANEL": return false; // Close when selection is cleared case "CLEAR_SELECTED_BLOCK": return false; } return state; } function requestedInspectorTab(state = null, action) { switch (action.type) { case "REQUEST_INSPECTOR_TAB": return { tabName: action.tabName, options: action.options }; case "CLEAR_REQUESTED_INSPECTOR_TAB": return null; } return state; } function selectedBlockStyleState(state = void 0, action) { switch (action.type) { case "SET_SELECTED_BLOCK_STYLE_STATE": { if (!action.clientId || !action.value) { return void 0; } const showStateOnCanvas = state?.clientId === action.clientId ? state.showStateOnCanvas ?? true : true; const previousValue = state?.clientId === action.clientId ? state.value : {}; return { clientId: action.clientId, showStateOnCanvas, value: { pseudo: "default", ...previousValue, ...action.value } }; } case "SET_SELECTED_BLOCK_STYLE_STATE_CANVAS_PREVIEW": { if (!action.clientId || typeof action.value !== "boolean") { return state; } const previousValue = state?.clientId === action.clientId ? state.value : {}; return { clientId: action.clientId, showStateOnCanvas: action.value, value: { pseudo: "default", ...previousValue } }; } case "SELECT_BLOCK": case "SELECTION_CHANGE": { const startClientId = action.clientId ?? action.start?.clientId; const endClientId = action.clientId ?? action.end?.clientId; if (state?.clientId && (startClientId !== endClientId || state.clientId !== startClientId)) { return void 0; } break; } case "RESET_SELECTION": { if (state?.clientId && state.clientId !== action.selectionStart?.clientId) { return void 0; } break; } case "CLEAR_SELECTED_BLOCK": case "MULTI_SELECT": return void 0; case "REMOVE_BLOCKS": case "REPLACE_BLOCKS": { if (state?.clientId && action.clientIds?.includes(state.clientId)) { return void 0; } break; } case "RESET_BLOCKS": { if (state?.clientId && !getFlattenedClientIds(action.blocks)[state.clientId]) { return void 0; } break; } } return state; } function styleStateViewport(state = "default", action) { if (action.type === "SET_STYLE_STATE_VIEWPORT") { return action.viewport ?? "default"; } return state; } function isResponsiveEditing(state = false, action) { if (action.type === "SET_RESPONSIVE_EDITING") { return action.enabled; } return state; } var combinedReducers = (0, import_data2.combineReducers)({ blocks, isDragging, isTyping, isBlockInterfaceHidden, draggedBlocks, selection, isMultiSelecting, isSelectionEnabled, initialPosition, blocksMode, blockListSettings, insertionPoint, insertionCue, template, settings, preferences, lastBlockAttributesChange, lastFocus, expandedBlock, highlightedBlock, lastBlockInserted, editedContentOnlySection, blockVisibility, viewportModalClientIds, styleOverrides, removalPromptData, blockRemovalRules, registeredInserterMediaCategories, zoomLevel, hasBlockSpotlight, openedListViewPanels, listViewExpandRevision, listViewContentPanelOpen, requestedInspectorTab, selectedBlockStyleState, styleStateViewport, isResponsiveEditing }); function getBlockTreeBlock(state, clientId) { if (clientId === "") { const rootBlock = state.blocks.tree.get(clientId); if (!rootBlock) { return; } return { clientId: "", ...rootBlock }; } if (!state.blocks.controlledInnerBlocks.has(clientId)) { return state.blocks.tree.get(clientId); } const controlledTree = state.blocks.tree.get(`controlled||${clientId}`); const regularTree = state.blocks.tree.get(clientId); return { ...regularTree, innerBlocks: controlledTree?.innerBlocks }; } function traverseBlockTree(state, clientId, callback) { const tree = getBlockTreeBlock(state, clientId); if (!tree) { return; } callback(tree); if (!tree?.innerBlocks?.length) { return; } for (const innerBlock of tree?.innerBlocks) { traverseBlockTree(state, innerBlock.clientId, callback); } } function findParentInClientIdsList(state, clientId, clientIds) { if (!clientIds.length) { return; } let parent = state.blocks.parents.get(clientId); while (parent !== void 0) { if (clientIds.includes(parent)) { return parent; } parent = state.blocks.parents.get(parent); } } function hasBindings(block) { return block?.attributes?.metadata?.bindings && Object.keys(block?.attributes?.metadata?.bindings).length; } function getDerivedBlockEditingModesForTree(state, treeClientId = "") { const isZoomedOut = state?.zoomLevel < 100 || state?.zoomLevel === "auto-scaled"; const derivedBlockEditingModes = /* @__PURE__ */ new Map(); const sectionRootClientId = state.settings?.[sectionRootClientIdKey]; const sectionClientIds = state.blocks.order.get(sectionRootClientId); const hasDisabledBlocks = Array.from(state.blocks.blockEditingModes).some( ([, mode2]) => mode2 === "disabled" ); const templatePartClientIds = []; const syncedPatternClientIds = []; state.blocks.controlledInnerBlocks.forEach((clientId) => { const block = state.blocks.byClientId?.get(clientId); if (block?.name === "core/template-part") { templatePartClientIds.push(clientId); } if (block?.name === "core/block") { syncedPatternClientIds.push(clientId); } }); const contentOnlyTemplateLockedClientIds = Array.from( state.blockListSettings ).flatMap( ([clientId, listSettings]) => listSettings?.templateLock === "contentOnly" ? [clientId] : [] ); const isIsolatedEditor = state.settings?.[isIsolatedEditorKey]; const disableContentOnlyForUnsyncedPatterns = state.settings?.disableContentOnlyForUnsyncedPatterns; const unsyncedPatternClientIds = isIsolatedEditor || disableContentOnlyForUnsyncedPatterns ? [] : Array.from(state.blocks.attributes.keys()).filter( (clientId) => state.blocks.attributes.get(clientId)?.metadata?.patternName ); const disableContentOnlyForTemplateParts = state.settings?.disableContentOnlyForTemplateParts; const contentOnlyParents = [ ...contentOnlyTemplateLockedClientIds, ...unsyncedPatternClientIds, ...isIsolatedEditor || disableContentOnlyForTemplateParts ? [] : templatePartClientIds ]; traverseBlockTree(state, treeClientId, (block) => { const { clientId, name: blockName } = block; const hasEditedContentOnlySection = !!state.editedContentOnlySection; let isWithinEditedContentOnlySection2 = false; if (hasEditedContentOnlySection) { isWithinEditedContentOnlySection2 = clientId === state.editedContentOnlySection || !!findParentInClientIdsList(state, clientId, [ state.editedContentOnlySection ]); if (!isWithinEditedContentOnlySection2) { derivedBlockEditingModes.set(clientId, "disabled"); return; } } if (state.blocks.blockEditingModes.has(clientId)) { return; } if (hasDisabledBlocks) { let ancestorBlockEditingMode; let parent = state.blocks.parents.get(clientId); while (parent !== void 0) { if (state.blocks.blockEditingModes.has(parent)) { ancestorBlockEditingMode = state.blocks.blockEditingModes.get(parent); } if (ancestorBlockEditingMode) { break; } parent = state.blocks.parents.get(parent); } if (ancestorBlockEditingMode === "disabled") { derivedBlockEditingModes.set(clientId, "disabled"); return; } } if (isZoomedOut) { if (clientId === sectionRootClientId) { derivedBlockEditingModes.set(clientId, "contentOnly"); return; } if (!sectionClientIds?.length) { derivedBlockEditingModes.set(clientId, "disabled"); return; } if (sectionClientIds.includes(clientId)) { derivedBlockEditingModes.set(clientId, "contentOnly"); return; } derivedBlockEditingModes.set(clientId, "disabled"); return; } if (syncedPatternClientIds.length) { if (syncedPatternClientIds.includes(clientId)) { if (findParentInClientIdsList( state, clientId, syncedPatternClientIds )) { derivedBlockEditingModes.set(clientId, "disabled"); return; } return; } const parentSyncedPatternClientId = findParentInClientIdsList( state, clientId, syncedPatternClientIds ); if (parentSyncedPatternClientId) { if (findParentInClientIdsList( state, parentSyncedPatternClientId, syncedPatternClientIds )) { derivedBlockEditingModes.set(clientId, "disabled"); return; } if (hasBindings(block)) { derivedBlockEditingModes.set(clientId, "contentOnly"); return; } derivedBlockEditingModes.set(clientId, "disabled"); return; } } if (hasEditedContentOnlySection && isWithinEditedContentOnlySection2) { derivedBlockEditingModes.set(clientId, "default"); return; } if (contentOnlyParents.length) { const hasContentOnlyParent = !!findParentInClientIdsList( state, clientId, contentOnlyParents ); if (hasContentOnlyParent) { if (isContentBlock(blockName)) { derivedBlockEditingModes.set(clientId, "contentOnly"); } else { derivedBlockEditingModes.set(clientId, "disabled"); } } } }); return derivedBlockEditingModes; } function getDerivedBlockEditingModesUpdates({ prevState, nextState, addedBlocks, removedClientIds }) { const prevDerivedBlockEditingModes = prevState.derivedBlockEditingModes; let nextDerivedBlockEditingModes; removedClientIds?.forEach((clientId) => { traverseBlockTree(prevState, clientId, (block) => { if (prevDerivedBlockEditingModes.has(block.clientId)) { if (!nextDerivedBlockEditingModes) { nextDerivedBlockEditingModes = new Map( prevDerivedBlockEditingModes ); } nextDerivedBlockEditingModes.delete(block.clientId); } }); }); addedBlocks?.forEach((addedBlock) => { const updates = getDerivedBlockEditingModesForTree( nextState, addedBlock.clientId ); if (updates.size) { if (!nextDerivedBlockEditingModes) { nextDerivedBlockEditingModes = new Map([ ...prevDerivedBlockEditingModes?.size ? prevDerivedBlockEditingModes : [], ...updates ]); } else { nextDerivedBlockEditingModes = new Map([ ...nextDerivedBlockEditingModes?.size ? nextDerivedBlockEditingModes : [], ...updates ]); } } }); return nextDerivedBlockEditingModes; } function withDerivedBlockEditingModes(reducer3) { return (state, action) => { const nextState = reducer3(state, action); if (action.type !== "SET_EDITOR_MODE" && nextState === state) { return state; } switch (action.type) { case "REMOVE_BLOCKS": { const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, removedClientIds: action.clientIds }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "RECEIVE_BLOCKS": case "INSERT_BLOCKS": { const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks: action.blocks }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "UPDATE_BLOCK_ATTRIBUTES": { const disableContentOnlyForUnsyncedPatterns = nextState.settings?.disableContentOnlyForUnsyncedPatterns; if (disableContentOnlyForUnsyncedPatterns) { break; } const addedBlocks = []; const removedClientIds = []; for (const clientId of action?.clientIds) { const attributes = action.options?.uniqueByBlock ? action.attributes[clientId] : action.attributes; if (!attributes) { break; } if ( // patternName is switching from falsy to truthy, indicating // this block is becoming an unsynced pattern. attributes.metadata?.patternName && !state.blocks.attributes.get(clientId)?.metadata?.patternName ) { addedBlocks.push( nextState.blocks.tree.get(clientId) ); } else if ( // patternName is switching from truthy to falsy, this block is becoming // a regular block but was an unsynced pattern. // Check that `metadata` is part of the included attributes, as // `updateBlockAttributes` merges attributes, if it isn't present // the previous `metadata` would be retained. attributes.metadata && !attributes.metadata?.patternName && state.blocks.attributes.get(clientId)?.metadata?.patternName ) { removedClientIds.push(clientId); } } if (!addedBlocks?.length && !removedClientIds?.length) { break; } const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks, removedClientIds }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "UPDATE_BLOCK_LIST_SETTINGS": { const addedBlocks = []; const removedClientIds = []; const updates = typeof action.clientId === "string" ? { [action.clientId]: action.settings } : action.clientId; for (const clientId in updates) { const isNewContentOnlyBlock = state.blockListSettings.get(clientId)?.templateLock !== "contentOnly" && nextState.blockListSettings.get(clientId)?.templateLock === "contentOnly"; const wasContentOnlyBlock = state.blockListSettings.get(clientId)?.templateLock === "contentOnly" && nextState.blockListSettings.get(clientId)?.templateLock !== "contentOnly"; if (isNewContentOnlyBlock) { addedBlocks.push( nextState.blocks.tree.get(clientId) ); } else if (wasContentOnlyBlock) { removedClientIds.push(clientId); } } if (!addedBlocks.length && !removedClientIds.length) { break; } const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks, removedClientIds }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "SET_BLOCK_EDITING_MODE": case "UNSET_BLOCK_EDITING_MODE": case "SET_HAS_CONTROLLED_INNER_BLOCKS": { const updatedBlock = getBlockTreeBlock( nextState, action.clientId ); if (!updatedBlock) { break; } const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, removedClientIds: [action.clientId], addedBlocks: [updatedBlock] }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "REPLACE_BLOCKS": { const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks: action.blocks, removedClientIds: action.clientIds }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "REPLACE_INNER_BLOCKS": { const removedClientIds = state.blocks.order.get( action.rootClientId ); const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks: action.blocks, removedClientIds }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "MOVE_BLOCKS_TO_POSITION": { const addedBlocks = action.clientIds.map((clientId) => { return nextState.blocks.byClientId.get(clientId); }); const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks, removedClientIds: action.clientIds }); if (nextDerivedBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes ?? state.derivedBlockEditingModes }; } break; } case "UPDATE_SETTINGS": { if (state?.settings?.[sectionRootClientIdKey] !== nextState?.settings?.[sectionRootClientIdKey] || !!state?.settings?.disableContentOnlyForUnsyncedPatterns !== !!nextState?.settings?.disableContentOnlyForUnsyncedPatterns || !!state?.settings?.[isIsolatedEditorKey] !== !!nextState?.settings?.[isIsolatedEditorKey] || !!state?.settings?.disableContentOnlyForTemplateParts !== !!nextState?.settings?.disableContentOnlyForTemplateParts) { return { ...nextState, derivedBlockEditingModes: getDerivedBlockEditingModesForTree(nextState) }; } break; } case "RESET_BLOCKS": case "EDIT_CONTENT_ONLY_SECTION": case "SET_EDITOR_MODE": case "RESET_ZOOM_LEVEL": case "SET_ZOOM_LEVEL": { return { ...nextState, derivedBlockEditingModes: getDerivedBlockEditingModesForTree(nextState) }; } } nextState.derivedBlockEditingModes = state?.derivedBlockEditingModes ?? /* @__PURE__ */ new Map(); return nextState; }; } function withAutomaticChangeReset(reducer3) { return (state, action) => { const nextState = reducer3(state, action); if (!state) { return nextState; } nextState.automaticChangeStatus = state.automaticChangeStatus; if (action.type === "MARK_AUTOMATIC_CHANGE") { return { ...nextState, automaticChangeStatus: "pending" }; } if (action.type === "MARK_AUTOMATIC_CHANGE_FINAL" && state.automaticChangeStatus === "pending") { return { ...nextState, automaticChangeStatus: "final" }; } if (nextState.blocks === state.blocks && nextState.selection === state.selection) { return nextState; } if (nextState.automaticChangeStatus !== "final" && nextState.selection !== state.selection) { return nextState; } return { ...nextState, automaticChangeStatus: void 0 }; }; } var reducer_default = (0, import_compose.pipe)( withDerivedBlockEditingModes, withAutomaticChangeReset )(combinedReducers); // packages/block-editor/build-module/store/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { __experimentalGetActiveBlockIdByBlockNames: () => __experimentalGetActiveBlockIdByBlockNames, __experimentalGetAllowedBlocks: () => __experimentalGetAllowedBlocks, __experimentalGetAllowedPatterns: () => __experimentalGetAllowedPatterns, __experimentalGetBlockListSettingsForBlocks: () => __experimentalGetBlockListSettingsForBlocks, __experimentalGetDirectInsertBlock: () => __experimentalGetDirectInsertBlock, __experimentalGetGlobalBlocksByName: () => __experimentalGetGlobalBlocksByName, __experimentalGetLastBlockAttributeChanges: () => __experimentalGetLastBlockAttributeChanges, __experimentalGetParsedPattern: () => __experimentalGetParsedPattern, __experimentalGetPatternTransformItems: () => __experimentalGetPatternTransformItems, __experimentalGetPatternsByBlockTypes: () => __experimentalGetPatternsByBlockTypes, __experimentalGetReusableBlockTitle: () => __experimentalGetReusableBlockTitle, __unstableGetBlockWithoutInnerBlocks: () => __unstableGetBlockWithoutInnerBlocks, __unstableGetClientIdWithClientIdsTree: () => __unstableGetClientIdWithClientIdsTree, __unstableGetClientIdsTree: () => __unstableGetClientIdsTree, __unstableGetContentLockingParent: () => __unstableGetContentLockingParent, __unstableGetLastBlockChangeHistoryMode: () => __unstableGetLastBlockChangeHistoryMode, __unstableGetSelectedBlocksWithPartialSelection: () => __unstableGetSelectedBlocksWithPartialSelection, __unstableGetTemporarilyEditingAsBlocks: () => __unstableGetTemporarilyEditingAsBlocks, __unstableGetVisibleBlocks: () => __unstableGetVisibleBlocks, __unstableHasActiveBlockOverlayActive: () => __unstableHasActiveBlockOverlayActive, __unstableIsFullySelected: () => __unstableIsFullySelected, __unstableIsLastBlockChangeIgnored: () => __unstableIsLastBlockChangeIgnored, __unstableIsSelectionCollapsed: () => __unstableIsSelectionCollapsed, __unstableIsSelectionMergeable: () => __unstableIsSelectionMergeable, __unstableIsWithinBlockOverlay: () => __unstableIsWithinBlockOverlay, __unstableSelectionHasUnmergeableBlock: () => __unstableSelectionHasUnmergeableBlock, areInnerBlocksControlled: () => areInnerBlocksControlled, canEditBlock: () => canEditBlock, canInsertBlockType: () => canInsertBlockType, canInsertBlocks: () => canInsertBlocks, canLockBlockType: () => canLockBlockType, canMoveBlock: () => canMoveBlock, canMoveBlocks: () => canMoveBlocks, canRemoveBlock: () => canRemoveBlock, canRemoveBlocks: () => canRemoveBlocks, didAutomaticChange: () => didAutomaticChange, getAdjacentBlockClientId: () => getAdjacentBlockClientId, getAllowedBlocks: () => getAllowedBlocks, getBlock: () => getBlock, getBlockAttributes: () => getBlockAttributes, getBlockCount: () => getBlockCount, getBlockEditingMode: () => getBlockEditingMode, getBlockHierarchyRootClientId: () => getBlockHierarchyRootClientId, getBlockIndex: () => getBlockIndex, getBlockInsertionPoint: () => getBlockInsertionPoint, getBlockListSettings: () => getBlockListSettings, getBlockMode: () => getBlockMode, getBlockName: () => getBlockName, getBlockNamesByClientId: () => getBlockNamesByClientId, getBlockOrder: () => getBlockOrder, getBlockParents: () => getBlockParents, getBlockParentsByBlockName: () => getBlockParentsByBlockName, getBlockRootClientId: () => getBlockRootClientId, getBlockSelectionEnd: () => getBlockSelectionEnd, getBlockSelectionStart: () => getBlockSelectionStart, getBlockTransformItems: () => getBlockTransformItems, getBlocks: () => getBlocks, getBlocksByClientId: () => getBlocksByClientId, getBlocksByName: () => getBlocksByName, getClientIdsOfDescendants: () => getClientIdsOfDescendants, getClientIdsWithDescendants: () => getClientIdsWithDescendants, getDirectInsertBlock: () => getDirectInsertBlock, getDraggedBlockClientIds: () => getDraggedBlockClientIds, getFirstMultiSelectedBlockClientId: () => getFirstMultiSelectedBlockClientId, getGlobalBlockCount: () => getGlobalBlockCount, getHoveredBlockClientId: () => getHoveredBlockClientId, getInserterItems: () => getInserterItems, getLastMultiSelectedBlockClientId: () => getLastMultiSelectedBlockClientId, getLowestCommonAncestorWithSelectedBlock: () => getLowestCommonAncestorWithSelectedBlock, getMultiSelectedBlockClientIds: () => getMultiSelectedBlockClientIds, getMultiSelectedBlocks: () => getMultiSelectedBlocks, getMultiSelectedBlocksEndClientId: () => getMultiSelectedBlocksEndClientId, getMultiSelectedBlocksStartClientId: () => getMultiSelectedBlocksStartClientId, getNextBlockClientId: () => getNextBlockClientId, getPatternsByBlockTypes: () => getPatternsByBlockTypes, getPreviousBlockClientId: () => getPreviousBlockClientId, getSelectedBlock: () => getSelectedBlock, getSelectedBlockClientId: () => getSelectedBlockClientId, getSelectedBlockClientIds: () => getSelectedBlockClientIds, getSelectedBlockCount: () => getSelectedBlockCount, getSelectedBlocksInitialCaretPosition: () => getSelectedBlocksInitialCaretPosition, getSelectionEnd: () => getSelectionEnd, getSelectionStart: () => getSelectionStart, getSettings: () => getSettings, getTemplate: () => getTemplate, getTemplateLock: () => getTemplateLock, hasBlockMovingClientId: () => hasBlockMovingClientId, hasDraggedInnerBlock: () => hasDraggedInnerBlock, hasInserterItems: () => hasInserterItems, hasMultiSelection: () => hasMultiSelection, hasSelectedBlock: () => hasSelectedBlock, hasSelectedInnerBlock: () => hasSelectedInnerBlock, isAncestorBeingDragged: () => isAncestorBeingDragged, isAncestorMultiSelected: () => isAncestorMultiSelected, isBlockBeingDragged: () => isBlockBeingDragged, isBlockHighlighted: () => isBlockHighlighted, isBlockInsertionPointVisible: () => isBlockInsertionPointVisible, isBlockMultiSelected: () => isBlockMultiSelected, isBlockSelected: () => isBlockSelected, isBlockValid: () => isBlockValid, isBlockVisible: () => isBlockVisible, isBlockWithinSelection: () => isBlockWithinSelection, isCaretWithinFormattedText: () => isCaretWithinFormattedText, isDraggingBlocks: () => isDraggingBlocks, isFirstMultiSelectedBlock: () => isFirstMultiSelectedBlock, isGroupable: () => isGroupable, isLastBlockChangePersistent: () => isLastBlockChangePersistent, isMultiSelecting: () => isMultiSelecting2, isSelectionEnabled: () => isSelectionEnabled2, isTyping: () => isTyping2, isUngroupable: () => isUngroupable, isValidTemplate: () => isValidTemplate, wasBlockJustInserted: () => wasBlockJustInserted }); var import_blocks7 = __toESM(require_blocks(), 1); var import_hooks2 = __toESM(require_hooks(), 1); // packages/icons/build-module/icon/index.mjs var import_element5 = __toESM(require_element(), 1); var icon_default = (0, import_element5.forwardRef)( ({ icon, size: size4 = 24, ...props }, ref) => { return (0, import_element5.cloneElement)(icon, { width: size4, height: size4, ...props, ref }); } ); // packages/icons/build-module/library/align-center.mjs var import_primitives = __toESM(require_primitives(), 1); var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var align_center_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.Path, { d: "M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z" }) }); // packages/icons/build-module/library/align-justify.mjs var import_primitives2 = __toESM(require_primitives(), 1); var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); var align_justify_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.Path, { d: "M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z" }) }); // packages/icons/build-module/library/align-left.mjs var import_primitives3 = __toESM(require_primitives(), 1); var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); var align_left_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.Path, { d: "M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z" }) }); // packages/icons/build-module/library/align-none.mjs var import_primitives4 = __toESM(require_primitives(), 1); var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); var align_none_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.Path, { d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z" }) }); // packages/icons/build-module/library/align-right.mjs var import_primitives5 = __toESM(require_primitives(), 1); var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); var align_right_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.Path, { d: "M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z" }) }); // packages/icons/build-module/library/arrow-down.mjs var import_primitives6 = __toESM(require_primitives(), 1); var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); var arrow_down_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.Path, { d: "m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z" }) }); // packages/icons/build-module/library/arrow-left.mjs var import_primitives7 = __toESM(require_primitives(), 1); var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); var arrow_left_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives7.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" }) }); // packages/icons/build-module/library/arrow-right.mjs var import_primitives8 = __toESM(require_primitives(), 1); var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); var arrow_right_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives8.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) }); // packages/icons/build-module/library/aspect-ratio.mjs var import_primitives9 = __toESM(require_primitives(), 1); var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); var aspect_ratio_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives9.Path, { d: "M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z" }) }); // packages/icons/build-module/library/audio.mjs var import_primitives10 = __toESM(require_primitives(), 1); var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); var audio_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives10.Path, { d: "M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z" }) }); // packages/icons/build-module/library/block-default.mjs var import_primitives11 = __toESM(require_primitives(), 1); var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); var block_default_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives11.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" }) }); // packages/icons/build-module/library/category.mjs var import_primitives12 = __toESM(require_primitives(), 1); var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); var category_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives12.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z" }) }); // packages/icons/build-module/library/caution.mjs var import_primitives13 = __toESM(require_primitives(), 1); var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); var caution_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives13.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 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z" }) }); // packages/icons/build-module/library/check.mjs var import_primitives14 = __toESM(require_primitives(), 1); var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); var check_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives14.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) }); // packages/icons/build-module/library/chevron-down.mjs var import_primitives15 = __toESM(require_primitives(), 1); var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives15.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) }); // packages/icons/build-module/library/chevron-left-small.mjs var import_primitives16 = __toESM(require_primitives(), 1); var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives16.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) }); // packages/icons/build-module/library/chevron-left.mjs var import_primitives17 = __toESM(require_primitives(), 1); var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives17.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives17.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) }); // packages/icons/build-module/library/chevron-right-small.mjs var import_primitives18 = __toESM(require_primitives(), 1); var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives18.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives18.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) }); // packages/icons/build-module/library/chevron-right.mjs var import_primitives19 = __toESM(require_primitives(), 1); var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives19.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives19.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) }); // packages/icons/build-module/library/chevron-up.mjs var import_primitives20 = __toESM(require_primitives(), 1); var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives20.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives20.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) }); // packages/icons/build-module/library/close-small.mjs var import_primitives21 = __toESM(require_primitives(), 1); var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives21.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives21.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" }) }); // packages/icons/build-module/library/cog.mjs var import_primitives22 = __toESM(require_primitives(), 1); var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); var cog_default = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives22.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives22.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z" }) }); // packages/icons/build-module/library/copy-small.mjs var import_primitives23 = __toESM(require_primitives(), 1); var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); var copy_small_default = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives23.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives23.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" }) }); // packages/icons/build-module/library/copy.mjs var import_primitives24 = __toESM(require_primitives(), 1); var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); var copy_default = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives24.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives24.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z" }) }); // packages/icons/build-module/library/corner-all.mjs var import_primitives25 = __toESM(require_primitives(), 1); var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); var corner_all_default = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives25.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives25.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5Zm-12.5 9v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }); // packages/icons/build-module/library/corner-bottom-left.mjs var import_primitives26 = __toESM(require_primitives(), 1); var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); var corner_bottom_left_default = /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_primitives26.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives26.G, { opacity: ".25", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives26.Path, { d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }), /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives26.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5.75 15v3c0 .138.112.25.25.25h3v1.5H6A1.75 1.75 0 0 1 4.25 18v-3h1.5Z" }) ] }); // packages/icons/build-module/library/corner-bottom-right.mjs var import_primitives27 = __toESM(require_primitives(), 1); var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); var corner_bottom_right_default = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_primitives27.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives27.G, { opacity: ".25", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives27.Path, { d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }), /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives27.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M15 18.25h3a.25.25 0 0 0 .25-.25v-3h1.5v3A1.75 1.75 0 0 1 18 19.75h-3v-1.5Z" }) ] }); // packages/icons/build-module/library/corner-top-left.mjs var import_primitives28 = __toESM(require_primitives(), 1); var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); var corner_top_left_default = /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_primitives28.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives28.G, { opacity: ".25", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives28.Path, { d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }), /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives28.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M6 5.75a.25.25 0 0 0-.25.25v3h-1.5V6c0-.966.784-1.75 1.75-1.75h3v1.5H6Z" }) ] }); // packages/icons/build-module/library/corner-top-right.mjs var import_primitives29 = __toESM(require_primitives(), 1); var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); var corner_top_right_default = /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_primitives29.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives29.G, { opacity: ".25", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives29.Path, { d: "M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z" }) }), /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives29.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5Z" }) ] }); // packages/icons/build-module/library/desktop.mjs var import_primitives30 = __toESM(require_primitives(), 1); var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); var desktop_default = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.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" }) }); // packages/icons/build-module/library/drag-handle.mjs var import_primitives31 = __toESM(require_primitives(), 1); var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); var drag_handle_default = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives31.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives31.Path, { d: "M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z" }) }); // packages/icons/build-module/library/envelope.mjs var import_primitives32 = __toESM(require_primitives(), 1); var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); var envelope_default = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives32.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives32.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M3 7c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Zm2-.5h14c.3 0 .5.2.5.5v1L12 13.5 4.5 7.9V7c0-.3.2-.5.5-.5Zm-.5 3.3V17c0 .3.2.5.5.5h14c.3 0 .5-.2.5-.5V9.8L12 15.4 4.5 9.8Z" }) }); // packages/icons/build-module/library/error.mjs var import_primitives33 = __toESM(require_primitives(), 1); var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); var error_default = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives33.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives33.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z" }) }); // packages/icons/build-module/library/external.mjs var import_primitives34 = __toESM(require_primitives(), 1); var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); var external_default = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives34.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives34.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" }) }); // packages/icons/build-module/library/file.mjs var import_primitives35 = __toESM(require_primitives(), 1); var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); var file_default = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives35.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives35.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z" }) }); // packages/icons/build-module/library/filter.mjs var import_primitives36 = __toESM(require_primitives(), 1); var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); var filter_default = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives36.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives36.Path, { d: "M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z" }) }); // packages/icons/build-module/library/format-capitalize.mjs var import_primitives37 = __toESM(require_primitives(), 1); var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); var format_capitalize_default = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives37.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives37.Path, { d: "M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z" }) }); // packages/icons/build-module/library/format-lowercase.mjs var import_primitives38 = __toESM(require_primitives(), 1); var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); var format_lowercase_default = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives38.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives38.Path, { d: "M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z" }) }); // packages/icons/build-module/library/format-strikethrough.mjs var import_primitives39 = __toESM(require_primitives(), 1); var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); var format_strikethrough_default = /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives39.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives39.Path, { d: "M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z" }) }); // packages/icons/build-module/library/format-underline.mjs var import_primitives40 = __toESM(require_primitives(), 1); var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1); var format_underline_default = /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives40.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives40.Path, { d: "M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z" }) }); // packages/icons/build-module/library/format-uppercase.mjs var import_primitives41 = __toESM(require_primitives(), 1); var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1); var format_uppercase_default = /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives41.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives41.Path, { d: "M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z" }) }); // packages/icons/build-module/library/full-height.mjs var import_primitives42 = __toESM(require_primitives(), 1); var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1); var full_height_default = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives42.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives42.Path, { d: "M12.75 19.45 15 17.5l1 1.1-4 3.4-4-3.4 1-1.1 2.25 1.95V14.5h1.5v4.95ZM19 12.75H5v-1.5h14v1.5ZM16 5.4l-1 1.1-2.25-1.95V9.5h-1.5V4.55L9 6.5 8 5.4 12 2l4 3.4Z" }) }); // packages/icons/build-module/library/fullscreen.mjs var import_primitives43 = __toESM(require_primitives(), 1); var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1); var fullscreen_default = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives43.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives43.Path, { d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" }) }); // packages/icons/build-module/library/globe.mjs var import_primitives44 = __toESM(require_primitives(), 1); var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1); var globe_default = /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives44.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives44.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-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z" }) }); // packages/icons/build-module/library/grid.mjs var import_primitives45 = __toESM(require_primitives(), 1); var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1); var grid_default = /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_primitives45.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_primitives45.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z" }) }); // packages/icons/build-module/library/group.mjs var import_primitives46 = __toESM(require_primitives(), 1); var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1); var group_default = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_primitives46.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_primitives46.Path, { d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z" }) }); // packages/icons/build-module/library/heading-level-1.mjs var import_primitives47 = __toESM(require_primitives(), 1); var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1); var heading_level_1_default = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_primitives47.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_primitives47.Path, { d: "M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z" }) }); // packages/icons/build-module/library/heading-level-2.mjs var import_primitives48 = __toESM(require_primitives(), 1); var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1); var heading_level_2_default = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_primitives48.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_primitives48.Path, { d: "M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z" }) }); // packages/icons/build-module/library/heading-level-3.mjs var import_primitives49 = __toESM(require_primitives(), 1); var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1); var heading_level_3_default = /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_primitives49.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_primitives49.Path, { d: "M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z" }) }); // packages/icons/build-module/library/heading-level-4.mjs var import_primitives50 = __toESM(require_primitives(), 1); var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1); var heading_level_4_default = /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_primitives50.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_primitives50.Path, { d: "M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z" }) }); // packages/icons/build-module/library/heading-level-5.mjs var import_primitives51 = __toESM(require_primitives(), 1); var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1); var heading_level_5_default = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_primitives51.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_primitives51.Path, { d: "M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z" }) }); // packages/icons/build-module/library/heading-level-6.mjs var import_primitives52 = __toESM(require_primitives(), 1); var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1); var heading_level_6_default = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_primitives52.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_primitives52.Path, { d: "M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z" }) }); // packages/icons/build-module/library/home.mjs var import_primitives53 = __toESM(require_primitives(), 1); var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1); var home_default = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_primitives53.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_primitives53.Path, { d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" }) }); // packages/icons/build-module/library/image.mjs var import_primitives54 = __toESM(require_primitives(), 1); var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1); var image_default = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_primitives54.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_primitives54.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" }) }); // packages/icons/build-module/library/info.mjs var import_primitives55 = __toESM(require_primitives(), 1); var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1); var info_default = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_primitives55.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_primitives55.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" }) }); // packages/icons/build-module/library/justify-bottom.mjs var import_primitives56 = __toESM(require_primitives(), 1); var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1); var justify_bottom_default = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_primitives56.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_primitives56.Path, { d: "M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z" }) }); // packages/icons/build-module/library/justify-center-vertical.mjs var import_primitives57 = __toESM(require_primitives(), 1); var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1); var justify_center_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_primitives57.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_primitives57.Path, { d: "M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z" }) }); // packages/icons/build-module/library/justify-center.mjs var import_primitives58 = __toESM(require_primitives(), 1); var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1); var justify_center_default = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_primitives58.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_primitives58.Path, { d: "M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z" }) }); // packages/icons/build-module/library/justify-left.mjs var import_primitives59 = __toESM(require_primitives(), 1); var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1); var justify_left_default = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_primitives59.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_primitives59.Path, { d: "M9 9v6h11V9H9zM4 20h1.5V4H4v16z" }) }); // packages/icons/build-module/library/justify-right.mjs var import_primitives60 = __toESM(require_primitives(), 1); var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1); var justify_right_default = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_primitives60.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_primitives60.Path, { d: "M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z" }) }); // packages/icons/build-module/library/justify-space-between-vertical.mjs var import_primitives61 = __toESM(require_primitives(), 1); var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1); var justify_space_between_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_primitives61.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_primitives61.Path, { d: "M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z" }) }); // packages/icons/build-module/library/justify-space-between.mjs var import_primitives62 = __toESM(require_primitives(), 1); var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1); var justify_space_between_default = /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_primitives62.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_primitives62.Path, { d: "M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z" }) }); // packages/icons/build-module/library/justify-stretch-vertical.mjs var import_primitives63 = __toESM(require_primitives(), 1); var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1); var justify_stretch_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_primitives63.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_primitives63.Path, { d: "M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z" }) }); // packages/icons/build-module/library/justify-stretch.mjs var import_primitives64 = __toESM(require_primitives(), 1); var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1); var justify_stretch_default = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_primitives64.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_primitives64.Path, { d: "M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z" }) }); // packages/icons/build-module/library/justify-top.mjs var import_primitives65 = __toESM(require_primitives(), 1); var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1); var justify_top_default = /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_primitives65.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_primitives65.Path, { d: "M9 20h6V9H9v11zM4 4v1.5h16V4H4z" }) }); // packages/icons/build-module/library/keyboard-return.mjs var import_primitives66 = __toESM(require_primitives(), 1); var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1); var keyboard_return_default = /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_primitives66.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_primitives66.Path, { d: "m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z" }) }); // packages/icons/build-module/library/layout.mjs var import_primitives67 = __toESM(require_primitives(), 1); var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1); var layout_default = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_primitives67.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_primitives67.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" }) }); // packages/icons/build-module/library/link-off.mjs var import_primitives68 = __toESM(require_primitives(), 1); var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1); var link_off_default = /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_primitives68.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_primitives68.Path, { d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z" }) }); // packages/icons/build-module/library/link.mjs var import_primitives69 = __toESM(require_primitives(), 1); var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1); var link_default = /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_primitives69.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_primitives69.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) }); // packages/icons/build-module/library/list-view.mjs var import_primitives70 = __toESM(require_primitives(), 1); var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1); var list_view_default = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_primitives70.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_primitives70.Path, { d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z" }) }); // packages/icons/build-module/library/lock-outline.mjs var import_primitives71 = __toESM(require_primitives(), 1); var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1); var lock_outline_default = /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_primitives71.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_primitives71.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z" }) }); // packages/icons/build-module/library/lock-small.mjs var import_primitives72 = __toESM(require_primitives(), 1); var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1); var lock_small_default = /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_primitives72.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_primitives72.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" }) }); // packages/icons/build-module/library/lock.mjs var import_primitives73 = __toESM(require_primitives(), 1); var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1); var lock_default = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives73.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives73.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z" }) }); // packages/icons/build-module/library/media.mjs var import_primitives74 = __toESM(require_primitives(), 1); var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1); var media_default = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_primitives74.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_primitives74.Path, { d: "m7 6.5 4 2.5-4 2.5z" }), /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_primitives74.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z" }) ] }); // packages/icons/build-module/library/mobile.mjs var import_primitives75 = __toESM(require_primitives(), 1); var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1); var mobile_default = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives75.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives75.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" }) }); // packages/icons/build-module/library/more-vertical.mjs var import_primitives76 = __toESM(require_primitives(), 1); var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1); var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_primitives76.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_primitives76.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); // packages/icons/build-module/library/page.mjs var import_primitives77 = __toESM(require_primitives(), 1); var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1); var page_default = /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_primitives77.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_primitives77.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }), /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_primitives77.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" }) ] }); // packages/icons/build-module/library/paragraph.mjs var import_primitives78 = __toESM(require_primitives(), 1); var import_jsx_runtime80 = __toESM(require_jsx_runtime(), 1); var paragraph_default = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_primitives78.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_primitives78.Path, { d: "m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z" }) }); // packages/icons/build-module/library/pencil.mjs var import_primitives79 = __toESM(require_primitives(), 1); var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1); var pencil_default = /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_primitives79.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_primitives79.Path, { d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) }); // packages/icons/build-module/library/pin-small.mjs var import_primitives80 = __toESM(require_primitives(), 1); var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1); var pin_small_default = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_primitives80.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_primitives80.Path, { d: "M10.97 10.159a3.382 3.382 0 0 0-2.857.955l1.724 1.723-2.836 2.913L7 17h1.25l2.913-2.837 1.723 1.723a3.38 3.38 0 0 0 .606-.825c.33-.63.446-1.343.35-2.032L17 10.695 13.305 7l-2.334 3.159Z" }) }); // packages/icons/build-module/library/plus.mjs var import_primitives81 = __toESM(require_primitives(), 1); var import_jsx_runtime83 = __toESM(require_jsx_runtime(), 1); var plus_default = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_primitives81.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_primitives81.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) }); // packages/icons/build-module/library/position-center.mjs var import_primitives82 = __toESM(require_primitives(), 1); var import_jsx_runtime84 = __toESM(require_jsx_runtime(), 1); var position_center_default = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_primitives82.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_primitives82.Path, { d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z" }) }); // packages/icons/build-module/library/position-left.mjs var import_primitives83 = __toESM(require_primitives(), 1); var import_jsx_runtime85 = __toESM(require_jsx_runtime(), 1); var position_left_default = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_primitives83.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_primitives83.Path, { d: "M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z" }) }); // packages/icons/build-module/library/position-right.mjs var import_primitives84 = __toESM(require_primitives(), 1); var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1); var position_right_default = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_primitives84.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_primitives84.Path, { d: "M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z" }) }); // packages/icons/build-module/library/post-featured-image.mjs var import_primitives85 = __toESM(require_primitives(), 1); var import_jsx_runtime87 = __toESM(require_jsx_runtime(), 1); var post_featured_image_default = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_primitives85.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_primitives85.Path, { d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z" }) }); // packages/icons/build-module/library/post-list.mjs var import_primitives86 = __toESM(require_primitives(), 1); var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1); var post_list_default = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_primitives86.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_primitives86.Path, { d: "M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z" }) }); // packages/icons/build-module/library/reset.mjs var import_primitives87 = __toESM(require_primitives(), 1); var import_jsx_runtime89 = __toESM(require_jsx_runtime(), 1); var reset_default = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_primitives87.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_primitives87.Path, { d: "M7 11.5h10V13H7z" }) }); // packages/icons/build-module/library/rotate-right.mjs var import_primitives88 = __toESM(require_primitives(), 1); var import_jsx_runtime90 = __toESM(require_jsx_runtime(), 1); var rotate_right_default = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_primitives88.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_primitives88.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" }) }); // packages/icons/build-module/library/row.mjs var import_primitives89 = __toESM(require_primitives(), 1); var import_jsx_runtime91 = __toESM(require_jsx_runtime(), 1); var row_default = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_primitives89.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_primitives89.Path, { d: "M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z" }) }); // packages/icons/build-module/library/search.mjs var import_primitives90 = __toESM(require_primitives(), 1); var import_jsx_runtime92 = __toESM(require_jsx_runtime(), 1); var search_default = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_primitives90.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_primitives90.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) }); // packages/icons/build-module/library/seen.mjs var import_primitives91 = __toESM(require_primitives(), 1); var import_jsx_runtime93 = __toESM(require_jsx_runtime(), 1); var seen_default = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_primitives91.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_primitives91.Path, { d: "M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z" }) }); // packages/icons/build-module/library/settings.mjs var import_primitives92 = __toESM(require_primitives(), 1); var import_jsx_runtime94 = __toESM(require_jsx_runtime(), 1); var settings_default = /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_primitives92.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_primitives92.Path, { d: "m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" }), /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_primitives92.Path, { d: "m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" }) ] }); // packages/icons/build-module/library/shadow.mjs var import_primitives93 = __toESM(require_primitives(), 1); var import_jsx_runtime95 = __toESM(require_jsx_runtime(), 1); var shadow_default = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_primitives93.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_primitives93.Path, { d: "M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z" }) }); // packages/icons/build-module/library/sides-all.mjs var import_primitives94 = __toESM(require_primitives(), 1); var import_jsx_runtime96 = __toESM(require_jsx_runtime(), 1); var sides_all_default = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_primitives94.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_primitives94.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z" }) }); // packages/icons/build-module/library/sides-bottom.mjs var import_primitives95 = __toESM(require_primitives(), 1); var import_jsx_runtime97 = __toESM(require_jsx_runtime(), 1); var sides_bottom_default = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_primitives95.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_primitives95.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } }), /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_primitives95.Path, { d: "m16.5 19.5h-9v-1.5h9z" }) ] }); // packages/icons/build-module/library/sides-horizontal.mjs var import_primitives96 = __toESM(require_primitives(), 1); var import_jsx_runtime98 = __toESM(require_jsx_runtime(), 1); var sides_horizontal_default = /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_primitives96.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_primitives96.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } }), /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_primitives96.Path, { d: "m4.5 7.5v9h1.5v-9z" }), /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_primitives96.Path, { d: "m18 7.5v9h1.5v-9z" }) ] }); // packages/icons/build-module/library/sides-left.mjs var import_primitives97 = __toESM(require_primitives(), 1); var import_jsx_runtime99 = __toESM(require_jsx_runtime(), 1); var sides_left_default = /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_primitives97.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_primitives97.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } }), /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_primitives97.Path, { d: "m4.5 16.5v-9h1.5v9z" }) ] }); // packages/icons/build-module/library/sides-right.mjs var import_primitives98 = __toESM(require_primitives(), 1); var import_jsx_runtime100 = __toESM(require_jsx_runtime(), 1); var sides_right_default = /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_primitives98.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_primitives98.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } }), /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_primitives98.Path, { d: "m18 16.5v-9h1.5v9z" }) ] }); // packages/icons/build-module/library/sides-top.mjs var import_primitives99 = __toESM(require_primitives(), 1); var import_jsx_runtime101 = __toESM(require_jsx_runtime(), 1); var sides_top_default = /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_primitives99.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_primitives99.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } }), /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_primitives99.Path, { d: "m16.5 6h-9v-1.5h9z" }) ] }); // packages/icons/build-module/library/sides-vertical.mjs var import_primitives100 = __toESM(require_primitives(), 1); var import_jsx_runtime102 = __toESM(require_jsx_runtime(), 1); var sides_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_primitives100.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_primitives100.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } }), /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_primitives100.Path, { d: "m7.5 6h9v-1.5h-9z" }), /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_primitives100.Path, { d: "m7.5 19.5h9v-1.5h-9z" }) ] }); // packages/icons/build-module/library/stack.mjs var import_primitives101 = __toESM(require_primitives(), 1); var import_jsx_runtime103 = __toESM(require_jsx_runtime(), 1); var stack_default = /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_primitives101.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_primitives101.Path, { d: "M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z" }) }); // packages/icons/build-module/library/stretch-full-width.mjs var import_primitives102 = __toESM(require_primitives(), 1); var import_jsx_runtime104 = __toESM(require_jsx_runtime(), 1); var stretch_full_width_default = /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_primitives102.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_primitives102.Path, { d: "M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z" }) }); // packages/icons/build-module/library/stretch-wide.mjs var import_primitives103 = __toESM(require_primitives(), 1); var import_jsx_runtime105 = __toESM(require_jsx_runtime(), 1); var stretch_wide_default = /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_primitives103.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_primitives103.Path, { d: "M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z" }) }); // packages/icons/build-module/library/styles.mjs var import_primitives104 = __toESM(require_primitives(), 1); var import_jsx_runtime106 = __toESM(require_jsx_runtime(), 1); var styles_default = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_primitives104.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_primitives104.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z" }) }); // packages/icons/build-module/library/symbol.mjs var import_primitives105 = __toESM(require_primitives(), 1); var import_jsx_runtime107 = __toESM(require_jsx_runtime(), 1); var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_primitives105.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_primitives105.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" }) }); // packages/icons/build-module/library/tablet.mjs var import_primitives106 = __toESM(require_primitives(), 1); var import_jsx_runtime108 = __toESM(require_jsx_runtime(), 1); var tablet_default = /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_primitives106.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_primitives106.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" }) }); // packages/icons/build-module/library/tag.mjs var import_primitives107 = __toESM(require_primitives(), 1); var import_jsx_runtime109 = __toESM(require_jsx_runtime(), 1); var tag_default = /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_primitives107.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_primitives107.Path, { d: "M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" }) }); // packages/icons/build-module/library/text-horizontal.mjs var import_primitives108 = __toESM(require_primitives(), 1); var import_jsx_runtime110 = __toESM(require_jsx_runtime(), 1); var text_horizontal_default = /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_primitives108.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_primitives108.Path, { d: "M8.2 14.4h3.9L13 17h1.7L11 6.5H9.3L5.6 17h1.7l.9-2.6zm2-5.5 1.4 4H8.8l1.4-4zm7.4 7.5-1.3.8.8 1.4H5.5V20h14.3l-2.2-3.6z" }) }); // packages/icons/build-module/library/text-vertical.mjs var import_primitives109 = __toESM(require_primitives(), 1); var import_jsx_runtime111 = __toESM(require_jsx_runtime(), 1); var text_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_primitives109.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_primitives109.Path, { d: "M7 5.6v1.7l2.6.9v3.9L7 13v1.7L17.5 11V9.3L7 5.6zm4.2 6V8.8l4 1.4-4 1.4zm-5.7 5.6V5.5H4v14.3l3.6-2.2-.8-1.3-1.3.9z" }) }); // packages/icons/build-module/library/trash.mjs var import_primitives110 = __toESM(require_primitives(), 1); var import_jsx_runtime112 = __toESM(require_jsx_runtime(), 1); var trash_default = /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_primitives110.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_primitives110.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" }) }); // packages/icons/build-module/library/ungroup.mjs var import_primitives111 = __toESM(require_primitives(), 1); var import_jsx_runtime113 = __toESM(require_jsx_runtime(), 1); var ungroup_default = /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_primitives111.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_primitives111.Path, { d: "M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z" }) }); // packages/icons/build-module/library/unlock.mjs var import_primitives112 = __toESM(require_primitives(), 1); var import_jsx_runtime114 = __toESM(require_jsx_runtime(), 1); var unlock_default = /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_primitives112.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_primitives112.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z" }) }); // packages/icons/build-module/library/unseen.mjs var import_primitives113 = __toESM(require_primitives(), 1); var import_jsx_runtime115 = __toESM(require_jsx_runtime(), 1); var unseen_default = /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_primitives113.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_primitives113.Path, { d: "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z" }) }); // packages/icons/build-module/library/upload.mjs var import_primitives114 = __toESM(require_primitives(), 1); var import_jsx_runtime116 = __toESM(require_jsx_runtime(), 1); var upload_default = /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_primitives114.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_primitives114.Path, { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" }) }); // packages/icons/build-module/library/verse.mjs var import_primitives115 = __toESM(require_primitives(), 1); var import_jsx_runtime117 = __toESM(require_jsx_runtime(), 1); var verse_default = /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_primitives115.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_primitives115.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" }) }); // packages/icons/build-module/library/video.mjs var import_primitives116 = __toESM(require_primitives(), 1); var import_jsx_runtime118 = __toESM(require_jsx_runtime(), 1); var video_default = /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_primitives116.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_primitives116.Path, { d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z" }) }); // packages/block-editor/build-module/store/selectors.mjs var import_rich_text = __toESM(require_rich_text(), 1); var import_deprecated2 = __toESM(require_deprecated(), 1); var import_data5 = __toESM(require_data(), 1); // packages/block-editor/build-module/store/utils.mjs var import_blocks6 = __toESM(require_blocks(), 1); var import_block_serialization_default_parser = __toESM(require_block_serialization_default_parser(), 1); // packages/block-editor/build-module/store/constants.mjs var STORE_NAME = "core/block-editor"; // packages/block-editor/build-module/store/private-selectors.mjs var private_selectors_exports = {}; __export(private_selectors_exports, { canHostEditableRoot: () => canHostEditableRoot, getAllPatterns: () => getAllPatterns, getBlockRemovalRules: () => getBlockRemovalRules, getBlockSettings: () => getBlockSettings, getBlockStyles: () => getBlockStyles, getBlockWithoutAttributes: () => getBlockWithoutAttributes, getClientIdWithClientIdsTree: () => getClientIdWithClientIdsTree, getClientIdsTree: () => getClientIdsTree, getClosestAllowedInsertionPoint: () => getClosestAllowedInsertionPoint, getClosestAllowedInsertionPointForPattern: () => getClosestAllowedInsertionPointForPattern, getContentLockingParent: () => getContentLockingParent, getEditedContentOnlySection: () => getEditedContentOnlySection, getEnabledBlockParents: () => getEnabledBlockParents, getEnabledClientIdsTree: () => getEnabledClientIdsTree, getExpandedBlock: () => getExpandedBlock, getInserterMediaCategories: () => getInserterMediaCategories, getInsertionPoint: () => getInsertionPoint, getLastFocus: () => getLastFocus, getLastInsertedBlocksClientIds: () => getLastInsertedBlocksClientIds, getListViewClientIdsTree: () => getListViewClientIdsTree, getListViewExpandRevision: () => getListViewExpandRevision, getParentSectionBlock: () => getParentSectionBlock, getPatternBySlug: () => getPatternBySlug, getRegisteredInserterMediaCategories: () => getRegisteredInserterMediaCategories, getRemovalPromptData: () => getRemovalPromptData, getRequestedInspectorTab: () => getRequestedInspectorTab, getReusableBlocks: () => getReusableBlocks, getSectionRootClientId: () => getSectionRootClientId, getSelectedBlockStyleState: () => getSelectedBlockStyleState, getStyleOverrides: () => getStyleOverrides, getStyleStateViewport: () => getStyleStateViewport, getViewportModalClientIds: () => getViewportModalClientIds, getZoomLevel: () => getZoomLevel, hasAllowedPatterns: () => hasAllowedPatterns, hasBlockSpotlight: () => hasBlockSpotlight2, hasSelectedStyleState: () => hasSelectedStyleState, isBlockHiddenAnywhere: () => isBlockHiddenAnywhere, isBlockHiddenAtViewport: () => isBlockHiddenAtViewport, isBlockHiddenEverywhere: () => isBlockHiddenEverywhere, isBlockInterfaceHidden: () => isBlockInterfaceHidden2, isBlockParentHiddenAtViewport: () => isBlockParentHiddenAtViewport, isBlockParentHiddenEverywhere: () => isBlockParentHiddenEverywhere, isBlockSubtreeDisabled: () => isBlockSubtreeDisabled, isContainerInsertableToInContentOnlyMode: () => isContainerInsertableToInContentOnlyMode, isDragging: () => isDragging2, isEditLockedBlock: () => isEditLockedBlock, isListViewContentPanelOpen: () => isListViewContentPanelOpen, isListViewPanelOpened: () => isListViewPanelOpened, isLockedBlock: () => isLockedBlock, isMoveLockedBlock: () => isMoveLockedBlock, isRemoveLockedBlock: () => isRemoveLockedBlock, isResponsiveEditing: () => isResponsiveEditing2, isSectionBlock: () => isSectionBlock, isSelectedBlockStyleStateShownOnCanvas: () => isSelectedBlockStyleStateShownOnCanvas, isWithinEditedContentOnlySection: () => isWithinEditedContentOnlySection, isZoomOut: () => isZoomOut, shouldRenderBlockListView: () => shouldRenderBlockListView }); var import_data4 = __toESM(require_data(), 1); var import_blocks5 = __toESM(require_blocks(), 1); // packages/global-styles-engine/build-module/utils/object.mjs function setImmutably(object, path, value) { path = Array.isArray(path) ? [...path] : [path]; object = Array.isArray(object) ? [...object] : { ...object }; const leaf = path.pop(); let prev = object; for (const key of path) { const lvl = prev[key]; prev = prev[key] = Array.isArray(lvl) ? [...lvl] : { ...lvl }; } prev[leaf] = value; return object; } var getValueFromObjectPath = (object, path, defaultValue) => { const arrayPath = Array.isArray(path) ? path : path.split("."); let value = object; arrayPath.forEach((fieldName) => { value = value?.[fieldName]; }); return value ?? defaultValue; }; // packages/global-styles-engine/build-module/utils/common.mjs var import_style_engine = __toESM(require_style_engine(), 1); // packages/global-styles-engine/build-module/utils/fluid.mjs var DEFAULT_MAXIMUM_VIEWPORT_WIDTH = "1600px"; var DEFAULT_MINIMUM_VIEWPORT_WIDTH = "320px"; var DEFAULT_SCALE_FACTOR = 1; var DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN = 0.25; var DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX = 0.75; var DEFAULT_MINIMUM_FONT_SIZE_LIMIT = "14px"; function getComputedFluidTypographyValue({ minimumFontSize, maximumFontSize, fontSize, minimumViewportWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH, maximumViewportWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH, scaleFactor = DEFAULT_SCALE_FACTOR, minimumFontSizeLimit }) { minimumFontSizeLimit = !!getTypographyValueAndUnit(minimumFontSizeLimit) ? minimumFontSizeLimit : DEFAULT_MINIMUM_FONT_SIZE_LIMIT; if (fontSize) { const fontSizeParsed = getTypographyValueAndUnit(fontSize); if (!fontSizeParsed?.unit || !fontSizeParsed?.value) { return null; } const minimumFontSizeLimitParsed = getTypographyValueAndUnit( minimumFontSizeLimit, { coerceTo: fontSizeParsed.unit } ); if (!!minimumFontSizeLimitParsed?.value && !minimumFontSize && !maximumFontSize) { if (fontSizeParsed?.value <= minimumFontSizeLimitParsed?.value) { return null; } } if (!maximumFontSize) { maximumFontSize = `${fontSizeParsed.value}${fontSizeParsed.unit}`; } if (!minimumFontSize) { const fontSizeValueInPx = fontSizeParsed.unit === "px" ? fontSizeParsed.value : fontSizeParsed.value * 16; const minimumFontSizeFactor = Math.min( Math.max( 1 - 0.075 * Math.log2(fontSizeValueInPx), DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN ), DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX ); const calculatedMinimumFontSize = roundToPrecision( fontSizeParsed.value * minimumFontSizeFactor, 3 ); if (!!minimumFontSizeLimitParsed?.value && calculatedMinimumFontSize < minimumFontSizeLimitParsed?.value) { minimumFontSize = `${minimumFontSizeLimitParsed.value}${minimumFontSizeLimitParsed.unit}`; } else { minimumFontSize = `${calculatedMinimumFontSize}${fontSizeParsed.unit}`; } } } const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSize); const fontSizeUnit = minimumFontSizeParsed?.unit || "rem"; const maximumFontSizeParsed = getTypographyValueAndUnit(maximumFontSize, { coerceTo: fontSizeUnit }); if (!minimumFontSizeParsed || !maximumFontSizeParsed) { return null; } const minimumFontSizeRem = getTypographyValueAndUnit(minimumFontSize, { coerceTo: "rem" }); const maximumViewportWidthParsed = getTypographyValueAndUnit( maximumViewportWidth, { coerceTo: fontSizeUnit } ); const minimumViewportWidthParsed = getTypographyValueAndUnit( minimumViewportWidth, { coerceTo: fontSizeUnit } ); if (!maximumViewportWidthParsed || !minimumViewportWidthParsed || !minimumFontSizeRem) { return null; } const linearDenominator = maximumViewportWidthParsed.value - minimumViewportWidthParsed.value; if (!linearDenominator) { return null; } const minViewportWidthOffsetValue = roundToPrecision( minimumViewportWidthParsed.value / 100, 3 ); const viewportWidthOffset = roundToPrecision(minViewportWidthOffsetValue, 3) + fontSizeUnit; const linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / linearDenominator); const linearFactorScaled = roundToPrecision( (linearFactor || 1) * scaleFactor, 3 ); const fluidTargetFontSize = `${minimumFontSizeRem.value}${minimumFontSizeRem.unit} + ((1vw - ${viewportWidthOffset}) * ${linearFactorScaled})`; return `clamp(${minimumFontSize}, ${fluidTargetFontSize}, ${maximumFontSize})`; } function getTypographyValueAndUnit(rawValue, options = {}) { if (typeof rawValue !== "string" && typeof rawValue !== "number") { return null; } if (isFinite(rawValue)) { rawValue = `${rawValue}px`; } const { coerceTo, rootSizeValue, acceptableUnits } = { coerceTo: "", // Default browser font size. Later we could inject some JS to compute this `getComputedStyle( document.querySelector( "html" ) ).fontSize`. rootSizeValue: 16, acceptableUnits: ["rem", "px", "em"], ...options }; const acceptableUnitsGroup = acceptableUnits?.join("|"); const regexUnits = new RegExp( `^(\\d*\\.?\\d+)(${acceptableUnitsGroup}){1,1}$` ); const matches = rawValue.toString().match(regexUnits); if (!matches || matches.length < 3) { return null; } let [, value, unit] = matches; let returnValue = parseFloat(value); if ("px" === coerceTo && ("em" === unit || "rem" === unit)) { returnValue = returnValue * rootSizeValue; unit = coerceTo; } if ("px" === unit && ("em" === coerceTo || "rem" === coerceTo)) { returnValue = returnValue / rootSizeValue; unit = coerceTo; } if (("em" === coerceTo || "rem" === coerceTo) && ("em" === unit || "rem" === unit)) { unit = coerceTo; } if (!unit) { return null; } return { value: roundToPrecision(returnValue, 3), unit }; } function roundToPrecision(value, digits = 3) { const base = Math.pow(10, digits); return Math.round(value * base) / base; } // packages/global-styles-engine/build-module/utils/typography.mjs function isFluidTypographyEnabled(typographySettings) { const fluidSettings = typographySettings?.fluid; return true === fluidSettings || fluidSettings && typeof fluidSettings === "object" && Object.keys(fluidSettings).length > 0; } function getFluidTypographyOptionsFromSettings(settings2) { const typographySettings = settings2?.typography ?? {}; const layoutSettings = settings2?.layout; const defaultMaxViewportWidth = getTypographyValueAndUnit( layoutSettings?.wideSize ) ? layoutSettings?.wideSize : null; return isFluidTypographyEnabled(typographySettings) && defaultMaxViewportWidth ? { fluid: { maxViewportWidth: defaultMaxViewportWidth, ...typeof typographySettings.fluid === "object" ? typographySettings.fluid : {} } } : { fluid: typographySettings?.fluid }; } function getTypographyFontSizeValue(preset, settings2) { const { size: defaultSize } = preset; if (!defaultSize || "0" === defaultSize || false === preset?.fluid) { return defaultSize; } if (!isFluidTypographyEnabled(settings2?.typography) && !isFluidTypographyEnabled(preset)) { return defaultSize; } const fluidTypographySettings = getFluidTypographyOptionsFromSettings(settings2)?.fluid ?? {}; const fluidFontSizeValue = getComputedFluidTypographyValue({ minimumFontSize: typeof preset?.fluid === "boolean" ? void 0 : preset?.fluid?.min, maximumFontSize: typeof preset?.fluid === "boolean" ? void 0 : preset?.fluid?.max, fontSize: defaultSize, minimumFontSizeLimit: typeof fluidTypographySettings === "object" ? fluidTypographySettings?.minFontSize : void 0, maximumViewportWidth: typeof fluidTypographySettings === "object" ? fluidTypographySettings?.maxViewportWidth : void 0, minimumViewportWidth: typeof fluidTypographySettings === "object" ? fluidTypographySettings?.minViewportWidth : void 0 }); if (!!fluidFontSizeValue) { return fluidFontSizeValue; } return defaultSize; } // packages/global-styles-engine/build-module/utils/common.mjs var ROOT_BLOCK_SELECTOR = "body"; var ROOT_CSS_PROPERTIES_SELECTOR = ":root"; function splitSelectorList(selector3) { if (!selector3.includes(",")) { return [selector3]; } const selectors4 = []; let currentSelector = ""; let parenthesesDepth = 0; for (const char of selector3) { if (char === "(") { parenthesesDepth++; } else if (char === ")" && parenthesesDepth > 0) { parenthesesDepth--; } else if (char === "," && parenthesesDepth === 0) { selectors4.push(currentSelector); currentSelector = ""; continue; } currentSelector += char; } selectors4.push(currentSelector); return selectors4; } var PRESET_METADATA = [ { path: ["color", "palette"], valueKey: "color", cssVarInfix: "color", classes: [ { classSuffix: "color", propertyName: "color" }, { classSuffix: "background-color", propertyName: "background-color" }, { classSuffix: "border-color", propertyName: "border-color" } ] }, { path: ["color", "gradients"], valueKey: "gradient", cssVarInfix: "gradient", classes: [ { classSuffix: "gradient-background", propertyName: "background" } ] }, { path: ["color", "duotone"], valueKey: "colors", cssVarInfix: "duotone", valueFunc: ({ slug }) => `url( '#wp-duotone-${slug}' )`, classes: [] }, { path: ["shadow", "presets"], valueKey: "shadow", cssVarInfix: "shadow", classes: [] }, { path: ["typography", "fontSizes"], valueFunc: (preset, settings2) => getTypographyFontSizeValue(preset, settings2), valueKey: "size", cssVarInfix: "font-size", classes: [{ classSuffix: "font-size", propertyName: "font-size" }] }, { path: ["typography", "fontFamilies"], valueKey: "fontFamily", cssVarInfix: "font-family", classes: [ { classSuffix: "font-family", propertyName: "font-family" } ] }, { path: ["spacing", "spacingSizes"], valueKey: "size", cssVarInfix: "spacing", valueFunc: ({ size: size4 }) => size4, classes: [] }, { path: ["border", "radiusSizes"], valueKey: "size", cssVarInfix: "border-radius", classes: [] }, { path: ["dimensions", "dimensionSizes"], valueKey: "size", cssVarInfix: "dimension", classes: [] } ]; function scopeSelector(scope, selector3) { if (!scope || !selector3) { return selector3; } const scopes = splitSelectorList(scope); const selectors4 = splitSelectorList(selector3); const selectorsScoped = []; scopes.forEach((outer) => { selectors4.forEach((inner) => { selectorsScoped.push(`${outer.trim()} ${inner.trim()}`); }); }); return selectorsScoped.join(", "); } function scopeFeatureSelectors(scope, selectors4) { if (!scope || !selectors4) { return; } const featureSelectors = {}; Object.entries(selectors4).forEach(([feature, selector3]) => { if (typeof selector3 === "string") { featureSelectors[feature] = scopeSelector(scope, selector3); } if (typeof selector3 === "object") { featureSelectors[feature] = {}; Object.entries(selector3).forEach( ([subfeature, subfeatureSelector]) => { featureSelectors[feature][subfeature] = scopeSelector( scope, subfeatureSelector ); } ); } }); return featureSelectors; } function appendToSelector(selector3, toAppend) { if (!selector3.includes(",")) { return selector3 + toAppend; } const selectors4 = splitSelectorList(selector3); const newSelectors = selectors4.map((sel) => sel + toAppend); return newSelectors.join(","); } function getBlockStyleVariationSelector(variation, blockSelector) { const variationClass = `.is-style-${variation}`; if (!blockSelector) { return variationClass; } const ancestorRegex = /[^\s:]+/; const addVariationClass = (match2) => match2 + variationClass; const result = splitSelectorList(blockSelector).map( (part) => part.replace(ancestorRegex, addVariationClass) ); return result.join(","); } function getBlockStyleVariationFeatureSelector(variation, featureSelector) { const variationClass = `.is-style-${variation}`; const selectorParts = splitSelectorList(featureSelector).map( (selector3) => { const trimmedSelector = selector3.trim(); const prefix2 = `${variationClass} `; if (trimmedSelector.startsWith(prefix2)) { return trimmedSelector.slice(prefix2.length); } return trimmedSelector; } ); return getBlockStyleVariationSelector( variation, selectorParts.join(",") ); } function getResolvedRefValue(ruleValue, tree) { if (!ruleValue || !tree) { return ruleValue; } if (typeof ruleValue === "object" && "ref" in ruleValue && ruleValue?.ref) { const resolvedRuleValue = (0, import_style_engine.getCSSValueFromRawStyle)( getValueFromObjectPath(tree, ruleValue.ref) ); if (typeof resolvedRuleValue === "object" && resolvedRuleValue !== null && "ref" in resolvedRuleValue && resolvedRuleValue?.ref) { return void 0; } if (resolvedRuleValue === void 0) { return ruleValue; } return resolvedRuleValue; } return ruleValue; } function getResolvedThemeFilePath(file, themeFileURIs) { if (!file || !themeFileURIs || !Array.isArray(themeFileURIs)) { return file; } const uri = themeFileURIs.find( (themeFileUri) => themeFileUri?.name === file ); if (!uri?.href) { return file; } return uri?.href; } function getResolvedValue(ruleValue, tree) { if (!ruleValue || !tree) { return ruleValue; } const resolvedValue = getResolvedRefValue(ruleValue, tree); if (typeof resolvedValue === "object" && resolvedValue !== null && "url" in resolvedValue && resolvedValue?.url) { resolvedValue.url = getResolvedThemeFilePath( resolvedValue.url, tree?._links?.["wp:theme-file"] ); } return resolvedValue; } function findInPresetsBy(settings2, blockName, presetPath = [], presetProperty = "slug", presetValueValue) { const orderedPresetsByOrigin = [ blockName ? getValueFromObjectPath(settings2, [ "blocks", blockName, ...presetPath ]) : void 0, getValueFromObjectPath(settings2, presetPath) ].filter(Boolean); for (const presetByOrigin of orderedPresetsByOrigin) { if (presetByOrigin) { const origins = ["custom", "theme", "default"]; for (const origin of origins) { const presets = presetByOrigin[origin]; if (presets) { const presetObject = presets.find( (preset) => preset[presetProperty] === presetValueValue ); if (presetObject) { if (presetProperty === "slug") { return presetObject; } const highestPresetObjectWithSameSlug = findInPresetsBy( settings2, blockName, presetPath, "slug", presetObject.slug ); if (highestPresetObjectWithSameSlug[presetProperty] === presetObject[presetProperty]) { return presetObject; } return void 0; } } } } } } function getValueFromPresetVariable(features, blockName, variable, [presetType, slug] = []) { const metadata = PRESET_METADATA.find( (data) => data.cssVarInfix === presetType ); if (!metadata || !features.settings) { return variable; } const presetObject = findInPresetsBy( features.settings, blockName, metadata.path, "slug", slug ); if (presetObject) { const { valueKey } = metadata; const result = presetObject[valueKey]; return getValueFromVariable(features, blockName, result); } return variable; } function getValueFromCustomVariable(features, blockName, variable, path = []) { const result = (blockName ? getValueFromObjectPath(features?.settings ?? {}, [ "blocks", blockName, "custom", ...path ]) : void 0) ?? getValueFromObjectPath(features?.settings ?? {}, [ "custom", ...path ]); if (!result) { return variable; } return getValueFromVariable(features, blockName, result); } function getValueFromVariable(features, blockName, variable) { if (!variable || typeof variable !== "string") { if (typeof variable === "object" && variable !== null && "ref" in variable && typeof variable.ref === "string") { const resolvedVariable = getValueFromObjectPath( features, variable.ref ); if (!resolvedVariable || typeof resolvedVariable === "object" && "ref" in resolvedVariable) { return resolvedVariable; } variable = resolvedVariable; } else { return variable; } } const USER_VALUE_PREFIX = "var:"; const THEME_VALUE_PREFIX = "var(--wp--"; const THEME_VALUE_SUFFIX = ")"; let parsedVar; if (variable.startsWith(USER_VALUE_PREFIX)) { parsedVar = variable.slice(USER_VALUE_PREFIX.length).split("|"); } else if (variable.startsWith(THEME_VALUE_PREFIX) && variable.endsWith(THEME_VALUE_SUFFIX)) { parsedVar = variable.slice(THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length).split("--"); } else { return variable; } const [type, ...path] = parsedVar; if (type === "preset") { return getValueFromPresetVariable( features, blockName, variable, path ); } if (type === "custom") { return getValueFromCustomVariable( features, blockName, variable, path ); } return variable; } // packages/global-styles-engine/build-module/style-state-back-compat.mjs var LEGACY_STYLE_STATE_ALIASES = { "@mobile": "mobile", "@tablet": "tablet", "-current": "@current" }; function isObjectRecord(value) { return !!value && typeof value === "object" && !Array.isArray(value); } function normalizeStyleStateNode(node) { if (!isObjectRecord(node)) { return node; } let normalized = node; Object.entries(LEGACY_STYLE_STATE_ALIASES).forEach( ([state, legacyState]) => { if (Object.hasOwn(node, legacyState)) { if (normalized === node) { normalized = { ...node }; } if (!Object.hasOwn(node, state)) { normalized[state] = node[legacyState]; } delete normalized[legacyState]; } } ); Object.entries(normalized).forEach(([key, value]) => { if (!isObjectRecord(value)) { return; } const normalizedValue = normalizeStyleStateNode(value); if (normalizedValue !== value) { if (normalized === node) { normalized = { ...node }; } normalized[key] = normalizedValue; } }); return normalized; } function normalizeStyleStateAliases(globalStyles) { if (true) { return globalStyles; } if (!globalStyles?.styles) { return globalStyles; } const styles = normalizeStyleStateNode(globalStyles.styles); return styles === globalStyles.styles ? globalStyles : { ...globalStyles, styles }; } // packages/global-styles-engine/build-module/core/merge.mjs var import_deepmerge = __toESM(require_cjs(), 1); // node_modules/is-plain-object/dist/is-plain-object.mjs function isObject(o3) { return Object.prototype.toString.call(o3) === "[object Object]"; } function isPlainObject(o3) { var ctor, prot; if (isObject(o3) === false) return false; ctor = o3.constructor; if (ctor === void 0) return true; prot = ctor.prototype; if (isObject(prot) === false) return false; if (prot.hasOwnProperty("isPrototypeOf") === false) { return false; } return true; } // packages/global-styles-engine/build-module/core/merge.mjs function mergeGlobalStyles(base, user) { return (0, import_deepmerge.default)( normalizeStyleStateAliases(base), normalizeStyleStateAliases(user), { /* * We only pass as arrays the presets, * in which case we want the new array of values * to override the old array (no merging). */ isMergeableObject: isPlainObject, /* * Exceptions to the above rule. * Background images should be replaced, not merged, * as they themselves are specific object definitions for the style. */ customMerge: (key) => { if (key === "backgroundImage") { return (baseConfig, userConfig) => userConfig ?? baseConfig; } return void 0; } } ); } // packages/global-styles-engine/build-module/core/render.mjs var import_blocks3 = __toESM(require_blocks(), 1); var import_style_engine2 = __toESM(require_style_engine(), 1); var import_data3 = __toESM(require_data(), 1); // packages/global-styles-engine/build-module/core/selectors.mjs function getBlockSelector(blockType, target = "root", options = {}) { if (!target) { return null; } const { fallback = false } = options; const { name, selectors: selectors4, supports } = blockType; const hasSelectors = selectors4 && Object.keys(selectors4).length > 0; const path = Array.isArray(target) ? target.join(".") : target; let rootSelector = null; if (hasSelectors && selectors4.root) { rootSelector = selectors4?.root; } else if (supports?.__experimentalSelector) { rootSelector = supports.__experimentalSelector; } else { rootSelector = ".wp-block-" + name.replace("core/", "").replace("/", "-"); } if (path === "root") { return rootSelector; } const pathArray = Array.isArray(target) ? target : target.split("."); if (pathArray.length === 1) { const fallbackSelector = fallback ? rootSelector : null; if (hasSelectors) { const featureSelector2 = getValueFromObjectPath( selectors4, `${path}.root`, null ) || getValueFromObjectPath(selectors4, path, null); return featureSelector2 || fallbackSelector; } const featureSelector = supports ? getValueFromObjectPath( supports, `${path}.__experimentalSelector`, null ) : void 0; if (!featureSelector) { return fallbackSelector; } return scopeSelector(rootSelector, featureSelector); } let subfeatureSelector; if (hasSelectors) { subfeatureSelector = getValueFromObjectPath(selectors4, path, null); } if (subfeatureSelector) { return subfeatureSelector; } if (fallback) { return getBlockSelector(blockType, pathArray[0], options); } return null; } // packages/global-styles-engine/build-module/utils/string.mjs function kebabCase2(str) { return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([0-9])([a-zA-Z])/g, "$1-$2").replace(/([a-zA-Z])([0-9])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(); } // packages/global-styles-engine/build-module/utils/spacing.mjs function getSpacingPresetCssVar(value) { if (!value) { return; } const slug = value.match(/var:preset\|spacing\|(.+)/); if (!slug) { return value; } return `var(--wp--preset--spacing--${slug[1]})`; } // packages/global-styles-engine/build-module/utils/gap.mjs function getGapBoxControlValueFromStyle(blockGapValue) { if (!blockGapValue) { return null; } const isValueString = typeof blockGapValue === "string"; return { top: isValueString ? blockGapValue : blockGapValue?.top, left: isValueString ? blockGapValue : blockGapValue?.left }; } function getGapCSSValue(blockGapValue, defaultValue = "0") { const blockGapBoxControlValue = getGapBoxControlValueFromStyle(blockGapValue); if (!blockGapBoxControlValue) { return null; } const row = getSpacingPresetCssVar(blockGapBoxControlValue?.top) || defaultValue; const column = getSpacingPresetCssVar(blockGapBoxControlValue?.left) || defaultValue; return row === column ? row : `${row} ${column}`; } // packages/global-styles-engine/build-module/utils/background.mjs var BACKGROUND_BLOCK_DEFAULT_VALUES = { backgroundSize: "cover", backgroundPosition: "50% 50%" // used only when backgroundSize is 'contain'. }; function setBackgroundStyleDefaults(backgroundStyle) { if (!backgroundStyle || // @ts-expect-error !backgroundStyle?.backgroundImage?.url) { return; } let backgroundStylesWithDefaults; if (!backgroundStyle?.backgroundSize) { backgroundStylesWithDefaults = { backgroundSize: BACKGROUND_BLOCK_DEFAULT_VALUES.backgroundSize }; } if ("contain" === backgroundStyle?.backgroundSize && !backgroundStyle?.backgroundPosition) { backgroundStylesWithDefaults = { backgroundPosition: BACKGROUND_BLOCK_DEFAULT_VALUES.backgroundPosition }; } return backgroundStylesWithDefaults; } // packages/global-styles-engine/build-module/utils/layout.mjs var LAYOUT_DEFINITIONS = { default: { name: "default", slug: "flow", className: "is-layout-flow", baseStyles: [ { selector: " > .alignleft", rules: { float: "left", "margin-inline-start": "0", "margin-inline-end": "2em" } }, { selector: " > .alignright", rules: { float: "right", "margin-inline-start": "2em", "margin-inline-end": "0" } }, { selector: " > .aligncenter", rules: { "margin-left": "auto !important", "margin-right": "auto !important" } } ], spacingStyles: [ { selector: " > :first-child", rules: { "margin-block-start": "0" } }, { selector: " > :last-child", rules: { "margin-block-end": "0" } }, { selector: " > *", rules: { "margin-block-start": null, "margin-block-end": "0" } } ] }, constrained: { name: "constrained", slug: "constrained", className: "is-layout-constrained", baseStyles: [ { selector: " > .alignleft", rules: { float: "left", "margin-inline-start": "0", "margin-inline-end": "2em" } }, { selector: " > .alignright", rules: { float: "right", "margin-inline-start": "2em", "margin-inline-end": "0" } }, { selector: " > .aligncenter", rules: { "margin-left": "auto !important", "margin-right": "auto !important" } }, { selector: " > :where(:not(.alignleft):not(.alignright):not(.alignfull))", rules: { "max-width": "var(--wp--style--global--content-size)", "margin-left": "auto !important", "margin-right": "auto !important" } }, { selector: " > .alignwide", rules: { "max-width": "var(--wp--style--global--wide-size)" } } ], spacingStyles: [ { selector: " > :first-child", rules: { "margin-block-start": "0" } }, { selector: " > :last-child", rules: { "margin-block-end": "0" } }, { selector: " > *", rules: { "margin-block-start": null, "margin-block-end": "0" } } ] }, flex: { name: "flex", slug: "flex", className: "is-layout-flex", displayMode: "flex", baseStyles: [ { selector: "", rules: { "flex-wrap": "wrap", "align-items": "center" } }, { selector: " > :is(*, div)", // :is(*, div) instead of just * increases the specificity by 001. rules: { margin: "0" } } ], spacingStyles: [ { selector: "", rules: { gap: null } } ] }, grid: { name: "grid", slug: "grid", className: "is-layout-grid", displayMode: "grid", baseStyles: [ { selector: " > :is(*, div)", // :is(*, div) instead of just * increases the specificity by 001. rules: { margin: "0" } } ], spacingStyles: [ { selector: "", rules: { gap: null } } ] } }; // packages/global-styles-engine/build-module/utils/viewport.mjs var DEFAULT_VIEWPORT_BREAKPOINTS = { mobile: "480px", tablet: "782px" }; var VIEWPORT_SIZE_REGEXP = /^(\d+|\d*\.\d+)(px|em|rem)$/; var DEFAULT_FONT_SIZE = 16; function isViewportSettings(configOrSettings) { return "mobile" in configOrSettings || "tablet" in configOrSettings; } function getViewportSettings(configOrSettings) { if (!configOrSettings || typeof configOrSettings !== "object") { return {}; } if (isViewportSettings(configOrSettings)) { return configOrSettings; } return configOrSettings.settings?.viewport ?? {}; } function isValidViewportSize(value) { return typeof value === "string" && VIEWPORT_SIZE_REGEXP.test(value.trim()); } function getViewportBreakpointValueInPixels(value) { if (typeof value === "number") { return value; } if (typeof value !== "string") { return void 0; } const match2 = value.trim().match(VIEWPORT_SIZE_REGEXP); if (!match2) { return void 0; } const numericValue = Number.parseFloat(match2[1]); const unit = match2[2]; return unit === "px" ? numericValue : numericValue * DEFAULT_FONT_SIZE; } function getViewportBreakpoints(configOrSettings) { const viewportSettings = getViewportSettings(configOrSettings); const breakpoints = {}; const breakpointValuesInPixels = {}; Object.keys(DEFAULT_VIEWPORT_BREAKPOINTS).forEach((breakpoint) => { const key = breakpoint; const value = viewportSettings[key]; const px = getViewportBreakpointValueInPixels(value); if (px !== void 0 && isValidViewportSize(value)) { breakpoints[key] = value.trim(); breakpointValuesInPixels[key] = px; } }); const breakpointNames = Object.keys(breakpoints); if (!breakpointNames.length) { return { ...DEFAULT_VIEWPORT_BREAKPOINTS }; } if (1 === breakpointNames.length) { return breakpoints; } const mobile = breakpoints.mobile; const tablet = breakpoints.tablet; if (breakpointValuesInPixels.mobile >= breakpointValuesInPixels.tablet) { return { mobile }; } return { mobile, tablet }; } function getResponsiveMediaQueries(configOrSettings) { const breakpoints = getViewportBreakpoints(configOrSettings); const mediaQueries = {}; if (breakpoints.mobile) { mediaQueries["@mobile"] = `@media (width <= ${breakpoints.mobile})`; } if (breakpoints.tablet) { mediaQueries["@tablet"] = breakpoints.mobile ? `@media (${breakpoints.mobile} < width <= ${breakpoints.tablet})` : `@media (width <= ${breakpoints.tablet})`; } return mediaQueries; } // packages/global-styles-engine/build-module/core/render.mjs var ELEMENT_CLASS_NAMES = { button: "wp-element-button", caption: "wp-element-caption" }; var BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = { __experimentalBorder: "border", color: "color", dimensions: "dimensions", spacing: "spacing", typography: "typography" }; var VALID_BLOCK_PSEUDO_SELECTORS = { "core/button": [":hover", ":focus", ":focus-visible", ":active"], "core/navigation-link": [":hover", ":focus", ":focus-visible", ":active"] }; var VALID_ELEMENT_PSEUDO_SELECTORS = { link: [ ":link", ":any-link", ":visited", ":hover", ":focus", ":focus-visible", ":active" ], button: [ ":link", ":any-link", ":visited", ":hover", ":focus", ":focus-visible", ":active" ] }; function getPresetsClasses(blockSelector = "*", blockPresets = {}) { return PRESET_METADATA.reduce( (declarations, { path, cssVarInfix, classes }) => { if (!classes) { return declarations; } const presetByOrigin = getValueFromObjectPath( blockPresets, path, [] ); ["default", "theme", "custom"].forEach((origin) => { if (presetByOrigin[origin]) { presetByOrigin[origin].forEach( ({ slug }) => { classes.forEach( ({ classSuffix, propertyName }) => { const classSelectorToUse = `.has-${kebabCase2( slug )}-${classSuffix}`; const selectorToUse = blockSelector ? `:where(${blockSelector})${classSelectorToUse}` : classSelectorToUse; const value = `var(--wp--preset--${cssVarInfix}--${kebabCase2( slug )})`; declarations += `${selectorToUse}{${propertyName}: ${value} !important;}`; } ); } ); } }); return declarations; }, "" ); } var updateParagraphTextIndentSelector = (featureDeclarations, settings2, blockName) => { if (blockName !== "core/paragraph") { return featureDeclarations; } const blockSettings = settings2?.blocks?.["core/paragraph"]; const textIndentSetting = blockSettings?.typography?.textIndent ?? settings2?.typography?.textIndent ?? "subsequent"; if (textIndentSetting !== "all") { return featureDeclarations; } const oldSelector = ".wp-block-paragraph + .wp-block-paragraph"; const newSelector = ".wp-block-paragraph"; if (oldSelector in featureDeclarations) { const declarations = featureDeclarations[oldSelector]; const updated = { ...featureDeclarations }; delete updated[oldSelector]; updated[newSelector] = declarations; return updated; } return featureDeclarations; }; var updateButtonWidthDeclarations = (featureDeclarations, settings2) => { const buttonSelector = ".wp-block-button"; if (!(buttonSelector in featureDeclarations)) { return featureDeclarations; } const updated = { ...featureDeclarations }; updated[buttonSelector] = updated[buttonSelector].map( (declaration) => { const match2 = declaration.match(/^width:\s*(.+)$/); if (!match2) { return declaration; } const value = match2[1]; let percentage = null; if (value.endsWith("%")) { percentage = parseFloat(value); } const presetPrefix = "var(--wp--preset--dimension--"; if (percentage === null && value.startsWith(presetPrefix) && value.endsWith(")")) { const slug = value.slice(presetPrefix.length, -1); const dimensionSizes = { ...settings2?.dimensions?.dimensionSizes ?? {}, ...settings2?.blocks?.["core/button"]?.dimensions?.dimensionSizes ?? {} }; for (const origin of Object.values(dimensionSizes)) { if (!Array.isArray(origin)) { continue; } for (const preset of origin) { if (preset.slug === slug && typeof preset.size === "string" && preset.size.endsWith("%")) { percentage = parseFloat(preset.size); break; } } if (percentage !== null) { break; } } } if (percentage === null || isNaN(percentage)) { return declaration; } return `width: calc(${percentage} * 1% - (var(--wp--style--block-gap, 0.5em) * (1 - ${percentage} / 100)))`; } ); return updated; }; var getFeatureDeclarations = (selectors4, styles) => { const declarations = {}; Object.entries(selectors4).forEach(([feature, selector3]) => { if (feature === "root" || !styles?.[feature]) { return; } const isShorthand = typeof selector3 === "string"; if (!isShorthand && typeof selector3 === "object" && selector3 !== null) { Object.entries(selector3).forEach( ([subfeature, subfeatureSelector]) => { if (subfeature === "root" || !styles?.[feature][subfeature]) { return; } const subfeatureStyles = { [feature]: { [subfeature]: styles[feature][subfeature] } }; const newDeclarations = getStylesDeclarations(subfeatureStyles); declarations[subfeatureSelector] = [ ...declarations[subfeatureSelector] || [], ...newDeclarations ]; delete styles[feature][subfeature]; } ); } if (isShorthand || typeof selector3 === "object" && selector3 !== null && "root" in selector3) { const featureSelector = isShorthand ? selector3 : selector3.root; const featureStyles = { [feature]: styles[feature] }; const newDeclarations = getStylesDeclarations(featureStyles); declarations[featureSelector] = [ ...declarations[featureSelector] || [], ...newDeclarations ]; delete styles[feature]; } }); return declarations; }; function getStylesDeclarations(blockStyles = {}, selector3 = "", useRootPaddingAlign, tree = {}, disableRootPadding = false) { const isRoot = ROOT_BLOCK_SELECTOR === selector3; const output = Object.entries( import_blocks3.__EXPERIMENTAL_STYLE_PROPERTY ).reduce( (declarations, [key, { value, properties, useEngine, rootOnly }]) => { if (rootOnly && !isRoot) { return declarations; } const pathToValue = value; if (pathToValue[0] === "elements" || useEngine) { return declarations; } const styleValue = getValueFromObjectPath( blockStyles, pathToValue ); if (key === "--wp--style--root--padding" && (typeof styleValue === "string" || !useRootPaddingAlign)) { return declarations; } if (properties && typeof styleValue !== "string") { Object.entries(properties).forEach((entry) => { const [name, prop] = entry; if (!getValueFromObjectPath(styleValue, [prop], false)) { return; } const cssProperty = name.startsWith("--") ? name : kebabCase2(name); declarations.push( `${cssProperty}: ${(0, import_style_engine2.getCSSValueFromRawStyle)( getValueFromObjectPath(styleValue, [prop]) )}` ); }); } else if (getValueFromObjectPath(blockStyles, pathToValue, false)) { const cssProperty = key.startsWith("--") ? key : kebabCase2(key); declarations.push( `${cssProperty}: ${(0, import_style_engine2.getCSSValueFromRawStyle)( getValueFromObjectPath(blockStyles, pathToValue) )}` ); } return declarations; }, [] ); if (!!blockStyles.background) { if (blockStyles.background?.backgroundImage) { blockStyles.background.backgroundImage = getResolvedValue( blockStyles.background.backgroundImage, tree ); } if (!isRoot && !!blockStyles.background?.backgroundImage?.id) { blockStyles = { ...blockStyles, background: { ...blockStyles.background, ...setBackgroundStyleDefaults(blockStyles.background) } }; } } const extraRules = (0, import_style_engine2.getCSSRules)(blockStyles); extraRules.forEach((rule) => { if (isRoot && (useRootPaddingAlign || disableRootPadding) && rule.key.startsWith("padding")) { return; } const cssProperty = rule.key.startsWith("--") ? rule.key : kebabCase2(rule.key); let ruleValue = getResolvedValue(rule.value, tree); if (cssProperty === "font-size") { ruleValue = getTypographyFontSizeValue( { name: "", slug: "", size: ruleValue }, tree?.settings ); } if (cssProperty === "aspect-ratio") { output.push("min-height: unset"); } output.push(`${cssProperty}: ${ruleValue}`); }); return output; } function getLayoutStyles({ layoutDefinitions = LAYOUT_DEFINITIONS, style, selector: selector3, hasBlockGapSupport, hasFallbackGapSupport, fallbackGapValue }) { let ruleset = ""; let gapValue = hasBlockGapSupport ? getGapCSSValue(style?.spacing?.blockGap) : ""; if (hasFallbackGapSupport) { if (selector3 === ROOT_BLOCK_SELECTOR) { gapValue = !gapValue ? "0.5em" : gapValue; } else if (!hasBlockGapSupport && fallbackGapValue) { gapValue = fallbackGapValue; } } if (gapValue && layoutDefinitions) { Object.values(layoutDefinitions).forEach( ({ className, name, spacingStyles }) => { if (!hasBlockGapSupport && "flex" !== name && "grid" !== name) { return; } if (spacingStyles?.length) { spacingStyles.forEach((spacingStyle) => { const declarations = []; if (spacingStyle.rules) { Object.entries(spacingStyle.rules).forEach( ([cssProperty, cssValue]) => { declarations.push( `${cssProperty}: ${cssValue ? cssValue : gapValue}` ); } ); } if (declarations.length) { let combinedSelector = ""; if (!hasBlockGapSupport) { combinedSelector = selector3 === ROOT_BLOCK_SELECTOR ? `:where(.${className}${spacingStyle?.selector || ""})` : `:where(${selector3}.${className}${spacingStyle?.selector || ""})`; } else { combinedSelector = selector3 === ROOT_BLOCK_SELECTOR ? `:root :where(.${className})${spacingStyle?.selector || ""}` : `:root :where(${selector3}-${className})${spacingStyle?.selector || ""}`; } ruleset += `${combinedSelector} { ${declarations.join( "; " )}; }`; } }); } } ); if (selector3 === ROOT_BLOCK_SELECTOR && hasBlockGapSupport) { ruleset += `${ROOT_CSS_PROPERTIES_SELECTOR} { --wp--style--block-gap: ${gapValue}; }`; } } if (selector3 === ROOT_BLOCK_SELECTOR && layoutDefinitions) { const validDisplayModes = ["block", "flex", "grid"]; Object.values(layoutDefinitions).forEach( ({ className, displayMode, baseStyles }) => { if (displayMode && validDisplayModes.includes(displayMode)) { ruleset += `${selector3} .${className} { display:${displayMode}; }`; } if (baseStyles?.length) { baseStyles.forEach((baseStyle) => { const declarations = []; if (baseStyle.rules) { Object.entries(baseStyle.rules).forEach( ([cssProperty, cssValue]) => { declarations.push( `${cssProperty}: ${cssValue}` ); } ); } if (declarations.length) { const combinedSelector = `.${className}${baseStyle?.selector || ""}`; ruleset += `${combinedSelector} { ${declarations.join( "; " )}; }`; } }); } } ); } return ruleset; } var STYLE_KEYS = [ "border", "color", "dimensions", "spacing", "typography", "filter", "outline", "shadow", "background" ]; function pickStyleKeys(treeToPickFrom, responsiveMediaQueries) { return pickStyleAndPseudoKeys( treeToPickFrom, void 0, responsiveMediaQueries ); } function pickStyleAndPseudoKeys(treeToPickFrom, blockName, responsiveMediaQueries) { if (!treeToPickFrom) { return {}; } const entries = Object.entries(treeToPickFrom); const allowedPseudoSelectors = blockName ? VALID_BLOCK_PSEUDO_SELECTORS[blockName] ?? [] : []; const pickedEntries = entries.filter( ([key]) => STYLE_KEYS.includes(key) || allowedPseudoSelectors.includes(key) || responsiveMediaQueries[key] ); const clonedEntries = pickedEntries.map(([key, style]) => [ key, JSON.parse(JSON.stringify(style)) ]); return Object.fromEntries(clonedEntries); } function getPseudoStyleNodes(node) { const { styles, selector: selector3, featureSelectors, name, elementName, mediaQuery, variationName } = node; const pseudoSelectors = name ? VALID_BLOCK_PSEUDO_SELECTORS[name] ?? [] : VALID_ELEMENT_PSEUDO_SELECTORS[elementName ?? ""] ?? []; if (!pseudoSelectors.length) { return []; } return pseudoSelectors.flatMap((pseudoSelector) => { const pseudoStyles = styles?.[pseudoSelector]; if (!pseudoStyles || typeof pseudoStyles !== "object") { return []; } return [ { styles: JSON.parse(JSON.stringify(pseudoStyles)), selector: selector3, selectorSuffix: pseudoSelector, mediaQuery, featureSelectors: featureSelectors && typeof featureSelectors !== "string" ? featureSelectors : void 0, name, elementName, variationName } ]; }); } function getResponsiveStyleNodes(node, responsiveMediaQueries) { const { styles, selector: selector3, fallbackGapValue, featureSelectors, hasLayoutSupport: hasLayoutSupport2, layoutHasBlockGapSupport, layoutSelector, name, elementName, isStyleVariation, variationName } = node; if (!name && !elementName) { return []; } return Object.entries(responsiveMediaQueries).flatMap( ([breakpointKey, mediaQuery]) => { const breakpointStyles = styles?.[breakpointKey]; if (!breakpointStyles || typeof breakpointStyles !== "object") { return []; } return [ { styles: JSON.parse(JSON.stringify(breakpointStyles)), selector: selector3, mediaQuery, featureSelectors: featureSelectors && typeof featureSelectors !== "string" ? featureSelectors : void 0, fallbackGapValue, hasLayoutSupport: hasLayoutSupport2, name, elementName, isStyleVariation, variationName, layoutSelector, layoutHasBlockGapSupport } ]; } ); } function getElementStylesByName(styleNode, responsiveMediaQueries) { const elementStylesByName = { ...styleNode?.elements ?? {} }; Object.keys(responsiveMediaQueries).forEach((breakpointKey) => { Object.entries(styleNode?.[breakpointKey]?.elements ?? {}).forEach( ([elementName, styles]) => { elementStylesByName[elementName] = { ...elementStylesByName[elementName] ?? {}, [breakpointKey]: styles }; } ); }); return elementStylesByName; } var getNodesWithStyles = (tree, blockSelectors) => { const nodes = []; if (!tree?.styles) { return nodes; } const responsiveMediaQueries = getResponsiveMediaQueries(tree); const styles = pickStyleKeys(tree.styles, responsiveMediaQueries); if (styles) { nodes.push({ styles, selector: ROOT_BLOCK_SELECTOR, // Root selector (body) styles should not be wrapped in `:root where()` to keep // specificity at (0,0,1) and maintain backwards compatibility. skipSelectorWrapper: true }); } Object.entries(import_blocks3.__EXPERIMENTAL_ELEMENTS).forEach(([name, selector3]) => { if (tree.styles?.elements?.[name]) { nodes.push({ styles: tree.styles?.elements?.[name] ?? {}, selector: selector3, elementName: name, // Top level elements that don't use a class name should not receive the // `:root :where()` wrapper to maintain backwards compatibility. skipSelectorWrapper: !ELEMENT_CLASS_NAMES[name] }); } }); Object.entries(tree.styles?.blocks ?? {}).forEach( ([blockName, node]) => { const blockStyles = pickStyleAndPseudoKeys( node, blockName, responsiveMediaQueries ); const typedNode = node; const variationNodesToAdd = []; const variationStyleNodesToAdd = []; if (typedNode?.variations) { Object.entries(typedNode.variations).forEach( ([variationName, variation]) => { const typedVariation = variation; const variationStyles = pickStyleAndPseudoKeys( typedVariation, blockName, responsiveMediaQueries ); if (typedVariation?.css) { variationStyles.css = typedVariation.css; } const variationSelector = typeof blockSelectors !== "string" ? blockSelectors[blockName]?.styleVariationSelectors?.[variationName] : void 0; if (variationSelector && typeof blockSelectors !== "string") { const blockSelector = blockSelectors[blockName]; variationStyleNodesToAdd.push({ styles: variationStyles, selector: variationSelector, featureSelectors: blockSelector?.featureSelectors, fallbackGapValue: blockSelector?.fallbackGapValue, hasLayoutSupport: blockSelector?.hasLayoutSupport, isStyleVariation: true, variationName, layoutSelector: variationSelector + blockSelector.selector, layoutHasBlockGapSupport: true, name: blockName }); } Object.entries( getElementStylesByName( typedVariation, responsiveMediaQueries ) ).forEach(([element, elementStyles]) => { if (elementStyles && import_blocks3.__EXPERIMENTAL_ELEMENTS[element]) { variationNodesToAdd.push({ styles: elementStyles, selector: scopeSelector( variationSelector, import_blocks3.__EXPERIMENTAL_ELEMENTS[element] ), elementName: element, isStyleVariation: true }); } }); Object.entries(typedVariation?.blocks ?? {}).forEach( ([ variationBlockName, variationBlockStyles ]) => { const variationBlockSelector = typeof blockSelectors !== "string" ? scopeSelector( variationSelector, blockSelectors[variationBlockName]?.selector ) : void 0; const variationDuotoneSelector = typeof blockSelectors !== "string" ? scopeSelector( variationSelector, blockSelectors[variationBlockName]?.duotoneSelector ) : void 0; const variationFeatureSelectors = typeof blockSelectors !== "string" ? scopeFeatureSelectors( variationSelector, blockSelectors[variationBlockName]?.featureSelectors ?? {} ) : void 0; const variationBlockStyleNodes = pickStyleAndPseudoKeys( variationBlockStyles, variationBlockName, responsiveMediaQueries ); if (variationBlockStyles?.css) { variationBlockStyleNodes.css = variationBlockStyles.css; } if (!variationBlockSelector || typeof blockSelectors === "string") { return; } variationNodesToAdd.push({ selector: variationBlockSelector, name: variationBlockName, isStyleVariation: true, duotoneSelector: variationDuotoneSelector, featureSelectors: variationFeatureSelectors, fallbackGapValue: blockSelectors[variationBlockName]?.fallbackGapValue, hasLayoutSupport: blockSelectors[variationBlockName]?.hasLayoutSupport, styles: variationBlockStyleNodes }); Object.entries( getElementStylesByName( variationBlockStyles, responsiveMediaQueries ) ).forEach( ([ variationBlockElement, variationBlockElementStyles ]) => { if (variationBlockElementStyles && import_blocks3.__EXPERIMENTAL_ELEMENTS[variationBlockElement]) { variationNodesToAdd.push({ styles: variationBlockElementStyles, selector: scopeSelector( variationBlockSelector, import_blocks3.__EXPERIMENTAL_ELEMENTS[variationBlockElement] ), elementName: variationBlockElement, isStyleVariation: true }); } } ); } ); } ); } if (typeof blockSelectors !== "string" && blockSelectors?.[blockName]?.selector) { nodes.push({ duotoneSelector: blockSelectors[blockName].duotoneSelector, fallbackGapValue: blockSelectors[blockName].fallbackGapValue, hasLayoutSupport: blockSelectors[blockName].hasLayoutSupport, selector: blockSelectors[blockName].selector, styles: blockStyles, featureSelectors: blockSelectors[blockName].featureSelectors, name: blockName }); } nodes.push(...variationStyleNodesToAdd); Object.entries( getElementStylesByName(typedNode, responsiveMediaQueries) ).forEach(([elementName, value]) => { if (typeof blockSelectors !== "string" && value && blockSelectors?.[blockName] && import_blocks3.__EXPERIMENTAL_ELEMENTS[elementName]) { nodes.push({ styles: value, selector: blockSelectors[blockName]?.selector.split(",").map((sel) => { const elementSelectors = import_blocks3.__EXPERIMENTAL_ELEMENTS[elementName].split(","); return elementSelectors.map( (elementSelector) => sel + " " + elementSelector ); }).join(","), elementName }); } }); nodes.push(...variationNodesToAdd); } ); return nodes; }; var getNodesWithSettings = (tree, blockSelectors) => { const nodes = []; if (!tree?.settings) { return nodes; } const pickPresets = (treeToPickFrom) => { let presets2 = {}; PRESET_METADATA.forEach(({ path }) => { const value = getValueFromObjectPath(treeToPickFrom, path, false); if (value !== false) { presets2 = setImmutably(presets2, path, value); } }); return presets2; }; const presets = pickPresets(tree.settings); const custom = tree.settings?.custom; if (Object.keys(presets).length > 0 || custom) { nodes.push({ presets, custom, selector: ROOT_CSS_PROPERTIES_SELECTOR }); } Object.entries(tree.settings?.blocks ?? {}).forEach( ([blockName, node]) => { const blockCustom = node.custom; if (typeof blockSelectors === "string" || !blockSelectors[blockName]) { return; } const blockPresets = pickPresets(node); if (Object.keys(blockPresets).length > 0 || blockCustom) { nodes.push({ presets: blockPresets, custom: blockCustom, selector: blockSelectors[blockName]?.selector, featureSelectors: blockSelectors[blockName]?.featureSelectors }); } } ); return nodes; }; function renderStylesNode(node, { tree, useRootPaddingAlign, disableLayoutStyles, hasBlockGapSupport, hasFallbackGapSupport, disableRootPadding }) { const { selector: selector3, selectorSuffix, mediaQuery, duotoneSelector, styles, fallbackGapValue, hasLayoutSupport: hasLayoutSupport2, featureSelectors, layoutSelector, layoutHasBlockGapSupport, skipSelectorWrapper, name, variationName } = node; let ruleset = ""; const effectiveSelector = selectorSuffix ? appendToSelector(selector3, selectorSuffix) : selector3; if (featureSelectors && typeof featureSelectors !== "string") { let featureDeclarations = getFeatureDeclarations( featureSelectors, styles ); featureDeclarations = updateParagraphTextIndentSelector( featureDeclarations, tree.settings, name ); featureDeclarations = updateButtonWidthDeclarations( featureDeclarations, tree.settings ); Object.entries(featureDeclarations).forEach( ([featureSelector, declarations]) => { if (declarations.length) { let selectorForRule = variationName ? getBlockStyleVariationFeatureSelector( variationName, featureSelector ) : featureSelector; selectorForRule = selectorSuffix ? appendToSelector(selectorForRule, selectorSuffix) : selectorForRule; const rules = declarations.join(";"); ruleset += `:root :where(${selectorForRule}){${rules};}`; } } ); } if (duotoneSelector) { const duotoneStyles = {}; if (styles?.filter) { duotoneStyles.filter = styles.filter; delete styles.filter; } const duotoneDeclarations = getStylesDeclarations(duotoneStyles); if (duotoneDeclarations.length) { ruleset += `${duotoneSelector}{${duotoneDeclarations.join( ";" )};}`; } } const selectorForLayout = layoutSelector ?? effectiveSelector; const hasBlockGapSupportForLayout = layoutHasBlockGapSupport ?? hasBlockGapSupport; if (!disableLayoutStyles && (ROOT_BLOCK_SELECTOR === selectorForLayout || hasLayoutSupport2)) { ruleset += getLayoutStyles({ style: styles, selector: selectorForLayout, hasBlockGapSupport: hasBlockGapSupportForLayout, hasFallbackGapSupport, fallbackGapValue }); } const styleDeclarations = getStylesDeclarations( styles, effectiveSelector, useRootPaddingAlign, tree, disableRootPadding ); if (styleDeclarations?.length) { const generalSelector = skipSelectorWrapper ? effectiveSelector : `:root :where(${effectiveSelector})`; ruleset += `${generalSelector}{${styleDeclarations.join(";")};}`; } if (styles?.css) { ruleset += processCSSNesting( styles.css, `:root :where(${effectiveSelector})` ); } if (mediaQuery && ruleset) { return `${mediaQuery}{${ruleset}}`; } return ruleset; } var transformToStyles = (tree, blockSelectors, hasBlockGapSupport, hasFallbackGapSupport, disableLayoutStyles = false, disableRootPadding = false, styleOptions = {}) => { const options = { blockGap: true, blockStyles: true, layoutStyles: true, marginReset: true, presets: true, rootPadding: true, variationStyles: false, ...styleOptions }; const normalizedTree = normalizeStyleStateAliases(tree); const nodesWithStyles = getNodesWithStyles( normalizedTree, blockSelectors ); const nodesWithSettings = getNodesWithSettings( normalizedTree, blockSelectors ); const useRootPaddingAlign = normalizedTree?.settings?.useRootPaddingAwareAlignments; const { contentSize, wideSize } = normalizedTree?.settings?.layout || {}; const hasBodyStyles = options.marginReset || options.rootPadding || options.layoutStyles; let ruleset = ""; if (options.presets && (contentSize || wideSize)) { ruleset += `${ROOT_CSS_PROPERTIES_SELECTOR} {`; ruleset = contentSize ? ruleset + ` --wp--style--global--content-size: ${contentSize};` : ruleset; ruleset = wideSize ? ruleset + ` --wp--style--global--wide-size: ${wideSize};` : ruleset; ruleset += "}"; } if (hasBodyStyles) { ruleset += ":where(body) {margin: 0;"; if (options.rootPadding && useRootPaddingAlign) { ruleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) } .has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); } .has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); } .has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; } .has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0; `; } ruleset += "}"; } if (options.blockStyles) { const responsiveMediaQueries = getResponsiveMediaQueries(tree); nodesWithStyles.forEach((node) => { if (node.isStyleVariation && !options.variationStyles) { return; } const responsiveNodes = getResponsiveStyleNodes( node, responsiveMediaQueries ); [ node, ...responsiveNodes, ...getPseudoStyleNodes(node), ...responsiveNodes.flatMap(getPseudoStyleNodes) ].forEach((expandedNode) => { ruleset += renderStylesNode(expandedNode, { tree: normalizedTree, useRootPaddingAlign, disableLayoutStyles, hasBlockGapSupport, hasFallbackGapSupport, disableRootPadding }); }); }); } if (options.layoutStyles) { ruleset = ruleset + ".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }"; ruleset = ruleset + ".wp-site-blocks > .alignright { float: right; margin-left: 2em; }"; ruleset = ruleset + ".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"; } if (options.blockGap && hasBlockGapSupport) { const gapValue = getGapCSSValue(normalizedTree?.styles?.spacing?.blockGap) || "0.5em"; ruleset = ruleset + `:root :where(.wp-site-blocks) > * { margin-block-start: ${gapValue}; margin-block-end: 0; }`; ruleset = ruleset + ":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }"; ruleset = ruleset + ":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"; } if (options.presets) { nodesWithSettings.forEach(({ selector: selector3, presets }) => { if (ROOT_BLOCK_SELECTOR === selector3 || ROOT_CSS_PROPERTIES_SELECTOR === selector3) { selector3 = ""; } const classes = getPresetsClasses(selector3, presets); if (classes.length > 0) { ruleset += classes; } }); } return ruleset; }; var getSelectorsConfig = (blockType, rootSelector) => { if (blockType?.selectors && Object.keys(blockType.selectors).length > 0) { return blockType.selectors; } const config2 = { root: rootSelector }; Object.entries(BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS).forEach( ([featureKey, featureName]) => { const featureSelector = getBlockSelector(blockType, featureKey); if (featureSelector) { config2[featureName] = featureSelector; } } ); return config2; }; var getBlockSelectors = (blockTypes, variationInstanceId) => { const { getBlockStyles: getBlockStyles2 } = (0, import_data3.select)(import_blocks3.store); const result = {}; blockTypes.forEach((blockType) => { const name = blockType.name; const selector3 = getBlockSelector(blockType); if (!selector3) { return; } let duotoneSelector = getBlockSelector(blockType, "filter.duotone"); if (!duotoneSelector) { const rootSelector = getBlockSelector(blockType); const duotoneSupport = (0, import_blocks3.getBlockSupport)( blockType, "color.__experimentalDuotone", false ); if (typeof duotoneSupport === "string" && rootSelector) { duotoneSelector = scopeSelector(rootSelector, duotoneSupport); } } const hasLayoutSupport2 = !!blockType?.supports?.layout || !!blockType?.supports?.__experimentalLayout; const fallbackGapValue = ( // @ts-expect-error blockType?.supports?.spacing?.blockGap?.__experimentalDefault ); const blockStyleVariations = getBlockStyles2(name); const styleVariationSelectors = {}; blockStyleVariations?.forEach((variation) => { const variationSuffix = variationInstanceId ? `-${variationInstanceId}` : ""; const variationName = `${variation.name}${variationSuffix}`; const styleVariationSelector = getBlockStyleVariationSelector( variationName, selector3 ); styleVariationSelectors[variationName] = styleVariationSelector; }); const featureSelectors = getSelectorsConfig(blockType, selector3); result[name] = { duotoneSelector: duotoneSelector ?? void 0, fallbackGapValue, featureSelectors: Object.keys(featureSelectors).length ? featureSelectors : void 0, hasLayoutSupport: hasLayoutSupport2, name, selector: selector3, styleVariationSelectors: blockStyleVariations?.length ? styleVariationSelectors : void 0 }; }); return result; }; function processCSSNesting(css, blockSelector) { let processedCSS = ""; if (!css || css.trim() === "") { return processedCSS; } const parts = css.split("&"); parts.forEach((part) => { if (!part || part.trim() === "") { return; } const isRootCss = !part.includes("{"); if (isRootCss) { processedCSS += `:root :where(${blockSelector}){${part.trim()}}`; } else { const splitPart = part.replace("}", "").split("{"); if (splitPart.length !== 2) { return; } const [nestedSelector, cssValue] = splitPart; const matches = nestedSelector.match(/([>+~\s]*::[a-zA-Z-]+)/); const pseudoPart = matches ? matches[1] : ""; const withoutPseudoElement = matches ? nestedSelector.replace(pseudoPart, "").trim() : nestedSelector.trim(); let combinedSelector; if (withoutPseudoElement === "") { combinedSelector = blockSelector; } else { combinedSelector = nestedSelector.startsWith(" ") ? scopeSelector(blockSelector, withoutPseudoElement) : appendToSelector(blockSelector, withoutPseudoElement); } processedCSS += `:root :where(${combinedSelector})${pseudoPart}{${cssValue.trim()}}`; } }); return processedCSS; } // packages/global-styles-engine/build-module/variation.mjs function getVariationStyle(globalStyles, name, variation, { resolveRefs = true } = {}) { if (!globalStyles?.styles?.blocks?.[name]?.variations?.[variation]) { return void 0; } const replaceRefs = (variationStyles) => { Object.keys(variationStyles).forEach((key) => { const value = variationStyles[key]; if (typeof value === "object" && value !== null) { if (value.ref !== void 0) { if (typeof value.ref !== "string" || value.ref.trim() === "") { delete variationStyles[key]; } else { const refValue = getValueFromObjectPath( globalStyles, value.ref ); if (refValue !== void 0 && refValue !== null) { variationStyles[key] = refValue; } else { delete variationStyles[key]; } } } else { replaceRefs(value); if (Object.keys(value).length === 0) { delete variationStyles[key]; } } } }); }; const styles = JSON.parse( JSON.stringify( globalStyles.styles.blocks[name].variations[variation] ) ); if (resolveRefs) { replaceRefs(styles); } return styles; } // packages/global-styles-engine/build-module/resolve-style.mjs var DEFAULT_STATE_VALUE = "default"; function isDefaultBlockStyleState(selectedState) { const viewport = selectedState?.viewport; const pseudoState = selectedState?.pseudoState; return (!viewport || viewport === DEFAULT_STATE_VALUE) && (!pseudoState || pseudoState === DEFAULT_STATE_VALUE); } function getStyleStatePath(selectedState) { if (isDefaultBlockStyleState(selectedState)) { return []; } return [selectedState.viewport, selectedState.pseudoState].filter( (state) => !!state && state !== DEFAULT_STATE_VALUE ); } function getStyleForState(style, selectedState) { const path = getStyleStatePath(selectedState); if (!path.length) { return style; } return getValueFromObjectPath(style, path); } var TREE_STRUCTURAL_KEYS = /* @__PURE__ */ new Set(["blocks", "variations", "css"]); var EMPTY_INHERITANCE = Object.freeze({ value: {}, sources: {} }); var SOURCE_DESCRIPTORS = { root: { layer: "root" }, element: { layer: "element" }, block: { layer: "block" }, blockVariation: { layer: "blockVariation" } }; function createSourceDescriptor(type) { const descriptor = SOURCE_DESCRIPTORS[type]; if (!descriptor) { return null; } return { ...descriptor }; } function createContribution(styles, source) { if (!styles || !source) { return null; } return { styles, source }; } function getPathKey(path) { return path.join("."); } function getSourceForPath(source) { return { ...source }; } function isExplicitEmpty(value) { if (value === "" || value === null) { return true; } if (typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0) { return true; } return false; } function isRefObject(value) { return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.ref === "string"; } function pickLayerRootContribution(layer) { if (!layer || typeof layer !== "object" || Array.isArray(layer)) { return null; } const contribution = {}; for (const key of Object.keys(layer)) { if (TREE_STRUCTURAL_KEYS.has(key)) { continue; } if (key === "elements") { if (layer.elements && typeof layer.elements === "object") { contribution.elements = layer.elements; } continue; } if (isExplicitEmpty(layer[key])) { continue; } contribution[key] = layer[key]; } return Object.keys(contribution).length === 0 ? null : contribution; } var ATOMIC_OBJECT_KEYS = /* @__PURE__ */ new Set(["backgroundImage"]); function deepMergeDroppingEmpties(target, source, globalStyles, sourceMetadata, sources, path = []) { if (!source || typeof source !== "object" || Array.isArray(source)) { return target; } for (const key of Object.keys(source)) { let sourceValue = source[key]; if (isExplicitEmpty(sourceValue)) { continue; } if (isRefObject(sourceValue)) { if (sourceValue.ref.trim() === "") { continue; } const resolved = getValueFromObjectPath( globalStyles, sourceValue.ref ); if (resolved === void 0 || resolved === null || isRefObject(resolved)) { continue; } sourceValue = resolved; } const nextPath = [...path, key]; if (!ATOMIC_OBJECT_KEYS.has(key) && sourceValue !== null && typeof sourceValue === "object" && !Array.isArray(sourceValue) && !isRefObject(sourceValue)) { const existing = target[key] && typeof target[key] === "object" && !Array.isArray(target[key]) ? target[key] : {}; target[key] = deepMergeDroppingEmpties( { ...existing }, sourceValue, globalStyles, sourceMetadata, sources, nextPath ); } else { target[key] = ATOMIC_OBJECT_KEYS.has(key) && sourceValue !== null && typeof sourceValue === "object" && !Array.isArray(sourceValue) ? { ...sourceValue } : sourceValue; if (sourceMetadata && sources) { sources[getPathKey(nextPath)] = getSourceForPath(sourceMetadata); } } } return target; } function getStateSlice(layerObject, selectedState) { if (!layerObject) { return null; } const slice = getStyleForState(layerObject, selectedState); return slice && typeof slice === "object" && !Array.isArray(slice) ? slice : null; } var NON_CASCADING_ROOT_PREFIXES = [ "color.background", "color.gradient", "background", "spacing", "dimensions", "border", "shadow", "filter" ]; function isNonCascadingRootPath(pathKey) { if (pathKey.startsWith("elements.")) { return false; } return NON_CASCADING_ROOT_PREFIXES.some( (prefix2) => pathKey === prefix2 || pathKey.startsWith(`${prefix2}.`) ); } function deleteAtPath(target, pathSegments) { if (!target || typeof target !== "object") { return; } const [head, ...rest] = pathSegments; if (rest.length === 0) { delete target[head]; return; } const child = target[head]; if (child && typeof child === "object") { deleteAtPath(child, rest); if (Object.keys(child).length === 0) { delete target[head]; } } } function dropNonCascadingRootLeaves(value, sources) { for (const pathKey of Object.keys(sources)) { if (sources[pathKey].layer === "root" && isNonCascadingRootPath(pathKey)) { deleteAtPath(value, pathKey.split(".")); delete sources[pathKey]; } } } function resolveThemeFileBackgroundImage(value, globalStyles, links) { const image = value?.background?.backgroundImage; if (!image) { return; } const resolved = getResolvedValue(image, { ...globalStyles, _links: links ?? void 0 }); if (resolved !== void 0) { value.background.backgroundImage = resolved; } } function computeResolvedStyle(globalStyles, { blockName, variationName = null, elements = null, viewport = null, pseudoState = null } = {}) { if (!globalStyles || !globalStyles.styles) { return EMPTY_INHERITANCE; } if (!blockName) { return EMPTY_INHERITANCE; } const styles = globalStyles.styles; const selectedState = { viewport, pseudoState }; const root = styles; const block = styles.blocks?.[blockName] ?? null; const elementLayers = (elements ?? []).map((elementName) => styles.elements?.[elementName] ?? null).filter((layer) => !!layer); const variation = variationName ? getVariationStyle(globalStyles, blockName, variationName) ?? null : null; const contributions = [ createContribution( pickLayerRootContribution(root), createSourceDescriptor("root") ), ...elementLayers.map( (layer) => createContribution( pickLayerRootContribution(layer), createSourceDescriptor("element") ) ), block ? createContribution( pickLayerRootContribution(block), createSourceDescriptor("block") ) : null, variation ? createContribution( pickLayerRootContribution(variation), createSourceDescriptor("blockVariation") ) : null ]; if (!isDefaultBlockStyleState(selectedState)) { contributions.push( createContribution( pickLayerRootContribution( getStateSlice(root, selectedState) ), createSourceDescriptor("root") ), ...elementLayers.map( (layer) => createContribution( pickLayerRootContribution( getStateSlice(layer, selectedState) ), createSourceDescriptor("element") ) ), block ? createContribution( pickLayerRootContribution( getStateSlice(block, selectedState) ), createSourceDescriptor("block") ) : null, variation ? createContribution( pickLayerRootContribution( getStateSlice(variation, selectedState) ), createSourceDescriptor("blockVariation") ) : null ); } const filteredContributions = contributions.filter( Boolean ); if (filteredContributions.length === 0) { return EMPTY_INHERITANCE; } const sources = {}; const value = filteredContributions.reduce( (mergedValue, contribution) => deepMergeDroppingEmpties( mergedValue, contribution.styles, globalStyles, contribution.source, sources ), {} ); dropNonCascadingRootLeaves(value, sources); resolveThemeFileBackgroundImage( value, globalStyles, globalStyles._links ?? null ); return { value, sources }; } var NO_LINKS = {}; var memo = /* @__PURE__ */ new WeakMap(); function resolveStyle(globalStyles, context = {}) { const styleData = globalStyles?.styles; if (!styleData || typeof styleData !== "object") { return computeResolvedStyle(globalStyles, context); } let byLinks = memo.get(styleData); if (!byLinks) { byLinks = /* @__PURE__ */ new WeakMap(); memo.set(styleData, byLinks); } const linksKey = globalStyles?._links ?? NO_LINKS; let inner = byLinks.get(linksKey); if (!inner) { inner = /* @__PURE__ */ new Map(); byLinks.set(linksKey, inner); } const sliceKey = `${context.elements?.join(",") ?? ""}:${context.viewport ?? ""}:${context.pseudoState ?? ""}`; const key = (context.blockName || "") + "" + (context.variationName || "") + "" + sliceKey; if (inner.has(key)) { return inner.get(key); } const result = computeResolvedStyle(globalStyles, context); inner.set(key, result); return result; } // packages/global-styles-engine/build-module/lock-unlock.mjs var import_private_apis2 = __toESM(require_private_apis(), 1); var { lock: lock2, unlock: unlock2 } = (0, import_private_apis2.__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/global-styles-engine" ); // packages/global-styles-engine/build-module/private-apis.mjs var privateApis = {}; lock2(privateApis, { getResponsiveMediaQueries, getViewportBreakpoints, getViewportBreakpointValueInPixels, resolveStyle, getVariationStyle }); // packages/block-editor/build-module/components/block-visibility/constants.mjs var import_i18n2 = __toESM(require_i18n(), 1); var BLOCK_VISIBILITY_VIEWPORTS = { desktop: { label: (0, import_i18n2.__)("Desktop"), icon: desktop_default, key: "desktop" }, tablet: { label: (0, import_i18n2.__)("Tablet"), icon: tablet_default, key: "tablet" }, mobile: { label: (0, import_i18n2.__)("Mobile"), icon: mobile_default, key: "mobile" } }; var BLOCK_VISIBILITY_VIEWPORT_ENTRIES = Object.entries( BLOCK_VISIBILITY_VIEWPORTS ); // packages/block-editor/build-module/store/get-block-settings.mjs var import_blocks4 = __toESM(require_blocks(), 1); var import_hooks = __toESM(require_hooks(), 1); // packages/block-editor/build-module/utils/object.mjs function setImmutably2(object, path, value) { const pathArray = Array.isArray(path) ? [...path] : [path]; const result = Array.isArray(object) ? [...object] : { ...object }; const leaf = pathArray.pop(); let prev = result; for (const key of pathArray) { const lvl = prev[key]; prev[key] = prev = Array.isArray(lvl) ? [...lvl] : { ...lvl }; } prev[leaf] = value; return result; } var getValueFromObjectPath2 = (object, path, defaultValue) => { const arrayPath = Array.isArray(path) ? path : path.split("."); let value = object; arrayPath.forEach((fieldName) => { value = value?.[fieldName]; }); return value ?? defaultValue; }; // packages/block-editor/build-module/store/get-block-settings.mjs var blockedPaths = [ "color", "border", "dimensions", "typography", "spacing" ]; var deprecatedFlags = { "color.palette": (settings2) => settings2.colors, "color.gradients": (settings2) => settings2.gradients, "color.custom": (settings2) => settings2.disableCustomColors === void 0 ? void 0 : !settings2.disableCustomColors, "color.customGradient": (settings2) => settings2.disableCustomGradients === void 0 ? void 0 : !settings2.disableCustomGradients, "typography.fontSizes": (settings2) => settings2.fontSizes, "typography.customFontSize": (settings2) => settings2.disableCustomFontSizes === void 0 ? void 0 : !settings2.disableCustomFontSizes, "typography.lineHeight": (settings2) => settings2.enableCustomLineHeight, "spacing.units": (settings2) => { if (settings2.enableCustomUnits === void 0) { return; } if (settings2.enableCustomUnits === true) { return ["px", "em", "rem", "vh", "vw", "%"]; } return settings2.enableCustomUnits; }, "spacing.padding": (settings2) => settings2.enableCustomSpacing }; var prefixedFlags = { /* * These were only available in the plugin * and can be removed when the minimum WordPress version * for the plugin is 5.9. */ "border.customColor": "border.color", "border.customStyle": "border.style", "border.customWidth": "border.width", "typography.customFontStyle": "typography.fontStyle", "typography.customFontWeight": "typography.fontWeight", "typography.customLetterSpacing": "typography.letterSpacing", "typography.customTextDecorations": "typography.textDecoration", "typography.customTextTransforms": "typography.textTransform", /* * These were part of WordPress 5.8 and we need to keep them. */ "border.customRadius": "border.radius", "spacing.customMargin": "spacing.margin", "spacing.customPadding": "spacing.padding", "typography.customLineHeight": "typography.lineHeight" }; var removeCustomPrefixes = (path) => { return prefixedFlags[path] || path; }; function getBlockSettings(state, clientId, ...paths) { const blockName = getBlockName(state, clientId); const candidates = []; if (clientId) { let id = clientId; do { const name = getBlockName(state, id); if ((0, import_blocks4.hasBlockSupport)(name, "__experimentalSettings", false)) { candidates.push(id); } } while (id = state.blocks.parents.get(id)); } return paths.map((path) => { if (blockedPaths.includes(path)) { console.warn( "Top level useSetting paths are disabled. Please use a subpath to query the information needed." ); return void 0; } let result = (0, import_hooks.applyFilters)( "blockEditor.useSetting.before", void 0, path, clientId, blockName ); if (void 0 !== result) { return result; } const normalizedPath = removeCustomPrefixes(path); for (const candidateClientId of candidates) { const candidateAtts = getBlockAttributes( state, candidateClientId ); result = getValueFromObjectPath2( candidateAtts.settings?.blocks?.[blockName], normalizedPath ) ?? getValueFromObjectPath2( candidateAtts.settings, normalizedPath ); if (result !== void 0) { break; } } const settings2 = getSettings(state); if (result === void 0 && blockName) { result = getValueFromObjectPath2( settings2.__experimentalFeatures?.blocks?.[blockName], normalizedPath ); } if (result === void 0) { result = getValueFromObjectPath2( settings2.__experimentalFeatures, normalizedPath ); } if (result !== void 0) { if (import_blocks4.__EXPERIMENTAL_PATHS_WITH_OVERRIDE[normalizedPath]) { return result.custom ?? result.theme ?? result.default; } return result; } const deprecatedSettingsValue = deprecatedFlags[normalizedPath]?.(settings2); if (deprecatedSettingsValue !== void 0) { return deprecatedSettingsValue; } return normalizedPath === "typography.dropCap" ? true : void 0; }); } // packages/block-editor/build-module/store/private-selectors.mjs var { isContentBlock: isContentBlock2, editableRootKey } = unlock(import_blocks5.privateApis); var { getViewportBreakpoints: getViewportBreakpoints2 } = unlock(privateApis); function isViewportAvailable(state, viewport) { if (viewport === BLOCK_VISIBILITY_VIEWPORTS.desktop.key) { return true; } return getViewportBreakpoints2( getSettings(state)?.__experimentalFeatures?.viewport )[viewport] !== void 0; } function isBlockInterfaceHidden2(state) { return state.isBlockInterfaceHidden; } function getLastInsertedBlocksClientIds(state) { return state?.lastBlockInserted?.clientIds; } function getBlockWithoutAttributes(state, clientId) { return state.blocks.byClientId.get(clientId); } var isBlockSubtreeDisabled = (state, clientId) => { const isChildSubtreeDisabled = (childClientId) => { return getBlockEditingMode(state, childClientId) === "disabled" && getBlockOrder(state, childClientId).every( isChildSubtreeDisabled ); }; return getBlockOrder(state, clientId).every(isChildSubtreeDisabled); }; function isContainerInsertableToInContentOnlyMode(state, blockName, rootClientId) { const isBlockContentBlock = isContentBlock2(blockName); const rootBlockName = getBlockName(state, rootClientId); const isContainerContentBlock = isContentBlock2(rootBlockName); const isRootBlockMain = getSectionRootClientId(state) === rootClientId; return isRootBlockMain || isContainerContentBlock && isBlockContentBlock; } function getClientIdWithClientIdsTreeUnmemoized(state, clientId) { return { clientId, innerBlocks: getClientIdsTreeUnmemoized(state, clientId) }; } function getClientIdsTreeUnmemoized(state, rootClientId = "") { return getBlockOrder(state, rootClientId).map( (clientId) => getClientIdWithClientIdsTreeUnmemoized(state, clientId) ); } var getClientIdWithClientIdsTree = (0, import_data4.createSelector)( getClientIdWithClientIdsTreeUnmemoized, (state) => [state.blocks.order] ); var getClientIdsTree = (0, import_data4.createSelector)( getClientIdsTreeUnmemoized, (state) => [state.blocks.order] ); function getFilteredClientIdsTreeUnmemoized(state, rootClientId, includesBlock) { const blockOrder = getBlockOrder(state, rootClientId); const result = []; for (const clientId of blockOrder) { const innerBlocks = getFilteredClientIdsTreeUnmemoized( state, clientId, includesBlock ); if (includesBlock(state, clientId)) { result.push({ clientId, innerBlocks }); } else { result.push(...innerBlocks); } } return result; } function getEnabledClientIdsTreeUnmemoized(state, rootClientId) { return getFilteredClientIdsTreeUnmemoized( state, rootClientId, (_state, clientId) => getBlockEditingMode(_state, clientId) !== "disabled" ); } function hasExplicitDisabledParent(state, clientId) { let parent = state.blocks.parents.get(clientId); while (parent !== void 0) { const parentBlockEditingMode = state.blocks.blockEditingModes.get(parent); if (parentBlockEditingMode) { return parentBlockEditingMode === "disabled"; } parent = state.blocks.parents.get(parent); } return false; } var canHostEditableRoot = (0, import_data4.createSelector)( (state, clientId) => { if (!clientId || getBlockEditingMode(state, clientId) !== "default" || // Not when the block is edited as HTML: there is no rich text to // host then, only a textarea, which the editing host would // interfere with. getBlockMode(state, clientId) !== "visual" || !(0, import_blocks5.getBlockType)(getBlockName(state, clientId))?.[editableRootKey]) { return false; } const siblings = getBlockOrder( state, getBlockRootClientId(state, clientId) ); return siblings.length > 1 && siblings.every( (siblingClientId) => getBlockEditingMode(state, siblingClientId) === "default" ); }, (state) => [ state.blocks.order, state.blocks.parents, state.blocks.byClientId, state.blocks.blockEditingModes, state.derivedBlockEditingModes, state.blocksMode ] ); function getListViewClientIdsTreeUnmemoized(state, rootClientId) { return getFilteredClientIdsTreeUnmemoized( state, rootClientId, (_state, clientId) => { if (getBlockEditingMode(_state, clientId) !== "disabled") { return true; } const explicitBlockEditingMode = _state.blocks.blockEditingModes.get(clientId); if (explicitBlockEditingMode) { return explicitBlockEditingMode !== "disabled"; } if (hasExplicitDisabledParent(_state, clientId)) { return false; } if (_state.editedContentOnlySection) { if (isWithinEditedContentOnlySection(_state, clientId)) { return false; } const parentSectionBlock = getParentSectionBlock( _state, clientId ); if (!parentSectionBlock) { return true; } if (isContentBlock2(getBlockName(_state, clientId))) { return true; } } return false; } ); } var getEnabledClientIdsTree = (0, import_data4.createRegistrySelector)( () => (0, import_data4.createSelector)(getEnabledClientIdsTreeUnmemoized, (state) => [ state.blocks.order, state.derivedBlockEditingModes, state.blocks.blockEditingModes ]) ); var getListViewClientIdsTree = (0, import_data4.createRegistrySelector)( () => (0, import_data4.createSelector)(getListViewClientIdsTreeUnmemoized, (state) => [ state.blocks.order, state.derivedBlockEditingModes, state.blocks.blockEditingModes, state.blocks.parents, state.blocks.byClientId, state.blocks.attributes, state.blockListSettings, state.editedContentOnlySection, state.settings ]) ); var getEnabledBlockParents = (0, import_data4.createSelector)( (state, clientId, ascending = false) => { return getBlockParents(state, clientId, ascending).filter( (parent) => getBlockEditingMode(state, parent) !== "disabled" ); }, (state) => [ state.blocks.parents, state.blocks.blockEditingModes, state.settings.templateLock, state.blockListSettings ] ); function getRemovalPromptData(state) { return state.removalPromptData; } function getBlockRemovalRules(state) { return state.blockRemovalRules; } var getStyleOverrides = (0, import_data4.createSelector)( (state) => { const clientIds = getClientIdsWithDescendants(state); const clientIdMap = clientIds.reduce((acc, clientId, index2) => { acc[clientId] = index2; return acc; }, {}); return [...state.styleOverrides].sort((overrideA, overrideB) => { const [, { clientId: clientIdA }] = overrideA; const [, { clientId: clientIdB }] = overrideB; const aIndex = clientIdMap[clientIdA] ?? -1; const bIndex = clientIdMap[clientIdB] ?? -1; return aIndex - bIndex; }); }, (state) => [state.blocks.order, state.styleOverrides] ); function getRegisteredInserterMediaCategories(state) { return state.registeredInserterMediaCategories; } var getInserterMediaCategories = (0, import_data4.createSelector)( (state) => { const { settings: { inserterMediaCategories, allowedMimeTypes, enableOpenverseMediaCategory }, registeredInserterMediaCategories: registeredInserterMediaCategories2 } = state; if (!inserterMediaCategories && !registeredInserterMediaCategories2.length || !allowedMimeTypes) { return; } const coreInserterMediaCategoriesNames = inserterMediaCategories?.map(({ name }) => name) || []; const mergedCategories = [ ...inserterMediaCategories || [], ...(registeredInserterMediaCategories2 || []).filter( ({ name }) => !coreInserterMediaCategoriesNames.includes(name) ) ]; return mergedCategories.filter((category) => { if (!enableOpenverseMediaCategory && category.name === "openverse") { return false; } return Object.values(allowedMimeTypes).some( (mimeType) => mimeType.startsWith(`${category.mediaType}/`) ); }); }, (state) => [ state.settings.inserterMediaCategories, state.settings.allowedMimeTypes, state.settings.enableOpenverseMediaCategory, state.registeredInserterMediaCategories ] ); var hasAllowedPatterns = (0, import_data4.createRegistrySelector)( (select3) => (0, import_data4.createSelector)( (state, rootClientId = null) => { const { getAllPatterns: getAllPatterns2 } = unlock(select3(STORE_NAME)); const patterns = getAllPatterns2(); const { allowedBlockTypes } = getSettings(state); return patterns.some((pattern) => { const { inserter = true } = pattern; if (!inserter) { return false; } const grammar = getGrammar(pattern); return checkAllowListRecursive(grammar, allowedBlockTypes) && grammar.every( ({ name: blockName }) => canInsertBlockType(state, blockName, rootClientId) ); }); }, (state, rootClientId) => [ ...getAllPatternsDependants(select3)(state), ...getInsertBlockTypeDependants(select3)(state, rootClientId) ] ) ); var getPatternBySlug = (0, import_data4.createRegistrySelector)( (select3) => (0, import_data4.createSelector)( (state, patternName) => { if (patternName?.startsWith("core/block/")) { const _id = parseInt( patternName.slice("core/block/".length), 10 ); const block = unlock(select3(STORE_NAME)).getReusableBlocks().find(({ id }) => id === _id); if (!block) { return null; } return mapUserPattern( block, state.settings[userPatternCategoriesSelectKey]?.( select3 ) ?? state.settings.__experimentalUserPatternCategories ); } return [ // This setting is left for back compat. ...state.settings.__experimentalBlockPatterns ?? [], ...state.settings[selectBlockPatternsKey]?.(select3) ?? [] ].find(({ name }) => name === patternName); }, (state, patternName) => patternName?.startsWith("core/block/") ? [ unlock(select3(STORE_NAME)).getReusableBlocks(), state.settings.__experimentalReusableBlocks ] : [ state.settings.__experimentalBlockPatterns, state.settings[selectBlockPatternsKey]?.(select3) ] ) ); var getAllPatterns = (0, import_data4.createRegistrySelector)( (select3) => (0, import_data4.createSelector)((state) => { return [ ...unlock(select3(STORE_NAME)).getReusableBlocks().map( (userPattern) => mapUserPattern( userPattern, state.settings[userPatternCategoriesSelectKey]?.( select3 ) ?? state.settings.__experimentalUserPatternCategories ) ), // This setting is left for back compat. ...state.settings.__experimentalBlockPatterns ?? [], ...state.settings[selectBlockPatternsKey]?.(select3) ?? [] ].filter( (x2, index2, arr) => index2 === arr.findIndex((y2) => x2.name === y2.name) ); }, getAllPatternsDependants(select3)) ); var EMPTY_ARRAY = []; var getReusableBlocks = (0, import_data4.createRegistrySelector)( (select3) => (state) => { const reusableBlocksSelect = state.settings[reusableBlocksSelectKey]; return (reusableBlocksSelect ? reusableBlocksSelect(select3) : state.settings.__experimentalReusableBlocks) ?? EMPTY_ARRAY; } ); function getLastFocus(state) { return state.lastFocus; } function isDragging2(state) { return state.isDragging; } function getExpandedBlock(state) { return state.expandedBlock; } var getContentLockingParent = (state, clientId) => { let current = clientId; let result; while (!result && (current = state.blocks.parents.get(current))) { if (getTemplateLock(state, current) === "contentOnly") { result = current; } } return result; }; function isSectionBlockCandidate(state, clientId) { const blockName = getBlockName(state, clientId); if (blockName === "core/block") { return true; } const attributes = getBlockAttributes(state, clientId); const isTemplatePart9 = blockName === "core/template-part"; const isIsolatedEditor = state.settings?.[isIsolatedEditorKey]; const disableContentOnlyForUnsyncedPatterns = state.settings?.disableContentOnlyForUnsyncedPatterns; const disableContentOnlyForTemplateParts = state.settings?.disableContentOnlyForTemplateParts; if ((!disableContentOnlyForUnsyncedPatterns && attributes?.metadata?.patternName || isTemplatePart9 && !disableContentOnlyForTemplateParts) && !isIsolatedEditor) { return true; } const hasContentOnlyTemplateLock = getTemplateLock(state, clientId) === "contentOnly"; const rootClientId = getBlockRootClientId(state, clientId); const hasRootContentOnlyTemplateLock = getTemplateLock(state, rootClientId) === "contentOnly"; if (hasContentOnlyTemplateLock && !hasRootContentOnlyTemplateLock) { return true; } return false; } var getParentSectionBlock = (state, clientId) => { if (isWithinEditedContentOnlySection(state, clientId)) { return void 0; } let current = clientId; let result; while (current = state.blocks.parents.get(current)) { if (isSectionBlockCandidate(state, current)) { result = current; } } return result; }; function isSectionBlock(state, clientId) { if (isWithinEditedContentOnlySection(state, clientId) || getParentSectionBlock(state, clientId)) { return false; } return isSectionBlockCandidate(state, clientId); } function getEditedContentOnlySection(state) { return state.editedContentOnlySection; } function isWithinEditedContentOnlySection(state, clientId) { if (!state.editedContentOnlySection) { return false; } if (state.editedContentOnlySection === clientId) { return true; } let current = clientId; while (current = state.blocks.parents.get(current)) { if (state.editedContentOnlySection === current) { return true; } } return false; } var getBlockStyles = (0, import_data4.createSelector)( (state, clientIds) => clientIds.reduce((styles, clientId) => { styles[clientId] = state.blocks.attributes.get(clientId)?.style; return styles; }, {}), (state, clientIds) => [ ...clientIds.map( (clientId) => state.blocks.attributes.get(clientId)?.style ) ] ); function getSectionRootClientId(state) { return state.settings?.[sectionRootClientIdKey]; } function isZoomOut(state) { return state.zoomLevel === "auto-scaled" || state.zoomLevel < 100; } function getZoomLevel(state) { return state.zoomLevel; } function getClosestAllowedInsertionPoint(state, name, clientId = "") { const blockNames = Array.isArray(name) ? name : [name]; const areBlockNamesAllowedInClientId = (id) => blockNames.every( (currentName) => canInsertBlockType(state, currentName, id) ); if (!clientId) { if (areBlockNamesAllowedInClientId(clientId)) { return clientId; } const sectionRootClientId = getSectionRootClientId(state); if (sectionRootClientId && areBlockNamesAllowedInClientId(sectionRootClientId)) { return sectionRootClientId; } return null; } let current = clientId; while (current !== null && !areBlockNamesAllowedInClientId(current)) { const parentClientId = getBlockRootClientId(state, current); current = parentClientId; } return current; } function getClosestAllowedInsertionPointForPattern(state, pattern, clientId) { const { allowedBlockTypes } = getSettings(state); const isAllowed = checkAllowListRecursive( getGrammar(pattern), allowedBlockTypes ); if (!isAllowed) { return null; } const names = getGrammar(pattern).map(({ blockName: name }) => name); return getClosestAllowedInsertionPoint(state, names, clientId); } function getInsertionPoint(state) { return state.insertionPoint; } var isBlockHiddenAnywhere = (state, clientId) => { const blockName = getBlockName(state, clientId); if (!(0, import_blocks5.hasBlockSupport)(blockName, "visibility", true)) { return false; } const attributes = state.blocks.attributes.get(clientId); const blockVisibility2 = attributes?.metadata?.blockVisibility; if (blockVisibility2 === false) { return true; } if (typeof blockVisibility2?.viewport === "object" && blockVisibility2?.viewport !== null) { return Object.values(BLOCK_VISIBILITY_VIEWPORTS).some( (viewport) => isViewportAvailable(state, viewport.key) && blockVisibility2?.viewport?.[viewport.key] === false ); } return false; }; var isBlockHiddenEverywhere = (state, clientId) => { const blockName = getBlockName(state, clientId); if (!(0, import_blocks5.hasBlockSupport)(blockName, "visibility", true)) { return false; } const attributes = state.blocks.attributes.get(clientId); const blockVisibility2 = attributes?.metadata?.blockVisibility; if (blockVisibility2 === false) { return true; } return false; }; var isBlockParentHiddenEverywhere = (state, clientId) => { const parents = getBlockParents(state, clientId); return parents.some( (parentId) => isBlockHiddenEverywhere(state, parentId) ); }; var isBlockHiddenAtViewport = (state, clientId, viewport) => { if (isBlockHiddenEverywhere(state, clientId)) { return true; } const attributes = state.blocks.attributes.get(clientId); const blockVisibilityViewport = attributes?.metadata?.blockVisibility?.viewport; if (typeof blockVisibilityViewport === "object" && blockVisibilityViewport !== null && typeof viewport === "string") { const viewportKey = viewport.toLowerCase(); return isViewportAvailable(state, viewportKey) && blockVisibilityViewport?.[viewportKey] === false; } return false; }; var isBlockParentHiddenAtViewport = (state, clientId, viewport) => { const parents = getBlockParents(state, clientId); return parents.some( (parentId) => isBlockHiddenAtViewport(state, parentId, viewport) ); }; function hasBlockSpotlight2(state) { return !!state.hasBlockSpotlight || !!state.editedContentOnlySection; } function isEditLockedBlock(state, clientId) { const attributes = getBlockAttributes(state, clientId); return !!attributes?.lock?.edit; } function isMoveLockedBlock(state, clientId) { const attributes = getBlockAttributes(state, clientId); if (attributes?.lock?.move !== void 0) { return !!attributes?.lock?.move; } const rootClientId = getBlockRootClientId(state, clientId); const templateLock = getTemplateLock(state, rootClientId); return templateLock === "all"; } function isRemoveLockedBlock(state, clientId) { const attributes = getBlockAttributes(state, clientId); if (attributes?.lock?.remove !== void 0) { return !!attributes?.lock?.remove; } const rootClientId = getBlockRootClientId(state, clientId); const templateLock = getTemplateLock(state, rootClientId); return templateLock === "all" || templateLock === "insert"; } function isLockedBlock(state, clientId) { return isEditLockedBlock(state, clientId) || isMoveLockedBlock(state, clientId) || isRemoveLockedBlock(state, clientId); } function isListViewContentPanelOpen(state) { return state.listViewContentPanelOpen; } function isListViewPanelOpened(state, clientId) { if (state.openedListViewPanels?.allOpen) { return true; } return state.openedListViewPanels?.panels?.[clientId] === true; } function getListViewExpandRevision(state) { return state.listViewExpandRevision || 0; } function shouldRenderBlockListView(state, clientId) { const blockName = getBlockName(state, clientId); if (blockName === "core/navigation") { return true; } if (!(0, import_blocks5.hasBlockSupport)(blockName, "listView")) { return false; } const allowedBlocks = getBlockListSettings( state, clientId )?.allowedBlocks; const isEmptyAndNoAllowedBlocks = getBlockOrder(state, clientId).length === 0 && (allowedBlocks === false || Array.isArray(allowedBlocks) && allowedBlocks.length === 0); return !isEmptyAndNoAllowedBlocks; } function getViewportModalClientIds(state) { return state.viewportModalClientIds; } function getRequestedInspectorTab(state) { return state.requestedInspectorTab; } var DEFAULT_BLOCK_STYLE_STATE = { viewport: "default", pseudo: "default" }; function getStyleStateViewport(state) { return state.styleStateViewport ?? DEFAULT_BLOCK_STYLE_STATE.viewport; } function isResponsiveEditing2(state) { return state.isResponsiveEditing; } var getSelectedBlockStyleState = (0, import_data4.createSelector)( (state, clientId) => { const perBlockState = state.selectedBlockStyleState?.clientId === clientId ? state.selectedBlockStyleState.value ?? DEFAULT_BLOCK_STYLE_STATE : DEFAULT_BLOCK_STYLE_STATE; return { ...perBlockState, // The viewport is tracked globally, so inject it here. This way // consumers receive a single combined state object instead of // merging the global viewport themselves, and selectors derived // from this stay consistent. viewport: getStyleStateViewport(state) }; }, (state) => [state.styleStateViewport, state.selectedBlockStyleState] ); function hasSelectedStyleState(state, clientId) { const selectedState = getSelectedBlockStyleState(state, clientId); return selectedState.viewport !== DEFAULT_BLOCK_STYLE_STATE.viewport || selectedState.pseudo !== DEFAULT_BLOCK_STYLE_STATE.pseudo; } function isSelectedBlockStyleStateShownOnCanvas(state, clientId) { if (state.selectedBlockStyleState?.clientId !== clientId) { return true; } return state.selectedBlockStyleState.showStateOnCanvas ?? true; } // packages/block-editor/build-module/components/inserter/block-patterns-tab/utils.mjs var import_i18n3 = __toESM(require_i18n(), 1); var INSERTER_PATTERN_TYPES = { user: "user", theme: "theme", directory: "directory" }; var INSERTER_SYNC_TYPES = { full: "fully", unsynced: "unsynced" }; var allPatternsCategory = { name: "allPatterns", label: (0, import_i18n3._x)("All", "patterns") }; var myPatternsCategory = { name: "myPatterns", label: (0, import_i18n3.__)("My patterns") }; var starterPatternsCategory = { name: "core/starter-content", label: (0, import_i18n3.__)("Starter content") }; function isPatternFiltered(pattern, sourceFilter, syncFilter) { const isUserPattern = pattern.name.startsWith("core/block"); const isDirectoryPattern = pattern.source === "core" || pattern.source?.startsWith("pattern-directory"); if (sourceFilter === INSERTER_PATTERN_TYPES.theme && (isUserPattern || isDirectoryPattern)) { return true; } if (sourceFilter === INSERTER_PATTERN_TYPES.directory && (isUserPattern || !isDirectoryPattern)) { return true; } if (sourceFilter === INSERTER_PATTERN_TYPES.user && pattern.type !== INSERTER_PATTERN_TYPES.user) { return true; } if (syncFilter === INSERTER_SYNC_TYPES.full && pattern.syncStatus !== "") { return true; } if (syncFilter === INSERTER_SYNC_TYPES.unsynced && pattern.syncStatus !== "unsynced" && isUserPattern) { return true; } return false; } // packages/block-editor/build-module/store/utils.mjs var isFiltered = /* @__PURE__ */ Symbol("isFiltered"); var parsedPatternCache = /* @__PURE__ */ new WeakMap(); var grammarMapCache = /* @__PURE__ */ new WeakMap(); function mapUserPattern(userPattern, __experimentalUserPatternCategories = []) { return { name: `core/block/${userPattern.id}`, id: userPattern.id, type: INSERTER_PATTERN_TYPES.user, title: userPattern.title?.raw, categories: userPattern.wp_pattern_category?.map((catId) => { const category = __experimentalUserPatternCategories.find( ({ id }) => id === catId ); return category ? category.slug : catId; }), content: userPattern.content?.raw, syncStatus: userPattern.wp_pattern_sync_status }; } function parsePattern(pattern) { const blocks2 = (0, import_blocks6.parse)(pattern.content, { __unstableSkipMigrationLogs: true }); if (blocks2.length === 1) { blocks2[0].attributes = { ...blocks2[0].attributes, metadata: { ...blocks2[0].attributes.metadata || {}, categories: pattern.categories, patternName: pattern.name, name: blocks2[0].attributes.metadata?.name || pattern.title } }; } return { ...pattern, blocks: blocks2 }; } function getParsedPattern(pattern) { let parsedPattern = parsedPatternCache.get(pattern); if (!parsedPattern) { parsedPattern = parsePattern(pattern); parsedPatternCache.set(pattern, parsedPattern); } return parsedPattern; } function getGrammar(pattern) { let grammarMap = grammarMapCache.get(pattern); if (!grammarMap) { grammarMap = (0, import_block_serialization_default_parser.parse)(pattern.content); grammarMap = grammarMap.filter((block) => block.blockName !== null); grammarMapCache.set(pattern, grammarMap); } return grammarMap; } var checkAllowList = (list, item, defaultResult = null) => { if (typeof list === "boolean") { return list; } if (Array.isArray(list)) { if (list.includes("core/post-content") && item === null) { return true; } return list.includes(item); } return defaultResult; }; var checkAllowListRecursive = (blocks2, allowedBlockTypes) => { if (typeof allowedBlockTypes === "boolean") { return allowedBlockTypes; } const blocksQueue = [...blocks2]; while (blocksQueue.length > 0) { const block = blocksQueue.shift(); const isAllowed = checkAllowList( allowedBlockTypes, block.name || block.blockName, true ); if (!isAllowed) { return false; } block.innerBlocks?.forEach((innerBlock) => { blocksQueue.push(innerBlock); }); } return true; }; var getAllPatternsDependants = (select3) => (state) => { return [ state.settings.__experimentalBlockPatterns, state.settings[userPatternCategoriesSelectKey]?.(select3) ?? state.settings.__experimentalUserPatternCategories, state.settings.__experimentalReusableBlocks, state.settings[selectBlockPatternsKey]?.(select3), state.blockPatterns, unlock(select3(STORE_NAME)).getReusableBlocks() ]; }; var getInsertBlockTypeDependants = () => (state, rootClientId) => { return [ state.blockListSettings.get(rootClientId), state.blocks.byClientId.get(rootClientId), state.blocks.order.get(rootClientId || ""), state.settings.allowedBlockTypes, state.settings.templateLock, getBlockEditingMode(state, rootClientId), getSectionRootClientId(state), isSectionBlock(state, rootClientId), getParentSectionBlock(state, rootClientId) ]; }; // packages/block-editor/build-module/utils/sorting.mjs function isGreater(a2, b2) { if (typeof a2 === "string" && typeof b2 === "string") { return a2 > b2; } return Number(a2) > Number(b2); } var comparator = (field, items, order) => { return (a2, b2) => { let cmpA, cmpB; if (typeof field === "function") { cmpA = field(a2); cmpB = field(b2); } else { cmpA = a2[field]; cmpB = b2[field]; } if (isGreater(cmpA, cmpB)) { return order === "asc" ? 1 : -1; } else if (isGreater(cmpB, cmpA)) { return order === "asc" ? -1 : 1; } const orderA = items.findIndex((item) => item === a2); const orderB = items.findIndex((item) => item === b2); if (orderA > orderB) { return 1; } else if (orderB > orderA) { return -1; } return 0; }; }; function orderBy(items, field, order = "asc") { return items.concat().sort(comparator(field, items, order)); } // packages/block-editor/build-module/store/selectors.mjs var { isContentBlock: isContentBlock3 } = unlock(import_blocks7.privateApis); var MILLISECONDS_PER_HOUR = 3600 * 1e3; var MILLISECONDS_PER_DAY = 24 * 3600 * 1e3; var MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1e3; var EMPTY_ARRAY2 = []; var EMPTY_SET = /* @__PURE__ */ new Set(); var DEFAULT_INSERTER_OPTIONS = { [isFiltered]: true }; function getBlockName(state, clientId) { const block = state.blocks.byClientId.get(clientId); return block ? block.name : null; } function isBlockValid(state, clientId) { const block = state.blocks.byClientId.get(clientId); return !!block && block.isValid; } function getBlockAttributes(state, clientId) { const block = state.blocks.byClientId.get(clientId); if (!block) { return null; } return state.blocks.attributes.get(clientId); } function getBlock(state, clientId) { if (!state.blocks.byClientId.has(clientId)) { return null; } return state.blocks.tree.get(clientId); } var __unstableGetBlockWithoutInnerBlocks = (0, import_data5.createSelector)( (state, clientId) => { const block = state.blocks.byClientId.get(clientId); if (!block) { return null; } return { ...block, attributes: getBlockAttributes(state, clientId) }; }, (state, clientId) => [ state.blocks.byClientId.get(clientId), state.blocks.attributes.get(clientId) ] ); function getBlocks(state, rootClientId) { const treeKey = !rootClientId || !areInnerBlocksControlled(state, rootClientId) ? rootClientId || "" : "controlled||" + rootClientId; return state.blocks.tree.get(treeKey)?.innerBlocks || EMPTY_ARRAY2; } function __unstableGetClientIdWithClientIdsTree(state, clientId) { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree", { since: "6.3", version: "6.5" } ); return getClientIdWithClientIdsTree(state, clientId); } function __unstableGetClientIdsTree(state, rootClientId) { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree", { since: "6.3", version: "6.5" } ); return getClientIdsTree(state, rootClientId); } var getClientIdsOfDescendants = (0, import_data5.createSelector)( (state, rootIds) => { rootIds = Array.isArray(rootIds) ? [...rootIds] : [rootIds]; const ids = []; for (const rootId of rootIds) { const order = state.blocks.order.get(rootId); if (order) { ids.push(...order); } } let index2 = 0; while (index2 < ids.length) { const id = ids[index2]; const order = state.blocks.order.get(id); if (order) { ids.splice(index2 + 1, 0, ...order); } index2++; } return ids; }, (state) => [state.blocks.order] ); var getClientIdsWithDescendants = (state) => getClientIdsOfDescendants(state, ""); var getGlobalBlockCount = (0, import_data5.createSelector)( (state, blockName) => { const clientIds = getClientIdsWithDescendants(state); if (!blockName) { return clientIds.length; } let count = 0; for (const clientId of clientIds) { const block = state.blocks.byClientId.get(clientId); if (block.name === blockName) { count++; } } return count; }, (state) => [state.blocks.order, state.blocks.byClientId] ); var getBlocksByName = (0, import_data5.createSelector)( (state, blockName) => { if (!blockName) { return EMPTY_ARRAY2; } const blockNames = Array.isArray(blockName) ? blockName : [blockName]; const clientIds = getClientIdsWithDescendants(state); const foundBlocks = clientIds.filter((clientId) => { const block = state.blocks.byClientId.get(clientId); return blockNames.includes(block.name); }); return foundBlocks.length > 0 ? foundBlocks : EMPTY_ARRAY2; }, (state) => [state.blocks.order, state.blocks.byClientId] ); function __experimentalGetGlobalBlocksByName(state, blockName) { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName", { since: "6.5", alternative: `wp.data.select( 'core/block-editor' ).getBlocksByName` } ); return getBlocksByName(state, blockName); } var getBlocksByClientId = (0, import_data5.createSelector)( (state, clientIds) => (Array.isArray(clientIds) ? clientIds : [clientIds]).map( (clientId) => getBlock(state, clientId) ), (state, clientIds) => (Array.isArray(clientIds) ? clientIds : [clientIds]).map( (clientId) => state.blocks.tree.get(clientId) ) ); var getBlockNamesByClientId = (0, import_data5.createSelector)( (state, clientIds) => getBlocksByClientId(state, clientIds).filter(Boolean).map((block) => block.name), (state, clientIds) => getBlocksByClientId(state, clientIds) ); function getBlockCount(state, rootClientId) { return getBlockOrder(state, rootClientId).length; } function getSelectionStart(state) { return state.selection.selectionStart; } function getSelectionEnd(state) { return state.selection.selectionEnd; } function getBlockSelectionStart(state) { return state.selection.selectionStart.clientId; } function getBlockSelectionEnd(state) { return state.selection.selectionEnd.clientId; } function getSelectedBlockCount(state) { const multiSelectedBlockCount = getMultiSelectedBlockClientIds(state).length; if (multiSelectedBlockCount) { return multiSelectedBlockCount; } return state.selection.selectionStart.clientId ? 1 : 0; } function hasSelectedBlock(state) { const { selectionStart, selectionEnd } = state.selection; return !!selectionStart.clientId && selectionStart.clientId === selectionEnd.clientId; } function getSelectedBlockClientId(state) { const { selectionStart, selectionEnd } = state.selection; const { clientId } = selectionStart; if (!clientId || clientId !== selectionEnd.clientId) { return null; } return clientId; } function getSelectedBlock(state) { const clientId = getSelectedBlockClientId(state); return clientId ? getBlock(state, clientId) : null; } function getBlockRootClientId(state, clientId) { return state.blocks.parents.get(clientId) ?? null; } var getBlockParents = (0, import_data5.createSelector)( (state, clientId, ascending = false) => { const parents = []; let current = clientId; while (current = state.blocks.parents.get(current)) { parents.push(current); } if (!parents.length) { return EMPTY_ARRAY2; } return ascending ? parents : parents.reverse(); }, (state) => [state.blocks.parents] ); var getBlockParentsByBlockName = (0, import_data5.createSelector)( (state, clientId, blockName, ascending = false) => { const parents = getBlockParents(state, clientId, ascending); const hasName = Array.isArray(blockName) ? (name) => blockName.includes(name) : (name) => blockName === name; return parents.filter((id) => hasName(getBlockName(state, id))); }, (state) => [state.blocks.parents] ); function getBlockHierarchyRootClientId(state, clientId) { let current = clientId; let parent; do { parent = current; current = state.blocks.parents.get(current); } while (current); return parent; } function getLowestCommonAncestorWithSelectedBlock(state, clientId) { const selectedId = getSelectedBlockClientId(state); const clientParents = [...getBlockParents(state, clientId), clientId]; const selectedParents = [ ...getBlockParents(state, selectedId), selectedId ]; let lowestCommonAncestor; const maxDepth = Math.min(clientParents.length, selectedParents.length); for (let index2 = 0; index2 < maxDepth; index2++) { if (clientParents[index2] === selectedParents[index2]) { lowestCommonAncestor = clientParents[index2]; } else { break; } } return lowestCommonAncestor; } function getAdjacentBlockClientId(state, startClientId, modifier = 1) { if (startClientId === void 0) { startClientId = getSelectedBlockClientId(state); } if (startClientId === void 0) { if (modifier < 0) { startClientId = getFirstMultiSelectedBlockClientId(state); } else { startClientId = getLastMultiSelectedBlockClientId(state); } } if (!startClientId) { return null; } const rootClientId = getBlockRootClientId(state, startClientId); if (rootClientId === null) { return null; } const { order } = state.blocks; const orderSet = order.get(rootClientId); const index2 = orderSet.indexOf(startClientId); const nextIndex = index2 + 1 * modifier; if (nextIndex < 0) { return null; } if (nextIndex === orderSet.length) { return null; } return orderSet[nextIndex]; } function getPreviousBlockClientId(state, startClientId) { return getAdjacentBlockClientId(state, startClientId, -1); } function getNextBlockClientId(state, startClientId) { return getAdjacentBlockClientId(state, startClientId, 1); } function getSelectedBlocksInitialCaretPosition(state) { return state.initialPosition; } function getSelectionNestingAncestor(state) { const { selectionStart, selectionEnd } = state.selection; const startClientId = selectionStart.clientId; const endClientId = selectionEnd.clientId; if (!startClientId || !endClientId || startClientId === endClientId) { return void 0; } if (getBlockParents(state, endClientId).includes(startClientId)) { return startClientId; } if (getBlockParents(state, startClientId).includes(endClientId)) { return endClientId; } return void 0; } var getSelectedBlockClientIds = (0, import_data5.createSelector)( (state) => { const { selectionStart, selectionEnd } = state.selection; if (!selectionStart.clientId || !selectionEnd.clientId) { return EMPTY_ARRAY2; } if (selectionStart.clientId === selectionEnd.clientId) { return [selectionStart.clientId]; } const nestingAncestorClientId = getSelectionNestingAncestor(state); if (nestingAncestorClientId) { return [nestingAncestorClientId]; } const rootClientId = getBlockRootClientId( state, selectionStart.clientId ); if (rootClientId === null) { return EMPTY_ARRAY2; } const blockOrder = getBlockOrder(state, rootClientId); const startIndex = blockOrder.indexOf(selectionStart.clientId); const endIndex = blockOrder.indexOf(selectionEnd.clientId); if (startIndex > endIndex) { return blockOrder.slice(endIndex, startIndex + 1); } return blockOrder.slice(startIndex, endIndex + 1); }, (state) => [ state.blocks.order, state.blocks.parents, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId ] ); function getMultiSelectedBlockClientIds(state) { const { selectionStart, selectionEnd } = state.selection; if (selectionStart.clientId === selectionEnd.clientId) { return EMPTY_ARRAY2; } return getSelectedBlockClientIds(state); } var getMultiSelectedBlocks = (0, import_data5.createSelector)( (state) => { const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state); if (!multiSelectedBlockClientIds.length) { return EMPTY_ARRAY2; } return multiSelectedBlockClientIds.map( (clientId) => getBlock(state, clientId) ); }, (state) => [ ...getSelectedBlockClientIds.getDependants(state), state.blocks.byClientId, state.blocks.order, state.blocks.attributes ] ); function getFirstMultiSelectedBlockClientId(state) { return getMultiSelectedBlockClientIds(state)[0] || null; } function getLastMultiSelectedBlockClientId(state) { const selectedClientIds = getMultiSelectedBlockClientIds(state); return selectedClientIds[selectedClientIds.length - 1] || null; } function isFirstMultiSelectedBlock(state, clientId) { return getFirstMultiSelectedBlockClientId(state) === clientId; } function isBlockMultiSelected(state, clientId) { return getMultiSelectedBlockClientIds(state).indexOf(clientId) !== -1; } var isAncestorMultiSelected = (0, import_data5.createSelector)( (state, clientId) => { let ancestorClientId = clientId; let isMultiSelected = false; while (ancestorClientId && !isMultiSelected) { ancestorClientId = getBlockRootClientId(state, ancestorClientId); isMultiSelected = isBlockMultiSelected(state, ancestorClientId); } return isMultiSelected; }, (state) => [ state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId ] ); function getMultiSelectedBlocksStartClientId(state) { const { selectionStart, selectionEnd } = state.selection; if (selectionStart.clientId === selectionEnd.clientId) { return null; } return selectionStart.clientId || null; } function getMultiSelectedBlocksEndClientId(state) { const { selectionStart, selectionEnd } = state.selection; if (selectionStart.clientId === selectionEnd.clientId) { return null; } return selectionEnd.clientId || null; } function __unstableIsFullySelected(state) { if (getSelectionNestingAncestor(state)) { return true; } const selectionAnchor = getSelectionStart(state); const selectionFocus = getSelectionEnd(state); return !selectionAnchor.attributeKey && !selectionFocus.attributeKey && typeof selectionAnchor.offset === "undefined" && typeof selectionFocus.offset === "undefined"; } function __unstableIsSelectionCollapsed(state) { const selectionAnchor = getSelectionStart(state); const selectionFocus = getSelectionEnd(state); return !!selectionAnchor && !!selectionFocus && selectionAnchor.clientId === selectionFocus.clientId && selectionAnchor.attributeKey === selectionFocus.attributeKey && selectionAnchor.offset === selectionFocus.offset; } function __unstableSelectionHasUnmergeableBlock(state) { return getSelectedBlockClientIds(state).some((clientId) => { const blockName = getBlockName(state, clientId); const blockType = (0, import_blocks7.getBlockType)(blockName); return !blockType.merge; }); } function __unstableIsSelectionMergeable(state, isForward) { const selectionAnchor = getSelectionStart(state); const selectionFocus = getSelectionEnd(state); if (selectionAnchor.clientId === selectionFocus.clientId) { return false; } if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === "undefined" || typeof selectionFocus.offset === "undefined") { return false; } const anchorRootClientId = getBlockRootClientId( state, selectionAnchor.clientId ); const focusRootClientId = getBlockRootClientId( state, selectionFocus.clientId ); if (anchorRootClientId !== focusRootClientId) { return false; } const blockOrder = getBlockOrder(state, anchorRootClientId); const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId); const focusIndex = blockOrder.indexOf(selectionFocus.clientId); let selectionStart, selectionEnd; if (anchorIndex > focusIndex) { selectionStart = selectionFocus; selectionEnd = selectionAnchor; } else { selectionStart = selectionAnchor; selectionEnd = selectionFocus; } const targetBlockClientId = isForward ? selectionEnd.clientId : selectionStart.clientId; const blockToMergeClientId = isForward ? selectionStart.clientId : selectionEnd.clientId; const targetBlockName = getBlockName(state, targetBlockClientId); const targetBlockType = (0, import_blocks7.getBlockType)(targetBlockName); if (!targetBlockType.merge) { return false; } const blockToMerge = getBlock(state, blockToMergeClientId); if (blockToMerge.name === targetBlockName) { return true; } const blocksToMerge = (0, import_blocks7.switchToBlockType)(blockToMerge, targetBlockName); return blocksToMerge && blocksToMerge.length; } var __unstableGetSelectedBlocksWithPartialSelection = (state) => { const selectionAnchor = getSelectionStart(state); const selectionFocus = getSelectionEnd(state); if (selectionAnchor.clientId === selectionFocus.clientId) { return EMPTY_ARRAY2; } if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === "undefined" || typeof selectionFocus.offset === "undefined") { return EMPTY_ARRAY2; } const anchorRootClientId = getBlockRootClientId( state, selectionAnchor.clientId ); const focusRootClientId = getBlockRootClientId( state, selectionFocus.clientId ); if (anchorRootClientId !== focusRootClientId) { return EMPTY_ARRAY2; } const blockOrder = getBlockOrder(state, anchorRootClientId); const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId); const focusIndex = blockOrder.indexOf(selectionFocus.clientId); const [selectionStart, selectionEnd] = anchorIndex > focusIndex ? [selectionFocus, selectionAnchor] : [selectionAnchor, selectionFocus]; const blockA = getBlock(state, selectionStart.clientId); const blockB = getBlock(state, selectionEnd.clientId); const htmlA = blockA.attributes[selectionStart.attributeKey]; const htmlB = blockB.attributes[selectionEnd.attributeKey]; let valueA = (0, import_rich_text.create)({ html: htmlA }); let valueB = (0, import_rich_text.create)({ html: htmlB }); valueA = (0, import_rich_text.remove)(valueA, 0, selectionStart.offset); valueB = (0, import_rich_text.remove)(valueB, selectionEnd.offset, valueB.text.length); return [ { ...blockA, attributes: { ...blockA.attributes, [selectionStart.attributeKey]: (0, import_rich_text.toHTMLString)({ value: valueA }) } }, { ...blockB, attributes: { ...blockB.attributes, [selectionEnd.attributeKey]: (0, import_rich_text.toHTMLString)({ value: valueB }) } } ]; }; function getBlockOrder(state, rootClientId) { return state.blocks.order.get(rootClientId || "") || EMPTY_ARRAY2; } function getBlockIndex(state, clientId) { const rootClientId = getBlockRootClientId(state, clientId); return getBlockOrder(state, rootClientId).indexOf(clientId); } function isBlockSelected(state, clientId) { const { selectionStart, selectionEnd } = state.selection; if (selectionStart.clientId !== selectionEnd.clientId) { return false; } return selectionStart.clientId === clientId; } function hasSelectedInnerBlock(state, clientId, deep = false) { const selectedBlockClientIds = getSelectedBlockClientIds(state); if (!selectedBlockClientIds.length) { return false; } if (deep) { return selectedBlockClientIds.some( (id) => ( // Pass true because we don't care about order and it's more // performant. getBlockParents(state, id, true).includes(clientId) ) ); } return selectedBlockClientIds.some( (id) => getBlockRootClientId(state, id) === clientId ); } function hasDraggedInnerBlock(state, clientId, deep = false) { return getBlockOrder(state, clientId).some( (innerClientId) => isBlockBeingDragged(state, innerClientId) || deep && hasDraggedInnerBlock(state, innerClientId, deep) ); } function isBlockWithinSelection(state, clientId) { if (!clientId) { return false; } const clientIds = getMultiSelectedBlockClientIds(state); const index2 = clientIds.indexOf(clientId); return index2 > -1 && index2 < clientIds.length - 1; } function hasMultiSelection(state) { const { selectionStart, selectionEnd } = state.selection; return selectionStart.clientId !== selectionEnd.clientId; } function isMultiSelecting2(state) { return state.isMultiSelecting; } function isSelectionEnabled2(state) { return state.isSelectionEnabled; } function getBlockMode(state, clientId) { return state.blocksMode[clientId] || "visual"; } function isTyping2(state) { return state.isTyping; } function isDraggingBlocks(state) { return !!state.draggedBlocks.length; } function getDraggedBlockClientIds(state) { return state.draggedBlocks; } function isBlockBeingDragged(state, clientId) { return state.draggedBlocks.includes(clientId); } function isAncestorBeingDragged(state, clientId) { if (!isDraggingBlocks(state)) { return false; } const parents = getBlockParents(state, clientId); return parents.some( (parentClientId) => isBlockBeingDragged(state, parentClientId) ); } function isCaretWithinFormattedText() { (0, import_deprecated2.default)( 'wp.data.select( "core/block-editor" ).isCaretWithinFormattedText', { since: "6.1", version: "6.3" } ); return false; } var getBlockInsertionPoint = (0, import_data5.createSelector)( (state) => { let rootClientId, index2; const { insertionCue: insertionCue2, selection: { selectionEnd } } = state; if (insertionCue2 !== null) { return insertionCue2; } const { clientId } = selectionEnd; if (clientId) { rootClientId = getBlockRootClientId(state, clientId) || void 0; index2 = getBlockIndex(state, selectionEnd.clientId) + 1; } else { index2 = getBlockOrder(state).length; } return { rootClientId, index: index2 }; }, (state) => [ state.insertionCue, state.selection.selectionEnd.clientId, state.blocks.parents, state.blocks.order ] ); function isBlockInsertionPointVisible(state) { return state.insertionCue !== null; } function isValidTemplate(state) { return state.template.isValid; } function getTemplate(state) { return state.settings.template; } function getTemplateLock(state, rootClientId) { if (!rootClientId) { return state.settings.templateLock ?? false; } const blockListTemplateLock = getBlockListSettings( state, rootClientId )?.templateLock; if (blockListTemplateLock === "contentOnly" && state.editedContentOnlySection === rootClientId) { return false; } return blockListTemplateLock ?? false; } var isBlockVisibleInTheInserter = (state, blockNameOrType, rootClientId = null) => { let blockType; let blockName; if (blockNameOrType && "object" === typeof blockNameOrType) { blockType = blockNameOrType; blockName = blockNameOrType.name; } else { blockType = (0, import_blocks7.getBlockType)(blockNameOrType); blockName = blockNameOrType; } if (!blockType) { return false; } const { allowedBlockTypes } = getSettings(state); const isBlockAllowedInEditor = checkAllowList( allowedBlockTypes, blockName, true ); if (!isBlockAllowedInEditor) { return false; } const parents = (Array.isArray(blockType.parent) ? blockType.parent : []).concat(Array.isArray(blockType.ancestor) ? blockType.ancestor : []); if (parents.length > 0) { if (parents.includes("core/post-content")) { return true; } let current = rootClientId; let hasParent = false; do { if (parents.includes(getBlockName(state, current))) { hasParent = true; break; } current = state.blocks.parents.get(current); } while (current); return hasParent; } return true; }; var canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) => { if (state.settings.isPreviewMode) { return false; } if (!isBlockVisibleInTheInserter(state, blockName, rootClientId)) { return false; } let blockType; if (blockName && "object" === typeof blockName) { blockType = blockName; blockName = blockType.name; } else { blockType = (0, import_blocks7.getBlockType)(blockName); } const rootTemplateLock = getTemplateLock(state, rootClientId); if (rootTemplateLock && rootTemplateLock !== "contentOnly") { return false; } if (isInnerContentRoot(state, rootClientId)) { return false; } const blockEditingMode = getBlockEditingMode(state, rootClientId ?? ""); const isParentSectionBlock = !!isSectionBlock(state, rootClientId); const sectionClientId = isParentSectionBlock ? rootClientId : getParentSectionBlock(state, rootClientId); const isWithinSection = !!sectionClientId; if (blockEditingMode === "disabled" && (!isWithinSection || blockName !== (0, import_blocks7.getDefaultBlockName)())) { return false; } const parentBlockListSettings = getBlockListSettings(state, rootClientId); if (rootClientId && parentBlockListSettings === void 0) { return false; } const isContentRoleBlock = isContentBlock3(blockName); if (isWithinSection && !isContentRoleBlock) { return false; } if (isWithinSection && getBlockName(state, sectionClientId) === "core/block") { return false; } if (isWithinSection && (isParentSectionBlock || blockEditingMode === "contentOnly" || blockEditingMode === "disabled") && !isContainerInsertableToInContentOnlyMode( state, blockName, rootClientId )) { const defaultBlockName = (0, import_blocks7.getDefaultBlockName)(); if (blockName === defaultBlockName) { const existingBlocks = getBlockOrder(state, rootClientId); const hasDefaultBlock = existingBlocks.some( (clientId) => getBlockName(state, clientId) === defaultBlockName ); if (!hasDefaultBlock) { return false; } } else { return false; } } const parentName = getBlockName(state, rootClientId); const parentBlockType = (0, import_blocks7.getBlockType)(parentName); const parentAllowedChildBlocks = parentBlockType?.allowedBlocks; let hasParentAllowedBlock = checkAllowList( parentAllowedChildBlocks, blockName ); if (hasParentAllowedBlock !== false) { const parentAllowedBlocks = parentBlockListSettings?.allowedBlocks; const hasParentListAllowedBlock = checkAllowList( parentAllowedBlocks, blockName ); if (hasParentListAllowedBlock !== null) { hasParentAllowedBlock = hasParentListAllowedBlock; } } const blockAllowedParentBlocks = blockType.parent; const hasBlockAllowedParent = checkAllowList( blockAllowedParentBlocks, parentName ); let hasBlockAllowedAncestor = true; const blockAllowedAncestorBlocks = blockType.ancestor; if (blockAllowedAncestorBlocks) { const ancestors = [ rootClientId, ...getBlockParents(state, rootClientId) ]; hasBlockAllowedAncestor = ancestors.some( (ancestorClientId) => checkAllowList( blockAllowedAncestorBlocks, getBlockName(state, ancestorClientId) ) ); } const canInsert = hasBlockAllowedAncestor && (hasParentAllowedBlock === null && hasBlockAllowedParent === null || hasParentAllowedBlock === true || hasBlockAllowedParent === true); if (!canInsert) { return canInsert; } return (0, import_hooks2.applyFilters)( "blockEditor.__unstableCanInsertBlockType", canInsert, blockType, rootClientId, { // Pass bound selectors of the current registry. If we're in a nested // context, the data will differ from the one selected from the root // registry. getBlock: getBlock.bind(null, state), getBlockParentsByBlockName: getBlockParentsByBlockName.bind( null, state ) } ); }; var canInsertBlockType = (0, import_data5.createRegistrySelector)( (select3) => (0, import_data5.createSelector)( canInsertBlockTypeUnmemoized, (state, blockName, rootClientId) => getInsertBlockTypeDependants(select3)(state, rootClientId) ) ); function canInsertBlocks(state, clientIds, rootClientId = null) { return clientIds.every( (id) => canInsertBlockType(state, getBlockName(state, id), rootClientId) ); } function isInnerContentRoot(state, rootClientId) { return !!rootClientId && getBlockName(state, rootClientId) === "core/html"; } function canRemoveBlock(state, clientId) { if (state.settings.isPreviewMode) { return false; } if (isInnerContentRoot(state, getBlockRootClientId(state, clientId))) { return false; } const attributes = getBlockAttributes(state, clientId); if (attributes === null) { return true; } if (attributes.lock?.remove !== void 0) { return !attributes.lock.remove; } const rootClientId = getBlockRootClientId(state, clientId); const rootTemplateLock = getTemplateLock(state, rootClientId); if (rootTemplateLock && rootTemplateLock !== "contentOnly") { return false; } const isParentSectionBlock = !!isSectionBlock(state, rootClientId); const sectionClientId = isParentSectionBlock ? rootClientId : getParentSectionBlock(state, rootClientId); const isWithinSection = !!sectionClientId; const isContentRoleBlock = isContentBlock3( getBlockName(state, clientId) ); if (isWithinSection && !isContentRoleBlock) { return false; } if (isWithinSection && getBlockName(state, sectionClientId) === "core/block") { return false; } const rootBlockEditingMode = getBlockEditingMode(state, rootClientId); const blockName = getBlockName(state, clientId); const defaultBlockName = (0, import_blocks7.getDefaultBlockName)(); if (isWithinSection && (isParentSectionBlock || blockName === defaultBlockName || rootBlockEditingMode === "contentOnly") && !isContainerInsertableToInContentOnlyMode( state, getBlockName(state, clientId), rootClientId )) { if (blockName === defaultBlockName) { const existingBlocks = getBlockOrder(state, rootClientId); const defaultBlocks = existingBlocks.filter( (id) => getBlockName(state, id) === defaultBlockName ); if (defaultBlocks.length > 1) { return true; } return false; } return false; } return rootBlockEditingMode !== "disabled"; } function canRemoveBlocks(state, clientIds) { return clientIds.every((clientId) => canRemoveBlock(state, clientId)); } function canMoveBlock(state, clientId) { if (state.settings.isPreviewMode) { return false; } if (isInnerContentRoot(state, getBlockRootClientId(state, clientId))) { return false; } const attributes = getBlockAttributes(state, clientId); if (attributes === null) { return true; } if (attributes.lock?.move !== void 0) { return !attributes.lock.move; } const rootClientId = getBlockRootClientId(state, clientId); const rootTemplateLock = getTemplateLock(state, rootClientId); if (rootTemplateLock === "all") { return false; } const isBlockWithinSection = !!getParentSectionBlock(state, clientId); const isContentRoleBlock = isContentBlock3( getBlockName(state, clientId) ); if (isBlockWithinSection && !isContentRoleBlock) { return false; } const isParentSectionBlock = !!isSectionBlock(state, rootClientId); const rootBlockEditingMode = getBlockEditingMode(state, rootClientId); if (isBlockWithinSection && (isParentSectionBlock || rootBlockEditingMode === "contentOnly") && !isContainerInsertableToInContentOnlyMode( state, getBlockName(state, clientId), rootClientId )) { return false; } return getBlockEditingMode(state, rootClientId) !== "disabled"; } function canMoveBlocks(state, clientIds) { return clientIds.every((clientId) => canMoveBlock(state, clientId)); } function canEditBlock(state, clientId) { if (state.settings.isPreviewMode) { return false; } const attributes = getBlockAttributes(state, clientId); if (attributes === null) { return true; } const { lock: lock5 } = attributes; return !lock5?.edit; } function canLockBlockType(state, nameOrType) { if (state.settings.isPreviewMode) { return false; } if (!(0, import_blocks7.hasBlockSupport)(nameOrType, "lock", true)) { return false; } return !!state.settings?.canLockBlocks; } function getInsertUsage(state, id) { return state.preferences.insertUsage?.[id] ?? null; } var canIncludeBlockTypeInInserter = (state, blockType, rootClientId) => { if (!(0, import_blocks7.hasBlockSupport)(blockType, "inserter", true)) { return false; } return canInsertBlockTypeUnmemoized(state, blockType.name, rootClientId); }; var getItemFromVariation = (state, item) => (variation) => { const variationId = `${item.id}/${variation.name}`; const { time, count = 0 } = getInsertUsage(state, variationId) || {}; return { ...item, id: variationId, icon: variation.icon || item.icon, title: variation.title || item.title, description: variation.description || item.description, category: variation.category || item.category, // If `example` is explicitly undefined for the variation, the preview will not be shown. example: variation.hasOwnProperty("example") ? variation.example : item.example, initialAttributes: { ...item.initialAttributes, ...variation.attributes }, innerBlocks: variation.innerBlocks, innerContent: variation.innerContent, keywords: variation.keywords || item.keywords, frecency: calculateFrecency(time, count), // Pass through search-only flag for block-scope variations. isSearchOnly: variation.isSearchOnly }; }; var calculateFrecency = (time, count) => { if (!time) { return count; } const duration = Date.now() - time; switch (true) { case duration < MILLISECONDS_PER_HOUR: return count * 4; case duration < MILLISECONDS_PER_DAY: return count * 2; case duration < MILLISECONDS_PER_WEEK: return count / 2; default: return count / 4; } }; var buildBlockTypeItem = (state, { buildScope = "inserter" }) => (blockType) => { const id = blockType.name; let isDisabled = false; if (!(0, import_blocks7.hasBlockSupport)(blockType.name, "multiple", true)) { isDisabled = getBlocksByClientId( state, getClientIdsWithDescendants(state) ).some(({ name }) => name === blockType.name); } const { time, count = 0 } = getInsertUsage(state, id) || {}; const blockItemBase = { id, name: blockType.name, title: blockType.title, icon: blockType.icon, isDisabled, frecency: calculateFrecency(time, count) }; if (buildScope === "transform") { return blockItemBase; } const inserterVariations = (0, import_blocks7.getBlockVariations)( blockType.name, "inserter" ); const blockVariations = (0, import_blocks7.getBlockVariations)(blockType.name, "block"); const allVariations = [ ...inserterVariations, // Built-in heading level variations have block scope but allow // insertion via slash inserter. // See https://github.com/WordPress/gutenberg/issues/74233. ...blockVariations.filter( (variation) => blockType.name === "core/heading" && ["h1", "h2", "h3", "h4", "h5", "h6"].includes( variation.name ) ).map((variation) => ({ ...variation, isSearchOnly: true })) ]; return { ...blockItemBase, initialAttributes: {}, description: blockType.description, category: blockType.category, keywords: blockType.keywords, parent: blockType.parent, ancestor: blockType.ancestor, variations: allVariations, example: blockType.example, utility: 1 // Deprecated. }; }; var buildBlockVariationItem = (state, item) => (variation) => { const variationId = `${item.id}/${variation.name}`; const { time, count = 0 } = getInsertUsage(state, variationId) || {}; return { ...item, id: variationId, icon: variation.icon || item.icon, title: variation.title || item.title, frecency: calculateFrecency(time, count), variationName: variation.name }; }; var getInserterItems = (0, import_data5.createRegistrySelector)( (select3) => (0, import_data5.createSelector)( (state, rootClientId = null, options = DEFAULT_INSERTER_OPTIONS) => { const buildReusableBlockInserterItem = (reusableBlock) => { const icon = !reusableBlock.wp_pattern_sync_status ? { src: symbol_default, foreground: "var(--wp-block-synced-color)" } : symbol_default; const userPattern = mapUserPattern(reusableBlock); const { time, count = 0 } = getInsertUsage(state, userPattern.name) || {}; const frecency = calculateFrecency(time, count); return { id: userPattern.name, name: "core/block", initialAttributes: { ref: reusableBlock.id }, title: userPattern.title, icon, category: "reusable", keywords: ["reusable"], isDisabled: false, utility: 1, // Deprecated. frecency, content: userPattern.content, get blocks() { return getParsedPattern(userPattern).blocks; }, syncStatus: userPattern.syncStatus }; }; const patternInserterItems = canInsertBlockTypeUnmemoized( state, "core/block", rootClientId ) ? unlock(select3(STORE_NAME)).getReusableBlocks().map(buildReusableBlockInserterItem) : []; const buildBlockTypeInserterItem = buildBlockTypeItem(state, { buildScope: "inserter" }); let blockTypeInserterItems = (0, import_blocks7.getBlockTypes)().filter( (blockType) => (0, import_blocks7.hasBlockSupport)(blockType, "inserter", true) ).map(buildBlockTypeInserterItem); if (options[isFiltered] !== false) { blockTypeInserterItems = blockTypeInserterItems.filter( (blockType) => canIncludeBlockTypeInInserter( state, blockType, rootClientId ) ); } else { const { getClosestAllowedInsertionPoint: getClosestAllowedInsertionPoint2 } = unlock( select3(STORE_NAME) ); blockTypeInserterItems = blockTypeInserterItems.filter( (blockType) => isBlockVisibleInTheInserter( state, blockType, rootClientId ) && getClosestAllowedInsertionPoint2( blockType.name, rootClientId ) !== null ).map((blockType) => ({ ...blockType, isAllowedInCurrentRoot: canIncludeBlockTypeInInserter( state, blockType, rootClientId ) })); } const items = blockTypeInserterItems.reduce( (accumulator, item) => { const { variations = [] } = item; if (!variations.some(({ isDefault }) => isDefault)) { accumulator.push(item); } if (variations.length) { const variationMapper = getItemFromVariation( state, item ); accumulator.push( ...variations.map(variationMapper) ); } return accumulator; }, [] ); const groupByType = (blocks2, block) => { const { core, noncore } = blocks2; const type = block.name.startsWith("core/") ? core : noncore; type.push(block); return blocks2; }; const { core: coreItems, noncore: nonCoreItems } = items.reduce( groupByType, { core: [], noncore: [] } ); const sortedBlockTypes = [...coreItems, ...nonCoreItems]; return [...sortedBlockTypes, ...patternInserterItems]; }, (state, rootClientId) => [ (0, import_blocks7.getBlockTypes)(), unlock(select3(STORE_NAME)).getReusableBlocks(), state.blocks.order, state.preferences.insertUsage, ...getInsertBlockTypeDependants(select3)(state, rootClientId) ] ) ); var getBlockTransformItems = (0, import_data5.createRegistrySelector)( (select3) => (0, import_data5.createSelector)( (state, blocks2, rootClientId = null) => { const normalizedBlocks = Array.isArray(blocks2) ? blocks2 : [blocks2]; const buildBlockTypeTransformItem = buildBlockTypeItem(state, { buildScope: "transform" }); const blockTypeTransformItems = (0, import_blocks7.getBlockTypes)().filter( (blockType) => canIncludeBlockTypeInInserter( state, blockType, rootClientId ) ).map(buildBlockTypeTransformItem); const itemsByName = Object.fromEntries( Object.entries(blockTypeTransformItems).map( ([, value]) => [value.name, value] ) ); const possibleTransforms = (0, import_blocks7.getPossibleBlockTransformations)( normalizedBlocks ).reduce((accumulator, block) => { const item = itemsByName[block?.name]; if (!item) { return accumulator; } const { variationName } = block; if (!variationName) { accumulator.push(item); return accumulator; } const variation = (0, import_blocks7.getBlockVariations)( item.name, "transform" )?.find(({ name }) => name === variationName); if (!variation) { accumulator.push(item); return accumulator; } accumulator.push( buildBlockVariationItem(state, item)(variation) ); return accumulator; }, []); return orderBy( possibleTransforms, (block) => block.frecency, "desc" ); }, (state, blocks2, rootClientId) => [ (0, import_blocks7.getBlockTypes)(), state.preferences.insertUsage, ...getInsertBlockTypeDependants(select3)(state, rootClientId) ] ) ); var hasInserterItems = (state, rootClientId = null) => { const hasBlockType = (0, import_blocks7.getBlockTypes)().some( (blockType) => canIncludeBlockTypeInInserter(state, blockType, rootClientId) ); if (hasBlockType) { return true; } const hasReusableBlock = canInsertBlockTypeUnmemoized( state, "core/block", rootClientId ); return hasReusableBlock; }; var getAllowedBlocks = (0, import_data5.createRegistrySelector)( (select3) => (0, import_data5.createSelector)( (state, rootClientId = null) => { if (!rootClientId) { return; } const blockTypes = (0, import_blocks7.getBlockTypes)().filter( (blockType) => canIncludeBlockTypeInInserter(state, blockType, rootClientId) ); const hasReusableBlock = canInsertBlockTypeUnmemoized( state, "core/block", rootClientId ); if (hasReusableBlock) { blockTypes.push("core/block"); } return blockTypes; }, (state, rootClientId) => [ (0, import_blocks7.getBlockTypes)(), ...getInsertBlockTypeDependants(select3)(state, rootClientId) ] ) ); var __experimentalGetAllowedBlocks = (0, import_data5.createSelector)( (state, rootClientId = null) => { (0, import_deprecated2.default)( 'wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks', { alternative: 'wp.data.select( "core/block-editor" ).getAllowedBlocks', since: "6.2", version: "6.4" } ); return getAllowedBlocks(state, rootClientId); }, (state, rootClientId) => getAllowedBlocks.getDependants(state, rootClientId) ); function getDirectInsertBlock(state, rootClientId = null) { if (!rootClientId) { return; } const { defaultBlock, directInsert } = state.blockListSettings.get(rootClientId) ?? {}; if (!defaultBlock || !directInsert) { return; } return defaultBlock; } function __experimentalGetDirectInsertBlock(state, rootClientId = null) { (0, import_deprecated2.default)( 'wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock', { alternative: 'wp.data.select( "core/block-editor" ).getDirectInsertBlock', since: "6.3", version: "6.4" } ); return getDirectInsertBlock(state, rootClientId); } var __experimentalGetParsedPattern = (0, import_data5.createRegistrySelector)( (select3) => (state, patternName) => { const pattern = unlock(select3(STORE_NAME)).getPatternBySlug( patternName ); return pattern ? getParsedPattern(pattern) : null; } ); var getAllowedPatternsDependants = (select3) => (state, rootClientId) => [ ...getAllPatternsDependants(select3)(state), ...getInsertBlockTypeDependants(select3)(state, rootClientId) ]; var patternsWithParsedBlocks = /* @__PURE__ */ new WeakMap(); function enhancePatternWithParsedBlocks(pattern) { let enhancedPattern = patternsWithParsedBlocks.get(pattern); if (!enhancedPattern) { enhancedPattern = { ...pattern, get blocks() { return getParsedPattern(pattern).blocks; } }; patternsWithParsedBlocks.set(pattern, enhancedPattern); } return enhancedPattern; } var __experimentalGetAllowedPatterns = (0, import_data5.createRegistrySelector)( (select3) => { return (0, import_data5.createSelector)( (state, rootClientId = null, options = DEFAULT_INSERTER_OPTIONS) => { const { getAllPatterns: getAllPatterns2 } = unlock(select3(STORE_NAME)); const patterns = getAllPatterns2(); const { allowedBlockTypes } = getSettings(state); const parsedPatterns = patterns.filter(({ inserter = true }) => !!inserter).map(enhancePatternWithParsedBlocks); const availableParsedPatterns = parsedPatterns.filter( (pattern) => checkAllowListRecursive( getGrammar(pattern), allowedBlockTypes ) ); const patternsAllowed = availableParsedPatterns.filter( (pattern) => getGrammar(pattern).every( ({ blockName: name }) => options[isFiltered] !== false ? canInsertBlockType( state, name, rootClientId ) : isBlockVisibleInTheInserter( state, name, rootClientId ) ) ); return patternsAllowed; }, getAllowedPatternsDependants(select3) ); } ); var getPatternsByBlockTypes = (0, import_data5.createRegistrySelector)( (select3) => (0, import_data5.createSelector)( (state, blockNames, rootClientId = null) => { if (!blockNames) { return EMPTY_ARRAY2; } const patterns = select3(STORE_NAME).__experimentalGetAllowedPatterns( rootClientId ); const normalizedBlockNames = Array.isArray(blockNames) ? blockNames : [blockNames]; const filteredPatterns = patterns.filter( (pattern) => pattern?.blockTypes?.some?.( (blockName) => normalizedBlockNames.includes(blockName) ) ); if (filteredPatterns.length === 0) { return EMPTY_ARRAY2; } return filteredPatterns; }, (state, blockNames, rootClientId) => getAllowedPatternsDependants(select3)(state, rootClientId) ) ); var __experimentalGetPatternsByBlockTypes = (0, import_data5.createRegistrySelector)( (select3) => { (0, import_deprecated2.default)( 'wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes', { alternative: 'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes', since: "6.2", version: "6.4" } ); return select3(STORE_NAME).getPatternsByBlockTypes; } ); var __experimentalGetPatternTransformItems = (0, import_data5.createRegistrySelector)( (select3) => (0, import_data5.createSelector)( (state, blocks2, rootClientId = null) => { if (!blocks2) { return EMPTY_ARRAY2; } if (blocks2.some( ({ clientId, innerBlocks }) => innerBlocks.length || areInnerBlocksControlled(state, clientId) )) { return EMPTY_ARRAY2; } const selectedBlockNames = Array.from( new Set(blocks2.map(({ name }) => name)) ); return select3(STORE_NAME).getPatternsByBlockTypes( selectedBlockNames, rootClientId ); }, (state, blocks2, rootClientId) => getAllowedPatternsDependants(select3)(state, rootClientId) ) ); function getBlockListSettings(state, clientId) { return state.blockListSettings.get(clientId); } function getSettings(state) { return state.settings; } function isLastBlockChangePersistent(state) { return state.blocks.isPersistentChange; } function __unstableGetLastBlockChangeHistoryMode(state) { if (state.blocks.lastBlockChangeHistoryMode) { return state.blocks.lastBlockChangeHistoryMode; } return state.blocks.isPersistentChange === false ? "merge" : "persistent"; } var __experimentalGetBlockListSettingsForBlocks = (0, import_data5.createSelector)( (state, clientIds = []) => { const blockListSettingsForBlocks = {}; for (const clientId of clientIds) { const settings2 = getBlockListSettings(state, clientId); if (settings2) { blockListSettingsForBlocks[clientId] = settings2; } } return blockListSettingsForBlocks; }, (state) => [state.blockListSettings] ); var __experimentalGetReusableBlockTitle = (0, import_data5.createRegistrySelector)( (select3) => (0, import_data5.createSelector)( (state, ref) => { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle", { since: "6.6", version: "6.8" } ); const reusableBlock = unlock(select3(STORE_NAME)).getReusableBlocks().find((block) => block.id === ref); if (!reusableBlock) { return null; } return reusableBlock.title?.raw; }, () => [unlock(select3(STORE_NAME)).getReusableBlocks()] ) ); function __unstableIsLastBlockChangeIgnored(state) { return state.blocks.isIgnoredChange; } function __experimentalGetLastBlockAttributeChanges(state) { return state.lastBlockAttributesChange; } function hasBlockMovingClientId() { (0, import_deprecated2.default)( 'wp.data.select( "core/block-editor" ).hasBlockMovingClientId', { since: "6.7", hint: "Block moving mode feature has been removed" } ); return false; } function didAutomaticChange(state) { return !!state.automaticChangeStatus; } function isBlockHighlighted(state, clientId) { return state.highlightedBlock === clientId; } function areInnerBlocksControlled(state, clientId) { return state.blocks.controlledInnerBlocks.has(clientId); } var __experimentalGetActiveBlockIdByBlockNames = (0, import_data5.createSelector)( (state, validBlockNames) => { if (!validBlockNames.length) { return null; } const selectedBlockClientId = getSelectedBlockClientId(state); if (validBlockNames.includes( getBlockName(state, selectedBlockClientId) )) { return selectedBlockClientId; } const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state); const entityAreaParents = getBlockParentsByBlockName( state, selectedBlockClientId || multiSelectedBlockClientIds[0], validBlockNames ); if (entityAreaParents) { return entityAreaParents[entityAreaParents.length - 1]; } return null; }, (state, validBlockNames) => [ state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId, validBlockNames ] ); function wasBlockJustInserted(state, clientId, source) { const { lastBlockInserted: lastBlockInserted2 } = state; return lastBlockInserted2.clientIds?.includes(clientId) && lastBlockInserted2.source === source; } function isBlockVisible(state, clientId) { return state.blockVisibility?.[clientId] ?? true; } function getHoveredBlockClientId() { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).getHoveredBlockClientId", { since: "6.9", version: "7.1" } ); return void 0; } var __unstableGetVisibleBlocks = (0, import_data5.createSelector)( (state) => { const visibleBlocks = new Set( Object.keys(state.blockVisibility).filter( (key) => state.blockVisibility[key] ) ); if (visibleBlocks.size === 0) { return EMPTY_SET; } return visibleBlocks; }, (state) => [state.blockVisibility] ); function __unstableHasActiveBlockOverlayActive(state, clientId) { if (getBlockEditingMode(state, clientId) !== "default") { return false; } if (!canEditBlock(state, clientId)) { return true; } if (isZoomOut(state)) { const sectionRootClientId = getSectionRootClientId(state); if (sectionRootClientId) { const sectionClientIds = getBlockOrder( state, sectionRootClientId ); if (sectionClientIds?.includes(clientId)) { return true; } } else if (clientId && !getBlockRootClientId(state, clientId)) { return true; } } const blockSupportDisable = (0, import_blocks7.hasBlockSupport)( getBlockName(state, clientId), "__experimentalDisableBlockOverlay", false ); const shouldEnableIfUnselected = blockSupportDisable ? false : areInnerBlocksControlled(state, clientId); return shouldEnableIfUnselected && !isBlockSelected(state, clientId) && !hasSelectedInnerBlock(state, clientId, true); } function __unstableIsWithinBlockOverlay(state, clientId) { let parent = state.blocks.parents.get(clientId); while (!!parent) { if (__unstableHasActiveBlockOverlayActive(state, parent)) { return true; } parent = state.blocks.parents.get(parent); } return false; } function getBlockEditingMode(state, clientId = "") { if (clientId === null) { clientId = ""; } if (state.derivedBlockEditingModes?.has(clientId)) { return state.derivedBlockEditingModes.get(clientId); } if (state.blocks.blockEditingModes.has(clientId)) { return state.blocks.blockEditingModes.get(clientId); } return "default"; } var isUngroupable = (0, import_data5.createRegistrySelector)( (select3) => (state, clientId = "") => { const _clientId = clientId || getSelectedBlockClientId(state); if (!_clientId) { return false; } if (isSectionBlock(state, _clientId)) { return false; } const { getGroupingBlockName } = select3(import_blocks7.store); const block = getBlock(state, _clientId); const groupingBlockName = getGroupingBlockName(); const _isUngroupable = block && (block.name === groupingBlockName || (0, import_blocks7.getBlockType)(block.name)?.transforms?.ungroup) && !!block.innerBlocks.length; return _isUngroupable && canRemoveBlock(state, _clientId); } ); var isGroupable = (0, import_data5.createRegistrySelector)( (select3) => (state, clientIds = EMPTY_ARRAY2) => { const { getGroupingBlockName } = select3(import_blocks7.store); const groupingBlockName = getGroupingBlockName(); const _clientIds = clientIds?.length ? clientIds : getSelectedBlockClientIds(state); const rootClientId = _clientIds?.length ? getBlockRootClientId(state, _clientIds[0]) : void 0; const groupingBlockAvailable = canInsertBlockType( state, groupingBlockName, rootClientId ); const _isGroupable = groupingBlockAvailable && _clientIds.length; return _isGroupable && canRemoveBlocks(state, _clientIds); } ); var __unstableGetContentLockingParent = (state, clientId) => { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent", { since: "6.1", version: "6.7" } ); return getContentLockingParent(state, clientId); }; function __unstableGetTemporarilyEditingAsBlocks(state) { (0, import_deprecated2.default)( "wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks", { since: "6.1", version: "6.7" } ); return getEditedContentOnlySection(state); } // packages/block-editor/build-module/store/private-actions.mjs var private_actions_exports = {}; __export(private_actions_exports, { __experimentalUpdateSettings: () => __experimentalUpdateSettings, clearBlockRemovalPrompt: () => clearBlockRemovalPrompt, clearRequestedInspectorTab: () => clearRequestedInspectorTab, closeListViewContentPanel: () => closeListViewContentPanel, deleteStyleOverride: () => deleteStyleOverride, editContentOnlySection: () => editContentOnlySection, ensureDefaultBlock: () => ensureDefaultBlock, expandBlock: () => expandBlock, hideBlockInterface: () => hideBlockInterface, hideViewportModal: () => hideViewportModal, openListViewContentPanel: () => openListViewContentPanel, privateRemoveBlocks: () => privateRemoveBlocks, requestInspectorTab: () => requestInspectorTab, resetZoomLevel: () => resetZoomLevel, setBlockRemovalRules: () => setBlockRemovalRules, setInsertionPoint: () => setInsertionPoint, setLastFocus: () => setLastFocus, setResponsiveEditing: () => setResponsiveEditing, setSelectedBlockStyleState: () => setSelectedBlockStyleState, setSelectedBlockStyleStateCanvasPreview: () => setSelectedBlockStyleStateCanvasPreview, setStyleOverride: () => setStyleOverride, setStyleStateViewport: () => setStyleStateViewport, setZoomLevel: () => setZoomLevel, showBlockInterface: () => showBlockInterface, showViewportModal: () => showViewportModal, startDragging: () => startDragging, stopDragging: () => stopDragging, stopEditingContentOnlySection: () => stopEditingContentOnlySection, toggleBlockSpotlight: () => toggleBlockSpotlight }); var import_deprecated3 = __toESM(require_deprecated(), 1); var import_a11y2 = __toESM(require_a11y(), 1); var import_i18n4 = __toESM(require_i18n(), 1); var castArray = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray]; var privateSettings = [ "inserterMediaCategories", "blockInspectorAnimation", "mediaSideload" ]; function __experimentalUpdateSettings(settings2, { stripExperimentalSettings = false, reset = false } = {}) { let incomingSettings = settings2; if (Object.hasOwn(incomingSettings, "__unstableIsPreviewMode")) { (0, import_deprecated3.default)( "__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings", { since: "6.8", alternative: "isPreviewMode" } ); incomingSettings = { ...incomingSettings }; incomingSettings.isPreviewMode = incomingSettings.__unstableIsPreviewMode; delete incomingSettings.__unstableIsPreviewMode; } let cleanSettings = incomingSettings; if (stripExperimentalSettings) { cleanSettings = {}; for (const key in incomingSettings) { if (!privateSettings.includes(key)) { cleanSettings[key] = incomingSettings[key]; } } } return { type: "UPDATE_SETTINGS", settings: cleanSettings, reset }; } function hideBlockInterface() { return { type: "HIDE_BLOCK_INTERFACE" }; } function showBlockInterface() { return { type: "SHOW_BLOCK_INTERFACE" }; } var privateRemoveBlocks = (clientIds, selectPrevious = true, forceRemove = false) => ({ select: select3, dispatch, registry }) => { if (!clientIds || !clientIds.length) { return; } clientIds = castArray(clientIds); const canRemoveBlocks2 = select3.canRemoveBlocks(clientIds); if (!canRemoveBlocks2) { return; } const rules = !forceRemove && select3.getBlockRemovalRules(); if (rules) { let flattenBlocks22 = function(blocks2) { const result = []; const stack = [...blocks2]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.push(...innerBlocks); result.push(block); } return result; }; var flattenBlocks2 = flattenBlocks22; const blockList = clientIds.map(select3.getBlock); const flattenedBlocks = flattenBlocks22(blockList); let message2; for (const rule of rules) { message2 = rule.callback(flattenedBlocks); if (message2) { dispatch( displayBlockRemovalPrompt( clientIds, selectPrevious, message2 ) ); return; } } } if (selectPrevious) { dispatch.selectPreviousBlock(clientIds[0], selectPrevious); } registry.batch(() => { dispatch({ type: "REMOVE_BLOCKS", clientIds }); dispatch(ensureDefaultBlock()); }); }; var ensureDefaultBlock = () => ({ select: select3, dispatch }) => { const count = select3.getBlockCount(); if (count > 0) { return; } const { __unstableHasCustomAppender } = select3.getSettings(); if (__unstableHasCustomAppender) { return; } dispatch.insertDefaultBlock(); }; function displayBlockRemovalPrompt(clientIds, selectPrevious, message2) { return { type: "DISPLAY_BLOCK_REMOVAL_PROMPT", clientIds, selectPrevious, message: message2 }; } function clearBlockRemovalPrompt() { return { type: "CLEAR_BLOCK_REMOVAL_PROMPT" }; } function setBlockRemovalRules(rules = false) { return { type: "SET_BLOCK_REMOVAL_RULES", rules }; } function setStyleOverride(id, style) { return { type: "SET_STYLE_OVERRIDE", id, style }; } function deleteStyleOverride(id) { return { type: "DELETE_STYLE_OVERRIDE", id }; } function setLastFocus(lastFocus2 = null) { return { type: "LAST_FOCUS", lastFocus: lastFocus2 }; } function startDragging() { return { type: "START_DRAGGING" }; } function stopDragging() { return { type: "STOP_DRAGGING" }; } function expandBlock(clientId) { return { type: "SET_BLOCK_EXPANDED_IN_LIST_VIEW", clientId }; } function setInsertionPoint(value) { return { type: "SET_INSERTION_POINT", value }; } function editContentOnlySection(clientId) { return { type: "EDIT_CONTENT_ONLY_SECTION", clientId }; } function stopEditingContentOnlySection() { return { type: "EDIT_CONTENT_ONLY_SECTION" }; } var setZoomLevel = (zoom = 100) => ({ select: select3, dispatch }) => { if (zoom !== 100) { const firstSelectedClientId = select3.getBlockSelectionStart(); const sectionRootClientId = select3.getSectionRootClientId(); if (firstSelectedClientId) { let sectionClientId; if (sectionRootClientId) { const sectionClientIds = select3.getBlockOrder(sectionRootClientId); if (sectionClientIds?.includes(firstSelectedClientId)) { sectionClientId = firstSelectedClientId; } else { sectionClientId = select3.getBlockParents(firstSelectedClientId).find( (parent) => sectionClientIds.includes(parent) ); } } else { sectionClientId = select3.getBlockHierarchyRootClientId( firstSelectedClientId ); } if (sectionClientId) { dispatch.selectBlock(sectionClientId); } else { dispatch.clearSelectedBlock(); } (0, import_a11y2.speak)((0, import_i18n4.__)("You are currently in zoom-out mode.")); } } dispatch({ type: "SET_ZOOM_LEVEL", zoom }); }; function resetZoomLevel() { return { type: "RESET_ZOOM_LEVEL" }; } function toggleBlockSpotlight(clientId, hasBlockSpotlight3) { return { type: "TOGGLE_BLOCK_SPOTLIGHT", clientId, hasBlockSpotlight: hasBlockSpotlight3 }; } function openListViewContentPanel() { return { type: "OPEN_LIST_VIEW_CONTENT_PANEL" }; } function closeListViewContentPanel() { return { type: "CLOSE_LIST_VIEW_CONTENT_PANEL" }; } function showViewportModal(clientIds) { return { type: "SHOW_VIEWPORT_MODAL", clientIds }; } function hideViewportModal() { return { type: "HIDE_VIEWPORT_MODAL" }; } function requestInspectorTab(tabName, options = {}) { return { type: "REQUEST_INSPECTOR_TAB", tabName, options }; } function clearRequestedInspectorTab() { return { type: "CLEAR_REQUESTED_INSPECTOR_TAB" }; } function setSelectedBlockStyleState(clientId, value) { return { type: "SET_SELECTED_BLOCK_STYLE_STATE", clientId, value }; } function setSelectedBlockStyleStateCanvasPreview(clientId, value) { return { type: "SET_SELECTED_BLOCK_STYLE_STATE_CANVAS_PREVIEW", clientId, value }; } function setStyleStateViewport(viewport) { return { type: "SET_STYLE_STATE_VIEWPORT", viewport }; } function setResponsiveEditing(enabled) { return { type: "SET_RESPONSIVE_EDITING", enabled }; } // packages/block-editor/build-module/store/actions.mjs var actions_exports = {}; __export(actions_exports, { __unstableDeleteSelection: () => __unstableDeleteSelection, __unstableExpandSelection: () => __unstableExpandSelection, __unstableIncrementListViewExpandRevision: () => __unstableIncrementListViewExpandRevision, __unstableMarkAutomaticChange: () => __unstableMarkAutomaticChange, __unstableMarkLastChangeAsPersistent: () => __unstableMarkLastChangeAsPersistent, __unstableMarkNextChangeAsNotPersistent: () => __unstableMarkNextChangeAsNotPersistent, __unstableSaveReusableBlock: () => __unstableSaveReusableBlock, __unstableSetAllListViewPanelsOpen: () => __unstableSetAllListViewPanelsOpen, __unstableSetEditorMode: () => __unstableSetEditorMode, __unstableSetOpenListViewPanel: () => __unstableSetOpenListViewPanel, __unstableSetTemporarilyEditingAsBlocks: () => __unstableSetTemporarilyEditingAsBlocks, __unstableSplitSelection: () => __unstableSplitSelection, __unstableToggleListViewPanel: () => __unstableToggleListViewPanel, clearSelectedBlock: () => clearSelectedBlock, duplicateBlocks: () => duplicateBlocks, enterFormattedText: () => enterFormattedText, exitFormattedText: () => exitFormattedText, flashBlock: () => flashBlock, hideInsertionPoint: () => hideInsertionPoint, hoverBlock: () => hoverBlock, insertAfterBlock: () => insertAfterBlock, insertBeforeBlock: () => insertBeforeBlock, insertBlock: () => insertBlock, insertBlocks: () => insertBlocks, insertDefaultBlock: () => insertDefaultBlock, mergeBlocks: () => mergeBlocks, moveBlockToPosition: () => moveBlockToPosition, moveBlocksDown: () => moveBlocksDown, moveBlocksToPosition: () => moveBlocksToPosition, moveBlocksUp: () => moveBlocksUp, multiSelect: () => multiSelect, receiveBlocks: () => receiveBlocks, registerInserterMediaCategory: () => registerInserterMediaCategory, removeBlock: () => removeBlock, removeBlocks: () => removeBlocks, replaceBlock: () => replaceBlock, replaceBlocks: () => replaceBlocks, replaceInnerBlocks: () => replaceInnerBlocks, resetBlocks: () => resetBlocks, resetSelection: () => resetSelection, selectBlock: () => selectBlock, selectNextBlock: () => selectNextBlock, selectPreviousBlock: () => selectPreviousBlock, selectionChange: () => selectionChange, setBlockEditingMode: () => setBlockEditingMode, setBlockMovingClientId: () => setBlockMovingClientId, setBlockVisibility: () => setBlockVisibility, setHasControlledInnerBlocks: () => setHasControlledInnerBlocks, setTemplateValidity: () => setTemplateValidity, showInsertionPoint: () => showInsertionPoint, startDraggingBlocks: () => startDraggingBlocks, startMultiSelect: () => startMultiSelect, startTyping: () => startTyping, stopDraggingBlocks: () => stopDraggingBlocks, stopMultiSelect: () => stopMultiSelect, stopTyping: () => stopTyping, synchronizeTemplate: () => synchronizeTemplate, toggleBlockHighlight: () => toggleBlockHighlight, toggleBlockMode: () => toggleBlockMode, toggleSelection: () => toggleSelection, unsetBlockEditingMode: () => unsetBlockEditingMode, updateBlock: () => updateBlock, updateBlockAttributes: () => updateBlockAttributes, updateBlockListSettings: () => updateBlockListSettings, updateSettings: () => updateSettings, validateBlocksToTemplate: () => validateBlocksToTemplate }); var import_blocks8 = __toESM(require_blocks(), 1); var import_a11y3 = __toESM(require_a11y(), 1); var import_i18n5 = __toESM(require_i18n(), 1); var import_notices = __toESM(require_notices(), 1); var import_rich_text3 = __toESM(require_rich_text(), 1); var import_deprecated4 = __toESM(require_deprecated(), 1); var import_preferences = __toESM(require_preferences(), 1); // packages/block-editor/build-module/utils/selection.mjs var import_rich_text2 = __toESM(require_rich_text(), 1); var START_OF_SELECTED_AREA = "\x86"; function retrieveSelectedAttribute(blockAttributes) { if (!blockAttributes) { return; } return Object.keys(blockAttributes).find((name) => { const value = blockAttributes[name]; return (typeof value === "string" || value instanceof import_rich_text2.RichTextData) && // To do: refactor this to use rich text's selection instead, so we // no longer have to use on this hack inserting a special character. value.toString().indexOf(START_OF_SELECTED_AREA) !== -1; }); } function findRichTextAttributeKey(blockType) { for (const [key, value] of Object.entries(blockType.attributes)) { if (value.source === "rich-text" || value.source === "html") { return key; } } return void 0; } // packages/block-editor/build-module/store/actions.mjs var castArray2 = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray]; var resetBlocks = (blocks2) => ({ dispatch }) => { dispatch({ type: "RESET_BLOCKS", blocks: blocks2 }); dispatch(validateBlocksToTemplate(blocks2)); }; var validateBlocksToTemplate = (blocks2) => ({ select: select3, dispatch }) => { const template2 = select3.getTemplate(); const templateLock = select3.getTemplateLock(); const isBlocksValidToTemplate = !template2 || templateLock !== "all" || (0, import_blocks8.doBlocksMatchTemplate)(blocks2, template2); const isValidTemplate2 = select3.isValidTemplate(); if (isBlocksValidToTemplate !== isValidTemplate2) { dispatch.setTemplateValidity(isBlocksValidToTemplate); return isBlocksValidToTemplate; } }; function resetSelection(selectionStart, selectionEnd, initialPosition2) { return { type: "RESET_SELECTION", selectionStart, selectionEnd, initialPosition: initialPosition2 }; } function receiveBlocks(blocks2) { (0, import_deprecated4.default)('wp.data.dispatch( "core/block-editor" ).receiveBlocks', { since: "5.9", alternative: "resetBlocks or insertBlocks" }); return { type: "RECEIVE_BLOCKS", blocks: blocks2 }; } function updateBlockAttributes(clientIds, attributes, options = { uniqueByBlock: false }) { if (typeof options === "boolean") { options = { uniqueByBlock: options }; } return { type: "UPDATE_BLOCK_ATTRIBUTES", clientIds: castArray2(clientIds), attributes, options }; } function updateBlock(clientId, updates) { return { type: "UPDATE_BLOCK", clientId, updates }; } function selectBlock(clientId, initialPosition2 = 0) { return { type: "SELECT_BLOCK", initialPosition: initialPosition2, clientId }; } function hoverBlock() { (0, import_deprecated4.default)('wp.data.dispatch( "core/block-editor" ).hoverBlock', { since: "6.9", version: "7.1" }); return { type: "DO_NOTHING" }; } var selectPreviousBlock = (clientId, fallbackToParent = false) => ({ select: select3, dispatch }) => { const previousBlockClientId = select3.getPreviousBlockClientId(clientId); if (previousBlockClientId) { dispatch.selectBlock(previousBlockClientId, -1); } else if (fallbackToParent) { const firstParentClientId = select3.getBlockRootClientId(clientId); if (firstParentClientId) { dispatch.selectBlock(firstParentClientId, -1); } else { const nextBlockClientId = select3.getNextBlockClientId(clientId); if (nextBlockClientId) { dispatch.selectBlock(nextBlockClientId, 0); } } } }; var selectNextBlock = (clientId) => ({ select: select3, dispatch }) => { const nextBlockClientId = select3.getNextBlockClientId(clientId); if (nextBlockClientId) { dispatch.selectBlock(nextBlockClientId); } }; function startMultiSelect() { return { type: "START_MULTI_SELECT" }; } function stopMultiSelect() { return { type: "STOP_MULTI_SELECT" }; } var multiSelect = (start2, end, __experimentalInitialPosition = 0) => ({ select: select3, dispatch }) => { const startBlockRootClientId = select3.getBlockRootClientId(start2); const endBlockRootClientId = select3.getBlockRootClientId(end); if (startBlockRootClientId !== endBlockRootClientId) { return; } dispatch({ type: "MULTI_SELECT", start: start2, end, initialPosition: __experimentalInitialPosition }); const blockCount = select3.getSelectedBlockCount(); (0, import_a11y3.speak)( (0, import_i18n5.sprintf)( /* translators: %s: number of selected blocks */ (0, import_i18n5._n)("%s block selected.", "%s blocks selected.", blockCount), blockCount ), "assertive" ); }; function clearSelectedBlock() { return { type: "CLEAR_SELECTED_BLOCK" }; } function toggleSelection(isSelectionEnabled3 = true) { return { type: "TOGGLE_SELECTION", isSelectionEnabled: isSelectionEnabled3 }; } var replaceBlocks = (clientIds, blocks2, indexToSelect, initialPosition2 = 0, meta) => ({ select: select3, dispatch, registry }) => { clientIds = castArray2(clientIds); blocks2 = castArray2(blocks2); const rootClientId = select3.getBlockRootClientId(clientIds[0]); for (let index2 = 0; index2 < blocks2.length; index2++) { const block = blocks2[index2]; const canInsertBlock = select3.canInsertBlockType( block.name, rootClientId ); if (!canInsertBlock) { return; } } registry.batch(() => { dispatch({ type: "REPLACE_BLOCKS", clientIds, blocks: blocks2, time: Date.now(), indexToSelect, initialPosition: initialPosition2, meta }); dispatch.ensureDefaultBlock(); }); }; function replaceBlock(clientId, block) { return replaceBlocks(clientId, block); } var createOnMove = (type) => (clientIds, rootClientId) => ({ select: select3, dispatch }) => { const canMoveBlocks2 = select3.canMoveBlocks(clientIds); if (!canMoveBlocks2) { return; } dispatch({ type, clientIds: castArray2(clientIds), rootClientId }); }; var moveBlocksDown = createOnMove("MOVE_BLOCKS_DOWN"); var moveBlocksUp = createOnMove("MOVE_BLOCKS_UP"); var moveBlocksToPosition = (clientIds, fromRootClientId = "", toRootClientId = "", index2) => ({ select: select3, dispatch }) => { const canMoveBlocks2 = select3.canMoveBlocks(clientIds); if (!canMoveBlocks2) { return; } if (fromRootClientId !== toRootClientId) { const canRemoveBlocks2 = select3.canRemoveBlocks(clientIds); if (!canRemoveBlocks2) { return; } const canInsertBlocks2 = select3.canInsertBlocks( clientIds, toRootClientId ); if (!canInsertBlocks2) { return; } } dispatch({ type: "MOVE_BLOCKS_TO_POSITION", fromRootClientId, toRootClientId, clientIds, index: index2 }); }; function moveBlockToPosition(clientId, fromRootClientId = "", toRootClientId = "", index2) { return moveBlocksToPosition( [clientId], fromRootClientId, toRootClientId, index2 ); } function insertBlock(block, index2, rootClientId, updateSelection, initialPosition2, meta) { return insertBlocks( [block], index2, rootClientId, updateSelection, initialPosition2, meta ); } var insertBlocks = (blocks2, index2, rootClientId, updateSelection = true, initialPosition2 = 0, meta) => ({ select: select3, dispatch }) => { if (initialPosition2 !== null && typeof initialPosition2 === "object") { meta = initialPosition2; initialPosition2 = 0; (0, import_deprecated4.default)( "meta argument in wp.data.dispatch('core/block-editor')", { since: "5.8", hint: "The meta argument is now the 6th argument of the function" } ); } blocks2 = castArray2(blocks2); const allowedBlocks = []; for (const block of blocks2) { const isValid2 = select3.canInsertBlockType( block.name, rootClientId ); if (isValid2) { allowedBlocks.push(block); } } if (allowedBlocks.length) { dispatch({ type: "INSERT_BLOCKS", blocks: allowedBlocks, index: index2, rootClientId, time: Date.now(), updateSelection, initialPosition: updateSelection ? initialPosition2 : null, meta }); } }; function showInsertionPoint(rootClientId, index2, __unstableOptions = {}) { const { __unstableWithInserter, operation, nearestSide } = __unstableOptions; return { type: "SHOW_INSERTION_POINT", rootClientId, index: index2, __unstableWithInserter, operation, nearestSide }; } var hideInsertionPoint = () => ({ select: select3, dispatch }) => { if (!select3.isBlockInsertionPointVisible()) { return; } dispatch({ type: "HIDE_INSERTION_POINT" }); }; function setTemplateValidity(isValid2) { return { type: "SET_TEMPLATE_VALIDITY", isValid: isValid2 }; } var synchronizeTemplate = () => ({ select: select3, dispatch }) => { dispatch({ type: "SYNCHRONIZE_TEMPLATE" }); const blocks2 = select3.getBlocks(); const template2 = select3.getTemplate(); const updatedBlockList = (0, import_blocks8.synchronizeBlocksWithTemplate)( blocks2, template2 ); dispatch.resetBlocks(updatedBlockList); }; var __unstableDeleteSelection = (isForward) => ({ registry, select: select3, dispatch }) => { const selectionAnchor = select3.getSelectionStart(); const selectionFocus = select3.getSelectionEnd(); if (selectionAnchor.clientId === selectionFocus.clientId) { return; } if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === "undefined" || typeof selectionFocus.offset === "undefined") { return false; } const anchorRootClientId = select3.getBlockRootClientId( selectionAnchor.clientId ); const focusRootClientId = select3.getBlockRootClientId( selectionFocus.clientId ); if (anchorRootClientId !== focusRootClientId) { return; } const blockOrder = select3.getBlockOrder(anchorRootClientId); const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId); const focusIndex = blockOrder.indexOf(selectionFocus.clientId); let selectionStart, selectionEnd; if (anchorIndex > focusIndex) { selectionStart = selectionFocus; selectionEnd = selectionAnchor; } else { selectionStart = selectionAnchor; selectionEnd = selectionFocus; } const targetSelection = isForward ? selectionEnd : selectionStart; const targetBlock = select3.getBlock(targetSelection.clientId); const targetBlockType = (0, import_blocks8.getBlockType)(targetBlock.name); if (!targetBlockType.merge) { return; } const selectionA = selectionStart; const selectionB = selectionEnd; const blockA = select3.getBlock(selectionA.clientId); const blockB = select3.getBlock(selectionB.clientId); const htmlA = blockA.attributes[selectionA.attributeKey]; const htmlB = blockB.attributes[selectionB.attributeKey]; let valueA = (0, import_rich_text3.create)({ html: htmlA }); let valueB = (0, import_rich_text3.create)({ html: htmlB }); valueA = (0, import_rich_text3.remove)(valueA, selectionA.offset, valueA.text.length); valueB = (0, import_rich_text3.insert)(valueB, START_OF_SELECTED_AREA, 0, selectionB.offset); const cloneA = (0, import_blocks8.cloneBlock)(blockA, { [selectionA.attributeKey]: (0, import_rich_text3.toHTMLString)({ value: valueA }) }); const cloneB = (0, import_blocks8.cloneBlock)(blockB, { [selectionB.attributeKey]: (0, import_rich_text3.toHTMLString)({ value: valueB }) }); const followingBlock = isForward ? cloneA : cloneB; const blocksWithTheSameType = blockA.name === blockB.name ? [followingBlock] : (0, import_blocks8.switchToBlockType)(followingBlock, targetBlockType.name); if (!blocksWithTheSameType || !blocksWithTheSameType.length) { return; } let updatedAttributes; if (isForward) { const blockToMerge = blocksWithTheSameType.pop(); updatedAttributes = targetBlockType.merge( blockToMerge.attributes, cloneB.attributes ); } else { const blockToMerge = blocksWithTheSameType.shift(); updatedAttributes = targetBlockType.merge( cloneA.attributes, blockToMerge.attributes ); } const newAttributeKey = retrieveSelectedAttribute(updatedAttributes); const convertedHtml = updatedAttributes[newAttributeKey]; const convertedValue = (0, import_rich_text3.create)({ html: convertedHtml }); const newOffset = convertedValue.text.indexOf(START_OF_SELECTED_AREA); const newValue = (0, import_rich_text3.remove)(convertedValue, newOffset, newOffset + 1); const newHtml = (0, import_rich_text3.toHTMLString)({ value: newValue }); updatedAttributes[newAttributeKey] = newHtml; const selectedBlockClientIds = select3.getSelectedBlockClientIds(); const replacement = [ ...isForward ? blocksWithTheSameType : [], { // Preserve the original client ID. ...targetBlock, attributes: { ...targetBlock.attributes, ...updatedAttributes }, // Block A's inner blocks sit inside the selection; only B's survive. innerBlocks: blockB.innerBlocks }, ...isForward ? [] : blocksWithTheSameType ]; registry.batch(() => { dispatch.selectionChange( targetBlock.clientId, newAttributeKey, newOffset, newOffset ); dispatch.replaceBlocks( selectedBlockClientIds, replacement, 0, // If we don't pass the `indexToSelect` it will default to the last block. select3.getSelectedBlocksInitialCaretPosition() ); }); }; var __unstableSplitSelection = (blocks2 = []) => ({ registry, select: select3, dispatch }) => { const selectionAnchor = select3.getSelectionStart(); const selectionFocus = select3.getSelectionEnd(); const anchorRootClientId = select3.getBlockRootClientId( selectionAnchor.clientId ); const focusRootClientId = select3.getBlockRootClientId( selectionFocus.clientId ); if (anchorRootClientId !== focusRootClientId) { return; } const blockOrder = select3.getBlockOrder(anchorRootClientId); const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId); const focusIndex = blockOrder.indexOf(selectionFocus.clientId); let selectionStart, selectionEnd; if (anchorIndex > focusIndex) { selectionStart = selectionFocus; selectionEnd = selectionAnchor; } else { selectionStart = selectionAnchor; selectionEnd = selectionFocus; } const selectionA = selectionStart; const selectionB = selectionEnd; const blockA = select3.getBlock(selectionA.clientId); const blockB = select3.getBlock(selectionB.clientId); const blockAType = (0, import_blocks8.getBlockType)(blockA.name); const blockBType = (0, import_blocks8.getBlockType)(blockB.name); const attributeKeyA = typeof selectionA.attributeKey === "string" ? selectionA.attributeKey : findRichTextAttributeKey(blockAType); const attributeKeyB = typeof selectionB.attributeKey === "string" ? selectionB.attributeKey : findRichTextAttributeKey(blockBType); const blockAttributes = select3.getBlockAttributes( selectionA.clientId ); const bindings = blockAttributes?.metadata?.bindings; if (bindings?.[attributeKeyA]) { if (blocks2.length) { const { createWarningNotice } = registry.dispatch(import_notices.store); createWarningNotice( (0, import_i18n5.__)( "Blocks can't be inserted into other blocks with bindings" ), { type: "snackbar" } ); return; } dispatch.insertAfterBlock(selectionA.clientId); return; } if (!attributeKeyA || !attributeKeyB || typeof selectionAnchor.offset === "undefined" || typeof selectionFocus.offset === "undefined") { return; } if (selectionA.clientId === selectionB.clientId && attributeKeyA === attributeKeyB && selectionA.offset === selectionB.offset) { if (blocks2.length) { if ((0, import_blocks8.isUnmodifiedDefaultBlock)(blockA, "content")) { dispatch.replaceBlocks( [selectionA.clientId], blocks2, blocks2.length - 1, -1 ); return; } } else if (!select3.getBlockOrder(selectionA.clientId).length) { let createEmpty2 = function() { const defaultBlockName2 = (0, import_blocks8.getDefaultBlockName)(); return select3.canInsertBlockType( defaultBlockName2, anchorRootClientId ) ? (0, import_blocks8.createBlock)(defaultBlockName2) : (0, import_blocks8.createBlock)( select3.getBlockName(selectionA.clientId) ); }; var createEmpty = createEmpty2; const length = blockAttributes[attributeKeyA].length; if (selectionA.offset === 0 && length) { dispatch.insertBlocks( [createEmpty2()], select3.getBlockIndex(selectionA.clientId), anchorRootClientId, false ); return; } if (selectionA.offset === length) { dispatch.insertBlocks( [createEmpty2()], select3.getBlockIndex(selectionA.clientId) + 1, anchorRootClientId ); return; } } } const htmlA = blockA.attributes[attributeKeyA]; const htmlB = blockB.attributes[attributeKeyB]; let valueA = (0, import_rich_text3.create)({ html: htmlA }); let valueB = (0, import_rich_text3.create)({ html: htmlB }); valueA = (0, import_rich_text3.remove)(valueA, selectionA.offset, valueA.text.length); valueB = (0, import_rich_text3.remove)(valueB, 0, selectionB.offset); let head = { // Preserve the original client ID. ...blockA, // If both start and end are the same, should only copy innerBlocks // once. innerBlocks: blockA.clientId === blockB.clientId ? [] : blockA.innerBlocks, attributes: { ...blockA.attributes, [attributeKeyA]: (0, import_rich_text3.toHTMLString)({ value: valueA }) } }; let tail = { ...blockB, // Only preserve the original client ID if the end is different. clientId: blockA.clientId === blockB.clientId ? (0, import_blocks8.createBlock)(blockB.name).clientId : blockB.clientId, attributes: { ...blockB.attributes, [attributeKeyB]: (0, import_rich_text3.toHTMLString)({ value: valueB }) } }; const defaultBlockName = (0, import_blocks8.getDefaultBlockName)(); if ( // A block is only split when the selection is within the same // block. blockA.clientId === blockB.clientId && defaultBlockName && tail.name !== defaultBlockName && select3.canInsertBlockType(defaultBlockName, anchorRootClientId) ) { const switched = (0, import_blocks8.switchToBlockType)(tail, defaultBlockName); if (switched?.length === 1) { tail = switched[0]; } } if (!blocks2.length) { dispatch.replaceBlocks(select3.getSelectedBlockClientIds(), [ head, tail ]); return; } let selection2; const output = []; const clonedBlocks = [...blocks2]; const firstBlock = clonedBlocks.shift(); const headType = (0, import_blocks8.getBlockType)(head.name); const firstBlocks = headType.merge && firstBlock.name === headType.name ? [firstBlock] : (0, import_blocks8.switchToBlockType)(firstBlock, headType.name); if (firstBlocks?.length) { const first = firstBlocks.shift(); head = { ...head, attributes: { ...head.attributes, ...headType.merge(head.attributes, first.attributes) } }; output.push(head); selection2 = { clientId: head.clientId, attributeKey: attributeKeyA, offset: (0, import_rich_text3.create)({ html: head.attributes[attributeKeyA] }).text.length }; clonedBlocks.unshift(...firstBlocks); } else { if (!(0, import_blocks8.isUnmodifiedBlock)(head)) { output.push(head); } output.push(firstBlock); } const lastBlock = clonedBlocks.pop(); const tailType = (0, import_blocks8.getBlockType)(tail.name); if (clonedBlocks.length) { output.push(...clonedBlocks); } if (lastBlock) { const lastBlocks = tailType.merge && tailType.name === lastBlock.name ? [lastBlock] : (0, import_blocks8.switchToBlockType)(lastBlock, tailType.name); if (lastBlocks?.length) { const last = lastBlocks.pop(); output.push({ ...tail, attributes: { ...tail.attributes, ...tailType.merge(last.attributes, tail.attributes) } }); output.push(...lastBlocks); selection2 = { clientId: tail.clientId, attributeKey: attributeKeyB, offset: (0, import_rich_text3.create)({ html: last.attributes[attributeKeyB] }).text.length }; } else { output.push(lastBlock); if (!(0, import_blocks8.isUnmodifiedBlock)(tail)) { output.push(tail); } } } else if (!(0, import_blocks8.isUnmodifiedBlock)(tail)) { output.push(tail); } registry.batch(() => { dispatch.replaceBlocks( select3.getSelectedBlockClientIds(), output, output.length - 1, 0 ); if (selection2) { dispatch.selectionChange( selection2.clientId, selection2.attributeKey, selection2.offset, selection2.offset ); } }); }; var __unstableExpandSelection = () => ({ select: select3, dispatch }) => { const selectionAnchor = select3.getSelectionStart(); const selectionFocus = select3.getSelectionEnd(); dispatch.selectionChange({ start: { clientId: selectionAnchor.clientId }, end: { clientId: selectionFocus.clientId } }); }; var mergeBlocks = (firstBlockClientId, secondBlockClientId) => ({ registry, select: select3, dispatch }) => { const clientIdA = firstBlockClientId; const clientIdB = secondBlockClientId; const blockA = select3.getBlock(clientIdA); const blockAType = (0, import_blocks8.getBlockType)(blockA.name); if (!blockAType || select3.getBlockEditingMode(clientIdA) === "disabled" || select3.getBlockEditingMode(clientIdB) === "disabled") { return; } const blockB = select3.getBlock(clientIdB); if (!blockAType.merge && (0, import_blocks8.getBlockSupport)(blockA.name, "__experimentalOnMerge")) { const blocksWithTheSameType2 = (0, import_blocks8.switchToBlockType)( blockB, blockAType.name ); if (blocksWithTheSameType2?.length !== 1) { dispatch.selectBlock(blockA.clientId); return; } const [blockWithSameType] = blocksWithTheSameType2; if (blockWithSameType.innerBlocks.length < 1) { dispatch.selectBlock(blockA.clientId); return; } registry.batch(() => { dispatch.insertBlocks( blockWithSameType.innerBlocks, void 0, clientIdA ); dispatch.removeBlock(clientIdB); dispatch.selectBlock( blockWithSameType.innerBlocks[0].clientId ); const nextBlockClientId = select3.getNextBlockClientId(clientIdA); if (nextBlockClientId && select3.getBlockName(clientIdA) === select3.getBlockName(nextBlockClientId)) { const rootAttributes = select3.getBlockAttributes(clientIdA); const previousRootAttributes = select3.getBlockAttributes(nextBlockClientId); if (Object.keys(rootAttributes).every( (key) => rootAttributes[key] === previousRootAttributes[key] )) { dispatch.moveBlocksToPosition( select3.getBlockOrder(nextBlockClientId), nextBlockClientId, clientIdA ); dispatch.removeBlock(nextBlockClientId, false); } } }); return; } if ((0, import_blocks8.isUnmodifiedDefaultBlock)(blockA)) { const isASelected = select3.isBlockSelected(clientIdA); if (isASelected) { registry.batch(() => { dispatch.removeBlock(clientIdA, false); dispatch.selectBlock(clientIdB, 0); }); } else { dispatch.removeBlock(clientIdA, false); } return; } if ((0, import_blocks8.isUnmodifiedDefaultBlock)(blockB)) { dispatch.removeBlock( clientIdB, select3.isBlockSelected(clientIdB) ); return; } if (!blockAType.merge) { if ((0, import_blocks8.isUnmodifiedBlock)(blockB, "content")) { dispatch.removeBlock( clientIdB, select3.isBlockSelected(clientIdB) ); } else { dispatch.selectBlock(blockA.clientId); } return; } const blockBType = (0, import_blocks8.getBlockType)(blockB.name); const { clientId, attributeKey, offset: offset4 } = select3.getSelectionStart(); const selectedBlockType = clientId === clientIdA ? blockAType : blockBType; const attributeDefinition = selectedBlockType.attributes[attributeKey]; const canRestoreTextSelection = (clientId === clientIdA || clientId === clientIdB) && attributeKey !== void 0 && offset4 !== void 0 && // We cannot restore text selection if the RichText identifier // is not a defined block attribute key. This can be the case if the // fallback instance ID is used to store selection (and no RichText // identifier is set), or when the identifier is wrong. !!attributeDefinition; if (!attributeDefinition) { if (typeof attributeKey === "number") { window.console.error( `RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was ${typeof attributeKey}` ); } else { window.console.error( "The RichText identifier prop does not match any attributes defined by the block." ); } } const cloneA = (0, import_blocks8.cloneBlock)(blockA); const cloneB = (0, import_blocks8.cloneBlock)(blockB); if (canRestoreTextSelection) { const selectedBlock = clientId === clientIdA ? cloneA : cloneB; const html = selectedBlock.attributes[attributeKey]; const value = (0, import_rich_text3.insert)( (0, import_rich_text3.create)({ html }), START_OF_SELECTED_AREA, offset4, offset4 ); selectedBlock.attributes[attributeKey] = (0, import_rich_text3.toHTMLString)({ value }); } const blocksWithTheSameType = blockA.name === blockB.name ? [cloneB] : (0, import_blocks8.switchToBlockType)(cloneB, blockA.name); if (!blocksWithTheSameType || !blocksWithTheSameType.length) { return; } const updatedAttributes = blockAType.merge( cloneA.attributes, blocksWithTheSameType[0].attributes ); if (canRestoreTextSelection) { const newAttributeKey = retrieveSelectedAttribute(updatedAttributes); const convertedHtml = updatedAttributes[newAttributeKey]; const convertedValue = (0, import_rich_text3.create)({ html: convertedHtml }); const newOffset = convertedValue.text.indexOf( START_OF_SELECTED_AREA ); const newValue = (0, import_rich_text3.remove)(convertedValue, newOffset, newOffset + 1); const newHtml = (0, import_rich_text3.toHTMLString)({ value: newValue }); updatedAttributes[newAttributeKey] = newHtml; dispatch.selectionChange( blockA.clientId, newAttributeKey, newOffset, newOffset ); } dispatch.replaceBlocks( [blockA.clientId, blockB.clientId], [ { ...blockA, attributes: { ...blockA.attributes, ...updatedAttributes } }, ...blocksWithTheSameType.slice(1) ], 0 // If we don't pass the `indexToSelect` it will default to the last block. ); }; var removeBlocks = (clientIds, selectPrevious = true) => privateRemoveBlocks(clientIds, selectPrevious); function removeBlock(clientId, selectPrevious) { return removeBlocks([clientId], selectPrevious); } function replaceInnerBlocks(rootClientId, blocks2, updateSelection = false, initialPosition2 = 0) { return { type: "REPLACE_INNER_BLOCKS", rootClientId, blocks: blocks2, updateSelection, initialPosition: updateSelection ? initialPosition2 : null, time: Date.now() }; } function toggleBlockMode(clientId) { return { type: "TOGGLE_BLOCK_MODE", clientId }; } function startTyping() { return { type: "START_TYPING" }; } function stopTyping() { return { type: "STOP_TYPING" }; } function startDraggingBlocks(clientIds = []) { return { type: "START_DRAGGING_BLOCKS", clientIds }; } function stopDraggingBlocks() { return { type: "STOP_DRAGGING_BLOCKS" }; } function enterFormattedText() { (0, import_deprecated4.default)('wp.data.dispatch( "core/block-editor" ).enterFormattedText', { since: "6.1", version: "6.3" }); return { type: "DO_NOTHING" }; } function exitFormattedText() { (0, import_deprecated4.default)('wp.data.dispatch( "core/block-editor" ).exitFormattedText', { since: "6.1", version: "6.3" }); return { type: "DO_NOTHING" }; } function selectionChange(clientId, attributeKey, startOffset, endOffset) { if (typeof clientId === "string") { return { type: "SELECTION_CHANGE", clientId, attributeKey, startOffset, endOffset }; } return { type: "SELECTION_CHANGE", ...clientId }; } var insertDefaultBlock = (attributes, rootClientId, index2) => ({ dispatch }) => { const defaultBlockName = (0, import_blocks8.getDefaultBlockName)(); if (!defaultBlockName) { return; } const block = (0, import_blocks8.createBlock)(defaultBlockName, attributes); return dispatch.insertBlock(block, index2, rootClientId); }; function updateBlockListSettings(clientId, settings2) { return { type: "UPDATE_BLOCK_LIST_SETTINGS", clientId, settings: settings2 }; } function updateSettings(settings2) { return __experimentalUpdateSettings(settings2, { stripExperimentalSettings: true }); } function __unstableSaveReusableBlock() { (0, import_deprecated4.default)( 'wp.data.dispatch( "core/block-editor" ).__unstableSaveReusableBlock', { since: "7.1" } ); return { type: "DO_NOTHING" }; } function __unstableMarkLastChangeAsPersistent() { return { type: "MARK_LAST_CHANGE_AS_PERSISTENT" }; } function __unstableMarkNextChangeAsNotPersistent({ history = "merge" } = {}) { return { type: "MARK_NEXT_CHANGE_AS_NOT_PERSISTENT", history }; } var __unstableMarkAutomaticChange = () => ({ dispatch }) => { dispatch({ type: "MARK_AUTOMATIC_CHANGE" }); const { requestIdleCallback = (cb) => setTimeout(cb, 100) } = window; requestIdleCallback(() => { dispatch({ type: "MARK_AUTOMATIC_CHANGE_FINAL" }); }); }; var __unstableSetEditorMode = (mode2) => ({ registry }) => { registry.dispatch(import_preferences.store).set("core", "editorTool", mode2); if (mode2 === "navigation") { (0, import_a11y3.speak)((0, import_i18n5.__)("You are currently in Write mode.")); } else if (mode2 === "edit") { (0, import_a11y3.speak)((0, import_i18n5.__)("You are currently in Design mode.")); } }; function setBlockMovingClientId() { (0, import_deprecated4.default)( 'wp.data.dispatch( "core/block-editor" ).setBlockMovingClientId', { since: "6.7", hint: "Block moving mode feature has been removed" } ); return { type: "DO_NOTHING" }; } var duplicateBlocks = (clientIds, updateSelection = true) => ({ select: select3, dispatch }) => { if (!clientIds || !clientIds.length) { return; } const blocks2 = select3.getBlocksByClientId(clientIds); if (blocks2.some((block) => !block)) { return; } const blockNames = blocks2.map((block) => block.name); if (blockNames.some( (blockName) => !(0, import_blocks8.hasBlockSupport)(blockName, "multiple", true) )) { return; } const rootClientId = select3.getBlockRootClientId(clientIds[0]); const clientIdsArray = castArray2(clientIds); const lastSelectedIndex = select3.getBlockIndex( clientIdsArray[clientIdsArray.length - 1] ); const clonedBlocks = blocks2.map( (block) => (0, import_blocks8.cloneSanitizedBlock)(block) ); dispatch.insertBlocks( clonedBlocks, lastSelectedIndex + 1, rootClientId, updateSelection ); if (clonedBlocks.length > 1 && updateSelection) { dispatch.multiSelect( clonedBlocks[0].clientId, clonedBlocks[clonedBlocks.length - 1].clientId ); } return clonedBlocks.map((block) => block.clientId); }; var insertBeforeBlock = (clientId) => ({ select: select3, dispatch }) => { if (!clientId) { return; } const rootClientId = select3.getBlockRootClientId(clientId); const blockIndex = select3.getBlockIndex(clientId); const { defaultBlock: directInsertBlock } = rootClientId ? select3.getBlockListSettings(rootClientId) ?? {} : {}; if (!directInsertBlock) { return dispatch.insertDefaultBlock({}, rootClientId, blockIndex); } const copiedAttributes = {}; if (directInsertBlock.attributesToCopy) { const attributes = select3.getBlockAttributes(clientId); directInsertBlock.attributesToCopy.forEach((key) => { if (attributes[key]) { copiedAttributes[key] = attributes[key]; } }); } const block = (0, import_blocks8.createBlock)(directInsertBlock.name, { ...directInsertBlock.attributes, ...copiedAttributes }); return dispatch.insertBlock(block, blockIndex, rootClientId); }; var insertAfterBlock = (clientId) => ({ select: select3, dispatch }) => { if (!clientId) { return; } const rootClientId = select3.getBlockRootClientId(clientId); const blockIndex = select3.getBlockIndex(clientId); const { defaultBlock: directInsertBlock } = rootClientId ? select3.getBlockListSettings(rootClientId) ?? {} : {}; if (!directInsertBlock) { return dispatch.insertDefaultBlock( {}, rootClientId, blockIndex + 1 ); } const copiedAttributes = {}; if (directInsertBlock.attributesToCopy) { const attributes = select3.getBlockAttributes(clientId); directInsertBlock.attributesToCopy.forEach((key) => { if (attributes[key]) { copiedAttributes[key] = attributes[key]; } }); } const block = (0, import_blocks8.createBlock)(directInsertBlock.name, { ...directInsertBlock.attributes, ...copiedAttributes }); return dispatch.insertBlock(block, blockIndex + 1, rootClientId); }; function toggleBlockHighlight(clientId, isHighlighted) { return { type: "TOGGLE_BLOCK_HIGHLIGHT", clientId, isHighlighted }; } var flashBlock = (clientId, timeout = 150) => async ({ dispatch }) => { dispatch(toggleBlockHighlight(clientId, true)); await new Promise((resolve) => setTimeout(resolve, timeout)); dispatch(toggleBlockHighlight(clientId, false)); }; function setHasControlledInnerBlocks(clientId, hasControlledInnerBlocks) { return { type: "SET_HAS_CONTROLLED_INNER_BLOCKS", hasControlledInnerBlocks, clientId }; } function setBlockVisibility(updates) { return { type: "SET_BLOCK_VISIBILITY", updates }; } function __unstableSetTemporarilyEditingAsBlocks(clientId) { (0, import_deprecated4.default)( "wp.data.dispatch( 'core/block-editor' ).__unstableSetTemporarilyEditingAsBlocks", { since: "7.0" } ); return editContentOnlySection(clientId); } var registerInserterMediaCategory = (category) => ({ select: select3, dispatch }) => { if (!category || typeof category !== "object") { console.error( "Category should be an `InserterMediaCategory` object." ); return; } if (!category.name) { console.error( "Category should have a `name` that should be unique among all media categories." ); return; } if (!category.labels?.name) { console.error("Category should have a `labels.name`."); return; } if (!["image", "audio", "video"].includes(category.mediaType)) { console.error( "Category should have `mediaType` property that is one of `image|audio|video`." ); return; } if (!category.fetch || typeof category.fetch !== "function") { console.error( "Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise`." ); return; } const registeredInserterMediaCategories2 = select3.getRegisteredInserterMediaCategories(); if (registeredInserterMediaCategories2.some( ({ name }) => name === category.name )) { console.error( `A category is already registered with the same name: "${category.name}".` ); return; } if (registeredInserterMediaCategories2.some( ({ labels: { name } = {} }) => name === category.labels?.name )) { console.error( `A category is already registered with the same labels.name: "${category.labels.name}".` ); return; } dispatch({ type: "REGISTER_INSERTER_MEDIA_CATEGORY", category: { ...category, isExternalResource: true } }); }; function setBlockEditingMode(clientId = "", mode2) { return { type: "SET_BLOCK_EDITING_MODE", clientId, mode: mode2 }; } function unsetBlockEditingMode(clientId = "") { return { type: "UNSET_BLOCK_EDITING_MODE", clientId }; } function __unstableSetOpenListViewPanel(clientId) { return { type: "SET_OPEN_LIST_VIEW_PANEL", clientId }; } function __unstableSetAllListViewPanelsOpen() { return { type: "SET_ALL_LIST_VIEW_PANELS_OPEN" }; } function __unstableToggleListViewPanel(clientId, isOpen) { return { type: "TOGGLE_LIST_VIEW_PANEL", clientId, isOpen }; } function __unstableIncrementListViewExpandRevision() { return { type: "INCREMENT_LIST_VIEW_EXPAND_REVISION" }; } // packages/block-editor/build-module/store/index.mjs var storeConfig = { reducer: reducer_default, selectors: selectors_exports, actions: actions_exports }; var store = (0, import_data6.createReduxStore)(STORE_NAME, { ...storeConfig, persist: ["preferences"] }); var registeredStore = (0, import_data6.registerStore)(STORE_NAME, { ...storeConfig, persist: ["preferences"] }); unlock(registeredStore).registerPrivateActions(private_actions_exports); unlock(registeredStore).registerPrivateSelectors(private_selectors_exports); unlock(store).registerPrivateActions(private_actions_exports); unlock(store).registerPrivateSelectors(private_selectors_exports); // packages/block-editor/build-module/components/warning/index.mjs var import_components3 = __toESM(require_components(), 1); var import_i18n6 = __toESM(require_i18n(), 1); var import_jsx_runtime119 = __toESM(require_jsx_runtime(), 1); function Warning({ className, actions, children, secondaryActions }) { return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { style: { display: "contents", all: "initial" }, children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: clsx_default(className, "block-editor-warning"), children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "block-editor-warning__contents", children: [ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("p", { className: "block-editor-warning__message", children }), (actions?.length > 0 || secondaryActions) && /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "block-editor-warning__actions", children: [ actions?.length > 0 && actions.map((action, i2) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)( "span", { className: "block-editor-warning__action", children: action }, i2 )), secondaryActions && /* @__PURE__ */ (0, import_jsx_runtime119.jsx)( import_components3.DropdownMenu, { className: "block-editor-warning__secondary", icon: more_vertical_default, label: (0, import_i18n6.__)("More options"), popoverProps: { placement: "bottom-end", className: "block-editor-warning__dropdown" }, noIcons: true, children: () => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_components3.MenuGroup, { children: secondaryActions.map( (item, pos) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)( import_components3.MenuItem, { onClick: item.onClick, children: item.title }, pos ) ) }) } ) ] }) ] }) }) }); } var warning_default = Warning; // packages/block-editor/build-module/components/block-edit/multiple-usage-warning.mjs var import_jsx_runtime120 = __toESM(require_jsx_runtime(), 1); function MultipleUsageWarning({ originalBlockClientId, name, onReplace }) { const { selectBlock: selectBlock2 } = (0, import_data7.useDispatch)(store); const blockType = (0, import_blocks9.getBlockType)(name); return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)( warning_default, { actions: [ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)( import_components4.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: () => selectBlock2(originalBlockClientId), children: (0, import_i18n7.__)("Find original") }, "find-original" ), /* @__PURE__ */ (0, import_jsx_runtime120.jsx)( import_components4.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: () => onReplace([]), children: (0, import_i18n7.__)("Remove") }, "remove" ) ], children: [ /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("strong", { children: [ blockType?.title, ": " ] }), (0, import_i18n7.__)("This block can only be used once.") ] } ); } // packages/block-editor/build-module/components/block-edit/index.mjs var import_jsx_runtime121 = __toESM(require_jsx_runtime(), 1); function BlockEdit({ mayDisplayControls, mayDisplayParentControls, mayDisplayPatternEditingControls, blockEditingMode, isPreviewMode, // The remaining props are passed through the BlockEdit filters and are thus // public API! ...props }) { const { name, isSelected, clientId, attributes = {}, __unstableLayoutClassNames } = props; const { layout = null, metadata = {} } = attributes; const { bindings } = metadata; const layoutSupport = (0, import_blocks10.hasBlockSupport)(name, "layout", false) || (0, import_blocks10.hasBlockSupport)(name, "__experimentalLayout", false); const parentBlockEditContext = useBlockEditContext(); const isInListViewBlockSupportTree = !!parentBlockEditContext[isInListViewBlockSupportTreeKey] || (0, import_blocks10.hasBlockSupport)(name, "listView") || name === "core/navigation"; const { originalBlockClientId } = (0, import_element6.useContext)(PrivateBlockContext); return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)( Provider, { value: (0, import_element6.useMemo)( () => ({ name, isSelected, clientId, layout: layoutSupport ? layout : null, __unstableLayoutClassNames, // We use symbols in favour of an __unstable prefix to avoid // usage outside of the package (this context is exposed). [mayDisplayControlsKey]: mayDisplayControls, [mayDisplayParentControlsKey]: mayDisplayParentControls, [mayDisplayPatternEditingControlsKey]: mayDisplayPatternEditingControls && blockEditingMode !== "disabled", [blockEditingModeKey]: blockEditingMode, [blockBindingsKey]: bindings, [isPreviewModeKey]: isPreviewMode, [isInListViewBlockSupportTreeKey]: isInListViewBlockSupportTree }), [ name, isSelected, clientId, layoutSupport, layout, __unstableLayoutClassNames, mayDisplayControls, mayDisplayParentControls, mayDisplayPatternEditingControls, blockEditingMode, bindings, isPreviewMode, isInListViewBlockSupportTree ] ), children: [ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(edit_default, { ...props }), originalBlockClientId && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)( MultipleUsageWarning, { originalBlockClientId, name, onReplace: props.onReplace } ) ] } ); } // packages/block-editor/build-module/components/use-settings/index.mjs function useSettings(...paths) { const { clientId = null } = useBlockEditContext(); return (0, import_data8.useSelect)( (select3) => unlock(select3(store)).getBlockSettings( clientId, ...paths ), [clientId, ...paths] ); } function useSetting(path) { (0, import_deprecated5.default)("wp.blockEditor.useSetting", { since: "6.5", alternative: "wp.blockEditor.useSettings", note: "The new useSettings function can retrieve multiple settings at once, with better performance." }); const [value] = useSettings(path); return value; } // packages/block-editor/build-module/components/colors/with-colors.mjs var import_jsx_runtime122 = __toESM(require_jsx_runtime(), 1); var { kebabCase: kebabCase3 } = unlock(import_components5.privateApis); var upperFirst = ([firstLetter, ...rest]) => firstLetter.toUpperCase() + rest.join(""); var withCustomColorPalette = (colorsArray) => (0, import_compose2.createHigherOrderComponent)( (WrappedComponent) => function WithCustomColorPalette(props) { return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(WrappedComponent, { ...props, colors: colorsArray }); }, "withCustomColorPalette" ); var withEditorColorPalette = () => (0, import_compose2.createHigherOrderComponent)( (WrappedComponent) => function WithEditorColorPalette(props) { const [userPalette, themePalette, defaultPalette] = useSettings( "color.palette.custom", "color.palette.theme", "color.palette.default" ); const allColors = (0, import_element7.useMemo)( () => [ ...userPalette || [], ...themePalette || [], ...defaultPalette || [] ], [userPalette, themePalette, defaultPalette] ); return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(WrappedComponent, { ...props, colors: allColors }); }, "withEditorColorPalette" ); function createColorHOC(colorTypes, withColorPalette) { const colorMap = colorTypes.reduce((colorObject, colorType) => { return { ...colorObject, ...typeof colorType === "string" ? { [colorType]: kebabCase3(colorType) } : colorType }; }, {}); return (0, import_compose2.compose)([ withColorPalette, (WrappedComponent) => { return class WithColors extends import_element7.Component { constructor(props) { super(props); this.setters = this.createSetters(); this.colorUtils = { getMostReadableColor: this.getMostReadableColor.bind(this) }; this.state = {}; } getMostReadableColor(colorValue) { const { colors: colors2 } = this.props; return getMostReadableColor(colors2, colorValue); } createSetters() { return Object.keys(colorMap).reduce( (settersAccumulator, colorAttributeName) => { const upperFirstColorAttributeName = upperFirst(colorAttributeName); const customColorAttributeName = `custom${upperFirstColorAttributeName}`; settersAccumulator[`set${upperFirstColorAttributeName}`] = this.createSetColor( colorAttributeName, customColorAttributeName ); return settersAccumulator; }, {} ); } createSetColor(colorAttributeName, customColorAttributeName) { return (colorValue) => { const colorObject = getColorObjectByColorValue( this.props.colors, colorValue ); this.props.setAttributes({ [colorAttributeName]: colorObject && colorObject.slug ? colorObject.slug : void 0, [customColorAttributeName]: colorObject && colorObject.slug ? void 0 : colorValue }); }; } static getDerivedStateFromProps({ attributes, colors: colors2 }, previousState) { return Object.entries(colorMap).reduce( (newState, [colorAttributeName, colorContext]) => { const colorObject = getColorObjectByAttributeValues( colors2, attributes[colorAttributeName], attributes[`custom${upperFirst( colorAttributeName )}`] ); const previousColorObject = previousState[colorAttributeName]; const previousColor = previousColorObject?.color; if (previousColor === colorObject.color && previousColorObject) { newState[colorAttributeName] = previousColorObject; } else { newState[colorAttributeName] = { ...colorObject, class: getColorClassName( colorContext, colorObject.slug ) }; } return newState; }, {} ); } render() { return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)( WrappedComponent, { ...{ ...this.props, colors: void 0, ...this.state, ...this.setters, colorUtils: this.colorUtils } } ); } }; } ]); } function createCustomColorsHOC(colorsArray) { return (...colorTypes) => { const withColorPalette = withCustomColorPalette(colorsArray); return (0, import_compose2.createHigherOrderComponent)( createColorHOC(colorTypes, withColorPalette), "withCustomColors" ); }; } function withColors(...colorTypes) { const withColorPalette = withEditorColorPalette(); return (0, import_compose2.createHigherOrderComponent)( createColorHOC(colorTypes, withColorPalette), "withColors" ); } // packages/block-editor/build-module/components/gradients/use-gradient.mjs var import_element8 = __toESM(require_element(), 1); var import_data9 = __toESM(require_data(), 1); function __experimentalGetGradientClass(gradientSlug) { if (!gradientSlug) { return void 0; } return `has-${gradientSlug}-gradient-background`; } function getGradientValueBySlug(gradients, slug) { const gradient = gradients?.find((g2) => g2.slug === slug); return gradient && gradient.gradient; } function __experimentalGetGradientObjectByGradientValue(gradients, value) { const gradient = gradients?.find((g2) => g2.gradient === value); return gradient; } function getGradientSlugByValue(gradients, value) { const gradient = __experimentalGetGradientObjectByGradientValue( gradients, value ); return gradient && gradient.slug; } function useGradient({ gradientAttribute = "gradient", customGradientAttribute = "customGradient" } = {}) { const { clientId } = useBlockEditContext(); const [ userGradientPalette, themeGradientPalette, defaultGradientPalette ] = useSettings( "color.gradients.custom", "color.gradients.theme", "color.gradients.default" ); const allGradients = (0, import_element8.useMemo)( () => [ ...userGradientPalette || [], ...themeGradientPalette || [], ...defaultGradientPalette || [] ], [userGradientPalette, themeGradientPalette, defaultGradientPalette] ); const { gradient, customGradient } = (0, import_data9.useSelect)( (select3) => { const { getBlockAttributes: getBlockAttributes3 } = select3(store); const attributes = getBlockAttributes3(clientId) || {}; return { customGradient: attributes[customGradientAttribute], gradient: attributes[gradientAttribute] }; }, [clientId, gradientAttribute, customGradientAttribute] ); const { updateBlockAttributes: updateBlockAttributes2 } = (0, import_data9.useDispatch)(store); const setGradient = (0, import_element8.useCallback)( (newGradientValue) => { const slug = getGradientSlugByValue( allGradients, newGradientValue ); if (slug) { updateBlockAttributes2(clientId, { [gradientAttribute]: slug, [customGradientAttribute]: void 0 }); return; } updateBlockAttributes2(clientId, { [gradientAttribute]: void 0, [customGradientAttribute]: newGradientValue }); }, [allGradients, clientId, updateBlockAttributes2] ); const gradientClass = __experimentalGetGradientClass(gradient); let gradientValue; if (gradient) { gradientValue = getGradientValueBySlug(allGradients, gradient); } else { gradientValue = customGradient; } return { gradientClass, gradientValue, setGradient }; } // packages/block-editor/build-module/components/font-sizes/utils.mjs var import_components6 = __toESM(require_components(), 1); var { kebabCase: kebabCase4 } = unlock(import_components6.privateApis); var getFontSize = (fontSizes, fontSizeAttribute, customFontSizeAttribute) => { if (fontSizeAttribute) { const fontSizeObject = fontSizes?.find( ({ slug }) => slug === fontSizeAttribute ); if (fontSizeObject) { return fontSizeObject; } } return { size: customFontSizeAttribute }; }; function getFontSizeObjectByValue(fontSizes, value) { const fontSizeObject = fontSizes?.find(({ size: size4 }) => size4 === value); if (fontSizeObject) { return fontSizeObject; } return { size: value }; } function getFontSizeClass(fontSizeSlug) { if (!fontSizeSlug) { return; } return `has-${kebabCase4(fontSizeSlug)}-font-size`; } // packages/block-editor/build-module/components/font-sizes/fluid-utils.mjs var DEFAULT_MAXIMUM_VIEWPORT_WIDTH2 = "1600px"; var DEFAULT_MINIMUM_VIEWPORT_WIDTH2 = "320px"; var DEFAULT_SCALE_FACTOR2 = 1; var DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN2 = 0.25; var DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX2 = 0.75; var DEFAULT_MINIMUM_FONT_SIZE_LIMIT2 = "14px"; function getComputedFluidTypographyValue2({ minimumFontSize, maximumFontSize, fontSize, minimumViewportWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH2, maximumViewportWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH2, scaleFactor = DEFAULT_SCALE_FACTOR2, minimumFontSizeLimit }) { minimumFontSizeLimit = !!getTypographyValueAndUnit2(minimumFontSizeLimit) ? minimumFontSizeLimit : DEFAULT_MINIMUM_FONT_SIZE_LIMIT2; if (fontSize) { const fontSizeParsed = getTypographyValueAndUnit2(fontSize); if (!fontSizeParsed?.unit) { return null; } const minimumFontSizeLimitParsed = getTypographyValueAndUnit2( minimumFontSizeLimit, { coerceTo: fontSizeParsed.unit } ); if (!!minimumFontSizeLimitParsed?.value && !minimumFontSize && !maximumFontSize) { if (fontSizeParsed?.value <= minimumFontSizeLimitParsed?.value) { return null; } } if (!maximumFontSize) { maximumFontSize = `${fontSizeParsed.value}${fontSizeParsed.unit}`; } if (!minimumFontSize) { const fontSizeValueInPx = fontSizeParsed.unit === "px" ? fontSizeParsed.value : fontSizeParsed.value * 16; const minimumFontSizeFactor = Math.min( Math.max( 1 - 0.075 * Math.log2(fontSizeValueInPx), DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN2 ), DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX2 ); const calculatedMinimumFontSize = roundToPrecision2( fontSizeParsed.value * minimumFontSizeFactor, 3 ); if (!!minimumFontSizeLimitParsed?.value && calculatedMinimumFontSize < minimumFontSizeLimitParsed?.value) { minimumFontSize = `${minimumFontSizeLimitParsed.value}${minimumFontSizeLimitParsed.unit}`; } else { minimumFontSize = `${calculatedMinimumFontSize}${fontSizeParsed.unit}`; } } } const minimumFontSizeParsed = getTypographyValueAndUnit2(minimumFontSize); const fontSizeUnit = minimumFontSizeParsed?.unit || "rem"; const maximumFontSizeParsed = getTypographyValueAndUnit2(maximumFontSize, { coerceTo: fontSizeUnit }); if (!minimumFontSizeParsed || !maximumFontSizeParsed) { return null; } const minimumFontSizeRem = getTypographyValueAndUnit2(minimumFontSize, { coerceTo: "rem" }); const maximumViewportWidthParsed = getTypographyValueAndUnit2( maximumViewportWidth, { coerceTo: fontSizeUnit } ); const minimumViewportWidthParsed = getTypographyValueAndUnit2( minimumViewportWidth, { coerceTo: fontSizeUnit } ); if (!maximumViewportWidthParsed || !minimumViewportWidthParsed || !minimumFontSizeRem) { return null; } const linearDenominator = maximumViewportWidthParsed.value - minimumViewportWidthParsed.value; if (!linearDenominator) { return null; } const minViewportWidthOffsetValue = roundToPrecision2( minimumViewportWidthParsed.value / 100, 3 ); const viewportWidthOffset = roundToPrecision2(minViewportWidthOffsetValue, 3) + fontSizeUnit; const linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / linearDenominator); const linearFactorScaled = roundToPrecision2( (linearFactor || 1) * scaleFactor, 3 ); const fluidTargetFontSize = `${minimumFontSizeRem.value}${minimumFontSizeRem.unit} + ((1vw - ${viewportWidthOffset}) * ${linearFactorScaled})`; return `clamp(${minimumFontSize}, ${fluidTargetFontSize}, ${maximumFontSize})`; } function getTypographyValueAndUnit2(rawValue, options = {}) { if (typeof rawValue !== "string" && typeof rawValue !== "number") { return null; } if (isFinite(rawValue)) { rawValue = `${rawValue}px`; } const { coerceTo, rootSizeValue, acceptableUnits } = { coerceTo: "", // Default browser font size. Later we could inject some JS to compute this `getComputedStyle( document.querySelector( "html" ) ).fontSize`. rootSizeValue: 16, acceptableUnits: ["rem", "px", "em"], ...options }; const acceptableUnitsGroup = acceptableUnits?.join("|"); const regexUnits = new RegExp( `^(\\d*\\.?\\d+)(${acceptableUnitsGroup}){1,1}$` ); const matches = rawValue.match(regexUnits); if (!matches || matches.length < 3) { return null; } let [, value, unit] = matches; let returnValue = parseFloat(value); if ("px" === coerceTo && ("em" === unit || "rem" === unit)) { returnValue = returnValue * rootSizeValue; unit = coerceTo; } if ("px" === unit && ("em" === coerceTo || "rem" === coerceTo)) { returnValue = returnValue / rootSizeValue; unit = coerceTo; } if (("em" === coerceTo || "rem" === coerceTo) && ("em" === unit || "rem" === unit)) { unit = coerceTo; } return { value: roundToPrecision2(returnValue, 3), unit }; } function roundToPrecision2(value, digits = 3) { const base = Math.pow(10, digits); return Number.isFinite(value) ? parseFloat(Math.round(value * base) / base) : void 0; } // packages/block-editor/build-module/components/font-sizes/font-size-picker.mjs var import_components7 = __toESM(require_components(), 1); var import_jsx_runtime123 = __toESM(require_jsx_runtime(), 1); function FontSizePicker(props) { const [fontSizes, customFontSize] = useSettings( "typography.fontSizes", "typography.customFontSize" ); return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)( import_components7.FontSizePicker, { ...props, fontSizes, disableCustomFontSizes: !customFontSize } ); } var font_size_picker_default = FontSizePicker; // packages/block-editor/build-module/components/font-sizes/with-font-sizes.mjs var import_compose3 = __toESM(require_compose(), 1); var import_element9 = __toESM(require_element(), 1); var import_jsx_runtime124 = __toESM(require_jsx_runtime(), 1); var DEFAULT_FONT_SIZES = []; var upperFirst2 = ([firstLetter, ...rest]) => firstLetter.toUpperCase() + rest.join(""); var with_font_sizes_default = (...fontSizeNames) => { const fontSizeAttributeNames = fontSizeNames.reduce( (fontSizeAttributeNamesAccumulator, fontSizeAttributeName) => { fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = `custom${upperFirst2(fontSizeAttributeName)}`; return fontSizeAttributeNamesAccumulator; }, {} ); return (0, import_compose3.createHigherOrderComponent)( (0, import_compose3.compose)([ (0, import_compose3.createHigherOrderComponent)( (WrappedComponent) => function WithFontSizesInner(props) { const [fontSizes] = useSettings( "typography.fontSizes" ); return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)( WrappedComponent, { ...props, fontSizes: fontSizes || DEFAULT_FONT_SIZES } ); }, "withFontSizes" ), (WrappedComponent) => { return class WithFontSizes extends import_element9.Component { constructor(props) { super(props); this.setters = this.createSetters(); this.state = {}; } createSetters() { return Object.entries(fontSizeAttributeNames).reduce( (settersAccumulator, [ fontSizeAttributeName, customFontSizeAttributeName ]) => { const upperFirstFontSizeAttributeName = upperFirst2(fontSizeAttributeName); settersAccumulator[`set${upperFirstFontSizeAttributeName}`] = this.createSetFontSize( fontSizeAttributeName, customFontSizeAttributeName ); return settersAccumulator; }, {} ); } createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName) { return (fontSizeValue) => { const fontSizeObject = this.props.fontSizes?.find( ({ size: size4 }) => size4 === Number(fontSizeValue) ); this.props.setAttributes({ [fontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? fontSizeObject.slug : void 0, [customFontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? void 0 : fontSizeValue }); }; } static getDerivedStateFromProps({ attributes, fontSizes }, previousState) { const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => { if (previousState[fontSizeAttributeName]) { if (attributes[fontSizeAttributeName]) { return attributes[fontSizeAttributeName] !== previousState[fontSizeAttributeName].slug; } return previousState[fontSizeAttributeName].size !== attributes[customFontSizeAttributeName]; } return true; }; if (!Object.values(fontSizeAttributeNames).some( didAttributesChange )) { return null; } const newState = Object.entries( fontSizeAttributeNames ).filter( ([key, value]) => didAttributesChange(value, key) ).reduce( (newStateAccumulator, [ fontSizeAttributeName, customFontSizeAttributeName ]) => { const fontSizeAttributeValue = attributes[fontSizeAttributeName]; const fontSizeObject = getFontSize( fontSizes, fontSizeAttributeValue, attributes[customFontSizeAttributeName] ); newStateAccumulator[fontSizeAttributeName] = { ...fontSizeObject, class: getFontSizeClass( fontSizeAttributeValue ) }; return newStateAccumulator; }, {} ); return { ...previousState, ...newState }; } render() { return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)( WrappedComponent, { ...{ ...this.props, fontSizes: void 0, ...this.state, ...this.setters } } ); } }; } ]), "withFontSizes" ); }; // packages/block-editor/build-module/components/alignment-control/ui.mjs var import_i18n8 = __toESM(require_i18n(), 1); var import_components8 = __toESM(require_components(), 1); var import_jsx_runtime125 = __toESM(require_jsx_runtime(), 1); var DEFAULT_ALIGNMENT_CONTROLS = [ { icon: align_left_default, title: (0, import_i18n8.__)("Align text left"), align: "left" }, { icon: align_center_default, title: (0, import_i18n8.__)("Align text center"), align: "center" }, { icon: align_right_default, title: (0, import_i18n8.__)("Align text right"), align: "right" } ]; var POPOVER_PROPS = { placement: "bottom-start" }; function AlignmentUI({ value, onChange, alignmentControls = DEFAULT_ALIGNMENT_CONTROLS, label = (0, import_i18n8.__)("Align text"), description = (0, import_i18n8.__)("Change text alignment"), isCollapsed: isCollapsed3 = true, isToolbar }) { function applyOrUnset(align) { return () => onChange(value === align ? void 0 : align); } const activeAlignment = alignmentControls.find( (control) => control.align === value ); function setIcon() { if (activeAlignment) { return activeAlignment.icon; } return (0, import_i18n8.isRTL)() ? align_right_default : align_left_default; } const UIComponent = isToolbar ? import_components8.ToolbarGroup : import_components8.ToolbarDropdownMenu; const extraProps = isToolbar ? { isCollapsed: isCollapsed3 } : { toggleProps: { description }, popoverProps: POPOVER_PROPS }; return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)( UIComponent, { icon: setIcon(), label, controls: alignmentControls.map((control) => { const { align } = control; const isActive = value === align; return { ...control, isActive, role: isCollapsed3 ? "menuitemradio" : void 0, onClick: applyOrUnset(align) }; }), ...extraProps } ); } var ui_default = AlignmentUI; // packages/block-editor/build-module/components/alignment-control/index.mjs var import_jsx_runtime126 = __toESM(require_jsx_runtime(), 1); var AlignmentControl = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(ui_default, { ...props, isToolbar: false }); }; var AlignmentToolbar = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(ui_default, { ...props, isToolbar: true }); }; // packages/block-editor/build-module/components/autocomplete/index.mjs var import_hooks3 = __toESM(require_hooks(), 1); var import_components10 = __toESM(require_components(), 1); var import_element13 = __toESM(require_element(), 1); var import_blocks13 = __toESM(require_blocks(), 1); // packages/block-editor/build-module/autocompleters/block.mjs var import_data11 = __toESM(require_data(), 1); var import_blocks12 = __toESM(require_blocks(), 1); var import_element12 = __toESM(require_element(), 1); // packages/block-editor/build-module/components/inserter/search-items.mjs var import_remove_accents = __toESM(require_remove_accents(), 1); // node_modules/tslib/tslib.es6.mjs var extendStatics = function(d2, b2) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) { d3.__proto__ = b3; } || function(d3, b3) { for (var p2 in b3) if (Object.prototype.hasOwnProperty.call(b3, p2)) d3[p2] = b3[p2]; }; return extendStatics(d2, b2); }; function __extends(d2, b2) { if (typeof b2 !== "function" && b2 !== null) throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null"); extendStatics(d2, b2); function __232() { this.constructor = d2; } d2.prototype = b2 === null ? Object.create(b2) : (__232.prototype = b2.prototype, new __232()); } var __assign = function() { __assign = Object.assign || function __assign2(t3) { for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { s2 = arguments[i2]; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t3[p2] = s2[p2]; } return t3; }; return __assign.apply(this, arguments); }; // node_modules/lower-case/dist.es2015/index.js function lowerCase(str) { return str.toLowerCase(); } // node_modules/no-case/dist.es2015/index.js var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; function noCase(input, options) { if (options === void 0) { options = {}; } var _a = options.splitRegexp, splitRegexp2 = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp2 = _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, splitRegexp2, "$1\0$2"), stripRegexp2, "\0"); var start2 = 0; var end = result.length; while (result.charAt(start2) === "\0") start2++; while (result.charAt(end - 1) === "\0") end--; return result.slice(start2, end).split("\0").map(transform).join(delimiter); } function replace(input, re, value) { if (re instanceof RegExp) return input.replace(re, value); return re.reduce(function(input2, re2) { return input2.replace(re2, value); }, input); } // packages/block-editor/build-module/components/inserter/search-items.mjs var defaultGetName = (item) => item.name || ""; var defaultGetTitle = (item) => item.title; var defaultGetDescription = (item) => item.description || ""; var defaultGetKeywords = (item) => item.keywords || []; var defaultGetCategory = (item) => item.category; var defaultGetCollection = () => null; var splitRegexp = [ /([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu, // One lowercase or digit, followed by one uppercase. /([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu // One uppercase followed by one uppercase and one lowercase. ]; var stripRegexp = new RegExp("(\\p{C}|\\p{P}|\\p{S})+", "giu"); var extractedWords = /* @__PURE__ */ new Map(); var normalizedStrings = /* @__PURE__ */ new Map(); function extractWords(input = "") { if (extractedWords.has(input)) { return extractedWords.get(input); } const result = noCase(input, { splitRegexp, stripRegexp }).split(" ").filter(Boolean); extractedWords.set(input, result); return result; } function normalizeString(input = "") { if (normalizedStrings.has(input)) { return normalizedStrings.get(input); } let result = (0, import_remove_accents.default)(input); result = result.replace(/^\//, ""); result = result.toLowerCase(); normalizedStrings.set(input, result); return result; } var getNormalizedSearchTerms = (input = "") => { return extractWords(normalizeString(input)); }; var removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => { return unmatchedTerms.filter( (term) => !getNormalizedSearchTerms(unprocessedTerms).some( (unprocessedTerm) => unprocessedTerm.includes(term) ) ); }; var searchBlockItems = (items, categories, collections, searchInput) => { const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); if (normalizedSearchTerms.length === 0) { return items; } const config2 = { getCategory: (item) => categories.find(({ slug }) => slug === item.category)?.title, getCollection: (item) => collections[item.name.split("/")[0]]?.title }; return searchItems(items, searchInput, config2); }; var searchItems = (items = [], searchInput = "", config2 = {}) => { const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); if (normalizedSearchTerms.length === 0) { return items; } const rankedItems = items.map((item) => { return [item, getItemSearchRank(item, searchInput, config2)]; }).filter(([, rank]) => rank > 0); rankedItems.sort(([, rank1], [, rank2]) => rank2 - rank1); return rankedItems.map(([item]) => item); }; function getItemSearchRank(item, searchTerm, config2 = {}) { const { getName = defaultGetName, getTitle = defaultGetTitle, getDescription = defaultGetDescription, getKeywords = defaultGetKeywords, getCategory = defaultGetCategory, getCollection = defaultGetCollection } = config2; const name = getName(item); const title = getTitle(item); const description = getDescription(item); const keywords = getKeywords(item); const category = getCategory(item); const collection = getCollection(item); const normalizedSearchInput = normalizeString(searchTerm); const normalizedTitle = normalizeString(title); let rank = 0; if (normalizedSearchInput === normalizedTitle) { rank += 30; } else if (normalizedTitle.startsWith(normalizedSearchInput)) { rank += 20; } else { const terms = [ name, title, description, ...keywords, category, collection ].join(" "); const normalizedSearchTerms = extractWords(normalizedSearchInput); const unmatchedTerms = removeMatchingTerms( normalizedSearchTerms, terms ); if (unmatchedTerms.length === 0) { rank += 10; } } if (rank !== 0 && name.startsWith("core/")) { const isCoreBlockVariation = name !== item.id; rank += isCoreBlockVariation ? 1 : 2; } return rank; } // packages/block-editor/build-module/components/inserter/hooks/use-block-types-state.mjs var import_blocks11 = __toESM(require_blocks(), 1); var import_data10 = __toESM(require_data(), 1); var import_element10 = __toESM(require_element(), 1); var import_notices2 = __toESM(require_notices(), 1); var import_i18n9 = __toESM(require_i18n(), 1); var useBlockTypesState = (rootClientId, onInsert, isQuick) => { const options = (0, import_element10.useMemo)( () => ({ [isFiltered]: !!isQuick }), [isQuick] ); const [items] = (0, import_data10.useSelect)( (select3) => [ select3(store).getInserterItems( rootClientId, options ) ], [rootClientId, options] ); const { getClosestAllowedInsertionPoint: getClosestAllowedInsertionPoint2 } = unlock( (0, import_data10.useSelect)(store) ); const { createErrorNotice } = (0, import_data10.useDispatch)(import_notices2.store); const [categories, collections] = (0, import_data10.useSelect)((select3) => { const { getCategories, getCollections } = select3(import_blocks11.store); return [getCategories(), getCollections()]; }, []); const onSelectItem = (0, import_element10.useCallback)( ({ name, initialAttributes, innerBlocks, innerContent, syncStatus, content }, shouldFocusBlock) => { const destinationClientId = getClosestAllowedInsertionPoint2( name, rootClientId ); if (destinationClientId === null) { const title = (0, import_blocks11.getBlockType)(name)?.title ?? name; createErrorNotice( (0, import_i18n9.sprintf)( /* translators: %s: block pattern title. */ (0, import_i18n9.__)(`Block "%s" can't be inserted.`), title ), { type: "snackbar", id: "inserter-notice" } ); return; } const insertedBlock = syncStatus === "unsynced" ? (0, import_blocks11.parse)(content, { __unstableSkipMigrationLogs: true }) : (0, import_blocks11.createBlock)( name, initialAttributes, (0, import_blocks11.createBlocksFromInnerBlocksTemplate)(innerBlocks), innerContent ); onInsert( insertedBlock, void 0, shouldFocusBlock, destinationClientId ); }, [ getClosestAllowedInsertionPoint2, rootClientId, onInsert, createErrorNotice ] ); return [items, categories, collections, onSelectItem]; }; var use_block_types_state_default = useBlockTypesState; // packages/block-editor/build-module/components/block-icon/index.mjs var import_components9 = __toESM(require_components(), 1); var import_element11 = __toESM(require_element(), 1); var import_jsx_runtime127 = __toESM(require_jsx_runtime(), 1); function BlockIcon({ icon, showColors = false, className, context }) { if (icon?.src === "block-default") { icon = { src: block_default_default }; } const renderedIcon = /* @__PURE__ */ (0, import_jsx_runtime127.jsx)( import_components9.Icon, { icon: icon && icon.src ? icon.src : icon, context } ); const style = showColors ? { backgroundColor: icon && icon.background, color: icon && icon.foreground } : {}; return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)( "span", { style, className: clsx_default("block-editor-block-icon", className, { "has-colors": showColors }), children: renderedIcon } ); } var block_icon_default = (0, import_element11.memo)(BlockIcon); // packages/block-editor/build-module/utils/order-inserter-block-items.mjs var orderInserterBlockItems = (items, priority2) => { if (!priority2) { return items; } items.sort(({ id: aName }, { id: bName }) => { let aIndex = priority2.indexOf(aName); let bIndex = priority2.indexOf(bName); if (aIndex < 0) { aIndex = priority2.length; } if (bIndex < 0) { bIndex = priority2.length; } return aIndex - bIndex; }); return items; }; // packages/block-editor/build-module/autocompleters/block.mjs var import_jsx_runtime128 = __toESM(require_jsx_runtime(), 1); var noop = () => { }; var SHOWN_BLOCK_TYPES = 9; function createBlockCompleter() { return { name: "blocks", className: "block-editor-autocompleters__block", triggerPrefix: "/", useItems(filterValue) { const { rootClientId, selectedBlockId, prioritizedBlocks } = (0, import_data11.useSelect)((select3) => { const { getSelectedBlockClientId: getSelectedBlockClientId2, getBlock: getBlock2, getBlockListSettings: getBlockListSettings2, getBlockRootClientId: getBlockRootClientId2 } = select3(store); const { getActiveBlockVariation } = select3(import_blocks12.store); const selectedBlockClientId = getSelectedBlockClientId2(); const { name: blockName, attributes } = getBlock2( selectedBlockClientId ); const activeBlockVariation = getActiveBlockVariation( blockName, attributes ); const _rootClientId = getBlockRootClientId2( selectedBlockClientId ); return { selectedBlockId: activeBlockVariation ? `${blockName}/${activeBlockVariation.name}` : blockName, rootClientId: _rootClientId, prioritizedBlocks: getBlockListSettings2(_rootClientId)?.prioritizedInserterBlocks }; }, []); const [items, categories, collections] = use_block_types_state_default( rootClientId, noop, true ); const filteredItems = (0, import_element12.useMemo)(() => { const initialFilteredItems = !!filterValue.trim() ? searchBlockItems( items, categories, collections, filterValue ) : orderInserterBlockItems( orderBy(items, "frecency", "desc"), prioritizedBlocks ); return initialFilteredItems.filter((item) => item.id !== selectedBlockId).slice(0, SHOWN_BLOCK_TYPES); }, [ filterValue, selectedBlockId, items, categories, collections, prioritizedBlocks ]); const options = (0, import_element12.useMemo)( () => filteredItems.map((blockItem) => { const { title, icon, isDisabled } = blockItem; return { key: `block-${blockItem.id}`, value: blockItem, label: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)( block_icon_default, { icon, showColors: true }, "icon" ), title ] }), isDisabled }; }), [filteredItems] ); return [options]; }, allowContext(before, after) { return !(/\S/.test(before) || /\S/.test(after)); }, getOptionCompletion(inserterItem) { const { name, initialAttributes, innerBlocks, innerContent, syncStatus, blocks: blocks2 } = inserterItem; return { action: "replace", value: syncStatus === "unsynced" ? (blocks2 ?? []).map( (block) => (0, import_blocks12.cloneBlock)(block) ) : (0, import_blocks12.createBlock)( name, initialAttributes, (0, import_blocks12.createBlocksFromInnerBlocksTemplate)( innerBlocks ), innerContent ) }; } }; } var block_default = createBlockCompleter(); // packages/block-editor/build-module/components/autocomplete/index.mjs var import_jsx_runtime129 = __toESM(require_jsx_runtime(), 1); var EMPTY_ARRAY3 = []; function useCompleters({ completers = EMPTY_ARRAY3 }) { const { name } = useBlockEditContext(); return (0, import_element13.useMemo)(() => { let filteredCompleters = [...completers]; if (name === (0, import_blocks13.getDefaultBlockName)() || (0, import_blocks13.getBlockSupport)(name, "__experimentalSlashInserter", false)) { filteredCompleters = [...filteredCompleters, block_default]; } if ((0, import_hooks3.hasFilter)("editor.Autocomplete.completers")) { if (filteredCompleters === completers) { filteredCompleters = filteredCompleters.map( (completer) => ({ ...completer }) ); } filteredCompleters = (0, import_hooks3.applyFilters)( "editor.Autocomplete.completers", filteredCompleters, name ); } return filteredCompleters; }, [completers, name]); } function useBlockEditorAutocompleteProps(props) { return (0, import_components10.__unstableUseAutocompleteProps)({ ...props, completers: useCompleters(props) }); } function BlockEditorAutocomplete(props) { return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_components10.Autocomplete, { ...props, completers: useCompleters(props) }); } var autocomplete_default = BlockEditorAutocomplete; // packages/block-editor/build-module/components/block-alignment-control/ui.mjs var import_i18n17 = __toESM(require_i18n(), 1); var import_components16 = __toESM(require_components(), 1); // packages/block-editor/build-module/components/block-alignment-control/use-available-alignments.mjs var import_data12 = __toESM(require_data(), 1); // packages/block-editor/build-module/components/block-list/layout.mjs var import_element15 = __toESM(require_element(), 1); // packages/block-editor/build-module/layouts/flex.mjs var import_i18n12 = __toESM(require_i18n(), 1); var import_components11 = __toESM(require_components(), 1); // packages/block-editor/build-module/layouts/utils.mjs var import_i18n10 = __toESM(require_i18n(), 1); // packages/block-editor/build-module/layouts/definitions.mjs var LAYOUT_DEFINITIONS2 = { default: { name: "default", slug: "flow", className: "is-layout-flow", baseStyles: [ { selector: " > .alignleft", rules: { float: "left", "margin-inline-start": "0", "margin-inline-end": "2em" } }, { selector: " > .alignright", rules: { float: "right", "margin-inline-start": "2em", "margin-inline-end": "0" } }, { selector: " > .aligncenter", rules: { "margin-left": "auto !important", "margin-right": "auto !important" } } ], spacingStyles: [ { selector: " > :first-child", rules: { "margin-block-start": "0" } }, { selector: " > :last-child", rules: { "margin-block-end": "0" } }, { selector: " > *", rules: { "margin-block-start": null, "margin-block-end": "0" } } ] }, constrained: { name: "constrained", slug: "constrained", className: "is-layout-constrained", baseStyles: [ { selector: " > .alignleft", rules: { float: "left", "margin-inline-start": "0", "margin-inline-end": "2em" } }, { selector: " > .alignright", rules: { float: "right", "margin-inline-start": "2em", "margin-inline-end": "0" } }, { selector: " > .aligncenter", rules: { "margin-left": "auto !important", "margin-right": "auto !important" } }, { selector: " > :where(:not(.alignleft):not(.alignright):not(.alignfull))", rules: { "max-width": "var(--wp--style--global--content-size)", "margin-left": "auto !important", "margin-right": "auto !important" } }, { selector: " > .alignwide", rules: { "max-width": "var(--wp--style--global--wide-size)" } } ], spacingStyles: [ { selector: " > :first-child", rules: { "margin-block-start": "0" } }, { selector: " > :last-child", rules: { "margin-block-end": "0" } }, { selector: " > *", rules: { "margin-block-start": null, "margin-block-end": "0" } } ] }, flex: { name: "flex", slug: "flex", className: "is-layout-flex", displayMode: "flex", baseStyles: [ { selector: "", rules: { "flex-wrap": "wrap", "align-items": "center" } }, { selector: " > :is(*, div)", // :is(*, div) instead of just * increases the specificity by 001. rules: { margin: "0" } } ], spacingStyles: [ { selector: "", rules: { gap: null } } ] }, grid: { name: "grid", slug: "grid", className: "is-layout-grid", displayMode: "grid", baseStyles: [ { selector: " > :is(*, div)", // :is(*, div) instead of just * increases the specificity by 001. rules: { margin: "0" } } ], spacingStyles: [ { selector: "", rules: { gap: null } } ] } }; // packages/block-editor/build-module/layouts/utils.mjs function appendSelectors(selectors4, append = "") { return selectors4.split(",").map( (subselector) => `${subselector}${append ? ` ${append}` : ""}` ).join(","); } function getBlockGapCSS(selector3, layoutDefinitions = LAYOUT_DEFINITIONS2, layoutType, blockGapValue) { let output = ""; if (layoutDefinitions?.[layoutType]?.spacingStyles?.length && blockGapValue) { layoutDefinitions[layoutType].spacingStyles.forEach((gapStyle) => { output += `${appendSelectors( selector3, gapStyle.selector.trim() )} { `; output += Object.entries(gapStyle.rules).map( ([cssProperty, value]) => `${cssProperty}: ${value ? value : blockGapValue}` ).join("; "); output += "; }"; }); } return output; } function getAlignmentsInfo(layout) { const { contentSize, wideSize, type = "default" } = layout; const alignmentInfo = {}; const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i; if (sizeRegex.test(contentSize) && type === "constrained") { alignmentInfo.none = (0, import_i18n10.sprintf)((0, import_i18n10.__)("Max %s wide"), contentSize); } if (sizeRegex.test(wideSize)) { alignmentInfo.wide = (0, import_i18n10.sprintf)((0, import_i18n10.__)("Max %s wide"), wideSize); } return alignmentInfo; } // packages/block-editor/build-module/components/spacing-sizes-control/utils.mjs var import_i18n11 = __toESM(require_i18n(), 1); var RANGE_CONTROL_MAX_SIZE = 8; var ALL_SIDES = ["top", "bottom", "left", "right"]; var DEFAULT_VALUES = { top: void 0, right: void 0, bottom: void 0, left: void 0 }; var ICONS = { custom: sides_all_default, axial: sides_all_default, horizontal: sides_horizontal_default, vertical: sides_vertical_default, top: sides_top_default, right: sides_right_default, bottom: sides_bottom_default, left: sides_left_default }; var LABELS = { default: (0, import_i18n11.__)("Spacing control"), top: (0, import_i18n11.__)("Top"), bottom: (0, import_i18n11.__)("Bottom"), left: (0, import_i18n11.__)("Left"), right: (0, import_i18n11.__)("Right"), mixed: (0, import_i18n11.__)("Mixed"), vertical: (0, import_i18n11.__)("Vertical"), horizontal: (0, import_i18n11.__)("Horizontal"), axial: (0, import_i18n11.__)("Horizontal & vertical"), custom: (0, import_i18n11.__)("Custom") }; var VIEWS = { axial: "axial", top: "top", right: "right", bottom: "bottom", left: "left", custom: "custom" }; function isValueSpacingPreset(value) { if (!value?.includes) { return false; } return value === "0" || value.includes("var:preset|spacing|"); } function getCustomValueFromPreset(value, spacingSizes) { if (!isValueSpacingPreset(value)) { return value; } const slug = getSpacingPresetSlug(value); const spacingSize = spacingSizes.find( (size4) => String(size4.slug) === slug ); return spacingSize?.size; } function getPresetValueFromCustomValue(value, spacingSizes) { if (!value || isValueSpacingPreset(value) || value === "0") { return value; } const spacingMatch = spacingSizes.find( (size4) => String(size4.size) === String(value) ); if (spacingMatch?.slug) { return `var:preset|spacing|${spacingMatch.slug}`; } return value; } function getSpacingPresetCssVar2(value) { if (!value || typeof value !== "string") { return; } const slug = value.match(/var:preset\|spacing\|(.+)/); if (!slug) { return value; } return `var(--wp--preset--spacing--${slug[1]})`; } function getSpacingPresetSlug(value) { if (!value) { return; } if (value === "0" || value === "default") { return value; } const slug = value.match(/var:preset\|spacing\|(.+)/); return slug ? slug[1] : void 0; } function hasAxisSupport(sides2, axis) { if (!sides2 || !sides2.length) { return false; } const hasHorizontalSupport = sides2.includes("horizontal") || sides2.includes("left") && sides2.includes("right"); const hasVerticalSupport = sides2.includes("vertical") || sides2.includes("top") && sides2.includes("bottom"); if (axis === "horizontal") { return hasHorizontalSupport; } if (axis === "vertical") { return hasVerticalSupport; } return hasHorizontalSupport || hasVerticalSupport; } function hasBalancedSidesSupport(sides2 = []) { const counts = { top: 0, right: 0, bottom: 0, left: 0 }; sides2.forEach((side) => counts[side] += 1); return (counts.top + counts.bottom) % 2 === 0 && (counts.left + counts.right) % 2 === 0; } function getInitialView(values = {}, sides2) { const { top, right, bottom, left } = values; const sideValues = [top, right, bottom, left].filter(Boolean); const hasMatchingAxialValues = top === bottom && left === right && (!!top || !!left); const hasNoValuesAndBalancedSides = !sideValues.length && hasBalancedSidesSupport(sides2); const hasOnlyAxialSides = sides2?.includes("horizontal") && sides2?.includes("vertical") && sides2?.length === 2; if (hasAxisSupport(sides2) && (hasMatchingAxialValues || hasNoValuesAndBalancedSides)) { return VIEWS.axial; } if (hasOnlyAxialSides && sideValues.length === 1) { let side; Object.entries(values).some(([key, value]) => { side = key; return value !== void 0; }); return side; } if (sides2?.length === 1 && !sideValues.length) { return sides2[0]; } return VIEWS.custom; } // packages/block-editor/build-module/hooks/gap.mjs function getGapBoxControlValueFromStyle2(blockGapValue) { if (!blockGapValue) { return null; } const isValueString = typeof blockGapValue === "string"; return { top: isValueString ? blockGapValue : blockGapValue?.top, left: isValueString ? blockGapValue : blockGapValue?.left }; } function getGapCSSValue2(blockGapValue, defaultValue = "0") { const blockGapBoxControlValue = getGapBoxControlValueFromStyle2(blockGapValue); if (!blockGapBoxControlValue) { return null; } const row = getSpacingPresetCssVar2(blockGapBoxControlValue?.top) || defaultValue; const column = getSpacingPresetCssVar2(blockGapBoxControlValue?.left) || defaultValue; return row === column ? row : `${row} ${column}`; } // packages/block-editor/build-module/layouts/flex.mjs var import_jsx_runtime130 = __toESM(require_jsx_runtime(), 1); var justifyContentMap = { left: "flex-start", right: "flex-end", center: "center", "space-between": "space-between" }; var alignItemsMap = { left: "flex-start", right: "flex-end", center: "center", stretch: "stretch" }; var verticalAlignmentMap = { top: "flex-start", center: "center", bottom: "flex-end", stretch: "stretch", "space-between": "space-between" }; var defaultAlignments = { horizontal: "center", vertical: "top" }; var verticalAlignmentOptions = { top: { icon: justify_top_default, label: (0, import_i18n12._x)("Align top", "Block vertical alignment setting") }, center: { icon: justify_center_vertical_default, label: (0, import_i18n12._x)("Align middle", "Block vertical alignment setting") }, bottom: { icon: justify_bottom_default, label: (0, import_i18n12._x)("Align bottom", "Block vertical alignment setting") }, stretch: { icon: justify_stretch_vertical_default, label: (0, import_i18n12._x)("Stretch to fill", "Block vertical alignment setting") }, "space-between": { icon: justify_space_between_vertical_default, label: (0, import_i18n12._x)("Space between", "Block vertical alignment setting") } }; var flexWrapOptions = ["wrap", "nowrap"]; var flex_default = { name: "flex", label: (0, import_i18n12.__)("Flex"), inspectorControls: function FlexLayoutInspectorControls({ layout = {}, onChange, layoutBlockSupport = {}, resetLayout = {}, clientId }) { const { allowOrientation = true, allowJustification = true, allowVerticalAlignment = true, allowWrap = true } = layoutBlockSupport; const hasLayoutValue = (key, defaultValue) => (layout?.[key] ?? defaultValue) !== (resetLayout?.[key] ?? defaultValue); const hasJustificationValue = () => hasLayoutValue("justifyContent", "left"); const hasVerticalAlignmentValue = () => hasLayoutValue( "verticalAlignment", getDefaultVerticalAlignment(layout) ); const hasOrientationValue = () => hasLayoutValue("orientation", "horizontal"); const hasWrapValue = () => hasLayoutValue("flexWrap", "wrap"); const resetJustification = () => onChange( cleanEmptyObject({ ...layout, justifyContent: resetLayout?.justifyContent }) ); const resetVerticalAlignment = () => onChange( cleanEmptyObject({ ...layout, verticalAlignment: getCompatibleVerticalAlignment( resetLayout?.verticalAlignment, layout?.orientation ) }) ); const resetOrientation = () => { const { verticalAlignment, justifyContent } = layout; const nextOrientation = resetLayout?.orientation; const isHorizontal = !nextOrientation || nextOrientation === "horizontal"; onChange( cleanEmptyObject({ ...layout, orientation: nextOrientation, verticalAlignment: resetLayout?.verticalAlignment ?? (isHorizontal && verticalAlignment === "space-between" ? "center" : verticalAlignment), justifyContent: resetLayout?.justifyContent ?? (isHorizontal && justifyContent === "stretch" ? "left" : justifyContent) }) ); }; const resetWrap = () => onChange( cleanEmptyObject({ ...layout, flexWrap: resetLayout?.flexWrap }) ); return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [ (allowJustification || allowOrientation) && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)( import_components11.Flex, { align: "flex-start", className: "block-editor-hooks__flex-layout-controls", gap: 4, justify: "flex-start", children: [ allowJustification && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components11.__experimentalToolsPanelItem, { label: (0, import_i18n12.__)("Justification"), hasValue: hasJustificationValue, onDeselect: resetJustification, isShownByDefault: true, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( FlexLayoutJustifyContentControl, { layout, onChange } ) } ), allowOrientation && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components11.__experimentalToolsPanelItem, { label: (0, import_i18n12.__)("Orientation"), hasValue: hasOrientationValue, onDeselect: resetOrientation, isShownByDefault: true, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( OrientationControl, { layout, onChange } ) } ) ] } ), allowVerticalAlignment && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components11.__experimentalToolsPanelItem, { label: (0, import_i18n12.__)("Alignment"), hasValue: hasVerticalAlignmentValue, onDeselect: resetVerticalAlignment, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( FlexLayoutVerticalAlignmentControl, { layout, onChange } ) } ), allowWrap && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components11.__experimentalToolsPanelItem, { label: (0, import_i18n12.__)("Wrapping"), hasValue: hasWrapValue, onDeselect: resetWrap, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( FlexWrapControl, { layout, onChange } ) } ) ] }); }, toolBarControls: function FlexLayoutToolbarControls({ layout = {}, onChange, layoutBlockSupport, controlsGroup = "block" }) { const { allowVerticalAlignment = true, allowJustification = true } = layoutBlockSupport; if (!allowJustification && !allowVerticalAlignment) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)( block_controls_default, { group: controlsGroup, __experimentalShareWithChildBlocks: true, children: [ allowJustification && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( FlexLayoutJustifyContentControl, { layout, onChange, isToolbar: true } ), allowVerticalAlignment && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( FlexLayoutVerticalAlignmentControl, { layout, onChange, isToolbar: true } ) ] } ); }, getLayoutStyle: function getLayoutStyle({ selector: selector3, layout = {}, viewportOverrides, style, blockName, hasBlockGapSupport, globalBlockGapValue, layoutDefinitions = LAYOUT_DEFINITIONS2 }) { const hasViewportOverrides = viewportOverrides !== void 0; const effectiveLayout = hasViewportOverrides ? { ...layout, ...viewportOverrides } : layout; const hasViewportOverride = (key) => Object.hasOwn(viewportOverrides || {}, key); const { orientation = "horizontal" } = effectiveLayout; let fallbackGapValue = "0.5em"; if (globalBlockGapValue) { const gapBox = getGapBoxControlValueFromStyle2(globalBlockGapValue); fallbackGapValue = getSpacingPresetCssVar2(gapBox?.left) || getSpacingPresetCssVar2(gapBox?.top) || "0.5em"; } const blockGapValue = style?.spacing?.blockGap && !shouldSkipSerialization(blockName, "spacing", "blockGap") ? getGapCSSValue2(style?.spacing?.blockGap, fallbackGapValue) : void 0; const hasBlockGapOverride = !hasViewportOverrides || Object.hasOwn(style?.spacing || {}, "blockGap"); const justifyContent = justifyContentMap[effectiveLayout.justifyContent]; const flexWrap = flexWrapOptions.includes(effectiveLayout.flexWrap) ? effectiveLayout.flexWrap : "wrap"; const verticalAlignment = verticalAlignmentMap[effectiveLayout.verticalAlignment]; const alignItems = alignItemsMap[effectiveLayout.justifyContent] || alignItemsMap.left; let output = ""; const rules = []; const shouldOutputFlexWrap = !hasViewportOverrides || hasViewportOverride("flexWrap"); const shouldOutputFlexOrientation = !hasViewportOverrides || hasViewportOverride("orientation"); const shouldOutputFlexJustification = !hasViewportOverrides || hasViewportOverride("justifyContent") || hasViewportOverride("orientation"); const shouldOutputFlexAlignment = !hasViewportOverrides || hasViewportOverride("verticalAlignment") || hasViewportOverride("orientation"); if (shouldOutputFlexWrap && flexWrap && flexWrap !== "wrap") { rules.push(`flex-wrap: ${flexWrap}`); } if (orientation === "horizontal") { if (shouldOutputFlexAlignment && verticalAlignment) { rules.push(`align-items: ${verticalAlignment}`); } if (shouldOutputFlexJustification && justifyContent) { rules.push(`justify-content: ${justifyContent}`); } } else { if (shouldOutputFlexAlignment && verticalAlignment) { rules.push(`justify-content: ${verticalAlignment}`); } if (shouldOutputFlexOrientation) { rules.push("flex-direction: column"); } if (shouldOutputFlexJustification) { rules.push(`align-items: ${alignItems}`); } } if (rules.length) { output = `${appendSelectors(selector3)} { ${rules.join("; ")}; }`; } if (hasBlockGapSupport && hasBlockGapOverride && blockGapValue) { output += getBlockGapCSS( selector3, layoutDefinitions, "flex", blockGapValue ); } return output; }, getOrientation(layout) { const { orientation = "horizontal" } = layout; return orientation; }, getAlignments() { return []; } }; function getDefaultVerticalAlignment({ orientation = "horizontal" } = {}) { return orientation === "horizontal" ? defaultAlignments.horizontal : defaultAlignments.vertical; } function getCompatibleVerticalAlignment(verticalAlignment, orientation) { if (orientation === "horizontal" && verticalAlignment === "space-between" || orientation === "vertical" && verticalAlignment === "stretch") { return void 0; } return verticalAlignment; } function getVerticalAlignmentControls(orientation) { return orientation === "horizontal" ? ["top", "center", "bottom", "stretch"] : ["top", "center", "bottom", "space-between"]; } function FlexLayoutVerticalAlignmentControl({ layout, onChange, isToolbar = false }) { const { orientation = "horizontal" } = layout; const { verticalAlignment = getDefaultVerticalAlignment(layout) } = layout; const onVerticalAlignmentChange = (value) => { onChange({ ...layout, verticalAlignment: value }); }; const controls = getVerticalAlignmentControls(orientation); if (isToolbar) { return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( BlockVerticalAlignmentControl, { onChange: onVerticalAlignmentChange, value: verticalAlignment, controls } ); } return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components11.__experimentalToggleGroupControl, { label: (0, import_i18n12.__)("Alignment"), onChange: onVerticalAlignmentChange, value: verticalAlignment, className: "block-editor-hooks__flex-layout-alignment-controls", children: controls.map((control) => { const { icon, label } = verticalAlignmentOptions[control]; return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components11.__experimentalToggleGroupControlOptionIcon, { value: control, icon, label }, control ); }) } ); } var POPOVER_PROPS2 = { placement: "bottom-start" }; function FlexLayoutJustifyContentControl({ layout, onChange, isToolbar = false }) { const { justifyContent = "left", orientation = "horizontal" } = layout; const onJustificationChange = (value) => { onChange({ ...layout, justifyContent: value }); }; const allowedControls = ["left", "center", "right"]; if (orientation === "horizontal") { allowedControls.push("space-between"); } else { allowedControls.push("stretch"); } if (isToolbar) { return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( JustifyContentControl, { allowedControls, value: justifyContent, onChange: onJustificationChange, popoverProps: POPOVER_PROPS2 } ); } const justificationOptions = [ { value: "left", icon: justify_left_default, label: (0, import_i18n12.__)("Justify items left") }, { value: "center", icon: justify_center_default, label: (0, import_i18n12.__)("Justify items center") }, { value: "right", icon: justify_right_default, label: (0, import_i18n12.__)("Justify items right") } ]; if (orientation === "horizontal") { justificationOptions.push({ value: "space-between", icon: justify_space_between_default, label: (0, import_i18n12.__)("Space between items") }); } else { justificationOptions.push({ value: "stretch", icon: justify_stretch_default, label: (0, import_i18n12.__)("Stretch items") }); } return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components11.__experimentalToggleGroupControl, { label: (0, import_i18n12.__)("Justification"), value: justifyContent, onChange: onJustificationChange, className: "block-editor-hooks__flex-layout-justification-controls", children: justificationOptions.map(({ value, icon, label }) => { return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components11.__experimentalToggleGroupControlOptionIcon, { value, icon, label }, value ); }) } ); } function FlexWrapControl({ layout, onChange }) { const { flexWrap = "wrap" } = layout; return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components11.ToggleControl, { label: (0, import_i18n12.__)("Allow to wrap to multiple lines"), onChange: (value) => { onChange({ ...layout, flexWrap: value ? "wrap" : "nowrap" }); }, checked: flexWrap === "wrap" } ); } function OrientationControl({ layout, onChange }) { const { orientation = "horizontal", verticalAlignment, justifyContent } = layout; return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)( import_components11.__experimentalToggleGroupControl, { className: "block-editor-hooks__flex-layout-orientation-controls", label: (0, import_i18n12.__)("Orientation"), value: orientation, onChange: (value) => { let newVerticalAlignment = verticalAlignment; let newJustification = justifyContent; if (value === "horizontal") { if (verticalAlignment === "space-between") { newVerticalAlignment = "center"; } if (justifyContent === "stretch") { newJustification = "left"; } } else { if (verticalAlignment === "stretch") { newVerticalAlignment = "top"; } if (justifyContent === "space-between") { newJustification = "left"; } } return onChange({ ...layout, orientation: value, verticalAlignment: newVerticalAlignment, justifyContent: newJustification }); }, children: [ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components11.__experimentalToggleGroupControlOptionIcon, { icon: arrow_right_default, value: "horizontal", label: (0, import_i18n12.__)("Horizontal") } ), /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components11.__experimentalToggleGroupControlOptionIcon, { icon: arrow_down_default, value: "vertical", label: (0, import_i18n12.__)("Vertical") } ) ] } ); } // packages/block-editor/build-module/layouts/flow.mjs var import_i18n13 = __toESM(require_i18n(), 1); var flow_default = { name: "default", label: (0, import_i18n13.__)("Flow"), inspectorControls: function DefaultLayoutInspectorControls() { return null; }, toolBarControls: function DefaultLayoutToolbarControls() { return null; }, getLayoutStyle: function getLayoutStyle2({ selector: selector3, style, blockName, hasBlockGapSupport, layoutDefinitions = LAYOUT_DEFINITIONS2 }) { const blockGapStyleValue = getGapCSSValue2(style?.spacing?.blockGap); let blockGapValue = ""; if (!shouldSkipSerialization(blockName, "spacing", "blockGap")) { if (blockGapStyleValue?.top) { blockGapValue = getGapCSSValue2(blockGapStyleValue?.top); } else if (typeof blockGapStyleValue === "string") { blockGapValue = getGapCSSValue2(blockGapStyleValue); } } let output = ""; if (hasBlockGapSupport && blockGapValue) { output += getBlockGapCSS( selector3, layoutDefinitions, "default", blockGapValue ); } return output; }, getOrientation() { return "vertical"; }, getAlignments(layout, isBlockBasedTheme) { const alignmentInfo = getAlignmentsInfo(layout); if (layout.alignments !== void 0) { if (!layout.alignments.includes("none")) { layout.alignments.unshift("none"); } return layout.alignments.map((alignment) => ({ name: alignment, info: alignmentInfo[alignment] })); } const alignments = [ { name: "left" }, { name: "center" }, { name: "right" } ]; if (!isBlockBasedTheme) { const { contentSize, wideSize } = layout; if (contentSize) { alignments.unshift({ name: "full" }); } if (wideSize) { alignments.unshift({ name: "wide", info: alignmentInfo.wide }); } } alignments.unshift({ name: "none", info: alignmentInfo.none }); return alignments; } }; // packages/block-editor/build-module/layouts/constrained.mjs var import_components13 = __toESM(require_components(), 1); var import_i18n14 = __toESM(require_i18n(), 1); var import_style_engine3 = __toESM(require_style_engine(), 1); var import_jsx_runtime131 = __toESM(require_jsx_runtime(), 1); var GLOBAL_CONTENT_SIZE = "var(--wp--style--global--content-size, none)"; var GLOBAL_WIDE_SIZE = "var(--wp--style--global--wide-size, none)"; var constrained_default = { name: "constrained", label: (0, import_i18n14.__)("Constrained"), inspectorControls: function DefaultLayoutInspectorControls2({ layout, onChange, layoutBlockSupport = {}, resetLayout = {}, clientId }) { const { wideSize, contentSize, justifyContent = "center" } = layout; const { allowJustification = true, allowCustomContentAndWideSize = true } = layoutBlockSupport; const onJustificationChange = (value) => { onChange({ ...layout, justifyContent: value }); }; const justificationOptions = [ { value: "left", icon: justify_left_default, label: (0, import_i18n14.__)("Justify items left") }, { value: "center", icon: justify_center_default, label: (0, import_i18n14.__)("Justify items center") }, { value: "right", icon: justify_right_default, label: (0, import_i18n14.__)("Justify items right") } ]; const [availableUnits] = useSettings("spacing.units"); const units2 = (0, import_components13.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ["%", "px", "em", "rem", "vw"] }); const hasLayoutValue = (key, defaultValue) => (layout?.[key] ?? defaultValue) !== (resetLayout?.[key] ?? defaultValue); const resetContentSize = () => onChange( cleanEmptyObject({ ...layout, contentSize: resetLayout?.contentSize }) ); const resetWideSize = () => onChange( cleanEmptyObject({ ...layout, wideSize: resetLayout?.wideSize }) ); const resetJustification = () => onChange( cleanEmptyObject({ ...layout, justifyContent: resetLayout?.justifyContent }) ); const hasContentSizeValue = () => hasLayoutValue("contentSize"); const hasWideSizeValue = () => hasLayoutValue("wideSize"); const hasJustificationValue = () => hasLayoutValue("justifyContent", "center"); return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [ allowCustomContentAndWideSize && /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components13.__experimentalToolsPanelItem, { label: (0, import_i18n14.__)("Content width"), hasValue: hasContentSizeValue, onDeselect: resetContentSize, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components13.__experimentalUnitControl, { label: (0, import_i18n14.__)("Content width"), labelPosition: "top", value: contentSize === null ? "" : contentSize || wideSize || "", onChange: (nextWidth) => { nextWidth = 0 > parseFloat(nextWidth) ? "0" : nextWidth; onChange({ ...layout, contentSize: nextWidth !== "" ? nextWidth : void 0 }); }, units: units2, prefix: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_components13.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(icon_default, { icon: align_none_default }) }) } ) } ), /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)( import_components13.__experimentalToolsPanelItem, { label: (0, import_i18n14.__)("Wide width"), hasValue: hasWideSizeValue, onDeselect: resetWideSize, panelId: clientId, children: [ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components13.__experimentalUnitControl, { label: (0, import_i18n14.__)("Wide width"), labelPosition: "top", value: wideSize === null ? "" : wideSize || contentSize || "", onChange: (nextWidth) => { nextWidth = 0 > parseFloat(nextWidth) ? "0" : nextWidth; onChange({ ...layout, wideSize: nextWidth !== "" ? nextWidth : void 0 }); }, units: units2, prefix: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_components13.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(icon_default, { icon: stretch_wide_default }) }) } ), /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("p", { className: "block-editor-hooks__layout-constrained-helptext", children: (0, import_i18n14.__)( "Customize the width for all elements that are assigned to the center or wide columns." ) }) ] } ) ] }), allowJustification && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components13.__experimentalToolsPanelItem, { label: (0, import_i18n14.__)("Justification"), hasValue: hasJustificationValue, onDeselect: resetJustification, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components13.__experimentalToggleGroupControl, { label: (0, import_i18n14.__)("Justification"), value: justifyContent, onChange: onJustificationChange, children: justificationOptions.map( ({ value, icon, label }) => { return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components13.__experimentalToggleGroupControlOptionIcon, { value, icon, label }, value ); } ) } ) } ) ] }); }, toolBarControls: function DefaultLayoutToolbarControls2({ layout = {}, onChange, layoutBlockSupport, controlsGroup = "block" }) { const { allowJustification = true } = layoutBlockSupport; if (!allowJustification) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( block_controls_default, { group: controlsGroup, __experimentalShareWithChildBlocks: true, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( DefaultLayoutJustifyContentControl, { layout, onChange } ) } ); }, getLayoutStyle: function getLayoutStyle3({ selector: selector3, layout = {}, viewportOverrides, style, blockName, hasBlockGapSupport, layoutDefinitions = LAYOUT_DEFINITIONS2 }) { const hasViewportOverrides = viewportOverrides !== void 0; const effectiveLayout = hasViewportOverrides ? { ...layout, ...viewportOverrides } : layout; const hasViewportOverride = (key) => Object.hasOwn(viewportOverrides || {}, key); const { contentSize, wideSize, justifyContent } = effectiveLayout; const blockGapStyleValue = getGapCSSValue2(style?.spacing?.blockGap); const hasBlockGapOverride = !hasViewportOverrides || Object.hasOwn(style?.spacing || {}, "blockGap"); const hasBlockSpacingOverride = !hasViewportOverrides || Object.hasOwn(style?.spacing || {}, "padding"); let blockGapValue = ""; if (!shouldSkipSerialization(blockName, "spacing", "blockGap")) { if (blockGapStyleValue?.top) { blockGapValue = getGapCSSValue2(blockGapStyleValue?.top); } else if (typeof blockGapStyleValue === "string") { blockGapValue = getGapCSSValue2(blockGapStyleValue); } } const marginLeft = justifyContent === "left" ? "0 !important" : "auto !important"; const marginRight = justifyContent === "right" ? "0 !important" : "auto !important"; const hasJustificationOverride = hasViewportOverrides && hasViewportOverride("justifyContent"); const hasContentSizeOverride = hasViewportOverrides && hasViewportOverride("contentSize"); const hasWideSizeOverride = hasViewportOverrides && hasViewportOverride("wideSize"); const shouldOutputConstrainedSizes = !hasViewportOverrides || hasContentSizeOverride || hasWideSizeOverride; const isResettingConstrainedSizes = hasViewportOverrides && (hasContentSizeOverride && !contentSize || hasWideSizeOverride && !wideSize); const contentMaxWidth = contentSize || (wideSize && !hasContentSizeOverride ? wideSize : GLOBAL_CONTENT_SIZE); const wideMaxWidth = wideSize || (contentSize && !hasWideSizeOverride ? contentSize : GLOBAL_WIDE_SIZE); const constrainedSizeDeclarations = [ `max-width: ${contentMaxWidth}` ]; if (!hasViewportOverrides || hasJustificationOverride) { constrainedSizeDeclarations.push( `margin-left: ${marginLeft}`, `margin-right: ${marginRight}` ); } let output = shouldOutputConstrainedSizes && (!!contentSize || !!wideSize || isResettingConstrainedSizes) ? ` ${appendSelectors( selector3, "> :where(:not(.alignleft):not(.alignright):not(.alignfull))" )} { ${constrainedSizeDeclarations.join("; ")}; } ${appendSelectors(selector3, "> .alignwide")} { max-width: ${wideMaxWidth}; } ${appendSelectors(selector3, "> .alignfull")} { max-width: none; } ` : ""; if (hasJustificationOverride && !shouldOutputConstrainedSizes) { output += `${appendSelectors( selector3, "> :where(:not(.alignleft):not(.alignright):not(.alignfull))" )} { margin-left: ${marginLeft}; margin-right: ${marginRight}; }`; } else if (!hasViewportOverrides) { if (justifyContent === "left") { output += `${appendSelectors( selector3, "> :where(:not(.alignleft):not(.alignright):not(.alignfull))" )} { margin-left: ${marginLeft}; }`; } else if (justifyContent === "right") { output += `${appendSelectors( selector3, "> :where(:not(.alignleft):not(.alignright):not(.alignfull))" )} { margin-right: ${marginRight}; }`; } } if (hasBlockSpacingOverride && style?.spacing?.padding) { const paddingValues = (0, import_style_engine3.getCSSRules)(style); paddingValues.forEach((rule) => { if (rule.key === "paddingRight") { const paddingRightValue = rule.value === "0" ? "0px" : rule.value; output += ` ${appendSelectors(selector3, "> .alignfull")} { margin-right: calc(${paddingRightValue} * -1); } `; } else if (rule.key === "paddingLeft") { const paddingLeftValue = rule.value === "0" ? "0px" : rule.value; output += ` ${appendSelectors(selector3, "> .alignfull")} { margin-left: calc(${paddingLeftValue} * -1); } `; } }); } if (hasBlockGapSupport && hasBlockGapOverride && blockGapValue) { output += getBlockGapCSS( selector3, layoutDefinitions, "constrained", blockGapValue ); } return output; }, getOrientation() { return "vertical"; }, getAlignments(layout) { const alignmentInfo = getAlignmentsInfo(layout); if (layout.alignments !== void 0) { if (!layout.alignments.includes("none")) { layout.alignments.unshift("none"); } return layout.alignments.map((alignment) => ({ name: alignment, info: alignmentInfo[alignment] })); } const { contentSize, wideSize } = layout; const alignments = [ { name: "left" }, { name: "center" }, { name: "right" } ]; if (contentSize) { alignments.unshift({ name: "full" }); } if (wideSize) { alignments.unshift({ name: "wide", info: alignmentInfo.wide }); } alignments.unshift({ name: "none", info: alignmentInfo.none }); return alignments; } }; var POPOVER_PROPS3 = { placement: "bottom-start" }; function DefaultLayoutJustifyContentControl({ layout, onChange }) { const { justifyContent = "center" } = layout; const onJustificationChange = (value) => { onChange({ ...layout, justifyContent: value }); }; const allowedControls = ["left", "center", "right"]; return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( JustifyContentControl, { allowedControls, value: justifyContent, onChange: onJustificationChange, popoverProps: POPOVER_PROPS3 } ); } // packages/block-editor/build-module/layouts/grid.mjs var import_i18n15 = __toESM(require_i18n(), 1); var import_components15 = __toESM(require_components(), 1); var import_element14 = __toESM(require_element(), 1); var import_jsx_runtime132 = __toESM(require_jsx_runtime(), 1); var RANGE_CONTROL_MAX_VALUES = { px: 600, "%": 100, vw: 100, vh: 100, em: 38, rem: 38, svw: 100, lvw: 100, dvw: 100, svh: 100, lvh: 100, dvh: 100, vi: 100, svi: 100, lvi: 100, dvi: 100, vb: 100, svb: 100, lvb: 100, dvb: 100, vmin: 100, svmin: 100, lvmin: 100, dvmin: 100, vmax: 100, svmax: 100, lvmax: 100, dvmax: 100 }; var units = [ { value: "px", label: "px", default: 0 }, { value: "rem", label: "rem", default: 0 }, { value: "em", label: "em", default: 0 } ]; var grid_default2 = { name: "grid", label: (0, import_i18n15.__)("Grid"), inspectorControls: function GridLayoutInspectorControls({ layout = {}, onChange, layoutBlockSupport = {}, resetLayout = {}, clientId }) { const { allowSizingOnChildren = false } = layoutBlockSupport; const showColumnsControl = true; const showMinWidthControl = !layout?.isManualPlacement || window.__experimentalEnableGridInteractivity; const showFillControl = !layout?.isManualPlacement; const defaultColumnCount = layout.isManualPlacement ? 3 : void 0; const hasLayoutValue = (key, defaultValue) => (layout?.[key] ?? defaultValue) !== (resetLayout?.[key] ?? defaultValue); const hasGridTypeValue = () => hasLayoutValue("isManualPlacement", false); const hasColumnsAndRowsValue = () => hasLayoutValue("columnCount", defaultColumnCount) || hasLayoutValue("rowCount"); const hasMinimumColumnWidthValue = () => hasLayoutValue("minimumColumnWidth"); const hasFillValue = () => hasLayoutValue("autoFit", false); const resetGridType = () => onChange( cleanEmptyObject({ ...layout, isManualPlacement: resetLayout?.isManualPlacement, rowCount: resetLayout?.rowCount, minimumColumnWidth: resetLayout?.minimumColumnWidth }) ); const resetColumnsAndRows = () => onChange( cleanEmptyObject({ ...layout, columnCount: resetLayout?.columnCount ?? defaultColumnCount, rowCount: resetLayout?.rowCount }) ); const resetMinimumColumnWidth = () => onChange( cleanEmptyObject({ ...layout, minimumColumnWidth: resetLayout?.minimumColumnWidth }) ); const resetFill = () => onChange( cleanEmptyObject({ ...layout, autoFit: resetLayout?.autoFit }) ); return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_jsx_runtime132.Fragment, { children: [ window.__experimentalEnableGridInteractivity && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components15.__experimentalToolsPanelItem, { label: (0, import_i18n15.__)("Grid item position"), hasValue: hasGridTypeValue, onDeselect: resetGridType, isShownByDefault: true, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( GridLayoutTypeControl, { layout, onChange } ) } ), showColumnsControl && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components15.__experimentalToolsPanelItem, { label: (0, import_i18n15.__)("Columns and rows"), hasValue: hasColumnsAndRowsValue, onDeselect: resetColumnsAndRows, isShownByDefault: true, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( GridLayoutColumnsAndRowsControl, { layout, onChange, allowSizingOnChildren } ) } ), showMinWidthControl && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components15.__experimentalToolsPanelItem, { label: (0, import_i18n15.__)("Min. column width"), hasValue: hasMinimumColumnWidthValue, onDeselect: resetMinimumColumnWidth, isShownByDefault: true, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( GridLayoutMinimumWidthControl, { layout, onChange } ) } ), showFillControl && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components15.__experimentalToolsPanelItem, { label: (0, import_i18n15.__)("Fill available space"), hasValue: hasFillValue, onDeselect: resetFill, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( GridLayoutFillControl, { layout, onChange } ) } ) ] }); }, toolBarControls: function GridLayoutToolbarControls() { return null; }, getLayoutStyle: function getLayoutStyle4({ selector: selector3, layout = {}, viewportOverrides, style, blockName, hasBlockGapSupport, globalBlockGapValue, layoutDefinitions = LAYOUT_DEFINITIONS2 }) { const hasViewportOverrides = viewportOverrides !== void 0; const effectiveLayout = hasViewportOverrides ? { ...layout, ...viewportOverrides } : layout; const hasViewportOverride = (key) => Object.hasOwn(viewportOverrides || {}, key); const { minimumColumnWidth = null, columnCount = null, rowCount = null, autoFit = false } = effectiveLayout; const autoPlacement4 = autoFit ? "auto-fit" : "auto-fill"; if (true) { if (minimumColumnWidth && typeof minimumColumnWidth !== "string") { throw new Error("minimumColumnWidth must be a string"); } if (columnCount && typeof columnCount !== "number") { throw new Error("columnCount must be a number"); } if (rowCount && typeof rowCount !== "number") { throw new Error("rowCount must be a number"); } if (autoFit && typeof autoFit !== "boolean") { throw new Error("autoFit must be a boolean"); } } let fallbackGapValue = "1.2rem"; if (globalBlockGapValue) { const gapBox = getGapBoxControlValueFromStyle2(globalBlockGapValue); fallbackGapValue = getSpacingPresetCssVar2(gapBox?.left) || getSpacingPresetCssVar2(gapBox?.top) || "1.2rem"; } const blockGapValue = style?.spacing?.blockGap && !shouldSkipSerialization(blockName, "spacing", "blockGap") ? getGapCSSValue2(style?.spacing?.blockGap, fallbackGapValue) : void 0; const hasBlockGapOverride = !hasViewportOverrides || Object.hasOwn(style?.spacing || {}, "blockGap"); let output = ""; const rules = []; const shouldOutputGridColumns = !hasViewportOverrides || hasViewportOverride("minimumColumnWidth") || hasViewportOverride("columnCount") || hasViewportOverride("autoFit") || hasBlockGapOverride && minimumColumnWidth && columnCount > 0; const shouldOutputGridRows = (!hasViewportOverrides || hasViewportOverride("rowCount")) && columnCount && rowCount; if (shouldOutputGridColumns && minimumColumnWidth && columnCount > 0) { let blockGapToUse = blockGapValue || fallbackGapValue; if (blockGapToUse === "0" || blockGapToUse === 0) { blockGapToUse = "0px"; } const maxValue = `max(min( ${minimumColumnWidth}, 100%), ( 100% - (${blockGapToUse}*${columnCount - 1}) ) / ${columnCount})`; rules.push( `grid-template-columns: repeat(${autoPlacement4}, minmax(${maxValue}, 1fr))` ); } else if (shouldOutputGridColumns && columnCount) { rules.push( `grid-template-columns: repeat(${columnCount}, minmax(0, 1fr))` ); } else if (shouldOutputGridColumns) { rules.push( `grid-template-columns: repeat(${autoPlacement4}, minmax(min(${minimumColumnWidth || "12rem"}, 100%), 1fr))` ); } if (shouldOutputGridColumns) { const baseHasContainerType = !layout?.columnCount || layout?.columnCount && layout?.minimumColumnWidth; const needsContainerType = !columnCount || minimumColumnWidth; if (needsContainerType && (!hasViewportOverrides || !baseHasContainerType)) { rules.push("container-type: inline-size"); } } if (shouldOutputGridRows) { rules.push( `grid-template-rows: repeat(${rowCount}, minmax(1rem, auto))` ); } if (rules.length) { output = `${appendSelectors(selector3)} { ${rules.join( "; " )}; }`; } if (hasBlockGapSupport && hasBlockGapOverride && blockGapValue) { output += getBlockGapCSS( selector3, layoutDefinitions, "grid", blockGapValue ); } return output; }, getOrientation() { return "horizontal"; }, getAlignments() { return []; } }; function GridLayoutMinimumWidthControl({ layout, onChange }) { const { minimumColumnWidth, columnCount, isManualPlacement } = layout; const defaultValue = isManualPlacement || columnCount ? null : "12rem"; const value = minimumColumnWidth || defaultValue; const [quantity, unit = "rem"] = (0, import_components15.__experimentalParseQuantityAndUnitFromRawValue)(value); const handleSliderChange = (next) => { onChange({ ...layout, minimumColumnWidth: [next, unit].join("") }); }; const handleUnitChange = (newUnit) => { let newValue; if (["em", "rem"].includes(newUnit) && unit === "px") { newValue = (quantity / 16).toFixed(2) + newUnit; } else if (["em", "rem"].includes(unit) && newUnit === "px") { newValue = Math.round(quantity * 16) + newUnit; } onChange({ ...layout, minimumColumnWidth: newValue }); }; return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("fieldset", { className: "block-editor-hooks__grid-layout-minimum-width-control", children: [ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components15.BaseControl.VisualLabel, { as: "legend", children: (0, import_i18n15.__)("Min. column width") }), /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_components15.Flex, { gap: 4, children: [ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components15.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components15.__experimentalUnitControl, { onChange: (newValue) => { onChange({ ...layout, minimumColumnWidth: newValue === "" ? void 0 : newValue }); }, onUnitChange: handleUnitChange, value, units, min: 0, label: (0, import_i18n15.__)("Minimum column width"), hideLabelFromVision: true } ) }), /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components15.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components15.RangeControl, { onChange: handleSliderChange, value: quantity || 0, min: 0, max: RANGE_CONTROL_MAX_VALUES[unit] || 600, withInputField: false, label: (0, import_i18n15.__)("Minimum column width"), hideLabelFromVision: true } ) }) ] }), /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "components-base-control__help", children: (0, import_i18n15.__)( "Columns will wrap to fewer per row when they can no longer maintain the minimum width." ) }) ] }); } function GridLayoutColumnsAndRowsControl({ layout, onChange, allowSizingOnChildren }) { const defaultColumnCount = void 0; const { columnCount = defaultColumnCount, rowCount, isManualPlacement } = layout; return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_jsx_runtime132.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("fieldset", { className: "block-editor-hooks__grid-layout-columns-and-rows-controls", children: [ !isManualPlacement && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components15.BaseControl.VisualLabel, { as: "legend", children: (0, import_i18n15.__)("Max. columns") }), /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_components15.Flex, { gap: 4, children: [ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components15.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components15.__experimentalNumberControl, { onChange: (value) => { const defaultNewColumnCount = isManualPlacement ? 1 : void 0; const newColumnCount = value === "" || value === "0" ? defaultNewColumnCount : parseInt(value, 10); onChange({ ...layout, columnCount: newColumnCount }); }, value: columnCount ?? "", min: 1, label: (0, import_i18n15.__)("Columns"), hideLabelFromVision: !isManualPlacement } ) }), /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components15.FlexItem, { isBlock: true, children: allowSizingOnChildren && isManualPlacement ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components15.__experimentalNumberControl, { onChange: (value) => { const newRowCount = value === "" || value === "0" ? 1 : parseInt(value, 10); onChange({ ...layout, rowCount: newRowCount }); }, value: rowCount, min: 1, label: (0, import_i18n15.__)("Rows") } ) : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components15.RangeControl, { value: columnCount ?? 1, onChange: (value) => onChange({ ...layout, columnCount: value === "" || value === "0" ? 1 : value }), min: 1, max: 16, withInputField: false, label: (0, import_i18n15.__)("Columns"), hideLabelFromVision: true } ) }) ] }) ] }) }); } function GridLayoutFillControl({ layout, onChange }) { const { autoFit = false } = layout; return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components15.ToggleControl, { label: (0, import_i18n15.__)("Fill available space"), help: (0, import_i18n15.__)( "Stretch columns to fill the available space, instead of leaving gaps when there are too few items to fill a row." ), checked: autoFit, onChange: (value) => onChange({ ...layout, autoFit: value }) } ); } function GridLayoutTypeControl({ layout, onChange }) { const { columnCount, rowCount, minimumColumnWidth, isManualPlacement } = layout; const [tempColumnCount, setTempColumnCount] = (0, import_element14.useState)( columnCount || 3 ); const [tempRowCount, setTempRowCount] = (0, import_element14.useState)(rowCount); const [tempMinimumColumnWidth, setTempMinimumColumnWidth] = (0, import_element14.useState)( minimumColumnWidth || "12rem" ); const gridPlacement = isManualPlacement ? "manual" : "auto"; const onChangeType = (value) => { if (value === "manual") { setTempMinimumColumnWidth(minimumColumnWidth || "12rem"); } else { setTempColumnCount(columnCount || 3); setTempRowCount(rowCount); } onChange({ ...layout, columnCount: value === "manual" ? tempColumnCount : tempColumnCount, rowCount: value === "manual" ? tempRowCount : void 0, isManualPlacement: value === "manual" ? true : void 0, minimumColumnWidth: value === "auto" ? tempMinimumColumnWidth : null }); }; const helpText2 = gridPlacement === "manual" ? (0, import_i18n15.__)( "Grid items can be manually placed in any position on the grid." ) : (0, import_i18n15.__)( "Grid items are placed automatically depending on their order." ); return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)( import_components15.__experimentalToggleGroupControl, { label: (0, import_i18n15.__)("Grid item position"), value: gridPlacement, onChange: onChangeType, isBlock: true, help: helpText2, children: [ /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components15.__experimentalToggleGroupControlOption, { value: "auto", label: (0, import_i18n15.__)("Auto") }, "auto" ), /* @__PURE__ */ (0, import_jsx_runtime132.jsx)( import_components15.__experimentalToggleGroupControlOption, { value: "manual", label: (0, import_i18n15.__)("Manual") }, "manual" ) ] } ); } // packages/block-editor/build-module/layouts/index.mjs var layoutTypes = [flow_default, flex_default, constrained_default, grid_default2]; function getLayoutType(name = "default") { return layoutTypes.find((layoutType) => layoutType.name === name); } function getLayoutTypes() { return layoutTypes; } // packages/block-editor/build-module/components/block-list/layout.mjs var import_jsx_runtime133 = __toESM(require_jsx_runtime(), 1); var defaultLayout = { type: "default" }; var Layout = (0, import_element15.createContext)(defaultLayout); Layout.displayName = "BlockLayoutContext"; var LayoutProvider = Layout.Provider; function useLayout() { return (0, import_element15.useContext)(Layout); } function LayoutStyle({ layout = {}, css, ...props }) { const layoutType = getLayoutType(layout.type); const [blockGapSupport] = useSettings("spacing.blockGap"); const hasBlockGapSupport = blockGapSupport !== null; if (layoutType) { if (css) { return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("style", { children: css }); } const layoutStyle = layoutType.getLayoutStyle?.({ hasBlockGapSupport, layout, ...props }); if (layoutStyle) { return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("style", { children: layoutStyle }); } } return null; } // packages/block-editor/build-module/components/block-alignment-control/use-available-alignments.mjs var EMPTY_ARRAY4 = []; var DEFAULT_CONTROLS = ["none", "left", "center", "right", "wide", "full"]; var WIDE_CONTROLS = ["wide", "full"]; function useAvailableAlignments(controls = DEFAULT_CONTROLS) { if (!controls.includes("none")) { controls = ["none", ...controls]; } const isNoneOnly = controls.length === 1 && controls[0] === "none"; const [wideControlsEnabled, themeSupportsLayout, isBlockBasedTheme] = (0, import_data12.useSelect)( (select3) => { if (isNoneOnly) { return [false, false, false]; } const settings2 = select3(store).getSettings(); return [ settings2.alignWide ?? false, settings2.supportsLayout, settings2.__unstableIsBlockBasedTheme ]; }, [isNoneOnly] ); const layout = useLayout(); if (isNoneOnly) { return EMPTY_ARRAY4; } const layoutType = getLayoutType(layout?.type); if (themeSupportsLayout) { const layoutAlignments = layoutType.getAlignments( layout, isBlockBasedTheme ); const alignments2 = layoutAlignments.filter( (alignment) => controls.includes(alignment.name) ); if (alignments2.length === 1 && alignments2[0].name === "none") { return EMPTY_ARRAY4; } return alignments2; } if (layoutType.name !== "default" && layoutType.name !== "constrained") { return EMPTY_ARRAY4; } const alignments = controls.filter((control) => { if (layout.alignments) { return layout.alignments.includes(control); } if (!wideControlsEnabled && WIDE_CONTROLS.includes(control)) { return false; } return DEFAULT_CONTROLS.includes(control); }).map((name) => ({ name })); if (alignments.length === 1 && alignments[0].name === "none") { return EMPTY_ARRAY4; } return alignments; } // packages/block-editor/build-module/components/block-alignment-control/constants.mjs var import_i18n16 = __toESM(require_i18n(), 1); var BLOCK_ALIGNMENTS_CONTROLS = { none: { icon: align_none_default, title: (0, import_i18n16._x)("None", "Alignment option") }, left: { icon: position_left_default, title: (0, import_i18n16.__)("Align left") }, center: { icon: position_center_default, title: (0, import_i18n16.__)("Align center") }, right: { icon: position_right_default, title: (0, import_i18n16.__)("Align right") }, wide: { icon: stretch_wide_default, title: (0, import_i18n16.__)("Wide width") }, full: { icon: stretch_full_width_default, title: (0, import_i18n16.__)("Full width") } }; var DEFAULT_CONTROL = "none"; // packages/block-editor/build-module/components/block-alignment-control/ui.mjs var import_jsx_runtime134 = __toESM(require_jsx_runtime(), 1); function BlockAlignmentUI({ value, onChange, controls, isToolbar, isCollapsed: isCollapsed3 = true }) { const enabledControls = useAvailableAlignments(controls); const hasEnabledControls = !!enabledControls.length; if (!hasEnabledControls) { return null; } function onChangeAlignment(align) { onChange([value, "none"].includes(align) ? void 0 : align); } const activeAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[value]; const defaultAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[DEFAULT_CONTROL]; const UIComponent = isToolbar ? import_components16.ToolbarGroup : import_components16.ToolbarDropdownMenu; const commonProps = { icon: activeAlignmentControl ? activeAlignmentControl.icon : defaultAlignmentControl.icon, label: (0, import_i18n17.__)("Align") }; const extraProps = isToolbar ? { isCollapsed: isCollapsed3, controls: enabledControls.map(({ name: controlName }) => { return { ...BLOCK_ALIGNMENTS_CONTROLS[controlName], isActive: value === controlName || !value && controlName === "none", role: isCollapsed3 ? "menuitemradio" : void 0, onClick: () => onChangeAlignment(controlName) }; }) } : { toggleProps: { description: (0, import_i18n17.__)("Change alignment") }, children: ({ onClose }) => { return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_jsx_runtime134.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_components16.MenuGroup, { className: "block-editor-block-alignment-control__menu-group", children: enabledControls.map( ({ name: controlName, info }) => { const { icon, title } = BLOCK_ALIGNMENTS_CONTROLS[controlName]; const isSelected = controlName === value || !value && controlName === "none"; return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)( import_components16.MenuItem, { icon, iconPosition: "left", className: clsx_default( "components-dropdown-menu__menu-item", { "is-active": isSelected } ), isSelected, onClick: () => { onChangeAlignment( controlName ); onClose(); }, role: "menuitemradio", info, children: title }, controlName ); } ) }) }); } }; return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(UIComponent, { ...commonProps, ...extraProps }); } var ui_default2 = BlockAlignmentUI; // packages/block-editor/build-module/components/block-alignment-control/index.mjs var import_jsx_runtime135 = __toESM(require_jsx_runtime(), 1); var BlockAlignmentControl = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(ui_default2, { ...props, isToolbar: false }); }; var BlockAlignmentToolbar = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(ui_default2, { ...props, isToolbar: true }); }; // packages/block-editor/build-module/components/block-bindings/attribute-control.mjs var import_es63 = __toESM(require_es6(), 1); var import_i18n18 = __toESM(require_i18n(), 1); var import_blocks15 = __toESM(require_blocks(), 1); var import_components18 = __toESM(require_components(), 1); var import_data15 = __toESM(require_data(), 1); var import_element17 = __toESM(require_element(), 1); var import_compose5 = __toESM(require_compose(), 1); // packages/block-editor/build-module/components/block-bindings/source-fields-list.mjs var import_es62 = __toESM(require_es6(), 1); var import_blocks14 = __toESM(require_blocks(), 1); var import_components17 = __toESM(require_components(), 1); var import_data14 = __toESM(require_data(), 1); var import_element16 = __toESM(require_element(), 1); var import_compose4 = __toESM(require_compose(), 1); // packages/block-editor/build-module/components/block-bindings/use-block-bindings-utils.mjs var import_data13 = __toESM(require_data(), 1); function isObjectEmpty(object) { return !object || Object.keys(object).length === 0; } function useBlockBindingsUtils(clientId) { const { clientId: contextClientId } = useBlockEditContext(); const blockClientId = clientId || contextClientId; const { updateBlockAttributes: updateBlockAttributes2 } = (0, import_data13.useDispatch)(store); const { getBlockAttributes: getBlockAttributes3 } = (0, import_data13.useRegistry)().select(store); const updateBlockBindings = (bindings) => { const { metadata: { bindings: currentBindings, ...metadata } = {} } = getBlockAttributes3(blockClientId); const newBindings = { ...currentBindings }; Object.entries(bindings).forEach(([attribute, binding]) => { if (!binding && newBindings[attribute]) { delete newBindings[attribute]; return; } newBindings[attribute] = binding; }); const newMetadata = { ...metadata, bindings: newBindings }; if (isObjectEmpty(newMetadata.bindings)) { delete newMetadata.bindings; } updateBlockAttributes2(blockClientId, { metadata: isObjectEmpty(newMetadata) ? void 0 : newMetadata }); }; const removeAllBlockBindings = () => { const { metadata: { bindings, ...metadata } = {} } = getBlockAttributes3(blockClientId); updateBlockAttributes2(blockClientId, { metadata: isObjectEmpty(metadata) ? void 0 : metadata }); }; return { updateBlockBindings, removeAllBlockBindings }; } // packages/block-editor/build-module/components/block-bindings/source-fields-list.mjs var import_jsx_runtime136 = __toESM(require_jsx_runtime(), 1); var { Menu } = unlock(import_components17.privateApis); function BlockBindingsSourceFieldsListItem({ args, attribute, field, source, sourceKey }) { const itemBindings = (0, import_element16.useMemo)( () => ({ source: sourceKey, args: field.args || { key: field.key } }), [field.args, field.key, sourceKey] ); const blockContext = (0, import_element16.useContext)(block_context_default); const values = (0, import_data14.useSelect)( (select3) => source.getValues({ select: select3, context: blockContext, bindings: { [attribute]: itemBindings } }), [attribute, blockContext, itemBindings, source] ); const { updateBlockBindings } = useBlockBindingsUtils(); return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)( Menu.CheckboxItem, { onChange: () => { const isCurrentlySelected = (0, import_es62.default)(args, field.args) ?? // Deprecate key dependency in 7.0. field.key === args?.key; if (isCurrentlySelected) { updateBlockBindings({ [attribute]: void 0 }); } else { updateBlockBindings({ [attribute]: itemBindings }); } }, name: attribute + "-binding", value: values[attribute], checked: (0, import_es62.default)(args, field.args) ?? // Deprecate key dependency in 7.0. field.key === args?.key, children: [ /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Menu.ItemLabel, { children: field.label }), /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Menu.ItemHelpText, { children: values[attribute] }) ] } ); } function BlockBindingsSourceFieldsList({ args, attribute, sourceKey, fields }) { const isMobile = (0, import_compose4.useViewportMatch)("medium", "<"); if (!fields || fields.length === 0) { return null; } const source = (0, import_blocks14.getBlockBindingsSource)(sourceKey); return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)( Menu, { placement: isMobile ? "bottom-start" : "left-start", children: [ /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Menu.SubmenuTriggerItem, { children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Menu.ItemLabel, { children: source.label }) }), /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Menu.Popover, { gutter: 8, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Menu.Group, { children: fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)( BlockBindingsSourceFieldsListItem, { args, attribute, field, source, sourceKey }, sourceKey + JSON.stringify(field.args) || field.key )) }) }) ] }, sourceKey ); } // packages/block-editor/build-module/components/block-bindings/attribute-control.mjs var import_jsx_runtime137 = __toESM(require_jsx_runtime(), 1); var { Menu: Menu2 } = unlock(import_components18.privateApis); function BlockBindingsAttributeControl({ attribute, binding, blockName }) { const { updateBlockBindings } = useBlockBindingsUtils(); const isMobile = (0, import_compose5.useViewportMatch)("medium", "<"); const blockContext = (0, import_element17.useContext)(block_context_default); const compatibleFields = (0, import_data15.useSelect)( (select3) => { const { getAllBlockBindingsSources, getBlockBindingsSourceFieldsList, getBlockType: getBlockType30 } = unlock(select3(import_blocks15.store)); const _attribute = getBlockType30(blockName).attributes?.[attribute]; if (_attribute?.enum) { return {}; } const attributeType = _attribute?.type === "rich-text" ? "string" : _attribute?.type; const sourceFields = {}; Object.entries(getAllBlockBindingsSources()).forEach( ([sourceName, source2]) => { const fieldsList = getBlockBindingsSourceFieldsList( source2, blockContext ); if (!fieldsList?.length) { return; } const compatibleFieldsList = fieldsList.filter( (field) => field.type === attributeType ); if (compatibleFieldsList.length) { sourceFields[sourceName] = compatibleFieldsList; } } ); return sourceFields; }, [attribute, blockName, blockContext] ); const { canUpdateBlockBindings } = (0, import_data15.useSelect)((select3) => ({ canUpdateBlockBindings: select3(store).getSettings().canUpdateBlockBindings })); const hasCompatibleFields = Object.keys(compatibleFields).length > 0; const isAttributeReadOnly = !canUpdateBlockBindings || !hasCompatibleFields; const { source: boundSourceName, args } = binding || {}; const source = (0, import_blocks15.getBlockBindingsSource)(boundSourceName); let displayText; let isValid2 = true; if (binding === void 0) { if (!hasCompatibleFields) { displayText = (0, import_i18n18.__)("No sources available"); } else { displayText = (0, import_i18n18.__)("Not connected"); } isValid2 = true; } else if (!source) { isValid2 = false; displayText = (0, import_i18n18.__)("Source not registered"); } else { displayText = compatibleFields?.[boundSourceName]?.find( (field) => (0, import_es63.default)(field.args, args) )?.label || source?.label || boundSourceName; } return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)( import_components18.__experimentalToolsPanelItem, { hasValue: () => !!binding, label: attribute, onDeselect: !!hasCompatibleFields && (() => { updateBlockBindings({ [attribute]: void 0 }); }), children: /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(Menu2, { placement: isMobile ? "bottom-start" : "left-start", children: [ /* @__PURE__ */ (0, import_jsx_runtime137.jsx)( Menu2.TriggerButton, { render: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_components18.__experimentalItem, {}), disabled: !hasCompatibleFields, children: /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)( import_components18.__experimentalVStack, { className: "block-editor-bindings__item", spacing: 0, children: [ /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_components18.__experimentalText, { truncate: true, children: attribute }), /* @__PURE__ */ (0, import_jsx_runtime137.jsx)( import_components18.__experimentalText, { truncate: true, variant: isValid2 ? "muted" : void 0, isDestructive: !isValid2, children: displayText } ) ] } ) } ), !isAttributeReadOnly && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(Menu2.Popover, { gutter: isMobile ? 8 : 36, children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)( Menu2, { placement: isMobile ? "bottom-start" : "left-start", children: Object.entries(compatibleFields).map( ([sourceKey, fields]) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)( BlockBindingsSourceFieldsList, { args: binding?.args, attribute, sourceKey, fields }, sourceKey ) ) } ) }) ] }) } ); } // packages/block-editor/build-module/components/block-full-height-alignment-control/index.mjs var import_i18n19 = __toESM(require_i18n(), 1); var import_components19 = __toESM(require_components(), 1); var import_jsx_runtime138 = __toESM(require_jsx_runtime(), 1); function BlockFullHeightAlignmentControl({ isActive, label = (0, import_i18n19.__)("Full height"), onToggle, isDisabled }) { return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)( import_components19.ToolbarButton, { isActive, icon: full_height_default, label, onClick: () => onToggle(!isActive), disabled: isDisabled } ); } var block_full_height_alignment_control_default = BlockFullHeightAlignmentControl; // packages/block-editor/build-module/components/block-alignment-matrix-control/index.mjs var import_i18n20 = __toESM(require_i18n(), 1); var import_keycodes = __toESM(require_keycodes(), 1); var import_components20 = __toESM(require_components(), 1); var import_jsx_runtime139 = __toESM(require_jsx_runtime(), 1); var noop2 = () => { }; function BlockAlignmentMatrixControl(props) { const { label = (0, import_i18n20.__)("Change matrix alignment"), onChange = noop2, value = "center", isDisabled } = props; const icon = /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_components20.AlignmentMatrixControl.Icon, { value }); return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)( import_components20.Dropdown, { popoverProps: { placement: "bottom-start" }, renderToggle: ({ onToggle, isOpen }) => { const openOnArrowDown = (event) => { if (!isOpen && event.keyCode === import_keycodes.DOWN) { event.preventDefault(); onToggle(); } }; return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)( import_components20.ToolbarButton, { onClick: onToggle, "aria-haspopup": "true", "aria-expanded": isOpen, onKeyDown: openOnArrowDown, label, icon, showTooltip: true, disabled: isDisabled } ); }, renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_components20.AlignmentMatrixControl, { onChange, value }) } ); } var block_alignment_matrix_control_default = BlockAlignmentMatrixControl; // packages/block-editor/build-module/components/block-breadcrumb/index.mjs var import_components21 = __toESM(require_components(), 1); var import_data17 = __toESM(require_data(), 1); var import_i18n21 = __toESM(require_i18n(), 1); var import_element20 = __toESM(require_element(), 1); // packages/block-editor/build-module/components/block-title/use-block-display-title.mjs var import_data16 = __toESM(require_data(), 1); var import_blocks16 = __toESM(require_blocks(), 1); function useBlockDisplayTitle({ clientId, maximumLength, context }) { const blockTitle = (0, import_data16.useSelect)( (select3) => { if (!clientId) { return null; } const { getBlockName: getBlockName2, getBlockAttributes: getBlockAttributes3, getBlock: getBlock2 } = select3(store); const { getBlockType: getBlockType30, getActiveBlockVariation } = select3(import_blocks16.store); const blockName = getBlockName2(clientId); const blockType = getBlockType30(blockName); if (!blockType) { return null; } const attributes = getBlockAttributes3(clientId); const label = (0, import_blocks16.__experimentalGetBlockLabel)(blockType, attributes, context); if (label !== blockType.title) { return label; } const match2 = getActiveBlockVariation( blockName, attributes, void 0, getBlock2?.(clientId)?.innerContent ); return match2?.title || blockType.title; }, [clientId, context] ); if (!blockTitle) { return null; } if (maximumLength && maximumLength > 0 && blockTitle.length > maximumLength) { const omission = "..."; return blockTitle.slice(0, maximumLength - omission.length) + omission; } return blockTitle; } // packages/block-editor/build-module/components/block-title/index.mjs function BlockTitle({ clientId, maximumLength, context }) { return useBlockDisplayTitle({ clientId, maximumLength, context }); } // packages/block-editor/build-module/components/block-list/use-block-props/use-block-refs.mjs var import_element19 = __toESM(require_element(), 1); var import_compose7 = __toESM(require_compose(), 1); // packages/block-editor/build-module/components/provider/block-refs-provider.mjs var import_element18 = __toESM(require_element(), 1); var import_compose6 = __toESM(require_compose(), 1); var import_jsx_runtime140 = __toESM(require_jsx_runtime(), 1); var BlockRefs = (0, import_element18.createContext)({ refsMap: (0, import_compose6.observableMap)(), eventHandlers: /* @__PURE__ */ new Map() }); BlockRefs.displayName = "BlockRefsContext"; function BlockRefsProvider({ children }) { const value = (0, import_element18.useMemo)( () => ({ refsMap: (0, import_compose6.observableMap)(), eventHandlers: /* @__PURE__ */ new Map() }), [] ); return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(BlockRefs.Provider, { value, children }); } // packages/block-editor/build-module/components/block-list/use-block-props/use-block-refs.mjs function useBlockRefProvider(clientId) { const { refsMap } = (0, import_element19.useContext)(BlockRefs); return (0, import_compose7.useRefEffect)( (element) => { refsMap.set(clientId, element); return () => refsMap.delete(clientId); }, [clientId] ); } function assignRef(ref, value) { if (typeof ref === "function") { ref(value); } else if (ref) { ref.current = value; } } function useBlockElementRef(clientId, ref) { const { refsMap } = (0, import_element19.useContext)(BlockRefs); (0, import_element19.useLayoutEffect)(() => { assignRef(ref, refsMap.get(clientId)); const unsubscribe = refsMap.subscribe( clientId, () => assignRef(ref, refsMap.get(clientId)) ); return () => { unsubscribe(); assignRef(ref, null); }; }, [refsMap, clientId, ref]); } function useBlockElement(clientId) { const [blockElement, setBlockElement] = (0, import_element19.useState)(null); useBlockElementRef(clientId, setBlockElement); return blockElement; } // packages/block-editor/build-module/utils/get-editor-region.mjs function getEditorRegion(editor) { if (!editor) { return null; } const editorCanvas = Array.from( document.querySelectorAll( 'iframe[name="editor-canvas"]' ).values() ).find((iframe) => { const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; return iframeDocument === editor.ownerDocument; }) ?? editor; return editorCanvas?.closest('[role="region"]') ?? editorCanvas; } // packages/block-editor/build-module/components/block-breadcrumb/index.mjs var import_jsx_runtime141 = __toESM(require_jsx_runtime(), 1); function BlockBreadcrumb({ rootLabelText }) { const { selectBlock: selectBlock2, clearSelectedBlock: clearSelectedBlock2 } = (0, import_data17.useDispatch)(store); const { clientId, parents, hasSelection } = (0, import_data17.useSelect)((select3) => { const { getSelectionStart: getSelectionStart2, getSelectedBlockClientId: getSelectedBlockClientId2, getEnabledBlockParents: getEnabledBlockParents2 } = unlock(select3(store)); const selectedBlockClientId = getSelectedBlockClientId2(); return { parents: getEnabledBlockParents2(selectedBlockClientId), clientId: selectedBlockClientId, hasSelection: !!getSelectionStart2().clientId }; }, []); const rootLabel = rootLabelText || (0, import_i18n21._x)("Document", "noun, breadcrumb"); const blockRef = (0, import_element20.useRef)(); useBlockElementRef(clientId, blockRef); return /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)( "ul", { className: "block-editor-block-breadcrumb", role: "list", "aria-label": (0, import_i18n21.__)("Block breadcrumb"), children: [ /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)( "li", { className: !hasSelection ? "block-editor-block-breadcrumb__current" : void 0, "aria-current": !hasSelection ? "true" : void 0, children: [ hasSelection && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)( import_components21.Button, { size: "small", className: "block-editor-block-breadcrumb__button", onClick: () => { const blockEditor = blockRef.current?.closest( ".editor-styles-wrapper" ); clearSelectedBlock2(); getEditorRegion(blockEditor)?.focus(); }, children: rootLabel } ), !hasSelection && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("span", { children: rootLabel }), !!clientId && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)( icon_default, { icon: chevron_right_small_default, className: "block-editor-block-breadcrumb__separator" } ) ] } ), parents.map((parentClientId) => /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("li", { children: [ /* @__PURE__ */ (0, import_jsx_runtime141.jsx)( import_components21.Button, { size: "small", className: "block-editor-block-breadcrumb__button", onClick: () => selectBlock2(parentClientId), children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)( BlockTitle, { clientId: parentClientId, maximumLength: 35, context: "breadcrumb" } ) } ), /* @__PURE__ */ (0, import_jsx_runtime141.jsx)( icon_default, { icon: chevron_right_small_default, className: "block-editor-block-breadcrumb__separator" } ) ] }, parentClientId)), !!clientId && /* @__PURE__ */ (0, import_jsx_runtime141.jsx)( "li", { className: "block-editor-block-breadcrumb__current", "aria-current": "true", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)( BlockTitle, { clientId, maximumLength: 35, context: "breadcrumb" } ) } ) ] } ); } var block_breadcrumb_default = BlockBreadcrumb; // packages/block-editor/build-module/components/block-content-overlay/index.mjs var import_data18 = __toESM(require_data(), 1); function useBlockOverlayActive(clientId) { return (0, import_data18.useSelect)( (select3) => { const { __unstableHasActiveBlockOverlayActive: __unstableHasActiveBlockOverlayActive2 } = select3(store); return __unstableHasActiveBlockOverlayActive2(clientId); }, [clientId] ); } // packages/block-editor/build-module/components/block-canvas/index.mjs var import_compose71 = __toESM(require_compose(), 1); var import_element179 = __toESM(require_element(), 1); var import_data126 = __toESM(require_data(), 1); var import_components116 = __toESM(require_components(), 1); // packages/block-editor/build-module/components/block-list/index.mjs var import_data81 = __toESM(require_data(), 1); var import_compose58 = __toESM(require_compose(), 1); var import_element143 = __toESM(require_element(), 1); var import_blocks46 = __toESM(require_blocks(), 1); // packages/block-editor/build-module/components/block-list/block.mjs var import_element33 = __toESM(require_element(), 1); var import_blocks23 = __toESM(require_blocks(), 1); var import_components28 = __toESM(require_components(), 1); var import_data31 = __toESM(require_data(), 1); var import_compose19 = __toESM(require_compose(), 1); var import_dom8 = __toESM(require_dom(), 1); // packages/block-editor/build-module/components/block-list/block-invalid-warning.mjs var import_i18n23 = __toESM(require_i18n(), 1); var import_components23 = __toESM(require_components(), 1); var import_element22 = __toESM(require_element(), 1); var import_blocks18 = __toESM(require_blocks(), 1); var import_data19 = __toESM(require_data(), 1); // node_modules/diff/libesm/diff/base.js var Diff = class { diff(oldStr, newStr, options = {}) { let callback; if (typeof options === "function") { callback = options; options = {}; } else if ("callback" in options) { callback = options.callback; } const oldString = this.castInput(oldStr, options); const newString = this.castInput(newStr, options); const oldTokens = this.removeEmpty(this.tokenize(oldString, options)); const newTokens = this.removeEmpty(this.tokenize(newString, options)); return this.diffWithOptionsObj(oldTokens, newTokens, options, callback); } diffWithOptionsObj(oldTokens, newTokens, options, callback) { var _a; const done = (value) => { value = this.postProcess(value, options); if (callback) { setTimeout(function() { callback(value); }, 0); return void 0; } else { return value; } }; const newLen = newTokens.length, oldLen = oldTokens.length; let editLength = 1; let maxEditLength = newLen + oldLen; if (options.maxEditLength != null) { maxEditLength = Math.min(maxEditLength, options.maxEditLength); } const maxExecutionTime = (_a = options.timeout) !== null && _a !== void 0 ? _a : Infinity; const abortAfterTimestamp = Date.now() + maxExecutionTime; const bestPath = [{ oldPos: -1, lastComponent: void 0 }]; let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options); if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) { return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens)); } let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity; const execEditLength = () => { for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) { let basePath; const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1]; if (removePath) { bestPath[diagonalPath - 1] = void 0; } let canAdd = false; if (addPath) { const addPathNewPos = addPath.oldPos - diagonalPath; canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen; } const canRemove = removePath && removePath.oldPos + 1 < oldLen; if (!canAdd && !canRemove) { bestPath[diagonalPath] = void 0; continue; } if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) { basePath = this.addToPath(addPath, true, false, 0, options); } else { basePath = this.addToPath(removePath, false, true, 1, options); } newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options); if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) { return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true; } else { bestPath[diagonalPath] = basePath; if (basePath.oldPos + 1 >= oldLen) { maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1); } if (newPos + 1 >= newLen) { minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1); } } } editLength++; }; if (callback) { (function exec() { setTimeout(function() { if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) { return callback(void 0); } if (!execEditLength()) { exec(); } }, 0); })(); } else { while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) { const ret = execEditLength(); if (ret) { return ret; } } } } addToPath(path, added, removed, oldPosInc, options) { const last = path.lastComponent; if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) { return { oldPos: path.oldPos + oldPosInc, lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent } }; } else { return { oldPos: path.oldPos + oldPosInc, lastComponent: { count: 1, added, removed, previousComponent: last } }; } } extractCommon(basePath, newTokens, oldTokens, diagonalPath, options) { const newLen = newTokens.length, oldLen = oldTokens.length; let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0; while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options)) { newPos++; oldPos++; commonCount++; if (options.oneChangePerToken) { basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false }; } } if (commonCount && !options.oneChangePerToken) { basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false }; } basePath.oldPos = oldPos; return newPos; } equals(left, right, options) { if (options.comparator) { return options.comparator(left, right); } else { return left === right || !!options.ignoreCase && left.toLowerCase() === right.toLowerCase(); } } removeEmpty(array) { const ret = []; for (let i2 = 0; i2 < array.length; i2++) { if (array[i2]) { ret.push(array[i2]); } } return ret; } // eslint-disable-next-line @typescript-eslint/no-unused-vars castInput(value, options) { return value; } // eslint-disable-next-line @typescript-eslint/no-unused-vars tokenize(value, options) { return Array.from(value); } join(chars) { return chars.join(""); } postProcess(changeObjects, options) { return changeObjects; } get useLongestToken() { return false; } buildValues(lastComponent, newTokens, oldTokens) { const components = []; let nextComponent; while (lastComponent) { components.push(lastComponent); nextComponent = lastComponent.previousComponent; delete lastComponent.previousComponent; lastComponent = nextComponent; } components.reverse(); const componentLen = components.length; let componentPos = 0, newPos = 0, oldPos = 0; for (; componentPos < componentLen; componentPos++) { const component = components[componentPos]; if (!component.removed) { if (!component.added && this.useLongestToken) { let value = newTokens.slice(newPos, newPos + component.count); value = value.map(function(value2, i2) { const oldValue = oldTokens[oldPos + i2]; return oldValue.length > value2.length ? oldValue : value2; }); component.value = this.join(value); } else { component.value = this.join(newTokens.slice(newPos, newPos + component.count)); } newPos += component.count; if (!component.added) { oldPos += component.count; } } else { component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count)); oldPos += component.count; } } return components; } }; // node_modules/diff/libesm/diff/character.js var CharacterDiff = class extends Diff { }; var characterDiff = new CharacterDiff(); function diffChars(oldStr, newStr, options) { return characterDiff.diff(oldStr, newStr, options); } // packages/block-editor/build-module/components/block-compare/index.mjs var import_i18n22 = __toESM(require_i18n(), 1); var import_blocks17 = __toESM(require_blocks(), 1); // packages/block-editor/build-module/components/block-compare/block-view.mjs var import_components22 = __toESM(require_components(), 1); var import_element21 = __toESM(require_element(), 1); var import_dom = __toESM(require_dom(), 1); var import_jsx_runtime142 = __toESM(require_jsx_runtime(), 1); function BlockView({ title, rawContent, renderedContent, action, actionText, className }) { return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className, children: [ /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "block-editor-block-compare__content", children: [ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("h2", { className: "block-editor-block-compare__heading", children: title }), /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "block-editor-block-compare__html", children: rawContent }), /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "block-editor-block-compare__preview edit-post-visual-editor", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_element21.RawHTML, { children: (0, import_dom.safeHTML)(renderedContent) }) }) ] }), /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "block-editor-block-compare__action", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)( import_components22.Button, { __next40pxDefaultSize: true, variant: "secondary", tabIndex: "0", onClick: action, children: actionText } ) }) ] }); } // packages/block-editor/build-module/components/block-compare/index.mjs var import_jsx_runtime143 = __toESM(require_jsx_runtime(), 1); function BlockCompare({ block, onKeep, onConvert, convertor, convertButtonText }) { function getDifference(originalContent, newContent) { const difference2 = diffChars(originalContent, newContent); return difference2.map((item, pos) => { const classes = clsx_default({ "block-editor-block-compare__added": item.added, "block-editor-block-compare__removed": item.removed }); return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("span", { className: classes, children: item.value }, pos); }); } function getConvertedContent(convertedBlock) { const newBlocks = Array.isArray(convertedBlock) ? convertedBlock : [convertedBlock]; const newContent = newBlocks.map( (item) => (0, import_blocks17.getSaveContent)(item.name, item.attributes, item.innerBlocks) ); return newContent.join(""); } const converted = getConvertedContent(convertor(block)); const difference = getDifference(block.originalContent, converted); return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { className: "block-editor-block-compare__wrapper", children: [ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)( BlockView, { title: (0, import_i18n22.__)("Current"), className: "block-editor-block-compare__current", action: onKeep, actionText: (0, import_i18n22.__)("Convert to HTML"), rawContent: block.originalContent, renderedContent: block.originalContent } ), /* @__PURE__ */ (0, import_jsx_runtime143.jsx)( BlockView, { title: (0, import_i18n22.__)("After Conversion"), className: "block-editor-block-compare__converted", action: onConvert, actionText: convertButtonText, rawContent: difference, renderedContent: converted } ) ] }); } var block_compare_default = BlockCompare; // packages/block-editor/build-module/components/block-list/block-invalid-warning.mjs var import_jsx_runtime144 = __toESM(require_jsx_runtime(), 1); var blockToBlocks = (block) => (0, import_blocks18.rawHandler)({ HTML: block.originalContent }); function BlockInvalidWarning({ clientId }) { const { block, canInsertHTMLBlock } = (0, import_data19.useSelect)( (select3) => { const { canInsertBlockType: canInsertBlockType2, getBlock: getBlock2, getBlockRootClientId: getBlockRootClientId2 } = select3(store); const rootClientId = getBlockRootClientId2(clientId); return { block: getBlock2(clientId), canInsertHTMLBlock: canInsertBlockType2( "core/html", rootClientId ) }; }, [clientId] ); const { replaceBlock: replaceBlock2 } = (0, import_data19.useDispatch)(store); const [compare2, setCompare] = (0, import_element22.useState)(false); const onCompareClose = (0, import_element22.useCallback)(() => setCompare(false), []); const convert = (0, import_element22.useMemo)( () => ({ toHTML() { const htmlBlock = (0, import_blocks18.createBlock)( "core/html", {}, [], [block.originalContent] ); return replaceBlock2(block.clientId, htmlBlock); }, toBlocks() { const newBlocks = blockToBlocks(block); return replaceBlock2(block.clientId, newBlocks); }, toRecoveredBlock() { const recoveredBlock = (0, import_blocks18.createBlock)( block.name, block.attributes, block.innerBlocks ); return replaceBlock2(block.clientId, recoveredBlock); } }), [block, replaceBlock2] ); const secondaryActions = (0, import_element22.useMemo)( () => [ { // translators: Button to fix block content title: (0, import_i18n23._x)("Resolve", "imperative verb"), onClick: () => setCompare(true) }, canInsertHTMLBlock && { title: (0, import_i18n23.__)("Convert to HTML"), onClick: convert.toHTML } ].filter(Boolean), [canInsertHTMLBlock, convert] ); return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(import_jsx_runtime144.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)( warning_default, { actions: [ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)( import_components23.Button, { __next40pxDefaultSize: true, onClick: convert.toRecoveredBlock, variant: "primary", children: (0, import_i18n23.__)("Attempt recovery") }, "recover" ) ], secondaryActions, children: (0, import_i18n23.__)("Block contains unexpected or invalid content.") } ), compare2 && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)( import_components23.Modal, { title: ( // translators: Dialog title to fix block content (0, import_i18n23.__)("Resolve Block") ), onRequestClose: onCompareClose, className: "block-editor-block-compare", children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)( block_compare_default, { block, onKeep: convert.toHTML, onConvert: convert.toBlocks, convertor: blockToBlocks, convertButtonText: (0, import_i18n23.__)("Convert to Blocks") } ) } ) ] }); } // packages/block-editor/build-module/components/block-list/block-crash-warning.mjs var import_i18n24 = __toESM(require_i18n(), 1); var import_jsx_runtime145 = __toESM(require_jsx_runtime(), 1); var warning = /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(warning_default, { className: "block-editor-block-list__block-crash-warning", children: (0, import_i18n24.__)("This block has encountered an error and cannot be previewed.") }); function BlockCrashWarning() { return warning; } // packages/block-editor/build-module/components/block-list/block-crash-boundary.mjs var import_element23 = __toESM(require_element(), 1); var BlockCrashBoundary = class extends import_element23.Component { constructor() { super(...arguments); this.state = { hasError: false }; } componentDidCatch() { this.setState({ hasError: true }); } render() { if (this.state.hasError) { return this.props.fallback; } return this.props.children; } }; var block_crash_boundary_default = BlockCrashBoundary; // packages/block-editor/build-module/components/block-list/block-html.mjs var import_react_autosize_textarea = __toESM(require_lib(), 1); var import_element24 = __toESM(require_element(), 1); var import_data20 = __toESM(require_data(), 1); var import_blocks19 = __toESM(require_blocks(), 1); // packages/block-editor/build-module/utils/native-undo.mjs var import_compose8 = __toESM(require_compose(), 1); var nativeUndoNodes = /* @__PURE__ */ new WeakSet(); function useNativeUndo() { return (0, import_compose8.useRefEffect)((node) => { nativeUndoNodes.add(node); return () => { nativeUndoNodes.delete(node); }; }, []); } function usesNativeUndo(event) { let { target } = event; if (target?.nodeName === "IFRAME") { target = target.contentDocument?.activeElement; } while (target) { if (nativeUndoNodes.has(target)) { return true; } target = target.parentElement; } return false; } // packages/block-editor/build-module/components/block-list/block-html.mjs var import_jsx_runtime146 = __toESM(require_jsx_runtime(), 1); function BlockHTML({ clientId }) { const [html, setHtml] = (0, import_element24.useState)(""); const nativeUndoRef = useNativeUndo(); const block = (0, import_data20.useSelect)( (select3) => select3(store).getBlock(clientId), [clientId] ); const { updateBlock: updateBlock2 } = (0, import_data20.useDispatch)(store); const blockContent = (0, import_element24.useMemo)( () => block ? (0, import_blocks19.getBlockContent)(block) : "", [block] ); const onChange = () => { const blockType = (0, import_blocks19.getBlockType)(block.name); if (!blockType) { return; } const attributes = (0, import_blocks19.getBlockAttributes)( blockType, html, block.attributes ); const content = html ? html : (0, import_blocks19.getSaveContent)(blockType, attributes); const [isValid2] = html ? (0, import_blocks19.validateBlock)({ ...block, attributes, originalContent: content }) : [true]; updateBlock2(clientId, { attributes, originalContent: content, isValid: isValid2 }); if (!html) { setHtml(content); } }; (0, import_element24.useEffect)(() => { setHtml(blockContent); }, [blockContent]); return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)( import_react_autosize_textarea.default, { className: "block-editor-block-list__block-html-textarea", value: html, onBlur: onChange, onChange: (event) => setHtml(event.target.value), ref: nativeUndoRef } ); } var block_html_default = BlockHTML; // packages/block-editor/build-module/components/block-list/use-block-props/index.mjs var import_element32 = __toESM(require_element(), 1); var import_i18n30 = __toESM(require_i18n(), 1); var import_blocks22 = __toESM(require_blocks(), 1); var import_compose18 = __toESM(require_compose(), 1); var import_warning4 = __toESM(require_warning(), 1); // node_modules/@react-spring/rafz/dist/react-spring-rafz.esm.js var updateQueue = makeQueue(); var raf = (fn) => schedule(fn, updateQueue); var writeQueue = makeQueue(); raf.write = (fn) => schedule(fn, writeQueue); var onStartQueue = makeQueue(); raf.onStart = (fn) => schedule(fn, onStartQueue); var onFrameQueue = makeQueue(); raf.onFrame = (fn) => schedule(fn, onFrameQueue); var onFinishQueue = makeQueue(); raf.onFinish = (fn) => schedule(fn, onFinishQueue); var timeouts = []; raf.setTimeout = (handler, ms) => { let time = raf.now() + ms; let cancel = () => { let i2 = timeouts.findIndex((t3) => t3.cancel == cancel); if (~i2) timeouts.splice(i2, 1); pendingCount -= ~i2 ? 1 : 0; }; let timeout = { time, handler, cancel }; timeouts.splice(findTimeout(time), 0, timeout); pendingCount += 1; start(); return timeout; }; var findTimeout = (time) => ~(~timeouts.findIndex((t3) => t3.time > time) || ~timeouts.length); raf.cancel = (fn) => { onStartQueue.delete(fn); onFrameQueue.delete(fn); onFinishQueue.delete(fn); updateQueue.delete(fn); writeQueue.delete(fn); }; raf.sync = (fn) => { sync = true; raf.batchedUpdates(fn); sync = false; }; raf.throttle = (fn) => { let lastArgs; function queuedFn() { try { fn(...lastArgs); } finally { lastArgs = null; } } function throttled(...args) { lastArgs = args; raf.onStart(queuedFn); } throttled.handler = fn; throttled.cancel = () => { onStartQueue.delete(queuedFn); lastArgs = null; }; return throttled; }; var nativeRaf = typeof window != "undefined" ? window.requestAnimationFrame : () => { }; raf.use = (impl) => nativeRaf = impl; raf.now = typeof performance != "undefined" ? () => performance.now() : Date.now; raf.batchedUpdates = (fn) => fn(); raf.catch = console.error; raf.frameLoop = "always"; raf.advance = () => { if (raf.frameLoop !== "demand") { console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"); } else { update(); } }; var ts = -1; var pendingCount = 0; var sync = false; function schedule(fn, queue) { if (sync) { queue.delete(fn); fn(0); } else { queue.add(fn); start(); } } function start() { if (ts < 0) { ts = 0; if (raf.frameLoop !== "demand") { nativeRaf(loop); } } } function stop() { ts = -1; } function loop() { if (~ts) { nativeRaf(loop); raf.batchedUpdates(update); } } function update() { let prevTs = ts; ts = raf.now(); let count = findTimeout(ts); if (count) { eachSafely(timeouts.splice(0, count), (t3) => t3.handler()); pendingCount -= count; } if (!pendingCount) { stop(); return; } onStartQueue.flush(); updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667); onFrameQueue.flush(); writeQueue.flush(); onFinishQueue.flush(); } function makeQueue() { let next = /* @__PURE__ */ new Set(); let current = next; return { add(fn) { pendingCount += current == next && !next.has(fn) ? 1 : 0; next.add(fn); }, delete(fn) { pendingCount -= current == next && next.has(fn) ? 1 : 0; return next.delete(fn); }, flush(arg) { if (current.size) { next = /* @__PURE__ */ new Set(); pendingCount -= current.size; eachSafely(current, (fn) => fn(arg) && next.add(fn)); pendingCount += next.size; current = next; } } }; } function eachSafely(values, each2) { values.forEach((value) => { try { each2(value); } catch (e2) { raf.catch(e2); } }); } // node_modules/@react-spring/shared/dist/react-spring-shared.esm.js var import_react = __toESM(require_react()); function noop3() { } var defineHidden = (obj, key, value) => Object.defineProperty(obj, key, { value, writable: true, configurable: true }); var is = { arr: Array.isArray, obj: (a2) => !!a2 && a2.constructor.name === "Object", fun: (a2) => typeof a2 === "function", str: (a2) => typeof a2 === "string", num: (a2) => typeof a2 === "number", und: (a2) => a2 === void 0 }; function isEqual(a2, b2) { if (is.arr(a2)) { if (!is.arr(b2) || a2.length !== b2.length) return false; for (let i2 = 0; i2 < a2.length; i2++) { if (a2[i2] !== b2[i2]) return false; } return true; } return a2 === b2; } var each = (obj, fn) => obj.forEach(fn); function eachProp(obj, fn, ctx2) { if (is.arr(obj)) { for (let i2 = 0; i2 < obj.length; i2++) { fn.call(ctx2, obj[i2], `${i2}`); } return; } for (const key in obj) { if (obj.hasOwnProperty(key)) { fn.call(ctx2, obj[key], key); } } } var toArray = (a2) => is.und(a2) ? [] : is.arr(a2) ? a2 : [a2]; function flush(queue, iterator) { if (queue.size) { const items = Array.from(queue); queue.clear(); each(items, iterator); } } var flushCalls = (queue, ...args) => flush(queue, (fn) => fn(...args)); var isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent); var createStringInterpolator$1; var to; var colors$1 = null; var skipAnimation = false; var willAdvance = noop3; var assign = (globals2) => { if (globals2.to) to = globals2.to; if (globals2.now) raf.now = globals2.now; if (globals2.colors !== void 0) colors$1 = globals2.colors; if (globals2.skipAnimation != null) skipAnimation = globals2.skipAnimation; if (globals2.createStringInterpolator) createStringInterpolator$1 = globals2.createStringInterpolator; if (globals2.requestAnimationFrame) raf.use(globals2.requestAnimationFrame); if (globals2.batchedUpdates) raf.batchedUpdates = globals2.batchedUpdates; if (globals2.willAdvance) willAdvance = globals2.willAdvance; if (globals2.frameLoop) raf.frameLoop = globals2.frameLoop; }; var globals = /* @__PURE__ */ Object.freeze({ __proto__: null, get createStringInterpolator() { return createStringInterpolator$1; }, get to() { return to; }, get colors() { return colors$1; }, get skipAnimation() { return skipAnimation; }, get willAdvance() { return willAdvance; }, assign }); var startQueue = /* @__PURE__ */ new Set(); var currentFrame = []; var prevFrame = []; var priority = 0; var frameLoop = { get idle() { return !startQueue.size && !currentFrame.length; }, start(animation) { if (priority > animation.priority) { startQueue.add(animation); raf.onStart(flushStartQueue); } else { startSafely(animation); raf(advance); } }, advance, sort(animation) { if (priority) { raf.onFrame(() => frameLoop.sort(animation)); } else { const prevIndex = currentFrame.indexOf(animation); if (~prevIndex) { currentFrame.splice(prevIndex, 1); startUnsafely(animation); } } }, clear() { currentFrame = []; startQueue.clear(); } }; function flushStartQueue() { startQueue.forEach(startSafely); startQueue.clear(); raf(advance); } function startSafely(animation) { if (!currentFrame.includes(animation)) startUnsafely(animation); } function startUnsafely(animation) { currentFrame.splice(findIndex(currentFrame, (other) => other.priority > animation.priority), 0, animation); } function advance(dt) { const nextFrame = prevFrame; for (let i2 = 0; i2 < currentFrame.length; i2++) { const animation = currentFrame[i2]; priority = animation.priority; if (!animation.idle) { willAdvance(animation); animation.advance(dt); if (!animation.idle) { nextFrame.push(animation); } } } priority = 0; prevFrame = currentFrame; prevFrame.length = 0; currentFrame = nextFrame; return currentFrame.length > 0; } function findIndex(arr, test) { const index2 = arr.findIndex(test); return index2 < 0 ? arr.length : index2; } var colors = { transparent: 0, aliceblue: 4042850303, antiquewhite: 4209760255, aqua: 16777215, aquamarine: 2147472639, azure: 4043309055, beige: 4126530815, bisque: 4293182719, black: 255, blanchedalmond: 4293643775, blue: 65535, blueviolet: 2318131967, brown: 2771004159, burlywood: 3736635391, burntsienna: 3934150143, cadetblue: 1604231423, chartreuse: 2147418367, chocolate: 3530104575, coral: 4286533887, cornflowerblue: 1687547391, cornsilk: 4294499583, crimson: 3692313855, cyan: 16777215, darkblue: 35839, darkcyan: 9145343, darkgoldenrod: 3095792639, darkgray: 2846468607, darkgreen: 6553855, darkgrey: 2846468607, darkkhaki: 3182914559, darkmagenta: 2332068863, darkolivegreen: 1433087999, darkorange: 4287365375, darkorchid: 2570243327, darkred: 2332033279, darksalmon: 3918953215, darkseagreen: 2411499519, darkslateblue: 1211993087, darkslategray: 793726975, darkslategrey: 793726975, darkturquoise: 13554175, darkviolet: 2483082239, deeppink: 4279538687, deepskyblue: 12582911, dimgray: 1768516095, dimgrey: 1768516095, dodgerblue: 512819199, firebrick: 2988581631, floralwhite: 4294635775, forestgreen: 579543807, fuchsia: 4278255615, gainsboro: 3705462015, ghostwhite: 4177068031, gold: 4292280575, goldenrod: 3668254975, gray: 2155905279, green: 8388863, greenyellow: 2919182335, grey: 2155905279, honeydew: 4043305215, hotpink: 4285117695, indianred: 3445382399, indigo: 1258324735, ivory: 4294963455, khaki: 4041641215, lavender: 3873897215, lavenderblush: 4293981695, lawngreen: 2096890111, lemonchiffon: 4294626815, lightblue: 2916673279, lightcoral: 4034953471, lightcyan: 3774873599, lightgoldenrodyellow: 4210742015, lightgray: 3553874943, lightgreen: 2431553791, lightgrey: 3553874943, lightpink: 4290167295, lightsalmon: 4288707327, lightseagreen: 548580095, lightskyblue: 2278488831, lightslategray: 2005441023, lightslategrey: 2005441023, lightsteelblue: 2965692159, lightyellow: 4294959359, lime: 16711935, limegreen: 852308735, linen: 4210091775, magenta: 4278255615, maroon: 2147483903, mediumaquamarine: 1724754687, mediumblue: 52735, mediumorchid: 3126187007, mediumpurple: 2473647103, mediumseagreen: 1018393087, mediumslateblue: 2070474495, mediumspringgreen: 16423679, mediumturquoise: 1221709055, mediumvioletred: 3340076543, midnightblue: 421097727, mintcream: 4127193855, mistyrose: 4293190143, moccasin: 4293178879, navajowhite: 4292783615, navy: 33023, oldlace: 4260751103, olive: 2155872511, olivedrab: 1804477439, orange: 4289003775, orangered: 4282712319, orchid: 3664828159, palegoldenrod: 4008225535, palegreen: 2566625535, paleturquoise: 2951671551, palevioletred: 3681588223, papayawhip: 4293907967, peachpuff: 4292524543, peru: 3448061951, pink: 4290825215, plum: 3718307327, powderblue: 2967529215, purple: 2147516671, rebeccapurple: 1714657791, red: 4278190335, rosybrown: 3163525119, royalblue: 1097458175, saddlebrown: 2336560127, salmon: 4202722047, sandybrown: 4104413439, seagreen: 780883967, seashell: 4294307583, sienna: 2689740287, silver: 3233857791, skyblue: 2278484991, slateblue: 1784335871, slategray: 1887473919, slategrey: 1887473919, snow: 4294638335, springgreen: 16744447, steelblue: 1182971135, tan: 3535047935, teal: 8421631, thistle: 3636451583, tomato: 4284696575, turquoise: 1088475391, violet: 4001558271, wheat: 4125012991, white: 4294967295, whitesmoke: 4126537215, yellow: 4294902015, yellowgreen: 2597139199 }; var NUMBER = "[-+]?\\d*\\.?\\d+"; var PERCENTAGE = NUMBER + "%"; function call(...parts) { return "\\(\\s*(" + parts.join(")\\s*,\\s*(") + ")\\s*\\)"; } var rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER)); var rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER)); var hsl = new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE)); var hsla = new RegExp("hsla" + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)); var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/; var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/; var hex6 = /^#([0-9a-fA-F]{6})$/; var hex8 = /^#([0-9a-fA-F]{8})$/; function normalizeColor(color) { let match2; if (typeof color === "number") { return color >>> 0 === color && color >= 0 && color <= 4294967295 ? color : null; } if (match2 = hex6.exec(color)) return parseInt(match2[1] + "ff", 16) >>> 0; if (colors$1 && colors$1[color] !== void 0) { return colors$1[color]; } if (match2 = rgb.exec(color)) { return (parse255(match2[1]) << 24 | parse255(match2[2]) << 16 | parse255(match2[3]) << 8 | 255) >>> 0; } if (match2 = rgba.exec(color)) { return (parse255(match2[1]) << 24 | parse255(match2[2]) << 16 | parse255(match2[3]) << 8 | parse1(match2[4])) >>> 0; } if (match2 = hex3.exec(color)) { return parseInt(match2[1] + match2[1] + match2[2] + match2[2] + match2[3] + match2[3] + "ff", 16) >>> 0; } if (match2 = hex8.exec(color)) return parseInt(match2[1], 16) >>> 0; if (match2 = hex4.exec(color)) { return parseInt(match2[1] + match2[1] + match2[2] + match2[2] + match2[3] + match2[3] + match2[4] + match2[4], 16) >>> 0; } if (match2 = hsl.exec(color)) { return (hslToRgb(parse360(match2[1]), parsePercentage(match2[2]), parsePercentage(match2[3])) | 255) >>> 0; } if (match2 = hsla.exec(color)) { return (hslToRgb(parse360(match2[1]), parsePercentage(match2[2]), parsePercentage(match2[3])) | parse1(match2[4])) >>> 0; } return null; } function hue2rgb(p2, q, t3) { if (t3 < 0) t3 += 1; if (t3 > 1) t3 -= 1; if (t3 < 1 / 6) return p2 + (q - p2) * 6 * t3; if (t3 < 1 / 2) return q; if (t3 < 2 / 3) return p2 + (q - p2) * (2 / 3 - t3) * 6; return p2; } function hslToRgb(h2, s2, l2) { const q = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2; const p2 = 2 * l2 - q; const r3 = hue2rgb(p2, q, h2 + 1 / 3); const g2 = hue2rgb(p2, q, h2); const b2 = hue2rgb(p2, q, h2 - 1 / 3); return Math.round(r3 * 255) << 24 | Math.round(g2 * 255) << 16 | Math.round(b2 * 255) << 8; } function parse255(str) { const int = parseInt(str, 10); if (int < 0) return 0; if (int > 255) return 255; return int; } function parse360(str) { const int = parseFloat(str); return (int % 360 + 360) % 360 / 360; } function parse1(str) { const num = parseFloat(str); if (num < 0) return 0; if (num > 1) return 255; return Math.round(num * 255); } function parsePercentage(str) { const int = parseFloat(str); if (int < 0) return 0; if (int > 100) return 1; return int / 100; } function colorToRgba(input) { let int32Color = normalizeColor(input); if (int32Color === null) return input; int32Color = int32Color || 0; let r3 = (int32Color & 4278190080) >>> 24; let g2 = (int32Color & 16711680) >>> 16; let b2 = (int32Color & 65280) >>> 8; let a2 = (int32Color & 255) / 255; return `rgba(${r3}, ${g2}, ${b2}, ${a2})`; } var createInterpolator = (range2, output, extrapolate) => { if (is.fun(range2)) { return range2; } if (is.arr(range2)) { return createInterpolator({ range: range2, output, extrapolate }); } if (is.str(range2.output[0])) { return createStringInterpolator$1(range2); } const config2 = range2; const outputRange = config2.output; const inputRange = config2.range || [0, 1]; const extrapolateLeft = config2.extrapolateLeft || config2.extrapolate || "extend"; const extrapolateRight = config2.extrapolateRight || config2.extrapolate || "extend"; const easing = config2.easing || ((t3) => t3); return (input) => { const range3 = findRange(input, inputRange); return interpolate(input, inputRange[range3], inputRange[range3 + 1], outputRange[range3], outputRange[range3 + 1], easing, extrapolateLeft, extrapolateRight, config2.map); }; }; function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) { let result = map ? map(input) : input; if (result < inputMin) { if (extrapolateLeft === "identity") return result; else if (extrapolateLeft === "clamp") result = inputMin; } if (result > inputMax) { if (extrapolateRight === "identity") return result; else if (extrapolateRight === "clamp") result = inputMax; } if (outputMin === outputMax) return outputMin; if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax; if (inputMin === -Infinity) result = -result; else if (inputMax === Infinity) result = result - inputMin; else result = (result - inputMin) / (inputMax - inputMin); result = easing(result); if (outputMin === -Infinity) result = -result; else if (outputMax === Infinity) result = result + outputMin; else result = result * (outputMax - outputMin) + outputMin; return result; } function findRange(input, inputRange) { for (var i2 = 1; i2 < inputRange.length - 1; ++i2) if (inputRange[i2] >= input) break; return i2 - 1; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } var $get = /* @__PURE__ */ Symbol.for("FluidValue.get"); var $observers = /* @__PURE__ */ Symbol.for("FluidValue.observers"); var hasFluidValue = (arg) => Boolean(arg && arg[$get]); var getFluidValue = (arg) => arg && arg[$get] ? arg[$get]() : arg; var getFluidObservers = (target) => target[$observers] || null; function callFluidObserver(observer, event) { if (observer.eventObserved) { observer.eventObserved(event); } else { observer(event); } } function callFluidObservers(target, event) { let observers = target[$observers]; if (observers) { observers.forEach((observer) => { callFluidObserver(observer, event); }); } } var FluidValue = class { constructor(get) { this[$get] = void 0; this[$observers] = void 0; if (!get && !(get = this.get)) { throw Error("Unknown getter"); } setFluidGetter(this, get); } }; var setFluidGetter = (target, get) => setHidden(target, $get, get); function addFluidObserver(target, observer) { if (target[$get]) { let observers = target[$observers]; if (!observers) { setHidden(target, $observers, observers = /* @__PURE__ */ new Set()); } if (!observers.has(observer)) { observers.add(observer); if (target.observerAdded) { target.observerAdded(observers.size, observer); } } } return observer; } function removeFluidObserver(target, observer) { let observers = target[$observers]; if (observers && observers.has(observer)) { const count = observers.size - 1; if (count) { observers.delete(observer); } else { target[$observers] = null; } if (target.observerRemoved) { target.observerRemoved(count, observer); } } } var setHidden = (target, key, value) => Object.defineProperty(target, key, { value, writable: true, configurable: true }); var numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; var colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; var unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, "i"); var rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi; var cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/; var variableToRgba = (input) => { const [token, fallback] = parseCSSVariable(input); if (!token || isSSR()) { return input; } const value = window.getComputedStyle(document.documentElement).getPropertyValue(token); if (value) { return value.trim(); } else if (fallback && fallback.startsWith("--")) { const _value = window.getComputedStyle(document.documentElement).getPropertyValue(fallback); if (_value) { return _value; } else { return input; } } else if (fallback && cssVariableRegex.test(fallback)) { return variableToRgba(fallback); } else if (fallback) { return fallback; } return input; }; var parseCSSVariable = (current) => { const match2 = cssVariableRegex.exec(current); if (!match2) return [,]; const [, token, fallback] = match2; return [token, fallback]; }; var namedColorRegex; var rgbaRound = (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`; var createStringInterpolator = (config2) => { if (!namedColorRegex) namedColorRegex = colors$1 ? new RegExp(`(${Object.keys(colors$1).join("|")})(?!\\w)`, "g") : /^\b$/; const output = config2.output.map((value) => { return getFluidValue(value).replace(cssVariableRegex, variableToRgba).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba); }); const keyframes = output.map((value) => value.match(numberRegex).map(Number)); const outputRanges = keyframes[0].map((_, i2) => keyframes.map((values) => { if (!(i2 in values)) { throw Error('The arity of each "output" value must be equal'); } return values[i2]; })); const interpolators = outputRanges.map((output2) => createInterpolator(_extends({}, config2, { output: output2 }))); return (input) => { var _output$find; const missingUnit = !unitRegex.test(output[0]) && ((_output$find = output.find((value) => unitRegex.test(value))) == null ? void 0 : _output$find.replace(numberRegex, "")); let i2 = 0; return output[0].replace(numberRegex, () => `${interpolators[i2++](input)}${missingUnit || ""}`).replace(rgbaRegex, rgbaRound); }; }; var prefix = "react-spring: "; var once = (fn) => { const func = fn; let called = false; if (typeof func != "function") { throw new TypeError(`${prefix}once requires a function parameter`); } return (...args) => { if (!called) { func(...args); called = true; } }; }; var warnInterpolate = once(console.warn); function deprecateInterpolate() { warnInterpolate(`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`); } var warnDirectCall = once(console.warn); function isAnimatedString(value) { return is.str(value) && (value[0] == "#" || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {})); } var useIsomorphicLayoutEffect = isSSR() ? import_react.useEffect : import_react.useLayoutEffect; var useIsMounted = () => { const isMounted = (0, import_react.useRef)(false); useIsomorphicLayoutEffect(() => { isMounted.current = true; return () => { isMounted.current = false; }; }, []); return isMounted; }; function useForceUpdate() { const update4 = (0, import_react.useState)()[1]; const isMounted = useIsMounted(); return () => { if (isMounted.current) { update4(Math.random()); } }; } function useMemoOne(getResult, inputs) { const [initial2] = (0, import_react.useState)(() => ({ inputs, result: getResult() })); const committed = (0, import_react.useRef)(); const prevCache = committed.current; let cache = prevCache; if (cache) { const useCache = Boolean(inputs && cache.inputs && areInputsEqual(inputs, cache.inputs)); if (!useCache) { cache = { inputs, result: getResult() }; } } else { cache = initial2; } (0, import_react.useEffect)(() => { committed.current = cache; if (prevCache == initial2) { initial2.inputs = initial2.result = void 0; } }, [cache]); return cache.result; } function areInputsEqual(next, prev) { if (next.length !== prev.length) { return false; } for (let i2 = 0; i2 < next.length; i2++) { if (next[i2] !== prev[i2]) { return false; } } return true; } var useOnce = (effect) => (0, import_react.useEffect)(effect, emptyDeps); var emptyDeps = []; // node_modules/@react-spring/core/dist/react-spring-core.esm.js var React2 = __toESM(require_react()); var import_react3 = __toESM(require_react()); // node_modules/@react-spring/animated/dist/react-spring-animated.esm.js var React = __toESM(require_react()); var import_react2 = __toESM(require_react()); var $node = /* @__PURE__ */ Symbol.for("Animated:node"); var isAnimated = (value) => !!value && value[$node] === value; var getAnimated = (owner) => owner && owner[$node]; var setAnimated = (owner, node) => defineHidden(owner, $node, node); var getPayload = (owner) => owner && owner[$node] && owner[$node].getPayload(); var Animated = class { constructor() { this.payload = void 0; setAnimated(this, this); } getPayload() { return this.payload || []; } }; var AnimatedValue = class _AnimatedValue extends Animated { constructor(_value) { super(); this.done = true; this.elapsedTime = void 0; this.lastPosition = void 0; this.lastVelocity = void 0; this.v0 = void 0; this.durationProgress = 0; this._value = _value; if (is.num(this._value)) { this.lastPosition = this._value; } } static create(value) { return new _AnimatedValue(value); } getPayload() { return [this]; } getValue() { return this._value; } setValue(value, step) { if (is.num(value)) { this.lastPosition = value; if (step) { value = Math.round(value / step) * step; if (this.done) { this.lastPosition = value; } } } if (this._value === value) { return false; } this._value = value; return true; } reset() { const { done } = this; this.done = false; if (is.num(this._value)) { this.elapsedTime = 0; this.durationProgress = 0; this.lastPosition = this._value; if (done) this.lastVelocity = null; this.v0 = null; } } }; var AnimatedString = class _AnimatedString extends AnimatedValue { constructor(value) { super(0); this._string = null; this._toString = void 0; this._toString = createInterpolator({ output: [value, value] }); } static create(value) { return new _AnimatedString(value); } getValue() { let value = this._string; return value == null ? this._string = this._toString(this._value) : value; } setValue(value) { if (is.str(value)) { if (value == this._string) { return false; } this._string = value; this._value = 1; } else if (super.setValue(value)) { this._string = null; } else { return false; } return true; } reset(goal) { if (goal) { this._toString = createInterpolator({ output: [this.getValue(), goal] }); } this._value = 0; super.reset(); } }; var TreeContext = { dependencies: null }; var AnimatedObject = class extends Animated { constructor(source) { super(); this.source = source; this.setValue(source); } getValue(animated2) { const values = {}; eachProp(this.source, (source, key) => { if (isAnimated(source)) { values[key] = source.getValue(animated2); } else if (hasFluidValue(source)) { values[key] = getFluidValue(source); } else if (!animated2) { values[key] = source; } }); return values; } setValue(source) { this.source = source; this.payload = this._makePayload(source); } reset() { if (this.payload) { each(this.payload, (node) => node.reset()); } } _makePayload(source) { if (source) { const payload = /* @__PURE__ */ new Set(); eachProp(source, this._addToPayload, payload); return Array.from(payload); } } _addToPayload(source) { if (TreeContext.dependencies && hasFluidValue(source)) { TreeContext.dependencies.add(source); } const payload = getPayload(source); if (payload) { each(payload, (node) => this.add(node)); } } }; var AnimatedArray = class _AnimatedArray extends AnimatedObject { constructor(source) { super(source); } static create(source) { return new _AnimatedArray(source); } getValue() { return this.source.map((node) => node.getValue()); } setValue(source) { const payload = this.getPayload(); if (source.length == payload.length) { return payload.map((node, i2) => node.setValue(source[i2])).some(Boolean); } super.setValue(source.map(makeAnimated)); return true; } }; function makeAnimated(value) { const nodeType = isAnimatedString(value) ? AnimatedString : AnimatedValue; return nodeType.create(value); } function getAnimatedType(value) { const parentNode = getAnimated(value); return parentNode ? parentNode.constructor : is.arr(value) ? AnimatedArray : isAnimatedString(value) ? AnimatedString : AnimatedValue; } function _extends2() { _extends2 = Object.assign ? Object.assign.bind() : function(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends2.apply(this, arguments); } var withAnimated = (Component6, host2) => { const hasInstance = !is.fun(Component6) || Component6.prototype && Component6.prototype.isReactComponent; return (0, import_react2.forwardRef)((givenProps, givenRef) => { const instanceRef = (0, import_react2.useRef)(null); const ref = hasInstance && (0, import_react2.useCallback)((value) => { instanceRef.current = updateRef(givenRef, value); }, [givenRef]); const [props, deps] = getAnimatedState(givenProps, host2); const forceUpdate = useForceUpdate(); const callback = () => { const instance = instanceRef.current; if (hasInstance && !instance) { return; } const didUpdate = instance ? host2.applyAnimatedValues(instance, props.getValue(true)) : false; if (didUpdate === false) { forceUpdate(); } }; const observer = new PropsObserver(callback, deps); const observerRef = (0, import_react2.useRef)(); useIsomorphicLayoutEffect(() => { observerRef.current = observer; each(deps, (dep) => addFluidObserver(dep, observer)); return () => { if (observerRef.current) { each(observerRef.current.deps, (dep) => removeFluidObserver(dep, observerRef.current)); raf.cancel(observerRef.current.update); } }; }); (0, import_react2.useEffect)(callback, []); useOnce(() => () => { const observer2 = observerRef.current; each(observer2.deps, (dep) => removeFluidObserver(dep, observer2)); }); const usedProps = host2.getComponentProps(props.getValue()); return React.createElement(Component6, _extends2({}, usedProps, { ref })); }); }; var PropsObserver = class { constructor(update4, deps) { this.update = update4; this.deps = deps; } eventObserved(event) { if (event.type == "change") { raf.write(this.update); } } }; function getAnimatedState(props, host2) { const dependencies = /* @__PURE__ */ new Set(); TreeContext.dependencies = dependencies; if (props.style) props = _extends2({}, props, { style: host2.createAnimatedStyle(props.style) }); props = new AnimatedObject(props); TreeContext.dependencies = null; return [props, dependencies]; } function updateRef(ref, value) { if (ref) { if (is.fun(ref)) ref(value); else ref.current = value; } return value; } var cacheKey = /* @__PURE__ */ Symbol.for("AnimatedComponent"); var createHost = (components, { applyAnimatedValues: _applyAnimatedValues = () => false, createAnimatedStyle: _createAnimatedStyle = (style) => new AnimatedObject(style), getComponentProps: _getComponentProps = (props) => props } = {}) => { const hostConfig = { applyAnimatedValues: _applyAnimatedValues, createAnimatedStyle: _createAnimatedStyle, getComponentProps: _getComponentProps }; const animated2 = (Component6) => { const displayName = getDisplayName(Component6) || "Anonymous"; if (is.str(Component6)) { Component6 = animated2[Component6] || (animated2[Component6] = withAnimated(Component6, hostConfig)); } else { Component6 = Component6[cacheKey] || (Component6[cacheKey] = withAnimated(Component6, hostConfig)); } Component6.displayName = `Animated(${displayName})`; return Component6; }; eachProp(components, (Component6, key) => { if (is.arr(components)) { key = getDisplayName(Component6); } animated2[key] = animated2(Component6); }); return { animated: animated2 }; }; var getDisplayName = (arg) => is.str(arg) ? arg : arg && is.str(arg.displayName) ? arg.displayName : is.fun(arg) && arg.name || null; // node_modules/@react-spring/core/dist/react-spring-core.esm.js function _extends3() { _extends3 = Object.assign ? Object.assign.bind() : function(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends3.apply(this, arguments); } function callProp(value, ...args) { return is.fun(value) ? value(...args) : value; } var matchProp = (value, key) => value === true || !!(key && value && (is.fun(value) ? value(key) : toArray(value).includes(key))); var resolveProp = (prop, key) => is.obj(prop) ? key && prop[key] : prop; var getDefaultProp = (props, key) => props.default === true ? props[key] : props.default ? props.default[key] : void 0; var noopTransform = (value) => value; var getDefaultProps = (props, transform = noopTransform) => { let keys = DEFAULT_PROPS; if (props.default && props.default !== true) { props = props.default; keys = Object.keys(props); } const defaults2 = {}; for (const key of keys) { const value = transform(props[key], key); if (!is.und(value)) { defaults2[key] = value; } } return defaults2; }; var DEFAULT_PROPS = ["config", "onProps", "onStart", "onChange", "onPause", "onResume", "onRest"]; var RESERVED_PROPS = { config: 1, from: 1, to: 1, ref: 1, loop: 1, reset: 1, pause: 1, cancel: 1, reverse: 1, immediate: 1, default: 1, delay: 1, onProps: 1, onStart: 1, onChange: 1, onPause: 1, onResume: 1, onRest: 1, onResolve: 1, items: 1, trail: 1, sort: 1, expires: 1, initial: 1, enter: 1, update: 1, leave: 1, children: 1, onDestroyed: 1, keys: 1, callId: 1, parentId: 1 }; function getForwardProps(props) { const forward = {}; let count = 0; eachProp(props, (value, prop) => { if (!RESERVED_PROPS[prop]) { forward[prop] = value; count++; } }); if (count) { return forward; } } function inferTo(props) { const to2 = getForwardProps(props); if (to2) { const out = { to: to2 }; eachProp(props, (val, key) => key in to2 || (out[key] = val)); return out; } return _extends3({}, props); } function computeGoal(value) { value = getFluidValue(value); return is.arr(value) ? value.map(computeGoal) : isAnimatedString(value) ? globals.createStringInterpolator({ range: [0, 1], output: [value, value] })(1) : value; } function isAsyncTo(to2) { return is.fun(to2) || is.arr(to2) && is.obj(to2[0]); } var config = { default: { tension: 170, friction: 26 }, gentle: { tension: 120, friction: 14 }, wobbly: { tension: 180, friction: 12 }, stiff: { tension: 210, friction: 20 }, slow: { tension: 280, friction: 60 }, molasses: { tension: 280, friction: 120 } }; var c1 = 1.70158; var c2 = c1 * 1.525; var c3 = c1 + 1; var c4 = 2 * Math.PI / 3; var c5 = 2 * Math.PI / 4.5; var bounceOut = (x2) => { const n1 = 7.5625; const d1 = 2.75; if (x2 < 1 / d1) { return n1 * x2 * x2; } else if (x2 < 2 / d1) { return n1 * (x2 -= 1.5 / d1) * x2 + 0.75; } else if (x2 < 2.5 / d1) { return n1 * (x2 -= 2.25 / d1) * x2 + 0.9375; } else { return n1 * (x2 -= 2.625 / d1) * x2 + 0.984375; } }; var easings = { linear: (x2) => x2, easeInQuad: (x2) => x2 * x2, easeOutQuad: (x2) => 1 - (1 - x2) * (1 - x2), easeInOutQuad: (x2) => x2 < 0.5 ? 2 * x2 * x2 : 1 - Math.pow(-2 * x2 + 2, 2) / 2, easeInCubic: (x2) => x2 * x2 * x2, easeOutCubic: (x2) => 1 - Math.pow(1 - x2, 3), easeInOutCubic: (x2) => x2 < 0.5 ? 4 * x2 * x2 * x2 : 1 - Math.pow(-2 * x2 + 2, 3) / 2, easeInQuart: (x2) => x2 * x2 * x2 * x2, easeOutQuart: (x2) => 1 - Math.pow(1 - x2, 4), easeInOutQuart: (x2) => x2 < 0.5 ? 8 * x2 * x2 * x2 * x2 : 1 - Math.pow(-2 * x2 + 2, 4) / 2, easeInQuint: (x2) => x2 * x2 * x2 * x2 * x2, easeOutQuint: (x2) => 1 - Math.pow(1 - x2, 5), easeInOutQuint: (x2) => x2 < 0.5 ? 16 * x2 * x2 * x2 * x2 * x2 : 1 - Math.pow(-2 * x2 + 2, 5) / 2, easeInSine: (x2) => 1 - Math.cos(x2 * Math.PI / 2), easeOutSine: (x2) => Math.sin(x2 * Math.PI / 2), easeInOutSine: (x2) => -(Math.cos(Math.PI * x2) - 1) / 2, easeInExpo: (x2) => x2 === 0 ? 0 : Math.pow(2, 10 * x2 - 10), easeOutExpo: (x2) => x2 === 1 ? 1 : 1 - Math.pow(2, -10 * x2), easeInOutExpo: (x2) => x2 === 0 ? 0 : x2 === 1 ? 1 : x2 < 0.5 ? Math.pow(2, 20 * x2 - 10) / 2 : (2 - Math.pow(2, -20 * x2 + 10)) / 2, easeInCirc: (x2) => 1 - Math.sqrt(1 - Math.pow(x2, 2)), easeOutCirc: (x2) => Math.sqrt(1 - Math.pow(x2 - 1, 2)), easeInOutCirc: (x2) => x2 < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x2, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x2 + 2, 2)) + 1) / 2, easeInBack: (x2) => c3 * x2 * x2 * x2 - c1 * x2 * x2, easeOutBack: (x2) => 1 + c3 * Math.pow(x2 - 1, 3) + c1 * Math.pow(x2 - 1, 2), easeInOutBack: (x2) => x2 < 0.5 ? Math.pow(2 * x2, 2) * ((c2 + 1) * 2 * x2 - c2) / 2 : (Math.pow(2 * x2 - 2, 2) * ((c2 + 1) * (x2 * 2 - 2) + c2) + 2) / 2, easeInElastic: (x2) => x2 === 0 ? 0 : x2 === 1 ? 1 : -Math.pow(2, 10 * x2 - 10) * Math.sin((x2 * 10 - 10.75) * c4), easeOutElastic: (x2) => x2 === 0 ? 0 : x2 === 1 ? 1 : Math.pow(2, -10 * x2) * Math.sin((x2 * 10 - 0.75) * c4) + 1, easeInOutElastic: (x2) => x2 === 0 ? 0 : x2 === 1 ? 1 : x2 < 0.5 ? -(Math.pow(2, 20 * x2 - 10) * Math.sin((20 * x2 - 11.125) * c5)) / 2 : Math.pow(2, -20 * x2 + 10) * Math.sin((20 * x2 - 11.125) * c5) / 2 + 1, easeInBounce: (x2) => 1 - bounceOut(1 - x2), easeOutBounce: bounceOut, easeInOutBounce: (x2) => x2 < 0.5 ? (1 - bounceOut(1 - 2 * x2)) / 2 : (1 + bounceOut(2 * x2 - 1)) / 2 }; var defaults = _extends3({}, config.default, { mass: 1, damping: 1, easing: easings.linear, clamp: false }); var AnimationConfig = class { constructor() { this.tension = void 0; this.friction = void 0; this.frequency = void 0; this.damping = void 0; this.mass = void 0; this.velocity = 0; this.restVelocity = void 0; this.precision = void 0; this.progress = void 0; this.duration = void 0; this.easing = void 0; this.clamp = void 0; this.bounce = void 0; this.decay = void 0; this.round = void 0; Object.assign(this, defaults); } }; function mergeConfig(config2, newConfig, defaultConfig) { if (defaultConfig) { defaultConfig = _extends3({}, defaultConfig); sanitizeConfig(defaultConfig, newConfig); newConfig = _extends3({}, defaultConfig, newConfig); } sanitizeConfig(config2, newConfig); Object.assign(config2, newConfig); for (const key in defaults) { if (config2[key] == null) { config2[key] = defaults[key]; } } let { mass, frequency, damping } = config2; if (!is.und(frequency)) { if (frequency < 0.01) frequency = 0.01; if (damping < 0) damping = 0; config2.tension = Math.pow(2 * Math.PI / frequency, 2) * mass; config2.friction = 4 * Math.PI * damping * mass / frequency; } return config2; } function sanitizeConfig(config2, props) { if (!is.und(props.decay)) { config2.duration = void 0; } else { const isTensionConfig = !is.und(props.tension) || !is.und(props.friction); if (isTensionConfig || !is.und(props.frequency) || !is.und(props.damping) || !is.und(props.mass)) { config2.duration = void 0; config2.decay = void 0; } if (isTensionConfig) { config2.frequency = void 0; } } } var emptyArray = []; var Animation = class { constructor() { this.changed = false; this.values = emptyArray; this.toValues = null; this.fromValues = emptyArray; this.to = void 0; this.from = void 0; this.config = new AnimationConfig(); this.immediate = false; } }; function scheduleProps(callId, { key, props, defaultProps, state, actions }) { return new Promise((resolve, reject) => { var _props$cancel; let delay; let timeout; let cancel = matchProp((_props$cancel = props.cancel) != null ? _props$cancel : defaultProps == null ? void 0 : defaultProps.cancel, key); if (cancel) { onStart(); } else { if (!is.und(props.pause)) { state.paused = matchProp(props.pause, key); } let pause = defaultProps == null ? void 0 : defaultProps.pause; if (pause !== true) { pause = state.paused || matchProp(pause, key); } delay = callProp(props.delay || 0, key); if (pause) { state.resumeQueue.add(onResume); actions.pause(); } else { actions.resume(); onResume(); } } function onPause() { state.resumeQueue.add(onResume); state.timeouts.delete(timeout); timeout.cancel(); delay = timeout.time - raf.now(); } function onResume() { if (delay > 0 && !globals.skipAnimation) { state.delayed = true; timeout = raf.setTimeout(onStart, delay); state.pauseQueue.add(onPause); state.timeouts.add(timeout); } else { onStart(); } } function onStart() { if (state.delayed) { state.delayed = false; } state.pauseQueue.delete(onPause); state.timeouts.delete(timeout); if (callId <= (state.cancelId || 0)) { cancel = true; } try { actions.start(_extends3({}, props, { callId, cancel }), resolve); } catch (err) { reject(err); } } }); } var getCombinedResult = (target, results) => results.length == 1 ? results[0] : results.some((result) => result.cancelled) ? getCancelledResult(target.get()) : results.every((result) => result.noop) ? getNoopResult(target.get()) : getFinishedResult(target.get(), results.every((result) => result.finished)); var getNoopResult = (value) => ({ value, noop: true, finished: true, cancelled: false }); var getFinishedResult = (value, finished, cancelled = false) => ({ value, finished, cancelled }); var getCancelledResult = (value) => ({ value, cancelled: true, finished: false }); function runAsync(to2, props, state, target) { const { callId, parentId, onRest } = props; const { asyncTo: prevTo, promise: prevPromise } = state; if (!parentId && to2 === prevTo && !props.reset) { return prevPromise; } return state.promise = (async () => { state.asyncId = callId; state.asyncTo = to2; const defaultProps = getDefaultProps(props, (value, key) => key === "onRest" ? void 0 : value); let preventBail; let bail; const bailPromise = new Promise((resolve, reject) => (preventBail = resolve, bail = reject)); const bailIfEnded = (bailSignal) => { const bailResult = callId <= (state.cancelId || 0) && getCancelledResult(target) || callId !== state.asyncId && getFinishedResult(target, false); if (bailResult) { bailSignal.result = bailResult; bail(bailSignal); throw bailSignal; } }; const animate = (arg1, arg2) => { const bailSignal = new BailSignal(); const skipAnimationSignal = new SkipAniamtionSignal(); return (async () => { if (globals.skipAnimation) { stopAsync(state); skipAnimationSignal.result = getFinishedResult(target, false); bail(skipAnimationSignal); throw skipAnimationSignal; } bailIfEnded(bailSignal); const props2 = is.obj(arg1) ? _extends3({}, arg1) : _extends3({}, arg2, { to: arg1 }); props2.parentId = callId; eachProp(defaultProps, (value, key) => { if (is.und(props2[key])) { props2[key] = value; } }); const result2 = await target.start(props2); bailIfEnded(bailSignal); if (state.paused) { await new Promise((resume) => { state.resumeQueue.add(resume); }); } return result2; })(); }; let result; if (globals.skipAnimation) { stopAsync(state); return getFinishedResult(target, false); } try { let animating; if (is.arr(to2)) { animating = (async (queue) => { for (const props2 of queue) { await animate(props2); } })(to2); } else { animating = Promise.resolve(to2(animate, target.stop.bind(target))); } await Promise.all([animating.then(preventBail), bailPromise]); result = getFinishedResult(target.get(), true, false); } catch (err) { if (err instanceof BailSignal) { result = err.result; } else if (err instanceof SkipAniamtionSignal) { result = err.result; } else { throw err; } } finally { if (callId == state.asyncId) { state.asyncId = parentId; state.asyncTo = parentId ? prevTo : void 0; state.promise = parentId ? prevPromise : void 0; } } if (is.fun(onRest)) { raf.batchedUpdates(() => { onRest(result, target, target.item); }); } return result; })(); } function stopAsync(state, cancelId) { flush(state.timeouts, (t3) => t3.cancel()); state.pauseQueue.clear(); state.resumeQueue.clear(); state.asyncId = state.asyncTo = state.promise = void 0; if (cancelId) state.cancelId = cancelId; } var BailSignal = class extends Error { constructor() { super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."); this.result = void 0; } }; var SkipAniamtionSignal = class extends Error { constructor() { super("SkipAnimationSignal"); this.result = void 0; } }; var isFrameValue = (value) => value instanceof FrameValue; var nextId$1 = 1; var FrameValue = class extends FluidValue { constructor(...args) { super(...args); this.id = nextId$1++; this.key = void 0; this._priority = 0; } get priority() { return this._priority; } set priority(priority2) { if (this._priority != priority2) { this._priority = priority2; this._onPriorityChange(priority2); } } get() { const node = getAnimated(this); return node && node.getValue(); } to(...args) { return globals.to(this, args); } interpolate(...args) { deprecateInterpolate(); return globals.to(this, args); } toJSON() { return this.get(); } observerAdded(count) { if (count == 1) this._attach(); } observerRemoved(count) { if (count == 0) this._detach(); } _attach() { } _detach() { } _onChange(value, idle = false) { callFluidObservers(this, { type: "change", parent: this, value, idle }); } _onPriorityChange(priority2) { if (!this.idle) { frameLoop.sort(this); } callFluidObservers(this, { type: "priority", parent: this, priority: priority2 }); } }; var $P = /* @__PURE__ */ Symbol.for("SpringPhase"); var HAS_ANIMATED = 1; var IS_ANIMATING = 2; var IS_PAUSED = 4; var hasAnimated = (target) => (target[$P] & HAS_ANIMATED) > 0; var isAnimating = (target) => (target[$P] & IS_ANIMATING) > 0; var isPaused = (target) => (target[$P] & IS_PAUSED) > 0; var setActiveBit = (target, active) => active ? target[$P] |= IS_ANIMATING | HAS_ANIMATED : target[$P] &= ~IS_ANIMATING; var setPausedBit = (target, paused) => paused ? target[$P] |= IS_PAUSED : target[$P] &= ~IS_PAUSED; var SpringValue = class extends FrameValue { constructor(arg1, arg2) { super(); this.key = void 0; this.animation = new Animation(); this.queue = void 0; this.defaultProps = {}; this._state = { paused: false, delayed: false, pauseQueue: /* @__PURE__ */ new Set(), resumeQueue: /* @__PURE__ */ new Set(), timeouts: /* @__PURE__ */ new Set() }; this._pendingCalls = /* @__PURE__ */ new Set(); this._lastCallId = 0; this._lastToId = 0; this._memoizedDuration = 0; if (!is.und(arg1) || !is.und(arg2)) { const props = is.obj(arg1) ? _extends3({}, arg1) : _extends3({}, arg2, { from: arg1 }); if (is.und(props.default)) { props.default = true; } this.start(props); } } get idle() { return !(isAnimating(this) || this._state.asyncTo) || isPaused(this); } get goal() { return getFluidValue(this.animation.to); } get velocity() { const node = getAnimated(this); return node instanceof AnimatedValue ? node.lastVelocity || 0 : node.getPayload().map((node2) => node2.lastVelocity || 0); } get hasAnimated() { return hasAnimated(this); } get isAnimating() { return isAnimating(this); } get isPaused() { return isPaused(this); } get isDelayed() { return this._state.delayed; } advance(dt) { let idle = true; let changed = false; const anim = this.animation; let { config: config2, toValues } = anim; const payload = getPayload(anim.to); if (!payload && hasFluidValue(anim.to)) { toValues = toArray(getFluidValue(anim.to)); } anim.values.forEach((node2, i2) => { if (node2.done) return; const to2 = node2.constructor == AnimatedString ? 1 : payload ? payload[i2].lastPosition : toValues[i2]; let finished = anim.immediate; let position = to2; if (!finished) { position = node2.lastPosition; if (config2.tension <= 0) { node2.done = true; return; } let elapsed = node2.elapsedTime += dt; const from = anim.fromValues[i2]; const v0 = node2.v0 != null ? node2.v0 : node2.v0 = is.arr(config2.velocity) ? config2.velocity[i2] : config2.velocity; let velocity; const precision = config2.precision || (from == to2 ? 5e-3 : Math.min(1, Math.abs(to2 - from) * 1e-3)); if (!is.und(config2.duration)) { let p2 = 1; if (config2.duration > 0) { if (this._memoizedDuration !== config2.duration) { this._memoizedDuration = config2.duration; if (node2.durationProgress > 0) { node2.elapsedTime = config2.duration * node2.durationProgress; elapsed = node2.elapsedTime += dt; } } p2 = (config2.progress || 0) + elapsed / this._memoizedDuration; p2 = p2 > 1 ? 1 : p2 < 0 ? 0 : p2; node2.durationProgress = p2; } position = from + config2.easing(p2) * (to2 - from); velocity = (position - node2.lastPosition) / dt; finished = p2 == 1; } else if (config2.decay) { const decay = config2.decay === true ? 0.998 : config2.decay; const e2 = Math.exp(-(1 - decay) * elapsed); position = from + v0 / (1 - decay) * (1 - e2); finished = Math.abs(node2.lastPosition - position) <= precision; velocity = v0 * e2; } else { velocity = node2.lastVelocity == null ? v0 : node2.lastVelocity; const restVelocity = config2.restVelocity || precision / 10; const bounceFactor = config2.clamp ? 0 : config2.bounce; const canBounce = !is.und(bounceFactor); const isGrowing = from == to2 ? node2.v0 > 0 : from < to2; let isMoving; let isBouncing = false; const step = 1; const numSteps = Math.ceil(dt / step); for (let n2 = 0; n2 < numSteps; ++n2) { isMoving = Math.abs(velocity) > restVelocity; if (!isMoving) { finished = Math.abs(to2 - position) <= precision; if (finished) { break; } } if (canBounce) { isBouncing = position == to2 || position > to2 == isGrowing; if (isBouncing) { velocity = -velocity * bounceFactor; position = to2; } } const springForce = -config2.tension * 1e-6 * (position - to2); const dampingForce = -config2.friction * 1e-3 * velocity; const acceleration = (springForce + dampingForce) / config2.mass; velocity = velocity + acceleration * step; position = position + velocity * step; } } node2.lastVelocity = velocity; if (Number.isNaN(position)) { console.warn(`Got NaN while animating:`, this); finished = true; } } if (payload && !payload[i2].done) { finished = false; } if (finished) { node2.done = true; } else { idle = false; } if (node2.setValue(position, config2.round)) { changed = true; } }); const node = getAnimated(this); const currVal = node.getValue(); if (idle) { const finalVal = getFluidValue(anim.to); if ((currVal !== finalVal || changed) && !config2.decay) { node.setValue(finalVal); this._onChange(finalVal); } else if (changed && config2.decay) { this._onChange(currVal); } this._stop(); } else if (changed) { this._onChange(currVal); } } set(value) { raf.batchedUpdates(() => { this._stop(); this._focus(value); this._set(value); }); return this; } pause() { this._update({ pause: true }); } resume() { this._update({ pause: false }); } finish() { if (isAnimating(this)) { const { to: to2, config: config2 } = this.animation; raf.batchedUpdates(() => { this._onStart(); if (!config2.decay) { this._set(to2, false); } this._stop(); }); } return this; } update(props) { const queue = this.queue || (this.queue = []); queue.push(props); return this; } start(to2, arg2) { let queue; if (!is.und(to2)) { queue = [is.obj(to2) ? to2 : _extends3({}, arg2, { to: to2 })]; } else { queue = this.queue || []; this.queue = []; } return Promise.all(queue.map((props) => { const up = this._update(props); return up; })).then((results) => getCombinedResult(this, results)); } stop(cancel) { const { to: to2 } = this.animation; this._focus(this.get()); stopAsync(this._state, cancel && this._lastCallId); raf.batchedUpdates(() => this._stop(to2, cancel)); return this; } reset() { this._update({ reset: true }); } eventObserved(event) { if (event.type == "change") { this._start(); } else if (event.type == "priority") { this.priority = event.priority + 1; } } _prepareNode(props) { const key = this.key || ""; let { to: to2, from } = props; to2 = is.obj(to2) ? to2[key] : to2; if (to2 == null || isAsyncTo(to2)) { to2 = void 0; } from = is.obj(from) ? from[key] : from; if (from == null) { from = void 0; } const range2 = { to: to2, from }; if (!hasAnimated(this)) { if (props.reverse) [to2, from] = [from, to2]; from = getFluidValue(from); if (!is.und(from)) { this._set(from); } else if (!getAnimated(this)) { this._set(to2); } } return range2; } _update(_ref, isLoop) { let props = _extends3({}, _ref); const { key, defaultProps } = this; if (props.default) Object.assign(defaultProps, getDefaultProps(props, (value, prop) => /^on/.test(prop) ? resolveProp(value, key) : value)); mergeActiveFn(this, props, "onProps"); sendEvent(this, "onProps", props, this); const range2 = this._prepareNode(props); if (Object.isFrozen(this)) { throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?"); } const state = this._state; return scheduleProps(++this._lastCallId, { key, props, defaultProps, state, actions: { pause: () => { if (!isPaused(this)) { setPausedBit(this, true); flushCalls(state.pauseQueue); sendEvent(this, "onPause", getFinishedResult(this, checkFinished(this, this.animation.to)), this); } }, resume: () => { if (isPaused(this)) { setPausedBit(this, false); if (isAnimating(this)) { this._resume(); } flushCalls(state.resumeQueue); sendEvent(this, "onResume", getFinishedResult(this, checkFinished(this, this.animation.to)), this); } }, start: this._merge.bind(this, range2) } }).then((result) => { if (props.loop && result.finished && !(isLoop && result.noop)) { const nextProps = createLoopUpdate(props); if (nextProps) { return this._update(nextProps, true); } } return result; }); } _merge(range2, props, resolve) { if (props.cancel) { this.stop(true); return resolve(getCancelledResult(this)); } const hasToProp = !is.und(range2.to); const hasFromProp = !is.und(range2.from); if (hasToProp || hasFromProp) { if (props.callId > this._lastToId) { this._lastToId = props.callId; } else { return resolve(getCancelledResult(this)); } } const { key, defaultProps, animation: anim } = this; const { to: prevTo, from: prevFrom } = anim; let { to: to2 = prevTo, from = prevFrom } = range2; if (hasFromProp && !hasToProp && (!props.default || is.und(to2))) { to2 = from; } if (props.reverse) [to2, from] = [from, to2]; const hasFromChanged = !isEqual(from, prevFrom); if (hasFromChanged) { anim.from = from; } from = getFluidValue(from); const hasToChanged = !isEqual(to2, prevTo); if (hasToChanged) { this._focus(to2); } const hasAsyncTo = isAsyncTo(props.to); const { config: config2 } = anim; const { decay, velocity } = config2; if (hasToProp || hasFromProp) { config2.velocity = 0; } if (props.config && !hasAsyncTo) { mergeConfig(config2, callProp(props.config, key), props.config !== defaultProps.config ? callProp(defaultProps.config, key) : void 0); } let node = getAnimated(this); if (!node || is.und(to2)) { return resolve(getFinishedResult(this, true)); } const reset = is.und(props.reset) ? hasFromProp && !props.default : !is.und(from) && matchProp(props.reset, key); const value = reset ? from : this.get(); const goal = computeGoal(to2); const isAnimatable = is.num(goal) || is.arr(goal) || isAnimatedString(goal); const immediate = !hasAsyncTo && (!isAnimatable || matchProp(defaultProps.immediate || props.immediate, key)); if (hasToChanged) { const nodeType = getAnimatedType(to2); if (nodeType !== node.constructor) { if (immediate) { node = this._set(goal); } else throw Error(`Cannot animate between ${node.constructor.name} and ${nodeType.name}, as the "to" prop suggests`); } } const goalType = node.constructor; let started = hasFluidValue(to2); let finished = false; if (!started) { const hasValueChanged = reset || !hasAnimated(this) && hasFromChanged; if (hasToChanged || hasValueChanged) { finished = isEqual(computeGoal(value), goal); started = !finished; } if (!isEqual(anim.immediate, immediate) && !immediate || !isEqual(config2.decay, decay) || !isEqual(config2.velocity, velocity)) { started = true; } } if (finished && isAnimating(this)) { if (anim.changed && !reset) { started = true; } else if (!started) { this._stop(prevTo); } } if (!hasAsyncTo) { if (started || hasFluidValue(prevTo)) { anim.values = node.getPayload(); anim.toValues = hasFluidValue(to2) ? null : goalType == AnimatedString ? [1] : toArray(goal); } if (anim.immediate != immediate) { anim.immediate = immediate; if (!immediate && !reset) { this._set(prevTo); } } if (started) { const { onRest } = anim; each(ACTIVE_EVENTS, (type) => mergeActiveFn(this, props, type)); const result = getFinishedResult(this, checkFinished(this, prevTo)); flushCalls(this._pendingCalls, result); this._pendingCalls.add(resolve); if (anim.changed) raf.batchedUpdates(() => { anim.changed = !reset; onRest == null ? void 0 : onRest(result, this); if (reset) { callProp(defaultProps.onRest, result); } else { anim.onStart == null ? void 0 : anim.onStart(result, this); } }); } } if (reset) { this._set(value); } if (hasAsyncTo) { resolve(runAsync(props.to, props, this._state, this)); } else if (started) { this._start(); } else if (isAnimating(this) && !hasToChanged) { this._pendingCalls.add(resolve); } else { resolve(getNoopResult(value)); } } _focus(value) { const anim = this.animation; if (value !== anim.to) { if (getFluidObservers(this)) { this._detach(); } anim.to = value; if (getFluidObservers(this)) { this._attach(); } } } _attach() { let priority2 = 0; const { to: to2 } = this.animation; if (hasFluidValue(to2)) { addFluidObserver(to2, this); if (isFrameValue(to2)) { priority2 = to2.priority + 1; } } this.priority = priority2; } _detach() { const { to: to2 } = this.animation; if (hasFluidValue(to2)) { removeFluidObserver(to2, this); } } _set(arg, idle = true) { const value = getFluidValue(arg); if (!is.und(value)) { const oldNode = getAnimated(this); if (!oldNode || !isEqual(value, oldNode.getValue())) { const nodeType = getAnimatedType(value); if (!oldNode || oldNode.constructor != nodeType) { setAnimated(this, nodeType.create(value)); } else { oldNode.setValue(value); } if (oldNode) { raf.batchedUpdates(() => { this._onChange(value, idle); }); } } } return getAnimated(this); } _onStart() { const anim = this.animation; if (!anim.changed) { anim.changed = true; sendEvent(this, "onStart", getFinishedResult(this, checkFinished(this, anim.to)), this); } } _onChange(value, idle) { if (!idle) { this._onStart(); callProp(this.animation.onChange, value, this); } callProp(this.defaultProps.onChange, value, this); super._onChange(value, idle); } _start() { const anim = this.animation; getAnimated(this).reset(getFluidValue(anim.to)); if (!anim.immediate) { anim.fromValues = anim.values.map((node) => node.lastPosition); } if (!isAnimating(this)) { setActiveBit(this, true); if (!isPaused(this)) { this._resume(); } } } _resume() { if (globals.skipAnimation) { this.finish(); } else { frameLoop.start(this); } } _stop(goal, cancel) { if (isAnimating(this)) { setActiveBit(this, false); const anim = this.animation; each(anim.values, (node) => { node.done = true; }); if (anim.toValues) { anim.onChange = anim.onPause = anim.onResume = void 0; } callFluidObservers(this, { type: "idle", parent: this }); const result = cancel ? getCancelledResult(this.get()) : getFinishedResult(this.get(), checkFinished(this, goal != null ? goal : anim.to)); flushCalls(this._pendingCalls, result); if (anim.changed) { anim.changed = false; sendEvent(this, "onRest", result, this); } } } }; function checkFinished(target, to2) { const goal = computeGoal(to2); const value = computeGoal(target.get()); return isEqual(value, goal); } function createLoopUpdate(props, loop2 = props.loop, to2 = props.to) { let loopRet = callProp(loop2); if (loopRet) { const overrides = loopRet !== true && inferTo(loopRet); const reverse = (overrides || props).reverse; const reset = !overrides || overrides.reset; return createUpdate(_extends3({}, props, { loop: loop2, default: false, pause: void 0, to: !reverse || isAsyncTo(to2) ? to2 : void 0, from: reset ? props.from : void 0, reset }, overrides)); } } function createUpdate(props) { const { to: to2, from } = props = inferTo(props); const keys = /* @__PURE__ */ new Set(); if (is.obj(to2)) findDefined(to2, keys); if (is.obj(from)) findDefined(from, keys); props.keys = keys.size ? Array.from(keys) : null; return props; } function findDefined(values, keys) { eachProp(values, (value, key) => value != null && keys.add(key)); } var ACTIVE_EVENTS = ["onStart", "onRest", "onChange", "onPause", "onResume"]; function mergeActiveFn(target, props, type) { target.animation[type] = props[type] !== getDefaultProp(props, type) ? resolveProp(props[type], target.key) : void 0; } function sendEvent(target, type, ...args) { var _target$animation$typ, _target$animation, _target$defaultProps$, _target$defaultProps; (_target$animation$typ = (_target$animation = target.animation)[type]) == null ? void 0 : _target$animation$typ.call(_target$animation, ...args); (_target$defaultProps$ = (_target$defaultProps = target.defaultProps)[type]) == null ? void 0 : _target$defaultProps$.call(_target$defaultProps, ...args); } var BATCHED_EVENTS = ["onStart", "onChange", "onRest"]; var nextId = 1; var Controller = class { constructor(props, flush2) { this.id = nextId++; this.springs = {}; this.queue = []; this.ref = void 0; this._flush = void 0; this._initialProps = void 0; this._lastAsyncId = 0; this._active = /* @__PURE__ */ new Set(); this._changed = /* @__PURE__ */ new Set(); this._started = false; this._item = void 0; this._state = { paused: false, pauseQueue: /* @__PURE__ */ new Set(), resumeQueue: /* @__PURE__ */ new Set(), timeouts: /* @__PURE__ */ new Set() }; this._events = { onStart: /* @__PURE__ */ new Map(), onChange: /* @__PURE__ */ new Map(), onRest: /* @__PURE__ */ new Map() }; this._onFrame = this._onFrame.bind(this); if (flush2) { this._flush = flush2; } if (props) { this.start(_extends3({ default: true }, props)); } } get idle() { return !this._state.asyncTo && Object.values(this.springs).every((spring) => { return spring.idle && !spring.isDelayed && !spring.isPaused; }); } get item() { return this._item; } set item(item) { this._item = item; } get() { const values = {}; this.each((spring, key) => values[key] = spring.get()); return values; } set(values) { for (const key in values) { const value = values[key]; if (!is.und(value)) { this.springs[key].set(value); } } } update(props) { if (props) { this.queue.push(createUpdate(props)); } return this; } start(props) { let { queue } = this; if (props) { queue = toArray(props).map(createUpdate); } else { this.queue = []; } if (this._flush) { return this._flush(this, queue); } prepareKeys(this, queue); return flushUpdateQueue(this, queue); } stop(arg, keys) { if (arg !== !!arg) { keys = arg; } if (keys) { const springs = this.springs; each(toArray(keys), (key) => springs[key].stop(!!arg)); } else { stopAsync(this._state, this._lastAsyncId); this.each((spring) => spring.stop(!!arg)); } return this; } pause(keys) { if (is.und(keys)) { this.start({ pause: true }); } else { const springs = this.springs; each(toArray(keys), (key) => springs[key].pause()); } return this; } resume(keys) { if (is.und(keys)) { this.start({ pause: false }); } else { const springs = this.springs; each(toArray(keys), (key) => springs[key].resume()); } return this; } each(iterator) { eachProp(this.springs, iterator); } _onFrame() { const { onStart, onChange, onRest } = this._events; const active = this._active.size > 0; const changed = this._changed.size > 0; if (active && !this._started || changed && !this._started) { this._started = true; flush(onStart, ([onStart2, result]) => { result.value = this.get(); onStart2(result, this, this._item); }); } const idle = !active && this._started; const values = changed || idle && onRest.size ? this.get() : null; if (changed && onChange.size) { flush(onChange, ([onChange2, result]) => { result.value = values; onChange2(result, this, this._item); }); } if (idle) { this._started = false; flush(onRest, ([onRest2, result]) => { result.value = values; onRest2(result, this, this._item); }); } } eventObserved(event) { if (event.type == "change") { this._changed.add(event.parent); if (!event.idle) { this._active.add(event.parent); } } else if (event.type == "idle") { this._active.delete(event.parent); } else return; raf.onFrame(this._onFrame); } }; function flushUpdateQueue(ctrl, queue) { return Promise.all(queue.map((props) => flushUpdate(ctrl, props))).then((results) => getCombinedResult(ctrl, results)); } async function flushUpdate(ctrl, props, isLoop) { const { keys, to: to2, from, loop: loop2, onRest, onResolve } = props; const defaults2 = is.obj(props.default) && props.default; if (loop2) { props.loop = false; } if (to2 === false) props.to = null; if (from === false) props.from = null; const asyncTo = is.arr(to2) || is.fun(to2) ? to2 : void 0; if (asyncTo) { props.to = void 0; props.onRest = void 0; if (defaults2) { defaults2.onRest = void 0; } } else { each(BATCHED_EVENTS, (key) => { const handler = props[key]; if (is.fun(handler)) { const queue = ctrl["_events"][key]; props[key] = ({ finished, cancelled }) => { const result2 = queue.get(handler); if (result2) { if (!finished) result2.finished = false; if (cancelled) result2.cancelled = true; } else { queue.set(handler, { value: null, finished: finished || false, cancelled: cancelled || false }); } }; if (defaults2) { defaults2[key] = props[key]; } } }); } const state = ctrl["_state"]; if (props.pause === !state.paused) { state.paused = props.pause; flushCalls(props.pause ? state.pauseQueue : state.resumeQueue); } else if (state.paused) { props.pause = true; } const promises = (keys || Object.keys(ctrl.springs)).map((key) => ctrl.springs[key].start(props)); const cancel = props.cancel === true || getDefaultProp(props, "cancel") === true; if (asyncTo || cancel && state.asyncId) { promises.push(scheduleProps(++ctrl["_lastAsyncId"], { props, state, actions: { pause: noop3, resume: noop3, start(props2, resolve) { if (cancel) { stopAsync(state, ctrl["_lastAsyncId"]); resolve(getCancelledResult(ctrl)); } else { props2.onRest = onRest; resolve(runAsync(asyncTo, props2, state, ctrl)); } } } })); } if (state.paused) { await new Promise((resume) => { state.resumeQueue.add(resume); }); } const result = getCombinedResult(ctrl, await Promise.all(promises)); if (loop2 && result.finished && !(isLoop && result.noop)) { const nextProps = createLoopUpdate(props, loop2, to2); if (nextProps) { prepareKeys(ctrl, [nextProps]); return flushUpdate(ctrl, nextProps, true); } } if (onResolve) { raf.batchedUpdates(() => onResolve(result, ctrl, ctrl.item)); } return result; } function createSpring(key, observer) { const spring = new SpringValue(); spring.key = key; if (observer) { addFluidObserver(spring, observer); } return spring; } function prepareSprings(springs, props, create6) { if (props.keys) { each(props.keys, (key) => { const spring = springs[key] || (springs[key] = create6(key)); spring["_prepareNode"](props); }); } } function prepareKeys(ctrl, queue) { each(queue, (props) => { prepareSprings(ctrl.springs, props, (key) => { return createSpring(key, ctrl); }); }); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i2; for (i2 = 0; i2 < sourceKeys.length; i2++) { key = sourceKeys[i2]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var _excluded$3 = ["children"]; var SpringContext = (_ref) => { let { children } = _ref, props = _objectWithoutPropertiesLoose(_ref, _excluded$3); const inherited = (0, import_react3.useContext)(ctx); const pause = props.pause || !!inherited.pause, immediate = props.immediate || !!inherited.immediate; props = useMemoOne(() => ({ pause, immediate }), [pause, immediate]); const { Provider: Provider3 } = ctx; return React2.createElement(Provider3, { value: props }, children); }; var ctx = makeContext(SpringContext, {}); SpringContext.Provider = ctx.Provider; SpringContext.Consumer = ctx.Consumer; function makeContext(target, init) { Object.assign(target, React2.createContext(init)); target.Provider._context = target; target.Consumer._context = target; return target; } var TransitionPhase; (function(TransitionPhase2) { TransitionPhase2["MOUNT"] = "mount"; TransitionPhase2["ENTER"] = "enter"; TransitionPhase2["UPDATE"] = "update"; TransitionPhase2["LEAVE"] = "leave"; })(TransitionPhase || (TransitionPhase = {})); var Interpolation = class extends FrameValue { constructor(source, args) { super(); this.key = void 0; this.idle = true; this.calc = void 0; this._active = /* @__PURE__ */ new Set(); this.source = source; this.calc = createInterpolator(...args); const value = this._get(); const nodeType = getAnimatedType(value); setAnimated(this, nodeType.create(value)); } advance(_dt) { const value = this._get(); const oldValue = this.get(); if (!isEqual(value, oldValue)) { getAnimated(this).setValue(value); this._onChange(value, this.idle); } if (!this.idle && checkIdle(this._active)) { becomeIdle(this); } } _get() { const inputs = is.arr(this.source) ? this.source.map(getFluidValue) : toArray(getFluidValue(this.source)); return this.calc(...inputs); } _start() { if (this.idle && !checkIdle(this._active)) { this.idle = false; each(getPayload(this), (node) => { node.done = false; }); if (globals.skipAnimation) { raf.batchedUpdates(() => this.advance()); becomeIdle(this); } else { frameLoop.start(this); } } } _attach() { let priority2 = 1; each(toArray(this.source), (source) => { if (hasFluidValue(source)) { addFluidObserver(source, this); } if (isFrameValue(source)) { if (!source.idle) { this._active.add(source); } priority2 = Math.max(priority2, source.priority + 1); } }); this.priority = priority2; this._start(); } _detach() { each(toArray(this.source), (source) => { if (hasFluidValue(source)) { removeFluidObserver(source, this); } }); this._active.clear(); becomeIdle(this); } eventObserved(event) { if (event.type == "change") { if (event.idle) { this.advance(); } else { this._active.add(event.parent); this._start(); } } else if (event.type == "idle") { this._active.delete(event.parent); } else if (event.type == "priority") { this.priority = toArray(this.source).reduce((highest, parent) => Math.max(highest, (isFrameValue(parent) ? parent.priority : 0) + 1), 0); } } }; function isIdle(source) { return source.idle !== false; } function checkIdle(active) { return !active.size || Array.from(active).every(isIdle); } function becomeIdle(self) { if (!self.idle) { self.idle = true; each(getPayload(self), (node) => { node.done = true; }); callFluidObservers(self, { type: "idle", parent: self }); } } globals.assign({ createStringInterpolator, to: (source, args) => new Interpolation(source, args) }); var update2 = frameLoop.advance; // node_modules/@react-spring/web/dist/react-spring-web.esm.js var import_react_dom = __toESM(require_react_dom()); function _objectWithoutPropertiesLoose2(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i2; for (i2 = 0; i2 < sourceKeys.length; i2++) { key = sourceKeys[i2]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var _excluded$2 = ["style", "children", "scrollTop", "scrollLeft"]; var isCustomPropRE = /^--/; function dangerousStyleValue(name, value) { if (value == null || typeof value === "boolean" || value === "") return ""; if (typeof value === "number" && value !== 0 && !isCustomPropRE.test(name) && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + "px"; return ("" + value).trim(); } var attributeCache = {}; function applyAnimatedValues(instance, props) { if (!instance.nodeType || !instance.setAttribute) { return false; } const isFilterElement = instance.nodeName === "filter" || instance.parentNode && instance.parentNode.nodeName === "filter"; const _ref = props, { style, children, scrollTop, scrollLeft } = _ref, attributes = _objectWithoutPropertiesLoose2(_ref, _excluded$2); const values = Object.values(attributes); const names = Object.keys(attributes).map((name) => isFilterElement || instance.hasAttribute(name) ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, (n2) => "-" + n2.toLowerCase()))); if (children !== void 0) { instance.textContent = children; } for (let name in style) { if (style.hasOwnProperty(name)) { const value = dangerousStyleValue(name, style[name]); if (isCustomPropRE.test(name)) { instance.style.setProperty(name, value); } else { instance.style[name] = value; } } } names.forEach((name, i2) => { instance.setAttribute(name, values[i2]); }); if (scrollTop !== void 0) { instance.scrollTop = scrollTop; } if (scrollLeft !== void 0) { instance.scrollLeft = scrollLeft; } } var isUnitlessNumber = { animationIterationCount: true, borderImageOutset: true, borderImageSlice: true, borderImageWidth: true, boxFlex: true, boxFlexGroup: true, boxOrdinalGroup: true, columnCount: true, columns: true, flex: true, flexGrow: true, flexPositive: true, flexShrink: true, flexNegative: true, flexOrder: true, gridRow: true, gridRowEnd: true, gridRowSpan: true, gridRowStart: true, gridColumn: true, gridColumnEnd: true, gridColumnSpan: true, gridColumnStart: true, fontWeight: true, lineClamp: true, lineHeight: true, opacity: true, order: true, orphans: true, tabSize: true, widows: true, zIndex: true, zoom: true, fillOpacity: true, floodOpacity: true, stopOpacity: true, strokeDasharray: true, strokeDashoffset: true, strokeMiterlimit: true, strokeOpacity: true, strokeWidth: true }; var prefixKey = (prefix2, key) => prefix2 + key.charAt(0).toUpperCase() + key.substring(1); var prefixes = ["Webkit", "Ms", "Moz", "O"]; isUnitlessNumber = Object.keys(isUnitlessNumber).reduce((acc, prop) => { prefixes.forEach((prefix2) => acc[prefixKey(prefix2, prop)] = acc[prop]); return acc; }, isUnitlessNumber); var _excluded$1 = ["x", "y", "z"]; var domTransforms = /^(matrix|translate|scale|rotate|skew)/; var pxTransforms = /^(translate)/; var degTransforms = /^(rotate|skew)/; var addUnit = (value, unit) => is.num(value) && value !== 0 ? value + unit : value; var isValueIdentity = (value, id) => is.arr(value) ? value.every((v2) => isValueIdentity(v2, id)) : is.num(value) ? value === id : parseFloat(value) === id; var AnimatedStyle = class extends AnimatedObject { constructor(_ref) { let { x: x2, y: y2, z } = _ref, style = _objectWithoutPropertiesLoose2(_ref, _excluded$1); const inputs = []; const transforms = []; if (x2 || y2 || z) { inputs.push([x2 || 0, y2 || 0, z || 0]); transforms.push((xyz) => [`translate3d(${xyz.map((v2) => addUnit(v2, "px")).join(",")})`, isValueIdentity(xyz, 0)]); } eachProp(style, (value, key) => { if (key === "transform") { inputs.push([value || ""]); transforms.push((transform) => [transform, transform === ""]); } else if (domTransforms.test(key)) { delete style[key]; if (is.und(value)) return; const unit = pxTransforms.test(key) ? "px" : degTransforms.test(key) ? "deg" : ""; inputs.push(toArray(value)); transforms.push(key === "rotate3d" ? ([x3, y3, z2, deg]) => [`rotate3d(${x3},${y3},${z2},${addUnit(deg, unit)})`, isValueIdentity(deg, 0)] : (input) => [`${key}(${input.map((v2) => addUnit(v2, unit)).join(",")})`, isValueIdentity(input, key.startsWith("scale") ? 1 : 0)]); } }); if (inputs.length) { style.transform = new FluidTransform(inputs, transforms); } super(style); } }; var FluidTransform = class extends FluidValue { constructor(inputs, transforms) { super(); this._value = null; this.inputs = inputs; this.transforms = transforms; } get() { return this._value || (this._value = this._get()); } _get() { let transform = ""; let identity2 = true; each(this.inputs, (input, i2) => { const arg1 = getFluidValue(input[0]); const [t3, id] = this.transforms[i2](is.arr(arg1) ? arg1 : input.map(getFluidValue)); transform += " " + t3; identity2 = identity2 && id; }); return identity2 ? "none" : transform; } observerAdded(count) { if (count == 1) each(this.inputs, (input) => each(input, (value) => hasFluidValue(value) && addFluidObserver(value, this))); } observerRemoved(count) { if (count == 0) each(this.inputs, (input) => each(input, (value) => hasFluidValue(value) && removeFluidObserver(value, this))); } eventObserved(event) { if (event.type == "change") { this._value = null; } callFluidObservers(this, event); } }; var primitives = ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"]; var _excluded = ["scrollTop", "scrollLeft"]; globals.assign({ batchedUpdates: import_react_dom.unstable_batchedUpdates, createStringInterpolator, colors }); var host = createHost(primitives, { applyAnimatedValues, createAnimatedStyle: (style) => new AnimatedStyle(style), getComponentProps: (_ref) => { let props = _objectWithoutPropertiesLoose2(_ref, _excluded); return props; } }); var animated = host.animated; // packages/block-editor/build-module/components/use-moving-animation/index.mjs var import_element25 = __toESM(require_element(), 1); var import_dom2 = __toESM(require_dom(), 1); var import_data21 = __toESM(require_data(), 1); var BLOCK_ANIMATION_THRESHOLD = 200; function getAbsolutePosition(element) { return { top: element.offsetTop, left: element.offsetLeft }; } function useMovingAnimation({ triggerAnimationOnChange, clientId }) { const ref = (0, import_element25.useRef)(); const { isTyping: isTyping3, getGlobalBlockCount: getGlobalBlockCount2, isBlockSelected: isBlockSelected2, isFirstMultiSelectedBlock: isFirstMultiSelectedBlock2, isBlockMultiSelected: isBlockMultiSelected2, isAncestorMultiSelected: isAncestorMultiSelected2, isDraggingBlocks: isDraggingBlocks2 } = (0, import_data21.useSelect)(store); const { previous, prevRect } = (0, import_element25.useMemo)( () => ({ previous: ref.current && getAbsolutePosition(ref.current), prevRect: ref.current && ref.current.getBoundingClientRect() }), [triggerAnimationOnChange] ); (0, import_element25.useLayoutEffect)(() => { if (!previous || !ref.current) { return; } const scrollContainer = (0, import_dom2.getScrollContainer)(ref.current); const isSelected = isBlockSelected2(clientId); const adjustScrolling = isSelected || isFirstMultiSelectedBlock2(clientId); const isDragging3 = isDraggingBlocks2(); function preserveScrollPosition() { if (isDragging3) { return; } if (adjustScrolling && prevRect) { const blockRect = ref.current.getBoundingClientRect(); const diff = blockRect.top - prevRect.top; if (diff) { scrollContainer.scrollTop += diff; } } } const disableAnimation = window.matchMedia("(prefers-reduced-motion: reduce)").matches || isTyping3() || getGlobalBlockCount2() > BLOCK_ANIMATION_THRESHOLD; if (disableAnimation) { preserveScrollPosition(); return; } const isPartOfSelection = isSelected || isBlockMultiSelected2(clientId) || isAncestorMultiSelected2(clientId); if (isPartOfSelection && isDragging3) { return; } const zIndex = isPartOfSelection ? "1" : ""; const controller = new Controller({ x: 0, y: 0, config: { mass: 5, tension: 2e3, friction: 200 }, onChange({ value }) { if (!ref.current) { return; } let { x: x22, y: y22 } = value; x22 = Math.round(x22); y22 = Math.round(y22); const finishedMoving = x22 === 0 && y22 === 0; ref.current.style.transformOrigin = "center center"; ref.current.style.transform = finishedMoving ? null : `translate3d(${x22}px,${y22}px,0)`; ref.current.style.zIndex = zIndex; preserveScrollPosition(); } }); ref.current.style.transform = void 0; const destination = getAbsolutePosition(ref.current); const x2 = Math.round(previous.left - destination.left); const y2 = Math.round(previous.top - destination.top); controller.start({ x: 0, y: 0, from: { x: x2, y: y2 } }); return () => { controller.stop(); controller.set({ x: 0, y: 0 }); }; }, [ previous, prevRect, clientId, isTyping3, getGlobalBlockCount2, isBlockSelected2, isFirstMultiSelectedBlock2, isBlockMultiSelected2, isAncestorMultiSelected2, isDraggingBlocks2 ]); return ref; } var use_moving_animation_default = useMovingAnimation; // packages/block-editor/build-module/components/block-list/use-block-props/use-focus-first-element.mjs var import_element26 = __toESM(require_element(), 1); var import_dom3 = __toESM(require_dom(), 1); var import_data22 = __toESM(require_data(), 1); // packages/block-editor/build-module/utils/dom.mjs var BLOCK_SELECTOR = ".block-editor-block-list__block"; var APPENDER_SELECTOR = ".block-list-appender"; var BLOCK_APPENDER_CLASS = ".block-editor-button-block-appender"; function isInSameBlock(a2, b2) { return a2.closest(BLOCK_SELECTOR) === b2.closest(BLOCK_SELECTOR); } function isInsideRootBlock(blockElement, element) { const parentBlock = element.closest( [BLOCK_SELECTOR, APPENDER_SELECTOR, BLOCK_APPENDER_CLASS].join(",") ); return parentBlock === blockElement; } function getSelectionEditableElement(selection2, root) { const { anchorNode, focusNode } = selection2; if (!anchorNode || !focusNode) { return; } const element = anchorNode.nodeType === anchorNode.ELEMENT_NODE ? anchorNode : anchorNode.parentElement; const editable = element?.closest('[contenteditable="true"]'); if (!editable || editable === root || !editable.contains(focusNode)) { return; } return editable; } function getBlockClientId(node) { while (node && node.nodeType !== node.ELEMENT_NODE) { node = node.parentNode; } if (!node) { return; } const elementNode = node; const blockNode = elementNode.closest(BLOCK_SELECTOR); if (!blockNode) { return; } return blockNode.id.slice("block-".length); } function rectUnion(rect1, rect2) { const left = Math.min(rect1.left, rect2.left); const right = Math.max(rect1.right, rect2.right); const bottom = Math.max(rect1.bottom, rect2.bottom); const top = Math.min(rect1.top, rect2.top); return new window.DOMRectReadOnly(left, top, right - left, bottom - top); } function isElementVisible(element) { const viewport = element.ownerDocument.defaultView; if (!viewport) { return false; } if (element.hasAttribute("data-visually-hidden")) { return false; } const bounds = element.getBoundingClientRect(); if (bounds.width === 0 || bounds.height === 0) { return false; } if (element.checkVisibility) { return element.checkVisibility?.({ opacityProperty: true, contentVisibilityAuto: true, visibilityProperty: true }); } const style = viewport.getComputedStyle(element); if (style.display === "none" || style.visibility === "hidden" || style.opacity === "0") { return false; } return true; } function isScrollable(element) { const style = window.getComputedStyle(element); return style.overflowX === "auto" || style.overflowX === "scroll" || style.overflowY === "auto" || style.overflowY === "scroll"; } var WITH_OVERFLOW_ELEMENT_BLOCKS = ["core/navigation"]; function getElementBounds(element) { const viewport = element.ownerDocument.defaultView; if (!viewport) { return new window.DOMRectReadOnly(); } let bounds = element.getBoundingClientRect(); const dataType = element.getAttribute("data-type"); if (dataType && WITH_OVERFLOW_ELEMENT_BLOCKS.includes(dataType)) { const stack = [element]; let currentElement; while (currentElement = stack.pop()) { if (!isScrollable(currentElement)) { for (const child of currentElement.children) { if (isElementVisible(child)) { const childBounds = child.getBoundingClientRect(); bounds = rectUnion(bounds, childBounds); stack.push(child); } } } } } const left = Math.max(bounds.left, 0); const right = Math.min(bounds.right, viewport.innerWidth); bounds = new window.DOMRectReadOnly( left, bounds.top, right - left, bounds.height ); return bounds; } // packages/block-editor/build-module/components/block-list/use-block-props/use-focus-first-element.mjs function useFocusFirstElement({ clientId, initialPosition: initialPosition2 }) { const ref = (0, import_element26.useRef)(); const { isBlockSelected: isBlockSelected2, isMultiSelecting: isMultiSelecting3, isZoomOut: isZoomOut2, getSelectionStart: getSelectionStart2 } = unlock((0, import_data22.useSelect)(store)); (0, import_element26.useEffect)(() => { if (!isBlockSelected2(clientId) || isMultiSelecting3() || isZoomOut2()) { return; } if (initialPosition2 === void 0 || initialPosition2 === null) { return; } if (!ref.current) { return; } const { ownerDocument: ownerDocument2 } = ref.current; if (isInsideRootBlock(ref.current, ownerDocument2.activeElement)) { return; } const textInputs = import_dom3.focus.tabbable.find(ref.current).filter((node) => (0, import_dom3.isTextField)(node)); const isReverse = -1 === initialPosition2; const target = textInputs[isReverse ? textInputs.length - 1 : 0] || ref.current; if (!isInsideRootBlock(ref.current, target)) { ref.current.focus(); return; } if (!ref.current.getAttribute("contenteditable")) { const focusElement = import_dom3.focus.tabbable.findNext(ref.current); if (focusElement && isInsideRootBlock(ref.current, focusElement) && (0, import_dom3.isFormElement)(focusElement)) { focusElement.focus(); return; } } const { activeElement: activeElement2 } = ownerDocument2; const selection2 = ownerDocument2.defaultView.getSelection(); const { clientId: selectionClientId, offset: offset4 } = getSelectionStart2(); const hasCaret = activeElement2?.isContentEditable && activeElement2.contains(target) && !!selection2.anchorNode && target.contains(selection2.anchorNode); const isDeliberate = initialPosition2 === 0 || offset4 !== void 0 && selectionClientId === clientId; if (!(hasCaret && isDeliberate)) { (0, import_dom3.placeCaretAtHorizontalEdge)(target, isReverse); } }, [initialPosition2, clientId]); return ref; } // packages/block-editor/build-module/components/block-list/use-block-props/use-is-hovered.mjs var import_compose9 = __toESM(require_compose(), 1); var { subscribeDelegatedListener } = unlock(import_compose9.privateApis); function useIsHovered({ isEnabled = true } = {}) { return (0, import_compose9.useRefEffect)( (node) => { if (!isEnabled) { return; } function listener(event) { if (event.defaultPrevented) { return; } event.preventDefault(); node.classList.toggle( "is-hovered", event.type === "mouseover" ); } const unsubscribeOut = subscribeDelegatedListener( node, "mouseout", listener ); const unsubscribeOver = subscribeDelegatedListener( node, "mouseover", listener ); return () => { unsubscribeOut(); unsubscribeOver(); node.classList.remove("is-hovered"); }; }, [isEnabled] ); } // packages/block-editor/build-module/components/block-list/use-block-props/use-focus-handler.mjs var import_data23 = __toESM(require_data(), 1); var import_compose10 = __toESM(require_compose(), 1); var { subscribeDelegatedListener: subscribeDelegatedListener2 } = unlock(import_compose10.privateApis); function useFocusHandler(clientId) { const { isBlockSelected: isBlockSelected2, isBlockMultiSelected: isBlockMultiSelected2, isMultiSelecting: isMultiSelecting3 } = (0, import_data23.useSelect)(store); const { selectBlock: selectBlock2, selectionChange: selectionChange2 } = (0, import_data23.useDispatch)(store); return (0, import_compose10.useRefEffect)( (node) => { function onFocus(event) { if (isBlockSelected2(clientId)) { if (!event.target.isContentEditable) { selectionChange2(clientId); } return; } if (isMultiSelecting3()) { return; } if (isBlockMultiSelected2(clientId)) { return; } if (!isInsideRootBlock(node, event.target)) { return; } if (event.target.isContentEditable) { selectBlock2(clientId, null); return; } selectBlock2(clientId); } return subscribeDelegatedListener2(node, "focusin", onFocus); }, [isBlockSelected2, selectBlock2] ); } // packages/block-editor/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs var import_element28 = __toESM(require_element(), 1); // packages/block-editor/build-module/components/writing-flow/use-editable-root-event-handlers.mjs var import_data24 = __toESM(require_data(), 1); var import_compose11 = __toESM(require_compose(), 1); var import_element27 = __toESM(require_element(), 1); var SUPPORTED_EVENTS = { onKeyDown: "keydown", onKeyUp: "keyup", onBeforeInput: "beforeinput", onInput: "input", onCompositionStart: "compositionstart", onCompositionUpdate: "compositionupdate", onCompositionEnd: "compositionend" }; var EVENT_TYPES = Object.values(SUPPORTED_EVENTS); function getEventHandlers(props) { let handlers; for (const name in SUPPORTED_EVENTS) { if (typeof props[name] === "function") { handlers = handlers || {}; handlers[SUPPORTED_EVENTS[name]] = props[name]; } } return handlers; } var EVENT_INTERFACE = [ "eventPhase", "bubbles", "cancelable", "timeStamp", "defaultPrevented", "isTrusted" ]; var KEYBOARD_EVENT_INTERFACE = [ ...EVENT_INTERFACE, "view", "detail", "key", "code", "location", "ctrlKey", "shiftKey", "altKey", "metaKey", "repeat", "locale", "getModifierState", "charCode", "keyCode", "which" ]; var INPUT_EVENT_INTERFACE = [...EVENT_INTERFACE, "data"]; var EVENT_INTERFACES = { keydown: KEYBOARD_EVENT_INTERFACE, keyup: KEYBOARD_EVENT_INTERFACE, beforeinput: INPUT_EVENT_INTERFACE, input: INPUT_EVENT_INTERFACE, compositionstart: INPUT_EVENT_INTERFACE, compositionupdate: INPUT_EVENT_INTERFACE, compositionend: INPUT_EVENT_INTERFACE }; function createBlockSyntheticEvent(nativeEvent, target) { let propagationStopped = false; const syntheticEvent = { nativeEvent, type: nativeEvent.type, target, currentTarget: null, preventDefault() { nativeEvent.preventDefault(); syntheticEvent.defaultPrevented = true; }, isDefaultPrevented() { return syntheticEvent.defaultPrevented; }, stopPropagation() { nativeEvent.stopPropagation(); propagationStopped = true; }, isPropagationStopped() { return propagationStopped; }, // The modern event system doesn't pool, so persistence is a no-op. persist() { }, isPersistent() { return true; } }; for (const property of EVENT_INTERFACES[nativeEvent.type]) { const value = nativeEvent[property]; syntheticEvent[property] = typeof value === "function" ? value.bind(nativeEvent) : value; } return syntheticEvent; } function useEditableRootEventHandlers() { const { hasMultiSelection: hasMultiSelection2, getBlockParents: getBlockParents2 } = (0, import_data24.useSelect)(store); const { refsMap, eventHandlers } = (0, import_element27.useContext)(BlockRefs); return (0, import_compose11.useRefEffect)( (node) => { function onEvent(event) { if (!eventHandlers.size || event.target !== node || !event.isTrusted || node.contentEditable !== "true" || hasMultiSelection2()) { return; } const selection2 = node.ownerDocument.defaultView.getSelection(); if (!selection2.rangeCount) { return; } const editable = getSelectionEditableElement(selection2, node); const clientId = getBlockClientId(editable); if (!clientId) { return; } const clientIds = [ clientId, ...getBlockParents2(clientId, true) ]; let syntheticEvent; for (const ancestorClientId of clientIds) { const handler = eventHandlers.get(ancestorClientId)?.current?.[event.type]; const element = handler && refsMap.get(ancestorClientId); if (!element) { continue; } if (!syntheticEvent) { syntheticEvent = createBlockSyntheticEvent( event, editable ); } syntheticEvent.currentTarget = element; handler(syntheticEvent); if (syntheticEvent.isPropagationStopped()) { break; } } } const root = node.ownerDocument.documentElement; const unsubscribers = EVENT_TYPES.map((type) => { root.addEventListener(type, onEvent); return () => root.removeEventListener(type, onEvent); }); return () => unsubscribers.forEach((unsubscribe) => unsubscribe()); }, [hasMultiSelection2, getBlockParents2, refsMap, eventHandlers] ); } // packages/block-editor/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs function useRegisterBlockEventHandlers(clientId, wrapperProps) { const { eventHandlers } = (0, import_element28.useContext)(BlockRefs); const handlers = getEventHandlers(wrapperProps); const handlersRef = (0, import_element28.useRef)(); (0, import_element28.useInsertionEffect)(() => { handlersRef.current = handlers; }); const hasHandlers = !!handlers; (0, import_element28.useEffect)(() => { if (hasHandlers) { eventHandlers.set(clientId, handlersRef); return () => eventHandlers.delete(clientId); } }, [eventHandlers, clientId, hasHandlers]); } // packages/block-editor/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs var import_blocks20 = __toESM(require_blocks(), 1); var import_dom7 = __toESM(require_dom(), 1); var import_keycodes2 = __toESM(require_keycodes(), 1); var import_data25 = __toESM(require_data(), 1); var import_compose12 = __toESM(require_compose(), 1); function isColorTransparent(color) { return !color || color === "transparent" || color === "rgba(0, 0, 0, 0)"; } function useEventHandlers({ clientId, isSelected }) { const { getBlockRootClientId: getBlockRootClientId2, isZoomOut: isZoomOut2, hasMultiSelection: hasMultiSelection2, isSectionBlock: isSectionBlock2, editedContentOnlySection: editedContentOnlySection2, getBlock: getBlock2 } = unlock((0, import_data25.useSelect)(store)); const { insertAfterBlock: insertAfterBlock2, removeBlock: removeBlock2, resetZoomLevel: resetZoomLevel2, startDraggingBlocks: startDraggingBlocks2, stopDraggingBlocks: stopDraggingBlocks2, editContentOnlySection: editContentOnlySection2 } = unlock((0, import_data25.useDispatch)(store)); return (0, import_compose12.useRefEffect)( (node) => { if (!isSelected) { return; } function onKeyDown(event) { const { keyCode, target } = event; if (keyCode !== import_keycodes2.ENTER && keyCode !== import_keycodes2.BACKSPACE && keyCode !== import_keycodes2.DELETE) { return; } if (target !== node || (0, import_dom7.isTextField)(target)) { return; } event.preventDefault(); if (keyCode === import_keycodes2.ENTER && isZoomOut2()) { resetZoomLevel2(); } else if (keyCode === import_keycodes2.ENTER) { insertAfterBlock2(clientId); } else { removeBlock2(clientId); } } function onDragStart(event) { if (node !== event.target || node.isContentEditable || node.ownerDocument.activeElement !== node || hasMultiSelection2()) { event.preventDefault(); return; } const data = JSON.stringify({ type: "block", srcClientIds: [clientId], srcRootClientId: getBlockRootClientId2(clientId) }); event.dataTransfer.effectAllowed = "move"; event.dataTransfer.clearData(); event.dataTransfer.setData("wp-blocks", data); const { ownerDocument: ownerDocument2 } = node; const { defaultView } = ownerDocument2; const selection2 = defaultView.getSelection(); selection2.removeAllRanges(); const dragElement = ownerDocument2.createElement("div"); dragElement.style.width = "1px"; dragElement.style.height = "1px"; dragElement.style.position = "fixed"; dragElement.style.visibility = "hidden"; ownerDocument2.body.appendChild(dragElement); event.dataTransfer.setDragImage(dragElement, 0, 0); const rect = node.getBoundingClientRect(); const id = node.id; const clone = node.cloneNode(); clone.style.display = "none"; node.id = null; node.after(clone); let _scale = 1; { let parentElement = node; while (parentElement = parentElement.parentElement) { const { scale } = defaultView.getComputedStyle(parentElement); if (scale && scale !== "none") { _scale = parseFloat(scale); break; } } } const inverted = 1 / _scale; const originalNodeProperties = {}; for (const property of [ "transform", "transformOrigin", "transition", "zIndex", "position", "top", "left", "pointerEvents", "opacity", "backgroundColor" ]) { originalNodeProperties[property] = node.style[property]; } const originScrollTop = defaultView.scrollY; const originScrollLeft = defaultView.scrollX; const originClientX = event.clientX; const originClientY = event.clientY; node.style.position = "relative"; node.style.top = `${0}px`; node.style.left = `${0}px`; const originX = event.clientX - rect.left; const originY = event.clientY - rect.top; const dragScale = rect.height > 200 ? 200 / rect.height : 1; node.style.zIndex = "1000"; node.style.transformOrigin = `${originX * inverted}px ${originY * inverted}px`; node.style.transition = "transform 0.2s ease-out"; node.style.transform = `scale(${dragScale})`; node.style.opacity = "0.9"; if (isColorTransparent( defaultView.getComputedStyle(node).backgroundColor )) { let bgColor = "transparent"; let parentElement = node; while (parentElement = parentElement.parentElement) { const { backgroundColor } = defaultView.getComputedStyle(parentElement); if (!isColorTransparent(backgroundColor)) { bgColor = backgroundColor; break; } } node.style.backgroundColor = bgColor; } let hasStarted = false; let lastClientX = originClientX; let lastClientY = originClientY; function dragOver(e2) { if (e2.clientX === lastClientX && e2.clientY === lastClientY) { return; } lastClientX = e2.clientX; lastClientY = e2.clientY; over(); } function over() { if (!hasStarted) { hasStarted = true; node.style.pointerEvents = "none"; } const pointerYDelta = lastClientY - originClientY; const pointerXDelta = lastClientX - originClientX; const scrollTop = defaultView.scrollY; const scrollLeft = defaultView.scrollX; const scrollTopDelta = scrollTop - originScrollTop; const scrollLeftDelta = scrollLeft - originScrollLeft; const topDelta = pointerYDelta + scrollTopDelta; const leftDelta = pointerXDelta + scrollLeftDelta; node.style.top = `${topDelta * inverted}px`; node.style.left = `${leftDelta * inverted}px`; } function end() { ownerDocument2.removeEventListener("dragover", dragOver); ownerDocument2.removeEventListener("dragend", end); ownerDocument2.removeEventListener("drop", end); ownerDocument2.removeEventListener("scroll", over); for (const [property, value] of Object.entries( originalNodeProperties )) { node.style[property] = value; } clone.remove(); node.id = id; dragElement.remove(); stopDraggingBlocks2(); document.body.classList.remove( "is-dragging-components-draggable" ); ownerDocument2.documentElement.classList.remove( "is-dragging" ); } ownerDocument2.addEventListener("dragover", dragOver); ownerDocument2.addEventListener("dragend", end); ownerDocument2.addEventListener("drop", end); ownerDocument2.addEventListener("scroll", over); startDraggingBlocks2([clientId]); document.body.classList.add( "is-dragging-components-draggable" ); ownerDocument2.documentElement.classList.add("is-dragging"); } node.addEventListener("keydown", onKeyDown); node.addEventListener("dragstart", onDragStart); function onDoubleClick(event) { const isSection = isSectionBlock2(clientId); const block = getBlock2(clientId); const isSyncedPattern = (0, import_blocks20.isReusableBlock)(block); const isTemplatePartBlock = (0, import_blocks20.isTemplatePart)(block); const isAlreadyEditing = editedContentOnlySection2 === clientId; if (!isSection || isAlreadyEditing || isSyncedPattern || isTemplatePartBlock) { return; } event.preventDefault(); editContentOnlySection2(clientId); } node.addEventListener("dblclick", onDoubleClick); return () => { node.removeEventListener("keydown", onKeyDown); node.removeEventListener("dragstart", onDragStart); node.removeEventListener("dblclick", onDoubleClick); }; }, [ clientId, isSelected, getBlockRootClientId2, getBlock2, import_blocks20.isReusableBlock, import_blocks20.isTemplatePart, insertAfterBlock2, removeBlock2, isZoomOut2, resetZoomLevel2, hasMultiSelection2, startDraggingBlocks2, stopDraggingBlocks2, isSectionBlock2, editedContentOnlySection2, editContentOnlySection2 ] ); } // packages/block-editor/build-module/components/block-list/use-block-props/use-intersection-observer.mjs var import_compose13 = __toESM(require_compose(), 1); var import_element29 = __toESM(require_element(), 1); function useIntersectionObserver() { const observer = (0, import_element29.useContext)(IntersectionObserver2); return (0, import_compose13.useRefEffect)( (node) => { if (observer) { observer.observe(node); return () => { observer.unobserve(node); }; } }, [observer] ); } // packages/block-editor/build-module/components/block-list/use-block-props/use-scroll-into-view.mjs var import_compose14 = __toESM(require_compose(), 1); function useScrollIntoView({ isSelected }) { const prefersReducedMotion = (0, import_compose14.useReducedMotion)(); return (0, import_compose14.useRefEffect)( (node) => { if (isSelected) { const { ownerDocument: ownerDocument2 } = node; const { defaultView } = ownerDocument2; if (!defaultView.IntersectionObserver) { return; } const observer = new defaultView.IntersectionObserver( (entries) => { if (!entries[0].isIntersecting) { node.scrollIntoView({ behavior: prefersReducedMotion ? "instant" : "smooth" }); } observer.disconnect(); } ); observer.observe(node); return () => { observer.disconnect(); }; } }, [isSelected] ); } // packages/block-editor/build-module/components/use-flash-editable-blocks/index.mjs var import_compose15 = __toESM(require_compose(), 1); var import_data26 = __toESM(require_data(), 1); function useFlashEditableBlocks({ clientId = "", isEnabled = true } = {}) { const { getEnabledClientIdsTree: getEnabledClientIdsTree2 } = unlock((0, import_data26.useSelect)(store)); return (0, import_compose15.useRefEffect)( (element) => { if (!isEnabled) { return; } const flashEditableBlocks = () => { getEnabledClientIdsTree2(clientId).forEach( ({ clientId: id }) => { const block = element.querySelector( `[data-block="${id}"]` ); if (!block) { return; } block.classList.remove("has-editable-outline"); block.offsetWidth; block.classList.add("has-editable-outline"); } ); }; const handleClick = (event) => { const shouldFlash = event.target === element || event.target.classList.contains("is-root-container"); if (!shouldFlash) { return; } if (event.defaultPrevented) { return; } event.preventDefault(); flashEditableBlocks(); }; element.addEventListener("click", handleClick); return () => element.removeEventListener("click", handleClick); }, [isEnabled] ); } // packages/block-editor/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.mjs var import_compose16 = __toESM(require_compose(), 1); var nodesByDocument = /* @__PURE__ */ new Map(); function add(doc, node) { let set3 = nodesByDocument.get(doc); if (!set3) { set3 = /* @__PURE__ */ new Set(); nodesByDocument.set(doc, set3); doc.addEventListener("pointerdown", down); } set3.add(node); } function remove3(doc, node) { const set3 = nodesByDocument.get(doc); if (set3) { set3.delete(node); restore(node); if (set3.size === 0) { nodesByDocument.delete(doc); doc.removeEventListener("pointerdown", down); } } } function restore(node) { const prevDraggable = node.getAttribute("data-draggable"); if (prevDraggable) { node.removeAttribute("data-draggable"); if (prevDraggable === "true" && !node.getAttribute("draggable")) { node.setAttribute("draggable", "true"); } } } function down(event) { const { target } = event; const { ownerDocument: ownerDocument2, isContentEditable, tagName } = target; const isInputOrTextArea = ["INPUT", "TEXTAREA"].includes(tagName); const nodes = nodesByDocument.get(ownerDocument2); if (isContentEditable || isInputOrTextArea) { for (const node of nodes) { if (node.getAttribute("draggable") === "true" && node.contains(target)) { node.removeAttribute("draggable"); node.setAttribute("data-draggable", "true"); } } } else { for (const node of nodes) { restore(node); } } } function useFirefoxDraggableCompatibility() { return (0, import_compose16.useRefEffect)((node) => { add(node.ownerDocument, node); return () => { remove3(node.ownerDocument, node); }; }, []); } // packages/block-editor/build-module/components/block-visibility/modal.mjs var import_i18n26 = __toESM(require_i18n(), 1); var import_element30 = __toESM(require_element(), 1); var import_components24 = __toESM(require_components(), 1); var import_data27 = __toESM(require_data(), 1); var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1); var import_notices3 = __toESM(require_notices(), 1); // packages/block-editor/build-module/components/block-visibility/utils.mjs var import_i18n25 = __toESM(require_i18n(), 1); var { getViewportBreakpoints: getViewportBreakpoints3 } = unlock(privateApis); function getBlockVisibilityViewportEntries(viewportSettings) { const breakpoints = getViewportBreakpoints3(viewportSettings); return BLOCK_VISIBILITY_VIEWPORT_ENTRIES.filter( ([viewport]) => (viewport !== BLOCK_VISIBILITY_VIEWPORTS.tablet.key || breakpoints.tablet !== void 0) && (viewport !== BLOCK_VISIBILITY_VIEWPORTS.mobile.key || breakpoints.mobile !== void 0) ); } function isBlockHiddenForViewport(block, viewport) { if (!block) { return false; } const blockVisibility2 = block.attributes?.metadata?.blockVisibility; if (blockVisibility2 === true) { return false; } if ("object" !== typeof blockVisibility2) { return false; } const viewportConfig = blockVisibility2.viewport; if (!viewportConfig || "object" !== typeof viewportConfig) { return false; } if (!BLOCK_VISIBILITY_VIEWPORT_ENTRIES.some( ([, { key }]) => key === viewport )) { return false; } return viewportConfig[viewport] === false; } function getViewportCheckboxState(blocks2, viewport) { if (!blocks2?.length) { return false; } const hiddenCount = blocks2.filter( (block) => isBlockHiddenForViewport(block, viewport) ).length; if (hiddenCount === 0) { return false; } if (hiddenCount === blocks2.length) { return true; } return null; } function getHideEverywhereCheckboxState(blocks2) { if (!blocks2?.length) { return false; } const hiddenEverywhereCount = blocks2.filter( (block) => block && block.attributes?.metadata?.blockVisibility === false ).length; if (hiddenEverywhereCount === 0) { return false; } if (hiddenEverywhereCount === blocks2.length) { return true; } return null; } function getBlockVisibilityLabel(blockVisibility2, viewportSettings) { if (!blockVisibility2 && blockVisibility2 !== false) { return null; } if (blockVisibility2 === false) { return (0, import_i18n25.__)("Block is hidden"); } if (blockVisibility2?.viewport) { const hiddenViewports = getBlockVisibilityViewportEntries( viewportSettings ).filter( ([key]) => blockVisibility2.viewport?.[key] === false ).map(([, viewport]) => viewport.label); if (hiddenViewports.length > 0) { return (0, import_i18n25.sprintf)( /* translators: %s: comma-separated list of viewport names (Desktop, Tablet, Mobile) */ (0, import_i18n25.__)("Block is hidden on %s"), hiddenViewports.join(", ") ); } } return null; } // packages/block-editor/build-module/components/block-visibility/modal.mjs var import_jsx_runtime147 = __toESM(require_jsx_runtime(), 1); var DEFAULT_VIEWPORT_CHECKBOX_VALUES = { [BLOCK_VISIBILITY_VIEWPORTS.mobile.key]: false, [BLOCK_VISIBILITY_VIEWPORTS.tablet.key]: false, [BLOCK_VISIBILITY_VIEWPORTS.desktop.key]: false }; var EMPTY_BLOCKS = []; function BlockVisibilityModal({ clientIds, onClose }) { const { createSuccessNotice } = (0, import_data27.useDispatch)(import_notices3.store); const { updateBlockAttributes: updateBlockAttributes2 } = (0, import_data27.useDispatch)(store); const blocks2 = (0, import_data27.useSelect)( (select3) => select3(store).getBlocksByClientId(clientIds) ?? EMPTY_BLOCKS, [clientIds] ); const listViewShortcut = (0, import_data27.useSelect)((select3) => { return select3(import_keyboard_shortcuts.store).getShortcutRepresentation( "core/editor/toggle-list-view" ); }, []); const viewportSettings = (0, import_data27.useSelect)( (select3) => select3(store).getSettings().__experimentalFeatures?.viewport, [] ); const viewportEntries = (0, import_element30.useMemo)( () => getBlockVisibilityViewportEntries(viewportSettings), [viewportSettings] ); const initialViewportValues = (0, import_element30.useMemo)(() => { if (blocks2?.length === 0) { return { hideEverywhere: false, viewportChecked: {} }; } const viewportValues = {}; viewportEntries.forEach(([, { key }]) => { viewportValues[key] = getViewportCheckboxState(blocks2, key); }); return { hideEverywhere: getHideEverywhereCheckboxState(blocks2), viewportChecked: viewportValues }; }, [blocks2, viewportEntries]); const [viewportChecked, setViewportChecked] = (0, import_element30.useState)( initialViewportValues?.viewportChecked ?? {} ); const [hideEverywhere, setHideEverywhere] = (0, import_element30.useState)( initialViewportValues?.hideEverywhere ?? false ); const handleViewportCheckboxChange = (0, import_element30.useCallback)( (viewport, isChecked) => { setViewportChecked({ ...viewportChecked, [viewport]: isChecked }); }, [viewportChecked] ); const noticeMessage = (0, import_element30.useMemo)(() => { if (!hideEverywhere) { return (0, import_i18n26.sprintf)( // translators: %s: The shortcut key to access the List View. (0, import_i18n26.__)( "Block visibility settings updated. You can access them via the List View (%s)." ), listViewShortcut ); } const message2 = blocks2?.length > 1 ? ( // translators: %s: The shortcut key to access the List View. (0, import_i18n26.__)( "Blocks hidden. You can access them via the List View (%s)." ) ) : ( // translators: %s: The shortcut key to access the List View. (0, import_i18n26.__)( "Block hidden. You can access it via the List View (%s)." ) ); return (0, import_i18n26.sprintf)(message2, listViewShortcut); }, [hideEverywhere, blocks2?.length, listViewShortcut]); const isAnyViewportChecked = (0, import_element30.useMemo)( () => Object.values(viewportChecked).some( (checked) => checked === true || checked === null ), [viewportChecked] ); const isDirty = (0, import_element30.useMemo)(() => { if (hideEverywhere !== initialViewportValues.hideEverywhere) { return true; } return viewportEntries.some( ([, { key }]) => viewportChecked[key] !== initialViewportValues.viewportChecked[key] ); }, [ hideEverywhere, viewportChecked, initialViewportValues, viewportEntries ]); const hasIndeterminateValues = (0, import_element30.useMemo)(() => { if (hideEverywhere === null) { return true; } return Object.values(viewportChecked).some( (checked) => checked === null ); }, [hideEverywhere, viewportChecked]); const handleSubmit = (0, import_element30.useCallback)( (event) => { event.preventDefault(); const newVisibility = hideEverywhere ? false : { viewport: viewportEntries.reduce( (acc, [, { key }]) => { if (viewportChecked[key]) { acc[key] = false; } return acc; }, {} ) }; const attributesByClientId = Object.fromEntries( blocks2.map(({ clientId, attributes }) => [ clientId, { metadata: cleanEmptyObject({ ...attributes?.metadata, blockVisibility: newVisibility }) } ]) ); updateBlockAttributes2(clientIds, attributesByClientId, { uniqueByBlock: true }); createSuccessNotice(noticeMessage, { id: hideEverywhere ? "block-visibility-hidden" : "block-visibility-viewports-updated", type: "snackbar" }); onClose(); }, [ blocks2, clientIds, createSuccessNotice, hideEverywhere, noticeMessage, onClose, updateBlockAttributes2, viewportEntries, viewportChecked ] ); const hasMultipleBlocks = blocks2?.length > 1; return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)( import_components24.Modal, { title: clientIds?.length > 1 ? (0, import_i18n26.__)("Hide blocks") : (0, import_i18n26.__)("Hide block"), onRequestClose: onClose, overlayClassName: "block-editor-block-visibility-modal", size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("form", { onSubmit: handleSubmit, children: [ /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("fieldset", { children: [ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("legend", { children: hasMultipleBlocks ? (0, import_i18n26.__)( "Select the viewport sizes for which you want to hide the blocks. Changes will apply to all selected blocks." ) : (0, import_i18n26.__)( "Select the viewport size for which you want to hide the block." ) }), /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("ul", { className: "block-editor-block-visibility-modal__options", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("li", { className: "block-editor-block-visibility-modal__options-item block-editor-block-visibility-modal__options-item--everywhere", children: [ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)( import_components24.CheckboxControl, { className: "block-editor-block-visibility-modal__options-checkbox--everywhere", label: (0, import_i18n26.__)("Omit from published content"), checked: hideEverywhere === true, indeterminate: hideEverywhere === null, onChange: (checked) => { setHideEverywhere(checked); setViewportChecked( DEFAULT_VIEWPORT_CHECKBOX_VALUES ); } } ), hideEverywhere !== true && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("ul", { className: "block-editor-block-visibility-modal__sub-options", children: viewportEntries.map( ([, { label, icon, key }]) => /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)( "li", { className: "block-editor-block-visibility-modal__options-item", children: [ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)( import_components24.CheckboxControl, { label: (0, import_i18n26.sprintf)( // translators: %s: The viewport name. (0, import_i18n26.__)("Hide on %s"), label ), checked: viewportChecked[key] ?? false, indeterminate: viewportChecked[key] === null, onChange: (checked) => handleViewportCheckboxChange( key, checked ) } ), /* @__PURE__ */ (0, import_jsx_runtime147.jsx)( import_components24.Icon, { icon, className: clsx_default({ "block-editor-block-visibility-modal__options-icon--checked": viewportChecked[key] }) } ) ] }, key ) ) }) ] }) }), hasMultipleBlocks && hasIndeterminateValues && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "block-editor-block-visibility-modal__description", children: (0, import_i18n26.__)( "Selected blocks have different visibility settings. The checkboxes show an indeterminate state when settings differ." ) }), !hasMultipleBlocks && hideEverywhere === true && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "block-editor-block-visibility-modal__description", children: (0, import_i18n26.sprintf)( // translators: %s: The shortcut key to access the List View. (0, import_i18n26.__)( "Block will be hidden in the editor, and omitted from the published markup on the frontend. You can configure it again by selecting it in the List View (%s)." ), listViewShortcut ) }), !hasMultipleBlocks && !hideEverywhere && isAnyViewportChecked && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "block-editor-block-visibility-modal__description", children: (0, import_element30.createInterpolateElement)( (0, import_i18n26.sprintf)( // translators: %s: The shortcut key to access the List View (0, import_i18n26.__)( "Block will be hidden according to the selected viewports. It will be included in the published markup on the frontend. You can configure it again by selecting it in the List View (%s)." ), listViewShortcut ), { strong: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("strong", {}) } ) }) ] }), /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)( import_components24.Flex, { className: "block-editor-block-visibility-modal__actions", justify: "flex-end", expanded: false, children: [ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_components24.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)( import_components24.Button, { variant: "tertiary", onClick: onClose, __next40pxDefaultSize: true, children: (0, import_i18n26.__)("Cancel") } ) }), /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_components24.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)( import_components24.Button, { variant: "primary", type: "submit", disabled: !isDirty, accessibleWhenDisabled: true, __next40pxDefaultSize: true, children: (0, import_i18n26.__)("Apply") } ) }) ] } ) ] }) } ); } // packages/block-editor/build-module/components/block-visibility/use-block-visibility.mjs var import_compose17 = __toESM(require_compose(), 1); var { getViewportBreakpoints: getViewportBreakpoints4 } = unlock(privateApis); function useBlockVisibility(options = {}) { const { blockVisibility: blockVisibility2 = void 0, deviceType = BLOCK_VISIBILITY_VIEWPORTS.desktop.key, viewportSettings, view = window } = options; const viewportBreakpoints = getViewportBreakpoints4(viewportSettings); const mobileMediaQuery = viewportBreakpoints.mobile ? `(width <= ${viewportBreakpoints.mobile})` : void 0; const isMobileViewport = (0, import_compose17.useMediaQuery)(mobileMediaQuery, view); let tabletMediaQuery; if (viewportBreakpoints.tablet) { tabletMediaQuery = viewportBreakpoints.mobile ? `(${viewportBreakpoints.mobile} < width <= ${viewportBreakpoints.tablet})` : `(width <= ${viewportBreakpoints.tablet})`; } const isTabletViewport = (0, import_compose17.useMediaQuery)(tabletMediaQuery, view); let currentViewport; if (deviceType === BLOCK_VISIBILITY_VIEWPORTS.mobile.key && viewportBreakpoints.mobile) { currentViewport = BLOCK_VISIBILITY_VIEWPORTS.mobile.key; } else if (deviceType === BLOCK_VISIBILITY_VIEWPORTS.tablet.key && viewportBreakpoints.tablet) { currentViewport = BLOCK_VISIBILITY_VIEWPORTS.tablet.key; } else if (isMobileViewport) { currentViewport = BLOCK_VISIBILITY_VIEWPORTS.mobile.key; } else if (isTabletViewport && viewportBreakpoints.tablet) { currentViewport = BLOCK_VISIBILITY_VIEWPORTS.tablet.key; } else { currentViewport = BLOCK_VISIBILITY_VIEWPORTS.desktop.key; } const isBlockCurrentlyHidden = blockVisibility2 === false || blockVisibility2?.viewport?.[currentViewport] === false; return { isBlockCurrentlyHidden, currentViewport }; } // packages/block-editor/build-module/components/block-visibility/viewport-toolbar.mjs var import_i18n27 = __toESM(require_i18n(), 1); var import_components25 = __toESM(require_components(), 1); var import_element31 = __toESM(require_element(), 1); var import_blocks21 = __toESM(require_blocks(), 1); var import_data28 = __toESM(require_data(), 1); var import_jsx_runtime148 = __toESM(require_jsx_runtime(), 1); function BlockVisibilityViewportToolbar({ clientIds }) { const hasBlockVisibilityButtonShownRef = (0, import_element31.useRef)(false); const [blockVisibility2] = useSettings("blockVisibility.allowEditing"); const { canToggleBlockVisibility, areBlocksHiddenAnywhere } = (0, import_data28.useSelect)( (select3) => { const { getBlocksByClientId: getBlocksByClientId2, getBlockName: getBlockName2, isBlockHiddenAnywhere: isBlockHiddenAnywhere2 } = unlock(select3(store)); const _blocks = getBlocksByClientId2(clientIds); return { canToggleBlockVisibility: _blocks.every( ({ clientId }) => (0, import_blocks21.hasBlockSupport)( getBlockName2(clientId), "visibility", true ) ), areBlocksHiddenAnywhere: clientIds?.every( (clientId) => isBlockHiddenAnywhere2(clientId) ) }; }, [clientIds] ); const blockEditorDispatch = (0, import_data28.useDispatch)(store); (0, import_element31.useEffect)(() => { if (areBlocksHiddenAnywhere) { hasBlockVisibilityButtonShownRef.current = true; } }, [areBlocksHiddenAnywhere]); if (blockVisibility2 === false) { return null; } if (!areBlocksHiddenAnywhere && !hasBlockVisibilityButtonShownRef.current) { return null; } const { showViewportModal: showViewportModal2 } = unlock(blockEditorDispatch); return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_components25.ToolbarGroup, { className: "block-editor-block-visibility-toolbar", children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)( import_components25.ToolbarButton, { disabled: !canToggleBlockVisibility, icon: areBlocksHiddenAnywhere ? unseen_default : seen_default, label: areBlocksHiddenAnywhere ? (0, import_i18n27.__)("Hidden") : (0, import_i18n27.__)("Visible"), onClick: () => showViewportModal2(clientIds), "aria-haspopup": "dialog" } ) }); } // packages/block-editor/build-module/components/block-visibility/viewport-menu-item.mjs var import_i18n28 = __toESM(require_i18n(), 1); var import_components26 = __toESM(require_components(), 1); var import_data29 = __toESM(require_data(), 1); var import_keyboard_shortcuts2 = __toESM(require_keyboard_shortcuts(), 1); var import_jsx_runtime149 = __toESM(require_jsx_runtime(), 1); function BlockVisibilityViewportMenuItem({ clientIds }) { const [blockVisibility2] = useSettings("blockVisibility.allowEditing"); const { areBlocksHiddenAnywhere, shortcut } = (0, import_data29.useSelect)( (select3) => { const { isBlockHiddenAnywhere: isBlockHiddenAnywhere2 } = unlock( select3(store) ); return { areBlocksHiddenAnywhere: clientIds?.every( (clientId) => isBlockHiddenAnywhere2(clientId) ), shortcut: select3( import_keyboard_shortcuts2.store ).getShortcutRepresentation( "core/block-editor/toggle-block-visibility" ) }; }, [clientIds] ); const dispatch = (0, import_data29.useDispatch)(store); if (blockVisibility2 === false) { return null; } const { showViewportModal: showViewportModal2 } = unlock(dispatch); return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)( import_components26.MenuItem, { onClick: () => showViewportModal2(clientIds), shortcut, children: areBlocksHiddenAnywhere ? (0, import_i18n28.__)("Show") : (0, import_i18n28.__)("Hide") } ); } // packages/block-editor/build-module/components/block-visibility/viewport-visibility-info.mjs var import_components27 = __toESM(require_components(), 1); var import_data30 = __toESM(require_data(), 1); var import_i18n29 = __toESM(require_i18n(), 1); var import_jsx_runtime150 = __toESM(require_jsx_runtime(), 1); var { Badge: WCBadge } = unlock(import_components27.privateApis); var DEFAULT_VISIBILITY_STATE = { currentBlockVisibility: void 0, hasParentHiddenEverywhere: false, selectedDeviceType: BLOCK_VISIBILITY_VIEWPORTS.desktop.key }; function ViewportVisibilityInfo({ clientId }) { const { currentBlockVisibility, selectedDeviceType, viewportSettings, hasParentHiddenEverywhere } = (0, import_data30.useSelect)( (select3) => { if (!clientId) { return DEFAULT_VISIBILITY_STATE; } const { getBlockAttributes: getBlockAttributes3, isBlockParentHiddenEverywhere: isBlockParentHiddenEverywhere2, getSettings: getSettings7 } = unlock(select3(store)); const settings2 = getSettings7(); return { currentBlockVisibility: getBlockAttributes3(clientId)?.metadata?.blockVisibility, selectedDeviceType: settings2?.[deviceTypeKey]?.toLowerCase() || BLOCK_VISIBILITY_VIEWPORTS.desktop.key, viewportSettings: settings2?.__experimentalFeatures?.viewport, hasParentHiddenEverywhere: isBlockParentHiddenEverywhere2(clientId) }; }, [clientId] ); const blockElement = useBlockElement(clientId); const rawCanvasView = blockElement?.ownerDocument?.defaultView; const canvasView = rawCanvasView === null ? void 0 : rawCanvasView; const { isBlockCurrentlyHidden, currentViewport } = useBlockVisibility({ blockVisibility: currentBlockVisibility, deviceType: selectedDeviceType, viewportSettings, view: canvasView }); const isBlockParentHiddenAtViewport2 = (0, import_data30.useSelect)( (select3) => { if (!clientId || !currentViewport) { return false; } return unlock( select3(store) ).isBlockParentHiddenAtViewport(clientId, currentViewport); }, [clientId, currentViewport] ); if (!(isBlockCurrentlyHidden || hasParentHiddenEverywhere || isBlockParentHiddenAtViewport2)) { return null; } let label; if (isBlockCurrentlyHidden) { if (currentBlockVisibility === false) { label = (0, import_i18n29.__)("Block is hidden"); } else { const viewportLabel = BLOCK_VISIBILITY_VIEWPORTS[currentViewport]?.label || currentViewport; label = (0, import_i18n29.sprintf)( /* translators: %s: viewport name (Desktop, Tablet, Mobile) */ (0, import_i18n29.__)("Block is hidden on %s"), viewportLabel ); } } if (hasParentHiddenEverywhere) { label = (0, import_i18n29.__)("Parent block is hidden"); } else if (isBlockParentHiddenAtViewport2) { const viewportLabel = BLOCK_VISIBILITY_VIEWPORTS[currentViewport]?.label || currentViewport; label = (0, import_i18n29.sprintf)( /* translators: %s: viewport name (Desktop, Tablet, Mobile) */ (0, import_i18n29.__)("Parent block is hidden on %s"), viewportLabel ); } return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(WCBadge, { className: "block-editor-block-visibility-info", children: /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(import_components27.__experimentalHStack, { spacing: 2, justify: "start", children: [ /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(import_components27.Icon, { icon: unseen_default }), /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(import_components27.__experimentalText, { children: label }) ] }) }); } // packages/block-editor/build-module/components/block-list/use-block-props/index.mjs function useBlockProps(props = {}, { __unstableIsHtml } = {}) { const { clientId, className, wrapperProps = {}, isAligned, index: index2, mode: mode2, name, blockApiVersion, blockTitle, isSelected, isSubtreeDisabled, hasOverlay, initialPosition: initialPosition2, blockEditingMode, isHighlighted, isMultiSelected, isPartiallySelected, isReusable, isDragging: isDragging3, hasChildSelected, isEditingDisabled, hasEditableOutline, isEditingContentOnlySection, defaultClassName, isSectionBlock: isSectionBlock2, isWithinSectionBlock, canMove, blockVisibility: blockVisibility2, deviceType, viewportSettings, ariaLabel } = (0, import_element32.useContext)(PrivateBlockContext); useRegisterBlockEventHandlers(clientId, wrapperProps); const defaultViewRef = (0, import_compose18.useRefEffect)((element) => { if (element) { const { ownerDocument: ownerDocument2 } = element; const { defaultView } = ownerDocument2; defaultViewRef.current = defaultView; } }, []); const blockLabel = (0, import_i18n30.sprintf)((0, import_i18n30.__)("Block: %s"), blockTitle); const htmlSuffix = mode2 === "html" && !__unstableIsHtml ? "-visual" : ""; const ffDragRef = useFirefoxDraggableCompatibility(); const isHoverEnabled = !isWithinSectionBlock; const mergedRefs = (0, import_compose18.useMergeRefs)([ props.ref, defaultViewRef, useFocusFirstElement({ clientId, initialPosition: initialPosition2 }), useBlockRefProvider(clientId), useFocusHandler(clientId), useEventHandlers({ clientId, isSelected }), useIsHovered({ isEnabled: isHoverEnabled }), useIntersectionObserver(), use_moving_animation_default({ triggerAnimationOnChange: index2, clientId }), (0, import_compose18.useDisabled)({ isDisabled: !hasOverlay }), useFlashEditableBlocks({ clientId, isEnabled: isSectionBlock2 }), useScrollIntoView({ isSelected }), canMove ? ffDragRef : void 0 ]); const blockEditContext = useBlockEditContext(); const hasBlockBindings = !!blockEditContext[blockBindingsKey]; const bindingsStyle = hasBlockBindings ? { "--wp-admin-theme-color": "var(--wp-block-synced-color)", "--wp-admin-theme-color--rgb": "var(--wp-block-synced-color--rgb)" } : {}; const { isBlockCurrentlyHidden } = useBlockVisibility({ blockVisibility: blockVisibility2, deviceType, viewportSettings, view: defaultViewRef.current }); if (blockApiVersion < 2 && clientId === blockEditContext.clientId) { (0, import_warning4.default)( `Block type "${name}" must support API version 2 or higher to work correctly with "useBlockProps" method.` ); } let hasNegativeMargin = false; if (wrapperProps?.style?.marginTop?.charAt(0) === "-" || wrapperProps?.style?.marginBottom?.charAt(0) === "-" || wrapperProps?.style?.marginLeft?.charAt(0) === "-" || wrapperProps?.style?.marginRight?.charAt(0) === "-") { hasNegativeMargin = true; } return { tabIndex: blockEditingMode === "disabled" ? -1 : 0, draggable: canMove && !hasChildSelected ? true : void 0, ...wrapperProps, ...props, ref: mergedRefs, id: `block-${clientId}${htmlSuffix}`, role: "document", "aria-label": ariaLabel ?? blockLabel, "data-block": clientId, "data-type": name, "data-title": blockTitle, inert: isSubtreeDisabled ? "true" : void 0, className: clsx_default( "block-editor-block-list__block", { // The wp-block className is important for editor styles. "wp-block": !isAligned, "has-block-overlay": hasOverlay, "is-selected": isSelected, "is-highlighted": isHighlighted, "is-multi-selected": isMultiSelected, "is-partially-selected": isPartiallySelected, "is-reusable": isReusable, "is-dragging": isDragging3, "has-child-selected": hasChildSelected, "is-editing-disabled": isEditingDisabled, "has-editable-outline": hasEditableOutline, "has-negative-margin": hasNegativeMargin, "is-editing-content-only-section": isEditingContentOnlySection, "is-block-hidden": isBlockCurrentlyHidden }, className, props.className, wrapperProps.className, defaultClassName ), style: { ...wrapperProps.style, ...props.style, ...bindingsStyle } }; } useBlockProps.save = import_blocks22.__unstableGetBlockProps; // packages/block-editor/build-module/components/block-list/block.mjs var import_jsx_runtime151 = __toESM(require_jsx_runtime(), 1); function mergeWrapperProps(propsA, propsB) { const newProps = { ...propsA, ...propsB }; if (propsA?.hasOwnProperty("className") && propsB?.hasOwnProperty("className")) { newProps.className = clsx_default(propsA.className, propsB.className); } if (propsA?.hasOwnProperty("style") && propsB?.hasOwnProperty("style")) { newProps.style = { ...propsA.style, ...propsB.style }; } return newProps; } function Block({ children, isHtml, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("div", { ...useBlockProps(props, { __unstableIsHtml: isHtml }), children }); } function BlockListBlock({ block: { __unstableBlockSource }, mode: mode2, isLocked, canRemove, clientId, isSelected, isSelectionEnabled: isSelectionEnabled3, className, __unstableLayoutClassNames: layoutClassNames, name, isValid: isValid2, attributes, wrapperProps, setAttributes, onReplace, onRemove, onInsertBlocksAfter, onMerge, toggleSelection: toggleSelection2 }) { const { mayDisplayControls, mayDisplayParentControls, isSelectionWithinCurrentSection, themeSupportsLayout, ...context } = (0, import_element33.useContext)(PrivateBlockContext); const parentLayout = useLayout() || {}; let blockEdit = /* @__PURE__ */ (0, import_jsx_runtime151.jsx)( BlockEdit, { name, isSelected, attributes, setAttributes, insertBlocksAfter: isLocked ? void 0 : onInsertBlocksAfter, onReplace: canRemove ? onReplace : void 0, onRemove: canRemove ? onRemove : void 0, mergeBlocks: canRemove ? onMerge : void 0, clientId, isSelectionEnabled: isSelectionEnabled3, toggleSelection: toggleSelection2, __unstableLayoutClassNames: layoutClassNames, __unstableParentLayout: Object.keys(parentLayout).length ? parentLayout : void 0, mayDisplayControls, mayDisplayParentControls, mayDisplayPatternEditingControls: isSelectionWithinCurrentSection, blockEditingMode: context.blockEditingMode, isPreviewMode: context.isPreviewMode } ); const blockType = (0, import_blocks23.getBlockType)(name); if (blockType?.getEditWrapperProps) { wrapperProps = mergeWrapperProps( wrapperProps, blockType.getEditWrapperProps(attributes) ); } const isAligned = wrapperProps && !!wrapperProps["data-align"] && !themeSupportsLayout; const isSticky = className?.includes("is-position-sticky"); if (isAligned) { blockEdit = /* @__PURE__ */ (0, import_jsx_runtime151.jsx)( "div", { className: clsx_default("wp-block", isSticky && className), "data-align": wrapperProps["data-align"], children: blockEdit } ); } let block; if (!isValid2) { const saveContent = __unstableBlockSource ? (0, import_blocks23.serializeRawBlock)(__unstableBlockSource) : (0, import_blocks23.getSaveContent)(blockType, attributes); block = /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(Block, { className: "has-warning", children: [ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(BlockInvalidWarning, { clientId }), /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_element33.RawHTML, { children: (0, import_dom8.safeHTML)(saveContent) }) ] }); } else if (mode2 === "html") { block = /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(import_jsx_runtime151.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime151.jsx)("div", { style: { display: "none" }, children: blockEdit }), /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Block, { isHtml: true, children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(block_html_default, { clientId }) }) ] }); } else if (blockType?.apiVersion > 1) { block = blockEdit; } else { block = /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Block, { children: blockEdit }); } const { "data-align": dataAlign, ...restWrapperProps } = wrapperProps ?? {}; const updatedWrapperProps = { ...restWrapperProps, className: clsx_default( restWrapperProps.className, dataAlign && themeSupportsLayout && `align${dataAlign}`, !(dataAlign && isSticky) && className ) }; return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)( PrivateBlockContext.Provider, { value: { wrapperProps: updatedWrapperProps, isAligned, isSelectionWithinCurrentSection, ...context }, children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)( block_crash_boundary_default, { fallback: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Block, { className: "has-warning", children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(BlockCrashWarning, {}) }), children: block } ) } ); } var applyWithDispatch = (0, import_data31.withDispatch)((dispatch, ownProps, registry) => { const { updateBlockAttributes: updateBlockAttributes2, insertBlocks: insertBlocks2, mergeBlocks: mergeBlocks2, replaceBlocks: replaceBlocks2, toggleSelection: toggleSelection2, __unstableMarkLastChangeAsPersistent: __unstableMarkLastChangeAsPersistent2, moveBlocksToPosition: moveBlocksToPosition2, removeBlock: removeBlock2, selectBlock: selectBlock2 } = dispatch(store); return { setAttributes(nextAttributes) { const { getMultiSelectedBlockClientIds: getMultiSelectedBlockClientIds2 } = registry.select(store); const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds2(); const { clientId, attributes } = ownProps; const clientIds = multiSelectedBlockClientIds.length ? multiSelectedBlockClientIds : [clientId]; const newAttributes = typeof nextAttributes === "function" ? nextAttributes(attributes) : nextAttributes; updateBlockAttributes2(clientIds, newAttributes); }, onInsertBlocks(blocks2, index2) { const { rootClientId } = ownProps; insertBlocks2(blocks2, index2, rootClientId); }, onInsertBlocksAfter(blocks2) { const { clientId, rootClientId } = ownProps; const { getBlockIndex: getBlockIndex2 } = registry.select(store); const index2 = getBlockIndex2(clientId); insertBlocks2(blocks2, index2 + 1, rootClientId); }, onMerge(forward) { const { clientId, rootClientId } = ownProps; const { getPreviousBlockClientId: getPreviousBlockClientId2, getNextBlockClientId: getNextBlockClientId2, getBlock: getBlock2, getBlockAttributes: getBlockAttributes3, getBlockName: getBlockName2, getBlockOrder: getBlockOrder2, getBlockIndex: getBlockIndex2, getBlockRootClientId: getBlockRootClientId2, canInsertBlockType: canInsertBlockType2 } = registry.select(store); function switchToDefaultOrRemove() { const block = getBlock2(clientId); const defaultBlockName = (0, import_blocks23.getDefaultBlockName)(); const defaultBlockType = (0, import_blocks23.getBlockType)(defaultBlockName); if (getBlockName2(clientId) !== defaultBlockName) { const replacement = (0, import_blocks23.switchToBlockType)( block, defaultBlockName ); if (replacement && replacement.length) { replaceBlocks2(clientId, replacement); } } else if ((0, import_blocks23.isUnmodifiedDefaultBlock)(block)) { const nextBlockClientId = getNextBlockClientId2(clientId); if (nextBlockClientId) { registry.batch(() => { removeBlock2(clientId); selectBlock2(nextBlockClientId); }); } } else if (defaultBlockType.merge) { const attributes = defaultBlockType.merge( {}, block.attributes ); replaceBlocks2( [clientId], [(0, import_blocks23.createBlock)(defaultBlockName, attributes)] ); } } function moveFirstItemUp(_clientId, changeSelection = true) { const wrapperBlockName = getBlockName2(_clientId); const wrapperBlockType = (0, import_blocks23.getBlockType)(wrapperBlockName); const isTextualWrapper = wrapperBlockType.category === "text"; const targetRootClientId = getBlockRootClientId2(_clientId); const blockOrder = getBlockOrder2(_clientId); const [firstClientId] = blockOrder; if (blockOrder.length === 1 && (0, import_blocks23.isUnmodifiedBlock)(getBlock2(firstClientId))) { removeBlock2(_clientId); } else if (isTextualWrapper) { registry.batch(() => { if (canInsertBlockType2( getBlockName2(firstClientId), targetRootClientId )) { moveBlocksToPosition2( [firstClientId], _clientId, targetRootClientId, getBlockIndex2(_clientId) ); } else { const replacement = (0, import_blocks23.switchToBlockType)( getBlock2(firstClientId), (0, import_blocks23.getDefaultBlockName)() ); if (replacement && replacement.length && replacement.every( (block) => canInsertBlockType2( block.name, targetRootClientId ) )) { insertBlocks2( replacement, getBlockIndex2(_clientId), targetRootClientId, changeSelection ); removeBlock2(firstClientId, false); } else { switchToDefaultOrRemove(); } } if (!getBlockOrder2(_clientId).length && (0, import_blocks23.isUnmodifiedBlock)(getBlock2(_clientId))) { removeBlock2(_clientId, false); } }); } else { switchToDefaultOrRemove(); } } if (forward) { if (rootClientId) { const nextRootClientId = getNextBlockClientId2(rootClientId); if (nextRootClientId) { if (getBlockName2(rootClientId) === getBlockName2(nextRootClientId)) { const rootAttributes = getBlockAttributes3(rootClientId); const previousRootAttributes = getBlockAttributes3(nextRootClientId); if (Object.keys(rootAttributes).every( (key) => rootAttributes[key] === previousRootAttributes[key] )) { registry.batch(() => { moveBlocksToPosition2( getBlockOrder2(nextRootClientId), nextRootClientId, rootClientId ); removeBlock2(nextRootClientId, false); }); return; } } else { mergeBlocks2(rootClientId, nextRootClientId); return; } } } const nextBlockClientId = getNextBlockClientId2(clientId); if (!nextBlockClientId) { return; } if ((0, import_blocks23.isUnmodifiedDefaultBlock)(getBlock2(clientId))) { let firstLeafClientId = nextBlockClientId; while (getBlockOrder2(firstLeafClientId).length) { firstLeafClientId = getBlockOrder2(firstLeafClientId)[0]; } registry.batch(() => { removeBlock2(clientId); selectBlock2(firstLeafClientId); }); } else if (getBlockOrder2(nextBlockClientId).length) { moveFirstItemUp(nextBlockClientId, false); } else { mergeBlocks2(clientId, nextBlockClientId); } } else { const previousBlockClientId = getPreviousBlockClientId2(clientId); if (previousBlockClientId) { mergeBlocks2(previousBlockClientId, clientId); } else if (rootClientId) { const previousRootClientId = getPreviousBlockClientId2(rootClientId); if (previousRootClientId && getBlockName2(rootClientId) === getBlockName2(previousRootClientId)) { const rootAttributes = getBlockAttributes3(rootClientId); const previousRootAttributes = getBlockAttributes3(previousRootClientId); if (Object.keys(rootAttributes).every( (key) => rootAttributes[key] === previousRootAttributes[key] )) { registry.batch(() => { moveBlocksToPosition2( getBlockOrder2(rootClientId), rootClientId, previousRootClientId ); removeBlock2(rootClientId, false); }); return; } } moveFirstItemUp(rootClientId); } else { switchToDefaultOrRemove(); } } }, onReplace(blocks2, indexToSelect, initialPosition2) { if (blocks2.length && !(0, import_blocks23.isUnmodifiedDefaultBlock)(blocks2[blocks2.length - 1])) { __unstableMarkLastChangeAsPersistent2(); } const replacementBlocks = blocks2?.length === 1 && Array.isArray(blocks2[0]) ? blocks2[0] : blocks2; replaceBlocks2( [ownProps.clientId], replacementBlocks, indexToSelect, initialPosition2 ); }, onRemove() { removeBlock2(ownProps.clientId); }, toggleSelection(selectionEnabled) { toggleSelection2(selectionEnabled); } }; }); BlockListBlock = (0, import_compose19.compose)( applyWithDispatch, (0, import_components28.withFilters)("editor.BlockListBlock") )(BlockListBlock); function BlockListBlockProvider(props) { const { clientId, rootClientId } = props; const selectedProps = (0, import_data31.useSelect)( (select3) => { const { isBlockSelected: isBlockSelected2, getBlockMode: getBlockMode2, isSelectionEnabled: isSelectionEnabled22, getTemplateLock: getTemplateLock2, isSectionBlock: _isSectionBlock, getParentSectionBlock: getParentSectionBlock2, getBlockWithoutAttributes: getBlockWithoutAttributes2, getBlockAttributes: getBlockAttributes3, canRemoveBlock: canRemoveBlock2, canMoveBlock: canMoveBlock2, getSettings: getSettings7, getEditedContentOnlySection: getEditedContentOnlySection2, getBlockEditingMode: getBlockEditingMode2, getBlockName: getBlockName2, isFirstMultiSelectedBlock: isFirstMultiSelectedBlock2, getMultiSelectedBlockClientIds: getMultiSelectedBlockClientIds2, hasSelectedInnerBlock: hasSelectedInnerBlock2, getBlocksByName: getBlocksByName2, getBlockIndex: getBlockIndex2, isBlockMultiSelected: isBlockMultiSelected2, isBlockSubtreeDisabled: isBlockSubtreeDisabled2, isBlockHighlighted: isBlockHighlighted2, __unstableIsFullySelected: __unstableIsFullySelected2, __unstableSelectionHasUnmergeableBlock: __unstableSelectionHasUnmergeableBlock2, isBlockBeingDragged: isBlockBeingDragged2, isDragging: isDragging22, __unstableHasActiveBlockOverlayActive: __unstableHasActiveBlockOverlayActive2, getSelectedBlocksInitialCaretPosition: getSelectedBlocksInitialCaretPosition2 } = unlock(select3(store)); const blockWithoutAttributes = getBlockWithoutAttributes2(clientId); if (!blockWithoutAttributes) { return; } const { hasBlockSupport: _hasBlockSupport, getActiveBlockVariation } = select3(import_blocks23.store); const attributes2 = getBlockAttributes3(clientId); const { name: blockName, isValid: isValid22 } = blockWithoutAttributes; const blockType2 = (0, import_blocks23.getBlockType)(blockName); const settings2 = getSettings7(); const { supportsLayout, isPreviewMode: isPreviewMode2, __experimentalBlockBindingsSupportedAttributes } = settings2; const bindableAttributes2 = __experimentalBlockBindingsSupportedAttributes?.[blockName]; const blockVisibility22 = attributes2?.metadata?.blockVisibility; const deviceType2 = settings2?.[deviceTypeKey]?.toLowerCase() || "desktop"; const viewportSettings2 = settings2?.__experimentalFeatures?.viewport; const hasLightBlockWrapper = blockType2?.apiVersion > 1; const isMultiSelected2 = isBlockMultiSelected2(clientId); const blockEditingMode2 = getBlockEditingMode2(clientId); const previewContext = { isPreviewMode: isPreviewMode2, blockWithoutAttributes, name: blockName, attributes: attributes2, isValid: isValid22, themeSupportsLayout: supportsLayout, index: getBlockIndex2(clientId), isReusable: (0, import_blocks23.isReusableBlock)(blockType2), className: hasLightBlockWrapper ? attributes2.className : void 0, defaultClassName: hasLightBlockWrapper ? (0, import_blocks23.getBlockDefaultClassName)(blockName) : void 0, blockTitle: blockType2?.title, bindableAttributes: bindableAttributes2, blockVisibility: blockVisibility22, deviceType: deviceType2, viewportSettings: viewportSettings2, isMultiSelected: isMultiSelected2, blockEditingMode: blockEditingMode2, isEditingDisabled: blockEditingMode2 === "disabled" }; if (isPreviewMode2) { return previewContext; } const _isSelected = isBlockSelected2(clientId); const canRemove2 = canRemoveBlock2(clientId); const canMove2 = canMoveBlock2(clientId); const match2 = getActiveBlockVariation(blockName, attributes2); const checkDeep = true; const isAncestorOfSelectedBlock = hasSelectedInnerBlock2( clientId, checkDeep ); const sectionBlockClientId = _isSectionBlock(clientId) ? clientId : getParentSectionBlock2(clientId); const multiple = (0, import_blocks23.hasBlockSupport)(blockName, "multiple", true); const blocksWithSameName = multiple ? [] : getBlocksByName2(blockName); const isInvalid = blocksWithSameName.length && blocksWithSameName[0] !== clientId; return { ...previewContext, mode: getBlockMode2(clientId), isSelectionEnabled: isSelectionEnabled22(), isLocked: !!getTemplateLock2(rootClientId), isSectionBlock: _isSectionBlock(clientId), isWithinSectionBlock: !!sectionBlockClientId, isSelectionWithinCurrentSection: isBlockSelected2(sectionBlockClientId) || hasSelectedInnerBlock2(sectionBlockClientId, checkDeep), blockType: blockType2, canRemove: canRemove2, canMove: canMove2, isSelected: _isSelected, isEditingContentOnlySection: getEditedContentOnlySection2() === clientId, blockEditingMode: blockEditingMode2, mayDisplayControls: _isSelected || isFirstMultiSelectedBlock2(clientId) && getMultiSelectedBlockClientIds2().every( (id) => getBlockName2(id) === blockName ), mayDisplayParentControls: _hasBlockSupport( getBlockName2(clientId), "__experimentalExposeControlsToChildren", false ) && hasSelectedInnerBlock2(clientId), blockApiVersion: blockType2?.apiVersion || 1, blockTitle: match2?.title || blockType2?.title, isSubtreeDisabled: blockEditingMode2 === "disabled" && isBlockSubtreeDisabled2(clientId), hasOverlay: __unstableHasActiveBlockOverlayActive2(clientId) && !isDragging22(), initialPosition: _isSelected ? getSelectedBlocksInitialCaretPosition2() : void 0, isHighlighted: isBlockHighlighted2(clientId), isMultiSelected: isMultiSelected2, isPartiallySelected: isMultiSelected2 && !__unstableIsFullySelected2() && !__unstableSelectionHasUnmergeableBlock2(), isDragging: isBlockBeingDragged2(clientId), hasChildSelected: isAncestorOfSelectedBlock, isEditingDisabled: blockEditingMode2 === "disabled", hasEditableOutline: blockEditingMode2 !== "disabled" && getBlockEditingMode2(rootClientId) === "disabled", originalBlockClientId: isInvalid ? blocksWithSameName[0] : false, blockVisibility: blockVisibility22, deviceType: deviceType2, viewportSettings: viewportSettings2 }; }, [clientId, rootClientId] ); const defaultViewRef = (0, import_compose19.useRefEffect)((element) => { if (element) { const { ownerDocument: ownerDocument2 } = element; const { defaultView } = ownerDocument2; defaultViewRef.current = defaultView; } }, []); const { isBlockCurrentlyHidden } = useBlockVisibility({ blockVisibility: selectedProps?.blockVisibility, deviceType: selectedProps?.deviceType, viewportSettings: selectedProps?.viewportSettings, view: defaultViewRef.current }); const block = (0, import_element33.useMemo)( () => ({ ...selectedProps?.blockWithoutAttributes, attributes: selectedProps?.attributes }), [selectedProps?.blockWithoutAttributes, selectedProps?.attributes] ); if (!selectedProps) { return null; } const { isPreviewMode, // Fill values that end up as a public API and may not be defined in // preview mode. mode: mode2 = "visual", isSelectionEnabled: isSelectionEnabled3 = false, isLocked = false, canRemove = false, canMove = false, name, attributes, isValid: isValid2, isSelected = false, themeSupportsLayout, isEditingContentOnlySection, blockEditingMode, mayDisplayControls, mayDisplayParentControls, index: index2, blockApiVersion, blockType, blockTitle, isSubtreeDisabled, hasOverlay, initialPosition: initialPosition2, isHighlighted, isMultiSelected, isPartiallySelected, isReusable, isDragging: isDragging3, hasChildSelected, isSectionBlock: isSectionBlock2, isWithinSectionBlock, isSelectionWithinCurrentSection, isEditingDisabled, hasEditableOutline, className, defaultClassName, originalBlockClientId, bindableAttributes, blockVisibility: blockVisibility2, deviceType, viewportSettings } = selectedProps; const privateContext = { isPreviewMode, clientId, className, index: index2, mode: mode2, name, blockApiVersion, blockType, blockTitle, isSelected, isSubtreeDisabled, hasOverlay, initialPosition: initialPosition2, blockEditingMode, isHighlighted, isMultiSelected, isPartiallySelected, isReusable, isDragging: isDragging3, hasChildSelected, isSectionBlock: isSectionBlock2, isWithinSectionBlock, isSelectionWithinCurrentSection, isEditingDisabled, hasEditableOutline, isEditingContentOnlySection, defaultClassName, mayDisplayControls, mayDisplayParentControls, originalBlockClientId, themeSupportsLayout, canMove, isBlockCurrentlyHidden, bindableAttributes, blockVisibility: blockVisibility2, deviceType, viewportSettings }; if (isBlockCurrentlyHidden && !isSelected && !isMultiSelected && !hasChildSelected) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(PrivateBlockContext.Provider, { value: privateContext, children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)( BlockListBlock, { ...props, ...{ mode: mode2, isSelectionEnabled: isSelectionEnabled3, isLocked, canRemove, canMove, // Users of the editor.BlockListBlock filter used to be able // to access the block prop. Ideally these blocks would rely // on the clientId prop only. This is kept for backward // compatibility reasons. block, name, attributes, isValid: isValid2, isSelected } } ) }); } var block_default2 = (0, import_element33.memo)(BlockListBlockProvider); // packages/block-editor/build-module/components/block-list-appender/index.mjs var import_data68 = __toESM(require_data(), 1); var import_blocks40 = __toESM(require_blocks(), 1); // packages/block-editor/build-module/components/default-block-appender/index.mjs var import_i18n65 = __toESM(require_i18n(), 1); var import_html_entities = __toESM(require_html_entities(), 1); var import_data67 = __toESM(require_data(), 1); var import_keycodes9 = __toESM(require_keycodes(), 1); // packages/block-editor/build-module/components/inserter/index.mjs var import_a11y10 = __toESM(require_a11y(), 1); var import_i18n64 = __toESM(require_i18n(), 1); var import_components61 = __toESM(require_components(), 1); var import_data66 = __toESM(require_data(), 1); var import_blocks39 = __toESM(require_blocks(), 1); var import_element130 = __toESM(require_element(), 1); // packages/block-editor/build-module/components/inserter/menu.mjs var import_element128 = __toESM(require_element(), 1); var import_components59 = __toESM(require_components(), 1); // packages/ui/build-module/badge/badge.mjs var import_element48 = __toESM(require_element(), 1); // node_modules/@base-ui/utils/useControlled.mjs var React3 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/error.mjs var set; if (true) { set = /* @__PURE__ */ new Set(); } function error(...messages2) { if (true) { const messageKey = messages2.join(" "); if (!set.has(messageKey)) { set.add(messageKey); console.error(`Base UI: ${messageKey}`); } } } // node_modules/@base-ui/utils/useControlled.mjs function useControlled({ controlled, default: defaultProp, name, state = "value" }) { const { current: isControlled } = React3.useRef(controlled !== void 0); const [valueState, setValue] = React3.useState(defaultProp); const value = isControlled ? controlled : valueState; if (true) { React3.useEffect(() => { if (isControlled !== (controlled !== void 0)) { error([`A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join("\n")); } }, [state, name, controlled]); const { current: defaultValue } = React3.useRef(defaultProp); React3.useEffect(() => { if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) { error([`A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. To suppress this warning opt to use a controlled ${name}.`].join("\n")); } }, [defaultProp]); } const setValueIfUncontrolled = React3.useCallback((newValue) => { if (!isControlled) { setValue(newValue); } }, []); return [value, setValueIfUncontrolled]; } function serializeToDevModeString(input) { let nextId2 = 0; const seen = /* @__PURE__ */ new WeakMap(); try { const result = JSON.stringify(input, function replacer(key, value) { if (key === "_owner" && this != null && typeof this === "object" && "$$typeof" in this) { return void 0; } if (typeof value === "bigint") { return `__bigint__:${value}`; } if (value !== null && typeof value === "object") { const id = seen.get(value); if (id !== void 0) { return `__object__:${id}`; } seen.set(value, nextId2); nextId2 += 1; } return value; }); return result ?? `__top__:${typeof input}`; } catch { return "__unserializable__"; } } // node_modules/@base-ui/utils/safeReact.mjs var React4 = __toESM(require_react(), 1); var SafeReact = { ...React4 }; // node_modules/@base-ui/utils/useRefWithInit.mjs var React5 = __toESM(require_react(), 1); var UNINITIALIZED = {}; function useRefWithInit(init, initArg) { const ref = React5.useRef(UNINITIALIZED); if (ref.current === UNINITIALIZED) { ref.current = init(initArg); } return ref; } // node_modules/@base-ui/utils/useStableCallback.mjs var useInsertionEffect2 = SafeReact.useInsertionEffect; var useSafeInsertionEffect = ( // React 17 doesn't have useInsertionEffect. useInsertionEffect2 && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. useInsertionEffect2 !== SafeReact.useLayoutEffect ? useInsertionEffect2 : (fn) => fn() ); function useStableCallback(callback) { const stable = useRefWithInit(createStableCallback).current; stable.next = callback; useSafeInsertionEffect(stable.effect); return stable.trampoline; } function createStableCallback() { const stable = { next: void 0, callback: assertNotCalled, trampoline: (...args) => stable.callback?.(...args), effect: () => { stable.callback = stable.next; } }; return stable; } function assertNotCalled() { if (true) { throw ( /* minify-error-disabled */ new Error("Base UI: Cannot call an event handler while rendering.") ); } } // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs var React6 = __toESM(require_react(), 1); var noop4 = () => { }; var useIsoLayoutEffect = typeof document !== "undefined" ? React6.useLayoutEffect : noop4; // node_modules/@base-ui/utils/warn.mjs var set2; if (true) { set2 = /* @__PURE__ */ new Set(); } function warn(...messages2) { if (true) { const messageKey = messages2.join(" "); if (!set2.has(messageKey)) { set2.add(messageKey); console.warn(`Base UI: ${messageKey}`); } } } // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs var React8 = __toESM(require_react(), 1); // node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs var React7 = __toESM(require_react(), 1); var CompositeListContext = /* @__PURE__ */ React7.createContext({ register: () => { }, unregister: () => { }, subscribeMapChange: () => { return () => { }; }, elementsRef: { current: [] }, nextIndexRef: { current: 0 } }); if (true) CompositeListContext.displayName = "CompositeListContext"; function useCompositeListContext() { return React7.useContext(CompositeListContext); } // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs var import_jsx_runtime152 = __toESM(require_jsx_runtime(), 1); function CompositeList(props) { const { children, elementsRef, labelsRef, onMapChange: onMapChangeProp } = props; const onMapChange = useStableCallback(onMapChangeProp); const nextIndexRef = React8.useRef(0); const listeners = useRefWithInit(createListeners).current; const map = useRefWithInit(createMap).current; const [mapTick, setMapTick] = React8.useState(0); const lastTickRef = React8.useRef(mapTick); const register2 = useStableCallback((node, metadata) => { map.set(node, metadata ?? null); lastTickRef.current += 1; setMapTick(lastTickRef.current); }); const unregister = useStableCallback((node) => { map.delete(node); lastTickRef.current += 1; setMapTick(lastTickRef.current); }); const sortedMap = React8.useMemo(() => { disableEslintWarning(mapTick); const newMap = /* @__PURE__ */ new Map(); const sortedNodes = Array.from(map.keys()).filter((node) => node.isConnected).sort(sortByDocumentPosition); sortedNodes.forEach((node, index2) => { const metadata = map.get(node) ?? {}; newMap.set(node, { ...metadata, index: index2 }); }); return newMap; }, [map, mapTick]); useIsoLayoutEffect(() => { if (typeof MutationObserver !== "function" || sortedMap.size === 0) { return void 0; } const mutationObserver = new MutationObserver((entries) => { const diff = /* @__PURE__ */ new Set(); const updateDiff = (node) => diff.has(node) ? diff.delete(node) : diff.add(node); entries.forEach((entry) => { entry.removedNodes.forEach(updateDiff); entry.addedNodes.forEach(updateDiff); }); if (diff.size === 0) { lastTickRef.current += 1; setMapTick(lastTickRef.current); } }); sortedMap.forEach((_, node) => { if (node.parentElement) { mutationObserver.observe(node.parentElement, { childList: true }); } }); return () => { mutationObserver.disconnect(); }; }, [sortedMap]); useIsoLayoutEffect(() => { const shouldUpdateLengths = lastTickRef.current === mapTick; if (shouldUpdateLengths) { if (elementsRef.current.length !== sortedMap.size) { elementsRef.current.length = sortedMap.size; } if (labelsRef && labelsRef.current.length !== sortedMap.size) { labelsRef.current.length = sortedMap.size; } nextIndexRef.current = sortedMap.size; } onMapChange(sortedMap); }, [onMapChange, sortedMap, elementsRef, labelsRef, mapTick]); useIsoLayoutEffect(() => { return () => { elementsRef.current = []; }; }, [elementsRef]); useIsoLayoutEffect(() => { return () => { if (labelsRef) { labelsRef.current = []; } }; }, [labelsRef]); const subscribeMapChange = useStableCallback((fn) => { listeners.add(fn); return () => { listeners.delete(fn); }; }); useIsoLayoutEffect(() => { listeners.forEach((l2) => l2(sortedMap)); }, [listeners, sortedMap]); const contextValue = React8.useMemo(() => ({ register: register2, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef }), [register2, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef]); return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(CompositeListContext.Provider, { value: contextValue, children }); } function createMap() { return /* @__PURE__ */ new Map(); } function createListeners() { return /* @__PURE__ */ new Set(); } function sortByDocumentPosition(a2, b2) { const position = a2.compareDocumentPosition(b2); if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) { return -1; } if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) { return 1; } return 0; } function disableEslintWarning(_) { } // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs var React9 = __toESM(require_react(), 1); var DirectionContext = /* @__PURE__ */ React9.createContext(void 0); if (true) DirectionContext.displayName = "DirectionContext"; function useDirection() { const context = React9.useContext(DirectionContext); return context?.direction ?? "ltr"; } // node_modules/@base-ui/react/internals/useRenderElement.mjs var React12 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/useMergedRefs.mjs function useMergedRefs(a2, b2, c6, d2) { const forkRef = useRefWithInit(createForkRef).current; if (didChange(forkRef, a2, b2, c6, d2)) { update3(forkRef, [a2, b2, c6, d2]); } return forkRef.callback; } function useMergedRefsN(refs) { const forkRef = useRefWithInit(createForkRef).current; if (didChangeN(forkRef, refs)) { update3(forkRef, refs); } return forkRef.callback; } function createForkRef() { return { callback: null, cleanup: null, refs: [] }; } function didChange(forkRef, a2, b2, c6, d2) { return forkRef.refs[0] !== a2 || forkRef.refs[1] !== b2 || forkRef.refs[2] !== c6 || forkRef.refs[3] !== d2; } function didChangeN(forkRef, newRefs) { return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]); } function update3(forkRef, refs) { forkRef.refs = refs; if (refs.every((ref) => ref == null)) { forkRef.callback = null; return; } forkRef.callback = (instance) => { if (forkRef.cleanup) { forkRef.cleanup(); forkRef.cleanup = null; } if (instance != null) { const cleanupCallbacks = Array(refs.length).fill(null); for (let i2 = 0; i2 < refs.length; i2 += 1) { const ref = refs[i2]; if (ref == null) { continue; } switch (typeof ref) { case "function": { const refCleanup = ref(instance); if (typeof refCleanup === "function") { cleanupCallbacks[i2] = refCleanup; } break; } case "object": { ref.current = instance; break; } default: } } forkRef.cleanup = () => { for (let i2 = 0; i2 < refs.length; i2 += 1) { const ref = refs[i2]; if (ref == null) { continue; } switch (typeof ref) { case "function": { const cleanupCallback = cleanupCallbacks[i2]; if (typeof cleanupCallback === "function") { cleanupCallback(); } else { ref(null); } break; } case "object": { ref.current = null; break; } default: } } }; } }; } // node_modules/@base-ui/utils/getReactElementRef.mjs var React11 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/reactVersion.mjs var React10 = __toESM(require_react(), 1); var majorVersion = parseInt(React10.version, 10); function isReactVersionAtLeast(reactVersionToCheck) { return majorVersion >= reactVersionToCheck; } // node_modules/@base-ui/utils/getReactElementRef.mjs function getReactElementRef(element) { if (!/* @__PURE__ */ React11.isValidElement(element)) { return null; } const reactElement = element; const propsWithRef = reactElement.props; return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; } // node_modules/@base-ui/utils/mergeObjects.mjs function mergeObjects(a2, b2) { if (a2 && !b2) { return a2; } if (!a2 && b2) { return b2; } if (a2 || b2) { return { ...a2, ...b2 }; } return void 0; } // node_modules/@base-ui/utils/empty.mjs function NOOP() { } var EMPTY_ARRAY5 = Object.freeze([]); var EMPTY_OBJECT = Object.freeze({}); // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs function getStateAttributesProps(state, customMapping) { const props = {}; for (const key in state) { const value = state[key]; if (customMapping?.hasOwnProperty(key)) { const customProps = customMapping[key](value); if (customProps != null) { Object.assign(props, customProps); } continue; } if (value === true) { props[`data-${key.toLowerCase()}`] = ""; } else if (value) { props[`data-${key.toLowerCase()}`] = value.toString(); } } return props; } // node_modules/@base-ui/react/utils/resolveClassName.mjs function resolveClassName(className, state) { return typeof className === "function" ? className(state) : className; } // node_modules/@base-ui/react/utils/resolveStyle.mjs function resolveStyle2(style, state) { return typeof style === "function" ? style(state) : style; } // node_modules/@base-ui/react/merge-props/mergeProps.mjs var EMPTY_PROPS = {}; function mergeProps(a2, b2, c6, d2, e2) { if (!c6 && !d2 && !e2 && !a2) { return createInitialMergedProps(b2); } let merged = createInitialMergedProps(a2); if (b2) { merged = mergeInto(merged, b2); } if (c6) { merged = mergeInto(merged, c6); } if (d2) { merged = mergeInto(merged, d2); } if (e2) { merged = mergeInto(merged, e2); } return merged; } function mergePropsN(props) { if (props.length === 0) { return EMPTY_PROPS; } if (props.length === 1) { return createInitialMergedProps(props[0]); } let merged = createInitialMergedProps(props[0]); for (let i2 = 1; i2 < props.length; i2 += 1) { merged = mergeInto(merged, props[i2]); } return merged; } function createInitialMergedProps(inputProps) { if (isPropsGetter(inputProps)) { return { ...resolvePropsGetter(inputProps, EMPTY_PROPS) }; } return copyInitialProps(inputProps); } function mergeInto(merged, inputProps) { if (isPropsGetter(inputProps)) { return resolvePropsGetter(inputProps, merged); } return mutablyMergeInto(merged, inputProps); } function copyInitialProps(inputProps) { const copiedProps = { ...inputProps }; for (const propName in copiedProps) { const propValue = copiedProps[propName]; if (isEventHandler(propName, propValue)) { copiedProps[propName] = wrapEventHandler(propValue); } } return copiedProps; } function mutablyMergeInto(mergedProps, externalProps) { if (!externalProps) { return mergedProps; } for (const propName in externalProps) { const externalPropValue = externalProps[propName]; switch (propName) { case "style": { mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); break; } case "className": { mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); break; } default: { if (isEventHandler(propName, externalPropValue)) { mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); } else { mergedProps[propName] = externalPropValue; } } } } return mergedProps; } function isEventHandler(key, value) { const code0 = key.charCodeAt(0); const code1 = key.charCodeAt(1); const code2 = key.charCodeAt(2); return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); } function isPropsGetter(inputProps) { return typeof inputProps === "function"; } function resolvePropsGetter(inputProps, previousProps) { if (isPropsGetter(inputProps)) { return inputProps(previousProps); } return inputProps ?? EMPTY_PROPS; } function mergeEventHandlers(ourHandler, theirHandler) { if (!theirHandler) { return ourHandler; } if (!ourHandler) { return wrapEventHandler(theirHandler); } return (...args) => { const event = args[0]; if (isSyntheticEvent(event)) { const baseUIEvent = event; makeEventPreventable(baseUIEvent); const result2 = theirHandler(...args); if (!baseUIEvent.baseUIHandlerPrevented) { ourHandler?.(...args); } return result2; } const result = theirHandler(...args); ourHandler?.(...args); return result; }; } function wrapEventHandler(handler) { if (!handler) { return handler; } return (...args) => { const event = args[0]; if (isSyntheticEvent(event)) { makeEventPreventable(event); } return handler(...args); }; } function makeEventPreventable(event) { event.preventBaseUIHandler = () => { event.baseUIHandlerPrevented = true; }; return event; } function mergeClassNames(ourClassName, theirClassName) { if (theirClassName) { if (ourClassName) { return theirClassName + " " + ourClassName; } return theirClassName; } return ourClassName; } function isSyntheticEvent(event) { return event != null && typeof event === "object" && "nativeEvent" in event; } // node_modules/@base-ui/react/internals/useRenderElement.mjs var import_react4 = __toESM(require_react(), 1); function useRenderElement(element, componentProps, params = {}) { const renderProp = componentProps.render; const outProps = useRenderElementProps(componentProps, params); if (params.enabled === false) { return null; } const state = params.state ?? EMPTY_OBJECT; return evaluateRenderProp(element, renderProp, outProps, state); } function useRenderElementProps(componentProps, params = {}) { const { className: classNameProp, style: styleProp, render: renderProp } = componentProps; const { state = EMPTY_OBJECT, ref, props, stateAttributesMapping: stateAttributesMapping10, enabled = true } = params; const className = enabled ? resolveClassName(classNameProp, state) : void 0; const style = enabled ? resolveStyle2(styleProp, state) : void 0; const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping10) : EMPTY_OBJECT; const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; if (typeof document !== "undefined") { if (!enabled) { useMergedRefs(null, null); } else if (Array.isArray(ref)) { outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); } else { outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); } } if (!enabled) { return EMPTY_OBJECT; } if (className !== void 0) { outProps.className = mergeClassNames(outProps.className, className); } if (style !== void 0) { outProps.style = mergeObjects(outProps.style, style); } return outProps; } function resolveRenderFunctionProps(props) { if (Array.isArray(props)) { return mergePropsN(props); } return mergeProps(void 0, props); } var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; function evaluateRenderProp(element, render4, props, state) { if (render4) { if (typeof render4 === "function") { if (true) { warnIfRenderPropLooksLikeComponent(render4); } return render4(props, state); } const mergedProps = mergeProps(props, render4.props); mergedProps.ref = props.ref; let newElement = render4; if (newElement?.$$typeof === REACT_LAZY_TYPE) { const children = React12.Children.toArray(render4); newElement = children[0]; } if (true) { if (!/* @__PURE__ */ React12.isValidElement(newElement)) { throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n")); } } return /* @__PURE__ */ React12.cloneElement(newElement, mergedProps); } if (element) { if (typeof element === "string") { return renderTag(element, props); } } throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); } function warnIfRenderPropLooksLikeComponent(renderFn) { const functionName = renderFn.name; if (functionName.length === 0) { return; } if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { return; } if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { return; } warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={}` or `render={(props) => }` instead.", "https://base-ui.com/r/invalid-render-prop"); } function renderTag(Tag, props) { if (Tag === "button") { return /* @__PURE__ */ (0, import_react4.createElement)("button", { type: "button", ...props, key: props.key }); } if (Tag === "img") { return /* @__PURE__ */ (0, import_react4.createElement)("img", { alt: "", ...props, key: props.key }); } return /* @__PURE__ */ React12.createElement(Tag, props); } // node_modules/@base-ui/utils/useId.mjs var React13 = __toESM(require_react(), 1); var globalId = 0; function useGlobalId(idOverride, prefix2 = "mui") { const [defaultId, setDefaultId] = React13.useState(idOverride); const id = idOverride || defaultId; React13.useEffect(() => { if (defaultId == null) { globalId += 1; setDefaultId(`${prefix2}-${globalId}`); } }, [defaultId, prefix2]); return id; } var maybeReactUseId = SafeReact.useId; function useId(idOverride, prefix2) { if (maybeReactUseId !== void 0) { const reactId = maybeReactUseId(); return idOverride ?? (prefix2 ? `${prefix2}-${reactId}` : reactId); } return useGlobalId(idOverride, prefix2); } // node_modules/@base-ui/react/internals/useBaseUiId.mjs function useBaseUiId(idOverride) { return useId(idOverride, "base-ui"); } // node_modules/@base-ui/react/collapsible/root/useCollapsibleRoot.mjs var React16 = __toESM(require_react(), 1); // node_modules/@base-ui/react/internals/reason-parts.mjs var reason_parts_exports = {}; __export(reason_parts_exports, { cancelOpen: () => cancelOpen, chipRemovePress: () => chipRemovePress, clearPress: () => clearPress, closePress: () => closePress, closeWatcher: () => closeWatcher, decrementPress: () => decrementPress, disabled: () => disabled, drag: () => drag, escapeKey: () => escapeKey, focusOut: () => focusOut, imperativeAction: () => imperativeAction, incrementPress: () => incrementPress, initial: () => initial, inputBlur: () => inputBlur, inputChange: () => inputChange, inputClear: () => inputClear, inputPaste: () => inputPaste, inputPress: () => inputPress, itemPress: () => itemPress, keyboard: () => keyboard, linkPress: () => linkPress, listNavigation: () => listNavigation, missing: () => missing, none: () => none, outsidePress: () => outsidePress, pointer: () => pointer, scrub: () => scrub, siblingOpen: () => siblingOpen, swipe: () => swipe, trackPress: () => trackPress, triggerFocus: () => triggerFocus, triggerHover: () => triggerHover, triggerPress: () => triggerPress, wheel: () => wheel, windowResize: () => windowResize }); var none = "none"; var triggerPress = "trigger-press"; var triggerHover = "trigger-hover"; var triggerFocus = "trigger-focus"; var outsidePress = "outside-press"; var itemPress = "item-press"; var closePress = "close-press"; var linkPress = "link-press"; var clearPress = "clear-press"; var chipRemovePress = "chip-remove-press"; var trackPress = "track-press"; var incrementPress = "increment-press"; var decrementPress = "decrement-press"; var inputChange = "input-change"; var inputClear = "input-clear"; var inputBlur = "input-blur"; var inputPaste = "input-paste"; var inputPress = "input-press"; var focusOut = "focus-out"; var escapeKey = "escape-key"; var closeWatcher = "close-watcher"; var listNavigation = "list-navigation"; var keyboard = "keyboard"; var pointer = "pointer"; var drag = "drag"; var wheel = "wheel"; var scrub = "scrub"; var cancelOpen = "cancel-open"; var siblingOpen = "sibling-open"; var disabled = "disabled"; var missing = "missing"; var initial = "initial"; var imperativeAction = "imperative-action"; var swipe = "swipe"; var windowResize = "window-resize"; // node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs function createChangeEventDetails(reason, event, trigger, customProperties) { let canceled = false; let allowPropagation = false; const custom = customProperties ?? EMPTY_OBJECT; const details = { reason, event: event ?? new Event("base-ui"), cancel() { canceled = true; }, allowPropagation() { allowPropagation = true; }, get isCanceled() { return canceled; }, get isPropagationAllowed() { return allowPropagation; }, trigger, ...custom }; return details; } // node_modules/@base-ui/react/internals/useTransitionStatus.mjs var React15 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/useOnMount.mjs var React14 = __toESM(require_react(), 1); var EMPTY = []; function useOnMount(fn) { React14.useEffect(fn, EMPTY); } // node_modules/@base-ui/utils/useAnimationFrame.mjs var EMPTY2 = null; var LAST_RAF = globalThis.requestAnimationFrame; var Scheduler = class { /* This implementation uses an array as a backing data-structure for frame callbacks. * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it * never calls the native `cancelAnimationFrame` if there are no frames left. This can * be much more efficient if there is a call pattern that alterns as * "request-cancel-request-cancel-…". * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */ callbacks = []; callbacksCount = 0; nextId = 1; startId = 1; isScheduled = false; tick = (timestamp) => { this.isScheduled = false; const currentCallbacks = this.callbacks; const currentCallbacksCount = this.callbacksCount; this.callbacks = []; this.callbacksCount = 0; this.startId = this.nextId; if (currentCallbacksCount > 0) { for (let i2 = 0; i2 < currentCallbacks.length; i2 += 1) { currentCallbacks[i2]?.(timestamp); } } }; request(fn) { const id = this.nextId; this.nextId += 1; this.callbacks.push(fn); this.callbacksCount += 1; const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true); if (!this.isScheduled || didRAFChange) { requestAnimationFrame(this.tick); this.isScheduled = true; } return id; } cancel(id) { const index2 = id - this.startId; if (index2 < 0 || index2 >= this.callbacks.length) { return; } this.callbacks[index2] = null; this.callbacksCount -= 1; } }; var scheduler = new Scheduler(); var AnimationFrame = class _AnimationFrame { static create() { return new _AnimationFrame(); } static request(fn) { return scheduler.request(fn); } static cancel(id) { return scheduler.cancel(id); } currentId = EMPTY2; /** * Executes `fn` after `delay`, clearing any previously scheduled call. */ request(fn) { this.cancel(); this.currentId = scheduler.request(() => { this.currentId = EMPTY2; fn(); }); } cancel = () => { if (this.currentId !== EMPTY2) { scheduler.cancel(this.currentId); this.currentId = EMPTY2; } }; disposeEffect = () => { return this.cancel; }; }; function useAnimationFrame() { const timeout = useRefWithInit(AnimationFrame.create).current; useOnMount(timeout.disposeEffect); return timeout; } // node_modules/@base-ui/react/internals/useTransitionStatus.mjs function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) { const [transitionStatus, setTransitionStatus] = React15.useState(open && enableIdleState ? "idle" : void 0); const [mounted, setMounted] = React15.useState(open); if (open && !mounted) { setMounted(true); setTransitionStatus("starting"); } if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) { setTransitionStatus("ending"); } if (!open && !mounted && transitionStatus === "ending") { setTransitionStatus(void 0); } useIsoLayoutEffect(() => { if (!open && mounted && transitionStatus !== "ending" && deferEndingState) { const frame = AnimationFrame.request(() => { setTransitionStatus("ending"); }); return () => { AnimationFrame.cancel(frame); }; } return void 0; }, [open, mounted, transitionStatus, deferEndingState]); useIsoLayoutEffect(() => { if (!open || enableIdleState) { return void 0; } const frame = AnimationFrame.request(() => { setTransitionStatus(void 0); }); return () => { AnimationFrame.cancel(frame); }; }, [enableIdleState, open]); useIsoLayoutEffect(() => { if (!open || !enableIdleState) { return void 0; } if (open && mounted && transitionStatus !== "idle") { setTransitionStatus("starting"); } const frame = AnimationFrame.request(() => { setTransitionStatus("idle"); }); return () => { AnimationFrame.cancel(frame); }; }, [enableIdleState, open, mounted, transitionStatus]); return { mounted, setMounted, transitionStatus }; } // node_modules/@base-ui/react/collapsible/root/useCollapsibleRoot.mjs function useCollapsibleRoot(parameters) { const { open: openParam, defaultOpen, onOpenChange, disabled: disabled2 } = parameters; const [open, setOpen] = useControlled({ controlled: openParam, default: defaultOpen, name: "Collapsible", state: "open" }); const { mounted, setMounted, transitionStatus } = useTransitionStatus(open, true, true); const defaultPanelId = useBaseUiId(); const [panelIdState, setPanelIdState] = React16.useState(); const panelId = panelIdState ?? defaultPanelId; const handleTrigger = useStableCallback((event) => { const nextOpen = !open; const eventDetails = createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent); onOpenChange(nextOpen, eventDetails); if (eventDetails.isCanceled) { return; } setOpen(nextOpen); }); return React16.useMemo(() => ({ disabled: disabled2, handleTrigger, mounted, open, panelId, setMounted, setOpen, setPanelIdState, transitionStatus }), [disabled2, handleTrigger, mounted, open, panelId, setMounted, setOpen, setPanelIdState, transitionStatus]); } // node_modules/@base-ui/react/collapsible/root/CollapsibleRootContext.mjs var React17 = __toESM(require_react(), 1); var CollapsibleRootContext = /* @__PURE__ */ React17.createContext(void 0); if (true) CollapsibleRootContext.displayName = "CollapsibleRootContext"; function useCollapsibleRootContext() { const context = React17.useContext(CollapsibleRootContext); if (context === void 0) { throw new Error(true ? "Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within ." : formatErrorMessage_default(15)); } return context; } // node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs var React18 = __toESM(require_react(), 1); var IndexGuessBehavior = /* @__PURE__ */ (function(IndexGuessBehavior2) { IndexGuessBehavior2[IndexGuessBehavior2["None"] = 0] = "None"; IndexGuessBehavior2[IndexGuessBehavior2["GuessFromOrder"] = 1] = "GuessFromOrder"; return IndexGuessBehavior2; })({}); function useCompositeListItem(params = {}) { const { label, metadata, textRef, indexGuessBehavior, index: externalIndex } = params; const { register: register2, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef } = useCompositeListContext(); const indexRef = React18.useRef(-1); const [index2, setIndex] = React18.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => { if (indexRef.current === -1) { const newIndex = nextIndexRef.current; nextIndexRef.current += 1; indexRef.current = newIndex; } return indexRef.current; } : -1)); const componentRef = React18.useRef(null); const ref = React18.useCallback((node) => { componentRef.current = node; if (index2 !== -1 && node !== null) { elementsRef.current[index2] = node; if (labelsRef) { const isLabelDefined = label !== void 0; labelsRef.current[index2] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent; } } }, [index2, elementsRef, labelsRef, label, textRef]); useIsoLayoutEffect(() => { if (externalIndex != null) { return void 0; } const node = componentRef.current; if (node) { register2(node, metadata); return () => { unregister(node); }; } return void 0; }, [externalIndex, register2, unregister, metadata]); useIsoLayoutEffect(() => { if (externalIndex != null) { return void 0; } return subscribeMapChange((map) => { const i2 = componentRef.current ? map.get(componentRef.current)?.index : null; if (i2 != null) { setIndex(i2); } }); }, [externalIndex, subscribeMapChange, setIndex]); return { ref, index: index2 }; } // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) { TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style"; TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style"; return TransitionStatusDataAttributes2; })({}); var STARTING_HOOK = { [TransitionStatusDataAttributes.startingStyle]: "" }; var ENDING_HOOK = { [TransitionStatusDataAttributes.endingStyle]: "" }; var transitionStatusMapping = { transitionStatus(value) { if (value === "starting") { return STARTING_HOOK; } if (value === "ending") { return ENDING_HOOK; } return null; } }; // node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelDataAttributes.mjs var CollapsiblePanelDataAttributes = (function(CollapsiblePanelDataAttributes2) { CollapsiblePanelDataAttributes2["open"] = "data-open"; CollapsiblePanelDataAttributes2["closed"] = "data-closed"; CollapsiblePanelDataAttributes2[CollapsiblePanelDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle"; CollapsiblePanelDataAttributes2[CollapsiblePanelDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle"; return CollapsiblePanelDataAttributes2; })({}); // node_modules/@base-ui/react/collapsible/trigger/CollapsibleTriggerDataAttributes.mjs var CollapsibleTriggerDataAttributes = /* @__PURE__ */ (function(CollapsibleTriggerDataAttributes2) { CollapsibleTriggerDataAttributes2["panelOpen"] = "data-panel-open"; return CollapsibleTriggerDataAttributes2; })({}); // node_modules/@base-ui/react/utils/collapsibleOpenStateMapping.mjs var PANEL_OPEN_HOOK = { [CollapsiblePanelDataAttributes.open]: "" }; var PANEL_CLOSED_HOOK = { [CollapsiblePanelDataAttributes.closed]: "" }; var triggerOpenStateMapping = { open(value) { if (value) { return { [CollapsibleTriggerDataAttributes.panelOpen]: "" }; } return null; } }; var collapsibleOpenStateMapping = { open(value) { if (value) { return PANEL_OPEN_HOOK; } return PANEL_CLOSED_HOOK; } }; // node_modules/@base-ui/react/internals/use-button/useButton.mjs var React21 = __toESM(require_react(), 1); // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs function hasWindow() { return typeof window !== "undefined"; } function getNodeName(node) { if (isNode(node)) { return (node.nodeName || "").toLowerCase(); } return "#document"; } function getWindow(node) { var _node$ownerDocument; return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function getDocumentElement(node) { var _ref; return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; } function isNode(value) { if (!hasWindow()) { return false; } return value instanceof Node || value instanceof getWindow(value).Node; } function isElement(value) { if (!hasWindow()) { return false; } return value instanceof Element || value instanceof getWindow(value).Element; } function isHTMLElement(value) { if (!hasWindow()) { return false; } return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; } function isShadowRoot(value) { if (!hasWindow() || typeof ShadowRoot === "undefined") { return false; } return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; } function isOverflowElement(element) { const { overflow, overflowX, overflowY, display } = getComputedStyle2(element); return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents"; } function isTableElement(element) { return /^(table|td|th)$/.test(getNodeName(element)); } function isTopLayer(element) { try { if (element.matches(":popover-open")) { return true; } } catch (_e) { } try { return element.matches(":modal"); } catch (_e) { return false; } } var willChangeRe = /transform|translate|scale|rotate|perspective|filter/; var containRe = /paint|layout|strict|content/; var isNotNone = (value) => !!value && value !== "none"; var isWebKitValue; function isContainingBlock(elementOrCss) { const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss; return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || ""); } function getContainingBlock(element) { let currentNode = getParentNode(element); while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { if (isContainingBlock(currentNode)) { return currentNode; } else if (isTopLayer(currentNode)) { return null; } currentNode = getParentNode(currentNode); } return null; } function isWebKit() { if (isWebKitValue == null) { isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"); } return isWebKitValue; } function isLastTraversableNode(node) { return /^(html|body|#document)$/.test(getNodeName(node)); } function getComputedStyle2(element) { return getWindow(element).getComputedStyle(element); } function getNodeScroll(element) { if (isElement(element)) { return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop }; } return { scrollLeft: element.scrollX, scrollTop: element.scrollY }; } function getParentNode(node) { if (getNodeName(node) === "html") { return node; } const result = ( // Step into the shadow DOM of the parent of a slotted node. node.assignedSlot || // DOM Element detected. node.parentNode || // ShadowRoot detected. isShadowRoot(node) && node.host || // Fallback. getDocumentElement(node) ); return isShadowRoot(result) ? result.host : result; } function getNearestOverflowAncestor(node) { const parentNode = getParentNode(node); if (isLastTraversableNode(parentNode)) { return node.ownerDocument ? node.ownerDocument.body : node.body; } if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { return parentNode; } return getNearestOverflowAncestor(parentNode); } function getOverflowAncestors(node, list, traverseIframes) { var _node$ownerDocument2; if (list === void 0) { list = []; } if (traverseIframes === void 0) { traverseIframes = true; } const scrollableAncestor = getNearestOverflowAncestor(node); const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); const win = getWindow(scrollableAncestor); if (isBody) { const frameElement = getFrameElement(win); return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); } else { return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); } } function getFrameElement(win) { return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; } // node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs var React19 = __toESM(require_react(), 1); var CompositeRootContext = /* @__PURE__ */ React19.createContext(void 0); if (true) CompositeRootContext.displayName = "CompositeRootContext"; function useCompositeRootContext(optional = false) { const context = React19.useContext(CompositeRootContext); if (context === void 0 && !optional) { throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within ." : formatErrorMessage_default(16)); } return context; } // node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs var React20 = __toESM(require_react(), 1); function useFocusableWhenDisabled(parameters) { const { focusableWhenDisabled, disabled: disabled2, composite = false, tabIndex: tabIndexProp = 0, isNativeButton } = parameters; const isFocusableComposite = composite && focusableWhenDisabled !== false; const isNonFocusableComposite = composite && focusableWhenDisabled === false; const props = React20.useMemo(() => { const additionalProps = { // allow Tabbing away from focusableWhenDisabled elements onKeyDown(event) { if (disabled2 && focusableWhenDisabled && event.key !== "Tab") { event.preventDefault(); } } }; if (!composite) { additionalProps.tabIndex = tabIndexProp; if (!isNativeButton && disabled2) { additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1; } } if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) { additionalProps["aria-disabled"] = disabled2; } if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) { additionalProps.disabled = disabled2; } return additionalProps; }, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]); return { props }; } // node_modules/@base-ui/react/internals/use-button/useButton.mjs function useButton(parameters = {}) { const { disabled: disabled2 = false, focusableWhenDisabled, tabIndex = 0, native: isNativeButton = true, composite: compositeProp } = parameters; const elementRef = React21.useRef(null); const compositeRootContext = useCompositeRootContext(true); const isCompositeItem = compositeProp ?? compositeRootContext !== void 0; const { props: focusableWhenDisabledProps } = useFocusableWhenDisabled({ focusableWhenDisabled, disabled: disabled2, composite: isCompositeItem, tabIndex, isNativeButton }); if (true) { React21.useEffect(() => { if (!elementRef.current) { return; } const isButtonTag = isButtonElement(elementRef.current); if (isNativeButton) { if (!isButtonTag) { const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; const message2 = "A component that acts as a button expected a native