(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/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // 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/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // 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(a, b) { if (a === b) return true; if (a && b && typeof a == "object" && typeof b == "object") { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0; ) if (!equal(a[i], b[i])) return false; return true; } if (a instanceof Map && b instanceof Map) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false; return true; } if (a instanceof Set && b instanceof Set) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; return true; } if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0; ) if (a[i] !== b[i]) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0; ) { var key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } return a !== a && b !== b; }; } }); // 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; } }); // 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; } }); // vendor-external:react var require_react = __commonJS({ "vendor-external:react"(exports, module) { module.exports = window.React; } }); // vendor-external:react-dom var require_react_dom = __commonJS({ "vendor-external:react-dom"(exports, module) { module.exports = window.ReactDOM; } }); // 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(subscribe2, getSnapshot2) { didWarnOld18Alpha || void 0 === React192.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 = getSnapshot2(); if (!didWarnUncachedGetSnapshot) { var cachedValue = getSnapshot2(); objectIs(value, cachedValue) || (console.error( "The result of getSnapshot should be cached to avoid an infinite loop" ), didWarnUncachedGetSnapshot = true); } cachedValue = useState133({ inst: { value, getSnapshot: getSnapshot2 } }); var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; useLayoutEffect20( function() { inst.value = value; inst.getSnapshot = getSnapshot2; checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }, [subscribe2, value, getSnapshot2] ); useEffect113( function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); return subscribe2(function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }); }, [subscribe2] ); 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(subscribe2, getSnapshot2) { return getSnapshot2(); } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React192 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is2, useState133 = React192.useState, useEffect113 = React192.useEffect, useLayoutEffect20 = React192.useLayoutEffect, useDebugValue2 = React192.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 !== React192.useSyncExternalStore ? React192.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 React192 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is2, useSyncExternalStore4 = shim.useSyncExternalStore, useRef142 = React192.useRef, useEffect113 = React192.useEffect, useMemo173 = React192.useMemo, useDebugValue2 = React192.useDebugValue; exports.useSyncExternalStoreWithSelector = function(subscribe2, getSnapshot2, getServerSnapshot2, selector3, isEqual2) { var instRef = useRef142(null); if (null === instRef.current) { var inst = { hasValue: false, value: null }; instRef.current = inst; } else inst = instRef.current; instRef = useMemo173( 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 === getServerSnapshot2 ? null : getServerSnapshot2; return [ function() { return memoizedSelector(getSnapshot2()); }, null === maybeGetServerSnapshot ? void 0 : function() { return memoizedSelector(maybeGetServerSnapshot()); } ]; }, [getSnapshot2, getServerSnapshot2, selector3, isEqual2] ); var value = useSyncExternalStore4(subscribe2, instRef[0], instRef[1]); useEffect113( 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/warning var require_warning = __commonJS({ "package-external:@wordpress/warning"(exports, module) { module.exports = window.wp.warning; } }); // 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; } }); // 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; } }); // 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, index3) => { let number = start2 + 1 + index3; 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; var AT_NAME_END = /[\t\n\f\r "#'()/;[\\\]{}]/; 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); } function atruleStart(str, node) { let name = "@" + node.name; let params = node.params ? str.rawValue(node, "params") : ""; let afterName = node.raws.afterName; if (typeof afterName === "undefined") { afterName = params ? " " : ""; } else if (afterName === "" && params && !AT_NAME_END.test(params[0])) { afterName = " "; } return name + afterName + params; } function pushBody(str, stack, node) { let nodes = node.nodes; let last = nodes.length - 1; while (last > 0) { if (nodes[last].type !== "comment") break; last -= 1; } let semicolon = str.raw(node, "semicolon"); let isDocument = node.type === "document"; for (let i = nodes.length - 1; i >= 0; i--) { let child = nodes[i]; let childSemicolon = last !== i || semicolon; if (!childSemicolon && i < nodes.length - 1 && (child.type === "atrule" && !child.nodes || child.type === "decl" && child.prop.startsWith("--"))) { childSemicolon = true; } stack.push({ document: isDocument, node: child, semicolon: childSemicolon }); } } function pushBlock(str, stack, node, start2) { let between = str.raw(node, "between", "beforeOpen"); str.builder(escapeHTMLInCSS(start2 + between) + "{", node, "start"); let hasNodes = node.nodes && node.nodes.length; let close = () => { let after = hasNodes ? str.raw(node, "after") : str.raw(node, "after", "emptyBody"); if (after) str.builder(escapeHTMLInCSS(after)); str.builder("}", node, "end"); if (node.type === "rule" && node.raws.ownSemicolon) { str.builder(escapeHTMLInCSS(node.raws.ownSemicolon), node, "end"); } }; if (hasNodes) { stack.push(close); pushBody(str, stack, node); } else { close(); } } var Stringifier = class _Stringifier { constructor(builder) { this.builder = builder; } atrule(node, semicolon) { let start2 = atruleStart(this, node); if (node.nodes) { this.block(node, start2); } else { let end = (node.raws.between || "") + (semicolon ? ";" : ""); this.builder(escapeHTMLInCSS(start2 + 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 proto = _Stringifier.prototype; let expandable = ["atrule", "block", "body", "rule", "stringify"].every( (method) => this[method] === proto[method] ); let stack = []; pushBody(this, stack, node); while (stack.length > 0) { let entry = stack.pop(); if (typeof entry === "function") { entry(); continue; } let child = entry.node; let before = this.raw(child, "before"); if (before) { this.builder(entry.document ? before : escapeHTMLInCSS(before)); } if (expandable && child.type === "rule") { pushBlock(this, stack, child, this.rawValue(child, "selector")); } else if (expandable && child.type === "atrule" && child.nodes) { pushBlock(this, stack, child, atruleStart(this, child)); } else { this.stringify(child, entry.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((i) => { value = i.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((i) => { if (i.nodes && i.nodes.length > 0) { if (typeof i.raws.after !== "undefined") { value = i.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((i) => { if (typeof i.raws.before !== "undefined") { value = i.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((i) => { if (typeof i.raws.before !== "undefined") { value = i.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((i) => { if (i.type !== "decl") { value = i.raws.between; if (typeof value !== "undefined") return false; } }); return value; } rawBeforeRule(root) { let value; root.walk((i) => { if (i.nodes && (i.parent !== root || root.first !== i)) { if (typeof i.raws.before !== "undefined") { value = i.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((i) => { if (typeof i.raws.between !== "undefined") { value = i.raws.between.replace(/[^\s:]/g, ""); return false; } }); return value; } rawEmptyBody(root) { let value; root.walk((i) => { if (i.nodes && i.nodes.length === 0) { value = i.raws.after; if (typeof value !== "undefined") return false; } }); return value; } rawIndent(root) { if (root.raws.indent) return root.raws.indent; let value; root.walk((i) => { let p2 = i.parent; if (p2 && p2 !== root && p2.parent && p2.parent === root) { if (typeof i.raws.before !== "undefined") { let parts = i.raws.before.split("\n"); value = parts[parts.length - 1]; value = value.replace(/\S/g, ""); return false; } } }); return value; } rawSemicolon(root) { let value; root.walk((i) => { if (i.nodes && i.nodes.length && i.last.type === "decl") { value = i.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) { if (node.source && node.source.input.hasBOM) { this.builder("\uFEFF", node, "start"); } 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(); let stack = [[obj, cloned, parent]]; while (stack.length > 0) { let [source, target, targetParent] = stack.pop(); for (let i in source) { if (!Object.prototype.hasOwnProperty.call(source, i)) { continue; } if (i === "proxyCache") continue; let value = source[i]; let type = typeof value; if (i === "parent" && type === "object") { if (targetParent) target[i] = targetParent; } else if (i === "source") { target[i] = value; } else if (Array.isArray(value)) { let children = []; target[i] = children; for (let j2 of value) { let childClone = new j2.constructor(); children.push(childClone); stack.push([j2, childClone, target]); } } else { if (type === "object" && value !== null) { let valueClone = new value.constructor(); stack.push([value, valueClone, void 0]); value = valueClone; } target[i] = 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 i = 0; i < inputCSS.length; i++) { if (line === position.line && column === position.column) { offset4 = i; break; } if (inputCSS[i] === "\n") { column = 1; line += 1; } else { column += 1; } } return offset4; } var Node2 = class _Node { get proxyOf() { return this; } constructor(defaults2 = {}) { this.raws = {}; this[isClean] = false; this[my] = true; for (let name of Object.keys(defaults2)) { if (name === "__proto__") continue; 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 s = this.source; error2.stack = error2.stack.replace( /\n\s{4}at /, `$&${s.input.from}:${s.start.line}:${s.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 index3 = this.parent.index(this); return this.parent.nodes[index3 + 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 index3 = stringRepresentation.indexOf(opts.word); if (index3 !== -1) pos = this.positionInside(index3); } return pos; } positionInside(index3) { 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 + index3; for (let i = offset4; i < end; i++) { if (inputString[i] === "\n") { column = 1; line += 1; } else { column += 1; } } return { column, line, offset: end }; } prev() { if (!this.parent) return void 0; let index3 = this.parent.index(this); return this.parent.nodes[index3 - 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 index3 = stringRepresentation.indexOf(opts.word); if (index3 !== -1) { start2 = this.positionInside(index3); end = this.positionInside(index3 + 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 emitInputs = inputs == null; inputs = inputs || /* @__PURE__ */ new Map(); let holderOfRoot = []; let queue = [[this, holderOfRoot, 0]]; for (let step = 0; step < queue.length; step++) { let [node, holder, key] = queue[step]; let fixed2 = {}; holder[key] = fixed2; for (let name in node) { if (!Object.prototype.hasOwnProperty.call(node, name)) { continue; } if (name === "parent" || name === "proxyCache") continue; let value = node[name]; if (Array.isArray(value)) { let fixedArray = []; fixed2[name] = fixedArray; for (let i = 0; i < value.length; i++) { let item = value[i]; if (typeof item === "object" && item.toJSON) { if (item.toJSON === _Node.prototype.toJSON) { queue.push([item, fixedArray, i]); } else { fixedArray[i] = item.toJSON(null, inputs); } } else { fixedArray[i] = item; } } } else if (typeof value === "object" && value.toJSON) { if (value.toJSON === _Node.prototype.toJSON) { queue.push([value, fixed2, name]); } else { fixed2[name] = value.toJSON(null, inputs); } } else if (name === "source") { if (value == null) continue; let inputId = inputs.get(value.input); if (inputId == null) { inputId = inputs.size; inputs.set(value.input, inputId); } fixed2[name] = { end: value.end, inputId, start: value.start }; } else { fixed2[name] = value; } } } let fixed = holderOfRoot[0]; 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, (i) => { result += i; }); return result; } warn(result, text, opts = {}) { let data = { node: this }; for (let i in opts) data[i] = opts[i]; 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 parse5; var Root12; var Rule; function cleanSource(nodes) { let stack = nodes.slice(); while (stack.length > 0) { let node = stack.pop(); delete node.source; if (node.nodes) { node.nodes = node.nodes.slice(); for (let i of node.nodes) stack.push(i); } } return nodes.slice(); } function markTreeDirty(node) { let stack = [node]; while (stack.length > 0) { let next = stack.pop(); next[isClean] = false; if (next.proxyOf.nodes) { for (let i of next.proxyOf.nodes) stack.push(i); } } } 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) { let stack = [this]; while (stack.length > 0) { let node = stack.pop(); if (node !== this && node.cleanRaws !== _Container.prototype.cleanRaws) { node.cleanRaws(keepBetween); continue; } Node2.prototype.cleanRaws.call(node, keepBetween); if (node.nodes) { for (let child of node.nodes) stack.push(child); } } } each(callback) { if (!this.proxyOf.nodes) return void 0; let iterator = this.getIterator(); let index3, result; while (this.indexes[iterator] < this.proxyOf.nodes.length) { index3 = this.indexes[iterator]; result = callback(this.proxyOf.nodes[index3], index3); 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((i) => { if (typeof i === "function") { return (child, index3) => i(child.toProxy(), index3); } else { return i; } }) ); }; } 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((i) => i.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 index3; for (let id in this.indexes) { index3 = this.indexes[id]; if (existIndex < index3) { this.indexes[id] = index3 + 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 index3; for (let id in this.indexes) { index3 = this.indexes[id]; if (existIndex <= index3) { this.indexes[id] = index3 + nodes.length; } } this.markDirty(); return this; } normalize(nodes, sample) { if (typeof nodes === "string") { nodes = cleanSource(parse5(nodes).nodes); } else if (typeof nodes === "undefined") { nodes = []; } else if (Array.isArray(nodes)) { nodes = nodes.slice(0); for (let i of nodes) { if (i.parent) i.parent.removeChild(i, "ignore"); } } else if (nodes.type === "root" && this.type !== "document") { nodes = nodes.nodes.slice(0); for (let i of nodes) { if (i.parent) i.parent.removeChild(i, "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((i) => { if (!i[my]) _Container.rebuild(i); i = i.proxyOf; if (i.parent) i.parent.removeChild(i); if (i[isClean]) markTreeDirty(i); if (!i.raws) i.raws = {}; if (typeof i.raws.before === "undefined") { if (sample && typeof sample.raws.before !== "undefined") { i.raws.before = sample.raws.before.replace(/\S/g, ""); } } i.parent = this.proxyOf; return i; }); 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 index3; for (let id in this.indexes) { index3 = this.indexes[id]; if (index3 >= child) { this.indexes[id] = index3 - 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) { if (!this.proxyOf.nodes) return void 0; let stack = [{ iterator: this.getIterator(), node: this.proxyOf }]; while (stack.length > 0) { let { iterator, node } = stack[stack.length - 1]; let index3 = node.indexes[iterator]; if (index3 >= node.proxyOf.nodes.length) { delete node.indexes[iterator]; stack.pop(); let parent = stack[stack.length - 1]; if (parent) parent.node.indexes[parent.iterator] += 1; continue; } let child = node.proxyOf.nodes[index3]; let result; try { result = callback(child, index3); } catch (e2) { throw child.addToError(e2); } if (result === false) { for (let opened of stack) { delete opened.node.indexes[opened.iterator]; } return false; } if (child.walk && child.proxyOf.nodes) { stack.push({ iterator: child.getIterator(), node: child }); } else { node.indexes[iterator] += 1; } } return void 0; } walkAtRules(name, callback) { if (!callback) { callback = name; return this.walk((child, i) => { if (child.type === "atrule") { return callback(child, i); } }); } if (name instanceof RegExp) { return this.walk((child, i) => { if (child.type === "atrule" && name.test(child.name)) { return callback(child, i); } }); } return this.walk((child, i) => { if (child.type === "atrule" && child.name === name) { return callback(child, i); } }); } walkComments(callback) { return this.walk((child, i) => { if (child.type === "comment") { return callback(child, i); } }); } walkDecls(prop, callback) { if (!callback) { callback = prop; return this.walk((child, i) => { if (child.type === "decl") { return callback(child, i); } }); } if (prop instanceof RegExp) { return this.walk((child, i) => { if (child.type === "decl" && prop.test(child.prop)) { return callback(child, i); } }); } return this.walk((child, i) => { if (child.type === "decl" && child.prop === prop) { return callback(child, i); } }); } walkRules(selector3, callback) { if (!callback) { callback = selector3; return this.walk((child, i) => { if (child.type === "rule") { return callback(child, i); } }); } if (selector3 instanceof RegExp) { return this.walk((child, i) => { if (child.type === "rule" && selector3.test(child.selector)) { return callback(child, i); } }); } return this.walk((child, i) => { if (child.type === "rule" && child.selector === selector3) { return callback(child, i); } }); } }; Container.registerParse = (dependant) => { parse5 = dependant; }; Container.registerRule = (dependant) => { Rule = dependant; }; Container.registerAtRule = (dependant) => { AtRule = dependant; }; Container.registerRoot = (dependant) => { Root12 = dependant; }; module.exports = Container; Container.default = Container; Container.rebuild = (node) => { let stack = [node]; while (stack.length > 0) { let next = stack.pop(); if (next.type === "atrule") { Object.setPrototypeOf(next, AtRule.prototype); } else if (next.type === "rule") { Object.setPrototypeOf(next, Rule.prototype); } else if (next.type === "decl") { Object.setPrototypeOf(next, Declaration.prototype); } else if (next.type === "comment") { Object.setPrototypeOf(next, Comment.prototype); } else if (next.type === "root") { Object.setPrototypeOf(next, Root12.prototype); } next[my] = true; if (next.nodes) { for (let child of next.nodes) stack.push(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 i = size4 | 0; while (i-- > 0) { id += alphabet[Math.random() * alphabet.length | 0]; } return id; }; }; var nanoid = (size4 = 21) => { let id = ""; let i = size4 | 0; while (i-- > 0) { 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, realpathSync } = require_fs(); var { dirname, isAbsolute, join, relative, sep } = require_path(); var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); function realPath(path) { try { return realpathSync(path); } catch { return path; } } 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; if (!cssFile) return void 0; let rel = relative(realPath(dirname(cssFile)), realPath(path)); if (rel === ".." || rel.startsWith(".." + sep) || isAbsolute(rel)) { 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 i = 0, l2 = lines.length; i < l2; i++) { lineToIndex[i] = prevIndex; prevIndex += lines[i].length + 1; } input[lineToIndexCache] = lineToIndex; return lineToIndex; } var Input4 = 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 index3 = lineToIndex[line - 1]; return index3 + column - 1; } fromOffset(offset4) { let lineToIndex = getLineToIndex(this); let lastLine = lineToIndex[lineToIndex.length - 1]; let min3 = 0; if (offset4 >= lastLine) { min3 = lineToIndex.length - 1; } else { let max3 = lineToIndex.length - 2; let mid; while (min3 < max3) { mid = min3 + (max3 - min3 >> 1); if (offset4 < lineToIndex[mid]) { max3 = mid - 1; } else if (offset4 >= lineToIndex[mid + 1]) { min3 = mid + 1; } else { min3 = mid; break; } } } return { col: offset4 - lineToIndex[min3] + 1, line: min3 + 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") { let toPosition = consumer.originalPositionFor({ column: endColumn - 1, line: endLine }); if (toPosition.source) to2 = toPosition; } 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 = Input4; Input4.default = Input4; if (terminalHighlight && terminalHighlight.registerInput) { terminalHighlight.registerInput(Input4); } } }); // 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 Input4 = 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 i = this.root.nodes.length - 1; i >= 0; i--) { node = this.root.nodes[i]; if (node.type !== "comment") continue; if (node.text.startsWith("# sourceMappingURL=")) { this.root.removeChild(i); } } } 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, (i) => { result += i; }); 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((i) => i.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((i) => i.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((i) => i.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 Input4(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 Root12 = class extends Container { constructor(defaults2) { super(defaults2); this.type = "root"; if (!this.nodes) this.nodes = []; } normalize(child, sample, type) { let keepBefore = /* @__PURE__ */ new Set(); for (let node of Array.isArray(child) ? child : [child]) { if (node && typeof node === "object" && !node.parent && node.raws && typeof node.raws.before !== "undefined") { keepBefore.add(node.raws); } } 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) { if (!keepBefore.has(node.raws)) { node.raws.before = sample.raws.before; } } } } return nodes; } removeChild(child, ignore) { let index3 = this.index(child); if (!ignore && index3 === 0 && this.nodes.length > 1) { this.nodes[1].raws.before = this.nodes[index3].raws.before; } return super.removeChild(child); } toResult(opts = {}) { let lazy = new LazyResult(new Processor2(), this, opts); return lazy.stringify(); } }; Root12.registerLazyResult = (dependant) => { LazyResult = dependant; }; Root12.registerProcessor = (dependant) => { Processor2 = dependant; }; module.exports = Root12; Root12.default = Root12; Container.registerRoot(Root12); } }); // 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) { if (typeof string !== "string") return []; 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, n, 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] : ""; n = css.charCodeAt(pos + 1); if (prev === "url" && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE3 && n !== NEWLINE && n !== TAB5 && n !== FEED && n !== 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 Root12 = require_root(); var Rule = require_rule(); var tokenizer = require_tokenize(); var SAFE_COMMENT_NEIGHBOR = { empty: true, space: true }; function findLastWithPosition(tokens) { for (let i = tokens.length - 1; i >= 0; i--) { let token = tokens[i]; let pos = token[3] || token[2]; if (pos) return pos; } } function tokensToString(tokens, from, to2) { let result = ""; for (let i = from; i < to2; i++) result += tokens[i][1]; return result; } var Parser2 = class { constructor(input) { this.input = input; this.root = new Root12(); 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 open3 = 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 === "{") { open3 = 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 (open3) { 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 [i, 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 i; } } 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 i = tokens.length - 1; i >= 0; i--) { token = tokens[i]; if (token[1].toLowerCase() === "!important") { node.important = true; let string = this.stringFrom(tokens, i); 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 = i; 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((i) => i[0] !== "space" && i[0] !== "comment"); if (hasWord) { node.raws.between += firstSpaces.map((i) => i[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 i = 0; i < length; i += 1) { token = tokens[i]; type = token[0]; if (type === "space" && i === length - 1 && !customProperty) { clean = false; } else if (type === "comment") { prev = tokens[i - 1] ? tokens[i - 1][0] : "empty"; next = tokens[i + 1] ? tokens[i + 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, i) => all + i[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 i = from; i < tokens.length; i++) { result += tokens[i][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 = Parser2; } }); // 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 Input4 = require_input(); var Parser2 = require_parser(); function parse5(css, opts) { let input = new Input4(css, opts); let parser = new Parser2(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 = parse5; parse5.default = parse5; Container.registerParse(parse5); } }); // node_modules/postcss/lib/warning.js var require_warning2 = __commonJS({ "node_modules/postcss/lib/warning.js"(exports, module) { "use strict"; var Container = require_container(); var { my } = require_symbols(); var Warning2 = class { constructor(text, opts = {}) { this.type = "warning"; this.text = text; if (opts.node && opts.node.source) { if (!opts.node[my]) { Container.rebuild(opts.node); } 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 warning7 = new Warning2(text, opts); this.messages.push(warning7); return warning7; } warnings() { return this.messages.filter((i) => i.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 parse5 = require_parse(); var Result = require_result(); var Root12 = 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) { let stack = [node]; while (stack.length > 0) { let next = stack.pop(); next[isClean] = false; if (next.nodes) { for (let i of next.nodes) stack.push(i); } } 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 = parse5; 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 a = pluginVer.split("."); let b = runtimeVer.split("."); if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[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 i = 0; i < this.plugins.length; i++) { let plugin = this.plugins[i]; 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, (i) => { result += i; }); 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; if (visit.descending) { visit.descending = false; node.indexes[iterator] += 1; } let child; while (child = node.nodes[node.indexes[iterator]]) { if (!child[isClean]) { child[isClean] = true; visit.descending = true; stack.push(toStack(child)); return; } node.indexes[iterator] += 1; } 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 stack = [{ eventIndex: 0, events: getEvents(node), iterator: 0, node }]; while (stack.length > 0) { let visit = stack[stack.length - 1]; let visitNode = visit.node; if (visit.iterator !== 0) { let iterator = visit.iterator; if (visit.descending) { visit.descending = false; visitNode.indexes[iterator] += 1; } let child; let descended = false; while (child = visitNode.nodes[visitNode.indexes[iterator]]) { if (!child[isClean]) { child[isClean] = true; visit.descending = true; stack.push({ eventIndex: 0, events: getEvents(child), iterator: 0, node: child }); descended = true; break; } visitNode.indexes[iterator] += 1; } if (descended) continue; visit.iterator = 0; delete visitNode.indexes[iterator]; } if (visit.eventIndex < visit.events.length) { let event = visit.events[visit.eventIndex]; visit.eventIndex += 1; if (event === CHILDREN) { if (visitNode.nodes && visitNode.nodes.length) { visit.iterator = visitNode.getIterator(); } } else { let visitors = this.listeners[event]; if (visitors) { if (this.visitSync(visitors, visitNode.toProxy())) stack.pop(); } } continue; } stack.pop(); } } warnings() { return this.sync().warnings(); } }; LazyResult.registerPostcss = (dependant) => { postcss = dependant; }; module.exports = LazyResult; LazyResult.default = LazyResult; Root12.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 parse5 = 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 = parse5; 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 Root12 = require_root(); var Processor2 = class { constructor(plugins = []) { this.version = "8.5.26"; this.plugins = this.normalize(plugins); } normalize(plugins) { let normalized = []; for (let i of plugins) { if (i.postcss === true) { i = i(); } else if (i.postcss) { i = i.postcss; } if (typeof i === "object" && Array.isArray(i.plugins)) { normalized = normalized.concat(i.plugins); } else if (typeof i === "object" && i.postcssPlugin) { normalized.push(i); } else if (typeof i === "function") { normalized.push(i); } else if (typeof i === "object" && (i.parse || i.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(i + " 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; Root12.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 max3 = value.length; var stack = [{ nodes: tokens }]; var balanced = 0; var parent; var name = ""; var before = ""; var after = ""; while (pos < max3) { 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 < max3 && !(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 i, max3, node, result; for (i = 0, max3 = nodes.length; i < max3; i += 1) { node = nodes[i]; if (!bubble) { result = cb(node, i, nodes); } if (result !== false && node.type === "function" && Array.isArray(node.nodes)) { walk(node.nodes, cb, bubble); } if (bubble) { cb(node, i, 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, i; if (Array.isArray(nodes)) { result = ""; for (i = nodes.length - 1; ~i; i -= 1) { result = stringifyNode(nodes[i], 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_lib = __commonJS({ "node_modules/postcss-value-parser/lib/index.js"(exports, module) { var parse5 = require_parse2(); var walk = require_walk(); var stringify2 = require_stringify2(); function ValueParser(value) { if (this instanceof ValueParser) { this.nodes = parse5(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_lib(); 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/preferences var require_preferences = __commonJS({ "package-external:@wordpress/preferences"(exports, module) { module.exports = window.wp.preferences; } }); // 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(a, b) { if (a === b) return true; if (a && b && typeof a == "object" && typeof b == "object") { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0; ) if (!equal(a[i], b[i])) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0; ) { var key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } return a !== a && b !== b; }; } }); // 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: () => URLInput, 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: () => getCustomValueFromPreset2, getDimensionsClassesAndStyles: () => getDimensionsClassesAndStyles, getFontSize: () => getFontSize, getFontSizeClass: () => getFontSizeClass, getFontSizeObjectByValue: () => getFontSizeObjectByValue, getGradientSlugByValue: () => getGradientSlugByValue, getGradientValueBySlug: () => getGradientValueBySlug, getPxFromCssUnit: () => get_px_from_css_unit_default, getSpacingPresetCssVar: () => getSpacingPresetCssVar2, getStyleForState: () => getStyleForState2, getTypographyClassesAndStyles: () => getTypographyClassesAndStyles, isValueSpacingPreset: () => isValueSpacingPreset, privateApis: () => privateApis3, setStyleForState: () => setStyleForState, 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 t2, f, n = ""; if ("string" == typeof e2 || "number" == typeof e2) n += e2; else if ("object" == typeof e2) if (Array.isArray(e2)) { var o2 = e2.length; for (t2 = 0; t2 < o2; t2++) e2[t2] && (f = r(e2[t2])) && (n && (n += " "), n += f); } else for (f in e2) e2[f] && (n && (n += " "), n += f); return n; } function clsx() { for (var e2, t2, f = 0, n = "", o2 = arguments.length; f < o2; f++) (e2 = arguments[f]) && (t2 = r(e2)) && (n && (n += " "), n += t2); return n; } var clsx_default = clsx; // packages/block-editor/build-module/hooks/utils.mjs var import_blocks109 = __toESM(require_blocks(), 1); var import_element327 = __toESM(require_element(), 1); var import_data182 = __toESM(require_data(), 1); var import_compose108 = __toESM(require_compose(), 1); var import_hooks15 = __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 for (r3 = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, t2 = function(r4) { return "string" == typeof r4 ? r4.length > 0 : "number" == typeof r4; }, n = function(r4, t3, n2) { return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r4) / n2 + 0; }, u = function(r4, t3, n2) { return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r4 > n2 ? n2 : r4 > t3 ? r4 : t3; }, e2 = function(r4) { return (r4 = isFinite(r4) ? r4 % 360 : 0) < 0 ? r4 + 360 : r4; }, o2 = function(r4, t3) { return void 0 === t3 && (t3 = 0), n(r4, t3) % 360; }, a = function(r4) { return { r: u(r4.r, 0, 255), g: u(r4.g, 0, 255), b: u(r4.b, 0, 255), a: u(r4.a) }; }, i = function(r4) { return { r: n(r4.r), g: n(r4.g), b: n(r4.b), a: n(r4.a, 3) }; }, s = /^#([0-9a-f]{3,8})$/i, d = function(r4, t3) { var n2 = r4.charCodeAt(t3); return (15 & n2) + 9 * (n2 >> 6); }, h = function(r4, t3) { return d(r4, t3) << 4 | d(r4, t3 + 1); }, b = [], f = 0; f < 256; f++) b.push((f < 16 ? "0" : "") + f.toString(16)); var r3; var t2; var n; var u; var e2; var o2; var a; var i; var s; var d; var h; var b; var f; var g = function(r3) { return b[u(r3, 0, 255)]; }; var c = function(r3) { var t2 = r3.r, n = r3.g, u = r3.b, e2 = r3.a, o2 = Math.max(t2, n, u), a = o2 - Math.min(t2, n, u), i = a ? o2 === t2 ? (n - u) / a : o2 === n ? 2 + (u - t2) / a : 4 + (t2 - n) / a : 0; return { h: 60 * (i < 0 ? i + 6 : i), s: o2 ? a / o2 * 100 : 0, v: o2 / 255 * 100, a: e2 }; }; var v = function(r3) { var t2 = r3.h, n = r3.s, u = r3.v, e2 = r3.a; t2 = t2 / 360 * 6, n /= 100, u /= 100; var o2 = Math.floor(t2), a = u * (1 - n), i = u * (1 - (t2 - o2) * n), s = u * (1 - (1 - t2 + o2) * n), d = o2 % 6; return { r: 255 * [u, i, a, a, s, u][d], g: 255 * [s, u, u, i, a, a][d], b: 255 * [a, a, s, u, u, i][d], a: e2 }; }; var l = function(r3) { return { h: e2(r3.h), s: u(r3.s, 0, 100), l: u(r3.l, 0, 100), a: u(r3.a) }; }; var p = function(r3) { return { h: o2(r3.h), s: n(r3.s), l: n(r3.l), a: n(r3.a, 3) }; }; var m = function(r3) { return v((n = (t2 = r3).s, { h: t2.h, s: (n *= ((u = t2.l) < 50 ? u : 100 - u) / 100) > 0 ? 2 * n / (u + n) * 100 : 0, v: u + n, a: t2.a })); var t2, n, u; }; var y = function(r3) { return { h: (t2 = c(r3)).h, s: (e2 = (200 - (n = t2.s)) * (u = t2.v) / 100) > 0 && e2 < 200 ? n * u / 100 / (e2 <= 100 ? e2 : 200 - e2) * 100 : 0, l: e2 / 2, a: t2.a }; var t2, n, u, e2; }; var N = /^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i; var x = /^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s+([+-]?(?:\d*\.\d+|\d+))%\s+([+-]?(?:\d*\.\d+|\d+))%\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i; var M = /^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i; var H = /^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i; var $ = { string: [[function(r3) { if (!s.test(r3)) return null; var t2 = r3.length; return t2 <= 5 ? { r: 17 * d(r3, 1), g: 17 * d(r3, 2), b: 17 * d(r3, 3), a: 5 === t2 ? n(17 * d(r3, 4) / 255, 2) : 1 } : 7 === t2 || 9 === t2 ? { r: h(r3, 1), g: h(r3, 3), b: h(r3, 5), a: 9 === t2 ? n(h(r3, 7) / 255, 2) : 1 } : null; }, "hex"], [function(r3) { var t2 = M.exec(r3) || H.exec(r3); return t2 ? t2[2] !== t2[4] || t2[4] !== t2[6] ? null : a({ r: Number(t2[1]) / (t2[2] ? 100 / 255 : 1), g: Number(t2[3]) / (t2[4] ? 100 / 255 : 1), b: Number(t2[5]) / (t2[6] ? 100 / 255 : 1), a: void 0 === t2[7] ? 1 : Number(t2[7]) / (t2[8] ? 100 : 1) }) : null; }, "rgb"], [function(t2) { var n = N.exec(t2) || x.exec(t2); if (!n) return null; var u, e2, o2 = l({ h: (u = n[1], e2 = n[2], void 0 === e2 && (e2 = "deg"), Number(u) * (r3[e2] || 1)), s: Number(n[3]), l: Number(n[4]), a: void 0 === n[5] ? 1 : Number(n[5]) / (n[6] ? 100 : 1) }); return m(o2); }, "hsl"]], object: [[function(r3) { var n = r3.r, u = r3.g, e2 = r3.b, o2 = r3.a, i = void 0 === o2 ? 1 : o2; return t2(n) && t2(u) && t2(e2) ? a({ r: Number(n), g: Number(u), b: Number(e2), a: Number(i) }) : null; }, "rgb"], [function(r3) { var n = r3.h, u = r3.s, e2 = r3.l, o2 = r3.a, a = void 0 === o2 ? 1 : o2; if (!t2(n) || !t2(u) || !t2(e2)) return null; var i = l({ h: Number(n), s: Number(u), l: Number(e2), a: Number(a) }); return m(i); }, "hsl"], [function(r3) { var n = r3.h, o2 = r3.s, a = r3.v, i = r3.a, s = void 0 === i ? 1 : i; if (!t2(n) || !t2(o2) || !t2(a)) return null; var d = (function(r4) { return { h: e2(r4.h), s: u(r4.s, 0, 100), v: u(r4.v, 0, 100), a: u(r4.a) }; })({ h: Number(n), s: Number(o2), v: Number(a), a: Number(s) }); return v(d); }, "hsv"]] }; var j = function(r3, t2) { for (var n = 0; n < t2.length; n++) { var u = t2[n][0](r3); if (u) return [u, t2[n][1]]; } return [null, void 0]; }; var w = function(r3) { return "string" == typeof r3 ? j(r3.trim(), $.string) : "object" == typeof r3 && null !== r3 ? j(r3, $.object) : [null, void 0]; }; var k = function(r3, t2) { var n = y(r3); return { h: n.h, s: u(n.s + 100 * t2, 0, 100), l: n.l, a: n.a }; }; var E = function(r3) { return (299 * r3.r + 587 * r3.g + 114 * r3.b) / 1e3 / 255; }; var R = function(r3, t2) { var n = y(r3); return { h: n.h, s: n.s, l: u(n.l + 100 * t2, 0, 100), a: n.a }; }; var q = (function() { function r3(r4) { this.parsed = w(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(E(this.rgba), 2); }, r3.prototype.isDark = function() { return E(this.rgba) < 0.5; }, r3.prototype.isLight = function() { return E(this.rgba) >= 0.5; }, r3.prototype.toHex = function() { return r4 = i(this.rgba), t2 = r4.r, u = r4.g, e2 = r4.b, a = (o2 = r4.a) < 1 ? g(n(255 * o2)) : "", "#" + g(t2) + g(u) + g(e2) + a; var r4, t2, u, e2, o2, a; }, r3.prototype.toRgb = function() { return i(this.rgba); }, r3.prototype.toRgbString = function() { return r4 = i(this.rgba), t2 = r4.r, n = r4.g, u = r4.b, (e2 = r4.a) < 1 ? "rgba(" + t2 + ", " + n + ", " + u + ", " + e2 + ")" : "rgb(" + t2 + ", " + n + ", " + u + ")"; var r4, t2, n, u, e2; }, r3.prototype.toHsl = function() { return p(y(this.rgba)); }, r3.prototype.toHslString = function() { return r4 = p(y(this.rgba)), t2 = r4.h, n = r4.s, u = r4.l, (e2 = r4.a) < 1 ? "hsla(" + t2 + ", " + n + "%, " + u + "%, " + e2 + ")" : "hsl(" + t2 + ", " + n + "%, " + u + "%)"; var r4, t2, n, u, e2; }, r3.prototype.toHsv = function() { return r4 = c(this.rgba), { h: o2(r4.h), s: n(r4.s), v: n(r4.v), a: n(r4.a, 3) }; var r4; }, r3.prototype.invert = function() { return A({ 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), A(k(this.rgba, r4)); }, r3.prototype.desaturate = function(r4) { return void 0 === r4 && (r4 = 0.1), A(k(this.rgba, -r4)); }, r3.prototype.grayscale = function() { return A(k(this.rgba, -1)); }, r3.prototype.lighten = function(r4) { return void 0 === r4 && (r4 = 0.1), A(R(this.rgba, r4)); }, r3.prototype.darken = function(r4) { return void 0 === r4 && (r4 = 0.1), A(R(this.rgba, -r4)); }, r3.prototype.rotate = function(r4) { return void 0 === r4 && (r4 = 15), this.hue(y(this.rgba).h + r4); }, r3.prototype.alpha = function(r4) { return "number" == typeof r4 ? A({ r: (t2 = this.rgba).r, g: t2.g, b: t2.b, a: r4 }) : n(this.rgba.a, 3); var t2; }, r3.prototype.hue = function(r4) { var t2 = y(this.rgba); return "number" == typeof r4 ? A({ h: r4, s: t2.s, l: t2.l, a: t2.a }) : o2(t2.h); }, r3.prototype.isEqual = function(r4) { return this.toHex() === A(r4).toHex(); }, r3; })(); var A = function(r3) { return r3 instanceof q ? r3 : new q(r3); }; var C = []; var D = function(r3) { r3.forEach(function(r4) { C.indexOf(r4) < 0 && (r4(q, $), C.push(r4)); }); }; // node_modules/colord/plugins/names.mjs var e = function(e2, f) { var a = { 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 d in a) r3[a[d]] = d; var l2 = {}; e2.prototype.toName = function(f2) { if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent"; var d2, i, n = r3[this.toHex()]; if (n) return n; if (null == f2 ? void 0 : f2.closest) { var o2 = this.toRgb(), t2 = 1 / 0, b = "black"; if (!l2.length) for (var c6 in a) l2[c6] = new e2(a[c6]).toRgb(); for (var g2 in a) { var u = (d2 = o2, i = l2[g2], Math.pow(d2.r - i.r, 2) + Math.pow(d2.g - i.g, 2) + Math.pow(d2.b - i.b, 2)); u < t2 && (t2 = u, b = g2); } return b; } }; f.string.push([function(f2) { var r4 = f2.toLowerCase(), d2 = "transparent" === r4 ? "#0000" : a[r4]; return d2 ? new e2(d2).toRgb() : null; }, "name"]); }; // node_modules/colord/plugins/a11y.mjs var o = function(o2) { var t2 = o2 / 255; return t2 < 0.04045 ? t2 / 12.92 : Math.pow((t2 + 0.055) / 1.055, 2.4); }; var t = function(t2) { return 0.2126 * o(t2.r) + 0.7152 * o(t2.g) + 0.0722 * o(t2.b); }; var r2 = function(o2) { o2.prototype.luminance = function() { return o3 = t(this.rgba), void 0 === (r3 = 2) && (r3 = 0), void 0 === n && (n = Math.pow(10, r3)), Math.round(n * o3) / n + 0; var o3, r3, n; }, o2.prototype.contrast = function(r3) { void 0 === r3 && (r3 = "#FFF"); var n, a, i, e2, v2, u, d, c6 = r3 instanceof o2 ? r3 : new o2(r3); return e2 = this.rgba, v2 = c6.toRgb(), u = t(e2), d = t(v2), n = u > d ? (u + 0.05) / (d + 0.05) : (d + 0.05) / (u + 0.05), void 0 === (a = 2) && (a = 0), void 0 === i && (i = Math.pow(10, a)), Math.floor(i * n) / i + 0; }, o2.prototype.isReadable = function(o3, t2) { return void 0 === o3 && (o3 = "#FFF"), void 0 === t2 && (t2 = {}), this.contrast(o3) >= (e2 = void 0 === (i = (r3 = t2).size) ? "normal" : i, "AAA" === (a = void 0 === (n = r3.level) ? "AA" : n) && "normal" === e2 ? 7 : "AA" === a && "large" === e2 ? 3 : 4.5); var r3, n, a, i, e2; }; }; // node_modules/tslib/tslib.es6.mjs var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { d2.__proto__ = b2; } || function(d2, b2) { for (var p2 in b2) if (Object.prototype.hasOwnProperty.call(b2, p2)) d2[p2] = b2[p2]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __242() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__242.prototype = b.prototype, new __242()); } var __assign = function() { __assign = Object.assign || function __assign2(t2) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2)) t2[p2] = s[p2]; } return t2; }; 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, re2, value) { if (re2 instanceof RegExp) return input.replace(re2, value); return re2.reduce(function(input2, re3) { return input2.replace(re3, value); }, input); } // node_modules/dot-case/dist.es2015/index.js function dotCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: "." }, options)); } // node_modules/param-case/dist.es2015/index.js function paramCase(input, options) { if (options === void 0) { options = {}; } return dotCase(input, __assign({ delimiter: "-" }, options)); } // packages/kebab-case/build-module/index.mjs function kebabCase(str) { let input = str?.toString?.() ?? ""; input = input.replace(/['\u2019]/, ""); return paramCase(input, { splitRegexp: [ /(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g, // fooBar => foo-bar, 3Bar => 3-bar /(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g, // 3bar => 3-bar /([A-Za-z])([0-9])/g, // Foo3 => foo-3, foo3 => foo-3 /([A-Z])([A-Z][a-z])/g // FOOBar => foo-bar ] }); } // packages/block-editor/build-module/components/colors/utils.mjs D([e, r2]); 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 = A(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); // 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_blocks12 = __toESM(require_blocks(), 1); // packages/block-editor/build-module/components/block-edit/edit.mjs var import_blocks = __toESM(require_blocks(), 1); var import_components = __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/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/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 Component4 = blockType.edit || blockType.save; return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Component4, { ...props }); }; var EditWithFilters = (0, import_components.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_blocks11 = __toESM(require_blocks(), 1); var import_components3 = __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, index3) { return [ ...array.slice(0, index3), ...Array.isArray(elements) ? elements : [elements], ...array.slice(index3) ]; } 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(a, b) { return (0, import_es6.default)(Object.keys(a), Object.keys(b)); } 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((b) => b.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 i = 0; i < result.length; i++) { if (!state.order.get(result[i]) || action.keepControlledInnerBlocks && action.keepControlledInnerBlocks[result[i]]) { continue; } if (result === clientIds) { result = [...result]; } result.push(...state.order.get(result[i])); } 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: index3 = subState.length } = action; const newState = new Map(state); mappedBlocks.forEach((order, clientId) => { newState.set(clientId, order); }); newState.set( rootClientId, insertAt( subState, mappedBlocks.get(rootClientId), index3 ) ); return newState; } case "MOVE_BLOCKS_TO_POSITION": { const { fromRootClientId = "", toRootClientId = "", clientIds } = action; const { index: index3 = 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, index3, 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, index3) ); 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: index3, __unstableWithInserter, operation, nearestSide } = action; const nextState = { rootClientId, index: index3, __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, getSelectedBlockStyleState: () => getSelectedBlockStyleState, getSelectedBlocksInitialCaretPosition: () => getSelectedBlocksInitialCaretPosition, getSelectionEnd: () => getSelectionEnd, getSelectionStart: () => getSelectionStart, getSettings: () => getSettings, getTemplate: () => getTemplate, getTemplateLock: () => getTemplateLock, hasBlockMovingClientId: () => hasBlockMovingClientId, hasDraggedInnerBlock: () => hasDraggedInnerBlock, hasInserterItems: () => hasInserterItems, hasMultiSelection: () => hasMultiSelection, hasSelectedBlock: () => hasSelectedBlock, hasSelectedBlockStyleState: () => hasSelectedBlockStyleState, 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, style, ...props }, ref) => { const intrinsicStyle = icon.props.style; const mergedStyle = intrinsicStyle || style ? { ...intrinsicStyle, ...style } : void 0; return (0, import_element5.cloneElement)(icon, { width: size4, height: size4, ...props, // Merge styles so the icon's intrinsic style (e.g. `fill: none` on // stroke-based icons) is preserved unless the consumer overrides // the same property explicitly. ...mergedStyle ? { style: mergedStyle } : {}, 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.Path, { d: "M7.5 5H16.5M4 12H20M7.5 19H16.5", vectorEffect: "non-scaling-stroke" }) }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.Path, { d: "M4 5H20M4 12H20M4 19H16.5", vectorEffect: "non-scaling-stroke" }) }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.Path, { d: "M4 5H13M4 12H20M4 19H13", vectorEffect: "non-scaling-stroke" }) }); // 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.jsxs)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.Path, { d: "M5 5H19M5 19H19", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.Rect, { x: "5", y: "9", width: "14", height: "6", fill: "currentColor", stroke: "none" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.Path, { d: "M11 5H20M4 12H20M11 19H20", vectorEffect: "non-scaling-stroke" }) }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.Path, { d: "M12 4V19M7 14L12 19L17 14", vectorEffect: "non-scaling-stroke" }) }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives7.Path, { d: "M20 12L5 12M10 7L5 12L10 17", vectorEffect: "non-scaling-stroke" }) }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives8.Path, { d: "M4 12L19 12M14 17L19 12L14 7", vectorEffect: "non-scaling-stroke" }) }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives9.Path, { d: "M7.25 12V9.25H10M16.75 12V14.75H14M5.5 17.75H18.5C19.1904 17.75 19.75 17.1904 19.75 16.5V7.5C19.75 6.80964 19.1904 6.25 18.5 6.25H5.5C4.80964 6.25 4.25 6.80964 4.25 7.5V16.5C4.25 17.1904 4.80964 17.75 5.5 17.75Z", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/block-default.mjs var import_primitives10 = __toESM(require_primitives(), 1); var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); var block_default_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives10.Path, { d: "M3.75 10C3.75 9.30964 4.30964 8.75 5 8.75H19C19.6904 8.75 20.25 9.30964 20.25 10V18C20.25 18.6904 19.6904 19.25 19 19.25H5C4.30964 19.25 3.75 18.6904 3.75 18V10Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives10.Path, { d: "M10.5 6.5V9H6.5V6.5H10.5ZM17.5 6.5V9H13.5V6.5H17.5Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/category.mjs var import_primitives11 = __toESM(require_primitives(), 1); var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); var category_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives11.Path, { d: "M4.75 6C4.75 5.30964 5.30964 4.75 6 4.75H9C9.69036 4.75 10.25 5.30964 10.25 6V9C10.25 9.69036 9.69036 10.25 9 10.25H6C5.30964 10.25 4.75 9.69036 4.75 9V6Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives11.Path, { d: "M4.75 15C4.75 14.3096 5.30964 13.75 6 13.75H9C9.69036 13.75 10.25 14.3096 10.25 15V18C10.25 18.6904 9.69036 19.25 9 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V15Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives11.Path, { d: "M13.75 6C13.75 5.30964 14.3096 4.75 15 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V9C19.25 9.69036 18.6904 10.25 18 10.25H15C14.3096 10.25 13.75 9.69036 13.75 9V6Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives11.Path, { d: "M13.75 15C13.75 14.3096 14.3096 13.75 15 13.75H18C18.6904 13.75 19.25 14.3096 19.25 15V18C19.25 18.6904 18.6904 19.25 18 19.25H15C14.3096 19.25 13.75 18.6904 13.75 18V15Z", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/caution.mjs var import_primitives12 = __toESM(require_primitives(), 1); var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); var caution_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives12.Path, { d: "M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/check.mjs var import_primitives13 = __toESM(require_primitives(), 1); var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); var check_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives13.Path, { d: "M7 12L10 15L17 8", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/chevron-down.mjs var import_primitives14 = __toESM(require_primitives(), 1); var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives14.Path, { d: "M7 11L12 15L17 11", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/chevron-left-small.mjs var import_primitives15 = __toESM(require_primitives(), 1); var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives15.Path, { d: "M13.5 8.5L10.5 12L13.5 15.5", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/chevron-left.mjs var import_primitives16 = __toESM(require_primitives(), 1); var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives16.Path, { d: "M14 6.5L9 12L14 17.5", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/chevron-right-small.mjs var import_primitives17 = __toESM(require_primitives(), 1); var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives17.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives17.Path, { d: "M10.5 8.5L13.5 12L10.5 15.5", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/chevron-right.mjs var import_primitives18 = __toESM(require_primitives(), 1); var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives18.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives18.Path, { d: "M10 6.5L15 12L10 17.5", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/chevron-up.mjs var import_primitives19 = __toESM(require_primitives(), 1); var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives19.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives19.Path, { d: "M7 13L12 9L17 13", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/close-small.mjs var import_primitives20 = __toESM(require_primitives(), 1); var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives20.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives20.Path, { d: "M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/cog.mjs var import_primitives21 = __toESM(require_primitives(), 1); var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); var cog_default = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_primitives21.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives21.Path, { d: "M5.38646 8.95505C5.36302 8.99564 5.37092 9.04706 5.40547 9.07874L6.96476 10.509C7.08306 10.1089 7.24777 9.72864 7.45264 9.37456C7.66022 9.01579 7.90904 8.68387 8.19262 8.38527L6.17287 7.74956C6.12816 7.73549 6.07968 7.75436 6.05624 7.79495L5.38646 8.95505Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives21.Path, { d: "M12.6698 19.25C12.7167 19.25 12.7573 19.2174 12.7674 19.1717L13.2265 17.106C12.833 17.2001 12.4223 17.25 12 17.25C11.5777 17.25 11.167 17.2001 10.7736 17.106L11.2326 19.1717C11.2428 19.2174 11.2834 19.25 11.3303 19.25L12.6698 19.25Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives21.Path, { d: "M11.3303 4.75C11.2834 4.75 11.2428 4.78255 11.2326 4.82831L10.7736 6.89403C11.167 6.79986 11.5777 6.75 12 6.75C12.4223 6.75 12.833 6.79987 13.2265 6.89403L12.7674 4.82831C12.7573 4.78255 12.7167 4.75 12.6698 4.75L11.3303 4.75Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives21.Path, { d: "M17.9438 7.79495C17.9204 7.75436 17.8719 7.73549 17.8272 7.74956L15.8074 8.38528C16.091 8.68388 16.3398 9.0158 16.5474 9.37457C16.7523 9.72865 16.917 10.1089 17.0353 10.509L18.5946 9.07874C18.6291 9.04706 18.637 8.99564 18.6136 8.95505L17.9438 7.79495Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives21.Path, { d: "M6.05625 16.205C6.07968 16.2456 6.12816 16.2645 6.17287 16.2504L8.19262 15.6147C7.90904 15.3161 7.66022 14.9842 7.45264 14.6254C7.24777 14.2714 7.08307 13.8911 6.96476 13.491L5.40547 14.9213C5.37093 14.9529 5.36303 15.0044 5.38646 15.045L6.05625 16.205Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives21.Path, { d: "M18.6136 15.0449C18.637 15.0044 18.6291 14.9529 18.5946 14.9213L17.0353 13.491C16.917 13.8911 16.7523 14.2713 16.5474 14.6254C16.3398 14.9842 16.091 15.3161 15.8074 15.6147L17.8272 16.2504C17.8719 16.2645 17.9204 16.2456 17.9438 16.205L18.6136 15.0449Z", fill: "currentColor", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives21.Path, { d: "M12 6.75C14.8995 6.75 17.25 9.10051 17.25 12C17.25 14.8995 14.8995 17.25 12 17.25C9.10051 17.25 6.75 14.8995 6.75 12C6.75 9.10051 9.10051 6.75 12 6.75Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives21.Path, { d: "M12 8C14.2091 8 16 9.79086 16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8Z", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/copy-small.mjs var import_primitives22 = __toESM(require_primitives(), 1); var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); var copy_small_default = /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_primitives22.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives22.Rect, { x: "4.75", y: "4.75", width: "11.5", height: "11.5", rx: "0.875", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives22.Path, { d: "M19.25 8.281V17.281C19.25 18.3692 18.3546 19.25 17.251 19.25H6.25", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/copy.mjs var import_primitives23 = __toESM(require_primitives(), 1); var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); var copy_default = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_primitives23.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives23.Path, { d: "M20.25 6.75V19C20.25 19.6904 19.6904 20.25 19 20.25H6.75", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives23.Path, { d: "M3.75 5C3.75 4.30964 4.30964 3.75 5 3.75H16C16.6904 3.75 17.25 4.30964 17.25 5V16C17.25 16.6904 16.6904 17.25 16 17.25H5C4.30964 17.25 3.75 16.6904 3.75 16V5Z", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/corner-all.mjs var import_primitives24 = __toESM(require_primitives(), 1); var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); var corner_all_default = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives24.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives24.Path, { d: "M19.25 9V6C19.25 5.30964 18.6904 4.75 18 4.75H15M19.25 15V18C19.25 18.6904 18.6904 19.25 18 19.25H15M9 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V9M4.75 15V18C4.75 18.6904 5.30964 19.25 6 19.25H9", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/corner-bottom-left.mjs var import_primitives25 = __toESM(require_primitives(), 1); var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); var corner_bottom_left_default = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_primitives25.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives25.Path, { d: "M4.75 15V18C4.75 18.6904 5.30964 19.25 6 19.25H9", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives25.Path, { opacity: ".25", d: "M19.25 9V6C19.25 5.30964 18.6904 4.75 18 4.75H15M19.25 15V18C19.25 18.6904 18.6904 19.25 18 19.25H15M9 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V9", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/corner-bottom-right.mjs var import_primitives26 = __toESM(require_primitives(), 1); var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); var corner_bottom_right_default = /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_primitives26.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives26.Path, { d: "M15 19.25L18 19.25C18.6904 19.25 19.25 18.6904 19.25 18L19.25 15", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives26.Path, { opacity: ".25", d: "M9 4.75L6 4.75C5.30965 4.75 4.75 5.30964 4.75 6L4.75 9M15 4.75L18 4.75C18.6904 4.75 19.25 5.30964 19.25 6L19.25 9M4.75 15L4.75 18C4.75 18.6904 5.30964 19.25 6 19.25L9 19.25", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/corner-top-left.mjs var import_primitives27 = __toESM(require_primitives(), 1); var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); var corner_top_left_default = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_primitives27.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives27.Path, { d: "M9 4.75L6 4.75C5.30964 4.75 4.75 5.30964 4.75 6L4.75 9", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives27.Path, { opacity: ".25", d: "M15 19.25L18 19.25C18.6904 19.25 19.25 18.6904 19.25 18L19.25 15M9 19.25L6 19.25C5.30964 19.25 4.75 18.6904 4.75 18L4.75 15M19.25 9L19.25 6C19.25 5.30964 18.6904 4.75 18 4.75L15 4.75", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/corner-top-right.mjs var import_primitives28 = __toESM(require_primitives(), 1); var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); var corner_top_right_default = /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_primitives28.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives28.Path, { d: "M19.25 9L19.25 6C19.25 5.30965 18.6904 4.75 18 4.75L15 4.75", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives28.Path, { opacity: ".25", d: "M4.75 15L4.75 18C4.75 18.6904 5.30964 19.25 6 19.25L9 19.25M4.75 9L4.75 6C4.75 5.30964 5.30965 4.75 6 4.75L9 4.75M15 19.25L18 19.25C18.6904 19.25 19.25 18.6904 19.25 18L19.25 15", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/desktop.mjs var import_primitives29 = __toESM(require_primitives(), 1); var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); var desktop_default = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives29.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives29.Path, { d: "M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/drag-handle.mjs var import_primitives30 = __toESM(require_primitives(), 1); var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); var drag_handle_default = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_primitives30.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.Path, { d: "M9.25 5.75H8.75V6.25H9.25V5.75Z", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.Path, { d: "M9.25 11.75H8.75V12.25H9.25V11.75Z", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.Path, { d: "M9.25 17.75H8.75V18.25H9.25V17.75Z", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.Path, { d: "M15.25 5.75H14.75V6.25H15.25V5.75Z", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.Path, { d: "M15.25 11.75H14.75V12.25H15.25V11.75Z", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.Path, { d: "M15.25 17.75H14.75V18.25H15.25V17.75Z", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.Path, { d: "M9.25 5.75H8.75V6.25H9.25V5.75Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.Path, { d: "M9.25 11.75H8.75V12.25H9.25V11.75Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.Path, { d: "M9.25 17.75H8.75V18.25H9.25V17.75Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.Path, { d: "M15.25 5.75H14.75V6.25H15.25V5.75Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.Path, { d: "M15.25 11.75H14.75V12.25H15.25V11.75Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives30.Path, { d: "M15.25 17.75H14.75V18.25H15.25V17.75Z", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/envelope.mjs var import_primitives31 = __toESM(require_primitives(), 1); var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); var envelope_default = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives31.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives31.Path, { d: "M20.25 8.5V7C20.25 6.30964 19.6904 5.75 19 5.75H5C4.30964 5.75 3.75 6.30964 3.75 7V8.5M20.25 8.5V17C20.25 17.6904 19.6904 18.25 19 18.25H5C4.30964 18.25 3.75 17.6904 3.75 17V8.5M20.25 8.5L12 14.5L3.75 8.5", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/error.mjs var import_primitives32 = __toESM(require_primitives(), 1); var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); var error_default = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives32.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives32.Path, { d: "M12 9L12 14M12 15.5V17M11.1284 5.04947L3.83827 18.0097C3.46331 18.6763 3.94502 19.5 4.70985 19.5H19.2902C20.055 19.5 20.5367 18.6763 20.1617 18.0097L12.8716 5.04947C12.4893 4.36982 11.5107 4.36982 11.1284 5.04947Z", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/external.mjs var import_primitives33 = __toESM(require_primitives(), 1); var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); var external_default = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives33.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives33.Path, { d: "M9.5 6.25H6.5C5.80964 6.25 5.25 6.80964 5.25 7.5V17.5C5.25 18.1904 5.80964 18.75 6.5 18.75H16.5C17.1904 18.75 17.75 18.1904 17.75 17.5V14.5M11.5 12.5L18.75 5.25M12.5 5.25H18.75V11.5", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/file.mjs var import_primitives34 = __toESM(require_primitives(), 1); var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); var file_default = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives34.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives34.Path, { d: "M3.75 6V17.5C3.75 18.1904 4.30964 18.75 5 18.75H19C19.6904 18.75 20.25 18.1904 20.25 17.5V8.5C20.25 7.80964 19.6904 7.25 19 7.25H13.3463C12.8352 7.25 12.3755 6.93881 12.1857 6.46424L11.8143 5.53576C11.6245 5.06119 11.1648 4.75 10.6537 4.75H5C4.30964 4.75 3.75 5.30964 3.75 6Z", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/filter.mjs var import_primitives35 = __toESM(require_primitives(), 1); var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); var filter_default = /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_primitives35.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives35.Path, { d: "M12 5.5L5.25 18.25H18.75L12 5.5Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives35.Path, { d: "M11.25 18.25H5.25L11.25 6.91666V18.25Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/format-capitalize.mjs var import_primitives36 = __toESM(require_primitives(), 1); var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); var format_capitalize_default = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_primitives36.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives36.Path, { d: "M11.4527 17.5V17.223L10.4369 14.1757L8.12838 7.25H7.57432L5.26577 14.1757L4.25 17.223V17.5M10.4369 14.1757H5.26577", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives36.Path, { d: "M14.25 6V15.0386V17.5M14.25 13.2941C14.25 11.2353 15.4265 10.4118 16.8676 10.4118C18.4595 10.4118 19.75 11.6471 19.75 13.7059C19.75 15.7647 18.4595 17 16.8676 17C15.6908 17 14.25 15.7647 14.25 14.1176", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/format-lowercase.mjs var import_primitives37 = __toESM(require_primitives(), 1); var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); var format_lowercase_default = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_primitives37.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives37.Path, { d: "M14.25 6V15.0386V17.5M14.25 13.2941C14.25 11.2353 15.4265 10.4118 16.8676 10.4118C18.4595 10.4118 19.75 11.6471 19.75 13.7059C19.75 15.7647 18.4595 16.75 16.8676 16.75C15.6908 16.75 14.25 15.7647 14.25 14.1176", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives37.Path, { d: "M10.5 9.5C10.5 9.5 10.5 13.5533 10.5 14.7886C10.5 16.0239 10.6824 16.75 12 16.75M10.5 13.0441C10.5 10.9853 9.32353 10.1618 7.88235 10.1618C6.29047 10.1618 5 11.3971 5 13.4559C5 15.5147 6.29047 16.75 7.88235 16.75C9.0592 16.75 10.5 15.5147 10.5 13.8676", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/format-strikethrough.mjs var import_primitives38 = __toESM(require_primitives(), 1); var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); var format_strikethrough_default = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives38.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives38.Path, { d: "M9 16.1554C12 18.02 15 16.5283 15 14.2908C15 13.6314 14.6839 12.999 14.1213 12.5328C14.108 12.5217 14.0945 12.5108 14.081 12.5M9 9.31845C9 7.49773 11.4313 6.3247 13.9199 7.4278M5.5 12.5H14.081M18.5 12.5H14.081", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/format-underline.mjs var import_primitives39 = __toESM(require_primitives(), 1); var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); var format_underline_default = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_primitives39.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives39.Path, { d: "M15.25 7.25V13.5C15.25 15.2949 13.7949 16.75 12 16.75C10.2051 16.75 8.75 15.2949 8.75 13.5V7.25", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives39.Path, { d: "M8 19.5H16", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/format-uppercase.mjs var import_primitives40 = __toESM(require_primitives(), 1); var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1); var format_uppercase_default = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_primitives40.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives40.Path, { d: "M17.4118 11.7206H14M17.4118 11.7206L17.9839 11.8477C19.1189 12.1 19.9265 13.1066 19.9265 14.2693C19.9265 15.6394 18.8158 16.75 17.4458 16.75H14C14 16.75 14 14.439 14 11.7206M17.4118 11.7206C18.3792 11.5594 19.0882 10.7223 19.0882 9.74158V9.51902C19.0882 8.26588 18.0724 7.25 16.8192 7.25H14C14 8.55783 14 10.2406 14 11.7206", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives40.Path, { d: "M4.25 17.5V17.223L5.26577 14.1757M5.26577 14.1757L7.57432 7.25H8.12838L10.4369 14.1757L11.4527 17.223V17.5M10.4369 14.1757H5.26577", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/full-height.mjs var import_primitives41 = __toESM(require_primitives(), 1); var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1); var full_height_default = /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives41.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives41.Path, { d: "M5 12H19M12 9.5V3M8.5 6L12 3L15.5 6M12 14.5V21M8.5 18L12 21L15.5 18", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/fullscreen.mjs var import_primitives42 = __toESM(require_primitives(), 1); var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1); var fullscreen_default = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives42.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives42.Path, { d: "M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/globe.mjs var import_primitives43 = __toESM(require_primitives(), 1); var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1); var globe_default = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives43.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives43.Path, { d: "M12 4.75C8.87453 4.75 6.21099 6.72773 5.19257 9.5M18.8074 14.5C19.0937 13.7207 19.25 12.8786 19.25 12C19.25 11.1214 19.0937 10.2793 18.8074 9.5C17.789 6.72773 15.1255 4.75 12 4.75M12 4.75C11 5.5 9 8.63218 9 12C9 15.3678 11 18.5 12 19.25M12 4.75C13 5.5 15 8.63218 15 12C15 15.3678 13 18.5 12 19.25M5.19257 9.5C4.90628 10.2793 4.75 11.1214 4.75 12C4.75 12.8786 4.90629 13.7207 5.19257 14.5C6.21099 17.2723 8.87453 19.25 12 19.25M12 19.25C15.1255 19.25 17.789 17.2723 18.8074 14.5M5.19257 9.5L18.8074 9.5M5.19257 14.5L18.8074 14.5", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/grid.mjs var import_primitives44 = __toESM(require_primitives(), 1); var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1); var grid_default = /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives44.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives44.Path, { d: "M12 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V12M12 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V12M12 4.75V19.25M12 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V12M12 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V12M19.25 12H4.75", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/group.mjs var import_primitives45 = __toESM(require_primitives(), 1); var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1); var group_default = /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_primitives45.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_primitives45.Path, { d: "M4.75 11C4.75 10.3096 5.30964 9.75 6 9.75H13C13.6904 9.75 14.25 10.3096 14.25 11V18C14.25 18.6904 13.6904 19.25 13 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V11Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_primitives45.Path, { d: "M9.75 6C9.75 5.30964 10.3096 4.75 11 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V13C19.25 13.6904 18.6904 14.25 18 14.25H11C10.3096 14.25 9.75 13.6904 9.75 13V6Z", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/heading-level-1.mjs var import_primitives46 = __toESM(require_primitives(), 1); var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1); var heading_level_1_default = /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_primitives46.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_primitives46.Path, { d: "M5.25 12H11M5.25 12V7.75M5.25 12L5.25 16.25M11 12V7.75M11 12V16.25", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_primitives46.Path, { d: "M17 17C17 16.1556 17 10.213 17 7.75L14 8.55556", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/heading-level-2.mjs var import_primitives47 = __toESM(require_primitives(), 1); var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1); var heading_level_2_default = /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_primitives47.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_primitives47.Path, { d: "M19.1415 16.25H14.75C14.75 11.7122 19.25 12.9034 19.25 9.5C19.25 7.79832 16.9457 6.29831 14.75 8", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_primitives47.Path, { d: "M5.25 12H11M5.25 12V7.75M5.25 12L5.25 16.25M11 12V7.75M11 12V16.25", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/heading-level-3.mjs var import_primitives48 = __toESM(require_primitives(), 1); var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1); var heading_level_3_default = /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_primitives48.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_primitives48.Path, { d: "M5.25 12H11M5.25 12V7.75M5.25 12L5.25 16.25M11 12V7.75M11 12V16.25", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_primitives48.Path, { d: "M14.5 15.4934C17 17.1638 19.5 15.8275 19.5 13.823C19.5 13.2323 19.2366 12.6658 18.7678 12.2481C18.2989 11.8305 17.663 11.5958 17 11.5958M17 11.5958C17.663 11.5958 18.2989 11.3612 18.7678 10.9435C19.2366 10.5258 19.5 9.95933 19.5 9.36864C19.5 7.69825 17.125 6.58466 15 7.69825M17 11.5958H16.75", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/heading-level-4.mjs var import_primitives49 = __toESM(require_primitives(), 1); var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1); var heading_level_4_default = /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_primitives49.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_primitives49.Path, { d: "M5.25 12H11M5.25 12V7.75M5.25 12L5.25 16.25M11 12V7.75M11 12V16.25", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_primitives49.Path, { d: "M19.25 17V12.75M19.25 9V12.75M15 7V7.5L13.75 12.75H19.25", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/heading-level-5.mjs var import_primitives50 = __toESM(require_primitives(), 1); var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1); var heading_level_5_default = /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_primitives50.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_primitives50.Path, { d: "M5.25 12H11M5.25 12V7.75M5.25 12L5.25 16.25M11 12V7.75M11 12V16.25", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_primitives50.Path, { d: "M14 15.4934C16.5 17.1638 19 15.8275 19 13.823C19 13.2323 18.7366 12.6658 18.2678 12.2482C17.7989 11.8305 17.163 11.5958 16.5 11.5958H14.25L14.75 7.75H18", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/heading-level-6.mjs var import_primitives51 = __toESM(require_primitives(), 1); var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1); var heading_level_6_default = /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_primitives51.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_primitives51.Path, { d: "M5.25 12H11M5.25 12V7.75M5.25 12L5.25 16.25M11 12V7.75M11 12V16.25", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_primitives51.Path, { d: "M19.0092 8.10342C17.1095 7.1899 15.4694 8.08711 14.7634 9.38026C14.0574 10.6734 13.8551 12.0834 14.0986 13.62C14.177 14.1146 14.3884 14.8582 14.9041 15.3039C15.4198 15.7496 16.1193 16 16.8486 16C17.578 16 18.2775 15.7496 18.7932 15.3039C19.3089 14.8582 19.5986 14.2537 19.5986 13.6234C19.5986 12.9931 19.3089 12.3918 18.7932 11.9461C18.2775 11.5004 17.578 11.25 16.8486 11.25C16.1193 11.25 15.4198 11.5004 14.9041 11.9461C14.3884 12.3918 14.0986 12.9931 14.0986 13.6234", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/home.mjs var import_primitives52 = __toESM(require_primitives(), 1); var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1); var home_default = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_primitives52.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_primitives52.Path, { d: "M13.75 19.25H19.25V8.5L12 5L4.75 8.5V19.25H10.25M13.75 19.25V13.7H10.25V19.25M13.75 19.25H10.25", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/image.mjs var import_primitives53 = __toESM(require_primitives(), 1); var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1); var image_default = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_primitives53.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_primitives53.Path, { d: "M19.25 14.2513L16.0707 11.0707C16.0317 11.0317 15.9683 11.0317 15.9293 11.0707L12.0584 14.9416C12.0245 14.9755 11.9713 14.9806 11.9316 14.9537L8.65791 12.7392C8.62313 12.7156 8.57736 12.7163 8.54332 12.7409L4.75 15.4808M19.25 14.2513V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V15.4808M19.25 14.2513V18C19.25 18.6904 18.6904 19.25 18 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V15.4808", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/info.mjs var import_primitives54 = __toESM(require_primitives(), 1); var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1); var info_default = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_primitives54.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_primitives54.Path, { d: "M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/justify-bottom.mjs var import_primitives55 = __toESM(require_primitives(), 1); var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1); var justify_bottom_default = /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_primitives55.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_primitives55.Path, { d: "M4 19.25H20", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_primitives55.Rect, { x: "9", y: "4", width: "6", height: "11", fill: "currentColor", stroke: "none" }) ] }); // packages/icons/build-module/library/justify-center-vertical.mjs var import_primitives56 = __toESM(require_primitives(), 1); var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1); var justify_center_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_primitives56.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_primitives56.Path, { d: "M4 12H20", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_primitives56.Rect, { x: "9", y: "4", width: "6", height: "16", fill: "currentColor", stroke: "none" }) ] }); // packages/icons/build-module/library/justify-center.mjs var import_primitives57 = __toESM(require_primitives(), 1); var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1); var justify_center_default = /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_primitives57.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_primitives57.Path, { d: "M12 20V4", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_primitives57.Rect, { x: "4", y: "9", width: "16", height: "6", fill: "currentColor", stroke: "none" }) ] }); // packages/icons/build-module/library/justify-left.mjs var import_primitives58 = __toESM(require_primitives(), 1); var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1); var justify_left_default = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_primitives58.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_primitives58.Path, { d: "M4.75 4V20", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_primitives58.Rect, { x: "9", y: "9", width: "11", height: "6", fill: "currentColor", stroke: "none" }) ] }); // packages/icons/build-module/library/justify-right.mjs var import_primitives59 = __toESM(require_primitives(), 1); var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1); var justify_right_default = /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_primitives59.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_primitives59.Rect, { x: "4", y: "9", width: "11", height: "6", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_primitives59.Path, { d: "M19.25 20V4", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/justify-space-between-vertical.mjs var import_primitives60 = __toESM(require_primitives(), 1); var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1); var justify_space_between_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_primitives60.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_primitives60.Path, { d: "M4 12H20", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_primitives60.Path, { d: "M17 20H7V16H17V20Z", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_primitives60.Path, { d: "M17 8H7V4H17V8Z", fill: "currentColor", stroke: "none" }) ] }); // packages/icons/build-module/library/justify-space-between.mjs var import_primitives61 = __toESM(require_primitives(), 1); var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1); var justify_space_between_default = /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_primitives61.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_primitives61.Rect, { x: "9", y: "9", width: "6", height: "6", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_primitives61.Path, { d: "M19.25 4V20M4.75 20V4", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/justify-stretch-vertical.mjs var import_primitives62 = __toESM(require_primitives(), 1); var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1); var justify_stretch_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_primitives62.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_primitives62.Rect, { x: "10", y: "7", width: "4", height: "10", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_primitives62.Path, { d: "M4 4.75H20M4 19.25H20", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/justify-stretch.mjs var import_primitives63 = __toESM(require_primitives(), 1); var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1); var justify_stretch_default = /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_primitives63.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_primitives63.Path, { d: "M4.75 4V20M19.25 20V4", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_primitives63.Rect, { x: "7", y: "10", width: "10", height: "4", fill: "currentColor", stroke: "none" }) ] }); // packages/icons/build-module/library/justify-top.mjs var import_primitives64 = __toESM(require_primitives(), 1); var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1); var justify_top_default = /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_primitives64.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_primitives64.Rect, { x: "9", y: "9", width: "6", height: "11", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_primitives64.Path, { d: "M4 4.75H20", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/keyboard-return.mjs var import_primitives65 = __toESM(require_primitives(), 1); var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1); var keyboard_return_default = /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_primitives65.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_primitives65.Path, { d: "M8.25 21L4.75 17L8.25 13M4.75 17H14.125C17.5077 17 20.25 14.2577 20.25 10.875C20.25 7.49226 17.5077 4.75 14.125 4.75H12", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/layout.mjs var import_primitives66 = __toESM(require_primitives(), 1); var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1); var layout_default = /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_primitives66.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_primitives66.Path, { d: "M9.75 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V9.75M9.75 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V9.75M9.75 19.25V9.75M19.25 9.75V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V9.75M19.25 9.75H9.75M9.75 9.75H4.75", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/link-off.mjs var import_primitives67 = __toESM(require_primitives(), 1); var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1); var link_off_default = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_primitives67.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_primitives67.Path, { d: "M9.5 12H12.5M10 7.75H8.25C5.90279 7.75 4 9.65279 4 12C4 14.3472 5.90279 16.25 8.25 16.25H10.2333M14 16.25H15.75C18.0972 16.25 20 14.3472 20 12C20 9.65279 18.0972 7.75 15.75 7.75H14.7667M8.5 19.5L16.5 4.5", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/link.mjs var import_primitives68 = __toESM(require_primitives(), 1); var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1); var link_default = /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_primitives68.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_primitives68.Path, { d: "M9.5 12L14.5 12M10 7.75H8.25C5.90279 7.75 4 9.65279 4 12C4 14.3472 5.90279 16.25 8.25 16.25H10M14 16.25H15.75C18.0972 16.25 20 14.3472 20 12C20 9.65279 18.0972 7.75 15.75 7.75L14 7.75", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/list-view.mjs var import_primitives69 = __toESM(require_primitives(), 1); var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1); var list_view_default = /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_primitives69.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_primitives69.Path, { d: "M10 17.5H21M6.5 12H17.5M3 6.5H14", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/lock-outline.mjs var import_primitives70 = __toESM(require_primitives(), 1); var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1); var lock_outline_default = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_primitives70.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_primitives70.Path, { d: "M9.25 10.75H7.75C7.47386 10.75 7.25 10.9739 7.25 11.25V17.25C7.25 17.5261 7.47386 17.75 7.75 17.75H16.25C16.5261 17.75 16.75 17.5261 16.75 17.25V11.25C16.75 10.9739 16.5261 10.75 16.25 10.75H14.75M9.25 10.75V7.5C9.25 5.98122 10.4812 4.75 12 4.75C13.5188 4.75 14.75 5.98122 14.75 7.5V10.75M9.25 10.75H14.75", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/lock-small.mjs var import_primitives71 = __toESM(require_primitives(), 1); var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1); var lock_small_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, { 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_primitives72 = __toESM(require_primitives(), 1); var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1); var lock_default = /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_primitives72.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_primitives72.Path, { d: "M9.25 11.1H7.75C7.47386 11.1 7.25 11.3239 7.25 11.6V17.6C7.25 17.8761 7.47386 18.1 7.75 18.1H16.25C16.5261 18.1 16.75 17.8761 16.75 17.6V11.6C16.75 11.3239 16.5261 11.1 16.25 11.1H14.75M9.25 11.1V7.85C9.25 6.33122 10.4812 5.1 12 5.1C13.5188 5.1 14.75 6.33122 14.75 7.85V11.1M9.25 11.1H14.75", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_primitives72.Path, { d: "M16.25 18.1H7.75C7.47386 18.1 7.25 17.8761 7.25 17.6V11.6C7.25 11.3239 7.47386 11.1 7.75 11.1H16.25C16.5261 11.1 16.75 11.3239 16.75 11.6V17.6C16.75 17.8761 16.5261 18.1 16.25 18.1Z", fill: "currentColor", stroke: "none" }) ] }); // packages/icons/build-module/library/media.mjs var import_primitives73 = __toESM(require_primitives(), 1); var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1); var media_default = /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_primitives73.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives73.Path, { d: "M14 12.375V6.51534C14 6.21609 13.7879 5.95882 13.4941 5.9018L11.8239 5.57758C11.5677 5.52784 11.341 5.37988 11.1924 5.1653L10.3985 4.01913C10.2818 3.85057 10.0898 3.75 9.88474 3.75H8.11526C7.91022 3.75 7.71822 3.85057 7.60147 4.01913L6.80758 5.1653C6.65896 5.37988 6.43232 5.52784 6.17608 5.57758L4.5059 5.9018C4.21213 5.95882 4 6.21609 4 6.51534V12.375C4 12.7202 4.27982 13 4.625 13H13.375C13.7202 13 14 12.7202 14 12.375Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives73.Circle, { cx: "9", cy: "9", r: "1", fill: "currentColor", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives73.Path, { d: "M20 17.25V9", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives73.Path, { d: "M17 10H20V9H17V10Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives73.Path, { d: "M11.75 18.5C12.4404 18.5 13 17.9404 13 17.25V16H11.75C11.0596 16 10.5 16.5596 10.5 17.25C10.5 17.9404 11.0596 18.5 11.75 18.5Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives73.Path, { d: "M18.75 18.5C19.4404 18.5 20 17.9404 20 17.25V16H18.75C18.0596 16 17.5 16.5596 17.5 17.25C17.5 17.9404 18.0596 18.5 18.75 18.5Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/mobile.mjs var import_primitives74 = __toESM(require_primitives(), 1); var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1); var mobile_default = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_primitives74.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_primitives74.Path, { d: "M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/more-vertical.mjs var import_primitives75 = __toESM(require_primitives(), 1); var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1); var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_primitives75.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives75.Path, { d: "M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives75.Path, { d: "M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives75.Path, { d: "M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives75.Path, { d: "M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives75.Path, { d: "M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives75.Path, { d: "M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/page.mjs var import_primitives76 = __toESM(require_primitives(), 1); var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1); var page_default = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_primitives76.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_primitives76.Path, { d: "M8.5 8.25H15.5M8.5 11.75H15.5M8.5 15.25H15.5M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/paragraph.mjs var import_primitives77 = __toESM(require_primitives(), 1); var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1); var paragraph_default = /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_primitives77.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_primitives77.Path, { d: "M10.75 20V4.75L14.75 4.75M14.75 20V4.75M14.75 4.75H18.5", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_primitives77.Path, { d: "M5.75 9C5.75 11.3472 7.65279 13.25 10 13.25H10.75V4.75H10C7.65279 4.75 5.75 6.65279 5.75 9Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/pencil.mjs var import_primitives78 = __toESM(require_primitives(), 1); var import_jsx_runtime80 = __toESM(require_jsx_runtime(), 1); var pencil_default = /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_primitives78.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_primitives78.Path, { d: "M5 19.25H12", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_primitives78.Path, { d: "M10 15L7.5 15.5L8 13L16 5L18 7L10 15Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }) ] }); // packages/icons/build-module/library/pin-small.mjs var import_primitives79 = __toESM(require_primitives(), 1); var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1); var pin_small_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: "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_primitives80 = __toESM(require_primitives(), 1); var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1); var plus_default = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_primitives80.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_primitives80.Path, { d: "M12 18V6M18 12H6", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/position-center.mjs var import_primitives81 = __toESM(require_primitives(), 1); var import_jsx_runtime83 = __toESM(require_jsx_runtime(), 1); var position_center_default = /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_primitives81.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_primitives81.Path, { d: "M5 4.75H19M5 19.25H19", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_primitives81.Rect, { x: "7", y: "9", width: "10", height: "6", fill: "currentColor", stroke: "none" }) ] }); // packages/icons/build-module/library/position-left.mjs var import_primitives82 = __toESM(require_primitives(), 1); var import_jsx_runtime84 = __toESM(require_jsx_runtime(), 1); var position_left_default = /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_primitives82.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_primitives82.Path, { d: "M5 4.75H13M5 19.25H13", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_primitives82.Rect, { x: "5", y: "9", width: "14", height: "6", fill: "currentColor", stroke: "none" }) ] }); // packages/icons/build-module/library/position-right.mjs var import_primitives83 = __toESM(require_primitives(), 1); var import_jsx_runtime85 = __toESM(require_jsx_runtime(), 1); var position_right_default = /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_primitives83.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_primitives83.Path, { d: "M11 4.75H19M11 19.25H19", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_primitives83.Rect, { x: "5", y: "9", width: "14", height: "6", fill: "currentColor", stroke: "none" }) ] }); // packages/icons/build-module/library/post-featured-image.mjs var import_primitives84 = __toESM(require_primitives(), 1); var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1); var post_featured_image_default = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_primitives84.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_primitives84.Path, { d: "M19.25 9.25131L14.0498 7.02135C14.0187 7.00803 13.983 7.01131 13.9549 7.03006L11.0501 8.96658C11.0193 8.98714 10.9796 8.98896 10.947 8.97131L8.65525 7.72992C8.62147 7.71163 8.5802 7.7143 8.54907 7.73679L4.75 10.4808M19.25 9.25131V5C19.25 4.30964 18.6904 3.75 18 3.75H6C5.30964 3.75 4.75 4.30964 4.75 5V10.4808M19.25 9.25131V10C19.25 10.6904 18.6904 11.25 18 11.25H5.51917C5.09437 11.25 4.75 10.9056 4.75 10.4808M4 15H20M4 19H13", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/post-list.mjs var import_primitives85 = __toESM(require_primitives(), 1); var import_jsx_runtime87 = __toESM(require_jsx_runtime(), 1); var post_list_default = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_primitives85.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_primitives85.Path, { d: "M7 10H8.5M10 10H17M7 14H8.5M10 14H17M6 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V18C4.75 18.6904 5.30964 19.25 6 19.25Z", vectorEffect: "non-scaling-stroke" }) }); // packages/icons/build-module/library/published.mjs var import_primitives86 = __toESM(require_primitives(), 1); var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1); var published_default = /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_primitives86.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_primitives86.Path, { d: "M12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75C7.99594 4.75 4.75 7.99594 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_primitives86.Path, { d: "M9 12L11 14L15 10", vectorEffect: "non-scaling-stroke" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_primitives87.Path, { d: "M7 12H17", vectorEffect: "non-scaling-stroke" }) }); // 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.jsxs)(import_primitives88.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_primitives88.Path, { d: "M12 19.25C7.99593 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99593 4.75 12 4.75L14 4.75M12 2L14 4.75L12 7.5", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_primitives88.Path, { d: "M9.22553 18.6981C12.9248 20.2304 17.1658 18.4737 18.6981 14.7745C19.7261 12.2927 19.2738 9.56712 17.7477 7.57918", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_primitives89.Path, { d: "M20 16.75L15 16.75C14.3096 16.75 13.75 16.1904 13.75 15.5L13.75 8.5C13.75 7.80964 14.3096 7.25 15 7.25L20 7.25M4 7.25L9 7.25C9.69036 7.25 10.25 7.80964 10.25 8.5L10.25 15.5C10.25 16.1904 9.69036 16.75 9 16.75L4 16.75", vectorEffect: "non-scaling-stroke" }) }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_primitives90.Path, { d: "M5 19L9.28769 14.7123M18.25 11C18.25 13.8995 15.8995 16.25 13 16.25C10.1005 16.25 7.75 13.8995 7.75 11C7.75 8.10051 10.1005 5.75 13 5.75C15.8995 5.75 18.25 8.10051 18.25 11Z", vectorEffect: "non-scaling-stroke" }) }); // 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.jsxs)(import_primitives91.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_primitives91.Path, { d: "M20.0645 13C18.5918 10.0366 15.5337 8 12 8C8.46631 8 5.40825 10.0366 3.93555 13", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_primitives91.Circle, { cx: "12", cy: "12.5", r: "3", fill: "currentColor", vectorEffect: "non-scaling-stroke" }) ] }); // 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.jsx)(import_primitives92.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_primitives92.Path, { d: "M5 8H19M19 16H5M10.75 8C10.75 8.82843 10.0784 9.5 9.25 9.5C8.42157 9.5 7.75 8.82843 7.75 8C7.75 7.17157 8.42157 6.5 9.25 6.5C10.0784 6.5 10.75 7.17157 10.75 8ZM16.25 16C16.25 16.8284 15.5784 17.5 14.75 17.5C13.9216 17.5 13.25 16.8284 13.25 16C13.25 15.1716 13.9216 14.5 14.75 14.5C15.5784 14.5 16.25 15.1716 16.25 16Z", vectorEffect: "non-scaling-stroke" }) }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_primitives93.Path, { d: "M3 12H6M18 12H21M5.63957 5.63751L7.76089 7.75883M16.2462 16.2441L18.3675 18.3654M12.005 3.005V6.005M12.005 18.005V21.005M18.3675 5.64459L16.2462 7.76591M7.76088 16.2512L5.63956 18.3725M15.25 12C15.25 13.7949 13.7949 15.25 12 15.25C10.2051 15.25 8.75 13.7949 8.75 12C8.75 10.2051 10.2051 8.75 12 8.75C13.7949 8.75 15.25 10.2051 15.25 12Z", vectorEffect: "non-scaling-stroke" }) }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_primitives94.Path, { d: "M7.5 18.5H16.5M18.5 16.5V7.5M16.5 5.5H7.5M5.5 7.5V16.5", vectorEffect: "non-scaling-stroke" }) }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_primitives95.Path, { opacity: ".25", d: "M18.5 16.5V7.5M16.5 5.5H7.5M5.5 7.5V16.5", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_primitives95.Path, { d: "M7.5 18.5H16.5", vectorEffect: "non-scaling-stroke" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_primitives96.Path, { opacity: ".25", d: "M7.5 18.5L16.5 18.5M16.5 5.5L7.5 5.5", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_primitives96.Path, { d: "M18.5 16.5L18.5 7.5M5.5 7.5L5.5 16.5", vectorEffect: "non-scaling-stroke" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_primitives97.Path, { opacity: ".25", d: "M7.5 18.5L16.5 18.5M18.5 16.5L18.5 7.5M16.5 5.5L7.5 5.5", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_primitives97.Path, { d: "M5.5 7.5L5.5 16.5", vectorEffect: "non-scaling-stroke" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_primitives98.Path, { opacity: ".25", d: "M16.5 5.5L7.5 5.5M5.5 7.5L5.5 16.5M7.5 18.5L16.5 18.5", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_primitives98.Path, { d: "M18.5 16.5L18.5 7.5", vectorEffect: "non-scaling-stroke" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_primitives99.Path, { opacity: ".25", d: "M5.5 7.5L5.5 16.5M7.5 18.5L16.5 18.5M18.5 16.5L18.5 7.5", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_primitives99.Path, { d: "M16.5 5.5L7.5 5.5", vectorEffect: "non-scaling-stroke" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_primitives100.Path, { opacity: ".25", d: "M5.5 7.5L5.5 16.5M18.5 16.5L18.5 7.5", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_primitives100.Path, { d: "M16.5 5.5L7.5 5.5M7.5 18.5L16.5 18.5", vectorEffect: "non-scaling-stroke" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_primitives101.Path, { d: "M7.25 20L7.25 15C7.25 14.3096 7.80965 13.75 8.5 13.75L15.5 13.75C16.1904 13.75 16.75 14.3096 16.75 15L16.75 20M16.75 4L16.75 9C16.75 9.69035 16.1904 10.25 15.5 10.25L8.5 10.25C7.80964 10.25 7.25 9.69036 7.25 9L7.25 4", vectorEffect: "non-scaling-stroke" }) }); // 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.jsxs)(import_primitives102.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_primitives102.Path, { d: "M8 19.25H16", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_primitives102.Rect, { x: "5", y: "4", width: "14", height: "11", fill: "currentColor", stroke: "none" }) ] }); // 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.jsxs)(import_primitives103.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_primitives103.Rect, { x: "5", y: "9", width: "14", height: "6", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_primitives103.Path, { d: "M8 4.75H16M8 19.25H16", vectorEffect: "non-scaling-stroke" }) ] }); // 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.jsxs)(import_primitives104.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_primitives104.Path, { d: "M12 4.75C7.99594 4.75 4.75 7.99593 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25L12 4.75Z", fill: "currentColor", stroke: "none" }), /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_primitives104.Path, { d: "M12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75C7.99594 4.75 4.75 7.99594 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) ] }); // 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.jsxs)(import_primitives105.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_primitives105.Path, { d: "M15.2071 6.20711L20.2929 11.2929C20.6834 11.6834 20.6834 12.3166 20.2929 12.7071L15.2071 17.7929C14.8166 18.1834 14.1834 18.1834 13.7929 17.7929L8.70711 12.7071C8.31658 12.3166 8.31658 11.6834 8.70711 11.2929L13.7929 6.20711C14.1834 5.81658 14.8166 5.81658 15.2071 6.20711Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_primitives105.Path, { d: "M9.5 5.5L3.70711 11.2929C3.31658 11.6834 3.31658 12.3166 3.70711 12.7071L9.5 18.5", vectorEffect: "non-scaling-stroke" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_primitives106.Path, { d: "M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z", vectorEffect: "non-scaling-stroke" }) }); // 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.jsxs)(import_primitives107.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_primitives107.Path, { d: "M4.75 12.5429V4.85C4.75 4.79477 4.79477 4.75 4.85 4.75H12.5429C12.6755 4.75 12.8027 4.80268 12.8964 4.89645L20.1464 12.1464C20.3417 12.3417 20.3417 12.6583 20.1464 12.8536L12.8536 20.1464C12.6583 20.3417 12.3417 20.3417 12.1464 20.1464L4.89645 12.8964C4.80268 12.8027 4.75 12.6755 4.75 12.5429Z", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_primitives107.Path, { d: "M9.75 8.75a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z", fill: "currentColor", stroke: "none" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_primitives108.Path, { d: "M5.5 19.5H18.5L17.0566 17M13.4527 17.5V17.223L12.4369 14.1757L10.1284 7.25H9.57432L7.26577 14.1757L6.25 17.223V17.5M12.4369 14.1757H7.26577", vectorEffect: "non-scaling-stroke" }) }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_primitives109.Path, { d: "M4.5 5.5L4.5 18.5L7 17.0566M6.5 13.4527L6.77703 13.4527L9.82432 12.4369L16.75 10.1284L16.75 9.57432L9.82432 7.26577L6.77703 6.25L6.5 6.25M9.82432 12.4369L9.82432 7.26577", vectorEffect: "non-scaling-stroke" }) }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_primitives110.Path, { d: "M5 7.5H7M19 7.5H17M17 7.5L16.1588 17.1733C16.069 18.2068 15.2038 19 14.1664 19H9.83363C8.79622 19 7.93102 18.2068 7.84115 17.1733L7 7.5M17 7.5H14.9897M7 7.5H9.01027M14.9897 7.5C14.8627 5.96012 13.5727 4.75 12 4.75C10.4273 4.75 9.13731 5.96012 9.01027 7.5M14.9897 7.5H9.01027", vectorEffect: "non-scaling-stroke" }) }); // 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.jsxs)(import_primitives111.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_primitives111.Path, { d: "M14.25 17V18C14.25 18.6904 13.6904 19.25 13 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V11C4.75 10.3096 5.30964 9.75 6 9.75H7", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_primitives111.Path, { d: "M9.75 6C9.75 5.30964 10.3096 4.75 11 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V13C19.25 13.6904 18.6904 14.25 18 14.25H11C10.3096 14.25 9.75 13.6904 9.75 13V6Z", vectorEffect: "non-scaling-stroke" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_primitives112.Path, { d: "M14.75 10.75H16.25C16.5261 10.75 16.75 10.9739 16.75 11.25V17.25C16.75 17.5261 16.5261 17.75 16.25 17.75H7.75C7.47386 17.75 7.25 17.5261 7.25 17.25V11.25C7.25 10.9739 7.47386 10.75 7.75 10.75H14.75ZM14.75 10.75V7.5C14.75 5.98122 13.5188 4.75 12 4.75C10.4812 4.75 9.25 5.98122 9.25 7.5V7.7368", vectorEffect: "non-scaling-stroke" }) }); // 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.jsxs)(import_primitives113.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_primitives113.Path, { d: "M8 21L10.6587 15.1842M13.1523 9.72929L13.8553 8.19144L16 3.5M20.0645 13C19.2118 11.2841 17.8276 9.87898 16.1272 9M3.93555 13C5.40825 10.0366 8.46631 8 12 8C12.636 8 13.2566 8.06597 13.8553 8.19144M13.1523 9.72929C12.7975 9.58156 12.4083 9.5 12 9.5C10.3431 9.5 9 10.8431 9 12.5C9 13.6747 9.67519 14.6917 10.6587 15.1842M13.1523 9.72929L10.6587 15.1842M13.1755 15.261C14.2481 14.8037 15 13.7397 15 12.5C15 12.1819 14.9505 11.8753 14.8587 11.5876", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_primitives113.Path, { d: "M12 9.5C10.3431 9.5 9 10.8431 9 12.5C9 13.6747 9.67519 14.6917 10.6587 15.1842L13.1523 9.72929C12.7975 9.58156 12.4083 9.5 12 9.5Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }) ] }); // 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", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_primitives114.Path, { d: "M4.75 15V19.25H12M12 19.25V4.5M12 19.25H19.25V15M17.5 10L12 4.5L6.5 10", vectorEffect: "non-scaling-stroke" }) }); // 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.jsxs)(import_primitives115.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_primitives115.Path, { d: "M8.5 14C9 12 12.5 7.5 17 5.5", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_primitives115.Path, { d: "M8 14C7.66667 11.1667 9 5 17 3C17.1667 4.66667 17.2 8.6 16 11C14.8 13.4 10.1667 14 8 14ZM8 14L7 16", strokeLinecap: "round", vectorEffect: "non-scaling-stroke" }), /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_primitives115.Path, { d: "M5 19.25H12", vectorEffect: "non-scaling-stroke" }) ] }); // 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, { DEFAULT_BLOCK_STYLE_STATE: () => DEFAULT_BLOCK_STYLE_STATE, 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, getStyleOverrides: () => getStyleOverrides, getStyleStateViewport: () => getStyleStateViewport, getViewportModalClientIds: () => getViewportModalClientIds, getZoomLevel: () => getZoomLevel, hasAllowedPatterns: () => hasAllowedPatterns, hasBlockSpotlight: () => hasBlockSpotlight2, 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, isSyncedBlock: () => isSyncedBlock, 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 selectors5 = []; let currentSelector = ""; let parenthesesDepth = 0; for (const char of selector3) { if (char === "(") { parenthesesDepth++; } else if (char === ")" && parenthesesDepth > 0) { parenthesesDepth--; } else if (char === "," && parenthesesDepth === 0) { selectors5.push(currentSelector); currentSelector = ""; continue; } currentSelector += char; } selectors5.push(currentSelector); return selectors5; } 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: ["typography", "textShadowPresets"], valueKey: "textShadow", cssVarInfix: "text-shadow", classes: [ { classSuffix: "text-shadow", propertyName: "text-shadow" } ] }, { 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 selectors5 = splitSelectorList(selector3); const selectorsScoped = []; scopes.forEach((outer) => { selectors5.forEach((inner) => { selectorsScoped.push(`${outer.trim()} ${inner.trim()}`); }); }); return selectorsScoped.join(", "); } function scopeFeatureSelectors(scope, selectors5) { if (!scope || !selectors5) { return; } const featureSelectors = {}; Object.entries(selectors5).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 selectors5 = splitSelectorList(selector3); const newSelectors = selectors5.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) { return { ...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 (false) { 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(o2) { return Object.prototype.toString.call(o2) === "[object Object]"; } function isPlainObject(o2) { var ctor, prot; if (isObject(o2) === false) return false; ctor = o2.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: selectors5, supports } = blockType; const hasSelectors = selectors5 && Object.keys(selectors5).length > 0; const path = Array.isArray(target) ? target.join(".") : target; let rootSelector = null; if (hasSelectors && selectors5.root) { rootSelector = selectors5?.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( selectors5, `${path}.root`, null ) || getValueFromObjectPath(selectors5, 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(selectors5, path, null); } if (subfeatureSelector) { return subfeatureSelector; } if (fallback) { return getBlockSelector(blockType, pathArray[0], options); } return null; } // packages/global-styles-engine/build-module/utils/duotone.mjs function getValuesFromColors(colors2 = []) { const values = { r: [], g: [], b: [], a: [] }; colors2.forEach((color) => { const rgbColor = A(color).toRgb(); values.r.push(rgbColor.r / 255); values.g.push(rgbColor.g / 255); values.b.push(rgbColor.b / 255); values.a.push(rgbColor.a); }); return values; } function getDuotoneUnsetStylesheet(selector3) { return `${selector3}{filter:none}`; } function getDuotoneStylesheet(selector3, id) { return `${selector3}{filter:url(#${id})}`; } function getDuotoneFilter(id, colors2) { const values = getValuesFromColors(colors2); return ` `; } // 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 hasImageUrl(backgroundImage) { return typeof backgroundImage === "object" && backgroundImage !== null && "url" in backgroundImage && !!backgroundImage.url; } function setBackgroundStyleDefaults(backgroundStyle) { if (!backgroundStyle || !hasImageUrl(backgroundStyle.backgroundImage)) { 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 = (selectors5, styles) => { const declarations = {}; Object.entries(selectors5).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 = ""; const blockGapValue = style?.spacing?.blockGap; let gapValue = hasBlockGapSupport ? getGapCSSValue(blockGapValue) : ""; if (hasFallbackGapSupport) { if (selector3 === ROOT_BLOCK_SELECTOR) { gapValue = !gapValue ? "0.5em" : gapValue; } else if (!hasBlockGapSupport && fallbackGapValue) { gapValue = fallbackGapValue; } } const rowGapValue = hasBlockGapSupport && blockGapValue && typeof blockGapValue !== "string" ? getGapCSSValue(blockGapValue.top) : gapValue; if (gapValue && layoutDefinitions) { Object.values(layoutDefinitions).forEach( ({ className, name, spacingStyles }) => { if (!hasBlockGapSupport && "flex" !== name && "grid" !== name) { return; } const layoutGapValue = ["default", "constrained"].includes( name ) ? rowGapValue : gapValue; if (spacingStyles?.length) { spacingStyles.forEach((spacingStyle) => { const declarations = []; if (spacingStyle.rules) { Object.entries(spacingStyle.rules).forEach( ([cssProperty, cssValue]) => { declarations.push( `${cssProperty}: ${cssValue ? cssValue : layoutGapValue}` ); } ); } 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 blockGapSupport = blockType?.supports?.spacing?.blockGap; const fallbackGapValue = typeof blockGapSupport === "object" && !Array.isArray(blockGapSupport) ? blockGapSupport.__experimentalDefault : void 0; 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, getDuotoneFilter, getDuotoneStylesheet, getDuotoneUnsetStylesheet, 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.createSelector)( getEnabledClientIdsTreeUnmemoized, (state) => [ state.blocks.order, state.derivedBlockEditingModes, state.blocks.blockEditingModes ] ); var getListViewClientIdsTree = (0, import_data4.createSelector)( getListViewClientIdsTreeUnmemoized, (state) => [ state.blocks.order, state.derivedBlockEditingModes, state.blocks.blockEditingModes, state.blocks.parents, state.editedContentOnlySection, // The state below is only read to resolve a block's parent section, // which the tree does only while a content-only section is being // edited. Depending on it otherwise rebuilds the tree on every // attribute change, i.e. on every keystroke. ...state.editedContentOnlySection ? [ state.blocks.byClientId, state.blocks.attributes, state.blockListSettings, 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, index3) => { acc[clientId] = index3; 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 patterns2 = getAllPatterns2(); const { allowedBlockTypes } = getSettings(state); return patterns2.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, index3, arr) => index3 === 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 isSyncedBlock(state, clientId) { const blockName = getBlockName(state, clientId); if (blockName !== "core/block" && blockName !== "core/template-part") { return false; } const patternName = getBlockAttributes(state, clientId)?.metadata?.patternName; return !(patternName && isSectionBlock(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; } 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 hasRegisteredCategory(pattern, allCategories) { if (!pattern.categories || !pattern.categories.length) { return false; } return pattern.categories.some( (cat) => allCategories.some((category) => category.name === cat) ); } function getPopulatedCategories(patterns2, allCategories) { const categories = allCategories.filter( (category) => patterns2.some( (pattern) => pattern.categories?.includes(category.name) ) ).sort((a, b) => a.label.localeCompare(b.label)); if (patterns2.some( (pattern) => !hasRegisteredCategory(pattern, allCategories) ) && !categories.find((category) => category.name === "uncategorized")) { categories.push({ name: "uncategorized", label: (0, import_i18n3.__)("Uncategorized") }); } return categories; } 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(a, b) { if (typeof a === "string" && typeof b === "string") { return a > b; } return Number(a) > Number(b); } var comparator = (field, order) => { return (a, b) => { let cmpA, cmpB; if (typeof field === "function") { cmpA = field(a); cmpB = field(b); } else { cmpA = a[field]; cmpB = b[field]; } if (isGreater(cmpA, cmpB)) { return order === "asc" ? 1 : -1; } else if (isGreater(cmpB, cmpA)) { return order === "asc" ? -1 : 1; } return 0; }; }; function orderBy(items, field, order = "asc") { return items.concat().sort(comparator(field, 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 index3 = 0; while (index3 < ids.length) { const id = ids[index3]; const order = state.blocks.order.get(id); if (order) { ids.splice(index3 + 1, 0, ...order); } index3++; } 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 index3 = 0; index3 < maxDepth; index3++) { if (clientParents[index3] === selectedParents[index3]) { lowestCommonAncestor = clientParents[index3]; } 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 index3 = orderSet.indexOf(startClientId); const nextIndex = index3 + 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 !!clientId && selectionStart.clientId === clientId; } var getSelectedBlockAncestors = (0, import_data5.createSelector)( (state) => { const ancestors = /* @__PURE__ */ new Set(); for (const clientId of getSelectedBlockClientIds(state)) { let current = clientId; while (current = state.blocks.parents.get(current)) { if (ancestors.has(current)) { break; } ancestors.add(current); } } return ancestors; }, (state) => getSelectedBlockClientIds.getDependants(state) ); function hasSelectedInnerBlock(state, clientId, deep = false) { if (!clientId) { return false; } const selectedBlockClientIds = getSelectedBlockClientIds(state); if (!selectedBlockClientIds.length) { return false; } if (deep) { return getSelectedBlockAncestors(state).has(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 index3 = clientIds.indexOf(clientId); return index3 > -1 && index3 < 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, index3; const { insertionCue: insertionCue2, selection: { selectionEnd } } = state; if (insertionCue2 !== null) { return insertionCue2; } const { clientId } = selectionEnd; if (clientId) { rootClientId = getBlockRootClientId(state, clientId) || void 0; index3 = getBlockIndex(state, selectionEnd.clientId) + 1; } else { index3 = getBlockOrder(state).length; } return { rootClientId, index: index3 }; }, (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: lock4 } = attributes; return !lock4?.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 patterns2 = getAllPatterns2(); const { allowedBlockTypes } = getSettings(state); const parsedPatterns = patterns2.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 patterns2 = select3(STORE_NAME).__experimentalGetAllowedPatterns( rootClientId ); const normalizedBlockNames = Array.isArray(blockNames) ? blockNames : [blockNames]; const filteredPatterns = patterns2.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); } var getSelectedBlockStyleState = (0, import_data5.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 hasSelectedBlockStyleState(state, clientId) { const selectedState = getSelectedBlockStyleState(state, clientId); return selectedState.viewport !== DEFAULT_BLOCK_STYLE_STATE.viewport || selectedState.pseudo !== DEFAULT_BLOCK_STYLE_STATE.pseudo; } // 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 import_blocks8 = __toESM(require_blocks(), 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; } } } let removeRoot = false; const rootClientId = select3.getBlockRootClientId(clientIds[0]); if (rootClientId && !(0, import_blocks8.getBlockType)(select3.getBlockName(rootClientId))?.parent?.length) { const blockOrder = select3.getBlockOrder(rootClientId); removeRoot = blockOrder.length === clientIds.length && blockOrder.every( (clientId) => clientIds.includes(clientId) ) && (0, import_blocks8.isUnmodifiedBlock)( select3.__unstableGetBlockWithoutInnerBlocks(rootClientId) ); } if (selectPrevious) { dispatch.selectPreviousBlock( removeRoot ? rootClientId : clientIds[0], selectPrevious ); } registry.batch(() => { dispatch({ type: "REMOVE_BLOCKS", clientIds: removeRoot ? [rootClientId] : 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_blocks10 = __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); // 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/utils/sibling-block-attributes.mjs var import_blocks9 = __toESM(require_blocks(), 1); function getSiblingBlockAttributes(blockName, attributes) { if (!attributes) { return {}; } const excluded = new Set( (0, import_blocks9.getBlockAttributesNamesByRole)(blockName, "content") ); excluded.add("metadata"); return Object.fromEntries( Object.entries(attributes).filter( ([key]) => !excluded.has(key) ) ); } // packages/block-editor/build-module/store/actions.mjs var { editableRootKey: editableRootKey2 } = unlock(import_blocks10.privateApis); 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_blocks10.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(); const nestedBlockCount = select3.getClientIdsOfDescendants( select3.getMultiSelectedBlockClientIds() ).length; (0, import_a11y3.speak)( nestedBlockCount ? (0, import_i18n5.sprintf)( /* translators: 1: number of selected blocks. 2: number of blocks including nested blocks. */ (0, import_i18n5._n)( "%1$s block selected, %2$s including nested blocks.", "%1$s blocks selected, %2$s including nested blocks.", blockCount ), blockCount, blockCount + nestedBlockCount ) : (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 index3 = 0; index3 < blocks2.length; index3++) { const block = blocks2[index3]; const canInsertBlock = select3.canInsertBlockType( block.name, rootClientId ); if (!canInsertBlock) { return; } } const blocksWithTemplates = applyBlockTypeTemplates(blocks2); registry.batch(() => { dispatch({ type: "REPLACE_BLOCKS", clientIds, blocks: blocksWithTemplates, time: Date.now(), indexToSelect, initialPosition: initialPosition2, meta }); selectBlockTypeTemplate( select3, dispatch, blocks2, blocksWithTemplates, initialPosition2 ); 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 = "", index3) => ({ 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: index3 }); }; function moveBlockToPosition(clientId, fromRootClientId = "", toRootClientId = "", index3) { return moveBlocksToPosition( [clientId], fromRootClientId, toRootClientId, index3 ); } function insertBlock(block, index3, rootClientId, updateSelection, initialPosition2, meta) { return insertBlocks( [block], index3, rootClientId, updateSelection, initialPosition2, meta ); } function applyBlockTypeTemplates(blocks2, expandedTypes = /* @__PURE__ */ new Set()) { let hasChanges = false; const result = blocks2.map((block) => { let { innerBlocks } = block; if (innerBlocks?.length) { innerBlocks = applyBlockTypeTemplates(innerBlocks, expandedTypes); } else if (!expandedTypes.has(block.name)) { const { template: template2 } = (0, import_blocks10.getBlockType)(block.name) ?? {}; if (template2?.length) { innerBlocks = applyBlockTypeTemplates( (0, import_blocks10.synchronizeBlocksWithTemplate)([], template2), new Set(expandedTypes).add(block.name) ); } } if (innerBlocks === block.innerBlocks) { return block; } hasChanges = true; return { ...block, innerBlocks }; }); return hasChanges ? result : blocks2; } function selectBlockTypeTemplate(select3, dispatch, originalBlocks, blocksWithTemplates, initialPosition2) { const selectedClientId = select3.getSelectedBlockClientId(); if (!selectedClientId) { return; } const index3 = blocksWithTemplates.findIndex( (block2) => block2.clientId === selectedClientId ); if (index3 === -1 || blocksWithTemplates[index3] === originalBlocks[index3] || !blocksWithTemplates[index3].innerBlocks.length || !(0, import_blocks10.getBlockType)(blocksWithTemplates[index3].name)?.templateInsertUpdatesSelection) { return; } let block = blocksWithTemplates[index3]; while (block.innerBlocks[0]) { block = block.innerBlocks[0]; } dispatch.selectBlock(block.clientId, initialPosition2); } var insertBlocks = (blocks2, index3, rootClientId, updateSelection = true, initialPosition2 = 0, meta) => ({ select: select3, dispatch, registry }) => { 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) { const blocksWithTemplates = applyBlockTypeTemplates(allowedBlocks); registry.batch(() => { dispatch({ type: "INSERT_BLOCKS", blocks: blocksWithTemplates, index: index3, rootClientId, time: Date.now(), updateSelection, initialPosition: updateSelection ? initialPosition2 : null, meta }); selectBlockTypeTemplate( select3, dispatch, allowedBlocks, blocksWithTemplates, initialPosition2 ); if (updateSelection && initialPosition2 === 0) { const clientId = select3.getSelectedBlockClientId(); const blockType = clientId && (0, import_blocks10.getBlockType)(select3.getBlockName(clientId)); const attributeKey = blockType?.[editableRootKey2] && findRichTextAttributeKey(blockType); if (attributeKey) { dispatch.selectionChange( clientId, attributeKey, 0, 0 ); } } }); } }; function showInsertionPoint(rootClientId, index3, __unstableOptions = {}) { const { __unstableWithInserter, operation, nearestSide } = __unstableOptions; return { type: "SHOW_INSERTION_POINT", rootClientId, index: index3, __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_blocks10.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_blocks10.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_blocks10.cloneBlock)(blockA, { [selectionA.attributeKey]: (0, import_rich_text3.toHTMLString)({ value: valueA }) }); const cloneB = (0, import_blocks10.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_blocks10.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_blocks10.getBlockType)(blockA.name); const blockBType = (0, import_blocks10.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_blocks10.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_blocks10.getDefaultBlockName)(); if (select3.canInsertBlockType( defaultBlockName2, anchorRootClientId )) { return (0, import_blocks10.createBlock)(defaultBlockName2); } const name = select3.getBlockName(selectionA.clientId); return (0, import_blocks10.createBlock)( name, getSiblingBlockAttributes(name, blockAttributes) ); }; 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_blocks10.createBlock)(blockB.name).clientId : blockB.clientId, attributes: { ...blockB.attributes, [attributeKeyB]: (0, import_rich_text3.toHTMLString)({ value: valueB }) } }; const defaultBlockName = (0, import_blocks10.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_blocks10.switchToBlockType)(tail, defaultBlockName); if (switched?.length === 1) { tail = switched[0]; } } if (!blocks2.length) { registry.batch(() => { dispatch.replaceBlocks(select3.getSelectedBlockClientIds(), [ head, tail ]); const tailType2 = (0, import_blocks10.getBlockType)(tail.name); const tailKey = tailType2?.[editableRootKey2] && findRichTextAttributeKey(tailType2); if (tailKey) { dispatch.selectionChange(tail.clientId, tailKey, 0, 0); } }); return; } let selection2; const output = []; const clonedBlocks = [...blocks2]; const firstBlock = clonedBlocks.shift(); const headType = (0, import_blocks10.getBlockType)(head.name); const firstBlocks = headType.merge && firstBlock.name === headType.name ? [firstBlock] : (0, import_blocks10.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_blocks10.isUnmodifiedBlock)(head)) { output.push(head); } output.push(firstBlock); } const lastBlock = clonedBlocks.pop(); const tailType = (0, import_blocks10.getBlockType)(tail.name); if (clonedBlocks.length) { output.push(...clonedBlocks); } if (lastBlock) { const lastBlocks = tailType.merge && tailType.name === lastBlock.name ? [lastBlock] : (0, import_blocks10.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_blocks10.isUnmodifiedBlock)(tail)) { output.push(tail); } } } else if (!(0, import_blocks10.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_blocks10.getBlockType)(blockA.name); if (!blockAType || select3.getBlockEditingMode(clientIdA) === "disabled" || select3.getBlockEditingMode(clientIdB) === "disabled") { return; } const blockB = select3.getBlock(clientIdB); if (!blockAType.merge && (0, import_blocks10.getBlockSupport)(blockA.name, "__experimentalOnMerge")) { const blocksWithTheSameType2 = (0, import_blocks10.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_blocks10.isUnmodifiedDefaultBlock)(blockA) || !!blockAType.merge && blockA.name !== blockB.name && (0, import_blocks10.isUnmodifiedBlock)(blockA, "content")) { 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_blocks10.isUnmodifiedDefaultBlock)(blockB)) { dispatch.removeBlock( clientIdB, select3.isBlockSelected(clientIdB) ); return; } if (!blockAType.merge) { if ((0, import_blocks10.isUnmodifiedBlock)(blockB, "content")) { dispatch.removeBlock( clientIdB, select3.isBlockSelected(clientIdB) ); } else { dispatch.selectBlock(blockA.clientId); } return; } const blockBType = (0, import_blocks10.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_blocks10.cloneBlock)(blockA); const cloneB = (0, import_blocks10.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_blocks10.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, index3) => ({ dispatch }) => { const defaultBlockName = (0, import_blocks10.getDefaultBlockName)(); if (!defaultBlockName) { return; } const block = (0, import_blocks10.createBlock)(defaultBlockName, attributes); return dispatch.insertBlock(block, index3, 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" }); }); }; function __unstableSetEditorMode() { (0, import_deprecated4.default)( 'wp.data.dispatch( "core/block-editor" ).__unstableSetEditorMode', { since: "7.2", hint: "The Write/Design editor tool has been removed." } ); return { type: "DO_NOTHING" }; } 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_blocks10.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_blocks10.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 block = (0, import_blocks10.createBlock)(directInsertBlock.name, { ...directInsertBlock.attributes, ...select3.getBlockName(clientId) === directInsertBlock.name ? getSiblingBlockAttributes( directInsertBlock.name, select3.getBlockAttributes(clientId) ) : {} }); 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 block = (0, import_blocks10.createBlock)(directInsertBlock.name, { ...directInsertBlock.attributes, ...select3.getBlockName(clientId) === directInsertBlock.name ? getSiblingBlockAttributes( directInsertBlock.name, select3.getBlockAttributes(clientId) ) : {} }); 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_components2 = __toESM(require_components(), 1); var import_i18n6 = __toESM(require_i18n(), 1); var import_jsx_runtime118 = __toESM(require_jsx_runtime(), 1); function Warning({ className, actions, children, secondaryActions }) { return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { style: { display: "contents", all: "initial" }, children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: clsx_default(className, "block-editor-warning"), children: /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "block-editor-warning__contents", children: [ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("p", { className: "block-editor-warning__message", children }), (actions?.length > 0 || secondaryActions) && /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "block-editor-warning__actions", children: [ actions?.length > 0 && actions.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)( "span", { className: "block-editor-warning__action", children: action }, i )), secondaryActions && /* @__PURE__ */ (0, import_jsx_runtime118.jsx)( import_components2.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_runtime118.jsx)(import_components2.MenuGroup, { children: secondaryActions.map( (item, pos) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)( import_components2.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_runtime119 = __toESM(require_jsx_runtime(), 1); function MultipleUsageWarning({ originalBlockClientId, name, onReplace }) { const { selectBlock: selectBlock2 } = (0, import_data7.useDispatch)(store); const blockType = (0, import_blocks11.getBlockType)(name); return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)( warning_default, { actions: [ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)( import_components3.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: () => selectBlock2(originalBlockClientId), children: (0, import_i18n7.__)("Find original") }, "find-original" ), /* @__PURE__ */ (0, import_jsx_runtime119.jsx)( import_components3.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: () => onReplace([]), children: (0, import_i18n7.__)("Remove") }, "remove" ) ], children: [ /* @__PURE__ */ (0, import_jsx_runtime119.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_runtime120 = __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_blocks12.hasBlockSupport)(name, "layout", false) || (0, import_blocks12.hasBlockSupport)(name, "__experimentalLayout", false); const parentBlockEditContext = useBlockEditContext(); const isInListViewBlockSupportTree = !!parentBlockEditContext[isInListViewBlockSupportTreeKey] || (0, import_blocks12.hasBlockSupport)(name, "listView") || name === "core/navigation"; const { originalBlockClientId } = (0, import_element6.useContext)(PrivateBlockContext); return /* @__PURE__ */ (0, import_jsx_runtime120.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_runtime120.jsx)(edit_default, { ...props }), originalBlockClientId && /* @__PURE__ */ (0, import_jsx_runtime120.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_runtime121 = __toESM(require_jsx_runtime(), 1); var upperFirst = ([firstLetter, ...rest]) => firstLetter.toUpperCase() + rest.join(""); var withCustomColorPalette = (colorsArray) => (0, import_compose2.createHigherOrderComponent)( (WrappedComponent) => function WithCustomColorPalette(props) { return /* @__PURE__ */ (0, import_jsx_runtime121.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_runtime121.jsx)(WrappedComponent, { ...props, colors: allColors }); }, "withEditorColorPalette" ); function createColorHOC(colorTypes, withColorPalette) { const colorMap = colorTypes.reduce((colorObject, colorType) => { return { ...colorObject, ...typeof colorType === "string" ? { [colorType]: kebabCase(colorType) } : colorType }; }, {}); return (0, import_compose2.compose)([ withColorPalette, (WrappedComponent) => { return function WithColors(props) { const { colors: _colors, ...passedProps } = props; const { attributes, setAttributes } = passedProps; const prevColorPropsRef = (0, import_element7.useRef)(null); const colorProps = (0, import_element7.useMemo)(() => { const prevColorProps = prevColorPropsRef.current; const result = Object.fromEntries( Object.entries(colorMap).flatMap( ([colorAttributeName, colorContext]) => { const customAttr = `custom${upperFirst( colorAttributeName )}`; const upperFirstColorAttributeName = upperFirst(colorAttributeName); const colorObject = getColorObjectByAttributeValues( _colors, attributes[colorAttributeName], attributes[customAttr] ); const prevColorValue = prevColorProps?.[colorAttributeName]; const colorValue = prevColorValue?.color === colorObject.color && prevColorValue ? prevColorValue : { ...colorObject, class: getColorClassName( colorContext, colorObject.slug ) }; const setter = (newColorValue) => { const resolvedColorObject = getColorObjectByColorValue( _colors, newColorValue ); setAttributes({ [colorAttributeName]: resolvedColorObject?.slug || void 0, [customAttr]: resolvedColorObject?.slug ? void 0 : newColorValue }); }; return [ [colorAttributeName, colorValue], [ `set${upperFirstColorAttributeName}`, setter ] ]; } ) ); prevColorPropsRef.current = result; return result; }, [attributes, _colors, setAttributes]); const colorUtils = (0, import_element7.useMemo)( () => ({ getMostReadableColor: (colorValue) => getMostReadableColor(_colors, colorValue) }), [_colors] ); return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)( WrappedComponent, { ...{ ...passedProps, ...colorProps, 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 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-${kebabCase(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_components4 = __toESM(require_components(), 1); var import_jsx_runtime122 = __toESM(require_jsx_runtime(), 1); function FontSizePicker(props) { const [fontSizes, customFontSize] = useSettings( "typography.fontSizes", "typography.customFontSize" ); return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)( import_components4.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_runtime123 = __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_runtime123.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_runtime123.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_components5 = __toESM(require_components(), 1); var import_jsx_runtime124 = __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, 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_components5.ToolbarGroup : import_components5.ToolbarDropdownMenu; const extraProps = isToolbar ? { isCollapsed: isCollapsed3 } : { toggleProps: description ? { description } : {}, popoverProps: POPOVER_PROPS }; return /* @__PURE__ */ (0, import_jsx_runtime124.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_runtime125 = __toESM(require_jsx_runtime(), 1); var AlignmentControl = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(ui_default, { ...props, isToolbar: false }); }; var AlignmentToolbar = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(ui_default, { ...props, isToolbar: true }); }; // packages/block-editor/build-module/components/autocomplete/index.mjs var import_hooks3 = __toESM(require_hooks(), 1); var import_components7 = __toESM(require_components(), 1); var import_element13 = __toESM(require_element(), 1); var import_blocks15 = __toESM(require_blocks(), 1); // packages/block-editor/build-module/autocompleters/block.mjs var import_data11 = __toESM(require_data(), 1); var import_blocks14 = __toESM(require_blocks(), 1); var import_element12 = __toESM(require_element(), 1); // packages/block-editor/build-module/utils/search-ranking.mjs var import_remove_accents = __toESM(require_remove_accents(), 1); 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 SEARCH_RANK = { NO_MATCH: 0, /** Every search term appears somewhere across the item's fields. */ MATCHES: 1, /** The value contains the search phrase. */ CONTAINS: 2, /** A word inside the value starts with the search phrase. */ WORD_STARTS_WITH: 3, /** The value starts with the search phrase. */ STARTS_WITH: 4, /** The value is the search phrase. */ EQUAL: 5 }; var readDefaultField = (key) => (item) => item[key]; var DEFAULT_FIELDS = [ { get: readDefaultField("title") }, { get: readDefaultField("name"), maxRank: SEARCH_RANK.WORD_STARTS_WITH }, { get: readDefaultField("keywords"), maxRank: SEARCH_RANK.WORD_STARTS_WITH }, { get: readDefaultField("category"), maxRank: SEARCH_RANK.CONTAINS }, { get: readDefaultField("description"), maxRank: SEARCH_RANK.CONTAINS } ]; var fieldValueCache = /* @__PURE__ */ new WeakMap(); function normalizeString(input = "") { return (0, import_remove_accents.default)(input).replace(/^\//, "").toLowerCase(); } function extractWords(input) { return noCase(input, { splitRegexp, stripRegexp }).split(" ").filter(Boolean); } function getNormalizedSearchTerms(input = "") { return extractWords(normalizeString(input)); } function parseQuery(searchInput) { const terms = getNormalizedSearchTerms(searchInput); return terms.length > 0 ? { terms, phrase: normalizeString(searchInput).trim() } : null; } function getCloseness(index3) { return 1 / (2 + index3); } function toValues(value) { if (Array.isArray(value)) { return value; } return value === void 0 || value === null ? [] : [value]; } function getFieldValues(item, field) { let cache = fieldValueCache.get(item); if (!cache) { cache = /* @__PURE__ */ new Map(); fieldValueCache.set(item, cache); } const derived = []; for (const value of toValues(field.get(item))) { let entry = cache.get(value); if (!entry) { const normalized = normalizeString(String(value)); entry = { normalized, words: extractWords(normalized) }; cache.set(value, entry); } if (entry.normalized) { derived.push(entry); } } return derived; } function getValueMatch({ normalized, words }, phrase) { if (normalized === phrase) { return { rank: SEARCH_RANK.EQUAL, closeness: getCloseness(0) }; } if (normalized.startsWith(phrase)) { return { rank: SEARCH_RANK.STARTS_WITH, closeness: getCloseness(0) }; } const wordIndex = words.findIndex((word) => word.startsWith(phrase)); if (wordIndex !== -1) { return { rank: SEARCH_RANK.WORD_STARTS_WITH, closeness: getCloseness(wordIndex) }; } const index3 = normalized.indexOf(phrase); if (index3 !== -1) { return { rank: SEARCH_RANK.CONTAINS, closeness: getCloseness(index3) }; } return null; } function getFieldMatch(field, values, phrase) { let best = null; for (const value of values) { const match2 = getValueMatch(value, phrase); if (match2 && (!best || match2.rank > best.rank || match2.rank === best.rank && match2.closeness > best.closeness)) { best = match2; } } if (!best) { return null; } const maxRank = field.maxRank ?? SEARCH_RANK.EQUAL; return best.rank > maxRank ? { ...best, rank: maxRank } : best; } function hasEveryTerm(valuesByField, terms) { return terms.every( (term) => valuesByField.some( (values) => values.some( (value) => value.words.some((word) => word.includes(term)) ) ) ); } function matchItem(item, { terms, phrase }, fields) { let best = null; const valuesByField = []; for (let fieldIndex = 0; fieldIndex < fields.length; fieldIndex++) { const field = fields[fieldIndex]; const values = getFieldValues(item, field); valuesByField.push(values); const match2 = getFieldMatch(field, values, phrase); if (match2 && (!best || match2.rank > best.rank)) { best = { ...match2, fieldIndex }; } } if (best) { return best; } if (hasEveryTerm(valuesByField, terms)) { return { rank: SEARCH_RANK.MATCHES, closeness: 0, fieldIndex: fields.length }; } return null; } function searchItems(items = [], searchInput = "", { fields = DEFAULT_FIELDS, filter, tiebreak } = {}) { const candidates = filter ? items.filter(filter) : items; const query = parseQuery(searchInput); if (!query) { return candidates; } const matches = []; for (const item of candidates) { const match2 = matchItem(item, query, fields); if (match2) { matches.push({ item, ...match2 }); } } matches.sort( (a, b) => b.rank - a.rank || a.fieldIndex - b.fieldIndex || b.closeness - a.closeness || (tiebreak ? tiebreak(a.item, b.item) : 0) ); return matches.map(({ item }) => item); } // packages/block-editor/build-module/components/inserter/search-items.mjs function getCorePriority(item) { const name = item.name || ""; if (!name.startsWith("core/")) { return 0; } return name === item.id ? 2 : 1; } var searchBlockItems = (items, categories, collections, searchInput) => { const fields = [ { get: (item) => item.title }, { get: (item) => item.name, maxRank: SEARCH_RANK.WORD_STARTS_WITH }, { get: (item) => item.keywords, maxRank: SEARCH_RANK.WORD_STARTS_WITH }, { get: (item) => categories.find(({ slug }) => slug === item.category)?.title, maxRank: SEARCH_RANK.CONTAINS }, { get: (item) => collections[(item.name || "").split("/")[0]]?.title, maxRank: SEARCH_RANK.CONTAINS }, { get: (item) => item.description, maxRank: SEARCH_RANK.CONTAINS } ]; return searchItems(items, searchInput, { fields, tiebreak: (a, b) => getCorePriority(b) - getCorePriority(a) }); }; // packages/block-editor/build-module/components/inserter/hooks/use-block-types-state.mjs var import_blocks13 = __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_blocks13.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_blocks13.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_blocks13.parse)(content, { __unstableSkipMigrationLogs: true }) : (0, import_blocks13.createBlock)( name, initialAttributes, (0, import_blocks13.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_components6 = __toESM(require_components(), 1); var import_element11 = __toESM(require_element(), 1); var import_jsx_runtime126 = __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_runtime126.jsx)( import_components6.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_runtime126.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_runtime127 = __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_blocks14.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_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime127.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_blocks14.cloneBlock)(block) ) : (0, import_blocks14.createBlock)( name, initialAttributes, (0, import_blocks14.createBlocksFromInnerBlocksTemplate)( innerBlocks ), innerContent ) }; } }; } var block_default = createBlockCompleter(); // packages/block-editor/build-module/components/autocomplete/index.mjs var import_jsx_runtime128 = __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_blocks15.getDefaultBlockName)() || (0, import_blocks15.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_components7.__unstableUseAutocompleteProps)({ ...props, completers: useCompleters(props) }); } function BlockEditorAutocomplete(props) { return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_components7.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_components13 = __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_components8 = __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(selectors5, append = "") { return selectors5.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; } function normalizeLegacyLayout(layout) { return layout?.inherit || layout?.contentSize || layout?.wideSize ? { ...layout, type: "constrained" } : layout; } // packages/block-editor/build-module/components/spacing-sizes-control/utils.mjs var import_i18n11 = __toESM(require_i18n(), 1); // packages/block-editor/build-module/components/preset-input-control/utils.mjs var isValuePreset = (value, slug) => { if (!value?.includes) { return false; } return value === "0" || value.includes(`var:preset|${slug}|`); }; function getPresetSlug(value, presetType) { if (!value) { return; } if (value === "0" || value === "default") { return value; } const slug = value.match( new RegExp(`var:preset\\|${presetType}\\|(.+)`) ); return slug ? slug[1] : void 0; } function getSliderValueFromPreset(presetValue, presets, presetType) { if (presetValue === void 0) { return 0; } const slug = parseFloat(presetValue, 10) === 0 ? "0" : getPresetSlug(presetValue, presetType); const sliderValue = presets.findIndex((size4) => { return String(size4.slug) === slug; }); return sliderValue !== -1 ? sliderValue : NaN; } function getCustomValueFromPreset(value, presets, presetType) { if (!isValuePreset(value, presetType)) { return value; } const slug = parseFloat(value, 10) === 0 ? "0" : getPresetSlug(value, presetType); const preset = presets.find((size4) => String(size4.slug) === slug); return preset?.size; } function getPresetValueFromCustomValue(value, spacingSizes, presetType) { if (!value || isValuePreset(value, presetType) || value === "0") { return value; } const spacingMatch = spacingSizes.find( (size4) => String(size4.size) === String(value) ); if (spacingMatch?.slug) { return `var:preset|${presetType}|${spacingMatch.slug}`; } return value; } // packages/block-editor/build-module/components/spacing-sizes-control/utils.mjs var SPACING_PRESET_TYPE = "spacing"; 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) { return isValuePreset(value, SPACING_PRESET_TYPE); } function getCustomValueFromPreset2(value, spacingSizes) { if (!isValueSpacingPreset(value)) { return value; } const slug = getPresetSlug(value, SPACING_PRESET_TYPE); const spacingSize = spacingSizes.find( (size4) => String(size4.slug) === slug ); return spacingSize?.size; } function getPresetValueFromCustomValue2(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 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 isAxialBlockGapAllowed(layout, defaultLayout2) { const usedLayout = normalizeLegacyLayout(layout) || defaultLayout2 || {}; return ["flex", "grid"].includes(usedLayout?.type); } 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_runtime129 = __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"), hasInspectorControls(layoutBlockSupport = {}) { const { allowOrientation = true, allowJustification = true, allowVerticalAlignment = true, allowWrap = true } = layoutBlockSupport; return allowOrientation || allowJustification || allowVerticalAlignment || allowWrap; }, 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_runtime129.jsxs)(import_jsx_runtime129.Fragment, { children: [ (allowJustification || allowOrientation) && /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)( import_components8.Flex, { align: "flex-start", className: "block-editor-hooks__flex-layout-controls", gap: 4, justify: "flex-start", children: [ allowJustification && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( import_components8.__experimentalToolsPanelItem, { label: (0, import_i18n12.__)("Justification"), hasValue: hasJustificationValue, onDeselect: resetJustification, isShownByDefault: true, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( FlexLayoutJustifyContentControl, { layout, onChange } ) } ), allowOrientation && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( import_components8.__experimentalToolsPanelItem, { label: (0, import_i18n12.__)("Orientation"), hasValue: hasOrientationValue, onDeselect: resetOrientation, isShownByDefault: true, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( OrientationControl, { layout, onChange } ) } ) ] } ), allowVerticalAlignment && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( import_components8.__experimentalToolsPanelItem, { label: (0, import_i18n12.__)("Alignment"), hasValue: hasVerticalAlignmentValue, onDeselect: resetVerticalAlignment, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( FlexLayoutVerticalAlignmentControl, { layout, onChange } ) } ), allowWrap && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( import_components8.__experimentalToolsPanelItem, { label: (0, import_i18n12.__)("Wrapping"), hasValue: hasWrapValue, onDeselect: resetWrap, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime129.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_runtime129.jsxs)( block_controls_default, { group: controlsGroup, __experimentalShareWithChildBlocks: true, children: [ allowJustification && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( FlexLayoutJustifyContentControl, { layout, onChange, isToolbar: true } ), allowVerticalAlignment && /* @__PURE__ */ (0, import_jsx_runtime129.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 (hasViewportOverride("orientation")) { rules.push("flex-direction: row"); } 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_runtime129.jsx)( BlockVerticalAlignmentControl, { onChange: onVerticalAlignmentChange, value: verticalAlignment, controls } ); } return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( import_components8.__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_runtime129.jsx)( import_components8.__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_runtime129.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_runtime129.jsx)( import_components8.__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_runtime129.jsx)( import_components8.__experimentalToggleGroupControlOptionIcon, { value, icon, label }, value ); }) } ); } function FlexWrapControl({ layout, onChange }) { const { flexWrap = "wrap" } = layout; return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( import_components8.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_runtime129.jsxs)( import_components8.__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_runtime129.jsx)( import_components8.__experimentalToggleGroupControlOptionIcon, { icon: arrow_right_default, value: "horizontal", label: (0, import_i18n12.__)("Horizontal") } ), /* @__PURE__ */ (0, import_jsx_runtime129.jsx)( import_components8.__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"), hasInspectorControls() { return false; }, inspectorControls: function DefaultLayoutInspectorControls() { return null; }, toolBarControls: function DefaultLayoutToolbarControls() { return null; }, getLayoutStyle: function getLayoutStyle2({ selector: selector3, style, blockName, hasBlockGapSupport, layoutDefinitions = LAYOUT_DEFINITIONS2 }) { const blockGapStyleValue = 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_components10 = __toESM(require_components(), 1); var import_i18n14 = __toESM(require_i18n(), 1); var import_style_engine3 = __toESM(require_style_engine(), 1); var import_jsx_runtime130 = __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"), hasInspectorControls(layoutBlockSupport = {}) { const { allowJustification = true, allowCustomContentAndWideSize = true } = layoutBlockSupport; return allowJustification || allowCustomContentAndWideSize; }, 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_components10.__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_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [ allowCustomContentAndWideSize && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components10.__experimentalToolsPanelItem, { label: (0, import_i18n14.__)("Content width"), hasValue: hasContentSizeValue, onDeselect: resetContentSize, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components10.__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_runtime130.jsx)(import_components10.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(icon_default, { icon: align_none_default }) }) } ) } ), /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)( import_components10.__experimentalToolsPanelItem, { label: (0, import_i18n14.__)("Wide width"), hasValue: hasWideSizeValue, onDeselect: resetWideSize, panelId: clientId, children: [ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components10.__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_runtime130.jsx)(import_components10.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(icon_default, { icon: stretch_wide_default }) }) } ), /* @__PURE__ */ (0, import_jsx_runtime130.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_runtime130.jsx)( import_components10.__experimentalToolsPanelItem, { label: (0, import_i18n14.__)("Justification"), hasValue: hasJustificationValue, onDeselect: resetJustification, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components10.__experimentalToggleGroupControl, { label: (0, import_i18n14.__)("Justification"), value: justifyContent, onChange: onJustificationChange, children: justificationOptions.map( ({ value, icon, label }) => { return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)( import_components10.__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_runtime130.jsx)( block_controls_default, { group: controlsGroup, __experimentalShareWithChildBlocks: true, children: /* @__PURE__ */ (0, import_jsx_runtime130.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 = 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_runtime130.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_components12 = __toESM(require_components(), 1); var import_element14 = __toESM(require_element(), 1); var import_jsx_runtime131 = __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"), hasInspectorControls() { return true; }, 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_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [ window.__experimentalEnableGridInteractivity && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components12.__experimentalToolsPanelItem, { label: (0, import_i18n15.__)("Grid item position"), hasValue: hasGridTypeValue, onDeselect: resetGridType, isShownByDefault: true, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( GridLayoutTypeControl, { layout, onChange } ) } ), showColumnsControl && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components12.__experimentalToolsPanelItem, { label: (0, import_i18n15.__)("Columns and rows"), hasValue: hasColumnsAndRowsValue, onDeselect: resetColumnsAndRows, isShownByDefault: true, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( GridLayoutColumnsAndRowsControl, { layout, onChange, allowSizingOnChildren } ) } ), showMinWidthControl && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components12.__experimentalToolsPanelItem, { label: (0, import_i18n15.__)("Min. column width"), hasValue: hasMinimumColumnWidthValue, onDeselect: resetMinimumColumnWidth, isShownByDefault: true, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( GridLayoutMinimumWidthControl, { layout, onChange } ) } ), showFillControl && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components12.__experimentalToolsPanelItem, { label: (0, import_i18n15.__)("Fill available space"), hasValue: hasFillValue, onDeselect: resetFill, panelId: clientId, children: /* @__PURE__ */ (0, import_jsx_runtime131.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) { const blockGapBoxControlValue = blockGapValue ? getGapBoxControlValueFromStyle2(style.spacing.blockGap) : void 0; let blockGapToUse = getSpacingPresetCssVar2(blockGapBoxControlValue?.left) || 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_components12.__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_runtime131.jsxs)("fieldset", { className: "block-editor-hooks__grid-layout-minimum-width-control", children: [ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_components12.BaseControl.VisualLabel, { as: "legend", children: (0, import_i18n15.__)("Min. column width") }), /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_components12.Flex, { gap: 4, children: [ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_components12.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components12.__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_runtime131.jsx)(import_components12.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components12.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_runtime131.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_runtime131.jsx)(import_jsx_runtime131.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("fieldset", { className: "block-editor-hooks__grid-layout-columns-and-rows-controls", children: [ !isManualPlacement && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_components12.BaseControl.VisualLabel, { as: "legend", children: (0, import_i18n15.__)("Max. columns") }), /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_components12.Flex, { gap: 4, children: [ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_components12.FlexItem, { isBlock: true, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components12.__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_runtime131.jsx)(import_components12.FlexItem, { isBlock: true, children: allowSizingOnChildren && isManualPlacement ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components12.__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_runtime131.jsx)( import_components12.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_runtime131.jsx)( import_components12.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_runtime131.jsxs)( import_components12.__experimentalToggleGroupControl, { label: (0, import_i18n15.__)("Grid item position"), value: gridPlacement, onChange: onChangeType, isBlock: true, help: helpText2, children: [ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components12.__experimentalToggleGroupControlOption, { value: "auto", label: (0, import_i18n15.__)("Auto") }, "auto" ), /* @__PURE__ */ (0, import_jsx_runtime131.jsx)( import_components12.__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_runtime132 = __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 && blockGapSupport !== void 0; if (layoutType) { if (css) { return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("style", { children: css }); } const layoutStyle = layoutType.getLayoutStyle?.({ hasBlockGapSupport, layout, ...props }); if (layoutStyle) { return /* @__PURE__ */ (0, import_jsx_runtime132.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 useAlignmentSettings(isNoneOnly) { return (0, import_data12.useSelect)( (select3) => { if (isNoneOnly) { return { wideControlsEnabled: false, themeSupportsLayout: false, isBlockBasedTheme: false }; } const settings2 = select3(store).getSettings(); return { wideControlsEnabled: settings2.alignWide ?? false, themeSupportsLayout: settings2.supportsLayout, isBlockBasedTheme: settings2.__unstableIsBlockBasedTheme }; }, [isNoneOnly] ); } function useAvailableAlignments(controls = DEFAULT_CONTROLS) { if (!controls.includes("none")) { controls = ["none", ...controls]; } const isNoneOnly = controls.length === 1 && controls[0] === "none"; const settings2 = useAlignmentSettings(isNoneOnly); const layout = useLayout(); if (isNoneOnly) { return EMPTY_ARRAY4; } return getAvailableAlignments(controls, layout, settings2); } function getAvailableAlignments(controls, layout, { wideControlsEnabled, themeSupportsLayout, isBlockBasedTheme }) { 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; } function useAlignmentMenu(controls = DEFAULT_CONTROLS) { if (!controls.includes("none")) { controls = ["none", ...controls]; } const isNoneOnly = controls.length === 1 && controls[0] === "none"; const settings2 = useAlignmentSettings(isNoneOnly); const layout = useLayout(); const [globalLayout] = useSettings("layout"); if (isNoneOnly) { return { enabled: EMPTY_ARRAY4, unavailable: EMPTY_ARRAY4 }; } const enabled = getAvailableAlignments(controls, layout, settings2); const layoutOffersAlignments = !!getAvailableAlignments( DEFAULT_CONTROLS, layout, settings2 ).length; if (!layoutOffersAlignments) { return { enabled, unavailable: EMPTY_ARRAY4 }; } const themeNames = getAvailableAlignments( DEFAULT_CONTROLS, { ...globalLayout, type: "constrained" }, settings2 ).map(({ name }) => name); const enabledNames = enabled.map(({ name }) => name); const unavailable = controls.filter( (name) => WIDE_CONTROLS.includes(name) && themeNames.includes(name) && !enabledNames.includes(name) ); return { enabled, unavailable }; } // 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_runtime133 = __toESM(require_jsx_runtime(), 1); function BlockAlignmentUI({ value, onChange, controls, isToolbar, isCollapsed: isCollapsed3 = true, label = (0, import_i18n17.__)("Align block"), description }) { const { enabled: enabledControls, unavailable: unavailableControls } = useAlignmentMenu(controls); if (!enabledControls.length) { return null; } const menuControls = [...enabledControls]; const enabledNames = menuControls.map(({ name }) => name); menuControls.splice( enabledNames.indexOf("none") + 1, 0, ...unavailableControls.map((name) => ({ name, isUnavailable: true })) ); 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_components13.ToolbarGroup : import_components13.ToolbarDropdownMenu; const commonProps = { icon: activeAlignmentControl ? activeAlignmentControl.icon : defaultAlignmentControl.icon, label }; 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 ? { description } : {}, children: ({ onClose }) => { return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_jsx_runtime133.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_components13.MenuGroup, { className: "block-editor-block-alignment-control__menu-group", children: menuControls.map( ({ name: controlName, info, isUnavailable }) => { const { icon, title } = BLOCK_ALIGNMENTS_CONTROLS[controlName]; const isSelected = controlName === value || !value && controlName === "none"; return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)( import_components13.MenuItem, { icon, iconPosition: "left", className: clsx_default( "components-dropdown-menu__menu-item", { "is-active": isSelected } ), isSelected, disabled: isUnavailable, onClick: () => { onChangeAlignment( controlName ); onClose(); }, role: "menuitemradio", info: isUnavailable ? (0, import_i18n17.__)("Not available") : info, children: title }, controlName ); } ) }) }); } }; return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(UIComponent, { ...commonProps, ...extraProps }); } var ui_default2 = BlockAlignmentUI; // packages/block-editor/build-module/components/block-alignment-control/index.mjs var import_jsx_runtime134 = __toESM(require_jsx_runtime(), 1); var BlockAlignmentControl = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(ui_default2, { ...props, isToolbar: false }); }; var BlockAlignmentToolbar = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime134.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_i18n29 = __toESM(require_i18n(), 1); var import_blocks17 = __toESM(require_blocks(), 1); var import_components15 = __toESM(require_components(), 1); var import_data15 = __toESM(require_data(), 1); var import_element125 = __toESM(require_element(), 1); var import_compose12 = __toESM(require_compose(), 1); // packages/ui/build-module/badge/badge.mjs var import_element30 = __toESM(require_element(), 1); // node_modules/@base-ui/utils/useControlled.mjs var React = __toESM(require_react(), 1); // node_modules/@base-ui/utils/createLogOnce.mjs var loggedMessages; if (true) { loggedMessages = /* @__PURE__ */ new Set(); } function createLogOnce(severity, prefix2) { return function logOnce(...messages2) { if (true) { const message2 = messages2.join(" "); const output = prefix2 ? `${prefix2}: ${message2}` : message2; const key = `${severity}:${output}`; if (!loggedMessages.has(key)) { loggedMessages.add(key); if (severity === "warn") { console.warn(output); } else { console.error(output); } } } }; } // node_modules/@base-ui/utils/error.mjs var error = createLogOnce("error", "Base UI"); // node_modules/@base-ui/utils/useControlled.mjs function useControlled({ controlled, default: defaultProp, name, state = "value" }) { const { current: isControlled } = React.useRef(controlled !== void 0); const [valueState, setValue] = React.useState(defaultProp); const value = isControlled && controlled !== void 0 ? controlled : valueState; if (true) { React.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 } = React.useRef(defaultProp); React.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 = React.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 React2 = __toESM(require_react(), 1); var SafeReact = { ...React2 }; // node_modules/@base-ui/utils/useRefWithInit.mjs var React3 = __toESM(require_react(), 1); var UNINITIALIZED = {}; function useRefWithInit(init, initArg) { const ref = React3.useRef(UNINITIALIZED); if (ref.current === UNINITIALIZED) { ref.current = init(initArg); } return ref; } // node_modules/@base-ui/utils/useStableCallback.mjs var useInsertionEffect = SafeReact.useInsertionEffect; var useSafeInsertionEffect = ( // React 17 doesn't have useInsertionEffect. useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (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/warn.mjs var warn = createLogOnce("warn", "Base UI"); // 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/composite/list/CompositeList.mjs var React6 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs var React4 = __toESM(require_react(), 1); var noop2 = () => { }; var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop2; // node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs var React5 = __toESM(require_react(), 1); var CompositeListContext = /* @__PURE__ */ React5.createContext({ register: () => { }, unregister: () => { }, subscribeMapChange: () => () => { }, nextIndexRef: { current: 0 } }); if (true) CompositeListContext.displayName = "CompositeListContext"; function useCompositeListContext() { return React5.useContext(CompositeListContext); } // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs var import_jsx_runtime135 = __toESM(require_jsx_runtime(), 1); function CompositeList(props) { const { children, elementsRef, labelsRef, onMapChange: onMapChangeProp } = props; const onMapChange = useStableCallback(onMapChangeProp); const [, setMapTick] = React6.useState(false); const listeners = useRefWithInit(createListeners).current; const map = useRefWithInit(createMap).current; const nextIndexRef = React6.useRef(0); const isDirtyRef = React6.useRef(true); const itemsRef = React6.useRef(null); const mutationObserverRef = React6.useRef(null); const scheduleMapUpdate = useStableCallback(() => { if (isDirtyRef.current) { return; } isDirtyRef.current = true; setMapTick((tick) => !tick); }); const register2 = useStableCallback((node, registration) => { map.set(node, registration); scheduleMapUpdate(); }); const unregister = useStableCallback((node) => { map.delete(node); scheduleMapUpdate(); }); const syncRefs = useStableCallback((items) => { const nextMap = /* @__PURE__ */ new Map(); elementsRef.current.length = 0; if (labelsRef) { labelsRef.current.length = 0; } items.forEach((item) => { nextMap.set(item.element, { ...item.registration.metadata ?? {}, index: item.index }); elementsRef.current[item.index] = item.element; if (labelsRef) { labelsRef.current[item.index] = item.registration.label !== void 0 ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent; } }); nextIndexRef.current = elementsRef.current.length; return nextMap; }); function observe(sortedNodes) { mutationObserverRef.current?.disconnect(); mutationObserverRef.current = null; if (typeof MutationObserver !== "function" || sortedNodes.length < 2) { return; } const mutationObserver = new MutationObserver((entries) => { if (!hasMovedNode(entries)) { return; } let previousConnectedNode = null; for (const node of sortedNodes) { if (!node.isConnected) { continue; } if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) { mutationObserver.disconnect(); scheduleMapUpdate(); return; } previousConnectedNode = node; } }); mutationObserverRef.current = mutationObserver; const roots = /* @__PURE__ */ new Set(); for (let i = 1; i < sortedNodes.length; i += 1) { const root = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]); if (root) { roots.add(root); } } roots.forEach((root) => mutationObserver.observe(root, { childList: true })); } const flush2 = useStableCallback(() => { const [items, automaticNodes] = getCompositeListSnapshot(map); const nextMap = syncRefs(items); const previousItems = itemsRef.current; const changed = !previousItems || previousItems.length !== items.length || items.some((item, index3) => { const previousItem = previousItems[index3]; return item.index !== previousItem.index || item.element !== previousItem.element || item.registration.index !== previousItem.registration.index || item.registration.metadata !== previousItem.registration.metadata; }); observe(automaticNodes); itemsRef.current = items; isDirtyRef.current = false; if (!changed) { return; } listeners.forEach((listener) => listener(nextMap)); onMapChange(nextMap); }); useIsoLayoutEffect(() => { if (!isDirtyRef.current && itemsRef.current) { syncRefs(itemsRef.current); } return () => { elementsRef.current = []; if (labelsRef) { labelsRef.current = []; } }; }, [elementsRef, labelsRef, syncRefs]); useIsoLayoutEffect(() => { if (isDirtyRef.current) { flush2(); } }); useIsoLayoutEffect(() => { return () => { mutationObserverRef.current?.disconnect(); isDirtyRef.current = true; }; }, []); const subscribeMapChange = useStableCallback((fn) => { listeners.add(fn); return () => { listeners.delete(fn); }; }); const contextValue = React6.useMemo(() => ({ register: register2, unregister, subscribeMapChange, nextIndexRef }), [register2, unregister, subscribeMapChange, nextIndexRef]); return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(CompositeListContext.Provider, { value: contextValue, children }); } function createMap() { return /* @__PURE__ */ new Map(); } function createListeners() { return /* @__PURE__ */ new Set(); } function getCompositeListSnapshot(map) { const reservedIndices = /* @__PURE__ */ new Set(); const items = []; const automaticItems = []; map.forEach((registration, node) => { if (!node.isConnected) { return; } const index3 = registration.index; const item = { index: index3 ?? -1, element: node, registration }; if (index3 === null) { automaticItems.push(item); } else if (index3 >= 0) { reservedIndices.add(index3); items.push(item); } }); let nextAutomaticIndex = 0; automaticItems.sort((a, b) => sortByDocumentPosition(a.element, b.element)); automaticItems.forEach((item) => { while (reservedIndices.has(nextAutomaticIndex)) { nextAutomaticIndex += 1; } item.index = nextAutomaticIndex; items.push(item); nextAutomaticIndex += 1; }); if (reservedIndices.size > 0) { items.sort((a, b) => a.index - b.index); } return [items, automaticItems.map((item) => item.element)]; } function getCommonAncestor(firstNode, lastNode) { let ancestor = firstNode.parentElement; while (ancestor && !ancestor.contains(lastNode)) { ancestor = ancestor.parentElement; } return ancestor; } function hasMovedNode(entries) { for (const entry of entries) { for (let i = 0; i < entry.removedNodes.length; i += 1) { if (entry.removedNodes[i].isConnected) { return true; } } } return false; } function sortByDocumentPosition(a, b) { return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1; } // node_modules/@base-ui/react/internals/useRenderElement.mjs var React9 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/useMergedRefs.mjs function useMergedRefs(a, b, c6, d) { const forkRef = useRefWithInit(createForkRef).current; if (didChange(forkRef, a, b, c6, d)) { update(forkRef, [a, b, c6, d]); } return forkRef.callback; } function useMergedRefsN(refs) { const forkRef = useRefWithInit(createForkRef).current; if (didChangeN(forkRef, refs)) { update(forkRef, refs); } return forkRef.callback; } function createForkRef() { return { callback: null, cleanup: null, refs: [] }; } function didChange(forkRef, a, b, c6, d) { return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c6 || forkRef.refs[3] !== d; } function didChangeN(forkRef, newRefs) { return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index3) => ref !== newRefs[index3]); } function update(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 i = 0; i < refs.length; i += 1) { const ref = refs[i]; if (ref == null) { continue; } switch (typeof ref) { case "function": { const refCleanup = ref(instance); if (typeof refCleanup === "function") { cleanupCallbacks[i] = refCleanup; } break; } case "object": { ref.current = instance; break; } default: } } forkRef.cleanup = () => { for (let i = 0; i < refs.length; i += 1) { const ref = refs[i]; if (ref == null) { continue; } switch (typeof ref) { case "function": { const cleanupCallback = cleanupCallbacks[i]; if (typeof cleanupCallback === "function") { cleanupCallback(); } else { void ref(null); } break; } case "object": { ref.current = null; break; } default: } } }; } }; } // node_modules/@base-ui/utils/getReactElementRef.mjs var React8 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/reactVersion.mjs var React7 = __toESM(require_react(), 1); var majorVersion = parseInt(React7.version, 10); function isReactVersionAtLeast(reactVersionToCheck) { return majorVersion >= reactVersionToCheck; } // node_modules/@base-ui/utils/getReactElementRef.mjs function getReactElementRef(element) { if (!/* @__PURE__ */ React8.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(a, b) { if (a && !b) { return a; } if (!a && b) { return b; } if (a || b) { return { ...a, ...b }; } return void 0; } // 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(a, b, c6, d, e2) { if (!c6 && !d && !e2 && !a) { return createInitialMergedProps(b); } let merged = createInitialMergedProps(a); if (b) { merged = mergeInto(merged, b); } if (c6) { merged = mergeInto(merged, c6); } if (d) { merged = mergeInto(merged, d); } 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 i = 1; i < props.length; i += 1) { merged = mergeInto(merged, props[i]); } 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_react = __toESM(require_react(), 1); function useRenderElement(element, componentProps, params = {}) { let renderProp = componentProps.render; if (params.enabled !== false) { renderProp = unwrapLazyRenderProp(renderProp); } const outProps = useRenderElementProps(componentProps, params, renderProp); if (params.enabled === false) { return null; } const state = params.state ?? EMPTY_OBJECT; return evaluateRenderProp(element, renderProp, outProps, state); } function useRenderElementProps(componentProps, params, renderProp) { const { className: classNameProp, style: styleProp } = componentProps; const { state = EMPTY_OBJECT, ref, props, stateAttributesMapping: stateAttributesMapping9, enabled = true } = params; const className = enabled ? resolveClassName(classNameProp, state) : void 0; const style = enabled ? resolveStyle2(styleProp, state) : void 0; const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping9) : EMPTY_OBJECT; const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; if (typeof document !== "undefined") { if (!enabled) { void 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 unwrapLazyRenderProp(render4) { if (render4?.$$typeof !== REACT_LAZY_TYPE) { return render4; } const unwrapped = React9.Children.toArray(render4)[0]; return /* @__PURE__ */ React9.isValidElement(unwrapped) ? unwrapped : render4; } 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; if (true) { if (!/* @__PURE__ */ React9.isValidElement(render4)) { 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__ */ React9.cloneElement(render4, 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_react.createElement)("button", { type: "button", ...props, key: props.key }); } if (Tag === "img") { return /* @__PURE__ */ (0, import_react.createElement)("img", { alt: "", ...props, key: props.key }); } return /* @__PURE__ */ React9.createElement(Tag, props); } // node_modules/@base-ui/utils/useId.mjs var React10 = __toESM(require_react(), 1); var globalId = 0; function useGlobalId(idOverride, prefix2 = "mui") { const [defaultId, setDefaultId] = React10.useState(idOverride); const id = idOverride || defaultId; React10.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 React13 = __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 React12 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/useOnMount.mjs var React11 = __toESM(require_react(), 1); function useOnMount(fn) { React11.useEffect(fn, EMPTY_ARRAY5); } // node_modules/@base-ui/utils/useAnimationFrame.mjs var EMPTY = 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 i = 0; i < currentCallbacks.length; i += 1) { currentCallbacks[i]?.(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 index3 = id - this.startId; if (index3 < 0 || index3 >= this.callbacks.length) { return; } if (this.callbacks[index3] === null) { return; } this.callbacks[index3] = 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 = EMPTY; /** * Executes `fn` after `delay`, clearing any previously scheduled call. */ request(fn) { this.cancel(); this.currentId = scheduler.request(() => { this.currentId = EMPTY; fn(); }); } cancel = () => { if (this.currentId !== EMPTY) { scheduler.cancel(this.currentId); this.currentId = EMPTY; } }; 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(open3, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) { const [transitionStatus, setTransitionStatus] = React12.useState(open3 && enableIdleState ? "idle" : void 0); const [mounted, setMounted] = React12.useState(open3 && !animateInitialOpen); if (open3 && !mounted) { setMounted(true); setTransitionStatus("starting"); } if (!open3 && mounted && transitionStatus !== "ending" && !deferEndingState) { setTransitionStatus("ending"); } if (!open3 && !mounted && transitionStatus === "ending") { setTransitionStatus(void 0); } useIsoLayoutEffect(() => { if (!open3 && mounted && transitionStatus !== "ending" && deferEndingState) { const frame = AnimationFrame.request(() => { setTransitionStatus("ending"); }); return () => { AnimationFrame.cancel(frame); }; } return void 0; }, [open3, mounted, transitionStatus, deferEndingState]); useIsoLayoutEffect(() => { if (!open3 || enableIdleState) { return void 0; } const frame = AnimationFrame.request(() => { setTransitionStatus(void 0); }); return () => { AnimationFrame.cancel(frame); }; }, [enableIdleState, open3]); useIsoLayoutEffect(() => { if (!open3 || !enableIdleState) { return void 0; } if (open3 && mounted && transitionStatus !== "idle") { setTransitionStatus("starting"); } const frame = AnimationFrame.request(() => { setTransitionStatus("idle"); }); return () => { AnimationFrame.cancel(frame); }; }, [enableIdleState, open3, mounted, transitionStatus]); return { mounted, setMounted, transitionStatus }; } // node_modules/@base-ui/react/collapsible/root/useCollapsibleRoot.mjs function useCollapsibleRoot(parameters) { const { open: openParam, defaultOpen = false, onOpenChange, disabled: disabled2 } = parameters; const [open3, setOpen] = useControlled({ controlled: openParam, default: defaultOpen, name: "Collapsible", state: "open" }); const { mounted, setMounted, transitionStatus } = useTransitionStatus(open3, true, true); const defaultPanelId = useBaseUiId(); const [registeredPanelId, setPanelIdState] = React13.useState(); const panelId = registeredPanelId === null ? void 0 : registeredPanelId ?? defaultPanelId; const handleTrigger = useStableCallback((event) => { const nextOpen = !open3; const eventDetails = createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent); onOpenChange(nextOpen, eventDetails); if (eventDetails.isCanceled) { return; } setOpen(nextOpen); }); return React13.useMemo(() => ({ defaultPanelId, disabled: disabled2, handleTrigger, mounted, open: open3, panelId, setMounted, setOpen, setPanelIdState, transitionStatus }), [defaultPanelId, disabled2, handleTrigger, mounted, open3, panelId, setMounted, setOpen, setPanelIdState, transitionStatus]); } // node_modules/@base-ui/react/collapsible/root/CollapsibleRootContext.mjs var React14 = __toESM(require_react(), 1); var CollapsibleRootContext = /* @__PURE__ */ React14.createContext(void 0); if (true) CollapsibleRootContext.displayName = "CollapsibleRootContext"; function useCollapsibleRootContext() { const context = React14.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 React15 = __toESM(require_react(), 1); function useCompositeListItem(params = {}) { const { guess, label, metadata, textRef, index: externalIndex } = params; const { register: register2, unregister, subscribeMapChange, nextIndexRef } = useCompositeListContext(); const indexRef = React15.useRef(-1); const [internalIndex, setInternalIndex] = React15.useState(externalIndex == null && guess ? () => { if (indexRef.current === -1) { const newIndex = nextIndexRef.current; nextIndexRef.current += 1; indexRef.current = newIndex; } return indexRef.current; } : -1); const index3 = externalIndex ?? internalIndex; const componentRef = React15.useRef(null); const ref = React15.useCallback((node) => { const previousNode = componentRef.current; if (previousNode) { unregister(previousNode); } componentRef.current = node; if (node) { register2(node, { metadata: metadata ?? null, index: externalIndex ?? null, label, textRef }); } }, [externalIndex, register2, unregister, metadata, label, textRef]); useIsoLayoutEffect(() => { if (externalIndex != null) { return void 0; } return subscribeMapChange((map) => { const i = componentRef.current ? map.get(componentRef.current)?.index : null; if (i != null) { setInternalIndex(i); } }); }, [externalIndex, subscribeMapChange]); return { ref, index: index3 }; } // node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs var TransitionStatusDataAttributes_exports = {}; __export(TransitionStatusDataAttributes_exports, { endingStyle: () => endingStyle, startingStyle: () => startingStyle }); var startingStyle = "data-starting-style"; var endingStyle = "data-ending-style"; // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs var STARTING_HOOK = { [startingStyle]: "" }; var ENDING_HOOK = { [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 open = "data-open"; var closed = "data-closed"; var startingStyle2 = TransitionStatusDataAttributes_exports.startingStyle; var endingStyle2 = TransitionStatusDataAttributes_exports.endingStyle; // node_modules/@base-ui/react/collapsible/trigger/CollapsibleTriggerDataAttributes.mjs var panelOpen = "data-panel-open"; // node_modules/@base-ui/react/utils/collapsibleOpenStateMapping.mjs var PANEL_OPEN_HOOK = { [open]: "" }; var PANEL_CLOSED_HOOK = { [closed]: "" }; var triggerOpenStateMapping = { open(value) { if (value) { return { [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 React18 = __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).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 React16 = __toESM(require_react(), 1); var CompositeRootContext = /* @__PURE__ */ React16.createContext(void 0); if (true) CompositeRootContext.displayName = "CompositeRootContext"; function useCompositeRootContext(optional = false) { const context = React16.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 React17 = __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 = React17.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/utils/owner.mjs function ownerDocument(node) { return node?.ownerDocument || document; } // node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs function dispatchClickWithModifiers(target, sourceEvent, { detail = 0 } = {}) { target.dispatchEvent(new (getWindow(target)).PointerEvent("click", { bubbles: true, cancelable: true, composed: true, detail, shiftKey: sourceEvent.shiftKey, ctrlKey: sourceEvent.ctrlKey, altKey: sourceEvent.altKey, metaKey: sourceEvent.metaKey })); } // 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 = React18.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) { React18.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