PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/scripts/format-library/index.js +7528 -388 23.0.1 → trunk View file →
@@ -1,4 +1,6 @@
1 +(function() {
2 +"use strict";
1 3 var wp;
2 4 (wp ||= {}).formatLibrary = (() => {
3 5 var __create = Object.create;
4 6 var __defProp = Object.defineProperty;
@@ -14,8 +16,12 @@
14 16 });
15 17 var __commonJS = (cb, mod) => function __require2() {
16 18 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17 19 };
20 + var __export = (target, all) => {
21 + for (var name16 in all)
22 + __defProp(target, name16, { get: all[name16], enumerable: true });
23 + };
18 24 var __copyProps = (to, from, except, desc) => {
19 25 if (from && typeof from === "object" || typeof from === "function") {
20 26 for (let key of __getOwnPropNames(from))
21 27 if (!__hasOwnProp.call(to, key) && key !== except)
@@ -80,22 +86,105 @@
80 86 module.exports = window.wp.components;
81 87 }
82 88 });
83 89
84 - // package-external:@wordpress/url
85 - var require_url = __commonJS({
86 - "package-external:@wordpress/url"(exports, module) {
87 - module.exports = window.wp.url;
90 + // vendor-external:react
91 + var require_react = __commonJS({
92 + "vendor-external:react"(exports, module) {
93 + module.exports = window.React;
88 94 }
89 95 });
90 96
91 - // package-external:@wordpress/html-entities
92 - var require_html_entities = __commonJS({
93 - "package-external:@wordpress/html-entities"(exports, module) {
94 - module.exports = window.wp.htmlEntities;
97 + // vendor-external:react-dom
98 + var require_react_dom = __commonJS({
99 + "vendor-external:react-dom"(exports, module) {
100 + module.exports = window.ReactDOM;
95 101 }
96 102 });
97 103
104 + // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
105 + var require_use_sync_external_store_shim_development = __commonJS({
106 + "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
107 + "use strict";
108 + (function() {
109 + function is(x, y) {
110 + return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
111 + }
112 + function useSyncExternalStore$2(subscribe2, getSnapshot2) {
113 + didWarnOld18Alpha || void 0 === React51.startTransition || (didWarnOld18Alpha = true, console.error(
114 + "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."
115 + ));
116 + var value = getSnapshot2();
117 + if (!didWarnUncachedGetSnapshot) {
118 + var cachedValue = getSnapshot2();
119 + objectIs(value, cachedValue) || (console.error(
120 + "The result of getSnapshot should be cached to avoid an infinite loop"
121 + ), didWarnUncachedGetSnapshot = true);
122 + }
123 + cachedValue = useState21({
124 + inst: { value, getSnapshot: getSnapshot2 }
125 + });
126 + var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
127 + useLayoutEffect3(
128 + function() {
129 + inst.value = value;
130 + inst.getSnapshot = getSnapshot2;
131 + checkIfSnapshotChanged(inst) && forceUpdate({ inst });
132 + },
133 + [subscribe2, value, getSnapshot2]
134 + );
135 + useEffect14(
136 + function() {
137 + checkIfSnapshotChanged(inst) && forceUpdate({ inst });
138 + return subscribe2(function() {
139 + checkIfSnapshotChanged(inst) && forceUpdate({ inst });
140 + });
141 + },
142 + [subscribe2]
143 + );
144 + useDebugValue(value);
145 + return value;
146 + }
147 + function checkIfSnapshotChanged(inst) {
148 + var latestGetSnapshot = inst.getSnapshot;
149 + inst = inst.value;
150 + try {
151 + var nextValue = latestGetSnapshot();
152 + return !objectIs(inst, nextValue);
153 + } catch (error2) {
154 + return true;
155 + }
156 + }
157 + function useSyncExternalStore$1(subscribe2, getSnapshot2) {
158 + return getSnapshot2();
159 + }
160 + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
161 + var React51 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState21 = React51.useState, useEffect14 = React51.useEffect, useLayoutEffect3 = React51.useLayoutEffect, useDebugValue = React51.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
162 + exports.useSyncExternalStore = void 0 !== React51.useSyncExternalStore ? React51.useSyncExternalStore : shim;
163 + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
164 + })();
165 + }
166 + });
167 +
168 + // node_modules/use-sync-external-store/shim/index.js
169 + var require_shim = __commonJS({
170 + "node_modules/use-sync-external-store/shim/index.js"(exports, module) {
171 + "use strict";
172 + if (false) {
173 + module.exports = null;
174 + } else {
175 + module.exports = require_use_sync_external_store_shim_development();
176 + }
177 + }
178 + });
179 +
180 + // package-external:@wordpress/compose
181 + var require_compose = __commonJS({
182 + "package-external:@wordpress/compose"(exports, module) {
183 + module.exports = window.wp.compose;
184 + }
185 + });
186 +
98 187 // package-external:@wordpress/a11y
99 188 var require_a11y = __commonJS({
100 189 "package-external:@wordpress/a11y"(exports, module) {
101 190 module.exports = window.wp.a11y;
@@ -101,26 +190,26 @@
101 190 module.exports = window.wp.a11y;
102 191 }
103 192 });
104 193
105 - // package-external:@wordpress/data
106 - var require_data = __commonJS({
107 - "package-external:@wordpress/data"(exports, module) {
108 - module.exports = window.wp.data;
194 + // package-external:@wordpress/url
195 + var require_url = __commonJS({
196 + "package-external:@wordpress/url"(exports, module) {
197 + module.exports = window.wp.url;
109 198 }
110 199 });
111 200
112 - // package-external:@wordpress/compose
113 - var require_compose = __commonJS({
114 - "package-external:@wordpress/compose"(exports, module) {
115 - module.exports = window.wp.compose;
201 + // package-external:@wordpress/html-entities
202 + var require_html_entities = __commonJS({
203 + "package-external:@wordpress/html-entities"(exports, module) {
204 + module.exports = window.wp.htmlEntities;
116 205 }
117 206 });
118 207
119 - // package-external:@wordpress/private-apis
120 - var require_private_apis = __commonJS({
121 - "package-external:@wordpress/private-apis"(exports, module) {
122 - module.exports = window.wp.privateApis;
208 + // package-external:@wordpress/data
209 + var require_data = __commonJS({
210 + "package-external:@wordpress/data"(exports, module) {
211 + module.exports = window.wp.data;
123 212 }
124 213 });
125 214
126 215 // packages/format-library/build-module/index.mjs
@@ -133,13 +222,19 @@
133 222
134 223 // packages/icons/build-module/icon/index.mjs
135 224 var import_element = __toESM(require_element(), 1);
136 225 var icon_default = (0, import_element.forwardRef)(
137 - ({ icon, size = 24, ...props }, ref) => {
226 + ({ icon, size = 24, style, ...props }, ref) => {
227 + const intrinsicStyle = icon.props.style;
228 + const mergedStyle = intrinsicStyle || style ? { ...intrinsicStyle, ...style } : void 0;
138 229 return (0, import_element.cloneElement)(icon, {
139 230 width: size,
140 231 height: size,
141 232 ...props,
233 + // Merge styles so the icon's intrinsic style (e.g. `fill: none` on
234 + // stroke-based icons) is preserved unless the consumer overrides
235 + // the same property explicitly.
236 + ...mergedStyle ? { style: mergedStyle } : {},
142 237 ref
143 238 });
144 239 }
145 240 );
@@ -146,72 +241,107 @@
146 241
147 242 // packages/icons/build-module/library/button.mjs
148 243 var import_primitives = __toESM(require_primitives(), 1);
149 244 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
150 - var button_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z" }) });
245 + var button_default = /* @__PURE__ */ (0, import_jsx_runtime.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_runtime.jsx)(import_primitives.Path, { d: "M8 11.75H16M5 16.25H19C19.6904 16.25 20.25 15.6904 20.25 15V8.5C20.25 7.80964 19.6904 7.25 19 7.25H5C4.30964 7.25 3.75 7.80964 3.75 8.5V15C3.75 15.6904 4.30964 16.25 5 16.25Z", vectorEffect: "non-scaling-stroke" }) });
151 246
152 - // packages/icons/build-module/library/code.mjs
247 + // packages/icons/build-module/library/chevron-right.mjs
153 248 var import_primitives2 = __toESM(require_primitives(), 1);
154 249 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
155 - var code_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" }) });
250 + var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime2.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_runtime2.jsx)(import_primitives2.Path, { d: "M10 6.5L15 12L10 17.5", vectorEffect: "non-scaling-stroke" }) });
156 251
157 - // packages/icons/build-module/library/color.mjs
252 + // packages/icons/build-module/library/code.mjs
158 253 var import_primitives3 = __toESM(require_primitives(), 1);
159 254 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
160 - var color_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" }) });
255 + var code_default = /* @__PURE__ */ (0, import_jsx_runtime3.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_runtime3.jsx)(import_primitives3.Path, { d: "M7.99997 7L3.70708 11.2929C3.31655 11.6834 3.31655 12.3166 3.70708 12.7071L7.99997 17M16 17L20.2929 12.7071C20.6834 12.3166 20.6834 11.6834 20.2929 11.2929L16 7", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) });
161 256
162 - // packages/icons/build-module/library/format-bold.mjs
257 + // packages/icons/build-module/library/color.mjs
163 258 var import_primitives4 = __toESM(require_primitives(), 1);
164 259 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
165 - var format_bold_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z" }) });
260 + var color_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(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_runtime4.jsx)(import_primitives4.Path, { d: "M17.25 14C17.25 16.8995 14.8995 19.25 12 19.25C9.10051 19.25 6.75 16.8995 6.75 14C6.75 11.1005 10 7.37 12 5.12C14 7.37 17.25 11.1005 17.25 14Z", vectorEffect: "non-scaling-stroke" }) });
166 261
167 - // packages/icons/build-module/library/format-italic.mjs
262 + // packages/icons/build-module/library/error.mjs
168 263 var import_primitives5 = __toESM(require_primitives(), 1);
169 264 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
170 - var format_italic_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "M12.5 5L10 19h1.9l2.5-14z" }) });
265 + var error_default = /* @__PURE__ */ (0, import_jsx_runtime5.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_runtime5.jsx)(import_primitives5.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" }) });
171 266
172 - // packages/icons/build-module/library/format-strikethrough.mjs
267 + // packages/icons/build-module/library/format-bold.mjs
173 268 var import_primitives6 = __toESM(require_primitives(), 1);
174 269 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
175 - var format_strikethrough_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z" }) });
270 + var format_bold_default = /* @__PURE__ */ (0, import_jsx_runtime6.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_runtime6.jsx)(import_primitives6.Path, { d: "M13 11.5H7.75M13 11.5L13.7412 11.6059C15.3242 11.832 16.5 13.1877 16.5 14.7868C16.5 16.5614 15.0614 18 13.2868 18H7.75C7.75 18 7.75 14.9338 7.75 11.5M13 11.5L13.2913 11.4417C14.5756 11.1849 15.5 10.0573 15.5 8.74755C15.5 7.23012 14.2699 6 12.7525 6H7.75C7.75 7.65199 7.75 9.63049 7.75 11.5", vectorEffect: "non-scaling-stroke" }) });
176 271
177 - // packages/icons/build-module/library/help.mjs
272 + // packages/icons/build-module/library/format-italic.mjs
178 273 var import_primitives7 = __toESM(require_primitives(), 1);
179 274 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
180 - var help_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M12 4a8 8 0 1 1 .001 16.001A8 8 0 0 1 12 4Zm0 1.5a6.5 6.5 0 1 0-.001 13.001A6.5 6.5 0 0 0 12 5.5Zm.75 11h-1.5V15h1.5v1.5Zm-.445-9.234a3 3 0 0 1 .445 5.89V14h-1.5v-1.25c0-.57.452-.958.917-1.01A1.5 1.5 0 0 0 12 8.75a1.5 1.5 0 0 0-1.5 1.5H9a3 3 0 0 1 3.305-2.984Z" }) });
275 + var format_italic_default = /* @__PURE__ */ (0, import_jsx_runtime7.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_runtime7.jsx)(import_primitives7.Path, { d: "M11 19L13.5 5", vectorEffect: "non-scaling-stroke" }) });
181 276
182 - // packages/icons/build-module/library/language.mjs
277 + // packages/icons/build-module/library/format-strikethrough.mjs
183 278 var import_primitives8 = __toESM(require_primitives(), 1);
184 279 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
185 - var language_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.Path, { d: "M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z" }) });
280 + var format_strikethrough_default = /* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsx)(import_primitives8.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" }) });
186 281
187 - // packages/icons/build-module/library/link.mjs
282 + // packages/icons/build-module/library/help.mjs
188 283 var import_primitives9 = __toESM(require_primitives(), 1);
189 284 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
190 - var link_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) });
285 + var help_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
286 + /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M9.75 10.25C9.75 9.00736 10.7574 8 12 8C13.2426 8 14.25 9.00736 14.25 10.25C14.25 11.4083 13.3748 12.3621 12.2496 12.4863C12.1124 12.5015 12 12.6119 12 12.75V14M12 15V16.5", vectorEffect: "non-scaling-stroke" }),
287 + /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M19.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" })
288 + ] });
191 289
192 - // packages/icons/build-module/library/math.mjs
290 + // packages/icons/build-module/library/inline-image.mjs
193 291 var import_primitives10 = __toESM(require_primitives(), 1);
194 292 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
195 - var math_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.Path, { d: "M11.2 6.8c-.7 0-1.4.5-1.6 1.1l-2.8 7.5-1.2-1.8c-.1-.2-.4-.3-.6-.3H3v1.5h1.6l1.2 1.8c.6.9 1.9.7 2.2-.3l2.9-7.9s.1-.2.2-.2h7.8V6.7h-7.8Zm5.3 3.4-1.9 1.9-1.9-1.9-1.1 1.1 1.9 1.9-1.9 1.9 1.1 1.1 1.9-1.9 1.9 1.9 1.1-1.1-1.9-1.9 1.9-1.9-1.1-1.1Z" }) });
293 + var inline_image_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(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_runtime10.jsx)(import_primitives10.Path, { d: "M13.25 11.3197L11.4155 9.48453C11.3765 9.44547 11.3132 9.44546 11.2741 9.48452L9.05837 11.7003C9.02448 11.7341 8.97132 11.7392 8.93163 11.7124L7.0648 10.4495C7.03003 10.426 6.98426 10.4267 6.95022 10.4513L4.75 12.0405M13.25 11.3197V7C13.25 6.30964 12.6904 5.75 12 5.75H6C5.30964 5.75 4.75 6.30965 4.75 7V12.0405M13.25 11.3197V13C13.25 13.6904 12.6904 14.25 12 14.25H6C5.30964 14.25 4.75 13.6904 4.75 13V12.0405M16 14H20M4 18H20", vectorEffect: "non-scaling-stroke" }) });
196 294
197 - // packages/icons/build-module/library/subscript.mjs
295 + // packages/icons/build-module/library/language.mjs
198 296 var import_primitives11 = __toESM(require_primitives(), 1);
199 297 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
200 - var subscript_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z" }) });
298 + var language_default = /* @__PURE__ */ (0, import_jsx_runtime11.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: [
299 + /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M3 6H9.5M16 6H13.5M9.5 6V3M9.5 6H13.5M13.5 6C13.0477 7.24386 11.7361 9.79194 9.44037 12.5512M5.5 16.5C7.04336 15.2139 8.35238 13.8588 9.44037 12.5512M6.5 8C6.9232 8.9522 7.93743 10.7507 9.44037 12.5512M12.5 15.5C11.3314 14.6235 10.305 13.587 9.44037 12.5512", vectorEffect: "non-scaling-stroke" }),
300 + /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M13.75 20V19.75L14.6667 17M14.6667 17L16.75 10.75H17.25L19.3333 17L20.25 19.75V20M19.3333 17H14.6667", vectorEffect: "non-scaling-stroke" })
301 + ] });
201 302
202 - // packages/icons/build-module/library/superscript.mjs
303 + // packages/icons/build-module/library/link.mjs
203 304 var import_primitives12 = __toESM(require_primitives(), 1);
204 305 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
205 - var superscript_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z" }) });
306 + var link_default = /* @__PURE__ */ (0, import_jsx_runtime12.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_runtime12.jsx)(import_primitives12.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" }) });
206 307
207 - // packages/icons/build-module/library/text-color.mjs
308 + // packages/icons/build-module/library/math.mjs
208 309 var import_primitives13 = __toESM(require_primitives(), 1);
209 310 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
210 - var text_color_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.Path, { d: "M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z" }) });
311 + var math_default = /* @__PURE__ */ (0, import_jsx_runtime13.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_runtime13.jsx)(import_primitives13.Path, { d: "M3 14H5L6.8916 16.3645C6.93974 16.4247 7.03496 16.4101 7.06289 16.3383L10.2521 8.13755C10.4015 7.75318 10.7717 7.5 11.1841 7.5H19M17 11L14.5 13.5M12 16L14.5 13.5M14.5 13.5L17 16M14.5 13.5L12 11", vectorEffect: "non-scaling-stroke" }) });
211 312
313 + // packages/icons/build-module/library/published.mjs
314 + var import_primitives14 = __toESM(require_primitives(), 1);
315 + var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
316 + var published_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
317 + /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.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" }),
318 + /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M9 12L11 14L15 10", vectorEffect: "non-scaling-stroke" })
319 + ] });
320 +
321 + // packages/icons/build-module/library/subscript.mjs
322 + var import_primitives15 = __toESM(require_primitives(), 1);
323 + var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
324 + var subscript_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
325 + /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M17.75 18.5988H15.75C15.75 16.5322 17.75 17.0489 17.75 15.4989C17.75 14.7239 16.75 14.0738 15.75 14.8488", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }),
326 + /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M10 12L13 7.4V7M10 12L7 7.4L7.00004 7M10 12L7 16.6V17M10 12L13 16.6V17", vectorEffect: "non-scaling-stroke" })
327 + ] });
328 +
329 + // packages/icons/build-module/library/superscript.mjs
330 + var import_primitives16 = __toESM(require_primitives(), 1);
331 + var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
332 + var superscript_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
333 + /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.Path, { d: "M17.75 8.59884H15.75C15.75 6.53219 17.75 7.04885 17.75 5.49887C17.75 4.72388 16.75 4.07384 15.75 4.84884", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }),
334 + /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.Path, { d: "M10 12L13 7.4V7M10 12L7 7.4L7.00004 7M10 12L7 16.6V17M10 12L13 16.6V17", vectorEffect: "non-scaling-stroke" })
335 + ] });
336 +
337 + // packages/icons/build-module/library/text-color.mjs
338 + var import_primitives17 = __toESM(require_primitives(), 1);
339 + var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
340 + var text_color_default = /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)(import_primitives17.Path, { d: "M8 17.5V17.223L9.01577 14.1757M9.01577 14.1757L11.3243 7.25H11.8784L14.1869 14.1757L15.2027 17.223V17.5M14.1869 14.1757H9.01577", vectorEffect: "non-scaling-stroke" }) });
341 +
212 342 // packages/format-library/build-module/bold/index.mjs
213 - var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
343 + var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
214 344 var name = "core/bold";
215 345 var title = (0, import_i18n.__)("Bold");
216 346 var bold = {
217 347 name,
@@ -217,18 +347,24 @@
217 347 name,
218 348 title,
219 349 tagName: "strong",
220 350 className: null,
221 - edit({ isActive, value, onChange, onFocus, isVisible = true }) {
351 + edit({
352 + isActive,
353 + value,
354 + onChange,
355 + onFocus,
356 + isVisible = true
357 + }) {
222 358 function onToggle() {
223 359 onChange((0, import_rich_text.toggleFormat)(value, { type: name, title }));
224 360 }
225 361 function onClick() {
226 - onChange((0, import_rich_text.toggleFormat)(value, { type: name }));
362 + onChange((0, import_rich_text.toggleFormat)(value, { type: name, title }));
227 363 onFocus();
228 364 }
229 - return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
230 - /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
365 + return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
366 + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
231 367 import_block_editor.RichTextShortcut,
232 368 {
233 369 type: "primary",
234 370 character: "b",
@@ -234,9 +370,9 @@
234 370 character: "b",
235 371 onUse: onToggle
236 372 }
237 373 ),
238 - isVisible && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
374 + isVisible && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
239 375 import_block_editor.RichTextToolbarButton,
240 376 {
241 377 name: "bold",
242 378 icon: format_bold_default,
@@ -246,9 +382,9 @@
246 382 shortcutType: "primary",
247 383 shortcutCharacter: "b"
248 384 }
249 385 ),
250 - /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
386 + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
251 387 import_block_editor.__unstableRichTextInputEvent,
252 388 {
253 389 inputType: "formatBold",
254 390 onInput: onToggle
@@ -261,9 +397,9 @@
261 397 // packages/format-library/build-module/code/index.mjs
262 398 var import_i18n2 = __toESM(require_i18n(), 1);
263 399 var import_rich_text2 = __toESM(require_rich_text(), 1);
264 400 var import_block_editor2 = __toESM(require_block_editor(), 1);
265 - var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
401 + var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
266 402 var name2 = "core/code";
267 403 var title2 = (0, import_i18n2.__)("Inline code");
268 404 var code = {
269 405 name: name2,
@@ -293,15 +429,20 @@
293 429 value = (0, import_rich_text2.remove)(value, endIndex, endIndex + 1);
294 430 value = (0, import_rich_text2.applyFormat)(value, { type: name2 }, startIndex, endIndex);
295 431 return value;
296 432 },
297 - edit({ value, onChange, onFocus, isActive }) {
433 + edit({
434 + value,
435 + onChange,
436 + onFocus,
437 + isActive
438 + }) {
298 439 function onClick() {
299 440 onChange((0, import_rich_text2.toggleFormat)(value, { type: name2, title: title2 }));
300 441 onFocus();
301 442 }
302 - return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
303 - /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
443 + return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
444 + /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
304 445 import_block_editor2.RichTextShortcut,
305 446 {
306 447 type: "access",
307 448 character: "x",
@@ -307,9 +448,9 @@
307 448 character: "x",
308 449 onUse: onClick
309 450 }
310 451 ),
311 - /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
452 + /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
312 453 import_block_editor2.RichTextToolbarButton,
313 454 {
314 455 icon: code_default,
315 456 title: title2,
@@ -323,16 +464,6936 @@
323 464 };
324 465
325 466 // packages/format-library/build-module/image/index.mjs
326 467 var import_components = __toESM(require_components(), 1);
468 +
469 + // node_modules/clsx/dist/clsx.mjs
470 + function r(e) {
471 + var t, f, n = "";
472 + if ("string" == typeof e || "number" == typeof e) n += e;
473 + else if ("object" == typeof e) if (Array.isArray(e)) {
474 + var o = e.length;
475 + for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
476 + } else for (f in e) e[f] && (n && (n += " "), n += f);
477 + return n;
478 + }
479 + function clsx() {
480 + for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
481 + return n;
482 + }
483 + var clsx_default = clsx;
484 +
485 + // node_modules/@base-ui/utils/useControlled.mjs
486 + var React = __toESM(require_react(), 1);
487 +
488 + // node_modules/@base-ui/utils/createLogOnce.mjs
489 + var loggedMessages;
490 + if (true) {
491 + loggedMessages = /* @__PURE__ */ new Set();
492 + }
493 + function createLogOnce(severity, prefix) {
494 + return function logOnce(...messages) {
495 + if (true) {
496 + const message = messages.join(" ");
497 + const output = prefix ? `${prefix}: ${message}` : message;
498 + const key = `${severity}:${output}`;
499 + if (!loggedMessages.has(key)) {
500 + loggedMessages.add(key);
501 + if (severity === "warn") {
502 + console.warn(output);
503 + } else {
504 + console.error(output);
505 + }
506 + }
507 + }
508 + };
509 + }
510 +
511 + // node_modules/@base-ui/utils/error.mjs
512 + var error = createLogOnce("error", "Base UI");
513 +
514 + // node_modules/@base-ui/utils/useControlled.mjs
515 + function useControlled({
516 + controlled,
517 + default: defaultProp,
518 + name: name16,
519 + state = "value"
520 + }) {
521 + const {
522 + current: isControlled
523 + } = React.useRef(controlled !== void 0);
524 + const [valueState, setValue] = React.useState(defaultProp);
525 + const value = isControlled && controlled !== void 0 ? controlled : valueState;
526 + if (true) {
527 + React.useEffect(() => {
528 + if (isControlled !== (controlled !== void 0)) {
529 + error([`A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name16} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name16} 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"));
530 + }
531 + }, [state, name16, controlled]);
532 + const {
533 + current: defaultValue
534 + } = React.useRef(defaultProp);
535 + React.useEffect(() => {
536 + if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) {
537 + error([`A component is changing the default ${state} state of an uncontrolled ${name16} after being initialized. To suppress this warning opt to use a controlled ${name16}.`].join("\n"));
538 + }
539 + }, [defaultProp]);
540 + }
541 + const setValueIfUncontrolled = React.useCallback((newValue) => {
542 + if (!isControlled) {
543 + setValue(newValue);
544 + }
545 + }, []);
546 + return [value, setValueIfUncontrolled];
547 + }
548 + function serializeToDevModeString(input) {
549 + let nextId = 0;
550 + const seen = /* @__PURE__ */ new WeakMap();
551 + try {
552 + const result = JSON.stringify(input, function replacer(key, value) {
553 + if (key === "_owner" && this != null && typeof this === "object" && "$$typeof" in this) {
554 + return void 0;
555 + }
556 + if (typeof value === "bigint") {
557 + return `__bigint__:${value}`;
558 + }
559 + if (value !== null && typeof value === "object") {
560 + const id = seen.get(value);
561 + if (id !== void 0) {
562 + return `__object__:${id}`;
563 + }
564 + seen.set(value, nextId);
565 + nextId += 1;
566 + }
567 + return value;
568 + });
569 + return result ?? `__top__:${typeof input}`;
570 + } catch {
571 + return "__unserializable__";
572 + }
573 + }
574 +
575 + // node_modules/@base-ui/utils/safeReact.mjs
576 + var React2 = __toESM(require_react(), 1);
577 + var SafeReact = {
578 + ...React2
579 + };
580 +
581 + // node_modules/@base-ui/utils/useRefWithInit.mjs
582 + var React3 = __toESM(require_react(), 1);
583 + var UNINITIALIZED = {};
584 + function useRefWithInit(init, initArg) {
585 + const ref = React3.useRef(UNINITIALIZED);
586 + if (ref.current === UNINITIALIZED) {
587 + ref.current = init(initArg);
588 + }
589 + return ref;
590 + }
591 +
592 + // node_modules/@base-ui/utils/useStableCallback.mjs
593 + var useInsertionEffect = SafeReact.useInsertionEffect;
594 + var useSafeInsertionEffect = (
595 + // React 17 doesn't have useInsertionEffect.
596 + useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
597 + useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn()
598 + );
599 + function useStableCallback(callback) {
600 + const stable = useRefWithInit(createStableCallback).current;
601 + stable.next = callback;
602 + useSafeInsertionEffect(stable.effect);
603 + return stable.trampoline;
604 + }
605 + function createStableCallback() {
606 + const stable = {
607 + next: void 0,
608 + callback: assertNotCalled,
609 + trampoline: (...args) => stable.callback?.(...args),
610 + effect: () => {
611 + stable.callback = stable.next;
612 + }
613 + };
614 + return stable;
615 + }
616 + function assertNotCalled() {
617 + if (true) {
618 + throw (
619 + /* minify-error-disabled */
620 + new Error("Base UI: Cannot call an event handler while rendering.")
621 + );
622 + }
623 + }
624 +
625 + // node_modules/@base-ui/utils/warn.mjs
626 + var warn = createLogOnce("warn", "Base UI");
627 +
628 + // node_modules/@base-ui/utils/empty.mjs
629 + function NOOP() {
630 + }
631 + var EMPTY_ARRAY = Object.freeze([]);
632 + var EMPTY_OBJECT = Object.freeze({});
633 +
634 + // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
635 + var React6 = __toESM(require_react(), 1);
636 +
637 + // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs
638 + var React4 = __toESM(require_react(), 1);
639 + var noop = () => {
640 + };
641 + var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop;
642 +
643 + // node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs
644 + var React5 = __toESM(require_react(), 1);
645 + var CompositeListContext = /* @__PURE__ */ React5.createContext({
646 + register: () => {
647 + },
648 + unregister: () => {
649 + },
650 + subscribeMapChange: () => () => {
651 + },
652 + nextIndexRef: {
653 + current: 0
654 + }
655 + });
656 + if (true) CompositeListContext.displayName = "CompositeListContext";
657 + function useCompositeListContext() {
658 + return React5.useContext(CompositeListContext);
659 + }
660 +
661 + // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
662 + var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
663 + function CompositeList(props) {
664 + const {
665 + children,
666 + elementsRef,
667 + labelsRef,
668 + onMapChange: onMapChangeProp
669 + } = props;
670 + const onMapChange = useStableCallback(onMapChangeProp);
671 + const [, setMapTick] = React6.useState(false);
672 + const listeners = useRefWithInit(createListeners).current;
673 + const map = useRefWithInit(createMap).current;
674 + const nextIndexRef = React6.useRef(0);
675 + const isDirtyRef = React6.useRef(true);
676 + const itemsRef = React6.useRef(null);
677 + const mutationObserverRef = React6.useRef(null);
678 + const scheduleMapUpdate = useStableCallback(() => {
679 + if (isDirtyRef.current) {
680 + return;
681 + }
682 + isDirtyRef.current = true;
683 + setMapTick((tick) => !tick);
684 + });
685 + const register = useStableCallback((node, registration) => {
686 + map.set(node, registration);
687 + scheduleMapUpdate();
688 + });
689 + const unregister = useStableCallback((node) => {
690 + map.delete(node);
691 + scheduleMapUpdate();
692 + });
693 + const syncRefs = useStableCallback((items) => {
694 + const nextMap = /* @__PURE__ */ new Map();
695 + elementsRef.current.length = 0;
696 + if (labelsRef) {
697 + labelsRef.current.length = 0;
698 + }
699 + items.forEach((item) => {
700 + nextMap.set(item.element, {
701 + ...item.registration.metadata ?? {},
702 + index: item.index
703 + });
704 + elementsRef.current[item.index] = item.element;
705 + if (labelsRef) {
706 + labelsRef.current[item.index] = item.registration.label !== void 0 ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent;
707 + }
708 + });
709 + nextIndexRef.current = elementsRef.current.length;
710 + return nextMap;
711 + });
712 + function observe(sortedNodes) {
713 + mutationObserverRef.current?.disconnect();
714 + mutationObserverRef.current = null;
715 + if (typeof MutationObserver !== "function" || sortedNodes.length < 2) {
716 + return;
717 + }
718 + const mutationObserver = new MutationObserver((entries) => {
719 + if (!hasMovedNode(entries)) {
720 + return;
721 + }
722 + let previousConnectedNode = null;
723 + for (const node of sortedNodes) {
724 + if (!node.isConnected) {
725 + continue;
726 + }
727 + if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) {
728 + mutationObserver.disconnect();
729 + scheduleMapUpdate();
730 + return;
731 + }
732 + previousConnectedNode = node;
733 + }
734 + });
735 + mutationObserverRef.current = mutationObserver;
736 + const roots = /* @__PURE__ */ new Set();
737 + for (let i = 1; i < sortedNodes.length; i += 1) {
738 + const root = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]);
739 + if (root) {
740 + roots.add(root);
741 + }
742 + }
743 + roots.forEach((root) => mutationObserver.observe(root, {
744 + childList: true
745 + }));
746 + }
747 + const flush = useStableCallback(() => {
748 + const [items, automaticNodes] = getCompositeListSnapshot(map);
749 + const nextMap = syncRefs(items);
750 + const previousItems = itemsRef.current;
751 + const changed = !previousItems || previousItems.length !== items.length || items.some((item, index2) => {
752 + const previousItem = previousItems[index2];
753 + return item.index !== previousItem.index || item.element !== previousItem.element || item.registration.index !== previousItem.registration.index || item.registration.metadata !== previousItem.registration.metadata;
754 + });
755 + observe(automaticNodes);
756 + itemsRef.current = items;
757 + isDirtyRef.current = false;
758 + if (!changed) {
759 + return;
760 + }
761 + listeners.forEach((listener) => listener(nextMap));
762 + onMapChange(nextMap);
763 + });
764 + useIsoLayoutEffect(() => {
765 + if (!isDirtyRef.current && itemsRef.current) {
766 + syncRefs(itemsRef.current);
767 + }
768 + return () => {
769 + elementsRef.current = [];
770 + if (labelsRef) {
771 + labelsRef.current = [];
772 + }
773 + };
774 + }, [elementsRef, labelsRef, syncRefs]);
775 + useIsoLayoutEffect(() => {
776 + if (isDirtyRef.current) {
777 + flush();
778 + }
779 + });
780 + useIsoLayoutEffect(() => {
781 + return () => {
782 + mutationObserverRef.current?.disconnect();
783 + isDirtyRef.current = true;
784 + };
785 + }, []);
786 + const subscribeMapChange = useStableCallback((fn) => {
787 + listeners.add(fn);
788 + return () => {
789 + listeners.delete(fn);
790 + };
791 + });
792 + const contextValue = React6.useMemo(() => ({
793 + register,
794 + unregister,
795 + subscribeMapChange,
796 + nextIndexRef
797 + }), [register, unregister, subscribeMapChange, nextIndexRef]);
798 + return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CompositeListContext.Provider, {
799 + value: contextValue,
800 + children
801 + });
802 + }
803 + function createMap() {
804 + return /* @__PURE__ */ new Map();
805 + }
806 + function createListeners() {
807 + return /* @__PURE__ */ new Set();
808 + }
809 + function getCompositeListSnapshot(map) {
810 + const reservedIndices = /* @__PURE__ */ new Set();
811 + const items = [];
812 + const automaticItems = [];
813 + map.forEach((registration, node) => {
814 + if (!node.isConnected) {
815 + return;
816 + }
817 + const index2 = registration.index;
818 + const item = {
819 + index: index2 ?? -1,
820 + element: node,
821 + registration
822 + };
823 + if (index2 === null) {
824 + automaticItems.push(item);
825 + } else if (index2 >= 0) {
826 + reservedIndices.add(index2);
827 + items.push(item);
828 + }
829 + });
830 + let nextAutomaticIndex = 0;
831 + automaticItems.sort((a, b) => sortByDocumentPosition(a.element, b.element));
832 + automaticItems.forEach((item) => {
833 + while (reservedIndices.has(nextAutomaticIndex)) {
834 + nextAutomaticIndex += 1;
835 + }
836 + item.index = nextAutomaticIndex;
837 + items.push(item);
838 + nextAutomaticIndex += 1;
839 + });
840 + if (reservedIndices.size > 0) {
841 + items.sort((a, b) => a.index - b.index);
842 + }
843 + return [items, automaticItems.map((item) => item.element)];
844 + }
845 + function getCommonAncestor(firstNode, lastNode) {
846 + let ancestor = firstNode.parentElement;
847 + while (ancestor && !ancestor.contains(lastNode)) {
848 + ancestor = ancestor.parentElement;
849 + }
850 + return ancestor;
851 + }
852 + function hasMovedNode(entries) {
853 + for (const entry of entries) {
854 + for (let i = 0; i < entry.removedNodes.length; i += 1) {
855 + if (entry.removedNodes[i].isConnected) {
856 + return true;
857 + }
858 + }
859 + }
860 + return false;
861 + }
862 + function sortByDocumentPosition(a, b) {
863 + return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
864 + }
865 +
866 + // node_modules/@base-ui/react/internals/useRenderElement.mjs
867 + var React9 = __toESM(require_react(), 1);
868 +
869 + // node_modules/@base-ui/utils/useMergedRefs.mjs
870 + function useMergedRefs(a, b, c, d) {
871 + const forkRef = useRefWithInit(createForkRef).current;
872 + if (didChange(forkRef, a, b, c, d)) {
873 + update(forkRef, [a, b, c, d]);
874 + }
875 + return forkRef.callback;
876 + }
877 + function useMergedRefsN(refs) {
878 + const forkRef = useRefWithInit(createForkRef).current;
879 + if (didChangeN(forkRef, refs)) {
880 + update(forkRef, refs);
881 + }
882 + return forkRef.callback;
883 + }
884 + function createForkRef() {
885 + return {
886 + callback: null,
887 + cleanup: null,
888 + refs: []
889 + };
890 + }
891 + function didChange(forkRef, a, b, c, d) {
892 + return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
893 + }
894 + function didChangeN(forkRef, newRefs) {
895 + return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]);
896 + }
897 + function update(forkRef, refs) {
898 + forkRef.refs = refs;
899 + if (refs.every((ref) => ref == null)) {
900 + forkRef.callback = null;
901 + return;
902 + }
903 + forkRef.callback = (instance) => {
904 + if (forkRef.cleanup) {
905 + forkRef.cleanup();
906 + forkRef.cleanup = null;
907 + }
908 + if (instance != null) {
909 + const cleanupCallbacks = Array(refs.length).fill(null);
910 + for (let i = 0; i < refs.length; i += 1) {
911 + const ref = refs[i];
912 + if (ref == null) {
913 + continue;
914 + }
915 + switch (typeof ref) {
916 + case "function": {
917 + const refCleanup = ref(instance);
918 + if (typeof refCleanup === "function") {
919 + cleanupCallbacks[i] = refCleanup;
920 + }
921 + break;
922 + }
923 + case "object": {
924 + ref.current = instance;
925 + break;
926 + }
927 + default:
928 + }
929 + }
930 + forkRef.cleanup = () => {
931 + for (let i = 0; i < refs.length; i += 1) {
932 + const ref = refs[i];
933 + if (ref == null) {
934 + continue;
935 + }
936 + switch (typeof ref) {
937 + case "function": {
938 + const cleanupCallback = cleanupCallbacks[i];
939 + if (typeof cleanupCallback === "function") {
940 + cleanupCallback();
941 + } else {
942 + void ref(null);
943 + }
944 + break;
945 + }
946 + case "object": {
947 + ref.current = null;
948 + break;
949 + }
950 + default:
951 + }
952 + }
953 + };
954 + }
955 + };
956 + }
957 +
958 + // node_modules/@base-ui/utils/getReactElementRef.mjs
959 + var React8 = __toESM(require_react(), 1);
960 +
961 + // node_modules/@base-ui/utils/reactVersion.mjs
962 + var React7 = __toESM(require_react(), 1);
963 + var majorVersion = parseInt(React7.version, 10);
964 + function isReactVersionAtLeast(reactVersionToCheck) {
965 + return majorVersion >= reactVersionToCheck;
966 + }
967 +
968 + // node_modules/@base-ui/utils/getReactElementRef.mjs
969 + function getReactElementRef(element) {
970 + if (!/* @__PURE__ */ React8.isValidElement(element)) {
971 + return null;
972 + }
973 + const reactElement = element;
974 + const propsWithRef = reactElement.props;
975 + return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
976 + }
977 +
978 + // node_modules/@base-ui/utils/mergeObjects.mjs
979 + function mergeObjects(a, b) {
980 + if (a && !b) {
981 + return a;
982 + }
983 + if (!a && b) {
984 + return b;
985 + }
986 + if (a || b) {
987 + return {
988 + ...a,
989 + ...b
990 + };
991 + }
992 + return void 0;
993 + }
994 +
995 + // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
996 + function getStateAttributesProps(state, customMapping) {
997 + const props = {};
998 + for (const key in state) {
999 + const value = state[key];
1000 + if (customMapping?.hasOwnProperty(key)) {
1001 + const customProps = customMapping[key](value);
1002 + if (customProps != null) {
1003 + Object.assign(props, customProps);
1004 + }
1005 + continue;
1006 + }
1007 + if (value === true) {
1008 + props[`data-${key.toLowerCase()}`] = "";
1009 + } else if (value) {
1010 + props[`data-${key.toLowerCase()}`] = value.toString();
1011 + }
1012 + }
1013 + return props;
1014 + }
1015 +
1016 + // node_modules/@base-ui/react/utils/resolveClassName.mjs
1017 + function resolveClassName(className, state) {
1018 + return typeof className === "function" ? className(state) : className;
1019 + }
1020 +
1021 + // node_modules/@base-ui/react/utils/resolveStyle.mjs
1022 + function resolveStyle(style, state) {
1023 + return typeof style === "function" ? style(state) : style;
1024 + }
1025 +
1026 + // node_modules/@base-ui/react/merge-props/mergeProps.mjs
1027 + var EMPTY_PROPS = {};
1028 + function mergeProps(a, b, c, d, e) {
1029 + if (!c && !d && !e && !a) {
1030 + return createInitialMergedProps(b);
1031 + }
1032 + let merged = createInitialMergedProps(a);
1033 + if (b) {
1034 + merged = mergeInto(merged, b);
1035 + }
1036 + if (c) {
1037 + merged = mergeInto(merged, c);
1038 + }
1039 + if (d) {
1040 + merged = mergeInto(merged, d);
1041 + }
1042 + if (e) {
1043 + merged = mergeInto(merged, e);
1044 + }
1045 + return merged;
1046 + }
1047 + function mergePropsN(props) {
1048 + if (props.length === 0) {
1049 + return EMPTY_PROPS;
1050 + }
1051 + if (props.length === 1) {
1052 + return createInitialMergedProps(props[0]);
1053 + }
1054 + let merged = createInitialMergedProps(props[0]);
1055 + for (let i = 1; i < props.length; i += 1) {
1056 + merged = mergeInto(merged, props[i]);
1057 + }
1058 + return merged;
1059 + }
1060 + function createInitialMergedProps(inputProps) {
1061 + if (isPropsGetter(inputProps)) {
1062 + return {
1063 + ...resolvePropsGetter(inputProps, EMPTY_PROPS)
1064 + };
1065 + }
1066 + return copyInitialProps(inputProps);
1067 + }
1068 + function mergeInto(merged, inputProps) {
1069 + if (isPropsGetter(inputProps)) {
1070 + return resolvePropsGetter(inputProps, merged);
1071 + }
1072 + return mutablyMergeInto(merged, inputProps);
1073 + }
1074 + function copyInitialProps(inputProps) {
1075 + const copiedProps = {
1076 + ...inputProps
1077 + };
1078 + for (const propName in copiedProps) {
1079 + const propValue = copiedProps[propName];
1080 + if (isEventHandler(propName, propValue)) {
1081 + copiedProps[propName] = wrapEventHandler(propValue);
1082 + }
1083 + }
1084 + return copiedProps;
1085 + }
1086 + function mutablyMergeInto(mergedProps, externalProps) {
1087 + if (!externalProps) {
1088 + return mergedProps;
1089 + }
1090 + for (const propName in externalProps) {
1091 + const externalPropValue = externalProps[propName];
1092 + switch (propName) {
1093 + case "style": {
1094 + mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
1095 + break;
1096 + }
1097 + case "className": {
1098 + mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
1099 + break;
1100 + }
1101 + default: {
1102 + if (isEventHandler(propName, externalPropValue)) {
1103 + mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
1104 + } else {
1105 + mergedProps[propName] = externalPropValue;
1106 + }
1107 + }
1108 + }
1109 + }
1110 + return mergedProps;
1111 + }
1112 + function isEventHandler(key, value) {
1113 + const code0 = key.charCodeAt(0);
1114 + const code1 = key.charCodeAt(1);
1115 + const code2 = key.charCodeAt(2);
1116 + return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
1117 + }
1118 + function isPropsGetter(inputProps) {
1119 + return typeof inputProps === "function";
1120 + }
1121 + function resolvePropsGetter(inputProps, previousProps) {
1122 + if (isPropsGetter(inputProps)) {
1123 + return inputProps(previousProps);
1124 + }
1125 + return inputProps ?? EMPTY_PROPS;
1126 + }
1127 + function mergeEventHandlers(ourHandler, theirHandler) {
1128 + if (!theirHandler) {
1129 + return ourHandler;
1130 + }
1131 + if (!ourHandler) {
1132 + return wrapEventHandler(theirHandler);
1133 + }
1134 + return (...args) => {
1135 + const event = args[0];
1136 + if (isSyntheticEvent(event)) {
1137 + const baseUIEvent = event;
1138 + makeEventPreventable(baseUIEvent);
1139 + const result2 = theirHandler(...args);
1140 + if (!baseUIEvent.baseUIHandlerPrevented) {
1141 + ourHandler?.(...args);
1142 + }
1143 + return result2;
1144 + }
1145 + const result = theirHandler(...args);
1146 + ourHandler?.(...args);
1147 + return result;
1148 + };
1149 + }
1150 + function wrapEventHandler(handler) {
1151 + if (!handler) {
1152 + return handler;
1153 + }
1154 + return (...args) => {
1155 + const event = args[0];
1156 + if (isSyntheticEvent(event)) {
1157 + makeEventPreventable(event);
1158 + }
1159 + return handler(...args);
1160 + };
1161 + }
1162 + function makeEventPreventable(event) {
1163 + event.preventBaseUIHandler = () => {
1164 + event.baseUIHandlerPrevented = true;
1165 + };
1166 + return event;
1167 + }
1168 + function mergeClassNames(ourClassName, theirClassName) {
1169 + if (theirClassName) {
1170 + if (ourClassName) {
1171 + return theirClassName + " " + ourClassName;
1172 + }
1173 + return theirClassName;
1174 + }
1175 + return ourClassName;
1176 + }
1177 + function isSyntheticEvent(event) {
1178 + return event != null && typeof event === "object" && "nativeEvent" in event;
1179 + }
1180 +
1181 + // node_modules/@base-ui/react/internals/useRenderElement.mjs
1182 + var import_react = __toESM(require_react(), 1);
1183 + function useRenderElement(element, componentProps, params = {}) {
1184 + let renderProp = componentProps.render;
1185 + if (params.enabled !== false) {
1186 + renderProp = unwrapLazyRenderProp(renderProp);
1187 + }
1188 + const outProps = useRenderElementProps(componentProps, params, renderProp);
1189 + if (params.enabled === false) {
1190 + return null;
1191 + }
1192 + const state = params.state ?? EMPTY_OBJECT;
1193 + return evaluateRenderProp(element, renderProp, outProps, state);
1194 + }
1195 + function useRenderElementProps(componentProps, params, renderProp) {
1196 + const {
1197 + className: classNameProp,
1198 + style: styleProp
1199 + } = componentProps;
1200 + const {
1201 + state = EMPTY_OBJECT,
1202 + ref,
1203 + props,
1204 + stateAttributesMapping: stateAttributesMapping4,
1205 + enabled = true
1206 + } = params;
1207 + const className = enabled ? resolveClassName(classNameProp, state) : void 0;
1208 + const style = enabled ? resolveStyle(styleProp, state) : void 0;
1209 + const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping4) : EMPTY_OBJECT;
1210 + const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
1211 + const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
1212 + if (typeof document !== "undefined") {
1213 + if (!enabled) {
1214 + void useMergedRefs(null, null);
1215 + } else if (Array.isArray(ref)) {
1216 + outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
1217 + } else {
1218 + outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
1219 + }
1220 + }
1221 + if (!enabled) {
1222 + return EMPTY_OBJECT;
1223 + }
1224 + if (className !== void 0) {
1225 + outProps.className = mergeClassNames(outProps.className, className);
1226 + }
1227 + if (style !== void 0) {
1228 + outProps.style = mergeObjects(outProps.style, style);
1229 + }
1230 + return outProps;
1231 + }
1232 + function resolveRenderFunctionProps(props) {
1233 + if (Array.isArray(props)) {
1234 + return mergePropsN(props);
1235 + }
1236 + return mergeProps(void 0, props);
1237 + }
1238 + var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
1239 + var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
1240 + var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
1241 + function unwrapLazyRenderProp(render) {
1242 + if (render?.$$typeof !== REACT_LAZY_TYPE) {
1243 + return render;
1244 + }
1245 + const unwrapped = React9.Children.toArray(render)[0];
1246 + return /* @__PURE__ */ React9.isValidElement(unwrapped) ? unwrapped : render;
1247 + }
1248 + function evaluateRenderProp(element, render, props, state) {
1249 + if (render) {
1250 + if (typeof render === "function") {
1251 + if (true) {
1252 + warnIfRenderPropLooksLikeComponent(render);
1253 + }
1254 + return render(props, state);
1255 + }
1256 + const mergedProps = mergeProps(props, render.props);
1257 + mergedProps.ref = props.ref;
1258 + if (true) {
1259 + if (!/* @__PURE__ */ React9.isValidElement(render)) {
1260 + 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"));
1261 + }
1262 + }
1263 + return /* @__PURE__ */ React9.cloneElement(render, mergedProps);
1264 + }
1265 + if (element) {
1266 + if (typeof element === "string") {
1267 + return renderTag(element, props);
1268 + }
1269 + }
1270 + throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
1271 + }
1272 + function warnIfRenderPropLooksLikeComponent(renderFn) {
1273 + const functionName = renderFn.name;
1274 + if (functionName.length === 0) {
1275 + return;
1276 + }
1277 + if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
1278 + return;
1279 + }
1280 + if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
1281 + return;
1282 + }
1283 + 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={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
1284 + }
1285 + function renderTag(Tag, props) {
1286 + if (Tag === "button") {
1287 + return /* @__PURE__ */ (0, import_react.createElement)("button", {
1288 + type: "button",
1289 + ...props,
1290 + key: props.key
1291 + });
1292 + }
1293 + if (Tag === "img") {
1294 + return /* @__PURE__ */ (0, import_react.createElement)("img", {
1295 + alt: "",
1296 + ...props,
1297 + key: props.key
1298 + });
1299 + }
1300 + return /* @__PURE__ */ React9.createElement(Tag, props);
1301 + }
1302 +
1303 + // node_modules/@base-ui/utils/useId.mjs
1304 + var React10 = __toESM(require_react(), 1);
1305 + var globalId = 0;
1306 + function useGlobalId(idOverride, prefix = "mui") {
1307 + const [defaultId, setDefaultId] = React10.useState(idOverride);
1308 + const id = idOverride || defaultId;
1309 + React10.useEffect(() => {
1310 + if (defaultId == null) {
1311 + globalId += 1;
1312 + setDefaultId(`${prefix}-${globalId}`);
1313 + }
1314 + }, [defaultId, prefix]);
1315 + return id;
1316 + }
1317 + var maybeReactUseId = SafeReact.useId;
1318 + function useId(idOverride, prefix) {
1319 + if (maybeReactUseId !== void 0) {
1320 + const reactId = maybeReactUseId();
1321 + return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
1322 + }
1323 + return useGlobalId(idOverride, prefix);
1324 + }
1325 +
1326 + // node_modules/@base-ui/react/internals/useBaseUiId.mjs
1327 + function useBaseUiId(idOverride) {
1328 + return useId(idOverride, "base-ui");
1329 + }
1330 +
1331 + // node_modules/@base-ui/react/internals/reason-parts.mjs
1332 + var reason_parts_exports = {};
1333 + __export(reason_parts_exports, {
1334 + cancelOpen: () => cancelOpen,
1335 + chipRemovePress: () => chipRemovePress,
1336 + clearPress: () => clearPress,
1337 + closePress: () => closePress,
1338 + closeWatcher: () => closeWatcher,
1339 + decrementPress: () => decrementPress,
1340 + disabled: () => disabled,
1341 + drag: () => drag,
1342 + escapeKey: () => escapeKey,
1343 + focusOut: () => focusOut,
1344 + imperativeAction: () => imperativeAction,
1345 + incrementPress: () => incrementPress,
1346 + initial: () => initial,
1347 + inputBlur: () => inputBlur,
1348 + inputChange: () => inputChange,
1349 + inputClear: () => inputClear,
1350 + inputPaste: () => inputPaste,
1351 + inputPress: () => inputPress,
1352 + itemPress: () => itemPress,
1353 + keyboard: () => keyboard,
1354 + linkPress: () => linkPress,
1355 + listNavigation: () => listNavigation,
1356 + missing: () => missing,
1357 + none: () => none,
1358 + outsidePress: () => outsidePress,
1359 + pointer: () => pointer,
1360 + scrub: () => scrub,
1361 + siblingOpen: () => siblingOpen,
1362 + swipe: () => swipe,
1363 + trackPress: () => trackPress,
1364 + triggerFocus: () => triggerFocus,
1365 + triggerHover: () => triggerHover,
1366 + triggerPress: () => triggerPress,
1367 + wheel: () => wheel,
1368 + windowResize: () => windowResize
1369 + });
1370 + var none = "none";
1371 + var triggerPress = "trigger-press";
1372 + var triggerHover = "trigger-hover";
1373 + var triggerFocus = "trigger-focus";
1374 + var outsidePress = "outside-press";
1375 + var itemPress = "item-press";
1376 + var closePress = "close-press";
1377 + var linkPress = "link-press";
1378 + var clearPress = "clear-press";
1379 + var chipRemovePress = "chip-remove-press";
1380 + var trackPress = "track-press";
1381 + var incrementPress = "increment-press";
1382 + var decrementPress = "decrement-press";
1383 + var inputChange = "input-change";
1384 + var inputClear = "input-clear";
1385 + var inputBlur = "input-blur";
1386 + var inputPaste = "input-paste";
1387 + var inputPress = "input-press";
1388 + var focusOut = "focus-out";
1389 + var escapeKey = "escape-key";
1390 + var closeWatcher = "close-watcher";
1391 + var listNavigation = "list-navigation";
1392 + var keyboard = "keyboard";
1393 + var pointer = "pointer";
1394 + var drag = "drag";
1395 + var wheel = "wheel";
1396 + var scrub = "scrub";
1397 + var cancelOpen = "cancel-open";
1398 + var siblingOpen = "sibling-open";
1399 + var disabled = "disabled";
1400 + var missing = "missing";
1401 + var initial = "initial";
1402 + var imperativeAction = "imperative-action";
1403 + var swipe = "swipe";
1404 + var windowResize = "window-resize";
1405 +
1406 + // node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs
1407 + function createChangeEventDetails(reason, event, trigger, customProperties) {
1408 + let canceled = false;
1409 + let allowPropagation = false;
1410 + const custom = customProperties ?? EMPTY_OBJECT;
1411 + const details = {
1412 + reason,
1413 + event: event ?? new Event("base-ui"),
1414 + cancel() {
1415 + canceled = true;
1416 + },
1417 + allowPropagation() {
1418 + allowPropagation = true;
1419 + },
1420 + get isCanceled() {
1421 + return canceled;
1422 + },
1423 + get isPropagationAllowed() {
1424 + return allowPropagation;
1425 + },
1426 + trigger,
1427 + ...custom
1428 + };
1429 + return details;
1430 + }
1431 +
1432 + // node_modules/@base-ui/react/internals/useTransitionStatus.mjs
1433 + var React12 = __toESM(require_react(), 1);
1434 +
1435 + // node_modules/@base-ui/utils/useOnMount.mjs
1436 + var React11 = __toESM(require_react(), 1);
1437 + function useOnMount(fn) {
1438 + React11.useEffect(fn, EMPTY_ARRAY);
1439 + }
1440 +
1441 + // node_modules/@base-ui/utils/useAnimationFrame.mjs
1442 + var EMPTY = null;
1443 + var LAST_RAF = globalThis.requestAnimationFrame;
1444 + var Scheduler = class {
1445 + /* This implementation uses an array as a backing data-structure for frame callbacks.
1446 + * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
1447 + * never calls the native `cancelAnimationFrame` if there are no frames left. This can
1448 + * be much more efficient if there is a call pattern that alterns as
1449 + * "request-cancel-request-cancel-…".
1450 + * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
1451 + * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
1452 + callbacks = [];
1453 + callbacksCount = 0;
1454 + nextId = 1;
1455 + startId = 1;
1456 + isScheduled = false;
1457 + tick = (timestamp) => {
1458 + this.isScheduled = false;
1459 + const currentCallbacks = this.callbacks;
1460 + const currentCallbacksCount = this.callbacksCount;
1461 + this.callbacks = [];
1462 + this.callbacksCount = 0;
1463 + this.startId = this.nextId;
1464 + if (currentCallbacksCount > 0) {
1465 + for (let i = 0; i < currentCallbacks.length; i += 1) {
1466 + currentCallbacks[i]?.(timestamp);
1467 + }
1468 + }
1469 + };
1470 + request(fn) {
1471 + const id = this.nextId;
1472 + this.nextId += 1;
1473 + this.callbacks.push(fn);
1474 + this.callbacksCount += 1;
1475 + const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);
1476 + if (!this.isScheduled || didRAFChange) {
1477 + requestAnimationFrame(this.tick);
1478 + this.isScheduled = true;
1479 + }
1480 + return id;
1481 + }
1482 + cancel(id) {
1483 + const index2 = id - this.startId;
1484 + if (index2 < 0 || index2 >= this.callbacks.length) {
1485 + return;
1486 + }
1487 + if (this.callbacks[index2] === null) {
1488 + return;
1489 + }
1490 + this.callbacks[index2] = null;
1491 + this.callbacksCount -= 1;
1492 + }
1493 + };
1494 + var scheduler = new Scheduler();
1495 + var AnimationFrame = class _AnimationFrame {
1496 + static create() {
1497 + return new _AnimationFrame();
1498 + }
1499 + static request(fn) {
1500 + return scheduler.request(fn);
1501 + }
1502 + static cancel(id) {
1503 + return scheduler.cancel(id);
1504 + }
1505 + currentId = EMPTY;
1506 + /**
1507 + * Executes `fn` after `delay`, clearing any previously scheduled call.
1508 + */
1509 + request(fn) {
1510 + this.cancel();
1511 + this.currentId = scheduler.request(() => {
1512 + this.currentId = EMPTY;
1513 + fn();
1514 + });
1515 + }
1516 + cancel = () => {
1517 + if (this.currentId !== EMPTY) {
1518 + scheduler.cancel(this.currentId);
1519 + this.currentId = EMPTY;
1520 + }
1521 + };
1522 + disposeEffect = () => {
1523 + return this.cancel;
1524 + };
1525 + };
1526 + function useAnimationFrame() {
1527 + const timeout = useRefWithInit(AnimationFrame.create).current;
1528 + useOnMount(timeout.disposeEffect);
1529 + return timeout;
1530 + }
1531 +
1532 + // node_modules/@base-ui/react/internals/useTransitionStatus.mjs
1533 + function useTransitionStatus(open, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {
1534 + const [transitionStatus, setTransitionStatus] = React12.useState(open && enableIdleState ? "idle" : void 0);
1535 + const [mounted, setMounted] = React12.useState(open && !animateInitialOpen);
1536 + if (open && !mounted) {
1537 + setMounted(true);
1538 + setTransitionStatus("starting");
1539 + }
1540 + if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) {
1541 + setTransitionStatus("ending");
1542 + }
1543 + if (!open && !mounted && transitionStatus === "ending") {
1544 + setTransitionStatus(void 0);
1545 + }
1546 + useIsoLayoutEffect(() => {
1547 + if (!open && mounted && transitionStatus !== "ending" && deferEndingState) {
1548 + const frame = AnimationFrame.request(() => {
1549 + setTransitionStatus("ending");
1550 + });
1551 + return () => {
1552 + AnimationFrame.cancel(frame);
1553 + };
1554 + }
1555 + return void 0;
1556 + }, [open, mounted, transitionStatus, deferEndingState]);
1557 + useIsoLayoutEffect(() => {
1558 + if (!open || enableIdleState) {
1559 + return void 0;
1560 + }
1561 + const frame = AnimationFrame.request(() => {
1562 + setTransitionStatus(void 0);
1563 + });
1564 + return () => {
1565 + AnimationFrame.cancel(frame);
1566 + };
1567 + }, [enableIdleState, open]);
1568 + useIsoLayoutEffect(() => {
1569 + if (!open || !enableIdleState) {
1570 + return void 0;
1571 + }
1572 + if (open && mounted && transitionStatus !== "idle") {
1573 + setTransitionStatus("starting");
1574 + }
1575 + const frame = AnimationFrame.request(() => {
1576 + setTransitionStatus("idle");
1577 + });
1578 + return () => {
1579 + AnimationFrame.cancel(frame);
1580 + };
1581 + }, [enableIdleState, open, mounted, transitionStatus]);
1582 + return {
1583 + mounted,
1584 + setMounted,
1585 + transitionStatus
1586 + };
1587 + }
1588 +
1589 + // node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs
1590 + var React13 = __toESM(require_react(), 1);
1591 + function useCompositeListItem(params = {}) {
1592 + const {
1593 + guess,
1594 + label,
1595 + metadata,
1596 + textRef,
1597 + index: externalIndex
1598 + } = params;
1599 + const {
1600 + register,
1601 + unregister,
1602 + subscribeMapChange,
1603 + nextIndexRef
1604 + } = useCompositeListContext();
1605 + const indexRef = React13.useRef(-1);
1606 + const [internalIndex, setInternalIndex] = React13.useState(externalIndex == null && guess ? () => {
1607 + if (indexRef.current === -1) {
1608 + const newIndex = nextIndexRef.current;
1609 + nextIndexRef.current += 1;
1610 + indexRef.current = newIndex;
1611 + }
1612 + return indexRef.current;
1613 + } : -1);
1614 + const index2 = externalIndex ?? internalIndex;
1615 + const componentRef = React13.useRef(null);
1616 + const ref = React13.useCallback((node) => {
1617 + const previousNode = componentRef.current;
1618 + if (previousNode) {
1619 + unregister(previousNode);
1620 + }
1621 + componentRef.current = node;
1622 + if (node) {
1623 + register(node, {
1624 + metadata: metadata ?? null,
1625 + index: externalIndex ?? null,
1626 + label,
1627 + textRef
1628 + });
1629 + }
1630 + }, [externalIndex, register, unregister, metadata, label, textRef]);
1631 + useIsoLayoutEffect(() => {
1632 + if (externalIndex != null) {
1633 + return void 0;
1634 + }
1635 + return subscribeMapChange((map) => {
1636 + const i = componentRef.current ? map.get(componentRef.current)?.index : null;
1637 + if (i != null) {
1638 + setInternalIndex(i);
1639 + }
1640 + });
1641 + }, [externalIndex, subscribeMapChange]);
1642 + return {
1643 + ref,
1644 + index: index2
1645 + };
1646 + }
1647 +
1648 + // node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs
1649 + var TransitionStatusDataAttributes_exports = {};
1650 + __export(TransitionStatusDataAttributes_exports, {
1651 + endingStyle: () => endingStyle,
1652 + startingStyle: () => startingStyle
1653 + });
1654 + var startingStyle = "data-starting-style";
1655 + var endingStyle = "data-ending-style";
1656 +
1657 + // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs
1658 + var STARTING_HOOK = {
1659 + [startingStyle]: ""
1660 + };
1661 + var ENDING_HOOK = {
1662 + [endingStyle]: ""
1663 + };
1664 + var transitionStatusMapping = {
1665 + transitionStatus(value) {
1666 + if (value === "starting") {
1667 + return STARTING_HOOK;
1668 + }
1669 + if (value === "ending") {
1670 + return ENDING_HOOK;
1671 + }
1672 + return null;
1673 + }
1674 + };
1675 +
1676 + // node_modules/@base-ui/react/internals/use-button/useButton.mjs
1677 + var React16 = __toESM(require_react(), 1);
1678 +
1679 + // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
1680 + function hasWindow() {
1681 + return typeof window !== "undefined";
1682 + }
1683 + function getNodeName(node) {
1684 + if (isNode(node)) {
1685 + return (node.nodeName || "").toLowerCase();
1686 + }
1687 + return "#document";
1688 + }
1689 + function getWindow(node) {
1690 + var _node$ownerDocument;
1691 + return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
1692 + }
1693 + function getDocumentElement(node) {
1694 + var _ref;
1695 + return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
1696 + }
1697 + function isNode(value) {
1698 + if (!hasWindow()) {
1699 + return false;
1700 + }
1701 + return value instanceof Node || value instanceof getWindow(value).Node;
1702 + }
1703 + function isHTMLElement(value) {
1704 + if (!hasWindow()) {
1705 + return false;
1706 + }
1707 + return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
1708 + }
1709 + function isShadowRoot(value) {
1710 + if (!hasWindow() || typeof ShadowRoot === "undefined") {
1711 + return false;
1712 + }
1713 + return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1714 + }
1715 + function isLastTraversableNode(node) {
1716 + return /^(html|body|#document)$/.test(getNodeName(node));
1717 + }
1718 + function getComputedStyle2(element) {
1719 + return getWindow(element).getComputedStyle(element);
1720 + }
1721 + function getParentNode(node) {
1722 + if (getNodeName(node) === "html") {
1723 + return node;
1724 + }
1725 + const result = (
1726 + // Step into the shadow DOM of the parent of a slotted node.
1727 + node.assignedSlot || // DOM Element detected.
1728 + node.parentNode || // ShadowRoot detected.
1729 + isShadowRoot(node) && node.host || // Fallback.
1730 + getDocumentElement(node)
1731 + );
1732 + return isShadowRoot(result) ? result.host : result;
1733 + }
1734 +
1735 + // node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs
1736 + var React14 = __toESM(require_react(), 1);
1737 + var CompositeRootContext = /* @__PURE__ */ React14.createContext(void 0);
1738 + if (true) CompositeRootContext.displayName = "CompositeRootContext";
1739 + function useCompositeRootContext(optional = false) {
1740 + const context = React14.useContext(CompositeRootContext);
1741 + if (context === void 0 && !optional) {
1742 + throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage_default(16));
1743 + }
1744 + return context;
1745 + }
1746 +
1747 + // node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs
1748 + var React15 = __toESM(require_react(), 1);
1749 + function useFocusableWhenDisabled(parameters) {
1750 + const {
1751 + focusableWhenDisabled,
1752 + disabled: disabled2,
1753 + composite = false,
1754 + tabIndex: tabIndexProp = 0,
1755 + isNativeButton
1756 + } = parameters;
1757 + const isFocusableComposite = composite && focusableWhenDisabled !== false;
1758 + const isNonFocusableComposite = composite && focusableWhenDisabled === false;
1759 + const props = React15.useMemo(() => {
1760 + const additionalProps = {
1761 + // allow Tabbing away from focusableWhenDisabled elements
1762 + onKeyDown(event) {
1763 + if (disabled2 && focusableWhenDisabled && event.key !== "Tab") {
1764 + event.preventDefault();
1765 + }
1766 + }
1767 + };
1768 + if (!composite) {
1769 + additionalProps.tabIndex = tabIndexProp;
1770 + if (!isNativeButton && disabled2) {
1771 + additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
1772 + }
1773 + }
1774 + if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) {
1775 + additionalProps["aria-disabled"] = disabled2;
1776 + }
1777 + if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {
1778 + additionalProps.disabled = disabled2;
1779 + }
1780 + return additionalProps;
1781 + }, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);
1782 + return {
1783 + props
1784 + };
1785 + }
1786 +
1787 + // node_modules/@base-ui/utils/owner.mjs
1788 + function ownerDocument(node) {
1789 + return node?.ownerDocument || document;
1790 + }
1791 +
1792 + // node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs
1793 + function dispatchClickWithModifiers(target, sourceEvent, {
1794 + detail = 0
1795 + } = {}) {
1796 + target.dispatchEvent(new (getWindow(target)).PointerEvent("click", {
1797 + bubbles: true,
1798 + cancelable: true,
1799 + composed: true,
1800 + detail,
1801 + shiftKey: sourceEvent.shiftKey,
1802 + ctrlKey: sourceEvent.ctrlKey,
1803 + altKey: sourceEvent.altKey,
1804 + metaKey: sourceEvent.metaKey
1805 + }));
1806 + }
1807 +
1808 + // node_modules/@base-ui/react/internals/use-button/useButton.mjs
1809 + function useButton(parameters = {}) {
1810 + const {
1811 + disabled: disabled2 = false,
1812 + focusableWhenDisabled,
1813 + tabIndex = 0,
1814 + native: isNativeButton = true,
1815 + composite: compositeProp
1816 + } = parameters;
1817 + const elementRef = React16.useRef(null);
1818 + const compositeRootContext = useCompositeRootContext(true);
1819 + const isCompositeItem = compositeProp ?? compositeRootContext !== void 0;
1820 + const {
1821 + props: focusableWhenDisabledProps
1822 + } = useFocusableWhenDisabled({
1823 + focusableWhenDisabled,
1824 + disabled: disabled2,
1825 + composite: isCompositeItem,
1826 + tabIndex,
1827 + isNativeButton
1828 + });
1829 + if (true) {
1830 + React16.useEffect(() => {
1831 + if (!elementRef.current) {
1832 + return;
1833 + }
1834 + const isButtonTag = isButtonElement(elementRef.current);
1835 + if (isNativeButton) {
1836 + if (!isButtonTag) {
1837 + const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
1838 + const message = "A component that acts as a button expected a native <button> because the `nativeButton` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the `render` prop, or set `nativeButton` to `false`.";
1839 + error(`${message}${ownerStackMessage}`);
1840 + }
1841 + } else if (isButtonTag) {
1842 + const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
1843 + const message = "A component that acts as a button expected a non-<button> because the `nativeButton` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set `nativeButton` to `true`.";
1844 + error(`${message}${ownerStackMessage}`);
1845 + }
1846 + }, [isNativeButton]);
1847 + }
1848 + const updateDisabled = React16.useCallback(() => {
1849 + const element = elementRef.current;
1850 + if (!isButtonElement(element)) {
1851 + return;
1852 + }
1853 + if (isCompositeItem && disabled2 && focusableWhenDisabledProps.disabled === void 0 && element.disabled) {
1854 + element.disabled = false;
1855 + }
1856 + }, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]);
1857 + useIsoLayoutEffect(updateDisabled, [updateDisabled]);
1858 + const getButtonProps = React16.useCallback((externalProps = {}) => {
1859 + const {
1860 + onClick: externalOnClick,
1861 + onMouseDown: externalOnMouseDown,
1862 + onKeyUp: externalOnKeyUp,
1863 + onKeyDown: externalOnKeyDown,
1864 + onPointerDown: externalOnPointerDown,
1865 + ...otherExternalProps
1866 + } = externalProps;
1867 + return mergeProps({
1868 + onClick(event) {
1869 + if (disabled2) {
1870 + event.preventDefault();
1871 + return;
1872 + }
1873 + externalOnClick?.(event);
1874 + },
1875 + onMouseDown(event) {
1876 + if (!disabled2) {
1877 + externalOnMouseDown?.(event);
1878 + }
1879 + },
1880 + onKeyDown(event) {
1881 + if (disabled2) {
1882 + return;
1883 + }
1884 + makeEventPreventable(event);
1885 + externalOnKeyDown?.(event);
1886 + if (event.baseUIHandlerPrevented) {
1887 + return;
1888 + }
1889 + const isCurrentTarget = event.target === event.currentTarget;
1890 + const currentTarget = event.currentTarget;
1891 + const isButton = isButtonElement(currentTarget);
1892 + const isLink = !isNativeButton && isValidLinkElement(currentTarget);
1893 + const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);
1894 + const isEnterKey = event.key === "Enter";
1895 + const isSpaceKey = event.key === " ";
1896 + const role = currentTarget.getAttribute("role");
1897 + const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell";
1898 + if (isCurrentTarget && isCompositeItem && isSpaceKey) {
1899 + if (event.defaultPrevented && isTextNavigationRole) {
1900 + return;
1901 + }
1902 + event.preventDefault();
1903 + if (!isNativeButton || isButton) {
1904 + event.preventBaseUIHandler();
1905 + dispatchClickWithModifiers(currentTarget, event);
1906 + }
1907 + return;
1908 + }
1909 + if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {
1910 + if (isCurrentTarget && isLink && isSpaceKey) {
1911 + event.preventDefault();
1912 + }
1913 + return;
1914 + }
1915 + if (event.defaultPrevented) {
1916 + return;
1917 + }
1918 + event.preventDefault();
1919 + if (isEnterKey) {
1920 + event.preventBaseUIHandler();
1921 + dispatchClickWithModifiers(currentTarget, event);
1922 + }
1923 + },
1924 + onKeyUp(event) {
1925 + if (disabled2) {
1926 + return;
1927 + }
1928 + makeEventPreventable(event);
1929 + externalOnKeyUp?.(event);
1930 + if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") {
1931 + event.preventDefault();
1932 + return;
1933 + }
1934 + if (event.baseUIHandlerPrevented) {
1935 + return;
1936 + }
1937 + if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === " ") {
1938 + event.preventBaseUIHandler();
1939 + dispatchClickWithModifiers(event.currentTarget, event);
1940 + }
1941 + },
1942 + onPointerDown(event) {
1943 + if (disabled2) {
1944 + event.preventDefault();
1945 + return;
1946 + }
1947 + externalOnPointerDown?.(event);
1948 + }
1949 + }, isNativeButton ? {
1950 + type: "button"
1951 + } : {
1952 + role: "button"
1953 + }, focusableWhenDisabledProps, otherExternalProps);
1954 + }, [disabled2, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);
1955 + const buttonRef = useStableCallback((element) => {
1956 + elementRef.current = element;
1957 + updateDisabled();
1958 + });
1959 + return {
1960 + getButtonProps,
1961 + buttonRef
1962 + };
1963 + }
1964 + function isButtonElement(elem) {
1965 + return isHTMLElement(elem) && elem.tagName === "BUTTON";
1966 + }
1967 + function isValidLinkElement(elem) {
1968 + return isHTMLElement(elem) && elem.tagName === "A" && Boolean(elem.href);
1969 + }
1970 +
1971 + // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
1972 + var React17 = __toESM(require_react(), 1);
1973 +
1974 + // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
1975 + var ReactDOM = __toESM(require_react_dom(), 1);
1976 +
1977 + // node_modules/@base-ui/react/utils/resolveRef.mjs
1978 + function resolveRef(maybeRef) {
1979 + if (maybeRef == null) {
1980 + return maybeRef;
1981 + }
1982 + return "current" in maybeRef ? maybeRef.current : maybeRef;
1983 + }
1984 +
1985 + // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
1986 + var pendingCallbacks = null;
1987 + function flushBeforePaint(fn) {
1988 + if (!pendingCallbacks) {
1989 + const callbacks = [];
1990 + pendingCallbacks = callbacks;
1991 + queueMicrotask(() => {
1992 + pendingCallbacks = null;
1993 + ReactDOM.flushSync(() => {
1994 + for (const callback of callbacks) {
1995 + callback();
1996 + }
1997 + });
1998 + });
1999 + }
2000 + pendingCallbacks.push(fn);
2001 + }
2002 + function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) {
2003 + const frame = useAnimationFrame();
2004 + return useStableCallback((fnToExecute, signal = null) => {
2005 + frame.cancel();
2006 + const element = resolveRef(elementOrRef);
2007 + if (element == null) {
2008 + return;
2009 + }
2010 + const resolvedElement = element;
2011 + const done = () => {
2012 + if (!batch) {
2013 + ReactDOM.flushSync(fnToExecute);
2014 + return;
2015 + }
2016 + flushBeforePaint(() => {
2017 + if (!signal?.aborted) {
2018 + fnToExecute();
2019 + }
2020 + });
2021 + };
2022 + if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
2023 + fnToExecute();
2024 + return;
2025 + }
2026 + function exec() {
2027 + Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => {
2028 + if (!signal?.aborted) {
2029 + done();
2030 + }
2031 + }, () => {
2032 + if (signal?.aborted) {
2033 + return;
2034 + }
2035 + const currentAnimations = resolvedElement.getAnimations();
2036 + if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) {
2037 + exec();
2038 + return;
2039 + }
2040 + done();
2041 + });
2042 + }
2043 + if (waitForStartingStyleRemoved) {
2044 + const startingStyleAttribute = startingStyle;
2045 + if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
2046 + frame.request(exec);
2047 + return;
2048 + }
2049 + const attributeObserver = new MutationObserver(() => {
2050 + if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
2051 + attributeObserver.disconnect();
2052 + exec();
2053 + }
2054 + });
2055 + attributeObserver.observe(resolvedElement, {
2056 + attributes: true,
2057 + attributeFilter: [startingStyleAttribute]
2058 + });
2059 + signal?.addEventListener("abort", () => attributeObserver.disconnect(), {
2060 + once: true
2061 + });
2062 + return;
2063 + }
2064 + frame.request(exec);
2065 + });
2066 + }
2067 +
2068 + // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
2069 + function useOpenChangeComplete(parameters) {
2070 + const {
2071 + enabled = true,
2072 + open,
2073 + ref,
2074 + batch = false,
2075 + onComplete: onCompleteParam
2076 + } = parameters;
2077 + const onComplete = useStableCallback(onCompleteParam);
2078 + const runOnceAnimationsFinish = useAnimationsFinished(ref, open, batch);
2079 + React17.useEffect(() => {
2080 + if (!enabled) {
2081 + return void 0;
2082 + }
2083 + const abortController = new AbortController();
2084 + runOnceAnimationsFinish(onComplete, abortController.signal);
2085 + return () => {
2086 + abortController.abort();
2087 + };
2088 + }, [enabled, open, onComplete, runOnceAnimationsFinish]);
2089 + }
2090 +
2091 + // node_modules/@base-ui/utils/useTimeout.mjs
2092 + var EMPTY2 = 0;
2093 + var Timeout = class _Timeout {
2094 + static create() {
2095 + return new _Timeout();
2096 + }
2097 + currentId = EMPTY2;
2098 + /**
2099 + * Executes `fn` after `delay`, clearing any previously scheduled call.
2100 + */
2101 + start(delay, fn) {
2102 + this.clear();
2103 + this.currentId = setTimeout(() => {
2104 + this.currentId = EMPTY2;
2105 + fn();
2106 + }, delay);
2107 + }
2108 + isStarted() {
2109 + return this.currentId !== EMPTY2;
2110 + }
2111 + clear = () => {
2112 + if (this.currentId !== EMPTY2) {
2113 + clearTimeout(this.currentId);
2114 + this.currentId = EMPTY2;
2115 + }
2116 + };
2117 + disposeEffect = () => {
2118 + return this.clear;
2119 + };
2120 + };
2121 + function useTimeout() {
2122 + const timeout = useRefWithInit(Timeout.create).current;
2123 + useOnMount(timeout.disposeEffect);
2124 + return timeout;
2125 + }
2126 +
2127 + // node_modules/@base-ui/utils/shadowDom.mjs
2128 + function activeElement(doc) {
2129 + let element = doc.activeElement;
2130 + while (element?.shadowRoot?.activeElement != null) {
2131 + element = element.shadowRoot.activeElement;
2132 + }
2133 + return element;
2134 + }
2135 + function contains(parent, child) {
2136 + if (!parent || !child) {
2137 + return false;
2138 + }
2139 + const rootNode = child.getRootNode?.();
2140 + if (parent.contains(child)) {
2141 + return true;
2142 + }
2143 + if (rootNode && isShadowRoot(rootNode)) {
2144 + let next = child;
2145 + while (next) {
2146 + if (parent === next) {
2147 + return true;
2148 + }
2149 + next = next.parentNode || next.host;
2150 + }
2151 + }
2152 + return false;
2153 + }
2154 + function getTarget(event) {
2155 + if ("composedPath" in event) {
2156 + return event.composedPath()[0] ?? event.target;
2157 + }
2158 + return event.target;
2159 + }
2160 +
2161 + // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
2162 + var round = Math.round;
2163 +
2164 + // node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs
2165 + function isIndexOutOfListBounds(list, index2) {
2166 + return index2 < 0 || index2 >= list.length;
2167 + }
2168 + function getMinListIndex(listRef, disabledIndices) {
2169 + return findNonDisabledListIndex(listRef.current, {
2170 + disabledIndices
2171 + });
2172 + }
2173 + function getMaxListIndex(listRef, disabledIndices) {
2174 + return findNonDisabledListIndex(listRef.current, {
2175 + decrement: true,
2176 + startingIndex: listRef.current.length,
2177 + disabledIndices
2178 + });
2179 + }
2180 + function findNonDisabledListIndex(list, {
2181 + startingIndex = -1,
2182 + decrement = false,
2183 + disabledIndices,
2184 + amount = 1
2185 + } = {}) {
2186 + let index2 = startingIndex;
2187 + do {
2188 + index2 += decrement ? -amount : amount;
2189 + } while (index2 >= 0 && index2 <= list.length - 1 && isListIndexDisabled(list, index2, disabledIndices));
2190 + return index2;
2191 + }
2192 + function isListIndexDisabled(list, index2, disabledIndices) {
2193 + const isExplicitlyDisabled = typeof disabledIndices === "function" ? disabledIndices(index2) : disabledIndices?.includes(index2) ?? false;
2194 + if (isExplicitlyDisabled) {
2195 + return true;
2196 + }
2197 + const element = list[index2];
2198 + if (!element) {
2199 + return false;
2200 + }
2201 + if (!isElementVisible(element)) {
2202 + return true;
2203 + }
2204 + if (element.matches(":disabled")) {
2205 + return true;
2206 + }
2207 + return !disabledIndices && (element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true");
2208 + }
2209 + function isHiddenByStyles(styles) {
2210 + return styles.visibility === "hidden" || styles.visibility === "collapse";
2211 + }
2212 + function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) {
2213 + if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) {
2214 + return false;
2215 + }
2216 + if (typeof element.checkVisibility === "function") {
2217 + return element.checkVisibility();
2218 + }
2219 + return styles.display !== "none" && styles.display !== "contents";
2220 + }
2221 +
2222 + // node_modules/@base-ui/utils/useForcedRerendering.mjs
2223 + var React18 = __toESM(require_react(), 1);
2224 + function useForcedRerendering() {
2225 + const [, setState] = React18.useState({});
2226 + return React18.useCallback(() => {
2227 + setState({});
2228 + }, []);
2229 + }
2230 +
2231 + // node_modules/@base-ui/react/internals/composite/composite.mjs
2232 + var ARROW_UP = "ArrowUp";
2233 + var ARROW_DOWN = "ArrowDown";
2234 + var ARROW_LEFT = "ArrowLeft";
2235 + var ARROW_RIGHT = "ArrowRight";
2236 + var HOME = "Home";
2237 + var END = "End";
2238 + var COMPOSITE_KEYS = /* @__PURE__ */ new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END]);
2239 + var SHIFT = "Shift";
2240 + var MODIFIER_KEYS = [SHIFT, "Control", "Alt", "Meta"];
2241 + function isInputElement(element) {
2242 + return isHTMLElement(element) && element.tagName === "INPUT";
2243 + }
2244 + function isNativeInput(element) {
2245 + if (isInputElement(element) && element.selectionStart != null) {
2246 + return true;
2247 + }
2248 + if (isHTMLElement(element) && element.tagName === "TEXTAREA") {
2249 + return true;
2250 + }
2251 + return false;
2252 + }
2253 + function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) {
2254 + if (!scrollContainer || !element || !element.scrollTo) {
2255 + return;
2256 + }
2257 + let targetX = scrollContainer.scrollLeft;
2258 + let targetY = scrollContainer.scrollTop;
2259 + const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth;
2260 + const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight;
2261 + if (isOverflowingX && orientation !== "vertical") {
2262 + const elementOffsetLeft = getOffset(scrollContainer, element, "left");
2263 + const containerStyles = getStyles(scrollContainer);
2264 + const elementStyles = getStyles(element);
2265 + if (direction === "ltr") {
2266 + if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {
2267 + targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;
2268 + } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {
2269 + targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
2270 + }
2271 + }
2272 + if (direction === "rtl") {
2273 + if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {
2274 + targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
2275 + } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {
2276 + targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;
2277 + }
2278 + }
2279 + }
2280 + if (isOverflowingY && orientation !== "horizontal") {
2281 + const elementOffsetTop = getOffset(scrollContainer, element, "top");
2282 + const containerStyles = getStyles(scrollContainer);
2283 + const elementStyles = getStyles(element);
2284 + if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) {
2285 + targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop;
2286 + } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) {
2287 + targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom;
2288 + }
2289 + }
2290 + scrollContainer.scrollTo({
2291 + left: targetX,
2292 + top: targetY,
2293 + behavior: "auto"
2294 + });
2295 + }
2296 + function getOffset(ancestor, element, side) {
2297 + const propName = side === "left" ? "offsetLeft" : "offsetTop";
2298 + let result = 0;
2299 + while (element.offsetParent) {
2300 + result += element[propName];
2301 + if (element.offsetParent === ancestor) {
2302 + break;
2303 + }
2304 + element = element.offsetParent;
2305 + }
2306 + return result;
2307 + }
2308 + function getStyles(element) {
2309 + const styles = getComputedStyle(element);
2310 + return {
2311 + scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0,
2312 + scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0,
2313 + scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0,
2314 + scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0,
2315 + scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0,
2316 + scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0,
2317 + scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0,
2318 + scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0
2319 + };
2320 + }
2321 +
2322 + // node_modules/@base-ui/utils/inertValue.mjs
2323 + function inertValue(value) {
2324 + if (isReactVersionAtLeast(19)) {
2325 + return value;
2326 + }
2327 + return value ? "true" : void 0;
2328 + }
2329 +
2330 + // node_modules/@base-ui/react/internals/useValueChanged.mjs
2331 + var React19 = __toESM(require_react(), 1);
2332 + function useValueChanged(value, onChange) {
2333 + const valueRef = React19.useRef(value);
2334 + const onChangeCallback = useStableCallback(onChange);
2335 + useIsoLayoutEffect(() => {
2336 + if (valueRef.current !== value) {
2337 + onChangeCallback(valueRef.current);
2338 + }
2339 + valueRef.current = value;
2340 + }, [value, onChangeCallback]);
2341 + }
2342 +
2343 + // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
2344 + var React20 = __toESM(require_react(), 1);
2345 +
2346 + // node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs
2347 + var valid = "data-valid";
2348 + var invalid = "data-invalid";
2349 +
2350 + // node_modules/@base-ui/react/internals/field-constants/constants.mjs
2351 + var DEFAULT_VALIDITY_STATE = {
2352 + badInput: false,
2353 + customError: false,
2354 + patternMismatch: false,
2355 + rangeOverflow: false,
2356 + rangeUnderflow: false,
2357 + stepMismatch: false,
2358 + tooLong: false,
2359 + tooShort: false,
2360 + typeMismatch: false,
2361 + valid: null,
2362 + valueMissing: false
2363 + };
2364 + var DEFAULT_FIELD_STATE_ATTRIBUTES = {
2365 + valid: null,
2366 + touched: false,
2367 + dirty: false,
2368 + filled: false,
2369 + focused: false
2370 + };
2371 + var DEFAULT_FIELD_ROOT_STATE = {
2372 + disabled: false,
2373 + ...DEFAULT_FIELD_STATE_ATTRIBUTES
2374 + };
2375 + var fieldValidityMapping = {
2376 + valid(value) {
2377 + if (value === null) {
2378 + return null;
2379 + }
2380 + if (value) {
2381 + return {
2382 + [valid]: ""
2383 + };
2384 + }
2385 + return {
2386 + [invalid]: ""
2387 + };
2388 + }
2389 + };
2390 +
2391 + // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
2392 + var DEFAULT_FIELD_ROOT_CONTEXT = {
2393 + invalid: void 0,
2394 + name: void 0,
2395 + validityData: {
2396 + state: DEFAULT_VALIDITY_STATE,
2397 + errors: [],
2398 + error: "",
2399 + value: "",
2400 + initialValue: null
2401 + },
2402 + setValidityData: NOOP,
2403 + disabled: void 0,
2404 + setTouched: NOOP,
2405 + setDirty: NOOP,
2406 + setFilled: NOOP,
2407 + setFocused: NOOP,
2408 + validationMode: "onSubmit",
2409 + shouldValidateOnChange: () => false,
2410 + state: DEFAULT_FIELD_ROOT_STATE,
2411 + registerFieldControl: NOOP,
2412 + validation: {
2413 + getValidationProps: (_disabled, props = EMPTY_OBJECT) => props,
2414 + inputRef: {
2415 + current: null
2416 + },
2417 + registeredInputs: /* @__PURE__ */ new Map(),
2418 + registerInput: NOOP,
2419 + getInputControl: () => null,
2420 + commit: async () => {
2421 + },
2422 + change: NOOP
2423 + }
2424 + };
2425 + var FieldRootContext = /* @__PURE__ */ React20.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
2426 + if (true) FieldRootContext.displayName = "FieldRootContext";
2427 + function useFieldRootContext(optional = true) {
2428 + const context = React20.useContext(FieldRootContext);
2429 + if (context.setValidityData === NOOP && !optional) {
2430 + throw new Error(true ? "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>." : formatErrorMessage_default(28));
2431 + }
2432 + return context;
2433 + }
2434 +
2435 + // node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs
2436 + function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name16) {
2437 + const {
2438 + registerFieldControl
2439 + } = useFieldRootContext();
2440 + const sourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol());
2441 + useIsoLayoutEffect(() => {
2442 + const source = sourceRef.current;
2443 + if (!enabled) {
2444 + registerFieldControl(source, void 0);
2445 + return;
2446 + }
2447 + const registration = {
2448 + controlRef,
2449 + getValue: getFormValueOverride,
2450 + id,
2451 + name: name16,
2452 + value
2453 + };
2454 + registerFieldControl(source, registration);
2455 + }, [controlRef, enabled, getFormValueOverride, id, name16, registerFieldControl, sourceRef, value]);
2456 + useIsoLayoutEffect(() => {
2457 + const source = sourceRef.current;
2458 + return () => {
2459 + registerFieldControl(source, void 0);
2460 + };
2461 + }, [registerFieldControl, sourceRef]);
2462 + }
2463 +
2464 + // node_modules/@base-ui/react/internals/form-context/FormContext.mjs
2465 + var React21 = __toESM(require_react(), 1);
2466 + var FormContext = /* @__PURE__ */ React21.createContext({
2467 + elementRef: {
2468 + current: null
2469 + },
2470 + formRef: {
2471 + current: {
2472 + fields: /* @__PURE__ */ new Map()
2473 + }
2474 + },
2475 + errors: {},
2476 + clearErrors: NOOP,
2477 + validationMode: "onSubmit",
2478 + submitCountRef: {
2479 + current: 0
2480 + }
2481 + });
2482 + if (true) FormContext.displayName = "FormContext";
2483 + function useFormContext() {
2484 + return React21.useContext(FormContext);
2485 + }
2486 +
2487 + // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
2488 + var React23 = __toESM(require_react(), 1);
2489 +
2490 + // node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
2491 + var React22 = __toESM(require_react(), 1);
2492 + var LabelableContext = /* @__PURE__ */ React22.createContext({
2493 + controlId: void 0,
2494 + registerControlId: NOOP,
2495 + resetControlId: NOOP,
2496 + labelId: void 0,
2497 + setLabelId: NOOP,
2498 + messageIds: [],
2499 + setMessageIds: NOOP,
2500 + getDescriptionProps: (externalProps) => externalProps
2501 + });
2502 + if (true) LabelableContext.displayName = "LabelableContext";
2503 + function useLabelableContext() {
2504 + return React22.useContext(LabelableContext);
2505 + }
2506 +
2507 + // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
2508 + function useLabelableId(params = {}) {
2509 + const {
2510 + id,
2511 + enabled = true
2512 + } = params;
2513 + const {
2514 + controlId,
2515 + registerControlId,
2516 + resetControlId
2517 + } = useLabelableContext();
2518 + const defaultId = useBaseUiId();
2519 + const controlSourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol());
2520 + const hasRegisteredRef = React23.useRef(false);
2521 + const hadExplicitIdRef = React23.useRef(false);
2522 + const unregisterControlId = useStableCallback(() => {
2523 + if (!hasRegisteredRef.current || registerControlId === NOOP) {
2524 + return;
2525 + }
2526 + hasRegisteredRef.current = false;
2527 + registerControlId(controlSourceRef.current, void 0);
2528 + });
2529 + useIsoLayoutEffect(() => {
2530 + if (!enabled || registerControlId === NOOP) {
2531 + unregisterControlId();
2532 + return void 0;
2533 + }
2534 + let nextId;
2535 + if (id !== void 0) {
2536 + hadExplicitIdRef.current = true;
2537 + nextId = id;
2538 + } else if (hadExplicitIdRef.current) {
2539 + nextId = defaultId;
2540 + } else {
2541 + resetControlId();
2542 + return void 0;
2543 + }
2544 + if (nextId === void 0) {
2545 + unregisterControlId();
2546 + return void 0;
2547 + }
2548 + hasRegisteredRef.current = true;
2549 + registerControlId(controlSourceRef.current, nextId);
2550 + return void 0;
2551 + }, [id, enabled, registerControlId, resetControlId, defaultId, controlSourceRef, unregisterControlId]);
2552 + useIsoLayoutEffect(() => {
2553 + return unregisterControlId;
2554 + }, [unregisterControlId]);
2555 + return (enabled ? controlId : void 0) ?? id ?? defaultId;
2556 + }
2557 +
2558 + // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
2559 + var React24 = __toESM(require_react(), 1);
2560 + var DirectionContext = /* @__PURE__ */ React24.createContext(void 0);
2561 + if (true) DirectionContext.displayName = "DirectionContext";
2562 + function useDirection() {
2563 + const context = React24.useContext(DirectionContext);
2564 + return context?.direction ?? "ltr";
2565 + }
2566 +
2567 + // node_modules/@base-ui/react/field/item/FieldItemContext.mjs
2568 + var React25 = __toESM(require_react(), 1);
2569 + var FieldItemContext = /* @__PURE__ */ React25.createContext({
2570 + disabled: false
2571 + });
2572 + if (true) FieldItemContext.displayName = "FieldItemContext";
2573 + function useFieldItemContext() {
2574 + const context = React25.useContext(FieldItemContext);
2575 + return context;
2576 + }
2577 +
2578 + // node_modules/@base-ui/react/field/root/useFieldValidation.mjs
2579 + var React26 = __toESM(require_react(), 1);
2580 +
2581 + // node_modules/@base-ui/react/field/utils/getCombinedFieldValidityData.mjs
2582 + function getCombinedFieldValidityData(validityData, invalid2) {
2583 + return {
2584 + ...validityData,
2585 + state: {
2586 + ...validityData.state,
2587 + valid: !invalid2 && validityData.state.valid
2588 + }
2589 + };
2590 + }
2591 +
2592 + // node_modules/@base-ui/react/field/root/useFieldValidation.mjs
2593 + var validityKeys = Object.keys(DEFAULT_VALIDITY_STATE);
2594 + function isEligibleInput(input, formElement) {
2595 + if (input.matches(":disabled")) {
2596 + return false;
2597 + }
2598 + if (!formElement || input.form === formElement) {
2599 + return true;
2600 + }
2601 + return input.form === null && !input.hasAttribute("form");
2602 + }
2603 + function findRepresentativeInput(inputs, formElement) {
2604 + let fallback = null;
2605 + for (const input of inputs.keys()) {
2606 + if (!isEligibleInput(input, formElement)) {
2607 + continue;
2608 + }
2609 + if (!input.validity.valid) {
2610 + return input;
2611 + }
2612 + fallback ??= input;
2613 + }
2614 + return fallback;
2615 + }
2616 + function makeState(customError) {
2617 + return {
2618 + ...DEFAULT_VALIDITY_STATE,
2619 + valid: !customError,
2620 + customError
2621 + };
2622 + }
2623 + function getNativeErrors(element) {
2624 + return element && element.validationMessage ? [element.validationMessage] : [];
2625 + }
2626 + function useFieldValidation(params) {
2627 + const {
2628 + elementRef,
2629 + formRef
2630 + } = useFormContext();
2631 + const {
2632 + setValidityData,
2633 + validate,
2634 + validityData,
2635 + validationDebounceTime,
2636 + invalid: invalid2,
2637 + markedDirtyRef,
2638 + state,
2639 + shouldValidateOnChange,
2640 + validationMode,
2641 + registeredFieldIdRef
2642 + } = params;
2643 + const {
2644 + controlId,
2645 + getDescriptionProps
2646 + } = useLabelableContext();
2647 + const timeout = useTimeout();
2648 + const inputRef = React26.useRef(null);
2649 + const registeredInputs = useRefWithInit(() => /* @__PURE__ */ new Map()).current;
2650 + const validationCommitIdRef = React26.useRef(0);
2651 + const customValidityRef = React26.useRef(null);
2652 + const registerInput = React26.useCallback((element, registration) => {
2653 + registeredInputs.set(element, registration);
2654 + return () => {
2655 + registeredInputs.delete(element);
2656 + };
2657 + }, [registeredInputs]);
2658 + const getInputControl = useStableCallback(() => {
2659 + const element = findRepresentativeInput(registeredInputs, elementRef.current);
2660 + return element && registeredInputs.get(element)?.controlRef.current || null;
2661 + });
2662 + const commit = useStableCallback(async (value, revalidate = false) => {
2663 + validationCommitIdRef.current += 1;
2664 + const validationCommitId = validationCommitIdRef.current;
2665 + function updateRegisteredFieldValidity(nextValidityData, externalInvalid = invalid2) {
2666 + const fieldId = registeredFieldIdRef.current ?? controlId;
2667 + if (fieldId == null) {
2668 + return;
2669 + }
2670 + const currentFieldData = formRef.current.fields.get(fieldId);
2671 + if (!currentFieldData) {
2672 + return;
2673 + }
2674 + const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData, externalInvalid);
2675 + formRef.current.fields.set(fieldId, {
2676 + ...currentFieldData,
2677 + validityData: validityDataWithFormErrors
2678 + });
2679 + }
2680 + function makeValidityData(validityState, errorMessages) {
2681 + const errors = validityState.valid === false ? errorMessages : [];
2682 + return {
2683 + value,
2684 + state: validityState,
2685 + error: errors[0] ?? "",
2686 + errors,
2687 + initialValue: validityData.initialValue
2688 + };
2689 + }
2690 + function setCustomValidity(element2, message) {
2691 + const displaced = element2.validity.customError ? element2.validationMessage : "";
2692 + const ownedMessage = message.replace(/\r\n?/g, "\n");
2693 + element2.setCustomValidity(ownedMessage);
2694 + customValidityRef.current = [element2, ownedMessage, displaced];
2695 + }
2696 + function clearCustomValidity() {
2697 + const record = customValidityRef.current;
2698 + customValidityRef.current = null;
2699 + if (record && (!record[0].willValidate || record[0].validationMessage === record[1])) {
2700 + record[0].setCustomValidity(record[2]);
2701 + }
2702 + }
2703 + function publish(validityState, errorMessages, externalInvalid) {
2704 + const nextValidityData = makeValidityData(validityState, errorMessages);
2705 + updateRegisteredFieldValidity(nextValidityData, externalInvalid);
2706 + setValidityData(nextValidityData);
2707 + }
2708 + function getState(el) {
2709 + const computedState = validityKeys.reduce((acc, key) => {
2710 + acc[key] = el.validity[key];
2711 + return acc;
2712 + }, {});
2713 + let hasOnlyValueMissingError = false;
2714 + for (const key of validityKeys) {
2715 + if (key === "valid") {
2716 + continue;
2717 + }
2718 + if (key === "valueMissing" && computedState[key]) {
2719 + hasOnlyValueMissingError = true;
2720 + } else if (computedState[key]) {
2721 + return computedState;
2722 + }
2723 + }
2724 + if (hasOnlyValueMissingError && !markedDirtyRef.current) {
2725 + computedState.valid = true;
2726 + computedState.valueMissing = false;
2727 + }
2728 + return computedState;
2729 + }
2730 + function resolveRepresentativeInput() {
2731 + return registeredInputs.size > 0 ? findRepresentativeInput(registeredInputs, elementRef.current) : inputRef.current;
2732 + }
2733 + let element = resolveRepresentativeInput();
2734 + function refreshState() {
2735 + element = resolveRepresentativeInput();
2736 + return element?.willValidate ? getState(element) : makeState(false);
2737 + }
2738 + if (revalidate) {
2739 + if (state.valid !== false || !element) {
2740 + return;
2741 + }
2742 + if (!element.validity.valueMissing) {
2743 + clearCustomValidity();
2744 + const currentElement = resolveRepresentativeInput();
2745 + const foreign = currentElement?.validity.customError ? getNativeErrors(currentElement) : [];
2746 + publish(makeState(foreign.length > 0), foreign, false);
2747 + return;
2748 + }
2749 + for (const key of validityKeys) {
2750 + if (key !== "valid" && key !== "valueMissing" && key !== "customError" && element.validity[key]) {
2751 + return;
2752 + }
2753 + }
2754 + }
2755 + timeout.clear();
2756 + clearCustomValidity();
2757 + let nextState = refreshState();
2758 + let validationErrors = getNativeErrors(element);
2759 + const isValidatingOnChange = shouldValidateOnChange();
2760 + if (validationErrors.length === 0 || isValidatingOnChange) {
2761 + const formValues = Array.from(formRef.current.fields.values()).reduce((acc, field) => {
2762 + if (field.name) {
2763 + acc[field.name] = field.getValue();
2764 + }
2765 + return acc;
2766 + }, {});
2767 + const resultOrPromise = validate(value, formValues);
2768 + let result;
2769 + if (typeof resultOrPromise === "object" && resultOrPromise !== null && "then" in resultOrPromise) {
2770 + if (nextState.valid === false) {
2771 + publish(nextState, validationErrors);
2772 + } else if (validationMode === "onSubmit" || !validityData.state.customError) {
2773 + nextState.valid = null;
2774 + publish(nextState, validationErrors);
2775 + }
2776 + result = await resultOrPromise;
2777 + if (validationCommitId !== validationCommitIdRef.current) {
2778 + return;
2779 + }
2780 + nextState = refreshState();
2781 + } else {
2782 + result = resultOrPromise;
2783 + }
2784 + validationErrors = result ? [].concat(result).filter(Boolean) : [];
2785 + if (validationErrors.length > 0) {
2786 + nextState.valid = false;
2787 + nextState.customError = true;
2788 + if (element?.willValidate) {
2789 + setCustomValidity(element, validationErrors.join("\n"));
2790 + }
2791 + } else {
2792 + validationErrors = getNativeErrors(element);
2793 + }
2794 + }
2795 + publish(nextState, validationErrors);
2796 + });
2797 + const change = useStableCallback((value, cancelPending = false) => {
2798 + timeout.clear();
2799 + validationCommitIdRef.current += 1;
2800 + if (cancelPending) {
2801 + return;
2802 + }
2803 + const validateOnChange = shouldValidateOnChange();
2804 + if (validateOnChange && value !== "" && validationDebounceTime) {
2805 + timeout.start(validationDebounceTime, () => {
2806 + commit(value);
2807 + });
2808 + } else {
2809 + commit(value, !validateOnChange);
2810 + }
2811 + });
2812 + const getValidationProps = React26.useCallback((disabled2, externalProps = {}) => mergeProps(getDescriptionProps(externalProps), state.valid === false && !state.disabled && !disabled2 ? {
2813 + "aria-invalid": true
2814 + } : EMPTY_OBJECT), [getDescriptionProps, state.disabled, state.valid]);
2815 + return React26.useMemo(() => ({
2816 + getValidationProps,
2817 + inputRef,
2818 + registeredInputs,
2819 + registerInput,
2820 + getInputControl,
2821 + commit,
2822 + change
2823 + }), [getValidationProps, registeredInputs, registerInput, getInputControl, commit, change]);
2824 + }
2825 +
2826 + // node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs
2827 + function useRegisteredLabelId(idProp, setLabelId) {
2828 + const id = useBaseUiId(idProp);
2829 + useIsoLayoutEffect(() => {
2830 + setLabelId(id);
2831 + return () => {
2832 + setLabelId((currentId) => currentId === id ? void 0 : currentId);
2833 + };
2834 + }, [id, setLabelId]);
2835 + return id;
2836 + }
2837 +
2838 + // node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs
2839 + function useLabel(params = {}) {
2840 + const {
2841 + id: idProp,
2842 + fallbackControlId,
2843 + native = false,
2844 + setLabelId: setLabelIdProp,
2845 + focusControl: focusControlProp
2846 + } = params;
2847 + const {
2848 + controlId: contextControlId,
2849 + setLabelId: setContextLabelId
2850 + } = useLabelableContext();
2851 + const syncLabelId = useStableCallback((nextLabelId) => {
2852 + setContextLabelId(nextLabelId);
2853 + setLabelIdProp?.(nextLabelId);
2854 + });
2855 + const id = useRegisteredLabelId(idProp, syncLabelId);
2856 + const resolvedControlId = contextControlId ?? fallbackControlId;
2857 + function focusControl(event) {
2858 + if (focusControlProp) {
2859 + focusControlProp(event, resolvedControlId);
2860 + return;
2861 + }
2862 + if (!resolvedControlId) {
2863 + return;
2864 + }
2865 + const controlElement = ownerDocument(event.currentTarget).getElementById(resolvedControlId);
2866 + if (isHTMLElement(controlElement)) {
2867 + focusElementWithVisible(controlElement);
2868 + }
2869 + }
2870 + function handleInteraction(event) {
2871 + const target = getTarget(event.nativeEvent);
2872 + if (target?.closest("button,input,select,textarea")) {
2873 + return;
2874 + }
2875 + if (!event.defaultPrevented && event.detail > 1) {
2876 + event.preventDefault();
2877 + }
2878 + if (native) {
2879 + return;
2880 + }
2881 + focusControl(event);
2882 + }
2883 + return native ? {
2884 + id,
2885 + htmlFor: resolvedControlId,
2886 + onMouseDown: handleInteraction
2887 + } : {
2888 + id,
2889 + onClick: handleInteraction,
2890 + onPointerDown(event) {
2891 + event.preventDefault();
2892 + }
2893 + };
2894 + }
2895 + function focusElementWithVisible(element) {
2896 + element.focus({
2897 + // Available from Chrome 144+ (January 2026).
2898 + // Safari and Firefox already support it.
2899 + focusVisible: true
2900 + });
2901 + }
2902 +
2903 + // node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs
2904 + var React27 = __toESM(require_react(), 1);
2905 + function useCompositeItem(params = {}) {
2906 + const {
2907 + highlightItemOnHover,
2908 + highlightedIndex,
2909 + onHighlightedIndexChange
2910 + } = useCompositeRootContext();
2911 + const {
2912 + ref,
2913 + index: index2
2914 + } = useCompositeListItem(params);
2915 + const isHighlighted = highlightedIndex === index2;
2916 + const itemRef = React27.useRef(null);
2917 + const mergedRef = useMergedRefs(ref, itemRef);
2918 + const compositeProps = {
2919 + tabIndex: isHighlighted ? 0 : -1,
2920 + onFocus() {
2921 + onHighlightedIndexChange(index2);
2922 + },
2923 + onMouseMove() {
2924 + const item = itemRef.current;
2925 + if (!highlightItemOnHover || !item) {
2926 + return;
2927 + }
2928 + const disabled2 = item.hasAttribute("disabled") || item.ariaDisabled === "true";
2929 + if (!isHighlighted && !disabled2) {
2930 + item.focus();
2931 + }
2932 + }
2933 + };
2934 + return {
2935 + compositeProps,
2936 + compositeRef: mergedRef,
2937 + index: index2
2938 + };
2939 + }
2940 +
2941 + // node_modules/@base-ui/react/utils/getCssDimensions.mjs
2942 + function getCssDimensions(element) {
2943 + const css = getComputedStyle2(element);
2944 + let width = parseFloat(css.width) || 0;
2945 + let height = parseFloat(css.height) || 0;
2946 + const hasOffset = isHTMLElement(element);
2947 + const offsetWidth = hasOffset ? element.offsetWidth : width;
2948 + const offsetHeight = hasOffset ? element.offsetHeight : height;
2949 + const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
2950 + if (shouldFallback) {
2951 + width = offsetWidth;
2952 + height = offsetHeight;
2953 + }
2954 + return {
2955 + width,
2956 + height
2957 + };
2958 + }
2959 +
2960 + // node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs
2961 + var React28 = __toESM(require_react(), 1);
2962 + var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
2963 + var DirectionProvider = function DirectionProvider2(props) {
2964 + const {
2965 + direction = "ltr"
2966 + } = props;
2967 + const contextValue = React28.useMemo(() => ({
2968 + direction
2969 + }), [direction]);
2970 + return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DirectionContext.Provider, {
2971 + value: contextValue,
2972 + children: props.children
2973 + });
2974 + };
2975 + if (true) DirectionProvider.displayName = "DirectionProvider";
2976 +
2977 + // node_modules/@base-ui/utils/isElementDisabled.mjs
2978 + function isElementDisabled(element) {
2979 + return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
2980 + }
2981 +
2982 + // node_modules/@base-ui/react/internals/csp-context/CSPContext.mjs
2983 + var React29 = __toESM(require_react(), 1);
2984 + var CSPContext = /* @__PURE__ */ React29.createContext(void 0);
2985 + if (true) CSPContext.displayName = "CSPContext";
2986 + var DEFAULT_CSP_CONTEXT_VALUE = {
2987 + disableStyleElements: false
2988 + };
2989 + function useCSPContext() {
2990 + return React29.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
2991 + }
2992 +
2993 + // node_modules/@base-ui/react/utils/getElementTransform.mjs
2994 + function getElementTransform(element, computedStyle) {
2995 + const transform = (computedStyle ?? getWindow(element).getComputedStyle(element)).transform;
2996 + let translateX = 0;
2997 + let translateY = 0;
2998 + let scale = 1;
2999 + if (transform && transform !== "none") {
3000 + const matrix = transform.match(/matrix(?:3d)?\(([^)]+)\)/);
3001 + if (matrix) {
3002 + const values = matrix[1].split(", ").map(parseFloat);
3003 + if (values.length === 6) {
3004 + translateX = values[4];
3005 + translateY = values[5];
3006 + scale = Math.sqrt(values[0] * values[0] + values[1] * values[1]);
3007 + } else if (values.length === 16) {
3008 + translateX = values[12];
3009 + translateY = values[13];
3010 + scale = values[0];
3011 + }
3012 + }
3013 + }
3014 + return {
3015 + x: translateX,
3016 + y: translateY,
3017 + scale
3018 + };
3019 + }
3020 +
3021 + // node_modules/@base-ui/react/field/index.parts.mjs
3022 + var index_parts_exports = {};
3023 + __export(index_parts_exports, {
3024 + Control: () => FieldControl,
3025 + Description: () => FieldDescription,
3026 + Error: () => FieldError,
3027 + Item: () => FieldItem,
3028 + Label: () => FieldLabel,
3029 + Root: () => FieldRoot,
3030 + Validity: () => FieldValidity
3031 + });
3032 +
3033 + // node_modules/@base-ui/react/field/root/FieldRoot.mjs
3034 + var React33 = __toESM(require_react(), 1);
3035 +
3036 + // node_modules/@base-ui/react/fieldset/root/FieldsetRootContext.mjs
3037 + var React30 = __toESM(require_react(), 1);
3038 + var FieldsetRootContext = /* @__PURE__ */ React30.createContext(void 0);
3039 + if (true) FieldsetRootContext.displayName = "FieldsetRootContext";
3040 + function useFieldsetRootContext(optional = false) {
3041 + const context = React30.useContext(FieldsetRootContext);
3042 + if (!context && !optional) {
3043 + throw new Error(true ? "Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>." : formatErrorMessage_default(86));
3044 + }
3045 + return context;
3046 + }
3047 +
3048 + // node_modules/@base-ui/react/internals/labelable-provider/LabelableProvider.mjs
3049 + var React31 = __toESM(require_react(), 1);
3050 + var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
3051 + var LabelableProvider = function LabelableProvider2(props) {
3052 + const defaultId = useBaseUiId();
3053 + const [controlIdState, setControlIdState] = React31.useState(defaultId);
3054 + const [labelId, setLabelId] = React31.useState();
3055 + const [messageIds, setMessageIds] = React31.useState([]);
3056 + const controlId = controlIdState === void 0 ? defaultId : controlIdState;
3057 + const registrationsRef = useRefWithInit(() => /* @__PURE__ */ new Map());
3058 + const {
3059 + messageIds: parentMessageIds
3060 + } = useLabelableContext();
3061 + const registerControlId = useStableCallback((source, nextId) => {
3062 + const registrations = registrationsRef.current;
3063 + if (nextId === void 0) {
3064 + registrations.delete(source);
3065 + } else {
3066 + registrations.set(source, nextId);
3067 + }
3068 + setControlIdState((prev) => {
3069 + if (registrations.size === 0) {
3070 + return prev;
3071 + }
3072 + let nextControlId;
3073 + for (const id of registrations.values()) {
3074 + if (id === prev) {
3075 + return prev;
3076 + }
3077 + if (nextControlId === void 0) {
3078 + nextControlId = id;
3079 + }
3080 + }
3081 + return nextControlId;
3082 + });
3083 + });
3084 + const resetControlId = useStableCallback(() => {
3085 + if (registrationsRef.current.size === 0) {
3086 + setControlIdState(defaultId);
3087 + }
3088 + });
3089 + const getDescriptionProps = React31.useCallback((externalProps) => {
3090 + const ids = externalProps["aria-describedby"] ? externalProps["aria-describedby"].split(" ") : [];
3091 + ids.push(...parentMessageIds, ...messageIds);
3092 + return {
3093 + ...externalProps,
3094 + "aria-describedby": Array.from(new Set(ids)).join(" ") || void 0
3095 + };
3096 + }, [parentMessageIds, messageIds]);
3097 + const contextValue = React31.useMemo(() => ({
3098 + controlId,
3099 + registerControlId,
3100 + resetControlId,
3101 + labelId,
3102 + setLabelId,
3103 + messageIds,
3104 + setMessageIds,
3105 + getDescriptionProps
3106 + }), [controlId, registerControlId, resetControlId, labelId, setLabelId, messageIds, setMessageIds, getDescriptionProps]);
3107 + return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LabelableContext.Provider, {
3108 + value: contextValue,
3109 + children: props.children
3110 + });
3111 + };
3112 + if (true) LabelableProvider.displayName = "LabelableProvider";
3113 +
3114 + // node_modules/@base-ui/react/internals/field-register-control/useFieldControlRegistration.mjs
3115 + var React32 = __toESM(require_react(), 1);
3116 + function useFieldControlRegistration(params) {
3117 + const {
3118 + change,
3119 + commit,
3120 + invalid: invalid2,
3121 + markedDirtyRef,
3122 + name: name16,
3123 + setRegisteredFieldName,
3124 + registeredFieldIdRef,
3125 + setValidityData,
3126 + validityData
3127 + } = params;
3128 + const {
3129 + formRef
3130 + } = useFormContext();
3131 + const activeFieldControlSourceRef = React32.useRef(null);
3132 + const registrationRef = React32.useRef(null);
3133 + const initialValueCapturedRef = React32.useRef(false);
3134 + const getValueForForm = useStableCallback(() => {
3135 + const registration = registrationRef.current;
3136 + if (!registration) {
3137 + return void 0;
3138 + }
3139 + if (registration.getValue) {
3140 + return registration.getValue();
3141 + }
3142 + return registration.value;
3143 + });
3144 + function getRegistrationValue(registration) {
3145 + return registration.value === void 0 ? getValueForForm() : registration.value;
3146 + }
3147 + const validate = useStableCallback(() => {
3148 + const registration = registrationRef.current;
3149 + markedDirtyRef.current = true;
3150 + if (!registration) {
3151 + commit(validityData.value);
3152 + return;
3153 + }
3154 + commit(getRegistrationValue(registration));
3155 + });
3156 + function refreshRegistration() {
3157 + const registration = registrationRef.current;
3158 + if (!registration || !registration.id) {
3159 + return;
3160 + }
3161 + formRef.current.fields.set(registration.id, {
3162 + getValue: getValueForForm,
3163 + name: name16 ?? registration.name,
3164 + controlRef: registration.controlRef,
3165 + validityData: getCombinedFieldValidityData(validityData, invalid2),
3166 + validate
3167 + });
3168 + }
3169 + function deleteRegistration(id = registrationRef.current?.id) {
3170 + if (id) {
3171 + formRef.current.fields.delete(id);
3172 + }
3173 + }
3174 + function captureInitialValue(registration) {
3175 + if (initialValueCapturedRef.current) {
3176 + return;
3177 + }
3178 + initialValueCapturedRef.current = true;
3179 + const initialValue = getRegistrationValue(registration);
3180 + setValidityData((prev) => prev.initialValue === initialValue ? prev : {
3181 + ...prev,
3182 + initialValue
3183 + });
3184 + }
3185 + useIsoLayoutEffect(() => {
3186 + const registration = registrationRef.current;
3187 + if (!registration || !registration.id) {
3188 + return;
3189 + }
3190 + setRegisteredFieldName(name16 ? void 0 : registration.name);
3191 + formRef.current.fields.set(registration.id, {
3192 + getValue: getValueForForm,
3193 + name: name16 ?? registration.name,
3194 + controlRef: registration.controlRef,
3195 + validityData: getCombinedFieldValidityData(validityData, invalid2),
3196 + validate
3197 + });
3198 + }, [formRef, getValueForForm, invalid2, name16, setRegisteredFieldName, validate, validityData]);
3199 + useIsoLayoutEffect(() => {
3200 + const fields = formRef.current.fields;
3201 + return () => {
3202 + const id = registrationRef.current?.id;
3203 + if (id) {
3204 + fields.delete(id);
3205 + }
3206 + };
3207 + }, [formRef]);
3208 + const register = useStableCallback((source, registration) => {
3209 + if (!registration) {
3210 + if (activeFieldControlSourceRef.current === source) {
3211 + activeFieldControlSourceRef.current = null;
3212 + change(void 0, true);
3213 + deleteRegistration();
3214 + registrationRef.current = null;
3215 + setRegisteredFieldName(void 0);
3216 + registeredFieldIdRef.current = void 0;
3217 + }
3218 + return;
3219 + }
3220 + const previousId = registrationRef.current?.id;
3221 + const previousSource = activeFieldControlSourceRef.current;
3222 + if (previousSource && previousSource !== source) {
3223 + change(void 0, true);
3224 + }
3225 + activeFieldControlSourceRef.current = source;
3226 + registrationRef.current = registration;
3227 + if (!name16) {
3228 + setRegisteredFieldName(registration.name);
3229 + }
3230 + registeredFieldIdRef.current = registration.id;
3231 + if (previousId && previousId !== registration.id) {
3232 + deleteRegistration(previousId);
3233 + }
3234 + captureInitialValue(registration);
3235 + refreshRegistration();
3236 + });
3237 + return [validate, register];
3238 + }
3239 +
3240 + // node_modules/@base-ui/react/field/root/FieldRoot.mjs
3241 + var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
3242 + var FieldRootInner = /* @__PURE__ */ React33.forwardRef(function FieldRootInner2(componentProps, forwardedRef) {
3243 + const {
3244 + errors,
3245 + validationMode: formValidationMode,
3246 + submitCountRef
3247 + } = useFormContext();
3248 + const {
3249 + render,
3250 + className,
3251 + validate: validateProp,
3252 + validationDebounceTime = 0,
3253 + validationMode = formValidationMode,
3254 + name: name16,
3255 + disabled: disabledProp = false,
3256 + invalid: invalidProp,
3257 + dirty: dirtyProp,
3258 + touched: touchedProp,
3259 + actionsRef,
3260 + style,
3261 + ...elementProps
3262 + } = componentProps;
3263 + const disabledFieldset = useFieldsetRootContext(true)?.disabled;
3264 + const validate = useStableCallback(validateProp || (() => null));
3265 + const disabled2 = disabledFieldset || disabledProp;
3266 + const [touchedState, setTouchedUnwrapped] = React33.useState(false);
3267 + const [dirtyState, setDirtyUnwrapped] = React33.useState(false);
3268 + const [filled, setFilled] = React33.useState(false);
3269 + const [focused, setFocused] = React33.useState(false);
3270 + const dirty = dirtyProp ?? dirtyState;
3271 + const touched = touchedProp ?? touchedState;
3272 + const markedDirtyRef = React33.useRef(dirty);
3273 + const registeredFieldIdRef = React33.useRef(void 0);
3274 + const [registeredFieldName, setRegisteredFieldName] = React33.useState();
3275 + const effectiveName = name16 ?? registeredFieldName;
3276 + useIsoLayoutEffect(() => {
3277 + if (dirtyProp !== void 0) {
3278 + markedDirtyRef.current = dirtyProp;
3279 + }
3280 + }, [dirtyProp]);
3281 + const setDirty = useStableCallback((value) => {
3282 + if (dirtyProp !== void 0) {
3283 + return;
3284 + }
3285 + if (value) {
3286 + markedDirtyRef.current = true;
3287 + }
3288 + setDirtyUnwrapped(value);
3289 + });
3290 + const setTouched = useStableCallback((value) => {
3291 + if (touchedProp !== void 0) {
3292 + return;
3293 + }
3294 + setTouchedUnwrapped(value);
3295 + });
3296 + const shouldValidateOnChange = useStableCallback(() => validationMode === "onChange" || validationMode === "onSubmit" && submitCountRef.current > 0);
3297 + const formError = effectiveName && Object.hasOwn(errors, effectiveName) ? errors[effectiveName] : null;
3298 + const hasFormError = !!(Array.isArray(formError) ? formError.length : formError);
3299 + const invalid2 = invalidProp === true || hasFormError;
3300 + const [validityData, setValidityData] = React33.useState({
3301 + state: DEFAULT_VALIDITY_STATE,
3302 + error: "",
3303 + errors: [],
3304 + value: null,
3305 + initialValue: null
3306 + });
3307 + const valid2 = !invalid2 && (disabled2 ? null : validityData.state.valid);
3308 + const state = React33.useMemo(() => ({
3309 + disabled: disabled2,
3310 + touched,
3311 + dirty,
3312 + valid: valid2,
3313 + filled,
3314 + focused
3315 + }), [disabled2, touched, dirty, valid2, filled, focused]);
3316 + const validation = useFieldValidation({
3317 + setValidityData,
3318 + validate,
3319 + validityData,
3320 + validationDebounceTime,
3321 + invalid: invalid2,
3322 + markedDirtyRef,
3323 + state,
3324 + shouldValidateOnChange,
3325 + validationMode,
3326 + registeredFieldIdRef
3327 + });
3328 + const [validateFieldControl, registerFieldControl] = useFieldControlRegistration({
3329 + change: validation.change,
3330 + commit: validation.commit,
3331 + invalid: invalid2,
3332 + markedDirtyRef,
3333 + name: name16,
3334 + setRegisteredFieldName,
3335 + registeredFieldIdRef,
3336 + setValidityData,
3337 + validityData
3338 + });
3339 + React33.useImperativeHandle(actionsRef, () => ({
3340 + validate: validateFieldControl
3341 + }), [validateFieldControl]);
3342 + const contextValue = React33.useMemo(() => ({
3343 + invalid: invalid2,
3344 + name: effectiveName,
3345 + validityData,
3346 + setValidityData,
3347 + disabled: disabled2,
3348 + setTouched,
3349 + setDirty,
3350 + setFilled,
3351 + setFocused,
3352 + validationMode,
3353 + shouldValidateOnChange,
3354 + state,
3355 + registerFieldControl,
3356 + validation
3357 + }), [invalid2, effectiveName, validityData, disabled2, setTouched, setDirty, setFilled, setFocused, validationMode, shouldValidateOnChange, state, registerFieldControl, validation]);
3358 + const element = useRenderElement("div", componentProps, {
3359 + ref: forwardedRef,
3360 + state,
3361 + props: elementProps,
3362 + stateAttributesMapping: fieldValidityMapping
3363 + });
3364 + return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FieldRootContext.Provider, {
3365 + value: contextValue,
3366 + children: element
3367 + });
3368 + });
3369 + if (true) FieldRootInner.displayName = "FieldRootInner";
3370 + var FieldRoot = /* @__PURE__ */ React33.forwardRef(function FieldRoot2(componentProps, forwardedRef) {
3371 + return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(LabelableProvider, {
3372 + children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FieldRootInner, {
3373 + ...componentProps,
3374 + ref: forwardedRef
3375 + })
3376 + });
3377 + });
3378 + if (true) FieldRoot.displayName = "FieldRoot";
3379 +
3380 + // node_modules/@base-ui/react/field/label/FieldLabel.mjs
3381 + var React34 = __toESM(require_react(), 1);
3382 + var FieldLabel = /* @__PURE__ */ React34.forwardRef(function FieldLabel2(componentProps, forwardedRef) {
3383 + const {
3384 + render,
3385 + className,
3386 + style,
3387 + id: idProp,
3388 + nativeLabel = true,
3389 + ...elementProps
3390 + } = componentProps;
3391 + const fieldRootContext = useFieldRootContext(false);
3392 + const fieldItemContext = useFieldItemContext();
3393 + const {
3394 + labelId
3395 + } = useLabelableContext();
3396 + const state = {
3397 + ...fieldRootContext.state,
3398 + disabled: fieldRootContext.disabled || fieldItemContext.disabled
3399 + };
3400 + const labelRef = React34.useRef(null);
3401 + const labelProps = useLabel({
3402 + id: labelId ?? idProp,
3403 + native: nativeLabel
3404 + });
3405 + if (true) {
3406 + React34.useEffect(() => {
3407 + if (!labelRef.current) {
3408 + return;
3409 + }
3410 + const isLabelTag = labelRef.current.tagName === "LABEL";
3411 + if (nativeLabel) {
3412 + if (!isLabelTag) {
3413 + const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
3414 + const message = "<Field.Label> expected a <label> element because the `nativeLabel` prop is true. Rendering a non-<label> disables native label association, so `htmlFor` will not work. Use a real <label> in the `render` prop, or set `nativeLabel` to `false`.";
3415 + error(`${message}${ownerStackMessage}`);
3416 + }
3417 + } else if (isLabelTag) {
3418 + const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
3419 + const message = "<Field.Label> expected a non-<label> element because the `nativeLabel` prop is false. Rendering a <label> assumes native label behavior while Base UI treats it as non-native, which can cause unexpected pointer behavior. Use a non-<label> in the `render` prop, or set `nativeLabel` to `true`.";
3420 + error(`${message}${ownerStackMessage}`);
3421 + }
3422 + }, [nativeLabel]);
3423 + }
3424 + const element = useRenderElement("label", componentProps, {
3425 + ref: [forwardedRef, labelRef],
3426 + state,
3427 + props: [labelProps, elementProps],
3428 + stateAttributesMapping: fieldValidityMapping
3429 + });
3430 + return element;
3431 + });
3432 + if (true) FieldLabel.displayName = "FieldLabel";
3433 +
3434 + // node_modules/@base-ui/react/field/error/FieldError.mjs
3435 + var React35 = __toESM(require_react(), 1);
3436 + var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
3437 + var stateAttributesMapping = {
3438 + ...fieldValidityMapping,
3439 + ...transitionStatusMapping
3440 + };
3441 + var FieldError = /* @__PURE__ */ React35.forwardRef(function FieldError2(componentProps, forwardedRef) {
3442 + const {
3443 + render,
3444 + id: idProp,
3445 + className,
3446 + match,
3447 + style,
3448 + ...elementProps
3449 + } = componentProps;
3450 + const id = useBaseUiId(idProp);
3451 + const {
3452 + validityData,
3453 + state: fieldState,
3454 + name: name16
3455 + } = useFieldRootContext(false);
3456 + const {
3457 + setMessageIds
3458 + } = useLabelableContext();
3459 + const {
3460 + errors
3461 + } = useFormContext();
3462 + const formError = name16 && Object.hasOwn(errors, name16) ? errors[name16] : null;
3463 + const hasFormError = !!(Array.isArray(formError) ? formError.length : formError);
3464 + const hasSpecificMatch = typeof match === "string";
3465 + let rendered = false;
3466 + if (match === true) {
3467 + rendered = true;
3468 + } else if (fieldState.disabled) {
3469 + rendered = false;
3470 + } else if (hasSpecificMatch) {
3471 + rendered = Boolean(validityData.state[match]);
3472 + } else {
3473 + rendered = hasFormError || validityData.state.valid === false;
3474 + }
3475 + const {
3476 + mounted,
3477 + transitionStatus,
3478 + setMounted
3479 + } = useTransitionStatus(rendered);
3480 + useIsoLayoutEffect(() => {
3481 + if (!rendered || !id) {
3482 + return void 0;
3483 + }
3484 + setMessageIds((v) => v.concat(id));
3485 + return () => {
3486 + setMessageIds((v) => v.filter((item) => item !== id));
3487 + };
3488 + }, [rendered, id, setMessageIds]);
3489 + const errorRef = React35.useRef(null);
3490 + const [lastRenderedMessage, setLastRenderedMessage] = React35.useState(null);
3491 + const [lastRenderedMessageKey, setLastRenderedMessageKey] = React35.useState(null);
3492 + let error2 = validityData.error;
3493 + if (!hasSpecificMatch && hasFormError) {
3494 + error2 = formError;
3495 + } else if (validityData.errors.length > 1) {
3496 + error2 = validityData.errors;
3497 + }
3498 + let errorMessage = error2;
3499 + if (Array.isArray(error2)) {
3500 + errorMessage = error2.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("ul", {
3501 + children: error2.map((message) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", {
3502 + children: message
3503 + }, message))
3504 + }) : error2[0];
3505 + }
3506 + const errorKey = Array.isArray(error2) ? JSON.stringify(error2) : error2;
3507 + if (rendered && errorKey !== lastRenderedMessageKey) {
3508 + setLastRenderedMessageKey(errorKey);
3509 + setLastRenderedMessage(errorMessage);
3510 + }
3511 + useOpenChangeComplete({
3512 + open: rendered,
3513 + ref: errorRef,
3514 + onComplete() {
3515 + if (!rendered) {
3516 + setMounted(false);
3517 + }
3518 + }
3519 + });
3520 + const state = {
3521 + ...fieldState,
3522 + transitionStatus
3523 + };
3524 + const element = useRenderElement("div", componentProps, {
3525 + ref: [forwardedRef, errorRef],
3526 + state,
3527 + props: [{
3528 + id,
3529 + children: rendered ? errorMessage : lastRenderedMessage
3530 + }, elementProps],
3531 + stateAttributesMapping,
3532 + enabled: mounted
3533 + });
3534 + if (!mounted) {
3535 + return null;
3536 + }
3537 + return element;
3538 + });
3539 + if (true) FieldError.displayName = "FieldError";
3540 +
3541 + // node_modules/@base-ui/react/field/description/FieldDescription.mjs
3542 + var React36 = __toESM(require_react(), 1);
3543 + var FieldDescription = /* @__PURE__ */ React36.forwardRef(function FieldDescription2(componentProps, forwardedRef) {
3544 + const {
3545 + render,
3546 + id: idProp,
3547 + className,
3548 + style,
3549 + ...elementProps
3550 + } = componentProps;
3551 + const id = useBaseUiId(idProp);
3552 + const fieldRootContext = useFieldRootContext(false);
3553 + const fieldItemContext = useFieldItemContext();
3554 + const {
3555 + setMessageIds
3556 + } = useLabelableContext();
3557 + const state = {
3558 + ...fieldRootContext.state,
3559 + disabled: fieldRootContext.disabled || fieldItemContext.disabled
3560 + };
3561 + useIsoLayoutEffect(() => {
3562 + if (!id) {
3563 + return void 0;
3564 + }
3565 + setMessageIds((v) => v.concat(id));
3566 + return () => {
3567 + setMessageIds((v) => v.filter((item) => item !== id));
3568 + };
3569 + }, [id, setMessageIds]);
3570 + const element = useRenderElement("p", componentProps, {
3571 + ref: forwardedRef,
3572 + state,
3573 + props: [{
3574 + id
3575 + }, elementProps],
3576 + stateAttributesMapping: fieldValidityMapping
3577 + });
3578 + return element;
3579 + });
3580 + if (true) FieldDescription.displayName = "FieldDescription";
3581 +
3582 + // node_modules/@base-ui/react/field/control/FieldControl.mjs
3583 + var React37 = __toESM(require_react(), 1);
3584 + var FieldControl = /* @__PURE__ */ React37.forwardRef(function FieldControl2(componentProps, forwardedRef) {
3585 + const {
3586 + render,
3587 + className,
3588 + id: idProp,
3589 + name: nameProp,
3590 + value: valueProp,
3591 + disabled: disabledProp = false,
3592 + onValueChange,
3593 + defaultValue,
3594 + autoFocus = false,
3595 + style,
3596 + ...elementProps
3597 + } = componentProps;
3598 + const {
3599 + state: fieldState,
3600 + name: fieldName,
3601 + disabled: fieldDisabled,
3602 + setTouched,
3603 + setDirty,
3604 + validityData,
3605 + setFocused,
3606 + setFilled,
3607 + validationMode,
3608 + validation
3609 + } = useFieldRootContext();
3610 + const {
3611 + clearErrors,
3612 + elementRef: formElementRef,
3613 + submitCountRef
3614 + } = useFormContext();
3615 + const disabled2 = fieldDisabled || disabledProp;
3616 + const name16 = fieldName ?? nameProp;
3617 + const state = {
3618 + ...fieldState,
3619 + disabled: disabled2
3620 + };
3621 + const {
3622 + labelId
3623 + } = useLabelableContext();
3624 + const id = useLabelableId({
3625 + id: idProp
3626 + });
3627 + const [valueUnwrapped] = useControlled({
3628 + controlled: valueProp,
3629 + default: defaultValue,
3630 + name: "FieldControl",
3631 + state: "value"
3632 + });
3633 + const isControlled = valueProp !== void 0;
3634 + const value = isControlled ? valueUnwrapped : void 0;
3635 + const serializedValue = value == null ? void 0 : String(value);
3636 + const getValueFromInput = useStableCallback(() => validation.inputRef.current?.value);
3637 + useRegisterFieldControl(validation.inputRef, id, serializedValue, getValueFromInput, !disabled2, nameProp);
3638 + useIsoLayoutEffect(() => {
3639 + const currentValue = serializedValue ?? validation.inputRef.current?.value;
3640 + if (currentValue !== void 0) {
3641 + setFilled(currentValue !== "");
3642 + }
3643 + }, [serializedValue, validation.inputRef, setFilled]);
3644 + useValueChanged(serializedValue, () => {
3645 + if (serializedValue === void 0) {
3646 + return;
3647 + }
3648 + clearErrors(name16);
3649 + setDirty(serializedValue !== (validityData.initialValue ?? ""));
3650 + validation.change(serializedValue);
3651 + });
3652 + const inputRef = React37.useRef(null);
3653 + const enterValidationTimeout = useTimeout();
3654 + useIsoLayoutEffect(() => {
3655 + if (autoFocus && inputRef.current === activeElement(ownerDocument(inputRef.current))) {
3656 + setFocused(true);
3657 + }
3658 + }, [autoFocus, setFocused]);
3659 + const element = useRenderElement("input", componentProps, {
3660 + ref: [forwardedRef, inputRef],
3661 + state,
3662 + props: [{
3663 + id,
3664 + disabled: disabled2,
3665 + name: name16,
3666 + ref: validation.inputRef,
3667 + "aria-labelledby": labelId,
3668 + autoFocus,
3669 + ...isControlled ? {
3670 + value
3671 + } : {
3672 + defaultValue
3673 + },
3674 + onChange(event) {
3675 + const inputValue = event.currentTarget.value;
3676 + const details = createChangeEventDetails(reason_parts_exports.none, event.nativeEvent);
3677 + onValueChange?.(inputValue, details);
3678 + if (isControlled) {
3679 + return;
3680 + }
3681 + setDirty(inputValue !== (validityData.initialValue ?? ""));
3682 + setFilled(inputValue !== "");
3683 + if (!event.nativeEvent.defaultPrevented && !details.isCanceled) {
3684 + clearErrors(name16);
3685 + validation.change(inputValue);
3686 + }
3687 + },
3688 + onFocus() {
3689 + setFocused(true);
3690 + },
3691 + onBlur(event) {
3692 + setTouched(true);
3693 + setFocused(false);
3694 + if (validationMode === "onBlur") {
3695 + const inputValue = event.currentTarget.value;
3696 + validation.commit(inputValue);
3697 + if (isControlled) {
3698 + queueMicrotask(() => {
3699 + const nextValue = validation.inputRef.current?.value;
3700 + if (nextValue !== void 0 && nextValue !== inputValue && nextValue !== (validityData.initialValue ?? "")) {
3701 + validation.commit(nextValue);
3702 + }
3703 + });
3704 + }
3705 + }
3706 + },
3707 + onKeyDown(event) {
3708 + if (event.currentTarget.tagName === "INPUT" && event.key === "Enter") {
3709 + setTouched(true);
3710 + const value2 = event.currentTarget.value;
3711 + const form = event.currentTarget.form;
3712 + if (form && form === formElementRef.current && !event.defaultPrevented) {
3713 + const input = event.currentTarget;
3714 + const submitCount = submitCountRef.current;
3715 + enterValidationTimeout.start(0, () => {
3716 + if (submitCountRef.current === submitCount) {
3717 + validation.commit(input.value);
3718 + }
3719 + });
3720 + } else {
3721 + validation.commit(value2);
3722 + }
3723 + }
3724 + }
3725 + }, elementProps, (props) => validation.getValidationProps(disabled2, props)],
3726 + stateAttributesMapping: fieldValidityMapping
3727 + });
3728 + return element;
3729 + });
3730 + if (true) FieldControl.displayName = "FieldControl";
3731 +
3732 + // node_modules/@base-ui/react/field/validity/FieldValidity.mjs
3733 + var React38 = __toESM(require_react(), 1);
3734 + var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
3735 + var FieldValidity = function FieldValidity2(props) {
3736 + const {
3737 + children
3738 + } = props;
3739 + const {
3740 + validityData,
3741 + invalid: invalid2
3742 + } = useFieldRootContext(false);
3743 + const combinedFieldValidityData = React38.useMemo(() => getCombinedFieldValidityData(validityData, invalid2), [validityData, invalid2]);
3744 + const isInvalid = combinedFieldValidityData.state.valid === false;
3745 + const {
3746 + transitionStatus
3747 + } = useTransitionStatus(isInvalid);
3748 + const fieldValidityState = React38.useMemo(() => {
3749 + return {
3750 + ...combinedFieldValidityData,
3751 + validity: combinedFieldValidityData.state,
3752 + transitionStatus
3753 + };
3754 + }, [combinedFieldValidityData, transitionStatus]);
3755 + return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(React38.Fragment, {
3756 + children: children(fieldValidityState)
3757 + });
3758 + };
3759 + if (true) FieldValidity.displayName = "FieldValidity";
3760 +
3761 + // node_modules/@base-ui/react/field/item/FieldItem.mjs
3762 + var React39 = __toESM(require_react(), 1);
3763 + var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
3764 + var FieldItem = /* @__PURE__ */ React39.forwardRef(function FieldItem2(componentProps, forwardedRef) {
3765 + const {
3766 + render,
3767 + className,
3768 + style,
3769 + disabled: disabledProp = false,
3770 + ...elementProps
3771 + } = componentProps;
3772 + const {
3773 + state: fieldState,
3774 + disabled: rootDisabled
3775 + } = useFieldRootContext(false);
3776 + const disabled2 = rootDisabled || disabledProp;
3777 + const state = {
3778 + ...fieldState,
3779 + disabled: disabled2
3780 + };
3781 + const fieldItemContext = React39.useMemo(() => ({
3782 + disabled: disabled2
3783 + }), [disabled2]);
3784 + const element = useRenderElement("div", componentProps, {
3785 + ref: forwardedRef,
3786 + state,
3787 + props: elementProps,
3788 + stateAttributesMapping: fieldValidityMapping
3789 + });
3790 + return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(LabelableProvider, {
3791 + children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FieldItemContext.Provider, {
3792 + value: fieldItemContext,
3793 + children: element
3794 + })
3795 + });
3796 + });
3797 + if (true) FieldItem.displayName = "FieldItem";
3798 +
3799 + // node_modules/@base-ui/react/input/Input.mjs
3800 + var React40 = __toESM(require_react(), 1);
3801 + var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
3802 + var Input = /* @__PURE__ */ React40.forwardRef(function Input2(props, forwardedRef) {
3803 + return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(index_parts_exports.Control, {
3804 + ref: forwardedRef,
3805 + ...props
3806 + });
3807 + });
3808 + if (true) Input.displayName = "Input";
3809 +
3810 + // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs
3811 + var React42 = __toESM(require_react(), 1);
3812 +
3813 + // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs
3814 + var React41 = __toESM(require_react(), 1);
3815 +
3816 + // node_modules/@base-ui/react/internals/composite/constants.mjs
3817 + var ACTIVE_COMPOSITE_ITEM = "data-composite-item-active";
3818 +
3819 + // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs
3820 + function useCompositeRoot(params) {
3821 + const {
3822 + loopFocus = true,
3823 + orientation = "both",
3824 + grid,
3825 + onLoop,
3826 + direction,
3827 + highlightedIndex: externalHighlightedIndex,
3828 + onHighlightedIndexChange: externalSetHighlightedIndex,
3829 + rootRef: externalRef,
3830 + enableHomeAndEndKeys = false,
3831 + stopEventPropagation,
3832 + disabledIndices,
3833 + modifierKeys = EMPTY_ARRAY
3834 + } = params;
3835 + const [internalHighlightedIndex, internalSetHighlightedIndex] = React41.useState(0);
3836 + const isGrid = grid != null;
3837 + const rootRef = React41.useRef(null);
3838 + const mergedRef = useMergedRefs(rootRef, externalRef);
3839 + const elementsRef = React41.useRef([]);
3840 + const hasSetDefaultIndexRef = React41.useRef(false);
3841 + const highlightedElementRef = React41.useRef(null);
3842 + const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;
3843 + const onHighlightedIndexChange = useStableCallback((index2, shouldScrollIntoView = false) => {
3844 + highlightedElementRef.current = elementsRef.current[index2] ?? null;
3845 + (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index2);
3846 + if (shouldScrollIntoView) {
3847 + const newActiveItem = elementsRef.current[index2];
3848 + scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);
3849 + }
3850 + });
3851 + const onMapChange = useStableCallback((map) => {
3852 + if (map.size === 0) {
3853 + return;
3854 + }
3855 + if (hasSetDefaultIndexRef.current) {
3856 + const elements = elementsRef.current;
3857 + const nextIndex = elements.indexOf(highlightedElementRef.current);
3858 + if (nextIndex === -1) {
3859 + const replacement = elements[highlightedIndex];
3860 + if (!replacement || isListIndexDisabled(elements, highlightedIndex, disabledIndices)) {
3861 + onHighlightedIndexChange(getFallbackIndex(elements, disabledIndices));
3862 + } else {
3863 + highlightedElementRef.current = replacement;
3864 + }
3865 + } else if (nextIndex !== highlightedIndex) {
3866 + onHighlightedIndexChange(nextIndex);
3867 + }
3868 + return;
3869 + }
3870 + hasSetDefaultIndexRef.current = true;
3871 + const sortedElements = Array.from(map.keys());
3872 + const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null;
3873 + const activeIndex = activeItem ? map.get(activeItem)?.index ?? -1 : -1;
3874 + if (activeIndex !== -1) {
3875 + onHighlightedIndexChange(activeIndex);
3876 + } else if (isListIndexDisabled(sortedElements, highlightedIndex, disabledIndices)) {
3877 + const firstEnabledIndex = findNonDisabledListIndex(sortedElements, {
3878 + disabledIndices
3879 + });
3880 + if (!isIndexOutOfListBounds(sortedElements, firstEnabledIndex)) {
3881 + onHighlightedIndexChange(firstEnabledIndex);
3882 + }
3883 + }
3884 + scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);
3885 + });
3886 + useIsoLayoutEffect(() => {
3887 + if (disabledIndices == null || externalHighlightedIndex != null || !hasSetDefaultIndexRef.current) {
3888 + return;
3889 + }
3890 + const elements = elementsRef.current;
3891 + if (isListIndexDisabled(elements, highlightedIndex, disabledIndices)) {
3892 + const firstEnabledIndex = findNonDisabledListIndex(elements, {
3893 + disabledIndices
3894 + });
3895 + if (!isIndexOutOfListBounds(elements, firstEnabledIndex)) {
3896 + onHighlightedIndexChange(firstEnabledIndex);
3897 + }
3898 + }
3899 + }, [disabledIndices, externalHighlightedIndex, highlightedIndex, elementsRef, onHighlightedIndexChange]);
3900 + const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => {
3901 + if (!onLoop) {
3902 + return nextIndex;
3903 + }
3904 + return onLoop(event, prevIndex, nextIndex, elementsRef);
3905 + });
3906 + const onKeyDown = useStableCallback((event) => {
3907 + const isHomeOrEnd = event.key === HOME || event.key === END;
3908 + if (!COMPOSITE_KEYS.has(event.key) || !enableHomeAndEndKeys && isHomeOrEnd) {
3909 + return;
3910 + }
3911 + if (isModifierKeySet(event, modifierKeys)) {
3912 + return;
3913 + }
3914 + const element = rootRef.current;
3915 + if (!element) {
3916 + return;
3917 + }
3918 + const isRtl = direction === "rtl";
3919 + const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT;
3920 + const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT;
3921 + const forwardKey = orientation === "vertical" ? ARROW_DOWN : horizontalForwardKey;
3922 + const backwardKey = orientation === "vertical" ? ARROW_UP : horizontalBackwardKey;
3923 + const target = getTarget(event.nativeEvent);
3924 + if (target != null && isNativeInput(target) && !isElementDisabled(target)) {
3925 + const selectionStart = target.selectionStart;
3926 + const selectionEnd = target.selectionEnd;
3927 + const textContent = target.value;
3928 + if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) {
3929 + return;
3930 + }
3931 + if (event.key !== backwardKey && selectionStart < textContent.length) {
3932 + return;
3933 + }
3934 + if (event.key !== forwardKey && selectionStart > 0) {
3935 + return;
3936 + }
3937 + }
3938 + let nextIndex = highlightedIndex;
3939 + const minIndex = getMinListIndex(elementsRef, disabledIndices);
3940 + const maxIndex = getMaxListIndex(elementsRef, disabledIndices);
3941 + if (grid != null) {
3942 + nextIndex = grid({
3943 + disabledIndices,
3944 + elementsRef,
3945 + event,
3946 + highlightedIndex,
3947 + loopFocus,
3948 + maxIndex,
3949 + minIndex,
3950 + onLoop: wrappedOnLoop,
3951 + orientation,
3952 + rtl: isRtl
3953 + });
3954 + }
3955 + const isForwardKey = orientation !== "vertical" && event.key === horizontalForwardKey || orientation !== "horizontal" && event.key === ARROW_DOWN;
3956 + const isBackwardKey = orientation !== "vertical" && event.key === horizontalBackwardKey || orientation !== "horizontal" && event.key === ARROW_UP;
3957 + if (enableHomeAndEndKeys) {
3958 + if (event.key === HOME) {
3959 + nextIndex = minIndex;
3960 + } else if (event.key === END) {
3961 + nextIndex = maxIndex;
3962 + }
3963 + }
3964 + if (nextIndex === highlightedIndex && (isForwardKey || isBackwardKey)) {
3965 + if (loopFocus && nextIndex === maxIndex && isForwardKey) {
3966 + nextIndex = minIndex;
3967 + if (onLoop) {
3968 + nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
3969 + }
3970 + } else if (loopFocus && nextIndex === minIndex && isBackwardKey) {
3971 + nextIndex = maxIndex;
3972 + if (onLoop) {
3973 + nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
3974 + }
3975 + } else {
3976 + nextIndex = findNonDisabledListIndex(elementsRef.current, {
3977 + startingIndex: nextIndex,
3978 + decrement: isBackwardKey,
3979 + disabledIndices
3980 + });
3981 + }
3982 + }
3983 + if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) {
3984 + if (stopEventPropagation) {
3985 + event.stopPropagation();
3986 + }
3987 + if (isGrid || isHomeOrEnd || isForwardKey || isBackwardKey) {
3988 + event.preventDefault();
3989 + }
3990 + onHighlightedIndexChange(nextIndex, true);
3991 + queueMicrotask(() => {
3992 + elementsRef.current[nextIndex]?.focus();
3993 + });
3994 + }
3995 + });
3996 + const props = {
3997 + ref: mergedRef,
3998 + onFocus(event) {
3999 + const element = rootRef.current;
4000 + const target = getTarget(event.nativeEvent);
4001 + if (!element || target == null || !isNativeInput(target)) {
4002 + return;
4003 + }
4004 + target.setSelectionRange(0, target.value.length);
4005 + },
4006 + onKeyDown
4007 + };
4008 + return {
4009 + props,
4010 + highlightedIndex,
4011 + onHighlightedIndexChange,
4012 + elementsRef,
4013 + onMapChange,
4014 + relayKeyboardEvent: onKeyDown
4015 + };
4016 + }
4017 + function getFallbackIndex(elements, disabledIndices) {
4018 + let fallbackIndex = -1;
4019 + for (let index2 = 0; index2 < elements.length; index2 += 1) {
4020 + const element = elements[index2];
4021 + if (!element || isListIndexDisabled(elements, index2, disabledIndices)) {
4022 + continue;
4023 + }
4024 + if (element.hasAttribute(ACTIVE_COMPOSITE_ITEM)) {
4025 + return index2;
4026 + }
4027 + if (fallbackIndex === -1) {
4028 + fallbackIndex = index2;
4029 + }
4030 + }
4031 + return Math.max(fallbackIndex, 0);
4032 + }
4033 + function isModifierKeySet(event, ignoredModifierKeys) {
4034 + for (const key of MODIFIER_KEYS) {
4035 + if (ignoredModifierKeys.includes(key)) {
4036 + continue;
4037 + }
4038 + if (event.getModifierState(key)) {
4039 + return true;
4040 + }
4041 + }
4042 + return false;
4043 + }
4044 +
4045 + // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs
4046 + var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
4047 + function CompositeRoot(componentProps) {
4048 + const {
4049 + render,
4050 + className,
4051 + style,
4052 + refs = EMPTY_ARRAY,
4053 + props = EMPTY_ARRAY,
4054 + state = EMPTY_OBJECT,
4055 + stateAttributesMapping: stateAttributesMapping4,
4056 + highlightedIndex: highlightedIndexProp,
4057 + onHighlightedIndexChange: onHighlightedIndexChangeProp,
4058 + orientation,
4059 + grid,
4060 + loopFocus,
4061 + onLoop,
4062 + enableHomeAndEndKeys,
4063 + onMapChange: onMapChangeProp,
4064 + stopEventPropagation = true,
4065 + rootRef,
4066 + disabledIndices,
4067 + modifierKeys,
4068 + highlightItemOnHover = false,
4069 + tag = "div",
4070 + ...elementProps
4071 + } = componentProps;
4072 + const direction = useDirection();
4073 + const {
4074 + props: defaultProps,
4075 + highlightedIndex,
4076 + onHighlightedIndexChange,
4077 + elementsRef,
4078 + onMapChange: onMapChangeUnwrapped,
4079 + relayKeyboardEvent
4080 + } = useCompositeRoot({
4081 + grid,
4082 + loopFocus,
4083 + onLoop,
4084 + orientation,
4085 + highlightedIndex: highlightedIndexProp,
4086 + onHighlightedIndexChange: onHighlightedIndexChangeProp,
4087 + rootRef,
4088 + stopEventPropagation,
4089 + enableHomeAndEndKeys,
4090 + direction,
4091 + disabledIndices,
4092 + modifierKeys
4093 + });
4094 + const element = useRenderElement(tag, componentProps, {
4095 + state,
4096 + ref: refs,
4097 + props: [defaultProps, ...props, elementProps],
4098 + stateAttributesMapping: stateAttributesMapping4
4099 + });
4100 + const contextValue = React42.useMemo(() => ({
4101 + highlightedIndex,
4102 + onHighlightedIndexChange,
4103 + highlightItemOnHover,
4104 + relayKeyboardEvent
4105 + }), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]);
4106 + return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CompositeRootContext.Provider, {
4107 + value: contextValue,
4108 + children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CompositeList, {
4109 + elementsRef,
4110 + onMapChange: (newMap) => {
4111 + onMapChangeProp?.(newMap);
4112 + onMapChangeUnwrapped(newMap);
4113 + },
4114 + children: element
4115 + })
4116 + });
4117 + }
4118 +
4119 + // node_modules/@base-ui/react/internals/prehydrationScript.stub.mjs
4120 + var script = "";
4121 +
4122 + // node_modules/@base-ui/react/utils/useIsHydrating.mjs
4123 + var import_shim = __toESM(require_shim(), 1);
4124 + function subscribe() {
4125 + return NOOP;
4126 + }
4127 + function getSnapshot() {
4128 + return false;
4129 + }
4130 + function getServerSnapshot() {
4131 + return true;
4132 + }
4133 + function useIsHydrating() {
4134 + return (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot);
4135 + }
4136 +
4137 + // node_modules/@base-ui/react/internals/PrehydrationScript.mjs
4138 + var React43 = __toESM(require_react(), 1);
4139 + var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
4140 + function PrehydrationScript(props) {
4141 + const {
4142 + script: script2
4143 + } = props;
4144 + const {
4145 + nonce
4146 + } = useCSPContext();
4147 + const isHydrating = useIsHydrating();
4148 + if (!isHydrating) {
4149 + return null;
4150 + }
4151 + return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("script", {
4152 + nonce,
4153 + dangerouslySetInnerHTML: {
4154 + __html: script2
4155 + },
4156 + suppressHydrationWarning: true
4157 + });
4158 + }
4159 +
4160 + // node_modules/@base-ui/react/tabs/index.parts.mjs
4161 + var index_parts_exports2 = {};
4162 + __export(index_parts_exports2, {
4163 + Indicator: () => TabsIndicator,
4164 + List: () => TabsList,
4165 + Panel: () => TabsPanel,
4166 + Root: () => TabsRoot,
4167 + Tab: () => TabsTab
4168 + });
4169 +
4170 + // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs
4171 + var React45 = __toESM(require_react(), 1);
4172 +
4173 + // node_modules/@base-ui/react/tabs/root/TabsRootContext.mjs
4174 + var React44 = __toESM(require_react(), 1);
4175 + var TabsRootContext = /* @__PURE__ */ React44.createContext(void 0);
4176 + if (true) TabsRootContext.displayName = "TabsRootContext";
4177 + function useTabsRootContext() {
4178 + const context = React44.useContext(TabsRootContext);
4179 + if (context === void 0) {
4180 + throw new Error(true ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage_default(64));
4181 + }
4182 + return context;
4183 + }
4184 +
4185 + // node_modules/@base-ui/react/tabs/root/TabsRootDataAttributes.mjs
4186 + var activationDirection = "data-activation-direction";
4187 +
4188 + // node_modules/@base-ui/react/tabs/root/stateAttributesMapping.mjs
4189 + var tabsStateAttributesMapping = {
4190 + tabActivationDirection: (dir) => ({
4191 + [activationDirection]: dir
4192 + })
4193 + };
4194 +
4195 + // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs
4196 + var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
4197 + var TabsRoot = /* @__PURE__ */ React45.forwardRef(function TabsRoot2(componentProps, forwardedRef) {
4198 + const {
4199 + className,
4200 + defaultValue: defaultValueProp = 0,
4201 + onValueChange: onValueChangeProp,
4202 + orientation = "horizontal",
4203 + render,
4204 + value: valueProp,
4205 + style,
4206 + ...elementProps
4207 + } = componentProps;
4208 + const hasExplicitDefaultValueProp = componentProps.defaultValue !== void 0;
4209 + const tabPanelRefs = React45.useRef([]);
4210 + const [mountedTabPanels, setMountedTabPanels] = React45.useState(() => /* @__PURE__ */ new Map());
4211 + const [value, setValue] = useControlled({
4212 + controlled: valueProp,
4213 + default: defaultValueProp,
4214 + name: "Tabs",
4215 + state: "value"
4216 + });
4217 + const isControlled = valueProp !== void 0;
4218 + const [tabMap, setTabMap] = React45.useState(() => /* @__PURE__ */ new Map());
4219 + const lastKnownTabElementRef = React45.useRef(void 0);
4220 + const getTabElementBySelectedValue = React45.useCallback((selectedValue) => findTabElement(tabMap, selectedValue), [tabMap]);
4221 + const [activationDirectionState, setActivationDirectionState] = React45.useState(() => ({
4222 + previousValue: value,
4223 + tabActivationDirection: "none"
4224 + }));
4225 + const {
4226 + previousValue,
4227 + tabActivationDirection: committedTabActivationDirection
4228 + } = activationDirectionState;
4229 + let tabActivationDirection = committedTabActivationDirection;
4230 + let directionComputationIncomplete = false;
4231 + if (previousValue !== value) {
4232 + tabActivationDirection = computeActivationDirection(previousValue, value, orientation, tabMap);
4233 + directionComputationIncomplete = previousValue != null && value != null && getTabElementBySelectedValue(value) == null;
4234 + }
4235 + const nextPreviousValue = directionComputationIncomplete ? previousValue : value;
4236 + const shouldSyncActivationDirectionState = previousValue !== nextPreviousValue || committedTabActivationDirection !== tabActivationDirection;
4237 + useIsoLayoutEffect(() => {
4238 + if (!shouldSyncActivationDirectionState) {
4239 + return;
4240 + }
4241 + setActivationDirectionState({
4242 + previousValue: nextPreviousValue,
4243 + tabActivationDirection
4244 + });
4245 + }, [nextPreviousValue, shouldSyncActivationDirectionState, tabActivationDirection]);
4246 + const onValueChange = useStableCallback((newValue, eventDetails) => {
4247 + const activationDirection2 = computeActivationDirection(value, newValue, orientation, tabMap);
4248 + eventDetails.activationDirection = activationDirection2;
4249 + onValueChangeProp?.(newValue, eventDetails);
4250 + if (eventDetails.isCanceled) {
4251 + return;
4252 + }
4253 + setValue(newValue);
4254 + });
4255 + const notifyAutomaticValueChange = useStableCallback((nextValue, reason) => {
4256 + onValueChangeProp?.(nextValue, createChangeEventDetails(reason, void 0, void 0, {
4257 + activationDirection: "none"
4258 + }));
4259 + });
4260 + const registerMountedTabPanel = useStableCallback((panelValue, panelId) => {
4261 + setMountedTabPanels((prev) => {
4262 + const next = new Map(prev);
4263 + next.set(panelValue, panelId);
4264 + return next;
4265 + });
4266 + return () => {
4267 + setMountedTabPanels((prev) => {
4268 + if (prev.get(panelValue) !== panelId) {
4269 + return prev;
4270 + }
4271 + const next = new Map(prev);
4272 + next.delete(panelValue);
4273 + return next;
4274 + });
4275 + };
4276 + });
4277 + const getTabPanelIdByValue = React45.useCallback((tabValue) => {
4278 + return mountedTabPanels.get(tabValue);
4279 + }, [mountedTabPanels]);
4280 + const getTabIdByPanelValue = React45.useCallback((tabPanelValue) => {
4281 + for (const tabMetadata of tabMap.values()) {
4282 + if (tabPanelValue === tabMetadata.value) {
4283 + return tabMetadata.id;
4284 + }
4285 + }
4286 + return void 0;
4287 + }, [tabMap]);
4288 + const tabsContextValue = React45.useMemo(() => ({
4289 + getTabElementBySelectedValue,
4290 + getTabIdByPanelValue,
4291 + getTabPanelIdByValue,
4292 + onValueChange,
4293 + orientation,
4294 + registerMountedTabPanel,
4295 + setTabMap,
4296 + tabActivationDirection,
4297 + value
4298 + }), [getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, tabActivationDirection, value]);
4299 + const selectedTabMetadata = React45.useMemo(() => {
4300 + for (const tabMetadata of tabMap.values()) {
4301 + if (tabMetadata.value === value) {
4302 + return tabMetadata;
4303 + }
4304 + }
4305 + return void 0;
4306 + }, [tabMap, value]);
4307 + const firstEnabledTabValue = React45.useMemo(() => {
4308 + for (const tabMetadata of tabMap.values()) {
4309 + if (!tabMetadata.disabled) {
4310 + return tabMetadata.value;
4311 + }
4312 + }
4313 + return void 0;
4314 + }, [tabMap]);
4315 + const shouldNotifyInitialValueChangeRef = React45.useRef(!hasExplicitDefaultValueProp);
4316 + const initialDefaultValueRef = React45.useRef(defaultValueProp);
4317 + const shouldHonorDisabledDefaultValueRef = React45.useRef(hasExplicitDefaultValueProp);
4318 + const didRegisterTabsRef = React45.useRef(false);
4319 + useIsoLayoutEffect(() => {
4320 + if (isControlled) {
4321 + return;
4322 + }
4323 + function commitAutomaticValueChange(fallbackValue, fallbackReason) {
4324 + setValue(fallbackValue);
4325 + setActivationDirectionState({
4326 + previousValue: fallbackValue,
4327 + tabActivationDirection: "none"
4328 + });
4329 + notifyAutomaticValueChange(fallbackValue, fallbackReason);
4330 + shouldNotifyInitialValueChangeRef.current = false;
4331 + }
4332 + if (tabMap.size === 0) {
4333 + if (didRegisterTabsRef.current && value !== null && !lastKnownTabElementRef.current?.isConnected) {
4334 + commitAutomaticValueChange(null, reason_parts_exports.missing);
4335 + }
4336 + return;
4337 + }
4338 + didRegisterTabsRef.current = true;
4339 + lastKnownTabElementRef.current = tabMap.keys().next().value;
4340 + const selectionIsDisabled = selectedTabMetadata?.disabled;
4341 + const selectionIsMissing = selectedTabMetadata == null && value !== null;
4342 + if (!selectionIsDisabled && value === initialDefaultValueRef.current) {
4343 + shouldHonorDisabledDefaultValueRef.current = false;
4344 + }
4345 + if (shouldHonorDisabledDefaultValueRef.current && selectionIsDisabled && value === initialDefaultValueRef.current) {
4346 + return;
4347 + }
4348 + const shouldNotifyInitialValueChange = shouldNotifyInitialValueChangeRef.current;
4349 + if (selectionIsDisabled || selectionIsMissing) {
4350 + const fallbackValue = firstEnabledTabValue ?? null;
4351 + if (value === fallbackValue) {
4352 + shouldNotifyInitialValueChangeRef.current = false;
4353 + return;
4354 + }
4355 + let fallbackReason = reason_parts_exports.missing;
4356 + if (shouldNotifyInitialValueChange) {
4357 + fallbackReason = reason_parts_exports.initial;
4358 + } else if (selectionIsDisabled) {
4359 + fallbackReason = reason_parts_exports.disabled;
4360 + }
4361 + commitAutomaticValueChange(fallbackValue, fallbackReason);
4362 + return;
4363 + }
4364 + if (shouldNotifyInitialValueChange && selectedTabMetadata != null) {
4365 + notifyAutomaticValueChange(value, reason_parts_exports.initial);
4366 + shouldNotifyInitialValueChangeRef.current = false;
4367 + }
4368 + }, [firstEnabledTabValue, isControlled, notifyAutomaticValueChange, selectedTabMetadata, setValue, tabMap, value]);
4369 + const state = {
4370 + orientation,
4371 + tabActivationDirection
4372 + };
4373 + const element = useRenderElement("div", componentProps, {
4374 + state,
4375 + ref: forwardedRef,
4376 + props: elementProps,
4377 + stateAttributesMapping: tabsStateAttributesMapping
4378 + });
4379 + return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabsRootContext.Provider, {
4380 + value: tabsContextValue,
4381 + children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CompositeList, {
4382 + elementsRef: tabPanelRefs,
4383 + children: element
4384 + })
4385 + });
4386 + });
4387 + if (true) TabsRoot.displayName = "TabsRoot";
4388 + function findTabElement(tabMap, value) {
4389 + for (const [tabElement, tabMetadata] of tabMap.entries()) {
4390 + if (value === tabMetadata.value) {
4391 + return tabElement;
4392 + }
4393 + }
4394 + return null;
4395 + }
4396 + function computeActivationDirection(oldValue, newValue, orientation, tabMap) {
4397 + if (oldValue == null || newValue == null) {
4398 + return "none";
4399 + }
4400 + const [positionProp, backward, forward] = orientation === "horizontal" ? ["left", "left", "right"] : ["top", "up", "down"];
4401 + const oldTab = findTabElement(tabMap, oldValue);
4402 + const newTab = findTabElement(tabMap, newValue);
4403 + if (oldTab == null || newTab == null) {
4404 + if (oldTab !== newTab && (typeof oldValue === "number" || typeof oldValue === "string") && typeof oldValue === typeof newValue) {
4405 + return newValue > oldValue ? forward : backward;
4406 + }
4407 + return "none";
4408 + }
4409 + const oldPosition = oldTab.getBoundingClientRect()[positionProp];
4410 + const newPosition = newTab.getBoundingClientRect()[positionProp];
4411 + if (newPosition < oldPosition) {
4412 + return backward;
4413 + }
4414 + if (newPosition > oldPosition) {
4415 + return forward;
4416 + }
4417 + return "none";
4418 + }
4419 +
4420 + // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs
4421 + var React47 = __toESM(require_react(), 1);
4422 +
4423 + // node_modules/@base-ui/react/tabs/list/TabsListContext.mjs
4424 + var React46 = __toESM(require_react(), 1);
4425 + var TabsListContext = /* @__PURE__ */ React46.createContext(void 0);
4426 + if (true) TabsListContext.displayName = "TabsListContext";
4427 + function useTabsListContext() {
4428 + const context = React46.useContext(TabsListContext);
4429 + if (context === void 0) {
4430 + throw new Error(true ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage_default(65));
4431 + }
4432 + return context;
4433 + }
4434 +
4435 + // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs
4436 + var TabsTab = /* @__PURE__ */ React47.forwardRef(function TabsTab2(componentProps, forwardedRef) {
4437 + const {
4438 + className,
4439 + disabled: disabled2 = false,
4440 + render,
4441 + value,
4442 + id: idProp,
4443 + nativeButton = true,
4444 + style,
4445 + ...elementProps
4446 + } = componentProps;
4447 + const {
4448 + value: activeTabValue,
4449 + getTabPanelIdByValue,
4450 + onValueChange,
4451 + orientation,
4452 + tabActivationDirection
4453 + } = useTabsRootContext();
4454 + const {
4455 + activateOnFocus,
4456 + registerTabResizeObserverElement,
4457 + tabsListElement
4458 + } = useTabsListContext();
4459 + const {
4460 + highlightedIndex,
4461 + onHighlightedIndexChange
4462 + } = useCompositeRootContext();
4463 + const id = useBaseUiId(idProp);
4464 + const tabMetadata = React47.useMemo(() => ({
4465 + disabled: disabled2,
4466 + id,
4467 + value
4468 + }), [disabled2, id, value]);
4469 + const {
4470 + compositeProps,
4471 + compositeRef,
4472 + index: index2
4473 + // hook is used instead of the CompositeItem component
4474 + // because the index is needed for Tab internals
4475 + } = useCompositeItem({
4476 + metadata: tabMetadata
4477 + });
4478 + const active = value === activeTabValue;
4479 + const isNavigatingRef = React47.useRef(false);
4480 + const unobserveTabElementRef = React47.useRef(null);
4481 + const observeTabElement = useStableCallback((element2) => {
4482 + unobserveTabElementRef.current?.();
4483 + unobserveTabElementRef.current = element2 ? registerTabResizeObserverElement(element2) : null;
4484 + });
4485 + useIsoLayoutEffect(() => {
4486 + if (isNavigatingRef.current) {
4487 + isNavigatingRef.current = false;
4488 + return;
4489 + }
4490 + if (!(active && index2 > -1 && highlightedIndex !== index2)) {
4491 + return;
4492 + }
4493 + const listElement = tabsListElement;
4494 + if (listElement != null) {
4495 + const activeEl = activeElement(ownerDocument(listElement));
4496 + if (activeEl && contains(listElement, activeEl)) {
4497 + return;
4498 + }
4499 + }
4500 + if (!disabled2) {
4501 + onHighlightedIndexChange(index2);
4502 + }
4503 + }, [active, index2, highlightedIndex, onHighlightedIndexChange, disabled2, tabsListElement]);
4504 + const {
4505 + getButtonProps,
4506 + buttonRef
4507 + } = useButton({
4508 + disabled: disabled2,
4509 + native: nativeButton,
4510 + focusableWhenDisabled: true
4511 + });
4512 + const tabPanelId = getTabPanelIdByValue(value);
4513 + const isPressingRef = React47.useRef(false);
4514 + const isMainButtonRef = React47.useRef(false);
4515 + function activate(event) {
4516 + onValueChange(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
4517 + activationDirection: "none"
4518 + }));
4519 + }
4520 + function onClick(event) {
4521 + if (active || disabled2) {
4522 + return;
4523 + }
4524 + activate(event);
4525 + }
4526 + function onFocus(event) {
4527 + if (active || disabled2) {
4528 + return;
4529 + }
4530 + if (activateOnFocus && (!isPressingRef.current || // keyboard or touch focus
4531 + isMainButtonRef.current)) {
4532 + activate(event);
4533 + }
4534 + }
4535 + function onPointerDown(event) {
4536 + if (active || disabled2) {
4537 + return;
4538 + }
4539 + isPressingRef.current = true;
4540 + isMainButtonRef.current = event.button === 0;
4541 + const doc = ownerDocument(event.currentTarget);
4542 + function handlePointerEnd() {
4543 + isPressingRef.current = false;
4544 + isMainButtonRef.current = false;
4545 + doc.removeEventListener("pointerup", handlePointerEnd);
4546 + doc.removeEventListener("pointercancel", handlePointerEnd);
4547 + }
4548 + doc.addEventListener("pointerup", handlePointerEnd);
4549 + doc.addEventListener("pointercancel", handlePointerEnd);
4550 + }
4551 + const state = {
4552 + disabled: disabled2,
4553 + active,
4554 + orientation,
4555 + tabActivationDirection
4556 + };
4557 + const element = useRenderElement("button", componentProps, {
4558 + state,
4559 + ref: [forwardedRef, buttonRef, compositeRef, observeTabElement],
4560 + props: [compositeProps, {
4561 + role: "tab",
4562 + "aria-controls": tabPanelId,
4563 + "aria-selected": active,
4564 + id,
4565 + onClick,
4566 + onFocus,
4567 + onPointerDown,
4568 + [ACTIVE_COMPOSITE_ITEM]: active ? "" : void 0,
4569 + onKeyDownCapture() {
4570 + isNavigatingRef.current = true;
4571 + }
4572 + }, elementProps, getButtonProps],
4573 + stateAttributesMapping: tabsStateAttributesMapping
4574 + });
4575 + return element;
4576 + });
4577 + if (true) TabsTab.displayName = "TabsTab";
4578 +
4579 + // node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs
4580 + var React48 = __toESM(require_react(), 1);
4581 +
4582 + // node_modules/@base-ui/react/tabs/indicator/TabsIndicatorCssVars.mjs
4583 + var activeTabLeft = "--active-tab-left";
4584 + var activeTabRight = "--active-tab-right";
4585 + var activeTabTop = "--active-tab-top";
4586 + var activeTabBottom = "--active-tab-bottom";
4587 + var activeTabWidth = "--active-tab-width";
4588 + var activeTabHeight = "--active-tab-height";
4589 +
4590 + // node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs
4591 + var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
4592 + var _PrehydrationScript;
4593 + var stateAttributesMapping2 = {
4594 + ...tabsStateAttributesMapping,
4595 + activeTabPosition: () => null,
4596 + activeTabSize: () => null
4597 + };
4598 + var MAX_LAYOUT_ROUNDING_ERROR = 2;
4599 + var TabsIndicator = /* @__PURE__ */ React48.forwardRef(function TabsIndicator2(componentProps, forwardedRef) {
4600 + const {
4601 + className,
4602 + render,
4603 + renderBeforeHydration = false,
4604 + style: styleProp,
4605 + ...elementProps
4606 + } = componentProps;
4607 + const {
4608 + getTabElementBySelectedValue,
4609 + orientation,
4610 + tabActivationDirection,
4611 + value
4612 + } = useTabsRootContext();
4613 + const {
4614 + tabsListElement,
4615 + registerIndicatorUpdateListener
4616 + } = useTabsListContext();
4617 + const rerender = useForcedRerendering();
4618 + React48.useEffect(() => {
4619 + return registerIndicatorUpdateListener(rerender);
4620 + }, [registerIndicatorUpdateListener, rerender]);
4621 + let left = 0;
4622 + let right = 0;
4623 + let top = 0;
4624 + let bottom = 0;
4625 + let width = 0;
4626 + let height = 0;
4627 + let isTabSelected = false;
4628 + if (value != null && tabsListElement != null) {
4629 + const activeTab = getTabElementBySelectedValue(value);
4630 + if (activeTab != null) {
4631 + isTabSelected = true;
4632 + const {
4633 + width: computedWidth,
4634 + height: computedHeight
4635 + } = getCssDimensions(activeTab);
4636 + const {
4637 + width: tabListWidth,
4638 + height: tabListHeight
4639 + } = getCssDimensions(tabsListElement);
4640 + const tabRect = activeTab.getBoundingClientRect();
4641 + const tabsListRect = tabsListElement.getBoundingClientRect();
4642 + const scaleX = tabListWidth > 0 ? tabsListRect.width / tabListWidth : 1;
4643 + const scaleY = tabListHeight > 0 ? tabsListRect.height / tabListHeight : 1;
4644 + const layoutOffset = getLayoutOffset(activeTab, tabsListElement);
4645 + left = layoutOffset.left;
4646 + top = layoutOffset.top;
4647 + const rectLeft = (tabRect.left - tabsListRect.left) / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft;
4648 + const rectTop = (tabRect.top - tabsListRect.top) / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop;
4649 + const tabTranslation = getActiveTabTranslation(activeTab);
4650 + if (Math.abs(rectLeft - tabTranslation.x - left) <= MAX_LAYOUT_ROUNDING_ERROR && Math.abs(rectTop - tabTranslation.y - top) <= MAX_LAYOUT_ROUNDING_ERROR) {
4651 + left = rectLeft;
4652 + top = rectTop;
4653 + }
4654 + width = computedWidth;
4655 + height = computedHeight;
4656 + right = tabsListElement.scrollWidth - left - width;
4657 + bottom = tabsListElement.scrollHeight - top - height;
4658 + }
4659 + }
4660 + const activeTabPosition = isTabSelected ? {
4661 + left,
4662 + right,
4663 + top,
4664 + bottom
4665 + } : null;
4666 + const activeTabSize = isTabSelected ? {
4667 + width,
4668 + height
4669 + } : null;
4670 + const style = isTabSelected ? {
4671 + [activeTabLeft]: `${left}px`,
4672 + [activeTabRight]: `${right}px`,
4673 + [activeTabTop]: `${top}px`,
4674 + [activeTabBottom]: `${bottom}px`,
4675 + [activeTabWidth]: `${width}px`,
4676 + [activeTabHeight]: `${height}px`
4677 + } : void 0;
4678 + const displayIndicator = isTabSelected && width > 0 && height > 0;
4679 + const state = {
4680 + orientation,
4681 + activeTabPosition,
4682 + activeTabSize,
4683 + tabActivationDirection
4684 + };
4685 + const element = useRenderElement("span", componentProps, {
4686 + state,
4687 + ref: forwardedRef,
4688 + props: [{
4689 + role: "presentation",
4690 + style,
4691 + hidden: !displayIndicator
4692 + // do not display the indicator before the layout is settled
4693 + }, elementProps, {
4694 + suppressHydrationWarning: true
4695 + }],
4696 + stateAttributesMapping: stateAttributesMapping2
4697 + });
4698 + if (value == null) {
4699 + return null;
4700 + }
4701 + return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(React48.Fragment, {
4702 + children: [element, renderBeforeHydration && (_PrehydrationScript || (_PrehydrationScript = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PrehydrationScript, {
4703 + script
4704 + })))]
4705 + });
4706 + });
4707 + if (true) TabsIndicator.displayName = "TabsIndicator";
4708 + function getLayoutOffset(element, ancestor) {
4709 + const elementOffset = getCumulativeOffset(element);
4710 + const ancestorOffset = getCumulativeOffset(ancestor);
4711 + let left = elementOffset.left - ancestorOffset.left - ancestor.clientLeft;
4712 + let top = elementOffset.top - ancestorOffset.top - ancestor.clientTop;
4713 + let node = getParentNode(element);
4714 + while (isHTMLElement(node) && node !== ancestor && !isLastTraversableNode(node)) {
4715 + left -= node.scrollLeft;
4716 + top -= node.scrollTop;
4717 + node = getParentNode(node);
4718 + }
4719 + return {
4720 + left,
4721 + top
4722 + };
4723 + }
4724 + function getCumulativeOffset(element) {
4725 + let left = 0;
4726 + let top = 0;
4727 + let currentElement = element;
4728 + while (currentElement != null) {
4729 + left += currentElement.offsetLeft;
4730 + top += currentElement.offsetTop;
4731 + const offsetParent = currentElement.offsetParent;
4732 + if (offsetParent != null) {
4733 + left += offsetParent.clientLeft;
4734 + top += offsetParent.clientTop;
4735 + }
4736 + currentElement = offsetParent;
4737 + }
4738 + return {
4739 + left,
4740 + top
4741 + };
4742 + }
4743 + function getActiveTabTranslation(element) {
4744 + const computedStyle = getWindow(element).getComputedStyle(element);
4745 + const {
4746 + x,
4747 + y
4748 + } = getElementTransform(element, computedStyle);
4749 + let translateX = x;
4750 + let translateY = y;
4751 + const {
4752 + translate
4753 + } = computedStyle;
4754 + if (translate && translate !== "none") {
4755 + const parts = translate.split(" ");
4756 + translateX += resolveTranslateLength(parts[0], element.offsetWidth);
4757 + translateY += resolveTranslateLength(parts[1], element.offsetHeight);
4758 + }
4759 + return {
4760 + x: translateX,
4761 + y: translateY
4762 + };
4763 + }
4764 + function resolveTranslateLength(value, referenceSize) {
4765 + if (!value) {
4766 + return 0;
4767 + }
4768 + const numeric = parseFloat(value);
4769 + if (!Number.isFinite(numeric)) {
4770 + return 0;
4771 + }
4772 + return value.endsWith("%") ? numeric / 100 * referenceSize : numeric;
4773 + }
4774 +
4775 + // node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs
4776 + var React49 = __toESM(require_react(), 1);
4777 +
4778 + // node_modules/@base-ui/react/tabs/panel/TabsPanelDataAttributes.mjs
4779 + var index = "data-index";
4780 + var startingStyle2 = TransitionStatusDataAttributes_exports.startingStyle;
4781 + var endingStyle2 = TransitionStatusDataAttributes_exports.endingStyle;
4782 +
4783 + // node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs
4784 + var stateAttributesMapping3 = {
4785 + ...tabsStateAttributesMapping,
4786 + ...transitionStatusMapping
4787 + };
4788 + var TabsPanel = /* @__PURE__ */ React49.forwardRef(function TabsPanel2(componentProps, forwardedRef) {
4789 + const {
4790 + className,
4791 + value,
4792 + render,
4793 + keepMounted = false,
4794 + style,
4795 + ...elementProps
4796 + } = componentProps;
4797 + const {
4798 + value: selectedValue,
4799 + getTabIdByPanelValue,
4800 + orientation,
4801 + tabActivationDirection,
4802 + registerMountedTabPanel
4803 + } = useTabsRootContext();
4804 + const id = useBaseUiId();
4805 + const {
4806 + ref: listItemRef,
4807 + index: index2
4808 + } = useCompositeListItem();
4809 + const open = value === selectedValue;
4810 + const {
4811 + mounted,
4812 + transitionStatus,
4813 + setMounted
4814 + } = useTransitionStatus(open);
4815 + const hidden = !mounted;
4816 + const correspondingTabId = getTabIdByPanelValue(value);
4817 + const state = {
4818 + hidden,
4819 + orientation,
4820 + tabActivationDirection,
4821 + transitionStatus
4822 + };
4823 + const panelRef = React49.useRef(null);
4824 + const element = useRenderElement("div", componentProps, {
4825 + state,
4826 + ref: [forwardedRef, listItemRef, panelRef],
4827 + props: [{
4828 + "aria-labelledby": correspondingTabId,
4829 + hidden,
4830 + id,
4831 + role: "tabpanel",
4832 + tabIndex: open ? 0 : -1,
4833 + inert: inertValue(!open),
4834 + // Computed key: a plain literal key fails the DOM-props excess property check.
4835 + [index]: index2
4836 + }, elementProps],
4837 + stateAttributesMapping: stateAttributesMapping3
4838 + });
4839 + useOpenChangeComplete({
4840 + open,
4841 + ref: panelRef,
4842 + onComplete() {
4843 + if (!open) {
4844 + setMounted(false);
4845 + }
4846 + }
4847 + });
4848 + useIsoLayoutEffect(() => {
4849 + if (id == null || hidden && !keepMounted) {
4850 + return void 0;
4851 + }
4852 + return registerMountedTabPanel(value, id);
4853 + }, [hidden, keepMounted, value, id, registerMountedTabPanel]);
4854 + const shouldRender = keepMounted || mounted;
4855 + if (!shouldRender) {
4856 + return null;
4857 + }
4858 + return element;
4859 + });
4860 + if (true) TabsPanel.displayName = "TabsPanel";
4861 +
4862 + // node_modules/@base-ui/react/tabs/list/TabsList.mjs
4863 + var React50 = __toESM(require_react(), 1);
4864 + var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
4865 + var TabsList = /* @__PURE__ */ React50.forwardRef(function TabsList2(componentProps, forwardedRef) {
4866 + const {
4867 + activateOnFocus = false,
4868 + className,
4869 + loopFocus = true,
4870 + render,
4871 + style,
4872 + ...elementProps
4873 + } = componentProps;
4874 + const {
4875 + orientation,
4876 + setTabMap,
4877 + tabActivationDirection
4878 + } = useTabsRootContext();
4879 + const [highlightedTabIndex, setHighlightedTabIndex] = React50.useState(0);
4880 + const [tabsListElement, setTabsListElement] = React50.useState(null);
4881 + const indicatorUpdateListenersRef = React50.useRef(/* @__PURE__ */ new Set());
4882 + const tabResizeObserverElementsRef = React50.useRef(/* @__PURE__ */ new Set());
4883 + const resizeObserverRef = React50.useRef(null);
4884 + useIsoLayoutEffect(() => {
4885 + if (typeof ResizeObserver === "undefined") {
4886 + return void 0;
4887 + }
4888 + const resizeObserver = new ResizeObserver(() => {
4889 + indicatorUpdateListenersRef.current.forEach((listener) => {
4890 + listener();
4891 + });
4892 + });
4893 + resizeObserverRef.current = resizeObserver;
4894 + if (tabsListElement) {
4895 + resizeObserver.observe(tabsListElement);
4896 + }
4897 + tabResizeObserverElementsRef.current.forEach((element) => {
4898 + resizeObserver.observe(element);
4899 + });
4900 + return () => {
4901 + resizeObserver.disconnect();
4902 + resizeObserverRef.current = null;
4903 + };
4904 + }, [tabsListElement]);
4905 + const registerIndicatorUpdateListener = useStableCallback((listener) => {
4906 + indicatorUpdateListenersRef.current.add(listener);
4907 + return () => {
4908 + indicatorUpdateListenersRef.current.delete(listener);
4909 + };
4910 + });
4911 + const registerTabResizeObserverElement = useStableCallback((element) => {
4912 + tabResizeObserverElementsRef.current.add(element);
4913 + resizeObserverRef.current?.observe(element);
4914 + return () => {
4915 + tabResizeObserverElementsRef.current.delete(element);
4916 + resizeObserverRef.current?.unobserve(element);
4917 + };
4918 + });
4919 + const state = {
4920 + orientation,
4921 + tabActivationDirection
4922 + };
4923 + const defaultProps = {
4924 + "aria-orientation": orientation === "vertical" ? "vertical" : void 0,
4925 + role: "tablist"
4926 + };
4927 + const tabsListContextValue = React50.useMemo(() => ({
4928 + activateOnFocus,
4929 + registerIndicatorUpdateListener,
4930 + registerTabResizeObserverElement,
4931 + tabsListElement
4932 + }), [activateOnFocus, registerIndicatorUpdateListener, registerTabResizeObserverElement, tabsListElement]);
4933 + return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TabsListContext.Provider, {
4934 + value: tabsListContextValue,
4935 + children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CompositeRoot, {
4936 + render,
4937 + className,
4938 + style,
4939 + state,
4940 + refs: [forwardedRef, setTabsListElement],
4941 + props: [defaultProps, elementProps],
4942 + stateAttributesMapping: tabsStateAttributesMapping,
4943 + highlightedIndex: highlightedTabIndex,
4944 + enableHomeAndEndKeys: true,
4945 + loopFocus,
4946 + orientation,
4947 + onHighlightedIndexChange: setHighlightedTabIndex,
4948 + onMapChange: setTabMap,
4949 + disabledIndices: EMPTY_ARRAY
4950 + })
4951 + });
4952 + });
4953 + if (true) TabsList.displayName = "TabsList";
4954 +
4955 + // node_modules/@base-ui/react/use-render/useRender.mjs
4956 + function useRender(params) {
4957 + return useRenderElement(params.defaultTagName ?? "div", params, params);
4958 + }
4959 +
4960 + // packages/ui/build-module/utils/direction-provider.mjs
327 4961 var import_i18n3 = __toESM(require_i18n(), 1);
4962 + var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
4963 + function DirectionProvider3({ children }) {
4964 + return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DirectionProvider, { direction: (0, import_i18n3.isRTL)() ? "rtl" : "ltr", children });
4965 + }
4966 +
4967 + // packages/ui/build-module/link/link.mjs
328 4968 var import_element2 = __toESM(require_element(), 1);
4969 + var import_i18n4 = __toESM(require_i18n(), 1);
4970 + var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
4971 + var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
4972 + function getRuntime() {
4973 + const globalScope = globalThis;
4974 + if (globalScope.__wpStyleRuntime) {
4975 + return globalScope.__wpStyleRuntime;
4976 + }
4977 + globalScope.__wpStyleRuntime = {
4978 + documents: /* @__PURE__ */ new Map(),
4979 + styles: /* @__PURE__ */ new Map(),
4980 + injectedStyles: /* @__PURE__ */ new WeakMap()
4981 + };
4982 + if (typeof document !== "undefined") {
4983 + registerDocument(document);
4984 + }
4985 + return globalScope.__wpStyleRuntime;
4986 + }
4987 + function documentContainsStyleHash(targetDocument, hash) {
4988 + if (!targetDocument.head) {
4989 + return false;
4990 + }
4991 + for (const style of targetDocument.head.querySelectorAll(
4992 + `style[${STYLE_HASH_ATTRIBUTE}]`
4993 + )) {
4994 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
4995 + return true;
4996 + }
4997 + }
4998 + return false;
4999 + }
5000 + function injectStyle(targetDocument, hash, css) {
5001 + if (!targetDocument.head) {
5002 + return;
5003 + }
5004 + const runtime = getRuntime();
5005 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5006 + if (!injectedStyles) {
5007 + injectedStyles = /* @__PURE__ */ new Set();
5008 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5009 + }
5010 + if (injectedStyles.has(hash)) {
5011 + return;
5012 + }
5013 + if (documentContainsStyleHash(targetDocument, hash)) {
5014 + injectedStyles.add(hash);
5015 + return;
5016 + }
5017 + const style = targetDocument.createElement("style");
5018 + style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
5019 + style.appendChild(targetDocument.createTextNode(css));
5020 + targetDocument.head.appendChild(style);
5021 + injectedStyles.add(hash);
5022 + }
5023 + function registerDocument(targetDocument) {
5024 + const runtime = getRuntime();
5025 + runtime.documents.set(
5026 + targetDocument,
5027 + (runtime.documents.get(targetDocument) ?? 0) + 1
5028 + );
5029 + for (const [hash, css] of runtime.styles) {
5030 + injectStyle(targetDocument, hash, css);
5031 + }
5032 + return () => {
5033 + const count = runtime.documents.get(targetDocument);
5034 + if (count === void 0) {
5035 + return;
5036 + }
5037 + if (count <= 1) {
5038 + runtime.documents.delete(targetDocument);
5039 + return;
5040 + }
5041 + runtime.documents.set(targetDocument, count - 1);
5042 + };
5043 + }
5044 + function registerStyle(hash, css) {
5045 + const runtime = getRuntime();
5046 + runtime.styles.set(hash, css);
5047 + for (const targetDocument of runtime.documents.keys()) {
5048 + injectStyle(targetDocument, hash, css);
5049 + }
5050 + }
5051 + if (typeof process === "undefined" || true) {
5052 + registerStyle("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
5053 + }
5054 + var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
5055 + if (typeof process === "undefined" || true) {
5056 + registerStyle("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
5057 + }
5058 + var focus_module_default = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
5059 + if (typeof process === "undefined" || true) {
5060 + registerStyle("e8e6a9be37", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d4250949359b05ce__link{text-decoration-thickness:from-font;text-underline-offset:.2em}.c6055659b8e2cd2c__is-brand,.c6055659b8e2cd2c__is-brand:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.c6055659b8e2cd2c__is-brand:active,.c6055659b8e2cd2c__is-brand:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._92e0dfcaeee15b88__is-neutral,._92e0dfcaeee15b88__is-neutral:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d)}._92e0dfcaeee15b88__is-neutral:active,._92e0dfcaeee15b88__is-neutral:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}.cf122a9bf1035d42__is-unstyled{--_gcd-a-color:inherit;color:inherit;text-decoration:none}._0cb411afac4c86c7__link-icon{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-padding-xs,4px);text-decoration:none}._0cb411afac4c86c7__link-icon:after{content:"\\2197"}._0cb411afac4c86c7__link-icon:dir(rtl):after{content:"\\2196"}}}');
5061 + }
5062 + var style_default = { "link": "d4250949359b05ce__link", "is-brand": "c6055659b8e2cd2c__is-brand", "is-neutral": "_92e0dfcaeee15b88__is-neutral", "is-unstyled": "cf122a9bf1035d42__is-unstyled", "link-icon": "_0cb411afac4c86c7__link-icon" };
5063 + if (typeof process === "undefined" || true) {
5064 + registerStyle("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
5065 + }
5066 + var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
5067 + var Link = (0, import_element2.forwardRef)(function Link2({
5068 + children,
5069 + variant = "default",
5070 + tone = "brand",
5071 + openInNewTab = false,
5072 + target,
5073 + render,
5074 + className,
5075 + ...props
5076 + }, ref) {
5077 + const shouldShowNewTabIndicator = openInNewTab || /^_blank$/i.test(target ?? "");
5078 + const element = useRender({
5079 + render,
5080 + defaultTagName: "a",
5081 + ref,
5082 + props: mergeProps(props, {
5083 + className: clsx_default(
5084 + global_css_defense_default.a,
5085 + resets_default["box-sizing"],
5086 + focus_module_default["outset-ring--focus-except-active"],
5087 + variant !== "unstyled" && style_default.link,
5088 + variant !== "unstyled" && style_default[`is-${tone}`],
5089 + variant === "unstyled" && style_default["is-unstyled"],
5090 + className
5091 + ),
5092 + target: target ?? (openInNewTab ? "_blank" : void 0),
5093 + children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
5094 + children,
5095 + shouldShowNewTabIndicator && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5096 + "span",
5097 + {
5098 + className: style_default["link-icon"],
5099 + role: "img",
5100 + "aria-label": (
5101 + /* translators: accessibility text appended to link text */
5102 + (0, import_i18n4.__)("(opens in a new tab)")
5103 + )
5104 + }
5105 + )
5106 + ] })
5107 + })
5108 + });
5109 + return element;
5110 + });
5111 +
5112 + // packages/ui/build-module/icon/icon.mjs
5113 + var import_element3 = __toESM(require_element(), 1);
5114 + var import_primitives18 = __toESM(require_primitives(), 1);
5115 + var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
5116 + var Icon = (0, import_element3.forwardRef)(function Icon2({ icon, size = 24, style, ...restProps }, ref) {
5117 + const mergedStyle = icon.props.style || style ? { ...icon.props.style, ...style } : void 0;
5118 + return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5119 + import_primitives18.SVG,
5120 + {
5121 + ref,
5122 + ...icon.props,
5123 + ...restProps,
5124 + ...mergedStyle ? { style: mergedStyle } : {},
5125 + width: size,
5126 + height: size
5127 + }
5128 + );
5129 + });
5130 +
5131 + // packages/ui/build-module/visually-hidden/visually-hidden.mjs
5132 + var import_element4 = __toESM(require_element(), 1);
5133 + var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
5134 + function getRuntime2() {
5135 + const globalScope = globalThis;
5136 + if (globalScope.__wpStyleRuntime) {
5137 + return globalScope.__wpStyleRuntime;
5138 + }
5139 + globalScope.__wpStyleRuntime = {
5140 + documents: /* @__PURE__ */ new Map(),
5141 + styles: /* @__PURE__ */ new Map(),
5142 + injectedStyles: /* @__PURE__ */ new WeakMap()
5143 + };
5144 + if (typeof document !== "undefined") {
5145 + registerDocument2(document);
5146 + }
5147 + return globalScope.__wpStyleRuntime;
5148 + }
5149 + function documentContainsStyleHash2(targetDocument, hash) {
5150 + if (!targetDocument.head) {
5151 + return false;
5152 + }
5153 + for (const style of targetDocument.head.querySelectorAll(
5154 + `style[${STYLE_HASH_ATTRIBUTE2}]`
5155 + )) {
5156 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
5157 + return true;
5158 + }
5159 + }
5160 + return false;
5161 + }
5162 + function injectStyle2(targetDocument, hash, css) {
5163 + if (!targetDocument.head) {
5164 + return;
5165 + }
5166 + const runtime = getRuntime2();
5167 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5168 + if (!injectedStyles) {
5169 + injectedStyles = /* @__PURE__ */ new Set();
5170 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5171 + }
5172 + if (injectedStyles.has(hash)) {
5173 + return;
5174 + }
5175 + if (documentContainsStyleHash2(targetDocument, hash)) {
5176 + injectedStyles.add(hash);
5177 + return;
5178 + }
5179 + const style = targetDocument.createElement("style");
5180 + style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
5181 + style.appendChild(targetDocument.createTextNode(css));
5182 + targetDocument.head.appendChild(style);
5183 + injectedStyles.add(hash);
5184 + }
5185 + function registerDocument2(targetDocument) {
5186 + const runtime = getRuntime2();
5187 + runtime.documents.set(
5188 + targetDocument,
5189 + (runtime.documents.get(targetDocument) ?? 0) + 1
5190 + );
5191 + for (const [hash, css] of runtime.styles) {
5192 + injectStyle2(targetDocument, hash, css);
5193 + }
5194 + return () => {
5195 + const count = runtime.documents.get(targetDocument);
5196 + if (count === void 0) {
5197 + return;
5198 + }
5199 + if (count <= 1) {
5200 + runtime.documents.delete(targetDocument);
5201 + return;
5202 + }
5203 + runtime.documents.set(targetDocument, count - 1);
5204 + };
5205 + }
5206 + function registerStyle2(hash, css) {
5207 + const runtime = getRuntime2();
5208 + runtime.styles.set(hash, css);
5209 + for (const targetDocument of runtime.documents.keys()) {
5210 + injectStyle2(targetDocument, hash, css);
5211 + }
5212 + }
5213 + if (typeof process === "undefined" || true) {
5214 + registerStyle2("f4df7461e9", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px;word-break:normal}}}");
5215 + }
5216 + var style_default2 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
5217 + var VisuallyHidden = (0, import_element4.forwardRef)(
5218 + function VisuallyHidden2({ render, ...restProps }, ref) {
5219 + const element = useRender({
5220 + render,
5221 + ref,
5222 + props: mergeProps(
5223 + { className: style_default2["visually-hidden"] },
5224 + restProps,
5225 + {
5226 + // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it.
5227 + "data-visually-hidden": ""
5228 + }
5229 + )
5230 + });
5231 + return element;
5232 + }
5233 + );
5234 +
5235 + // packages/ui/build-module/stack/stack.mjs
5236 + var import_element5 = __toESM(require_element(), 1);
5237 + var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
5238 + function getRuntime3() {
5239 + const globalScope = globalThis;
5240 + if (globalScope.__wpStyleRuntime) {
5241 + return globalScope.__wpStyleRuntime;
5242 + }
5243 + globalScope.__wpStyleRuntime = {
5244 + documents: /* @__PURE__ */ new Map(),
5245 + styles: /* @__PURE__ */ new Map(),
5246 + injectedStyles: /* @__PURE__ */ new WeakMap()
5247 + };
5248 + if (typeof document !== "undefined") {
5249 + registerDocument3(document);
5250 + }
5251 + return globalScope.__wpStyleRuntime;
5252 + }
5253 + function documentContainsStyleHash3(targetDocument, hash) {
5254 + if (!targetDocument.head) {
5255 + return false;
5256 + }
5257 + for (const style of targetDocument.head.querySelectorAll(
5258 + `style[${STYLE_HASH_ATTRIBUTE3}]`
5259 + )) {
5260 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
5261 + return true;
5262 + }
5263 + }
5264 + return false;
5265 + }
5266 + function injectStyle3(targetDocument, hash, css) {
5267 + if (!targetDocument.head) {
5268 + return;
5269 + }
5270 + const runtime = getRuntime3();
5271 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5272 + if (!injectedStyles) {
5273 + injectedStyles = /* @__PURE__ */ new Set();
5274 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5275 + }
5276 + if (injectedStyles.has(hash)) {
5277 + return;
5278 + }
5279 + if (documentContainsStyleHash3(targetDocument, hash)) {
5280 + injectedStyles.add(hash);
5281 + return;
5282 + }
5283 + const style = targetDocument.createElement("style");
5284 + style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
5285 + style.appendChild(targetDocument.createTextNode(css));
5286 + targetDocument.head.appendChild(style);
5287 + injectedStyles.add(hash);
5288 + }
5289 + function registerDocument3(targetDocument) {
5290 + const runtime = getRuntime3();
5291 + runtime.documents.set(
5292 + targetDocument,
5293 + (runtime.documents.get(targetDocument) ?? 0) + 1
5294 + );
5295 + for (const [hash, css] of runtime.styles) {
5296 + injectStyle3(targetDocument, hash, css);
5297 + }
5298 + return () => {
5299 + const count = runtime.documents.get(targetDocument);
5300 + if (count === void 0) {
5301 + return;
5302 + }
5303 + if (count <= 1) {
5304 + runtime.documents.delete(targetDocument);
5305 + return;
5306 + }
5307 + runtime.documents.set(targetDocument, count - 1);
5308 + };
5309 + }
5310 + function registerStyle3(hash, css) {
5311 + const runtime = getRuntime3();
5312 + runtime.styles.set(hash, css);
5313 + for (const targetDocument of runtime.documents.keys()) {
5314 + injectStyle3(targetDocument, hash, css);
5315 + }
5316 + }
5317 + if (typeof process === "undefined" || true) {
5318 + registerStyle3("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
5319 + }
5320 + var style_default3 = { "stack": "_19ce0419607e1896__stack" };
5321 + var gapTokens = {
5322 + xs: "var(--wpds-dimension-gap-xs, 4px)",
5323 + sm: "var(--wpds-dimension-gap-sm, 8px)",
5324 + md: "var(--wpds-dimension-gap-md, 12px)",
5325 + lg: "var(--wpds-dimension-gap-lg, 16px)",
5326 + xl: "var(--wpds-dimension-gap-xl, 24px)",
5327 + "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
5328 + "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
5329 + };
5330 + var Stack = (0, import_element5.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
5331 + const style = {
5332 + gap: gap && gapTokens[gap],
5333 + alignItems: align,
5334 + justifyContent: justify,
5335 + flexDirection: direction,
5336 + flexWrap: wrap
5337 + };
5338 + const element = useRender({
5339 + render,
5340 + ref,
5341 + props: mergeProps(props, { style, className: style_default3.stack })
5342 + });
5343 + return element;
5344 + });
5345 +
5346 + // packages/ui/build-module/utils/use-schedule-validation.mjs
5347 + var import_compose = __toESM(require_compose(), 1);
5348 + var import_element6 = __toESM(require_element(), 1);
5349 + function useScheduleValidation(validate) {
5350 + const validateEvent = (0, import_compose.useEvent)(validate);
5351 + const timerRef = (0, import_element6.useRef)(null);
5352 + const unmountedRef = (0, import_element6.useRef)(false);
5353 + const scheduleValidation = (0, import_element6.useCallback)(() => {
5354 + if (unmountedRef.current) {
5355 + return;
5356 + }
5357 + if (timerRef.current) {
5358 + clearTimeout(timerRef.current);
5359 + }
5360 + timerRef.current = setTimeout(() => {
5361 + validateEvent();
5362 + timerRef.current = null;
5363 + }, 0);
5364 + }, [validateEvent]);
5365 + (0, import_element6.useEffect)(() => {
5366 + unmountedRef.current = false;
5367 + return () => {
5368 + unmountedRef.current = true;
5369 + if (timerRef.current) {
5370 + clearTimeout(timerRef.current);
5371 + }
5372 + };
5373 + }, []);
5374 + return scheduleValidation;
5375 + }
5376 +
5377 + // packages/ui/build-module/form/primitives/input/input.mjs
5378 + var import_element9 = __toESM(require_element(), 1);
5379 +
5380 + // packages/ui/build-module/form/primitives/input-layout/input-layout.mjs
5381 + var import_element7 = __toESM(require_element(), 1);
5382 + var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
5383 + var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
5384 + function getRuntime4() {
5385 + const globalScope = globalThis;
5386 + if (globalScope.__wpStyleRuntime) {
5387 + return globalScope.__wpStyleRuntime;
5388 + }
5389 + globalScope.__wpStyleRuntime = {
5390 + documents: /* @__PURE__ */ new Map(),
5391 + styles: /* @__PURE__ */ new Map(),
5392 + injectedStyles: /* @__PURE__ */ new WeakMap()
5393 + };
5394 + if (typeof document !== "undefined") {
5395 + registerDocument4(document);
5396 + }
5397 + return globalScope.__wpStyleRuntime;
5398 + }
5399 + function documentContainsStyleHash4(targetDocument, hash) {
5400 + if (!targetDocument.head) {
5401 + return false;
5402 + }
5403 + for (const style of targetDocument.head.querySelectorAll(
5404 + `style[${STYLE_HASH_ATTRIBUTE4}]`
5405 + )) {
5406 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
5407 + return true;
5408 + }
5409 + }
5410 + return false;
5411 + }
5412 + function injectStyle4(targetDocument, hash, css) {
5413 + if (!targetDocument.head) {
5414 + return;
5415 + }
5416 + const runtime = getRuntime4();
5417 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5418 + if (!injectedStyles) {
5419 + injectedStyles = /* @__PURE__ */ new Set();
5420 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5421 + }
5422 + if (injectedStyles.has(hash)) {
5423 + return;
5424 + }
5425 + if (documentContainsStyleHash4(targetDocument, hash)) {
5426 + injectedStyles.add(hash);
5427 + return;
5428 + }
5429 + const style = targetDocument.createElement("style");
5430 + style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
5431 + style.appendChild(targetDocument.createTextNode(css));
5432 + targetDocument.head.appendChild(style);
5433 + injectedStyles.add(hash);
5434 + }
5435 + function registerDocument4(targetDocument) {
5436 + const runtime = getRuntime4();
5437 + runtime.documents.set(
5438 + targetDocument,
5439 + (runtime.documents.get(targetDocument) ?? 0) + 1
5440 + );
5441 + for (const [hash, css] of runtime.styles) {
5442 + injectStyle4(targetDocument, hash, css);
5443 + }
5444 + return () => {
5445 + const count = runtime.documents.get(targetDocument);
5446 + if (count === void 0) {
5447 + return;
5448 + }
5449 + if (count <= 1) {
5450 + runtime.documents.delete(targetDocument);
5451 + return;
5452 + }
5453 + runtime.documents.set(targetDocument, count - 1);
5454 + };
5455 + }
5456 + function registerStyle4(hash, css) {
5457 + const runtime = getRuntime4();
5458 + runtime.styles.set(hash, css);
5459 + for (const targetDocument of runtime.documents.keys()) {
5460 + injectStyle4(targetDocument, hash, css);
5461 + }
5462 + }
5463 + if (typeof process === "undefined" || true) {
5464 + registerStyle4("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
5465 + }
5466 + var global_css_defense_default2 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
5467 + if (typeof process === "undefined" || true) {
5468 + registerStyle4("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
5469 + }
5470 + var resets_default2 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
5471 + if (typeof process === "undefined" || true) {
5472 + registerStyle4("e4f4f9600b", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.cb2baafdc08746bb__input-layout{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-md,12px);background-color:var(--wpds-color-background-interactive-neutral,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:var(--wpds-border-width-xs,1px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:max(var(--wpds-typography-font-size-md,13px),16px);height:var(--wpds-dimension-size-lg,40px);line-height:1;@media (min-width:600px){font-size:var(--wpds-typography-font-size-md,13px)}&._0c807a84cbb94e0c__is-size-compact{height:var(--wpds-dimension-size-md,32px)}&._0c807a84cbb94e0c__is-size-compact,&.ed67cda122dc1e7b__is-size-small{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-sm,8px)}&.ed67cda122dc1e7b__is-size-small{height:var(--wpds-dimension-size-sm,24px)}&._6fb7104732387680__is-disabled,&:has([data-can-disable-input-layout][data-disabled]){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}&:not(._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-disabled,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText}}}&._8097270636ca6100__is-borderless{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border-color:transparent}&:has(._0d7afad74a057888__input-layout-slot:focus-within){--_gcd-div-outline:none;outline:none}&:hover:not(._6fb7104732387680__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-active,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}&:has(:invalid[data-validity-visible]){--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818);border-color:var(--wpds-color-stroke-interactive-error,#cc1818);&:hover{border-color:var(--wpds-color-stroke-interactive-error-active,#9d0000)}}}.c192b41a12b4387b__slot-wrapper{display:contents}._0d7afad74a057888__input-layout-slot{align-items:center;display:flex;&._0c952682762ca288__is-padding-minimal{--wp-ui-input-layout-prefix-padding-start:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px));--wp-ui-input-layout-suffix-padding-end:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}[data-slot-type=prefix] &{padding-inline-start:var(--wp-ui-input-layout-prefix-padding-start,var(--wp-ui-input-layout-padding-inline))}[data-slot-type=suffix] &{padding-inline-end:var(--wp-ui-input-layout-suffix-padding-end,var(--wp-ui-input-layout-padding-inline))}}}}');
5473 + }
5474 + var style_default4 = { "input-layout": "cb2baafdc08746bb__input-layout", "is-size-compact": "_0c807a84cbb94e0c__is-size-compact", "is-size-small": "ed67cda122dc1e7b__is-size-small", "is-disabled": "_6fb7104732387680__is-disabled", "is-borderless": "_8097270636ca6100__is-borderless", "input-layout-slot": "_0d7afad74a057888__input-layout-slot", "slot-wrapper": "c192b41a12b4387b__slot-wrapper", "is-padding-minimal": "_0c952682762ca288__is-padding-minimal" };
5475 + var InputLayout = (0, import_element7.forwardRef)(
5476 + function InputLayout2({
5477 + className,
5478 + children,
5479 + visuallyDisabled,
5480 + size = "default",
5481 + isBorderless,
5482 + prefix,
5483 + suffix,
5484 + ...restProps
5485 + }, ref) {
5486 + return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
5487 + "div",
5488 + {
5489 + ref,
5490 + className: clsx_default(
5491 + global_css_defense_default2.div,
5492 + resets_default2["box-sizing"],
5493 + style_default4["input-layout"],
5494 + style_default4[`is-size-${size}`],
5495 + visuallyDisabled && style_default4["is-disabled"],
5496 + isBorderless && style_default4["is-borderless"],
5497 + className
5498 + ),
5499 + ...restProps,
5500 + children: [
5501 + import_element7.Children.count(prefix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5502 + "div",
5503 + {
5504 + className: style_default4["slot-wrapper"],
5505 + "data-slot-type": "prefix",
5506 + children: prefix
5507 + }
5508 + ),
5509 + children,
5510 + import_element7.Children.count(suffix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5511 + "div",
5512 + {
5513 + className: style_default4["slot-wrapper"],
5514 + "data-slot-type": "suffix",
5515 + children: suffix
5516 + }
5517 + )
5518 + ]
5519 + }
5520 + );
5521 + }
5522 + );
5523 +
5524 + // packages/ui/build-module/form/primitives/input-layout/slot.mjs
5525 + var import_element8 = __toESM(require_element(), 1);
5526 + var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
5527 + var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash";
5528 + function getRuntime5() {
5529 + const globalScope = globalThis;
5530 + if (globalScope.__wpStyleRuntime) {
5531 + return globalScope.__wpStyleRuntime;
5532 + }
5533 + globalScope.__wpStyleRuntime = {
5534 + documents: /* @__PURE__ */ new Map(),
5535 + styles: /* @__PURE__ */ new Map(),
5536 + injectedStyles: /* @__PURE__ */ new WeakMap()
5537 + };
5538 + if (typeof document !== "undefined") {
5539 + registerDocument5(document);
5540 + }
5541 + return globalScope.__wpStyleRuntime;
5542 + }
5543 + function documentContainsStyleHash5(targetDocument, hash) {
5544 + if (!targetDocument.head) {
5545 + return false;
5546 + }
5547 + for (const style of targetDocument.head.querySelectorAll(
5548 + `style[${STYLE_HASH_ATTRIBUTE5}]`
5549 + )) {
5550 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) {
5551 + return true;
5552 + }
5553 + }
5554 + return false;
5555 + }
5556 + function injectStyle5(targetDocument, hash, css) {
5557 + if (!targetDocument.head) {
5558 + return;
5559 + }
5560 + const runtime = getRuntime5();
5561 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5562 + if (!injectedStyles) {
5563 + injectedStyles = /* @__PURE__ */ new Set();
5564 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5565 + }
5566 + if (injectedStyles.has(hash)) {
5567 + return;
5568 + }
5569 + if (documentContainsStyleHash5(targetDocument, hash)) {
5570 + injectedStyles.add(hash);
5571 + return;
5572 + }
5573 + const style = targetDocument.createElement("style");
5574 + style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash);
5575 + style.appendChild(targetDocument.createTextNode(css));
5576 + targetDocument.head.appendChild(style);
5577 + injectedStyles.add(hash);
5578 + }
5579 + function registerDocument5(targetDocument) {
5580 + const runtime = getRuntime5();
5581 + runtime.documents.set(
5582 + targetDocument,
5583 + (runtime.documents.get(targetDocument) ?? 0) + 1
5584 + );
5585 + for (const [hash, css] of runtime.styles) {
5586 + injectStyle5(targetDocument, hash, css);
5587 + }
5588 + return () => {
5589 + const count = runtime.documents.get(targetDocument);
5590 + if (count === void 0) {
5591 + return;
5592 + }
5593 + if (count <= 1) {
5594 + runtime.documents.delete(targetDocument);
5595 + return;
5596 + }
5597 + runtime.documents.set(targetDocument, count - 1);
5598 + };
5599 + }
5600 + function registerStyle5(hash, css) {
5601 + const runtime = getRuntime5();
5602 + runtime.styles.set(hash, css);
5603 + for (const targetDocument of runtime.documents.keys()) {
5604 + injectStyle5(targetDocument, hash, css);
5605 + }
5606 + }
5607 + if (typeof process === "undefined" || true) {
5608 + registerStyle5("e4f4f9600b", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.cb2baafdc08746bb__input-layout{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-md,12px);background-color:var(--wpds-color-background-interactive-neutral,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:var(--wpds-border-width-xs,1px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:max(var(--wpds-typography-font-size-md,13px),16px);height:var(--wpds-dimension-size-lg,40px);line-height:1;@media (min-width:600px){font-size:var(--wpds-typography-font-size-md,13px)}&._0c807a84cbb94e0c__is-size-compact{height:var(--wpds-dimension-size-md,32px)}&._0c807a84cbb94e0c__is-size-compact,&.ed67cda122dc1e7b__is-size-small{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-sm,8px)}&.ed67cda122dc1e7b__is-size-small{height:var(--wpds-dimension-size-sm,24px)}&._6fb7104732387680__is-disabled,&:has([data-can-disable-input-layout][data-disabled]){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}&:not(._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-disabled,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText}}}&._8097270636ca6100__is-borderless{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border-color:transparent}&:has(._0d7afad74a057888__input-layout-slot:focus-within){--_gcd-div-outline:none;outline:none}&:hover:not(._6fb7104732387680__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-active,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}&:has(:invalid[data-validity-visible]){--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818);border-color:var(--wpds-color-stroke-interactive-error,#cc1818);&:hover{border-color:var(--wpds-color-stroke-interactive-error-active,#9d0000)}}}.c192b41a12b4387b__slot-wrapper{display:contents}._0d7afad74a057888__input-layout-slot{align-items:center;display:flex;&._0c952682762ca288__is-padding-minimal{--wp-ui-input-layout-prefix-padding-start:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px));--wp-ui-input-layout-suffix-padding-end:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}[data-slot-type=prefix] &{padding-inline-start:var(--wp-ui-input-layout-prefix-padding-start,var(--wp-ui-input-layout-padding-inline))}[data-slot-type=suffix] &{padding-inline-end:var(--wp-ui-input-layout-suffix-padding-end,var(--wp-ui-input-layout-padding-inline))}}}}');
5609 + }
5610 + var style_default5 = { "input-layout": "cb2baafdc08746bb__input-layout", "is-size-compact": "_0c807a84cbb94e0c__is-size-compact", "is-size-small": "ed67cda122dc1e7b__is-size-small", "is-disabled": "_6fb7104732387680__is-disabled", "is-borderless": "_8097270636ca6100__is-borderless", "input-layout-slot": "_0d7afad74a057888__input-layout-slot", "slot-wrapper": "c192b41a12b4387b__slot-wrapper", "is-padding-minimal": "_0c952682762ca288__is-padding-minimal" };
5611 + var InputLayoutSlot = (0, import_element8.forwardRef)(function InputLayoutSlot2({ padding = "default", className, ...restProps }, ref) {
5612 + return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5613 + "div",
5614 + {
5615 + ref,
5616 + className: clsx_default(
5617 + style_default5["input-layout-slot"],
5618 + style_default5[`is-padding-${padding}`],
5619 + className
5620 + ),
5621 + ...restProps
5622 + }
5623 + );
5624 + });
5625 + InputLayoutSlot.displayName = "InputLayout.Slot";
5626 +
5627 + // packages/ui/build-module/form/primitives/input-layout/index.mjs
5628 + var InputLayout3 = Object.assign(InputLayout, {
5629 + Slot: InputLayoutSlot
5630 + });
5631 +
5632 + // packages/ui/build-module/form/primitives/input/input.mjs
5633 + var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
5634 + var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash";
5635 + function getRuntime6() {
5636 + const globalScope = globalThis;
5637 + if (globalScope.__wpStyleRuntime) {
5638 + return globalScope.__wpStyleRuntime;
5639 + }
5640 + globalScope.__wpStyleRuntime = {
5641 + documents: /* @__PURE__ */ new Map(),
5642 + styles: /* @__PURE__ */ new Map(),
5643 + injectedStyles: /* @__PURE__ */ new WeakMap()
5644 + };
5645 + if (typeof document !== "undefined") {
5646 + registerDocument6(document);
5647 + }
5648 + return globalScope.__wpStyleRuntime;
5649 + }
5650 + function documentContainsStyleHash6(targetDocument, hash) {
5651 + if (!targetDocument.head) {
5652 + return false;
5653 + }
5654 + for (const style of targetDocument.head.querySelectorAll(
5655 + `style[${STYLE_HASH_ATTRIBUTE6}]`
5656 + )) {
5657 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) {
5658 + return true;
5659 + }
5660 + }
5661 + return false;
5662 + }
5663 + function injectStyle6(targetDocument, hash, css) {
5664 + if (!targetDocument.head) {
5665 + return;
5666 + }
5667 + const runtime = getRuntime6();
5668 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5669 + if (!injectedStyles) {
5670 + injectedStyles = /* @__PURE__ */ new Set();
5671 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5672 + }
5673 + if (injectedStyles.has(hash)) {
5674 + return;
5675 + }
5676 + if (documentContainsStyleHash6(targetDocument, hash)) {
5677 + injectedStyles.add(hash);
5678 + return;
5679 + }
5680 + const style = targetDocument.createElement("style");
5681 + style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash);
5682 + style.appendChild(targetDocument.createTextNode(css));
5683 + targetDocument.head.appendChild(style);
5684 + injectedStyles.add(hash);
5685 + }
5686 + function registerDocument6(targetDocument) {
5687 + const runtime = getRuntime6();
5688 + runtime.documents.set(
5689 + targetDocument,
5690 + (runtime.documents.get(targetDocument) ?? 0) + 1
5691 + );
5692 + for (const [hash, css] of runtime.styles) {
5693 + injectStyle6(targetDocument, hash, css);
5694 + }
5695 + return () => {
5696 + const count = runtime.documents.get(targetDocument);
5697 + if (count === void 0) {
5698 + return;
5699 + }
5700 + if (count <= 1) {
5701 + runtime.documents.delete(targetDocument);
5702 + return;
5703 + }
5704 + runtime.documents.set(targetDocument, count - 1);
5705 + };
5706 + }
5707 + function registerStyle6(hash, css) {
5708 + const runtime = getRuntime6();
5709 + runtime.styles.set(hash, css);
5710 + for (const targetDocument of runtime.documents.keys()) {
5711 + injectStyle6(targetDocument, hash, css);
5712 + }
5713 + }
5714 + if (typeof process === "undefined" || true) {
5715 + registerStyle6("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
5716 + }
5717 + var global_css_defense_default3 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
5718 + if (typeof process === "undefined" || true) {
5719 + registerStyle6("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
5720 + }
5721 + var focus_module_default2 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
5722 + if (typeof process === "undefined" || true) {
5723 + registerStyle6("1a25f6a232", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._2ae7be2fc1bb17a3__input{--_gcd-input-padding:var(--wp-ui-input-padding-block,0px) var(--wp-ui-input-layout-padding-inline,0px);background:transparent;border:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:inherit;font-size:inherit;line-height:inherit;outline:none;padding-block:var(--wp-ui-input-padding-block,0);padding-inline:var(--wp-ui-input-layout-padding-inline,0);width:100%;&::placeholder{color:var(--wpds-color-foreground-interactive-neutral-weak,#707070)}&:disabled,&[aria-disabled=true]{--_gcd-input-placeholder-color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);&::placeholder{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}@media (forced-colors:active){color:GrayText}}&[type=email],&[type=url]{direction:ltr}&[type=number]{appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{appearance:none;margin:0}}}}}");
5724 + }
5725 + var style_default6 = { "input": "_2ae7be2fc1bb17a3__input" };
5726 + var Input3 = (0, import_element9.forwardRef)(function Input22({ className, size = "default", prefix, suffix, style, ...restProps }, ref) {
5727 + return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5728 + InputLayout3,
5729 + {
5730 + className: clsx_default(
5731 + focus_module_default2["outset-ring--focus-within"],
5732 + className
5733 + ),
5734 + style,
5735 + size,
5736 + visuallyDisabled: restProps.disabled,
5737 + prefix,
5738 + suffix,
5739 + children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5740 + Input,
5741 + {
5742 + ref,
5743 + className: clsx_default(global_css_defense_default3.input, style_default6.input),
5744 + ...restProps
5745 + }
5746 + )
5747 + }
5748 + );
5749 + });
5750 +
5751 + // packages/ui/build-module/form/primitives/control-with-error/control-with-error.mjs
5752 + var import_i18n5 = __toESM(require_i18n(), 1);
5753 + var import_element11 = __toESM(require_element(), 1);
5754 +
5755 + // packages/ui/build-module/spinner/spinner.mjs
5756 + var import_element10 = __toESM(require_element(), 1);
5757 + var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
5758 + var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash";
5759 + function getRuntime7() {
5760 + const globalScope = globalThis;
5761 + if (globalScope.__wpStyleRuntime) {
5762 + return globalScope.__wpStyleRuntime;
5763 + }
5764 + globalScope.__wpStyleRuntime = {
5765 + documents: /* @__PURE__ */ new Map(),
5766 + styles: /* @__PURE__ */ new Map(),
5767 + injectedStyles: /* @__PURE__ */ new WeakMap()
5768 + };
5769 + if (typeof document !== "undefined") {
5770 + registerDocument7(document);
5771 + }
5772 + return globalScope.__wpStyleRuntime;
5773 + }
5774 + function documentContainsStyleHash7(targetDocument, hash) {
5775 + if (!targetDocument.head) {
5776 + return false;
5777 + }
5778 + for (const style of targetDocument.head.querySelectorAll(
5779 + `style[${STYLE_HASH_ATTRIBUTE7}]`
5780 + )) {
5781 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) {
5782 + return true;
5783 + }
5784 + }
5785 + return false;
5786 + }
5787 + function injectStyle7(targetDocument, hash, css) {
5788 + if (!targetDocument.head) {
5789 + return;
5790 + }
5791 + const runtime = getRuntime7();
5792 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5793 + if (!injectedStyles) {
5794 + injectedStyles = /* @__PURE__ */ new Set();
5795 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5796 + }
5797 + if (injectedStyles.has(hash)) {
5798 + return;
5799 + }
5800 + if (documentContainsStyleHash7(targetDocument, hash)) {
5801 + injectedStyles.add(hash);
5802 + return;
5803 + }
5804 + const style = targetDocument.createElement("style");
5805 + style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash);
5806 + style.appendChild(targetDocument.createTextNode(css));
5807 + targetDocument.head.appendChild(style);
5808 + injectedStyles.add(hash);
5809 + }
5810 + function registerDocument7(targetDocument) {
5811 + const runtime = getRuntime7();
5812 + runtime.documents.set(
5813 + targetDocument,
5814 + (runtime.documents.get(targetDocument) ?? 0) + 1
5815 + );
5816 + for (const [hash, css] of runtime.styles) {
5817 + injectStyle7(targetDocument, hash, css);
5818 + }
5819 + return () => {
5820 + const count = runtime.documents.get(targetDocument);
5821 + if (count === void 0) {
5822 + return;
5823 + }
5824 + if (count <= 1) {
5825 + runtime.documents.delete(targetDocument);
5826 + return;
5827 + }
5828 + runtime.documents.set(targetDocument, count - 1);
5829 + };
5830 + }
5831 + function registerStyle7(hash, css) {
5832 + const runtime = getRuntime7();
5833 + runtime.styles.set(hash, css);
5834 + for (const targetDocument of runtime.documents.keys()) {
5835 + injectStyle7(targetDocument, hash, css);
5836 + }
5837 + }
5838 + if (typeof process === "undefined" || true) {
5839 + registerStyle7("bbbecfe373", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.ab4d64c07c0ba587__spinner{background-color:transparent;display:inline-block;height:var(--wpds-dimension-size-2xs,16px);opacity:1;overflow:visible;position:relative;width:var(--wpds-dimension-size-2xs,16px)}.a7654e10245bb7d2__indicator,.dc51f80c84b35fe2__track{fill:transparent;stroke-width:1.5px}.dc51f80c84b35fe2__track{stroke:var(--wpds-color-background-track-neutral,#dbdbdb)}.a7654e10245bb7d2__indicator{stroke:var(--wpds-color-background-thumb-brand,var(--wp-admin-theme-color,#3858e9));stroke-linecap:round;animation:_02322d973909703c__spinner-spin 1.4s linear infinite both;transform-origin:50% 50%}@keyframes _02322d973909703c__spinner-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}}}");
5840 + }
5841 + var style_default7 = { "spinner": "ab4d64c07c0ba587__spinner", "track": "dc51f80c84b35fe2__track", "indicator": "a7654e10245bb7d2__indicator", "spinner-spin": "_02322d973909703c__spinner-spin" };
5842 + var Spinner = (0, import_element10.forwardRef)(
5843 + function Spinner2({ className, ...props }, ref) {
5844 + return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
5845 + "svg",
5846 + {
5847 + className: clsx_default(style_default7.spinner, className),
5848 + viewBox: "0 0 100 100",
5849 + xmlns: "http://www.w3.org/2000/svg",
5850 + role: "presentation",
5851 + focusable: "false",
5852 + ...props,
5853 + ref,
5854 + children: [
5855 + /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5856 + "circle",
5857 + {
5858 + className: style_default7.track,
5859 + cx: "50",
5860 + cy: "50",
5861 + r: "50",
5862 + vectorEffect: "non-scaling-stroke"
5863 + }
5864 + ),
5865 + /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5866 + "path",
5867 + {
5868 + className: style_default7.indicator,
5869 + d: "m 50 0 a 50 50 0 0 1 50 50",
5870 + vectorEffect: "non-scaling-stroke"
5871 + }
5872 + )
5873 + ]
5874 + }
5875 + );
5876 + }
5877 + );
5878 +
5879 + // packages/ui/build-module/form/primitives/validity-indicator/validity-indicator.mjs
5880 + var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
5881 + var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash";
5882 + function getRuntime8() {
5883 + const globalScope = globalThis;
5884 + if (globalScope.__wpStyleRuntime) {
5885 + return globalScope.__wpStyleRuntime;
5886 + }
5887 + globalScope.__wpStyleRuntime = {
5888 + documents: /* @__PURE__ */ new Map(),
5889 + styles: /* @__PURE__ */ new Map(),
5890 + injectedStyles: /* @__PURE__ */ new WeakMap()
5891 + };
5892 + if (typeof document !== "undefined") {
5893 + registerDocument8(document);
5894 + }
5895 + return globalScope.__wpStyleRuntime;
5896 + }
5897 + function documentContainsStyleHash8(targetDocument, hash) {
5898 + if (!targetDocument.head) {
5899 + return false;
5900 + }
5901 + for (const style of targetDocument.head.querySelectorAll(
5902 + `style[${STYLE_HASH_ATTRIBUTE8}]`
5903 + )) {
5904 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) {
5905 + return true;
5906 + }
5907 + }
5908 + return false;
5909 + }
5910 + function injectStyle8(targetDocument, hash, css) {
5911 + if (!targetDocument.head) {
5912 + return;
5913 + }
5914 + const runtime = getRuntime8();
5915 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5916 + if (!injectedStyles) {
5917 + injectedStyles = /* @__PURE__ */ new Set();
5918 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5919 + }
5920 + if (injectedStyles.has(hash)) {
5921 + return;
5922 + }
5923 + if (documentContainsStyleHash8(targetDocument, hash)) {
5924 + injectedStyles.add(hash);
5925 + return;
5926 + }
5927 + const style = targetDocument.createElement("style");
5928 + style.setAttribute(STYLE_HASH_ATTRIBUTE8, hash);
5929 + style.appendChild(targetDocument.createTextNode(css));
5930 + targetDocument.head.appendChild(style);
5931 + injectedStyles.add(hash);
5932 + }
5933 + function registerDocument8(targetDocument) {
5934 + const runtime = getRuntime8();
5935 + runtime.documents.set(
5936 + targetDocument,
5937 + (runtime.documents.get(targetDocument) ?? 0) + 1
5938 + );
5939 + for (const [hash, css] of runtime.styles) {
5940 + injectStyle8(targetDocument, hash, css);
5941 + }
5942 + return () => {
5943 + const count = runtime.documents.get(targetDocument);
5944 + if (count === void 0) {
5945 + return;
5946 + }
5947 + if (count <= 1) {
5948 + runtime.documents.delete(targetDocument);
5949 + return;
5950 + }
5951 + runtime.documents.set(targetDocument, count - 1);
5952 + };
5953 + }
5954 + function registerStyle8(hash, css) {
5955 + const runtime = getRuntime8();
5956 + runtime.styles.set(hash, css);
5957 + for (const targetDocument of runtime.documents.keys()) {
5958 + injectStyle8(targetDocument, hash, css);
5959 + }
5960 + }
5961 + if (typeof process === "undefined" || true) {
5962 + registerStyle8("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
5963 + }
5964 + var global_css_defense_default4 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
5965 + if (typeof process === "undefined" || true) {
5966 + registerStyle8("d11816833c", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7a7ac88e306348e7__indicator{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);align-items:flex-start;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);gap:var(--wpds-dimension-gap-xs,4px);line-height:var(--wpds-typography-line-height-xs,16px);@media not (prefers-reduced-motion){animation:_48722cc5dd090ce4__indicator-jump var(--wpds-motion-duration-md,.2s) cubic-bezier(.68,-.55,.27,1.55)}}._57a3bbbfbe38a5c6__is-invalid{color:var(--wpds-color-foreground-content-error-weak,#cc1818)}._9e944dc198aac10b__is-valid{color:var(--wpds-color-foreground-content-success-weak,#008030)}.e482806667437c6a__indicator-icon{flex-shrink:0}._6e46434cc23019d2__indicator-spinner{height:var(--wpds-dimension-size-3xs,12px);margin:2px;width:var(--wpds-dimension-size-3xs,12px)}@keyframes _48722cc5dd090ce4__indicator-jump{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}}}');
5967 + }
5968 + var style_default8 = { "indicator": "_7a7ac88e306348e7__indicator", "indicator-jump": "_48722cc5dd090ce4__indicator-jump", "is-invalid": "_57a3bbbfbe38a5c6__is-invalid", "is-valid": "_9e944dc198aac10b__is-valid", "indicator-icon": "e482806667437c6a__indicator-icon", "indicator-spinner": "_6e46434cc23019d2__indicator-spinner" };
5969 + var ICON = {
5970 + valid: published_default,
5971 + invalid: error_default
5972 + };
5973 + function ValidityIndicator({
5974 + id,
5975 + type,
5976 + message
5977 + }) {
5978 + return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
5979 + "p",
5980 + {
5981 + id,
5982 + className: clsx_default(
5983 + global_css_defense_default4.p,
5984 + style_default8.indicator,
5985 + style_default8[`is-${type}`]
5986 + ),
5987 + children: [
5988 + type === "validating" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Spinner, { className: style_default8["indicator-spinner"] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
5989 + Icon,
5990 + {
5991 + className: style_default8["indicator-icon"],
5992 + icon: ICON[type],
5993 + size: 16,
5994 + fill: "currentColor"
5995 + }
5996 + ),
5997 + message
5998 + ]
5999 + }
6000 + );
6001 + }
6002 +
6003 + // packages/ui/build-module/form/primitives/control-with-error/control-with-error.mjs
6004 + var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
6005 + var DEFAULT_RENDER = (props) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Stack, { ...props, direction: "column", gap: "sm" });
6006 + function appendRequiredIndicator(label, required, markWhenOptional) {
6007 + let suffix;
6008 + if (required && !markWhenOptional) {
6009 + suffix = `(${(0, import_i18n5.__)("Required")})`;
6010 + } else if (!required && markWhenOptional) {
6011 + suffix = `(${(0, import_i18n5.__)("Optional")})`;
6012 + }
6013 + if (!suffix) {
6014 + return label;
6015 + }
6016 + if (typeof label === "string") {
6017 + return `${label} ${suffix}`;
6018 + }
6019 + return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
6020 + label,
6021 + " ",
6022 + suffix
6023 + ] });
6024 + }
6025 + var VALIDITY_VISIBLE_ATTRIBUTE = "data-validity-visible";
6026 + var ControlWithError = (0, import_element11.forwardRef)(function ControlWithError2({
6027 + required,
6028 + markWhenOptional,
6029 + customValidity,
6030 + getValidityTarget,
6031 + children,
6032 + render = DEFAULT_RENDER,
6033 + ...restProps
6034 + }, forwardedRef) {
6035 + const [errorMessage, setErrorMessage] = (0, import_element11.useState)();
6036 + const [statusMessage, setStatusMessage] = (0, import_element11.useState)();
6037 + const [showMessage, setShowMessage] = (0, import_element11.useState)(false);
6038 + const [isTouched, setIsTouched] = (0, import_element11.useState)(false);
6039 + const wrapperRef = (0, import_element11.useRef)(null);
6040 + (0, import_element11.useEffect)(() => {
6041 + const validityTarget = getValidityTarget();
6042 + const handler = () => {
6043 + if (customValidity?.type !== "validating") {
6044 + setErrorMessage(validityTarget?.validationMessage);
6045 + }
6046 + setShowMessage(true);
6047 + validityTarget?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, "");
6048 + };
6049 + validityTarget?.addEventListener("invalid", handler);
6050 + return () => validityTarget?.removeEventListener("invalid", handler);
6051 + }, [customValidity?.type, getValidityTarget]);
6052 + (0, import_element11.useEffect)(() => {
6053 + const validityTarget = getValidityTarget();
6054 + const suppressNativePopover = (event) => {
6055 + event.preventDefault();
6056 + if (!event.isTrusted) {
6057 + return;
6058 + }
6059 + const target = event.target;
6060 + const firstErrorInForm = Array.from(
6061 + target.form?.elements ?? []
6062 + ).find((el) => !el.validity.valid);
6063 + if (!target.form || firstErrorInForm === target) {
6064 + target.focus();
6065 + }
6066 + };
6067 + const radioSiblings = validityTarget?.type === "radio" && validityTarget?.name ? Array.from(
6068 + wrapperRef.current?.querySelectorAll(
6069 + `input[type="radio"][name="${validityTarget?.name}"]`
6070 + ) ?? []
6071 + ).filter((sibling) => sibling !== validityTarget) : [];
6072 + validityTarget?.addEventListener("invalid", suppressNativePopover);
6073 + radioSiblings.forEach(
6074 + (sibling) => sibling.addEventListener("invalid", suppressNativePopover)
6075 + );
6076 + return () => {
6077 + validityTarget?.removeEventListener(
6078 + "invalid",
6079 + suppressNativePopover
6080 + );
6081 + radioSiblings.forEach(
6082 + (sibling) => sibling.removeEventListener("invalid", suppressNativePopover)
6083 + );
6084 + };
6085 + }, [getValidityTarget]);
6086 + (0, import_element11.useEffect)(() => {
6087 + const validityTarget = getValidityTarget();
6088 + if (!customValidity?.type) {
6089 + validityTarget?.setCustomValidity("");
6090 + setErrorMessage(validityTarget?.validationMessage);
6091 + setStatusMessage(void 0);
6092 + return;
6093 + }
6094 + switch (customValidity.type) {
6095 + case "validating": {
6096 + validityTarget?.setCustomValidity("");
6097 + setErrorMessage(void 0);
6098 + setStatusMessage({
6099 + type: "validating",
6100 + message: customValidity.message
6101 + });
6102 + break;
6103 + }
6104 + case "valid": {
6105 + validityTarget?.setCustomValidity("");
6106 + setErrorMessage(validityTarget?.validationMessage);
6107 + setStatusMessage({
6108 + type: "valid",
6109 + message: customValidity.message
6110 + });
6111 + break;
6112 + }
6113 + case "invalid": {
6114 + validityTarget?.setCustomValidity(
6115 + customValidity.message ?? ""
6116 + );
6117 + setErrorMessage(validityTarget?.validationMessage);
6118 + setStatusMessage(void 0);
6119 + break;
6120 + }
6121 + }
6122 + }, [customValidity, getValidityTarget]);
6123 + (0, import_element11.useEffect)(() => {
6124 + if (!isTouched || showMessage) {
6125 + return;
6126 + }
6127 + if (customValidity?.type === "validating") {
6128 + const timer = setTimeout(() => {
6129 + setShowMessage(true);
6130 + }, 1e3);
6131 + return () => clearTimeout(timer);
6132 + }
6133 + setShowMessage(true);
6134 + }, [isTouched, customValidity?.type, showMessage]);
6135 + const onBlur = (event) => {
6136 + if (event.relatedTarget && event.currentTarget.contains(event.relatedTarget)) {
6137 + return;
6138 + }
6139 + if (!isTouched) {
6140 + setIsTouched(true);
6141 + getValidityTarget()?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, "");
6142 + }
6143 + const validityTarget = getValidityTarget();
6144 + const isValidating = customValidity?.type === "validating";
6145 + window.queueMicrotask(() => {
6146 + if (!isValidating) {
6147 + setErrorMessage(validityTarget?.validationMessage);
6148 + }
6149 + });
6150 + };
6151 + const messageId = (0, import_element11.useId)();
6152 + const message = (() => {
6153 + if (errorMessage) {
6154 + return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6155 + ValidityIndicator,
6156 + {
6157 + id: messageId,
6158 + type: "invalid",
6159 + message: errorMessage
6160 + }
6161 + );
6162 + }
6163 + if (statusMessage?.type) {
6164 + return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6165 + ValidityIndicator,
6166 + {
6167 + id: messageId,
6168 + type: statusMessage.type,
6169 + message: statusMessage.message
6170 + }
6171 + );
6172 + }
6173 + return null;
6174 + })();
6175 + const visibleMessage = showMessage ? message : null;
6176 + (0, import_element11.useEffect)(() => {
6177 + const target = getValidityTarget();
6178 + if (!target) {
6179 + return;
6180 + }
6181 + function setDescribedBy(el, shouldAdd) {
6182 + const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter((id) => id && id !== messageId);
6183 + if (shouldAdd) {
6184 + ids.push(messageId);
6185 + }
6186 + if (ids.length) {
6187 + el.setAttribute("aria-describedby", ids.join(" "));
6188 + } else {
6189 + el.removeAttribute("aria-describedby");
6190 + }
6191 + }
6192 + setDescribedBy(target, !!visibleMessage);
6193 + return () => setDescribedBy(target, false);
6194 + }, [visibleMessage, messageId, getValidityTarget]);
6195 + return useRender({
6196 + render,
6197 + ref: [forwardedRef, wrapperRef],
6198 + props: mergeProps(restProps, {
6199 + onBlur,
6200 + children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
6201 + (0, import_element11.cloneElement)(children, {
6202 + label: appendRequiredIndicator(
6203 + children.props.label,
6204 + required,
6205 + markWhenOptional
6206 + ),
6207 + required
6208 + }),
6209 + visibleMessage
6210 + ] })
6211 + })
6212 + });
6213 + });
6214 +
6215 + // packages/ui/build-module/form/primitives/field/index.mjs
6216 + var field_exports = {};
6217 + __export(field_exports, {
6218 + Control: () => Control,
6219 + Description: () => Description,
6220 + Details: () => Details,
6221 + Item: () => Item,
6222 + Label: () => Label,
6223 + Root: () => Root,
6224 + VisualLabel: () => VisualLabel
6225 + });
6226 +
6227 + // packages/ui/build-module/form/primitives/field/root.mjs
6228 + var import_element12 = __toESM(require_element(), 1);
6229 + var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
6230 + var STYLE_HASH_ATTRIBUTE9 = "data-wp-hash";
6231 + function getRuntime9() {
6232 + const globalScope = globalThis;
6233 + if (globalScope.__wpStyleRuntime) {
6234 + return globalScope.__wpStyleRuntime;
6235 + }
6236 + globalScope.__wpStyleRuntime = {
6237 + documents: /* @__PURE__ */ new Map(),
6238 + styles: /* @__PURE__ */ new Map(),
6239 + injectedStyles: /* @__PURE__ */ new WeakMap()
6240 + };
6241 + if (typeof document !== "undefined") {
6242 + registerDocument9(document);
6243 + }
6244 + return globalScope.__wpStyleRuntime;
6245 + }
6246 + function documentContainsStyleHash9(targetDocument, hash) {
6247 + if (!targetDocument.head) {
6248 + return false;
6249 + }
6250 + for (const style of targetDocument.head.querySelectorAll(
6251 + `style[${STYLE_HASH_ATTRIBUTE9}]`
6252 + )) {
6253 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE9) === hash) {
6254 + return true;
6255 + }
6256 + }
6257 + return false;
6258 + }
6259 + function injectStyle9(targetDocument, hash, css) {
6260 + if (!targetDocument.head) {
6261 + return;
6262 + }
6263 + const runtime = getRuntime9();
6264 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6265 + if (!injectedStyles) {
6266 + injectedStyles = /* @__PURE__ */ new Set();
6267 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6268 + }
6269 + if (injectedStyles.has(hash)) {
6270 + return;
6271 + }
6272 + if (documentContainsStyleHash9(targetDocument, hash)) {
6273 + injectedStyles.add(hash);
6274 + return;
6275 + }
6276 + const style = targetDocument.createElement("style");
6277 + style.setAttribute(STYLE_HASH_ATTRIBUTE9, hash);
6278 + style.appendChild(targetDocument.createTextNode(css));
6279 + targetDocument.head.appendChild(style);
6280 + injectedStyles.add(hash);
6281 + }
6282 + function registerDocument9(targetDocument) {
6283 + const runtime = getRuntime9();
6284 + runtime.documents.set(
6285 + targetDocument,
6286 + (runtime.documents.get(targetDocument) ?? 0) + 1
6287 + );
6288 + for (const [hash, css] of runtime.styles) {
6289 + injectStyle9(targetDocument, hash, css);
6290 + }
6291 + return () => {
6292 + const count = runtime.documents.get(targetDocument);
6293 + if (count === void 0) {
6294 + return;
6295 + }
6296 + if (count <= 1) {
6297 + runtime.documents.delete(targetDocument);
6298 + return;
6299 + }
6300 + runtime.documents.set(targetDocument, count - 1);
6301 + };
6302 + }
6303 + function registerStyle9(hash, css) {
6304 + const runtime = getRuntime9();
6305 + runtime.styles.set(hash, css);
6306 + for (const targetDocument of runtime.documents.keys()) {
6307 + injectStyle9(targetDocument, hash, css);
6308 + }
6309 + }
6310 + if (typeof process === "undefined" || true) {
6311 + registerStyle9("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
6312 + }
6313 + var resets_default3 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
6314 + var DEFAULT_RENDER2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Stack, { ...props, direction: "column", gap: "sm" });
6315 + var Root = (0, import_element12.forwardRef)(function Root2({ className, render = DEFAULT_RENDER2, ...restProps }, ref) {
6316 + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6317 + index_parts_exports.Root,
6318 + {
6319 + ref,
6320 + className: clsx_default(resets_default3["box-sizing"], className),
6321 + render,
6322 + ...restProps
6323 + }
6324 + );
6325 + });
6326 +
6327 + // packages/ui/build-module/form/primitives/field/item.mjs
6328 + var import_element13 = __toESM(require_element(), 1);
6329 + var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
6330 + var Item = (0, import_element13.forwardRef)(function Item2(props, ref) {
6331 + return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(index_parts_exports.Item, { ref, ...props });
6332 + });
6333 +
6334 + // packages/ui/build-module/form/primitives/field/label.mjs
6335 + var import_element14 = __toESM(require_element(), 1);
6336 + var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
6337 + var STYLE_HASH_ATTRIBUTE10 = "data-wp-hash";
6338 + function getRuntime10() {
6339 + const globalScope = globalThis;
6340 + if (globalScope.__wpStyleRuntime) {
6341 + return globalScope.__wpStyleRuntime;
6342 + }
6343 + globalScope.__wpStyleRuntime = {
6344 + documents: /* @__PURE__ */ new Map(),
6345 + styles: /* @__PURE__ */ new Map(),
6346 + injectedStyles: /* @__PURE__ */ new WeakMap()
6347 + };
6348 + if (typeof document !== "undefined") {
6349 + registerDocument10(document);
6350 + }
6351 + return globalScope.__wpStyleRuntime;
6352 + }
6353 + function documentContainsStyleHash10(targetDocument, hash) {
6354 + if (!targetDocument.head) {
6355 + return false;
6356 + }
6357 + for (const style of targetDocument.head.querySelectorAll(
6358 + `style[${STYLE_HASH_ATTRIBUTE10}]`
6359 + )) {
6360 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE10) === hash) {
6361 + return true;
6362 + }
6363 + }
6364 + return false;
6365 + }
6366 + function injectStyle10(targetDocument, hash, css) {
6367 + if (!targetDocument.head) {
6368 + return;
6369 + }
6370 + const runtime = getRuntime10();
6371 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6372 + if (!injectedStyles) {
6373 + injectedStyles = /* @__PURE__ */ new Set();
6374 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6375 + }
6376 + if (injectedStyles.has(hash)) {
6377 + return;
6378 + }
6379 + if (documentContainsStyleHash10(targetDocument, hash)) {
6380 + injectedStyles.add(hash);
6381 + return;
6382 + }
6383 + const style = targetDocument.createElement("style");
6384 + style.setAttribute(STYLE_HASH_ATTRIBUTE10, hash);
6385 + style.appendChild(targetDocument.createTextNode(css));
6386 + targetDocument.head.appendChild(style);
6387 + injectedStyles.add(hash);
6388 + }
6389 + function registerDocument10(targetDocument) {
6390 + const runtime = getRuntime10();
6391 + runtime.documents.set(
6392 + targetDocument,
6393 + (runtime.documents.get(targetDocument) ?? 0) + 1
6394 + );
6395 + for (const [hash, css] of runtime.styles) {
6396 + injectStyle10(targetDocument, hash, css);
6397 + }
6398 + return () => {
6399 + const count = runtime.documents.get(targetDocument);
6400 + if (count === void 0) {
6401 + return;
6402 + }
6403 + if (count <= 1) {
6404 + runtime.documents.delete(targetDocument);
6405 + return;
6406 + }
6407 + runtime.documents.set(targetDocument, count - 1);
6408 + };
6409 + }
6410 + function registerStyle10(hash, css) {
6411 + const runtime = getRuntime10();
6412 + runtime.styles.set(hash, css);
6413 + for (const targetDocument of runtime.documents.keys()) {
6414 + injectStyle10(targetDocument, hash, css);
6415 + }
6416 + }
6417 + if (typeof process === "undefined" || true) {
6418 + registerStyle10("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
6419 + }
6420 + var field_default = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
6421 + var Label = (0, import_element14.forwardRef)(
6422 + function Label2({ className, hideFromVision, variant, ...restProps }, ref) {
6423 + const label = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
6424 + index_parts_exports.Label,
6425 + {
6426 + ref,
6427 + className: clsx_default(
6428 + field_default.label,
6429 + variant && field_default[`is-${variant}`],
6430 + className
6431 + ),
6432 + ...restProps
6433 + }
6434 + );
6435 + if (hideFromVision) {
6436 + return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(VisuallyHidden, { render: label });
6437 + }
6438 + return label;
6439 + }
6440 + );
6441 +
6442 + // packages/ui/build-module/form/primitives/field/description.mjs
6443 + var import_element15 = __toESM(require_element(), 1);
6444 + var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
6445 + var STYLE_HASH_ATTRIBUTE11 = "data-wp-hash";
6446 + function getRuntime11() {
6447 + const globalScope = globalThis;
6448 + if (globalScope.__wpStyleRuntime) {
6449 + return globalScope.__wpStyleRuntime;
6450 + }
6451 + globalScope.__wpStyleRuntime = {
6452 + documents: /* @__PURE__ */ new Map(),
6453 + styles: /* @__PURE__ */ new Map(),
6454 + injectedStyles: /* @__PURE__ */ new WeakMap()
6455 + };
6456 + if (typeof document !== "undefined") {
6457 + registerDocument11(document);
6458 + }
6459 + return globalScope.__wpStyleRuntime;
6460 + }
6461 + function documentContainsStyleHash11(targetDocument, hash) {
6462 + if (!targetDocument.head) {
6463 + return false;
6464 + }
6465 + for (const style of targetDocument.head.querySelectorAll(
6466 + `style[${STYLE_HASH_ATTRIBUTE11}]`
6467 + )) {
6468 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE11) === hash) {
6469 + return true;
6470 + }
6471 + }
6472 + return false;
6473 + }
6474 + function injectStyle11(targetDocument, hash, css) {
6475 + if (!targetDocument.head) {
6476 + return;
6477 + }
6478 + const runtime = getRuntime11();
6479 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6480 + if (!injectedStyles) {
6481 + injectedStyles = /* @__PURE__ */ new Set();
6482 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6483 + }
6484 + if (injectedStyles.has(hash)) {
6485 + return;
6486 + }
6487 + if (documentContainsStyleHash11(targetDocument, hash)) {
6488 + injectedStyles.add(hash);
6489 + return;
6490 + }
6491 + const style = targetDocument.createElement("style");
6492 + style.setAttribute(STYLE_HASH_ATTRIBUTE11, hash);
6493 + style.appendChild(targetDocument.createTextNode(css));
6494 + targetDocument.head.appendChild(style);
6495 + injectedStyles.add(hash);
6496 + }
6497 + function registerDocument11(targetDocument) {
6498 + const runtime = getRuntime11();
6499 + runtime.documents.set(
6500 + targetDocument,
6501 + (runtime.documents.get(targetDocument) ?? 0) + 1
6502 + );
6503 + for (const [hash, css] of runtime.styles) {
6504 + injectStyle11(targetDocument, hash, css);
6505 + }
6506 + return () => {
6507 + const count = runtime.documents.get(targetDocument);
6508 + if (count === void 0) {
6509 + return;
6510 + }
6511 + if (count <= 1) {
6512 + runtime.documents.delete(targetDocument);
6513 + return;
6514 + }
6515 + runtime.documents.set(targetDocument, count - 1);
6516 + };
6517 + }
6518 + function registerStyle11(hash, css) {
6519 + const runtime = getRuntime11();
6520 + runtime.styles.set(hash, css);
6521 + for (const targetDocument of runtime.documents.keys()) {
6522 + injectStyle11(targetDocument, hash, css);
6523 + }
6524 + }
6525 + if (typeof process === "undefined" || true) {
6526 + registerStyle11("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
6527 + }
6528 + var global_css_defense_default5 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
6529 + if (typeof process === "undefined" || true) {
6530 + registerStyle11("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
6531 + }
6532 + var field_default2 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
6533 + var Description = (0, import_element15.forwardRef)(function Description2({ className, ...restProps }, ref) {
6534 + return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
6535 + index_parts_exports.Description,
6536 + {
6537 + ref,
6538 + className: clsx_default(
6539 + global_css_defense_default5.p,
6540 + field_default2.description,
6541 + className
6542 + ),
6543 + ...restProps
6544 + }
6545 + );
6546 + });
6547 +
6548 + // packages/ui/build-module/form/primitives/field/details.mjs
6549 + var import_element16 = __toESM(require_element(), 1);
6550 + var import_i18n6 = __toESM(require_i18n(), 1);
6551 + var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
6552 + var STYLE_HASH_ATTRIBUTE12 = "data-wp-hash";
6553 + function getRuntime12() {
6554 + const globalScope = globalThis;
6555 + if (globalScope.__wpStyleRuntime) {
6556 + return globalScope.__wpStyleRuntime;
6557 + }
6558 + globalScope.__wpStyleRuntime = {
6559 + documents: /* @__PURE__ */ new Map(),
6560 + styles: /* @__PURE__ */ new Map(),
6561 + injectedStyles: /* @__PURE__ */ new WeakMap()
6562 + };
6563 + if (typeof document !== "undefined") {
6564 + registerDocument12(document);
6565 + }
6566 + return globalScope.__wpStyleRuntime;
6567 + }
6568 + function documentContainsStyleHash12(targetDocument, hash) {
6569 + if (!targetDocument.head) {
6570 + return false;
6571 + }
6572 + for (const style of targetDocument.head.querySelectorAll(
6573 + `style[${STYLE_HASH_ATTRIBUTE12}]`
6574 + )) {
6575 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE12) === hash) {
6576 + return true;
6577 + }
6578 + }
6579 + return false;
6580 + }
6581 + function injectStyle12(targetDocument, hash, css) {
6582 + if (!targetDocument.head) {
6583 + return;
6584 + }
6585 + const runtime = getRuntime12();
6586 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6587 + if (!injectedStyles) {
6588 + injectedStyles = /* @__PURE__ */ new Set();
6589 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6590 + }
6591 + if (injectedStyles.has(hash)) {
6592 + return;
6593 + }
6594 + if (documentContainsStyleHash12(targetDocument, hash)) {
6595 + injectedStyles.add(hash);
6596 + return;
6597 + }
6598 + const style = targetDocument.createElement("style");
6599 + style.setAttribute(STYLE_HASH_ATTRIBUTE12, hash);
6600 + style.appendChild(targetDocument.createTextNode(css));
6601 + targetDocument.head.appendChild(style);
6602 + injectedStyles.add(hash);
6603 + }
6604 + function registerDocument12(targetDocument) {
6605 + const runtime = getRuntime12();
6606 + runtime.documents.set(
6607 + targetDocument,
6608 + (runtime.documents.get(targetDocument) ?? 0) + 1
6609 + );
6610 + for (const [hash, css] of runtime.styles) {
6611 + injectStyle12(targetDocument, hash, css);
6612 + }
6613 + return () => {
6614 + const count = runtime.documents.get(targetDocument);
6615 + if (count === void 0) {
6616 + return;
6617 + }
6618 + if (count <= 1) {
6619 + runtime.documents.delete(targetDocument);
6620 + return;
6621 + }
6622 + runtime.documents.set(targetDocument, count - 1);
6623 + };
6624 + }
6625 + function registerStyle12(hash, css) {
6626 + const runtime = getRuntime12();
6627 + runtime.styles.set(hash, css);
6628 + for (const targetDocument of runtime.documents.keys()) {
6629 + injectStyle12(targetDocument, hash, css);
6630 + }
6631 + }
6632 + if (typeof process === "undefined" || true) {
6633 + registerStyle12("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
6634 + }
6635 + var field_default3 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
6636 + var Details = (0, import_element16.forwardRef)(
6637 + function Details2({ className, ...restProps }, ref) {
6638 + return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
6639 + /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(index_parts_exports.Description, {}), children: (0, import_i18n6.__)("More details follow the field.") }),
6640 + /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
6641 + "div",
6642 + {
6643 + ref,
6644 + className: clsx_default(field_default3.description, className),
6645 + ...restProps
6646 + }
6647 + )
6648 + ] });
6649 + }
6650 + );
6651 +
6652 + // packages/ui/build-module/form/primitives/field/control.mjs
6653 + var import_element17 = __toESM(require_element(), 1);
6654 + var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
6655 + var Control = (0, import_element17.forwardRef)(
6656 + function Control2(props, ref) {
6657 + return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(index_parts_exports.Control, { ref, ...props });
6658 + }
6659 + );
6660 +
6661 + // packages/ui/build-module/form/primitives/field/visual-label.mjs
6662 + var import_element18 = __toESM(require_element(), 1);
6663 + var STYLE_HASH_ATTRIBUTE13 = "data-wp-hash";
6664 + function getRuntime13() {
6665 + const globalScope = globalThis;
6666 + if (globalScope.__wpStyleRuntime) {
6667 + return globalScope.__wpStyleRuntime;
6668 + }
6669 + globalScope.__wpStyleRuntime = {
6670 + documents: /* @__PURE__ */ new Map(),
6671 + styles: /* @__PURE__ */ new Map(),
6672 + injectedStyles: /* @__PURE__ */ new WeakMap()
6673 + };
6674 + if (typeof document !== "undefined") {
6675 + registerDocument13(document);
6676 + }
6677 + return globalScope.__wpStyleRuntime;
6678 + }
6679 + function documentContainsStyleHash13(targetDocument, hash) {
6680 + if (!targetDocument.head) {
6681 + return false;
6682 + }
6683 + for (const style of targetDocument.head.querySelectorAll(
6684 + `style[${STYLE_HASH_ATTRIBUTE13}]`
6685 + )) {
6686 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE13) === hash) {
6687 + return true;
6688 + }
6689 + }
6690 + return false;
6691 + }
6692 + function injectStyle13(targetDocument, hash, css) {
6693 + if (!targetDocument.head) {
6694 + return;
6695 + }
6696 + const runtime = getRuntime13();
6697 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6698 + if (!injectedStyles) {
6699 + injectedStyles = /* @__PURE__ */ new Set();
6700 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6701 + }
6702 + if (injectedStyles.has(hash)) {
6703 + return;
6704 + }
6705 + if (documentContainsStyleHash13(targetDocument, hash)) {
6706 + injectedStyles.add(hash);
6707 + return;
6708 + }
6709 + const style = targetDocument.createElement("style");
6710 + style.setAttribute(STYLE_HASH_ATTRIBUTE13, hash);
6711 + style.appendChild(targetDocument.createTextNode(css));
6712 + targetDocument.head.appendChild(style);
6713 + injectedStyles.add(hash);
6714 + }
6715 + function registerDocument13(targetDocument) {
6716 + const runtime = getRuntime13();
6717 + runtime.documents.set(
6718 + targetDocument,
6719 + (runtime.documents.get(targetDocument) ?? 0) + 1
6720 + );
6721 + for (const [hash, css] of runtime.styles) {
6722 + injectStyle13(targetDocument, hash, css);
6723 + }
6724 + return () => {
6725 + const count = runtime.documents.get(targetDocument);
6726 + if (count === void 0) {
6727 + return;
6728 + }
6729 + if (count <= 1) {
6730 + runtime.documents.delete(targetDocument);
6731 + return;
6732 + }
6733 + runtime.documents.set(targetDocument, count - 1);
6734 + };
6735 + }
6736 + function registerStyle13(hash, css) {
6737 + const runtime = getRuntime13();
6738 + runtime.styles.set(hash, css);
6739 + for (const targetDocument of runtime.documents.keys()) {
6740 + injectStyle13(targetDocument, hash, css);
6741 + }
6742 + }
6743 + if (typeof process === "undefined" || true) {
6744 + registerStyle13("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
6745 + }
6746 + var field_default4 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
6747 + var VisualLabel = (0, import_element18.forwardRef)(
6748 + function VisualLabel2({ className, render, variant, ...restProps }, ref) {
6749 + return useRender({
6750 + defaultTagName: "span",
6751 + render,
6752 + ref,
6753 + props: mergeProps(restProps, {
6754 + className: clsx_default(
6755 + field_default4.label,
6756 + variant && field_default4[`is-${variant}`],
6757 + className
6758 + )
6759 + })
6760 + });
6761 + }
6762 + );
6763 + VisualLabel.displayName = "Field.VisualLabel";
6764 +
6765 + // packages/ui/build-module/form/input-control/input-control.mjs
6766 + var import_element19 = __toESM(require_element(), 1);
6767 + var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
6768 + var STYLE_HASH_ATTRIBUTE14 = "data-wp-hash";
6769 + function getRuntime14() {
6770 + const globalScope = globalThis;
6771 + if (globalScope.__wpStyleRuntime) {
6772 + return globalScope.__wpStyleRuntime;
6773 + }
6774 + globalScope.__wpStyleRuntime = {
6775 + documents: /* @__PURE__ */ new Map(),
6776 + styles: /* @__PURE__ */ new Map(),
6777 + injectedStyles: /* @__PURE__ */ new WeakMap()
6778 + };
6779 + if (typeof document !== "undefined") {
6780 + registerDocument14(document);
6781 + }
6782 + return globalScope.__wpStyleRuntime;
6783 + }
6784 + function documentContainsStyleHash14(targetDocument, hash) {
6785 + if (!targetDocument.head) {
6786 + return false;
6787 + }
6788 + for (const style of targetDocument.head.querySelectorAll(
6789 + `style[${STYLE_HASH_ATTRIBUTE14}]`
6790 + )) {
6791 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE14) === hash) {
6792 + return true;
6793 + }
6794 + }
6795 + return false;
6796 + }
6797 + function injectStyle14(targetDocument, hash, css) {
6798 + if (!targetDocument.head) {
6799 + return;
6800 + }
6801 + const runtime = getRuntime14();
6802 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6803 + if (!injectedStyles) {
6804 + injectedStyles = /* @__PURE__ */ new Set();
6805 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6806 + }
6807 + if (injectedStyles.has(hash)) {
6808 + return;
6809 + }
6810 + if (documentContainsStyleHash14(targetDocument, hash)) {
6811 + injectedStyles.add(hash);
6812 + return;
6813 + }
6814 + const style = targetDocument.createElement("style");
6815 + style.setAttribute(STYLE_HASH_ATTRIBUTE14, hash);
6816 + style.appendChild(targetDocument.createTextNode(css));
6817 + targetDocument.head.appendChild(style);
6818 + injectedStyles.add(hash);
6819 + }
6820 + function registerDocument14(targetDocument) {
6821 + const runtime = getRuntime14();
6822 + runtime.documents.set(
6823 + targetDocument,
6824 + (runtime.documents.get(targetDocument) ?? 0) + 1
6825 + );
6826 + for (const [hash, css] of runtime.styles) {
6827 + injectStyle14(targetDocument, hash, css);
6828 + }
6829 + return () => {
6830 + const count = runtime.documents.get(targetDocument);
6831 + if (count === void 0) {
6832 + return;
6833 + }
6834 + if (count <= 1) {
6835 + runtime.documents.delete(targetDocument);
6836 + return;
6837 + }
6838 + runtime.documents.set(targetDocument, count - 1);
6839 + };
6840 + }
6841 + function registerStyle14(hash, css) {
6842 + const runtime = getRuntime14();
6843 + runtime.styles.set(hash, css);
6844 + for (const targetDocument of runtime.documents.keys()) {
6845 + injectStyle14(targetDocument, hash, css);
6846 + }
6847 + }
6848 + if (typeof process === "undefined" || true) {
6849 + registerStyle14("0c752c3d08", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer compositions{@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.a9211a7e6af24bed__root input[type=date]:not([data-filled]):not(:focus),.a9211a7e6af24bed__root input[type=datetime-local]:not([data-filled]):not(:focus),.a9211a7e6af24bed__root input[type=time]:not([data-filled]):not(:focus){--_gcd-input-color:transparent;--_gcd-input-color-disabled:transparent;color:transparent;&:disabled::-webkit-datetime-edit-text{color:transparent}}}}}");
6850 + }
6851 + var style_default9 = { "root": "a9211a7e6af24bed__root" };
6852 + var InputControl = (0, import_element19.forwardRef)(
6853 + function InputControl2({
6854 + className,
6855 + label,
6856 + description,
6857 + details,
6858 + hideLabelFromVision,
6859 + ...restProps
6860 + }, ref) {
6861 + return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(field_exports.Root, { className: clsx_default(style_default9.root, className), children: [
6862 + /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(field_exports.Label, { hideFromVision: hideLabelFromVision, children: label }),
6863 + /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Input3, { ref, ...restProps }),
6864 + description && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(field_exports.Description, { children: description }),
6865 + details && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(field_exports.Details, { children: details })
6866 + ] });
6867 + }
6868 + );
6869 +
6870 + // packages/ui/build-module/form/with-validation/validated-input-control/validated-input-control.mjs
6871 + var import_element20 = __toESM(require_element(), 1);
6872 + var import_compose2 = __toESM(require_compose(), 1);
6873 + var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
6874 + var ValidatedInputControl = (0, import_element20.forwardRef)(function ValidatedInputControl2({ required, markWhenOptional, customValidity, ...restProps }, forwardedRef) {
6875 + const validityTargetRef = (0, import_element20.useRef)(null);
6876 + const mergedRefs = (0, import_compose2.useMergeRefs)([forwardedRef, validityTargetRef]);
6877 + return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
6878 + ControlWithError,
6879 + {
6880 + required,
6881 + markWhenOptional,
6882 + customValidity,
6883 + getValidityTarget: () => validityTargetRef.current,
6884 + children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InputControl, { ref: mergedRefs, ...restProps })
6885 + }
6886 + );
6887 + });
6888 +
6889 + // packages/ui/build-module/tabs/index.mjs
6890 + var tabs_exports = {};
6891 + __export(tabs_exports, {
6892 + List: () => List,
6893 + Panel: () => Panel,
6894 + Root: () => Root3,
6895 + Tab: () => Tab
6896 + });
6897 +
6898 + // packages/ui/build-module/tabs/list.mjs
6899 + var import_element21 = __toESM(require_element(), 1);
6900 + var import_compose3 = __toESM(require_compose(), 1);
6901 + var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
6902 + var STYLE_HASH_ATTRIBUTE15 = "data-wp-hash";
6903 + function getRuntime15() {
6904 + const globalScope = globalThis;
6905 + if (globalScope.__wpStyleRuntime) {
6906 + return globalScope.__wpStyleRuntime;
6907 + }
6908 + globalScope.__wpStyleRuntime = {
6909 + documents: /* @__PURE__ */ new Map(),
6910 + styles: /* @__PURE__ */ new Map(),
6911 + injectedStyles: /* @__PURE__ */ new WeakMap()
6912 + };
6913 + if (typeof document !== "undefined") {
6914 + registerDocument15(document);
6915 + }
6916 + return globalScope.__wpStyleRuntime;
6917 + }
6918 + function documentContainsStyleHash15(targetDocument, hash) {
6919 + if (!targetDocument.head) {
6920 + return false;
6921 + }
6922 + for (const style of targetDocument.head.querySelectorAll(
6923 + `style[${STYLE_HASH_ATTRIBUTE15}]`
6924 + )) {
6925 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE15) === hash) {
6926 + return true;
6927 + }
6928 + }
6929 + return false;
6930 + }
6931 + function injectStyle15(targetDocument, hash, css) {
6932 + if (!targetDocument.head) {
6933 + return;
6934 + }
6935 + const runtime = getRuntime15();
6936 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6937 + if (!injectedStyles) {
6938 + injectedStyles = /* @__PURE__ */ new Set();
6939 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6940 + }
6941 + if (injectedStyles.has(hash)) {
6942 + return;
6943 + }
6944 + if (documentContainsStyleHash15(targetDocument, hash)) {
6945 + injectedStyles.add(hash);
6946 + return;
6947 + }
6948 + const style = targetDocument.createElement("style");
6949 + style.setAttribute(STYLE_HASH_ATTRIBUTE15, hash);
6950 + style.appendChild(targetDocument.createTextNode(css));
6951 + targetDocument.head.appendChild(style);
6952 + injectedStyles.add(hash);
6953 + }
6954 + function registerDocument15(targetDocument) {
6955 + const runtime = getRuntime15();
6956 + runtime.documents.set(
6957 + targetDocument,
6958 + (runtime.documents.get(targetDocument) ?? 0) + 1
6959 + );
6960 + for (const [hash, css] of runtime.styles) {
6961 + injectStyle15(targetDocument, hash, css);
6962 + }
6963 + return () => {
6964 + const count = runtime.documents.get(targetDocument);
6965 + if (count === void 0) {
6966 + return;
6967 + }
6968 + if (count <= 1) {
6969 + runtime.documents.delete(targetDocument);
6970 + return;
6971 + }
6972 + runtime.documents.set(targetDocument, count - 1);
6973 + };
6974 + }
6975 + function registerStyle15(hash, css) {
6976 + const runtime = getRuntime15();
6977 + runtime.styles.set(hash, css);
6978 + for (const targetDocument of runtime.documents.keys()) {
6979 + injectStyle15(targetDocument, hash, css);
6980 + }
6981 + }
6982 + if (typeof process === "undefined" || true) {
6983 + registerStyle15("54ae3f4680", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:var(--wpds-dimension-size-lg,40px);padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}');
6984 + }
6985 + var style_default10 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron" };
6986 + var SCROLL_EPSILON = 1;
6987 + var List = (0, import_element21.forwardRef)(
6988 + function TabList({
6989 + children,
6990 + variant = "default",
6991 + className,
6992 + activateOnFocus,
6993 + ...otherProps
6994 + }, forwardedRef) {
6995 + const [listEl, setListEl] = (0, import_element21.useState)(null);
6996 + const [overflow, setOverflow] = (0, import_element21.useState)({
6997 + first: false,
6998 + last: false,
6999 + isScrolling: false
7000 + });
7001 + (0, import_element21.useEffect)(() => {
7002 + if (!listEl) {
7003 + return;
7004 + }
7005 + const measureOverflow = () => {
7006 + const { scrollWidth, clientWidth, scrollLeft } = listEl;
7007 + const maxScroll = Math.max(scrollWidth - clientWidth, 0);
7008 + const direction = listEl.dir || (typeof window !== "undefined" ? window.getComputedStyle(listEl).direction : "ltr");
7009 + const scrollFromStart = direction === "rtl" && scrollLeft < 0 ? (
7010 + // In RTL layouts, scrollLeft is typically 0 at the visual "start"
7011 + // (right edge) and becomes negative toward the "end" (left edge).
7012 + // Normalize value for correct first/last detection logic.
7013 + -scrollLeft
7014 + ) : scrollLeft;
7015 + const next = {
7016 + first: scrollFromStart > SCROLL_EPSILON,
7017 + last: scrollFromStart < maxScroll - SCROLL_EPSILON,
7018 + isScrolling: scrollWidth > clientWidth
7019 + };
7020 + setOverflow(
7021 + (prev) => prev.first === next.first && prev.last === next.last && prev.isScrolling === next.isScrolling ? prev : next
7022 + );
7023 + };
7024 + const resizeObserver = new ResizeObserver(measureOverflow);
7025 + const observeTabs = () => {
7026 + resizeObserver.disconnect();
7027 + resizeObserver.observe(listEl);
7028 + listEl.querySelectorAll('[role="tab"]').forEach((tab) => resizeObserver.observe(tab));
7029 + };
7030 + const mutationObserver = new MutationObserver(observeTabs);
7031 + mutationObserver.observe(listEl, {
7032 + childList: true,
7033 + subtree: true
7034 + });
7035 + let scrollTick = false;
7036 + const throttleMeasureOverflowOnScroll = () => {
7037 + if (!scrollTick) {
7038 + requestAnimationFrame(() => {
7039 + measureOverflow();
7040 + scrollTick = false;
7041 + });
7042 + scrollTick = true;
7043 + }
7044 + };
7045 + listEl.addEventListener(
7046 + "scroll",
7047 + throttleMeasureOverflowOnScroll,
7048 + { passive: true }
7049 + );
7050 + observeTabs();
7051 + measureOverflow();
7052 + return () => {
7053 + listEl.removeEventListener(
7054 + "scroll",
7055 + throttleMeasureOverflowOnScroll
7056 + );
7057 + resizeObserver.disconnect();
7058 + mutationObserver.disconnect();
7059 + };
7060 + }, [listEl]);
7061 + const mergedListRef = (0, import_compose3.useMergeRefs)([
7062 + forwardedRef,
7063 + (el) => setListEl(el)
7064 + ]);
7065 + return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
7066 + index_parts_exports2.List,
7067 + {
7068 + ref: mergedListRef,
7069 + activateOnFocus,
7070 + "data-select-on-move": activateOnFocus ? "true" : "false",
7071 + className: clsx_default(
7072 + style_default10.tablist,
7073 + overflow.first && style_default10["is-overflowing-first"],
7074 + overflow.last && style_default10["is-overflowing-last"],
7075 + style_default10[`is-${variant}-variant`],
7076 + className
7077 + ),
7078 + ...otherProps,
7079 + tabIndex: otherProps.tabIndex ?? (overflow.isScrolling ? -1 : void 0),
7080 + children: [
7081 + children,
7082 + /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(index_parts_exports2.Indicator, { className: style_default10.indicator })
7083 + ]
7084 + }
7085 + );
7086 + }
7087 + );
7088 +
7089 + // packages/ui/build-module/tabs/panel.mjs
7090 + var import_element23 = __toESM(require_element(), 1);
7091 +
7092 + // packages/ui/build-module/tabs/context.mjs
7093 + var import_element22 = __toESM(require_element(), 1);
7094 + var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
7095 + var VALIDATION_ENABLED = true;
7096 + var TabsValidationContext = VALIDATION_ENABLED ? (0, import_element22.createContext)(null) : null;
7097 + function useRegisterTabDev() {
7098 + const context = (0, import_element22.useContext)(TabsValidationContext);
7099 + (0, import_element22.useEffect)(() => {
7100 + if (context) {
7101 + return context.registerTab();
7102 + }
7103 + return void 0;
7104 + }, [context]);
7105 + }
7106 + function useRegisterTabProd() {
7107 + }
7108 + var useRegisterTab = VALIDATION_ENABLED ? useRegisterTabDev : useRegisterTabProd;
7109 + function useRegisterPanelDev() {
7110 + const context = (0, import_element22.useContext)(TabsValidationContext);
7111 + (0, import_element22.useEffect)(() => {
7112 + if (context) {
7113 + return context.registerPanel();
7114 + }
7115 + return void 0;
7116 + }, [context]);
7117 + }
7118 + function useRegisterPanelProd() {
7119 + }
7120 + var useRegisterPanel = VALIDATION_ENABLED ? useRegisterPanelDev : useRegisterPanelProd;
7121 + function TabsValidationProviderDev({
7122 + children
7123 + }) {
7124 + const tabCountRef = (0, import_element22.useRef)(0);
7125 + const panelCountRef = (0, import_element22.useRef)(0);
7126 + const scheduleValidation = useScheduleValidation(() => {
7127 + const tabCount = tabCountRef.current;
7128 + const panelCount = panelCountRef.current;
7129 + if (tabCount !== panelCount) {
7130 + throw new Error(
7131 + `Tabs: Tab/Panel count mismatch (${tabCount} Tabs, ${panelCount} Panels). Each Tab must be associated with exactly one Panel. Mismatched or missing associations can break screen reader navigation and violate WAI-ARIA Tabs pattern requirements.`
7132 + );
7133 + }
7134 + });
7135 + const registerTab = (0, import_element22.useCallback)(() => {
7136 + tabCountRef.current += 1;
7137 + scheduleValidation();
7138 + return () => {
7139 + tabCountRef.current -= 1;
7140 + scheduleValidation();
7141 + };
7142 + }, [scheduleValidation]);
7143 + const registerPanel = (0, import_element22.useCallback)(() => {
7144 + panelCountRef.current += 1;
7145 + scheduleValidation();
7146 + return () => {
7147 + panelCountRef.current -= 1;
7148 + scheduleValidation();
7149 + };
7150 + }, [scheduleValidation]);
7151 + const contextValue = (0, import_element22.useMemo)(
7152 + () => ({
7153 + registerTab,
7154 + registerPanel
7155 + }),
7156 + [registerTab, registerPanel]
7157 + );
7158 + return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TabsValidationContext.Provider, { value: contextValue, children });
7159 + }
7160 + function TabsValidationProviderProd({
7161 + children
7162 + }) {
7163 + return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children });
7164 + }
7165 + var TabsValidationProvider = VALIDATION_ENABLED ? TabsValidationProviderDev : TabsValidationProviderProd;
7166 +
7167 + // packages/ui/build-module/tabs/panel.mjs
7168 + var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1);
7169 + var STYLE_HASH_ATTRIBUTE16 = "data-wp-hash";
7170 + function getRuntime16() {
7171 + const globalScope = globalThis;
7172 + if (globalScope.__wpStyleRuntime) {
7173 + return globalScope.__wpStyleRuntime;
7174 + }
7175 + globalScope.__wpStyleRuntime = {
7176 + documents: /* @__PURE__ */ new Map(),
7177 + styles: /* @__PURE__ */ new Map(),
7178 + injectedStyles: /* @__PURE__ */ new WeakMap()
7179 + };
7180 + if (typeof document !== "undefined") {
7181 + registerDocument16(document);
7182 + }
7183 + return globalScope.__wpStyleRuntime;
7184 + }
7185 + function documentContainsStyleHash16(targetDocument, hash) {
7186 + if (!targetDocument.head) {
7187 + return false;
7188 + }
7189 + for (const style of targetDocument.head.querySelectorAll(
7190 + `style[${STYLE_HASH_ATTRIBUTE16}]`
7191 + )) {
7192 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE16) === hash) {
7193 + return true;
7194 + }
7195 + }
7196 + return false;
7197 + }
7198 + function injectStyle16(targetDocument, hash, css) {
7199 + if (!targetDocument.head) {
7200 + return;
7201 + }
7202 + const runtime = getRuntime16();
7203 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
7204 + if (!injectedStyles) {
7205 + injectedStyles = /* @__PURE__ */ new Set();
7206 + runtime.injectedStyles.set(targetDocument, injectedStyles);
7207 + }
7208 + if (injectedStyles.has(hash)) {
7209 + return;
7210 + }
7211 + if (documentContainsStyleHash16(targetDocument, hash)) {
7212 + injectedStyles.add(hash);
7213 + return;
7214 + }
7215 + const style = targetDocument.createElement("style");
7216 + style.setAttribute(STYLE_HASH_ATTRIBUTE16, hash);
7217 + style.appendChild(targetDocument.createTextNode(css));
7218 + targetDocument.head.appendChild(style);
7219 + injectedStyles.add(hash);
7220 + }
7221 + function registerDocument16(targetDocument) {
7222 + const runtime = getRuntime16();
7223 + runtime.documents.set(
7224 + targetDocument,
7225 + (runtime.documents.get(targetDocument) ?? 0) + 1
7226 + );
7227 + for (const [hash, css] of runtime.styles) {
7228 + injectStyle16(targetDocument, hash, css);
7229 + }
7230 + return () => {
7231 + const count = runtime.documents.get(targetDocument);
7232 + if (count === void 0) {
7233 + return;
7234 + }
7235 + if (count <= 1) {
7236 + runtime.documents.delete(targetDocument);
7237 + return;
7238 + }
7239 + runtime.documents.set(targetDocument, count - 1);
7240 + };
7241 + }
7242 + function registerStyle16(hash, css) {
7243 + const runtime = getRuntime16();
7244 + runtime.styles.set(hash, css);
7245 + for (const targetDocument of runtime.documents.keys()) {
7246 + injectStyle16(targetDocument, hash, css);
7247 + }
7248 + }
7249 + if (typeof process === "undefined" || true) {
7250 + registerStyle16("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
7251 + }
7252 + var global_css_defense_default6 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
7253 + if (typeof process === "undefined" || true) {
7254 + registerStyle16("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
7255 + }
7256 + var focus_module_default3 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
7257 + var Panel = (0, import_element23.forwardRef)(
7258 + function TabPanel({ className, ...otherProps }, forwardedRef) {
7259 + useRegisterPanel();
7260 + return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
7261 + index_parts_exports2.Panel,
7262 + {
7263 + ref: forwardedRef,
7264 + className: clsx_default(
7265 + global_css_defense_default6.div,
7266 + focus_module_default3["outset-ring--focus-visible"],
7267 + className
7268 + ),
7269 + ...otherProps
7270 + }
7271 + );
7272 + }
7273 + );
7274 +
7275 + // packages/ui/build-module/tabs/root.mjs
7276 + var import_element24 = __toESM(require_element(), 1);
7277 + var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
7278 + var Root3 = (0, import_element24.forwardRef)(
7279 + function TabsRoot3({ ...otherProps }, forwardedRef) {
7280 + return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TabsValidationProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(index_parts_exports2.Root, { ref: forwardedRef, ...otherProps }) }) });
7281 + }
7282 + );
7283 +
7284 + // packages/ui/build-module/tabs/tab.mjs
7285 + var import_element25 = __toESM(require_element(), 1);
7286 + var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
7287 + var STYLE_HASH_ATTRIBUTE17 = "data-wp-hash";
7288 + function getRuntime17() {
7289 + const globalScope = globalThis;
7290 + if (globalScope.__wpStyleRuntime) {
7291 + return globalScope.__wpStyleRuntime;
7292 + }
7293 + globalScope.__wpStyleRuntime = {
7294 + documents: /* @__PURE__ */ new Map(),
7295 + styles: /* @__PURE__ */ new Map(),
7296 + injectedStyles: /* @__PURE__ */ new WeakMap()
7297 + };
7298 + if (typeof document !== "undefined") {
7299 + registerDocument17(document);
7300 + }
7301 + return globalScope.__wpStyleRuntime;
7302 + }
7303 + function documentContainsStyleHash17(targetDocument, hash) {
7304 + if (!targetDocument.head) {
7305 + return false;
7306 + }
7307 + for (const style of targetDocument.head.querySelectorAll(
7308 + `style[${STYLE_HASH_ATTRIBUTE17}]`
7309 + )) {
7310 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE17) === hash) {
7311 + return true;
7312 + }
7313 + }
7314 + return false;
7315 + }
7316 + function injectStyle17(targetDocument, hash, css) {
7317 + if (!targetDocument.head) {
7318 + return;
7319 + }
7320 + const runtime = getRuntime17();
7321 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
7322 + if (!injectedStyles) {
7323 + injectedStyles = /* @__PURE__ */ new Set();
7324 + runtime.injectedStyles.set(targetDocument, injectedStyles);
7325 + }
7326 + if (injectedStyles.has(hash)) {
7327 + return;
7328 + }
7329 + if (documentContainsStyleHash17(targetDocument, hash)) {
7330 + injectedStyles.add(hash);
7331 + return;
7332 + }
7333 + const style = targetDocument.createElement("style");
7334 + style.setAttribute(STYLE_HASH_ATTRIBUTE17, hash);
7335 + style.appendChild(targetDocument.createTextNode(css));
7336 + targetDocument.head.appendChild(style);
7337 + injectedStyles.add(hash);
7338 + }
7339 + function registerDocument17(targetDocument) {
7340 + const runtime = getRuntime17();
7341 + runtime.documents.set(
7342 + targetDocument,
7343 + (runtime.documents.get(targetDocument) ?? 0) + 1
7344 + );
7345 + for (const [hash, css] of runtime.styles) {
7346 + injectStyle17(targetDocument, hash, css);
7347 + }
7348 + return () => {
7349 + const count = runtime.documents.get(targetDocument);
7350 + if (count === void 0) {
7351 + return;
7352 + }
7353 + if (count <= 1) {
7354 + runtime.documents.delete(targetDocument);
7355 + return;
7356 + }
7357 + runtime.documents.set(targetDocument, count - 1);
7358 + };
7359 + }
7360 + function registerStyle17(hash, css) {
7361 + const runtime = getRuntime17();
7362 + runtime.styles.set(hash, css);
7363 + for (const targetDocument of runtime.documents.keys()) {
7364 + injectStyle17(targetDocument, hash, css);
7365 + }
7366 + }
7367 + if (typeof process === "undefined" || true) {
7368 + registerStyle17("54ae3f4680", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:var(--wpds-dimension-size-lg,40px);padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}');
7369 + }
7370 + var style_default11 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron" };
7371 + var Tab = (0, import_element25.forwardRef)(function Tab2({ className, children, ...otherProps }, forwardedRef) {
7372 + useRegisterTab();
7373 + return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
7374 + index_parts_exports2.Tab,
7375 + {
7376 + ref: forwardedRef,
7377 + className: clsx_default(style_default11.tab, className),
7378 + ...otherProps,
7379 + children: [
7380 + /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: style_default11["tab-children"], children }),
7381 + /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { icon: chevron_right_default, className: style_default11["tab-chevron"] })
7382 + ]
7383 + }
7384 + );
7385 + });
7386 +
7387 + // packages/format-library/build-module/image/index.mjs
7388 + var import_i18n7 = __toESM(require_i18n(), 1);
7389 + var import_element26 = __toESM(require_element(), 1);
329 7390 var import_rich_text3 = __toESM(require_rich_text(), 1);
330 7391 var import_block_editor3 = __toESM(require_block_editor(), 1);
331 - var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
7392 + var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
332 7393 var ALLOWED_MEDIA_TYPES = ["image"];
333 7394 var name3 = "core/image";
334 - var title3 = (0, import_i18n3.__)("Inline image");
7395 + var title3 = (0, import_i18n7.__)("Inline image");
335 7396 function getCurrentImageId(activeObjectAttributes) {
336 7397 if (!activeObjectAttributes?.className) {
337 7398 return void 0;
338 7399 }
@@ -341,9 +7402,9 @@
341 7402 }
342 7403 var image = {
343 7404 name: name3,
344 7405 title: title3,
345 - keywords: [(0, import_i18n3.__)("photo"), (0, import_i18n3.__)("media")],
7406 + keywords: [(0, import_i18n7.__)("photo"), (0, import_i18n7.__)("media")],
346 7407 object: true,
347 7408 tagName: "img",
348 7409 className: null,
349 7410 attributes: {
@@ -353,25 +7414,32 @@
353 7414 alt: "alt"
354 7415 },
355 7416 edit: Edit
356 7417 };
357 - function InlineUI({ value, onChange, activeObjectAttributes, contentRef }) {
358 - const { style, alt } = activeObjectAttributes;
7418 + function InlineUI({
7419 + value,
7420 + onChange,
7421 + activeObjectAttributes,
7422 + contentRef
7423 + }) {
7424 + const style = activeObjectAttributes?.style;
7425 + const alt = activeObjectAttributes?.alt;
359 7426 const width = style?.replace(/\D/g, "");
360 - const [editedWidth, setEditedWidth] = (0, import_element2.useState)(width);
361 - const [editedAlt, setEditedAlt] = (0, import_element2.useState)(alt);
7427 + const [editedWidth, setEditedWidth] = (0, import_element26.useState)(width);
7428 + const [editedAlt, setEditedAlt] = (0, import_element26.useState)(alt);
362 7429 const hasChanged = editedWidth !== width || editedAlt !== alt;
363 7430 const popoverAnchor = (0, import_rich_text3.useAnchor)({
7431 + // eslint-disable-next-line react-hooks/refs
364 7432 editableContentElement: contentRef.current,
365 7433 settings: image
366 7434 });
367 - return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7435 + return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
368 7436 import_components.Popover,
369 7437 {
370 7438 focusOnMount: false,
371 7439 anchor: popoverAnchor,
372 7440 className: "block-editor-format-toolbar__image-popover",
373 - children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7441 + children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
374 7442 "form",
375 7443 {
376 7444 className: "block-editor-format-toolbar__image-container-content",
377 7445 onSubmit: (event) => {
@@ -380,9 +7448,9 @@
380 7448 type: name3,
381 7449 attributes: {
382 7450 ...activeObjectAttributes,
383 7451 style: editedWidth ? `width: ${editedWidth}px;` : "",
384 - alt: editedAlt
7452 + alt: editedAlt ?? ""
385 7453 }
386 7454 };
387 7455 onChange({
388 7456 ...value,
@@ -389,14 +7457,13 @@
389 7457 replacements: newReplacements
390 7458 });
391 7459 event.preventDefault();
392 7460 },
393 - children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_components.__experimentalVStack, { spacing: 4, children: [
394 - /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7461 + children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Stack, { direction: "column", gap: "lg", children: [
7462 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
395 7463 import_components.__experimentalNumberControl,
396 7464 {
397 - __next40pxDefaultSize: true,
398 - label: (0, import_i18n3.__)("Width"),
7465 + label: (0, import_i18n7.__)("Width"),
399 7466 value: editedWidth,
400 7467 min: 1,
401 7468 onChange: (newWidth) => {
402 7469 setEditedWidth(newWidth);
@@ -402,37 +7469,38 @@
402 7469 setEditedWidth(newWidth);
403 7470 }
404 7471 }
405 7472 ),
406 - /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7473 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
407 7474 import_components.TextareaControl,
408 7475 {
409 - label: (0, import_i18n3.__)("Alternative text"),
410 - value: editedAlt,
7476 + label: (0, import_i18n7.__)("Alternative text"),
7477 + value: editedAlt ?? "",
411 7478 onChange: (newAlt) => {
412 7479 setEditedAlt(newAlt);
413 7480 },
414 - help: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
415 - /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
416 - import_components.ExternalLink,
7481 + help: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
7482 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7483 + Link,
417 7484 {
7485 + openInNewTab: true,
418 7486 href: (
419 7487 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.
420 - (0, import_i18n3.__)(
7488 + (0, import_i18n7.__)(
421 7489 "https://www.w3.org/WAI/tutorials/images/decision-tree/"
422 7490 )
423 7491 ),
424 - children: (0, import_i18n3.__)(
7492 + children: (0, import_i18n7.__)(
425 7493 "Describe the purpose of the image."
426 7494 )
427 7495 }
428 7496 ),
429 - /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("br", {}),
430 - (0, import_i18n3.__)("Leave empty if decorative.")
7497 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("br", {}),
7498 + (0, import_i18n7.__)("Leave empty if decorative.")
431 7499 ] })
432 7500 }
433 7501 ),
434 - /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components.__experimentalHStack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7502 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
435 7503 import_components.Button,
436 7504 {
437 7505 disabled: !hasChanged,
438 7506 accessibleWhenDisabled: true,
@@ -438,9 +7506,9 @@
438 7506 accessibleWhenDisabled: true,
439 7507 variant: "primary",
440 7508 type: "submit",
441 7509 size: "compact",
442 - children: (0, import_i18n3.__)("Apply")
7510 + children: (0, import_i18n7.__)("Apply")
443 7511 }
444 7512 ) })
445 7513 ] })
446 7514 }
@@ -455,15 +7523,20 @@
455 7523 isObjectActive,
456 7524 activeObjectAttributes,
457 7525 contentRef
458 7526 }) {
459 - return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_block_editor3.MediaUploadCheck, { children: [
460 - /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7527 + return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_block_editor3.MediaUploadCheck, { children: [
7528 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
461 7529 import_block_editor3.MediaUpload,
462 7530 {
463 7531 allowedTypes: ALLOWED_MEDIA_TYPES,
464 7532 value: getCurrentImageId(activeObjectAttributes),
465 - onSelect: ({ id, url, alt, width: imgWidth }) => {
7533 + onSelect: ({
7534 + id,
7535 + url,
7536 + alt,
7537 + width: imgWidth
7538 + }) => {
466 7539 onChange(
467 7540 (0, import_rich_text3.insertObject)(value, {
468 7541 type: name3,
469 7542 attributes: {
@@ -478,20 +7551,13 @@
478 7551 })
479 7552 );
480 7553 onFocus();
481 7554 },
482 - render: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7555 + render: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
483 7556 import_block_editor3.RichTextToolbarButton,
484 7557 {
485 - icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
486 - import_components.SVG,
487 - {
488 - xmlns: "http://www.w3.org/2000/svg",
489 - viewBox: "0 0 24 24",
490 - children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components.Path, { d: "M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z" })
491 - }
492 - ),
493 - title: isObjectActive ? (0, import_i18n3.__)("Replace image") : title3,
7558 + icon: inline_image_default,
7559 + title: isObjectActive ? (0, import_i18n7.__)("Replace image") : title3,
494 7560 onClick: open,
495 7561 isActive: isObjectActive
496 7562 }
497 7563 )
@@ -496,9 +7562,9 @@
496 7562 }
497 7563 )
498 7564 }
499 7565 ),
500 - isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7566 + isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
501 7567 InlineUI,
502 7568 {
503 7569 value,
504 7570 onChange,
@@ -509,29 +7575,35 @@
509 7575 ] });
510 7576 }
511 7577
512 7578 // packages/format-library/build-module/italic/index.mjs
513 - var import_i18n4 = __toESM(require_i18n(), 1);
7579 + var import_i18n8 = __toESM(require_i18n(), 1);
514 7580 var import_rich_text4 = __toESM(require_rich_text(), 1);
515 7581 var import_block_editor4 = __toESM(require_block_editor(), 1);
516 - var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
7582 + var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
517 7583 var name4 = "core/italic";
518 - var title4 = (0, import_i18n4.__)("Italic");
7584 + var title4 = (0, import_i18n8.__)("Italic");
519 7585 var italic = {
520 7586 name: name4,
521 7587 title: title4,
522 7588 tagName: "em",
523 7589 className: null,
524 - edit({ isActive, value, onChange, onFocus, isVisible = true }) {
7590 + edit({
7591 + isActive,
7592 + value,
7593 + onChange,
7594 + onFocus,
7595 + isVisible = true
7596 + }) {
525 7597 function onToggle() {
526 7598 onChange((0, import_rich_text4.toggleFormat)(value, { type: name4, title: title4 }));
527 7599 }
528 7600 function onClick() {
529 - onChange((0, import_rich_text4.toggleFormat)(value, { type: name4 }));
7601 + onChange((0, import_rich_text4.toggleFormat)(value, { type: name4, title: title4 }));
530 7602 onFocus();
531 7603 }
532 - return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
533 - /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7604 + return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
7605 + /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
534 7606 import_block_editor4.RichTextShortcut,
535 7607 {
536 7608 type: "primary",
537 7609 character: "i",
@@ -537,9 +7609,9 @@
537 7609 character: "i",
538 7610 onUse: onToggle
539 7611 }
540 7612 ),
541 - isVisible && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7613 + isVisible && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
542 7614 import_block_editor4.RichTextToolbarButton,
543 7615 {
544 7616 name: "italic",
545 7617 icon: format_italic_default,
@@ -549,9 +7621,9 @@
549 7621 shortcutType: "primary",
550 7622 shortcutCharacter: "i"
551 7623 }
552 7624 ),
553 - /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7625 + /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
554 7626 import_block_editor4.__unstableRichTextInputEvent,
555 7627 {
556 7628 inputType: "formatItalic",
557 7629 onInput: onToggle
@@ -561,10 +7633,10 @@
561 7633 }
562 7634 };
563 7635
564 7636 // packages/format-library/build-module/link/index.mjs
565 - var import_i18n7 = __toESM(require_i18n(), 1);
566 - var import_element5 = __toESM(require_element(), 1);
7637 + var import_i18n11 = __toESM(require_i18n(), 1);
7638 + var import_element29 = __toESM(require_element(), 1);
567 7639 var import_rich_text6 = __toESM(require_rich_text(), 1);
568 7640 var import_url3 = __toESM(require_url(), 1);
569 7641 var import_block_editor6 = __toESM(require_block_editor(), 1);
570 7642 var import_html_entities = __toESM(require_html_entities(), 1);
@@ -570,10 +7642,10 @@
570 7642 var import_html_entities = __toESM(require_html_entities(), 1);
571 7643 var import_a11y2 = __toESM(require_a11y(), 1);
572 7644
573 7645 // packages/format-library/build-module/link/inline.mjs
574 - var import_element4 = __toESM(require_element(), 1);
575 - var import_i18n6 = __toESM(require_i18n(), 1);
7646 + var import_element28 = __toESM(require_element(), 1);
7647 + var import_i18n10 = __toESM(require_i18n(), 1);
576 7648 var import_a11y = __toESM(require_a11y(), 1);
577 7649 var import_components3 = __toESM(require_components(), 1);
578 7650 var import_url2 = __toESM(require_url(), 1);
579 7651 var import_rich_text5 = __toESM(require_rich_text(), 1);
@@ -591,9 +7663,9 @@
591 7663 return false;
592 7664 }
593 7665 if (/^\S+:/.test(trimmedHref)) {
594 7666 const protocol = (0, import_url.getProtocol)(trimmedHref);
595 - if (!(0, import_url.isValidProtocol)(protocol)) {
7667 + if (!protocol || !(0, import_url.isValidProtocol)(protocol)) {
596 7668 return false;
597 7669 }
598 7670 if (protocol.startsWith("http") && !/^https?:\/\/[^\/\s]/i.test(trimmedHref)) {
599 7671 return false;
@@ -598,9 +7670,9 @@
598 7670 if (protocol.startsWith("http") && !/^https?:\/\/[^\/\s]/i.test(trimmedHref)) {
599 7671 return false;
600 7672 }
601 7673 const authority = (0, import_url.getAuthority)(trimmedHref);
602 - if (!(0, import_url.isValidAuthority)(authority)) {
7674 + if (!authority || !(0, import_url.isValidAuthority)(authority)) {
603 7675 return false;
604 7676 }
605 7677 const path = (0, import_url.getPath)(trimmedHref);
606 7678 if (path && !(0, import_url.isValidPath)(path)) {
@@ -641,9 +7713,9 @@
641 7713 format.attributes.id = id;
642 7714 }
643 7715 if (opensInNewWindow) {
644 7716 format.attributes.target = "_blank";
645 - format.attributes.rel = format.attributes.rel ? format.attributes.rel + " noreferrer noopener" : "noreferrer noopener";
7717 + format.attributes.rel = format.attributes.rel ? format.attributes.rel + " noopener" : "noopener";
646 7718 }
647 7719 if (nofollow) {
648 7720 format.attributes.rel = format.attributes.rel ? format.attributes.rel + " nofollow" : "nofollow";
649 7721 }
@@ -685,12 +7757,11 @@
685 7757 initialIndex = endIndex - 1;
686 7758 } else {
687 7759 return EMPTY_BOUNDARIES;
688 7760 }
689 - const index = newFormats[initialIndex].indexOf(targetFormat);
690 - const walkingArgs = [newFormats, initialIndex, targetFormat, index];
691 - startIndex = walkToStart(...walkingArgs);
692 - endIndex = walkToEnd(...walkingArgs);
7761 + const index2 = newFormats[initialIndex].indexOf(targetFormat);
7762 + startIndex = walkToStart(newFormats, initialIndex, targetFormat, index2);
7763 + endIndex = walkToEnd(newFormats, initialIndex, targetFormat, index2);
693 7764 startIndex = startIndex < 0 ? 0 : startIndex;
694 7765 return {
695 7766 start: startIndex,
696 7767 end: endIndex + 1
@@ -696,9 +7767,9 @@
696 7767 end: endIndex + 1
697 7768 };
698 7769 }
699 7770 function walkToBoundary(formats, initialIndex, targetFormatRef, formatIndex, direction) {
700 - let index = initialIndex;
7771 + let index2 = initialIndex;
701 7772 const directions = {
702 7773 forwards: 1,
703 7774 backwards: -1
704 7775 };
@@ -703,28 +7774,31 @@
703 7774 backwards: -1
704 7775 };
705 7776 const directionIncrement = directions[direction] || 1;
706 7777 const inverseDirectionIncrement = directionIncrement * -1;
707 - while (formats[index] && formats[index][formatIndex] === targetFormatRef) {
708 - index = index + directionIncrement;
7778 + while (formats[index2] && formats[index2][formatIndex] === targetFormatRef) {
7779 + index2 = index2 + directionIncrement;
709 7780 }
710 - index = index + inverseDirectionIncrement;
711 - return index;
7781 + index2 = index2 + inverseDirectionIncrement;
7782 + return index2;
712 7783 }
713 - var partialRight = (fn, ...partialArgs) => (...args) => fn(...args, ...partialArgs);
714 - var walkToStart = partialRight(walkToBoundary, "backwards");
715 - var walkToEnd = partialRight(walkToBoundary, "forwards");
7784 + var walkToStart = (...args) => walkToBoundary(...args, "backwards");
7785 + var walkToEnd = (...args) => walkToBoundary(...args, "forwards");
716 7786
717 7787 // packages/format-library/build-module/link/css-classes-setting.mjs
718 - var import_element3 = __toESM(require_element(), 1);
719 - var import_compose = __toESM(require_compose(), 1);
720 - var import_i18n5 = __toESM(require_i18n(), 1);
7788 + var import_element27 = __toESM(require_element(), 1);
7789 + var import_compose4 = __toESM(require_compose(), 1);
7790 + var import_i18n9 = __toESM(require_i18n(), 1);
721 7791 var import_components2 = __toESM(require_components(), 1);
722 - var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
723 - var CSSClassesSettingComponent = ({ setting, value, onChange }) => {
724 - const hasValue = value ? value?.cssClasses?.length > 0 : false;
725 - const [isSettingActive, setIsSettingActive] = (0, import_element3.useState)(hasValue);
726 - const instanceId = (0, import_compose.useInstanceId)(CSSClassesSettingComponent);
7792 + var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
7793 + var CSSClassesSettingComponent = ({
7794 + setting,
7795 + value,
7796 + onChange
7797 + }) => {
7798 + const hasValue = !!value?.cssClasses?.length;
7799 + const [isSettingActive, setIsSettingActive] = (0, import_element27.useState)(hasValue);
7800 + const instanceId = (0, import_compose4.useInstanceId)(CSSClassesSettingComponent);
727 7801 const controlledRegionId = `css-classes-setting-${instanceId}`;
728 7802 const handleSettingChange = (newValue) => {
729 7803 const sanitizedValue = typeof newValue === "string" ? newValue.replace(/,/g, " ").replace(/\s+/g, " ").trim() : newValue;
730 7804 onChange({
@@ -741,12 +7815,12 @@
741 7815 } else {
742 7816 setIsSettingActive(true);
743 7817 }
744 7818 };
745 - return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("fieldset", { children: [
746 - /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components2.VisuallyHidden, { as: "legend", children: setting.title }),
747 - /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_components2.__experimentalVStack, { spacing: 3, children: [
748 - /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7819 + return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("fieldset", { children: [
7820 + /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("legend", {}), children: setting.title }),
7821 + /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Stack, { direction: "column", gap: "md", children: [
7822 + /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
749 7823 import_components2.CheckboxControl,
750 7824 {
751 7825 label: setting.title,
752 7826 onChange: handleCheckboxChange,
@@ -754,19 +7828,18 @@
754 7828 "aria-expanded": isSettingActive,
755 7829 "aria-controls": isSettingActive ? controlledRegionId : void 0
756 7830 }
757 7831 ),
758 - isSettingActive && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { id: controlledRegionId, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7832 + isSettingActive && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { id: controlledRegionId, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
759 7833 import_components2.__experimentalInputControl,
760 7834 {
761 - label: (0, import_i18n5.__)("CSS classes"),
7835 + label: (0, import_i18n9.__)("CSS classes"),
762 7836 value: value?.cssClasses,
763 7837 onChange: handleSettingChange,
764 - help: (0, import_i18n5.__)(
7838 + help: (0, import_i18n9.__)(
765 7839 "Separate multiple classes with spaces."
766 7840 ),
767 - __unstableInputWidth: "100%",
768 - __next40pxDefaultSize: true
7841 + __unstableInputWidth: "100%"
769 7842 }
770 7843 ) })
771 7844 ] })
772 7845 ] });
@@ -773,28 +7846,26 @@
773 7846 };
774 7847 var css_classes_setting_default = CSSClassesSettingComponent;
775 7848
776 7849 // packages/format-library/build-module/link/inline.mjs
777 - var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
7850 + var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
778 7851 var LINK_SETTINGS = [
779 7852 ...import_block_editor5.LinkControl.DEFAULT_LINK_SETTINGS,
780 7853 {
781 7854 id: "nofollow",
782 - title: (0, import_i18n6.__)("Mark as nofollow")
7855 + title: (0, import_i18n10.__)("Mark as nofollow")
783 7856 },
784 7857 {
785 7858 id: "cssClasses",
786 - title: (0, import_i18n6.__)("Additional CSS class(es)"),
787 - render: (setting, value, onChange) => {
788 - return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
789 - css_classes_setting_default,
790 - {
791 - setting,
792 - value,
793 - onChange
794 - }
795 - );
796 - }
7859 + title: (0, import_i18n10.__)("Additional CSS class(es)"),
7860 + render: (setting, value, onChange) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7861 + css_classes_setting_default,
7862 + {
7863 + setting,
7864 + value,
7865 + onChange
7866 + }
7867 + )
797 7868 }
798 7869 ];
799 7870 function InlineLinkUI({
800 7871 isActive,
@@ -820,9 +7891,9 @@
820 7891 };
821 7892 },
822 7893 []
823 7894 );
824 - const linkValue = (0, import_element4.useMemo)(
7895 + const linkValue = (0, import_element28.useMemo)(
825 7896 () => ({
826 7897 url: activeAttributes.url,
827 7898 type: activeAttributes.type,
828 7899 id: activeAttributes.id,
@@ -844,9 +7915,9 @@
844 7915 function removeLink() {
845 7916 const newValue = (0, import_rich_text5.removeFormat)(value, "core/link");
846 7917 onChange(newValue);
847 7918 stopAddingLink();
848 - (0, import_a11y.speak)((0, import_i18n6.__)("Link removed."), "assertive");
7919 + (0, import_a11y.speak)((0, import_i18n10.__)("Link removed."), "assertive");
849 7920 }
850 7921 function onChangeLink(nextValue) {
851 7922 const hasLink = linkValue?.url;
852 7923 const isNewLink = !hasLink;
@@ -853,9 +7924,9 @@
853 7924 nextValue = {
854 7925 ...linkValue,
855 7926 ...nextValue
856 7927 };
857 - const newUrl = (0, import_url2.prependHTTPS)(nextValue.url);
7928 + const newUrl = (0, import_url2.prependHTTPS)(nextValue?.url ?? "");
858 7929 const linkFormat = createLinkFormat({
859 7930 url: newUrl,
860 7931 type: nextValue.type,
861 7932 id: nextValue.id !== void 0 && nextValue.id !== null ? String(nextValue.id) : void 0,
@@ -896,13 +7967,13 @@
896 7967 newValue = (0, import_rich_text5.applyFormat)(newValue, linkFormat, 0, newText.length);
897 7968 const boundary = getFormatBoundary(value, {
898 7969 type: "core/link"
899 7970 });
900 - const [valBefore, valAfter] = (0, import_rich_text5.split)(
901 - value,
902 - boundary.start,
903 - boundary.start
904 - );
7971 + const splitValue = (0, import_rich_text5.split)(value, boundary.start, boundary.start);
7972 + if (!splitValue) {
7973 + return;
7974 + }
7975 + const [valBefore, valAfter] = splitValue;
905 7976 const newValAfter = (0, import_rich_text5.replace)(valAfter, richTextText, newValue);
906 7977 newValue = (0, import_rich_text5.concat)(valBefore, newValAfter);
907 7978 }
908 7979 onChange(newValue);
@@ -910,25 +7981,24 @@
910 7981 stopAddingLink();
911 7982 }
912 7983 if (!isValidHref(newUrl)) {
913 7984 (0, import_a11y.speak)(
914 - (0, import_i18n6.__)(
7985 + (0, import_i18n10.__)(
915 7986 "Warning: the link has been inserted but may have errors. Please test it."
916 7987 ),
917 7988 "assertive"
918 7989 );
919 7990 } else if (isActive) {
920 - (0, import_a11y.speak)((0, import_i18n6.__)("Link edited."), "assertive");
7991 + (0, import_a11y.speak)((0, import_i18n10.__)("Link edited."), "assertive");
921 7992 } else {
922 - (0, import_a11y.speak)((0, import_i18n6.__)("Link inserted."), "assertive");
7993 + (0, import_a11y.speak)((0, import_i18n10.__)("Link inserted."), "assertive");
923 7994 }
924 7995 }
7996 + const anchorSettings = { ...link, isActive };
925 7997 const popoverAnchor = (0, import_rich_text5.useAnchor)({
7998 + // eslint-disable-next-line react-hooks/refs
926 7999 editableContentElement: contentRef.current,
927 - settings: {
928 - ...link,
929 - isActive
930 - }
8000 + settings: anchorSettings
931 8001 });
932 8002 async function handleCreate(pageTitle) {
933 8003 const page = await createPageEntity({
934 8004 title: pageTitle,
@@ -942,18 +8012,18 @@
942 8012 kind: "post-type"
943 8013 };
944 8014 }
945 8015 function createButtonText(searchTerm) {
946 - return (0, import_element4.createInterpolateElement)(
947 - (0, import_i18n6.sprintf)(
8016 + return (0, import_element28.createInterpolateElement)(
8017 + (0, import_i18n10.sprintf)(
948 8018 /* translators: %s: search term. */
949 - (0, import_i18n6.__)("Create page: <mark>%s</mark>"),
8019 + (0, import_i18n10.__)("Create page: <mark>%s</mark>"),
950 8020 searchTerm
951 8021 ),
952 - { mark: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("mark", {}) }
8022 + { mark: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("mark", {}) }
953 8023 );
954 8024 }
955 - return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
8025 + return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
956 8026 import_components3.Popover,
957 8027 {
958 8028 anchor: popoverAnchor,
959 8029 animate: false,
@@ -963,9 +8033,9 @@
963 8033 offset: 8,
964 8034 shift: true,
965 8035 focusOnMount,
966 8036 constrainTabbing: true,
967 - children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
8037 + children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
968 8038 import_block_editor5.LinkControl,
969 8039 {
970 8040 value: linkValue,
971 8041 onChange: onChangeLink,
@@ -996,10 +8066,10 @@
996 8066 if (isActive) {
997 8067 const boundary = getFormatBoundary(value, {
998 8068 type: "core/link"
999 8069 });
1000 - textStart = boundary.start;
1001 - textEnd = boundary.end;
8070 + textStart = boundary.start ?? value.start;
8071 + textEnd = boundary.end ?? value.end;
1002 8072 }
1003 8073 return (0, import_rich_text5.slice)(value, textStart, textEnd);
1004 8074 }
1005 8075 var inline_default = InlineLinkUI;
@@ -1004,11 +8074,11 @@
1004 8074 }
1005 8075 var inline_default = InlineLinkUI;
1006 8076
1007 8077 // packages/format-library/build-module/link/index.mjs
1008 - var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
8078 + var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
1009 8079 var name5 = "core/link";
1010 - var title5 = (0, import_i18n7.__)("Link");
8080 + var title5 = (0, import_i18n11.__)("Link");
1011 8081 function Edit2({
1012 8082 isActive,
1013 8083 activeAttributes,
1014 8084 value,
@@ -1016,22 +8086,24 @@
1016 8086 onFocus,
1017 8087 contentRef,
1018 8088 isVisible = true
1019 8089 }) {
1020 - const [addingLink, setAddingLink] = (0, import_element5.useState)(false);
1021 - const [openedBy, setOpenedBy] = (0, import_element5.useState)(null);
1022 - (0, import_element5.useEffect)(() => {
8090 + const [addingLink, setAddingLink] = (0, import_element29.useState)(false);
8091 + const [openedBy, setOpenedBy] = (0, import_element29.useState)(null);
8092 + (0, import_element29.useEffect)(() => {
1023 8093 if (!isActive) {
1024 8094 setAddingLink(false);
1025 8095 }
1026 8096 }, [isActive]);
1027 - (0, import_element5.useLayoutEffect)(() => {
8097 + (0, import_element29.useLayoutEffect)(() => {
1028 8098 const editableContentElement = contentRef.current;
1029 8099 if (!editableContentElement) {
1030 8100 return;
1031 8101 }
1032 8102 function handleClick(event) {
1033 - const link2 = event.target.closest("[contenteditable] a");
8103 + const link2 = event.target.closest(
8104 + "[contenteditable] a"
8105 + );
1034 8106 if (!link2 || // other formats (e.g. bold) may be nested within the link.
1035 8107 !isActive) {
1036 8108 return;
1037 8109 }
@@ -1094,14 +8166,14 @@
1094 8166 setOpenedBy(null);
1095 8167 }
1096 8168 function onRemoveFormat() {
1097 8169 onChange((0, import_rich_text6.removeFormat)(value, name5));
1098 - (0, import_a11y2.speak)((0, import_i18n7.__)("Link removed."), "assertive");
8170 + (0, import_a11y2.speak)((0, import_i18n11.__)("Link removed."), "assertive");
1099 8171 }
1100 8172 const shouldAutoFocus = !(openedBy?.el?.tagName === "A" && openedBy?.action === "click");
1101 8173 const hasSelection = !(0, import_rich_text6.isCollapsed)(value);
1102 - return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
1103 - hasSelection && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
8174 + return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
8175 + hasSelection && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
1104 8176 import_block_editor6.RichTextShortcut,
1105 8177 {
1106 8178 type: "primary",
1107 8179 character: "k",
@@ -1107,9 +8179,9 @@
1107 8179 character: "k",
1108 8180 onUse: addLink
1109 8181 }
1110 8182 ),
1111 - /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
8183 + /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
1112 8184 import_block_editor6.RichTextShortcut,
1113 8185 {
1114 8186 type: "primaryShift",
1115 8187 character: "k",
@@ -1115,14 +8187,14 @@
1115 8187 character: "k",
1116 8188 onUse: onRemoveFormat
1117 8189 }
1118 8190 ),
1119 - isVisible && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
8191 + isVisible && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
1120 8192 import_block_editor6.RichTextToolbarButton,
1121 8193 {
1122 8194 name: "link",
1123 8195 icon: link_default,
1124 - title: isActive ? (0, import_i18n7.__)("Link") : title5,
8196 + title: isActive ? (0, import_i18n11.__)("Link") : title5,
1125 8197 onClick: (event) => {
1126 8198 addLink(event.currentTarget);
1127 8199 },
1128 8200 isActive: isActive || addingLink,
@@ -1131,9 +8203,9 @@
1131 8203 "aria-haspopup": "true",
1132 8204 "aria-expanded": addingLink
1133 8205 }
1134 8206 ),
1135 - isVisible && addingLink && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
8207 + isVisible && addingLink && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
1136 8208 inline_default,
1137 8209 {
1138 8210 stopAddingLink,
1139 8211 onFocusOutside,
@@ -1189,14 +8261,14 @@
1189 8261 edit: Edit2
1190 8262 };
1191 8263
1192 8264 // packages/format-library/build-module/strikethrough/index.mjs
1193 - var import_i18n8 = __toESM(require_i18n(), 1);
8265 + var import_i18n12 = __toESM(require_i18n(), 1);
1194 8266 var import_rich_text7 = __toESM(require_rich_text(), 1);
1195 8267 var import_block_editor7 = __toESM(require_block_editor(), 1);
1196 - var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
8268 + var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
1197 8269 var name6 = "core/strikethrough";
1198 - var title6 = (0, import_i18n8.__)("Strikethrough");
8270 + var title6 = (0, import_i18n12.__)("Strikethrough");
1199 8271 var strikethrough = {
1200 8272 name: name6,
1201 8273 title: title6,
1202 8274 tagName: "s",
@@ -1205,10 +8277,10 @@
1205 8277 function onClick() {
1206 8278 onChange((0, import_rich_text7.toggleFormat)(value, { type: name6, title: title6 }));
1207 8279 onFocus();
1208 8280 }
1209 - return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
1210 - /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
8281 + return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
8282 + /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
1211 8283 import_block_editor7.RichTextShortcut,
1212 8284 {
1213 8285 type: "access",
1214 8286 character: "d",
@@ -1214,9 +8286,9 @@
1214 8286 character: "d",
1215 8287 onUse: onClick
1216 8288 }
1217 8289 ),
1218 - /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
8290 + /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
1219 8291 import_block_editor7.RichTextToolbarButton,
1220 8292 {
1221 8293 icon: format_strikethrough_default,
1222 8294 title: title6,
@@ -1229,14 +8301,14 @@
1229 8301 }
1230 8302 };
1231 8303
1232 8304 // packages/format-library/build-module/underline/index.mjs
1233 - var import_i18n9 = __toESM(require_i18n(), 1);
8305 + var import_i18n13 = __toESM(require_i18n(), 1);
1234 8306 var import_rich_text8 = __toESM(require_rich_text(), 1);
1235 8307 var import_block_editor8 = __toESM(require_block_editor(), 1);
1236 - var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
8308 + var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
1237 8309 var name7 = "core/underline";
1238 - var title7 = (0, import_i18n9.__)("Underline");
8310 + var title7 = (0, import_i18n13.__)("Underline");
1239 8311 var underline = {
1240 8312 name: name7,
1241 8313 title: title7,
1242 8314 tagName: "span",
@@ -1255,10 +8327,10 @@
1255 8327 title: title7
1256 8328 })
1257 8329 );
1258 8330 };
1259 - return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
1260 - /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
8331 + return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
8332 + /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
1261 8333 import_block_editor8.RichTextShortcut,
1262 8334 {
1263 8335 type: "primary",
1264 8336 character: "u",
@@ -1264,9 +8336,9 @@
1264 8336 character: "u",
1265 8337 onUse: onToggle
1266 8338 }
1267 8339 ),
1268 - /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
8340 + /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
1269 8341 import_block_editor8.__unstableRichTextInputEvent,
1270 8342 {
1271 8343 inputType: "formatUnderline",
1272 8344 onInput: onToggle
@@ -1276,48 +8348,41 @@
1276 8348 }
1277 8349 };
1278 8350
1279 8351 // packages/format-library/build-module/text-color/index.mjs
1280 - var import_i18n11 = __toESM(require_i18n(), 1);
1281 - var import_element7 = __toESM(require_element(), 1);
8352 + var import_i18n15 = __toESM(require_i18n(), 1);
8353 + var import_element31 = __toESM(require_element(), 1);
1282 8354 var import_block_editor10 = __toESM(require_block_editor(), 1);
1283 8355 var import_rich_text10 = __toESM(require_rich_text(), 1);
1284 8356
1285 8357 // packages/format-library/build-module/text-color/inline.mjs
1286 - var import_element6 = __toESM(require_element(), 1);
8358 + var import_element30 = __toESM(require_element(), 1);
1287 8359 var import_data2 = __toESM(require_data(), 1);
1288 8360 var import_rich_text9 = __toESM(require_rich_text(), 1);
1289 8361 var import_block_editor9 = __toESM(require_block_editor(), 1);
1290 8362 var import_components4 = __toESM(require_components(), 1);
1291 - var import_i18n10 = __toESM(require_i18n(), 1);
1292 -
1293 - // packages/format-library/build-module/lock-unlock.mjs
1294 - var import_private_apis = __toESM(require_private_apis(), 1);
1295 - var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
1296 - "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
1297 - "@wordpress/format-library"
1298 - );
1299 -
1300 - // packages/format-library/build-module/text-color/inline.mjs
1301 - var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
1302 - var { Tabs } = unlock(import_components4.privateApis);
8363 + var import_i18n14 = __toESM(require_i18n(), 1);
8364 + var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
1303 8365 var TABS = [
1304 - { name: "color", title: (0, import_i18n10.__)("Text") },
1305 - { name: "backgroundColor", title: (0, import_i18n10.__)("Background") }
8366 + { name: "color", title: (0, import_i18n14.__)("Text") },
8367 + { name: "backgroundColor", title: (0, import_i18n14.__)("Background") }
1306 8368 ];
1307 8369 function parseCSS(css = "") {
1308 - return css.split(";").reduce((accumulator, rule) => {
1309 - if (rule) {
1310 - const [property, value] = rule.split(":");
1311 - if (property === "color") {
1312 - accumulator.color = value;
8370 + return css.split(";").reduce(
8371 + (accumulator, rule) => {
8372 + if (rule) {
8373 + const [property, value] = rule.split(":");
8374 + if (property === "color") {
8375 + accumulator.color = value;
8376 + }
8377 + if (property === "background-color" && value !== transparentValue) {
8378 + accumulator.backgroundColor = value;
8379 + }
1313 8380 }
1314 - if (property === "background-color" && value !== transparentValue) {
1315 - accumulator.backgroundColor = value;
1316 - }
1317 - }
1318 - return accumulator;
1319 - }, {});
8381 + return accumulator;
8382 + },
8383 + {}
8384 + );
1320 8385 }
1321 8386 function parseClassName(className = "", colorSettings) {
1322 8387 return className.split(" ").reduce((accumulator, name16) => {
1323 8388 if (name16.startsWith("has-") && name16.endsWith("-color")) {
@@ -1336,10 +8401,10 @@
1336 8401 if (!activeColorFormat) {
1337 8402 return {};
1338 8403 }
1339 8404 return {
1340 - ...parseCSS(activeColorFormat.attributes.style),
1341 - ...parseClassName(activeColorFormat.attributes.class, colorSettings)
8405 + ...parseCSS(activeColorFormat.attributes?.style),
8406 + ...parseClassName(activeColorFormat.attributes?.class, colorSettings)
1342 8407 };
1343 8408 }
1344 8409 function setColors(value, name16, colorSettings, colors) {
1345 8410 const { color, backgroundColor } = {
@@ -1358,10 +8423,16 @@
1358 8423 styles.push(["background-color", transparentValue].join(":"));
1359 8424 }
1360 8425 if (color) {
1361 8426 const colorObject = (0, import_block_editor9.getColorObjectByColorValue)(colorSettings, color);
1362 - if (colorObject) {
1363 - classNames.push((0, import_block_editor9.getColorClassName)("color", colorObject.slug));
8427 + if (colorObject && colorObject.slug) {
8428 + const colorClassName = (0, import_block_editor9.getColorClassName)(
8429 + "color",
8430 + colorObject.slug
8431 + );
8432 + if (colorClassName) {
8433 + classNames.push(colorClassName);
8434 + }
1364 8435 } else {
1365 8436 styles.push(["color", color].join(":"));
1366 8437 }
1367 8438 }
@@ -1377,13 +8448,13 @@
1377 8448 const colors = (0, import_data2.useSelect)((select) => {
1378 8449 const { getSettings } = select(import_block_editor9.store);
1379 8450 return getSettings().colors ?? [];
1380 8451 }, []);
1381 - const activeColors = (0, import_element6.useMemo)(
8452 + const activeColors = (0, import_element30.useMemo)(
1382 8453 () => getActiveColors(value, name16, colors),
1383 8454 [name16, value, colors]
1384 8455 );
1385 - return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
8456 + return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
1386 8457 import_block_editor9.ColorPalette,
1387 8458 {
1388 8459 value: activeColors[property],
1389 8460 onChange: (color) => {
@@ -1403,26 +8474,28 @@
1403 8474 onClose,
1404 8475 contentRef,
1405 8476 isActive
1406 8477 }) {
8478 + const anchorSettings = { ...textColor, isActive };
1407 8479 const popoverAnchor = (0, import_rich_text9.useAnchor)({
8480 + // eslint-disable-next-line react-hooks/refs
1408 8481 editableContentElement: contentRef.current,
1409 - settings: { ...textColor, isActive }
8482 + settings: anchorSettings
1410 8483 });
1411 - return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
8484 + return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
1412 8485 import_components4.Popover,
1413 8486 {
1414 8487 onClose,
1415 8488 className: "format-library__inline-color-popover",
1416 8489 anchor: popoverAnchor,
1417 - children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tabs, { children: [
1418 - /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tabs.TabList, { children: TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tabs.Tab, { tabId: tab.name, children: tab.title }, tab.name)) }),
1419 - TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1420 - Tabs.TabPanel,
8490 + children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(tabs_exports.Root, { defaultValue: TABS[0].name, children: [
8491 + /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(tabs_exports.List, { children: TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(tabs_exports.Tab, { value: tab.name, children: tab.title }, tab.name)) }),
8492 + TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
8493 + tabs_exports.Panel,
1421 8494 {
1422 - tabId: tab.name,
1423 - focusable: false,
1424 - children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
8495 + value: tab.name,
8496 + tabIndex: -1,
8497 + children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
1425 8498 ColorPicker,
1426 8499 {
1427 8500 name: name16,
1428 8501 property: tab.name,
@@ -1438,18 +8511,18 @@
1438 8511 );
1439 8512 }
1440 8513
1441 8514 // packages/format-library/build-module/text-color/index.mjs
1442 - var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
8515 + var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1);
1443 8516 var transparentValue = "rgba(0, 0, 0, 0)";
1444 8517 var name8 = "core/text-color";
1445 - var title8 = (0, import_i18n11.__)("Highlight");
1446 - var EMPTY_ARRAY = [];
8518 + var title8 = (0, import_i18n15.__)("Highlight");
8519 + var EMPTY_ARRAY2 = [];
1447 8520 function getComputedStyleProperty(element, property) {
1448 - const { ownerDocument } = element;
1449 - const { defaultView } = ownerDocument;
1450 - const style = defaultView.getComputedStyle(element);
1451 - const value = style.getPropertyValue(property);
8521 + const { ownerDocument: ownerDocument2 } = element;
8522 + const { defaultView } = ownerDocument2;
8523 + const style = defaultView?.getComputedStyle(element);
8524 + const value = style?.getPropertyValue(property);
1452 8525 if (property === "background-color" && value === transparentValue && element.parentElement) {
1453 8526 return getComputedStyleProperty(element.parentElement, property);
1454 8527 }
1455 8528 return value;
@@ -1454,9 +8527,9 @@
1454 8527 }
1455 8528 return value;
1456 8529 }
1457 8530 function fillComputedColors(element, { color, backgroundColor }) {
1458 - if (!color && !backgroundColor) {
8531 + if (!element || !color && !backgroundColor) {
1459 8532 return;
1460 8533 }
1461 8534 return {
1462 8535 color: color || getComputedStyleProperty(element, "color"),
@@ -1469,14 +8542,14 @@
1469 8542 isActive,
1470 8543 activeAttributes,
1471 8544 contentRef
1472 8545 }) {
1473 - const [allowCustomControl, colors = EMPTY_ARRAY] = (0, import_block_editor10.useSettings)(
8546 + const [allowCustomControl, colors = EMPTY_ARRAY2] = (0, import_block_editor10.useSettings)(
1474 8547 "color.custom",
1475 8548 "color.palette"
1476 8549 );
1477 - const [isAddingColor, setIsAddingColor] = (0, import_element7.useState)(false);
1478 - const colorIndicatorStyle = (0, import_element7.useMemo)(
8550 + const [isAddingColor, setIsAddingColor] = (0, import_element31.useState)(false);
8551 + const colorIndicatorStyle = (0, import_element31.useMemo)(
1479 8552 () => fillComputedColors(
1480 8553 contentRef.current,
1481 8554 getActiveColors(value, name8, colors)
1482 8555 ),
@@ -1485,15 +8558,15 @@
1485 8558 const hasColorsToChoose = !!colors.length || allowCustomControl;
1486 8559 if (!hasColorsToChoose && !isActive) {
1487 8560 return null;
1488 8561 }
1489 - return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
1490 - /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
8562 + return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
8563 + /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
1491 8564 import_block_editor10.RichTextToolbarButton,
1492 8565 {
1493 8566 className: "format-library-text-color-button",
1494 8567 isActive,
1495 - icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
8568 + icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
1496 8569 icon_default,
1497 8570 {
1498 8571 icon: Object.keys(activeAttributes).length ? text_color_default : color_default,
1499 8572 style: colorIndicatorStyle
@@ -1503,14 +8576,13 @@
1503 8576 onClick: hasColorsToChoose ? () => setIsAddingColor(true) : () => onChange((0, import_rich_text10.removeFormat)(value, name8)),
1504 8577 role: "menuitemcheckbox"
1505 8578 }
1506 8579 ),
1507 - isAddingColor && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
8580 + isAddingColor && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
1508 8581 InlineColorUI,
1509 8582 {
1510 8583 name: name8,
1511 8584 onClose: () => setIsAddingColor(false),
1512 - activeAttributes,
1513 8585 value,
1514 8586 onChange,
1515 8587 contentRef,
1516 8588 isActive
@@ -1530,14 +8602,14 @@
1530 8602 edit: TextColorEdit
1531 8603 };
1532 8604
1533 8605 // packages/format-library/build-module/subscript/index.mjs
1534 - var import_i18n12 = __toESM(require_i18n(), 1);
8606 + var import_i18n16 = __toESM(require_i18n(), 1);
1535 8607 var import_rich_text11 = __toESM(require_rich_text(), 1);
1536 8608 var import_block_editor11 = __toESM(require_block_editor(), 1);
1537 - var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
8609 + var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
1538 8610 var name9 = "core/subscript";
1539 - var title9 = (0, import_i18n12.__)("Subscript");
8611 + var title9 = (0, import_i18n16.__)("Subscript");
1540 8612 var subscript = {
1541 8613 name: name9,
1542 8614 title: title9,
1543 8615 tagName: "sub",
@@ -1549,9 +8621,9 @@
1549 8621 function onClick() {
1550 8622 onToggle();
1551 8623 onFocus();
1552 8624 }
1553 - return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
8625 + return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
1554 8626 import_block_editor11.RichTextToolbarButton,
1555 8627 {
1556 8628 icon: subscript_default,
1557 8629 title: title9,
@@ -1563,14 +8635,14 @@
1563 8635 }
1564 8636 };
1565 8637
1566 8638 // packages/format-library/build-module/superscript/index.mjs
1567 - var import_i18n13 = __toESM(require_i18n(), 1);
8639 + var import_i18n17 = __toESM(require_i18n(), 1);
1568 8640 var import_rich_text12 = __toESM(require_rich_text(), 1);
1569 8641 var import_block_editor12 = __toESM(require_block_editor(), 1);
1570 - var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
8642 + var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
1571 8643 var name10 = "core/superscript";
1572 - var title10 = (0, import_i18n13.__)("Superscript");
8644 + var title10 = (0, import_i18n17.__)("Superscript");
1573 8645 var superscript = {
1574 8646 name: name10,
1575 8647 title: title10,
1576 8648 tagName: "sup",
@@ -1582,9 +8654,9 @@
1582 8654 function onClick() {
1583 8655 onToggle();
1584 8656 onFocus();
1585 8657 }
1586 - return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
8658 + return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
1587 8659 import_block_editor12.RichTextToolbarButton,
1588 8660 {
1589 8661 icon: superscript_default,
1590 8662 title: title10,
@@ -1596,15 +8668,15 @@
1596 8668 }
1597 8669 };
1598 8670
1599 8671 // packages/format-library/build-module/keyboard/index.mjs
1600 - var import_i18n14 = __toESM(require_i18n(), 1);
8672 + var import_i18n18 = __toESM(require_i18n(), 1);
1601 8673 var import_rich_text13 = __toESM(require_rich_text(), 1);
1602 8674 var import_block_editor13 = __toESM(require_block_editor(), 1);
1603 - var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
8675 + var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
1604 8676 var name11 = "core/keyboard";
1605 - var title11 = (0, import_i18n14.__)("Keyboard input");
1606 - var keyboard = {
8677 + var title11 = (0, import_i18n18.__)("Keyboard input");
8678 + var keyboard2 = {
1607 8679 name: name11,
1608 8680 title: title11,
1609 8681 tagName: "kbd",
1610 8682 className: null,
@@ -1615,9 +8687,9 @@
1615 8687 function onClick() {
1616 8688 onToggle();
1617 8689 onFocus();
1618 8690 }
1619 - return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
8691 + return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
1620 8692 import_block_editor13.RichTextToolbarButton,
1621 8693 {
1622 8694 icon: button_default,
1623 8695 title: title11,
@@ -1629,14 +8701,14 @@
1629 8701 }
1630 8702 };
1631 8703
1632 8704 // packages/format-library/build-module/unknown/index.mjs
1633 - var import_i18n15 = __toESM(require_i18n(), 1);
8705 + var import_i18n19 = __toESM(require_i18n(), 1);
1634 8706 var import_rich_text14 = __toESM(require_rich_text(), 1);
1635 8707 var import_block_editor14 = __toESM(require_block_editor(), 1);
1636 - var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
8708 + var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
1637 8709 var name12 = "core/unknown";
1638 - var title12 = (0, import_i18n15.__)("Clear Unknown Formatting");
8710 + var title12 = (0, import_i18n19.__)("Clear Unknown Formatting");
1639 8711 function selectionContainsUnknownFormats(value) {
1640 8712 if ((0, import_rich_text14.isCollapsed)(value)) {
1641 8713 return false;
1642 8714 }
@@ -1657,9 +8729,9 @@
1657 8729 function onClick() {
1658 8730 onChange((0, import_rich_text14.removeFormat)(value, name12));
1659 8731 onFocus();
1660 8732 }
1661 - return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8733 + return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
1662 8734 import_block_editor14.RichTextToolbarButton,
1663 8735 {
1664 8736 name: "unknown",
1665 8737 icon: help_default,
@@ -1671,16 +8743,16 @@
1671 8743 }
1672 8744 };
1673 8745
1674 8746 // packages/format-library/build-module/language/index.mjs
1675 - var import_i18n16 = __toESM(require_i18n(), 1);
8747 + var import_i18n20 = __toESM(require_i18n(), 1);
1676 8748 var import_block_editor15 = __toESM(require_block_editor(), 1);
1677 8749 var import_components5 = __toESM(require_components(), 1);
1678 - var import_element8 = __toESM(require_element(), 1);
8750 + var import_element32 = __toESM(require_element(), 1);
1679 8751 var import_rich_text15 = __toESM(require_rich_text(), 1);
1680 - var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
8752 + var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
1681 8753 var name13 = "core/language";
1682 - var title13 = (0, import_i18n16.__)("Language");
8754 + var title13 = (0, import_i18n20.__)("Language");
1683 8755 var language = {
1684 8756 name: name13,
1685 8757 title: title13,
1686 8758 tagName: "bdo",
@@ -1691,14 +8763,14 @@
1691 8763 },
1692 8764 edit: Edit3
1693 8765 };
1694 8766 function Edit3({ isActive, value, onChange, contentRef }) {
1695 - const [isPopoverVisible, setIsPopoverVisible] = (0, import_element8.useState)(false);
8767 + const [isPopoverVisible, setIsPopoverVisible] = (0, import_element32.useState)(false);
1696 8768 const togglePopover = () => {
1697 8769 setIsPopoverVisible((state) => !state);
1698 8770 };
1699 - return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
1700 - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
8771 + return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
8772 + /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
1701 8773 import_block_editor15.RichTextToolbarButton,
1702 8774 {
1703 8775 icon: language_default,
1704 8776 label: title13,
@@ -1713,9 +8785,9 @@
1713 8785 isActive,
1714 8786 role: "menuitemcheckbox"
1715 8787 }
1716 8788 ),
1717 - isPopoverVisible && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
8789 + isPopoverVisible && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
1718 8790 InlineLanguageUI,
1719 8791 {
1720 8792 value,
1721 8793 onChange,
@@ -1724,26 +8796,33 @@
1724 8796 }
1725 8797 )
1726 8798 ] });
1727 8799 }
1728 - function InlineLanguageUI({ value, contentRef, onChange, onClose }) {
8800 + function InlineLanguageUI({
8801 + value,
8802 + contentRef,
8803 + onChange,
8804 + onClose
8805 + }) {
1729 8806 const popoverAnchor = (0, import_rich_text15.useAnchor)({
8807 + // eslint-disable-next-line react-hooks/refs
1730 8808 editableContentElement: contentRef.current,
1731 8809 settings: language
1732 8810 });
1733 - const [lang, setLang] = (0, import_element8.useState)("");
1734 - const [dir, setDir] = (0, import_element8.useState)("ltr");
1735 - return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
8811 + const [lang, setLang] = (0, import_element32.useState)("");
8812 + const [dir, setDir] = (0, import_element32.useState)("ltr");
8813 + return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
1736 8814 import_components5.Popover,
1737 8815 {
1738 8816 className: "block-editor-format-toolbar__language-popover",
1739 8817 anchor: popoverAnchor,
1740 8818 onClose,
1741 - children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
1742 - import_components5.__experimentalVStack,
8819 + children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
8820 + Stack,
1743 8821 {
1744 - as: "form",
1745 - spacing: 4,
8822 + render: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("form", {}),
8823 + direction: "column",
8824 + gap: "lg",
1746 8825 className: "block-editor-format-toolbar__language-container-content",
1747 8826 onSubmit: (event) => {
1748 8827 event.preventDefault();
1749 8828 onChange(
@@ -1757,33 +8836,31 @@
1757 8836 );
1758 8837 onClose();
1759 8838 },
1760 8839 children: [
1761 - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
8840 + /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
1762 8841 import_components5.TextControl,
1763 8842 {
1764 - __next40pxDefaultSize: true,
1765 8843 label: title13,
1766 8844 value: lang,
1767 8845 onChange: (val) => setLang(val),
1768 - help: (0, import_i18n16.__)(
8846 + help: (0, import_i18n20.__)(
1769 8847 'A valid language attribute, like "en" or "fr".'
1770 8848 )
1771 8849 }
1772 8850 ),
1773 - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
8851 + /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
1774 8852 import_components5.SelectControl,
1775 8853 {
1776 - __next40pxDefaultSize: true,
1777 - label: (0, import_i18n16.__)("Text direction"),
8854 + label: (0, import_i18n20.__)("Text direction"),
1778 8855 value: dir,
1779 8856 options: [
1780 8857 {
1781 - label: (0, import_i18n16.__)("Left to right"),
8858 + label: (0, import_i18n20.__)("Left to right"),
1782 8859 value: "ltr"
1783 8860 },
1784 8861 {
1785 - label: (0, import_i18n16.__)("Right to left"),
8862 + label: (0, import_i18n20.__)("Right to left"),
1786 8863 value: "rtl"
1787 8864 }
1788 8865 ],
1789 8866 onChange: (val) => setDir(val)
@@ -1788,15 +8865,15 @@
1788 8865 ],
1789 8866 onChange: (val) => setDir(val)
1790 8867 }
1791 8868 ),
1792 - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components5.__experimentalHStack, { alignment: "right", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
8869 + /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
1793 8870 import_components5.Button,
1794 8871 {
1795 8872 __next40pxDefaultSize: true,
1796 8873 variant: "primary",
1797 8874 type: "submit",
1798 - text: (0, import_i18n16.__)("Apply")
8875 + text: (0, import_i18n20.__)("Apply")
1799 8876 }
1800 8877 ) })
1801 8878 ]
1802 8879 }
@@ -1805,18 +8882,16 @@
1805 8882 );
1806 8883 }
1807 8884
1808 8885 // packages/format-library/build-module/math/index.mjs
1809 - var import_i18n17 = __toESM(require_i18n(), 1);
1810 - var import_element9 = __toESM(require_element(), 1);
8886 + var import_i18n21 = __toESM(require_i18n(), 1);
8887 + var import_element33 = __toESM(require_element(), 1);
1811 8888 var import_rich_text16 = __toESM(require_rich_text(), 1);
1812 8889 var import_block_editor16 = __toESM(require_block_editor(), 1);
1813 8890 var import_components6 = __toESM(require_components(), 1);
1814 - var import_a11y3 = __toESM(require_a11y(), 1);
1815 - var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
1816 - var { Badge } = unlock(import_components6.privateApis);
8891 + var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
1817 8892 var name14 = "core/math";
1818 - var title14 = (0, import_i18n17.__)("Math");
8893 + var title14 = (0, import_i18n21.__)("Math");
1819 8894 function InlineUI2({
1820 8895 value,
1821 8896 onChange,
1822 8897 activeAttributes,
@@ -1822,34 +8897,32 @@
1822 8897 activeAttributes,
1823 8898 contentRef,
1824 8899 latexToMathML
1825 8900 }) {
1826 - const [latex, setLatex] = (0, import_element9.useState)(
8901 + const [latex, setLatex] = (0, import_element33.useState)(
1827 8902 activeAttributes?.["data-latex"] || ""
1828 8903 );
1829 - const [error, setError] = (0, import_element9.useState)(null);
8904 + const [error2, setError] = (0, import_element33.useState)(null);
8905 + const formRef = (0, import_element33.useRef)(null);
1830 8906 const popoverAnchor = (0, import_rich_text16.useAnchor)({
8907 + // eslint-disable-next-line react-hooks/refs
1831 8908 editableContentElement: contentRef.current,
1832 8909 settings: math
1833 8910 });
1834 8911 const handleLatexChange = (newLatex) => {
8912 + setLatex(newLatex);
1835 8913 let mathML = "";
1836 - setLatex(newLatex);
1837 - if (newLatex) {
8914 + if (newLatex && latexToMathML) {
1838 8915 try {
1839 8916 mathML = latexToMathML(newLatex, { displayMode: false });
1840 8917 setError(null);
1841 8918 } catch (err) {
1842 - setError(err.message);
1843 - (0, import_a11y3.speak)(
1844 - (0, import_i18n17.sprintf)(
1845 - /* translators: %s: error message returned when parsing LaTeX. */
1846 - (0, import_i18n17.__)("Error parsing mathematical expression: %s"),
1847 - err.message
1848 - )
8919 + setError(
8920 + err instanceof Error ? err.message : (0, import_i18n21.__)("Could not parse the LaTeX math syntax.")
1849 8921 );
1850 - return;
1851 8922 }
8923 + } else {
8924 + setError(null);
1852 8925 }
1853 8926 const newReplacements = value.replacements.slice();
1854 8927 newReplacements[value.start] = {
1855 8928 type: name14,
@@ -1862,9 +8935,9 @@
1862 8935 ...value,
1863 8936 replacements: newReplacements
1864 8937 });
1865 8938 };
1866 - return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
8939 + return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
1867 8940 import_components6.Popover,
1868 8941 {
1869 8942 placement: "bottom-start",
1870 8943 offset: 8,
@@ -1869,39 +8942,43 @@
1869 8942 placement: "bottom-start",
1870 8943 offset: 8,
1871 8944 focusOnMount: false,
1872 8945 anchor: popoverAnchor,
8946 + onFocusOutside: () => formRef.current?.reportValidity(),
1873 8947 className: "block-editor-format-toolbar__math-popover",
1874 - children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { style: { minWidth: "300px", padding: "4px" }, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_components6.__experimentalVStack, { spacing: 1, children: [
1875 - /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1876 - import_components6.TextControl,
1877 - {
1878 - __next40pxDefaultSize: true,
1879 - hideLabelFromVision: true,
1880 - label: (0, import_i18n17.__)("LaTeX math syntax"),
1881 - value: latex,
1882 - onChange: handleLatexChange,
1883 - placeholder: (0, import_i18n17.__)("e.g., x^2, \\frac{a}{b}"),
1884 - autoComplete: "off",
1885 - className: "block-editor-format-toolbar__math-input"
1886 - }
1887 - ),
1888 - error && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
1889 - /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1890 - Badge,
1891 - {
1892 - intent: "error",
1893 - className: "wp-block-math__error",
1894 - children: (0, import_i18n17.sprintf)(
1895 - /* translators: %s: error message returned when parsing LaTeX. */
1896 - (0, import_i18n17.__)("Error: %s"),
1897 - error
1898 - )
1899 - }
1900 - ),
1901 - /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("style", { children: ".wp-block-math__error .components-badge__content{white-space:normal}" })
1902 - ] })
1903 - ] }) })
8948 + children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
8949 + "form",
8950 + {
8951 + ref: formRef,
8952 + style: { minWidth: "300px", padding: "16px" },
8953 + onSubmit: (event) => event.preventDefault(),
8954 + children: [
8955 + /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
8956 + ValidatedInputControl,
8957 + {
8958 + label: (0, import_i18n21.__)("LaTeX math syntax"),
8959 + value: latex,
8960 + customValidity: error2 ? { type: "invalid", message: error2 } : void 0,
8961 + onValueChange: handleLatexChange,
8962 + placeholder: (0, import_i18n21.__)("e.g., x^2, \\frac{a}{b}, \\sqrt{x}"),
8963 + autoComplete: "off",
8964 + className: "block-editor-format-toolbar__math-input"
8965 + }
8966 + ),
8967 + /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
8968 + Link,
8969 + {
8970 + openInNewTab: true,
8971 + className: "block-editor-format-toolbar__math-learn-more",
8972 + href: (0, import_i18n21.__)(
8973 + "https://wordpress.org/documentation/article/math-block/"
8974 + ),
8975 + children: (0, import_i18n21.__)("Learn more about LaTeX syntax")
8976 + }
8977 + )
8978 + ]
8979 + }
8980 + )
1904 8981 }
1905 8982 );
1906 8983 }
1907 8984 function Edit4({
@@ -1911,36 +8988,52 @@
1911 8988 isObjectActive,
1912 8989 activeObjectAttributes,
1913 8990 contentRef
1914 8991 }) {
1915 - const [latexToMathML, setLatexToMathML] = (0, import_element9.useState)();
1916 - (0, import_element9.useEffect)(() => {
8992 + const [latexToMathML, setLatexToMathML] = (0, import_element33.useState)();
8993 + (0, import_element33.useEffect)(() => {
1917 8994 import("@wordpress/latex-to-mathml").then((module) => {
1918 8995 setLatexToMathML(() => module.default);
1919 8996 });
1920 8997 }, []);
1921 - return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
1922 - /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
8998 + function onClick() {
8999 + let newValue;
9000 + if (isObjectActive) {
9001 + const latex = activeObjectAttributes?.["data-latex"] || "";
9002 + newValue = (0, import_rich_text16.insert)(value, latex);
9003 + newValue.start = newValue.end - latex.length;
9004 + } else {
9005 + const selectedText = (0, import_rich_text16.getTextContent)((0, import_rich_text16.slice)(value));
9006 + let innerHTML = "";
9007 + if (selectedText && latexToMathML) {
9008 + try {
9009 + innerHTML = latexToMathML(selectedText, {
9010 + displayMode: false
9011 + });
9012 + } catch {
9013 + }
9014 + }
9015 + newValue = (0, import_rich_text16.insertObject)(value, {
9016 + type: name14,
9017 + attributes: { "data-latex": selectedText },
9018 + innerHTML
9019 + });
9020 + newValue.start = newValue.end - 1;
9021 + }
9022 + onChange(newValue);
9023 + onFocus();
9024 + }
9025 + return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
9026 + /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
1923 9027 import_block_editor16.RichTextToolbarButton,
1924 9028 {
1925 9029 icon: math_default,
1926 9030 title: title14,
1927 - onClick: () => {
1928 - const newValue = (0, import_rich_text16.insertObject)(value, {
1929 - type: name14,
1930 - attributes: {
1931 - "data-latex": ""
1932 - },
1933 - innerHTML: ""
1934 - });
1935 - newValue.start = newValue.end - 1;
1936 - onChange(newValue);
1937 - onFocus();
1938 - },
9031 + onClick,
1939 9032 isActive: isObjectActive
1940 9033 }
1941 9034 ),
1942 - isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
9035 + isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
1943 9036 InlineUI2,
1944 9037 {
1945 9038 value,
1946 9039 onChange,
@@ -1963,31 +9056,63 @@
1963 9056 edit: Edit4
1964 9057 };
1965 9058
1966 9059 // packages/format-library/build-module/non-breaking-space/index.mjs
1967 - var import_i18n18 = __toESM(require_i18n(), 1);
9060 + var import_i18n22 = __toESM(require_i18n(), 1);
1968 9061 var import_rich_text17 = __toESM(require_rich_text(), 1);
1969 9062 var import_block_editor17 = __toESM(require_block_editor(), 1);
1970 - var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
9063 + var import_components7 = __toESM(require_components(), 1);
9064 + var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1);
1971 9065 var name15 = "core/non-breaking-space";
1972 - var title15 = (0, import_i18n18.__)("Non breaking space");
9066 + var title15 = (0, import_i18n22.__)("Non breaking space");
9067 + function PopoverAnchor({ contentRef }) {
9068 + const popoverAnchor = (0, import_rich_text17.useAnchor)({
9069 + // eslint-disable-next-line react-hooks/refs
9070 + editableContentElement: contentRef.current,
9071 + settings: nonBreakingSpace
9072 + });
9073 + return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components7.Popover, { anchor: popoverAnchor, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { style: { whiteSpace: "nowrap", padding: "4px" }, children: (0, import_i18n22.__)("Non-breaking space") }) });
9074 + }
1973 9075 var nonBreakingSpace = {
1974 9076 name: name15,
1975 9077 title: title15,
1976 - tagName: "nbsp",
1977 - className: null,
1978 - edit({ value, onChange }) {
9078 + tagName: "span",
9079 + className: "non-breaking-space",
9080 + edit({ value, onChange, contentRef }) {
1979 9081 function addNonBreakingSpace() {
1980 9082 onChange((0, import_rich_text17.insert)(value, "\xA0"));
1981 9083 }
1982 - return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
1983 - import_block_editor17.RichTextShortcut,
1984 - {
1985 - type: "primaryShift",
1986 - character: " ",
1987 - onUse: addNonBreakingSpace
1988 - }
1989 - );
9084 + const selectedValue = value.start && value.end ? value.text.slice(value.start, value.end) : null;
9085 + return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
9086 + /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
9087 + import_block_editor17.RichTextShortcut,
9088 + {
9089 + type: "primaryShift",
9090 + character: " ",
9091 + onUse: addNonBreakingSpace
9092 + }
9093 + ),
9094 + selectedValue === "\xA0" && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PopoverAnchor, { contentRef })
9095 + ] });
9096 + },
9097 + __experimentalCreatePrepareEditableTree() {
9098 + return (formats, text) => {
9099 + const NBSP = "\xA0";
9100 + let record = { formats, text };
9101 + let index2 = -1;
9102 + do {
9103 + index2 = text.indexOf(NBSP, index2 + 1);
9104 + if (index2 !== -1) {
9105 + record = (0, import_rich_text17.applyFormat)(
9106 + record,
9107 + { type: name15 },
9108 + index2,
9109 + index2 + 1
9110 + );
9111 + }
9112 + } while (index2 !== -1);
9113 + return record.formats;
9114 + };
1990 9115 }
1991 9116 };
1992 9117
1993 9118 // packages/format-library/build-module/default-formats.mjs
@@ -2001,9 +9126,9 @@
2001 9126 underline,
2002 9127 textColor,
2003 9128 subscript,
2004 9129 superscript,
2005 - keyboard,
9130 + keyboard2,
2006 9131 unknown,
2007 9132 language,
2008 9133 math,
2009 9134 nonBreakingSpace
@@ -2012,6 +9137,21 @@
2012 9137 // packages/format-library/build-module/index.mjs
2013 9138 default_formats_default.forEach(
2014 9139 ({ name: name16, ...settings }) => (0, import_rich_text18.registerFormatType)(name16, settings)
2015 9140 );
9141 +})();
9142 +/*! Bundled license information:
9143 +
9144 +use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
9145 + (**
9146 + * @license React
9147 + * use-sync-external-store-shim.development.js
9148 + *
9149 + * Copyright (c) Meta Platforms, Inc. and affiliates.
9150 + *
9151 + * This source code is licensed under the MIT license found in the
9152 + * LICENSE file in the root directory of this source tree.
9153 + *)
9154 +*/
9155 +(window.wp ||= {}).formatLibrary = wp.formatLibrary;
2016 9156 })();
2017 9157 //# sourceMappingURL=index.js.map