| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 (function() { 2 "use strict"; 3 var wp; 4 (wp ||= {}).formatLibrary = (() => { 5 var __create = Object.create; 6 var __defProp = Object.defineProperty; 7 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 8 var __getOwnPropNames = Object.getOwnPropertyNames; 9 var __getProtoOf = Object.getPrototypeOf; 10 var __hasOwnProp = Object.prototype.hasOwnProperty; 11 var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { 12 get: (a, b) => (typeof require !== "undefined" ? require : a)[b] 13 }) : x)(function(x) { 14 if (typeof require !== "undefined") return require.apply(this, arguments); 15 throw Error('Dynamic require of "' + x + '" is not supported'); 16 }); 17 var __commonJS = (cb, mod) => function __require2() { 18 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 19 }; 20 var __export = (target, all) => { 21 for (var name16 in all) 22 __defProp(target, name16, { get: all[name16], enumerable: true }); 23 }; 24 var __copyProps = (to, from, except, desc) => { 25 if (from && typeof from === "object" || typeof from === "function") { 26 for (let key of __getOwnPropNames(from)) 27 if (!__hasOwnProp.call(to, key) && key !== except) 28 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 29 } 30 return to; 31 }; 32 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 33 // If the importer is in node compatibility mode or this is not an ESM 34 // file that has been converted to a CommonJS file using a Babel- 35 // compatible transform (i.e. "__esModule" has not been set), then set 36 // "default" to the CommonJS "module.exports" for node compatibility. 37 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 38 mod 39 )); 40 41 // package-external:@wordpress/rich-text 42 var require_rich_text = __commonJS({ 43 "package-external:@wordpress/rich-text"(exports, module) { 44 module.exports = window.wp.richText; 45 } 46 }); 47 48 // package-external:@wordpress/i18n 49 var require_i18n = __commonJS({ 50 "package-external:@wordpress/i18n"(exports, module) { 51 module.exports = window.wp.i18n; 52 } 53 }); 54 55 // package-external:@wordpress/block-editor 56 var require_block_editor = __commonJS({ 57 "package-external:@wordpress/block-editor"(exports, module) { 58 module.exports = window.wp.blockEditor; 59 } 60 }); 61 62 // package-external:@wordpress/element 63 var require_element = __commonJS({ 64 "package-external:@wordpress/element"(exports, module) { 65 module.exports = window.wp.element; 66 } 67 }); 68 69 // package-external:@wordpress/primitives 70 var require_primitives = __commonJS({ 71 "package-external:@wordpress/primitives"(exports, module) { 72 module.exports = window.wp.primitives; 73 } 74 }); 75 76 // vendor-external:react/jsx-runtime 77 var require_jsx_runtime = __commonJS({ 78 "vendor-external:react/jsx-runtime"(exports, module) { 79 module.exports = window.ReactJSXRuntime; 80 } 81 }); 82 83 // package-external:@wordpress/components 84 var require_components = __commonJS({ 85 "package-external:@wordpress/components"(exports, module) { 86 module.exports = window.wp.components; 87 } 88 }); 89 90 // vendor-external:react 91 var require_react = __commonJS({ 92 "vendor-external:react"(exports, module) { 93 module.exports = window.React; 94 } 95 }); 96 97 // vendor-external:react-dom 98 var require_react_dom = __commonJS({ 99 "vendor-external:react-dom"(exports, module) { 100 module.exports = window.ReactDOM; 101 } 102 }); 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 === React50.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 useEffect15( 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 React50 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState21 = React50.useState, useEffect15 = React50.useEffect, useLayoutEffect3 = React50.useLayoutEffect, useDebugValue = React50.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 !== React50.useSyncExternalStore ? React50.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 187 // package-external:@wordpress/a11y 188 var require_a11y = __commonJS({ 189 "package-external:@wordpress/a11y"(exports, module) { 190 module.exports = window.wp.a11y; 191 } 192 }); 193 194 // package-external:@wordpress/url 195 var require_url = __commonJS({ 196 "package-external:@wordpress/url"(exports, module) { 197 module.exports = window.wp.url; 198 } 199 }); 200 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; 205 } 206 }); 207 208 // package-external:@wordpress/data 209 var require_data = __commonJS({ 210 "package-external:@wordpress/data"(exports, module) { 211 module.exports = window.wp.data; 212 } 213 }); 214 215 // packages/format-library/build-module/index.mjs 216 var import_rich_text18 = __toESM(require_rich_text(), 1); 217 218 // packages/format-library/build-module/bold/index.mjs 219 var import_i18n = __toESM(require_i18n(), 1); 220 var import_rich_text = __toESM(require_rich_text(), 1); 221 var import_block_editor = __toESM(require_block_editor(), 1); 222 223 // packages/icons/build-module/icon/index.mjs 224 var import_element = __toESM(require_element(), 1); 225 var icon_default = (0, import_element.forwardRef)( 226 ({ icon, size = 24, style, ...props }, ref) => { 227 const intrinsicStyle = icon.props.style; 228 const mergedStyle = intrinsicStyle || style ? { ...intrinsicStyle, ...style } : void 0; 229 return (0, import_element.cloneElement)(icon, { 230 width: size, 231 height: size, 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 } : {}, 237 ref 238 }); 239 } 240 ); 241 242 // packages/icons/build-module/library/button.mjs 243 var import_primitives = __toESM(require_primitives(), 1); 244 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); 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", fill: "currentColor", 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" }) }); 246 247 // packages/icons/build-module/library/chevron-right.mjs 248 var import_primitives2 = __toESM(require_primitives(), 1); 249 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); 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" }) }); 251 252 // packages/icons/build-module/library/code.mjs 253 var import_primitives3 = __toESM(require_primitives(), 1); 254 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); 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" }) }); 256 257 // packages/icons/build-module/library/color.mjs 258 var import_primitives4 = __toESM(require_primitives(), 1); 259 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); 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", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.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" }) }); 261 262 // packages/icons/build-module/library/error.mjs 263 var import_primitives5 = __toESM(require_primitives(), 1); 264 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); 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", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z" }) }); 266 267 // packages/icons/build-module/library/format-bold.mjs 268 var import_primitives6 = __toESM(require_primitives(), 1); 269 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); 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", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.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" }) }); 271 272 // packages/icons/build-module/library/format-italic.mjs 273 var import_primitives7 = __toESM(require_primitives(), 1); 274 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); 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", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M12.5 5L10 19h1.9l2.5-14z" }) }); 276 277 // packages/icons/build-module/library/format-strikethrough.mjs 278 var import_primitives8 = __toESM(require_primitives(), 1); 279 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); 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", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.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" }) }); 281 282 // packages/icons/build-module/library/help.mjs 283 var import_primitives9 = __toESM(require_primitives(), 1); 284 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); 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 ] }); 289 290 // packages/icons/build-module/library/inline-image.mjs 291 var import_primitives10 = __toESM(require_primitives(), 1); 292 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); 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", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.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" }) }); 294 295 // packages/icons/build-module/library/language.mjs 296 var import_primitives11 = __toESM(require_primitives(), 1); 297 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); 298 var language_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.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" }) }); 299 300 // packages/icons/build-module/library/link.mjs 301 var import_primitives12 = __toESM(require_primitives(), 1); 302 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); 303 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" }) }); 304 305 // packages/icons/build-module/library/math.mjs 306 var import_primitives13 = __toESM(require_primitives(), 1); 307 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); 308 var math_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.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" }) }); 309 310 // packages/icons/build-module/library/published.mjs 311 var import_primitives14 = __toESM(require_primitives(), 1); 312 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); 313 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: [ 314 /* @__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" }), 315 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M9 12L11 14L15 10", vectorEffect: "non-scaling-stroke" }) 316 ] }); 317 318 // packages/icons/build-module/library/subscript.mjs 319 var import_primitives15 = __toESM(require_primitives(), 1); 320 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); 321 var subscript_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.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" }) }); 322 323 // packages/icons/build-module/library/superscript.mjs 324 var import_primitives16 = __toESM(require_primitives(), 1); 325 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); 326 var superscript_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.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" }) }); 327 328 // packages/icons/build-module/library/text-color.mjs 329 var import_primitives17 = __toESM(require_primitives(), 1); 330 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); 331 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", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives17.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" }) }); 332 333 // packages/format-library/build-module/bold/index.mjs 334 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); 335 var name = "core/bold"; 336 var title = (0, import_i18n.__)("Bold"); 337 var bold = { 338 name, 339 title, 340 tagName: "strong", 341 className: null, 342 edit({ 343 isActive, 344 value, 345 onChange, 346 onFocus, 347 isVisible = true 348 }) { 349 function onToggle() { 350 onChange((0, import_rich_text.toggleFormat)(value, { type: name, title })); 351 } 352 function onClick() { 353 onChange((0, import_rich_text.toggleFormat)(value, { type: name, title })); 354 onFocus(); 355 } 356 return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [ 357 /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( 358 import_block_editor.RichTextShortcut, 359 { 360 type: "primary", 361 character: "b", 362 onUse: onToggle 363 } 364 ), 365 isVisible && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( 366 import_block_editor.RichTextToolbarButton, 367 { 368 name: "bold", 369 icon: format_bold_default, 370 title, 371 onClick, 372 isActive, 373 shortcutType: "primary", 374 shortcutCharacter: "b" 375 } 376 ), 377 /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( 378 import_block_editor.__unstableRichTextInputEvent, 379 { 380 inputType: "formatBold", 381 onInput: onToggle 382 } 383 ) 384 ] }); 385 } 386 }; 387 388 // packages/format-library/build-module/code/index.mjs 389 var import_i18n2 = __toESM(require_i18n(), 1); 390 var import_rich_text2 = __toESM(require_rich_text(), 1); 391 var import_block_editor2 = __toESM(require_block_editor(), 1); 392 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); 393 var name2 = "core/code"; 394 var title2 = (0, import_i18n2.__)("Inline code"); 395 var code = { 396 name: name2, 397 title: title2, 398 tagName: "code", 399 className: null, 400 __unstableInputRule(value) { 401 const BACKTICK = "`"; 402 const { start, text } = value; 403 const characterBefore = text[start - 1]; 404 if (characterBefore !== BACKTICK) { 405 return value; 406 } 407 if (start - 2 < 0) { 408 return value; 409 } 410 const indexBefore = text.lastIndexOf(BACKTICK, start - 2); 411 if (indexBefore === -1) { 412 return value; 413 } 414 const startIndex = indexBefore; 415 const endIndex = start - 2; 416 if (startIndex === endIndex) { 417 return value; 418 } 419 value = (0, import_rich_text2.remove)(value, startIndex, startIndex + 1); 420 value = (0, import_rich_text2.remove)(value, endIndex, endIndex + 1); 421 value = (0, import_rich_text2.applyFormat)(value, { type: name2 }, startIndex, endIndex); 422 return value; 423 }, 424 edit({ 425 value, 426 onChange, 427 onFocus, 428 isActive 429 }) { 430 function onClick() { 431 onChange((0, import_rich_text2.toggleFormat)(value, { type: name2, title: title2 })); 432 onFocus(); 433 } 434 return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [ 435 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( 436 import_block_editor2.RichTextShortcut, 437 { 438 type: "access", 439 character: "x", 440 onUse: onClick 441 } 442 ), 443 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( 444 import_block_editor2.RichTextToolbarButton, 445 { 446 icon: code_default, 447 title: title2, 448 onClick, 449 isActive, 450 role: "menuitemcheckbox" 451 } 452 ) 453 ] }); 454 } 455 }; 456 457 // packages/format-library/build-module/image/index.mjs 458 var import_components = __toESM(require_components(), 1); 459 460 // node_modules/clsx/dist/clsx.mjs 461 function r(e) { 462 var t, f, n = ""; 463 if ("string" == typeof e || "number" == typeof e) n += e; 464 else if ("object" == typeof e) if (Array.isArray(e)) { 465 var o = e.length; 466 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); 467 } else for (f in e) e[f] && (n && (n += " "), n += f); 468 return n; 469 } 470 function clsx() { 471 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); 472 return n; 473 } 474 var clsx_default = clsx; 475 476 // node_modules/@base-ui/utils/useControlled.mjs 477 var React = __toESM(require_react(), 1); 478 479 // node_modules/@base-ui/utils/error.mjs 480 var set; 481 if (true) { 482 set = /* @__PURE__ */ new Set(); 483 } 484 function error(...messages) { 485 if (true) { 486 const messageKey = messages.join(" "); 487 if (!set.has(messageKey)) { 488 set.add(messageKey); 489 console.error(`Base UI: $messageKey}`); 490 } 491 } 492 } 493 494 // node_modules/@base-ui/utils/useControlled.mjs 495 function useControlled({ 496 controlled, 497 default: defaultProp, 498 name: name16, 499 state = "value" 500 }) { 501 const { 502 current: isControlled 503 } = React.useRef(controlled !== void 0); 504 const [valueState, setValue] = React.useState(defaultProp); 505 const value = isControlled ? controlled : valueState; 506 if (true) { 507 React.useEffect(() => { 508 if (isControlled !== (controlled !== void 0)) { 509 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")); 510 } 511 }, [state, name16, controlled]); 512 const { 513 current: defaultValue 514 } = React.useRef(defaultProp); 515 React.useEffect(() => { 516 if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) { 517 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")); 518 } 519 }, [defaultProp]); 520 } 521 const setValueIfUncontrolled = React.useCallback((newValue) => { 522 if (!isControlled) { 523 setValue(newValue); 524 } 525 }, []); 526 return [value, setValueIfUncontrolled]; 527 } 528 function serializeToDevModeString(input) { 529 let nextId = 0; 530 const seen = /* @__PURE__ */ new WeakMap(); 531 try { 532 const result = JSON.stringify(input, function replacer(key, value) { 533 if (key === "_owner" && this != null && typeof this === "object" && "$$typeof" in this) { 534 return void 0; 535 } 536 if (typeof value === "bigint") { 537 return `__bigint__:$value}`; 538 } 539 if (value !== null && typeof value === "object") { 540 const id = seen.get(value); 541 if (id !== void 0) { 542 return `__object__:$id}`; 543 } 544 seen.set(value, nextId); 545 nextId += 1; 546 } 547 return value; 548 }); 549 return result ?? `__top__:$typeof input}`; 550 } catch { 551 return "__unserializable__"; 552 } 553 } 554 555 // node_modules/@base-ui/utils/safeReact.mjs 556 var React2 = __toESM(require_react(), 1); 557 var SafeReact = { 558 ...React2 559 }; 560 561 // node_modules/@base-ui/utils/useRefWithInit.mjs 562 var React3 = __toESM(require_react(), 1); 563 var UNINITIALIZED = {}; 564 function useRefWithInit(init, initArg) { 565 const ref = React3.useRef(UNINITIALIZED); 566 if (ref.current === UNINITIALIZED) { 567 ref.current = init(initArg); 568 } 569 return ref; 570 } 571 572 // node_modules/@base-ui/utils/useStableCallback.mjs 573 var useInsertionEffect = SafeReact.useInsertionEffect; 574 var useSafeInsertionEffect = ( 575 // React 17 doesn't have useInsertionEffect. 576 useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. 577 useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn() 578 ); 579 function useStableCallback(callback) { 580 const stable = useRefWithInit(createStableCallback).current; 581 stable.next = callback; 582 useSafeInsertionEffect(stable.effect); 583 return stable.trampoline; 584 } 585 function createStableCallback() { 586 const stable = { 587 next: void 0, 588 callback: assertNotCalled, 589 trampoline: (...args) => stable.callback?.(...args), 590 effect: () => { 591 stable.callback = stable.next; 592 } 593 }; 594 return stable; 595 } 596 function assertNotCalled() { 597 if (true) { 598 throw ( 599 /* minify-error-disabled */ 600 new Error("Base UI: Cannot call an event handler while rendering.") 601 ); 602 } 603 } 604 605 // node_modules/@base-ui/utils/warn.mjs 606 var set2; 607 if (true) { 608 set2 = /* @__PURE__ */ new Set(); 609 } 610 function warn(...messages) { 611 if (true) { 612 const messageKey = messages.join(" "); 613 if (!set2.has(messageKey)) { 614 set2.add(messageKey); 615 console.warn(`Base UI: $messageKey}`); 616 } 617 } 618 } 619 620 // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs 621 var React6 = __toESM(require_react(), 1); 622 623 // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs 624 var React4 = __toESM(require_react(), 1); 625 var noop = () => { 626 }; 627 var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop; 628 629 // node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs 630 var React5 = __toESM(require_react(), 1); 631 var CompositeListContext = /* @__PURE__ */ React5.createContext({ 632 register: () => { 633 }, 634 unregister: () => { 635 }, 636 subscribeMapChange: () => () => { 637 }, 638 nextIndexRef: { 639 current: 0 640 } 641 }); 642 if (true) CompositeListContext.displayName = "CompositeListContext"; 643 function useCompositeListContext() { 644 return React5.useContext(CompositeListContext); 645 } 646 647 // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs 648 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); 649 function CompositeList(props) { 650 const { 651 children, 652 elementsRef, 653 labelsRef, 654 onMapChange: onMapChangeProp 655 } = props; 656 const onMapChange = useStableCallback(onMapChangeProp); 657 const [, setMapTick] = React6.useState(false); 658 const listeners = useRefWithInit(createListeners).current; 659 const map = useRefWithInit(createMap).current; 660 const nextIndexRef = React6.useRef(0); 661 const isDirtyRef = React6.useRef(true); 662 const itemsRef = React6.useRef([]); 663 const mutationObserverRef = React6.useRef(null); 664 const scheduleMapUpdate = useStableCallback(() => { 665 if (isDirtyRef.current) { 666 return; 667 } 668 isDirtyRef.current = true; 669 setMapTick((tick) => !tick); 670 }); 671 const register = useStableCallback((node, registration) => { 672 map.set(node, registration); 673 scheduleMapUpdate(); 674 }); 675 const unregister = useStableCallback((node) => { 676 map.delete(node); 677 scheduleMapUpdate(); 678 }); 679 const syncRefs = useStableCallback((items) => { 680 const nextMap = /* @__PURE__ */ new Map(); 681 elementsRef.current.length = 0; 682 if (labelsRef) { 683 labelsRef.current.length = 0; 684 } 685 items.forEach((item) => { 686 nextMap.set(item.element, { 687 ...item.registration.metadata ?? {}, 688 index: item.index 689 }); 690 elementsRef.current[item.index] = item.element; 691 if (labelsRef) { 692 labelsRef.current[item.index] = item.registration.label !== void 0 ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent; 693 } 694 }); 695 nextIndexRef.current = elementsRef.current.length; 696 return nextMap; 697 }); 698 function observe(sortedNodes) { 699 mutationObserverRef.current?.disconnect(); 700 mutationObserverRef.current = null; 701 if (typeof MutationObserver !== "function" || sortedNodes.length < 2) { 702 return; 703 } 704 const mutationObserver = new MutationObserver((entries) => { 705 if (!hasMovedNode(entries)) { 706 return; 707 } 708 let previousConnectedNode = null; 709 for (const node of sortedNodes) { 710 if (!node.isConnected) { 711 continue; 712 } 713 if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) { 714 mutationObserver.disconnect(); 715 scheduleMapUpdate(); 716 return; 717 } 718 previousConnectedNode = node; 719 } 720 }); 721 mutationObserverRef.current = mutationObserver; 722 const roots = /* @__PURE__ */ new Set(); 723 for (let i = 1; i < sortedNodes.length; i += 1) { 724 const root = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]); 725 if (root) { 726 roots.add(root); 727 } 728 } 729 roots.forEach((root) => mutationObserver.observe(root, { 730 childList: true 731 })); 732 } 733 const flush = useStableCallback(() => { 734 const [items, automaticNodes] = getCompositeListSnapshot(map); 735 const nextMap = syncRefs(items); 736 observe(automaticNodes); 737 itemsRef.current = items; 738 isDirtyRef.current = false; 739 listeners.forEach((listener) => listener(nextMap)); 740 onMapChange(nextMap); 741 }); 742 useIsoLayoutEffect(() => { 743 if (!isDirtyRef.current) { 744 syncRefs(itemsRef.current); 745 } 746 return () => { 747 elementsRef.current = []; 748 if (labelsRef) { 749 labelsRef.current = []; 750 } 751 }; 752 }, [elementsRef, labelsRef, syncRefs]); 753 useIsoLayoutEffect(() => { 754 if (isDirtyRef.current) { 755 flush(); 756 } 757 }); 758 useIsoLayoutEffect(() => { 759 return () => { 760 mutationObserverRef.current?.disconnect(); 761 isDirtyRef.current = true; 762 }; 763 }, []); 764 const subscribeMapChange = useStableCallback((fn) => { 765 listeners.add(fn); 766 return () => { 767 listeners.delete(fn); 768 }; 769 }); 770 const contextValue = React6.useMemo(() => ({ 771 register, 772 unregister, 773 subscribeMapChange, 774 nextIndexRef 775 }), [register, unregister, subscribeMapChange, nextIndexRef]); 776 return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CompositeListContext.Provider, { 777 value: contextValue, 778 children 779 }); 780 } 781 function createMap() { 782 return /* @__PURE__ */ new Map(); 783 } 784 function createListeners() { 785 return /* @__PURE__ */ new Set(); 786 } 787 function getCompositeListSnapshot(map) { 788 const reservedIndices = /* @__PURE__ */ new Set(); 789 const items = []; 790 const automaticItems = []; 791 map.forEach((registration, node) => { 792 if (!node.isConnected) { 793 return; 794 } 795 const index = registration.index; 796 const item = { 797 index: index ?? -1, 798 element: node, 799 registration 800 }; 801 if (index === null) { 802 automaticItems.push(item); 803 } else if (index >= 0) { 804 reservedIndices.add(index); 805 items.push(item); 806 } 807 }); 808 let nextAutomaticIndex = 0; 809 automaticItems.sort((a, b) => sortByDocumentPosition(a.element, b.element)); 810 automaticItems.forEach((item) => { 811 while (reservedIndices.has(nextAutomaticIndex)) { 812 nextAutomaticIndex += 1; 813 } 814 item.index = nextAutomaticIndex; 815 items.push(item); 816 nextAutomaticIndex += 1; 817 }); 818 if (reservedIndices.size > 0) { 819 items.sort((a, b) => a.index - b.index); 820 } 821 return [items, automaticItems.map((item) => item.element)]; 822 } 823 function getCommonAncestor(firstNode, lastNode) { 824 let ancestor = firstNode.parentElement; 825 while (ancestor && !ancestor.contains(lastNode)) { 826 ancestor = ancestor.parentElement; 827 } 828 return ancestor; 829 } 830 function hasMovedNode(entries) { 831 for (const entry of entries) { 832 for (let i = 0; i < entry.removedNodes.length; i += 1) { 833 if (entry.removedNodes[i].isConnected) { 834 return true; 835 } 836 } 837 } 838 return false; 839 } 840 function sortByDocumentPosition(a, b) { 841 return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1; 842 } 843 844 // node_modules/@base-ui/react/internals/useRenderElement.mjs 845 var React9 = __toESM(require_react(), 1); 846 847 // node_modules/@base-ui/utils/useMergedRefs.mjs 848 function useMergedRefs(a, b, c, d) { 849 const forkRef = useRefWithInit(createForkRef).current; 850 if (didChange(forkRef, a, b, c, d)) { 851 update(forkRef, [a, b, c, d]); 852 } 853 return forkRef.callback; 854 } 855 function useMergedRefsN(refs) { 856 const forkRef = useRefWithInit(createForkRef).current; 857 if (didChangeN(forkRef, refs)) { 858 update(forkRef, refs); 859 } 860 return forkRef.callback; 861 } 862 function createForkRef() { 863 return { 864 callback: null, 865 cleanup: null, 866 refs: [] 867 }; 868 } 869 function didChange(forkRef, a, b, c, d) { 870 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d; 871 } 872 function didChangeN(forkRef, newRefs) { 873 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]); 874 } 875 function update(forkRef, refs) { 876 forkRef.refs = refs; 877 if (refs.every((ref) => ref == null)) { 878 forkRef.callback = null; 879 return; 880 } 881 forkRef.callback = (instance) => { 882 if (forkRef.cleanup) { 883 forkRef.cleanup(); 884 forkRef.cleanup = null; 885 } 886 if (instance != null) { 887 const cleanupCallbacks = Array(refs.length).fill(null); 888 for (let i = 0; i < refs.length; i += 1) { 889 const ref = refs[i]; 890 if (ref == null) { 891 continue; 892 } 893 switch (typeof ref) { 894 case "function": { 895 const refCleanup = ref(instance); 896 if (typeof refCleanup === "function") { 897 cleanupCallbacks[i] = refCleanup; 898 } 899 break; 900 } 901 case "object": { 902 ref.current = instance; 903 break; 904 } 905 default: 906 } 907 } 908 forkRef.cleanup = () => { 909 for (let i = 0; i < refs.length; i += 1) { 910 const ref = refs[i]; 911 if (ref == null) { 912 continue; 913 } 914 switch (typeof ref) { 915 case "function": { 916 const cleanupCallback = cleanupCallbacks[i]; 917 if (typeof cleanupCallback === "function") { 918 cleanupCallback(); 919 } else { 920 void ref(null); 921 } 922 break; 923 } 924 case "object": { 925 ref.current = null; 926 break; 927 } 928 default: 929 } 930 } 931 }; 932 } 933 }; 934 } 935 936 // node_modules/@base-ui/utils/getReactElementRef.mjs 937 var React8 = __toESM(require_react(), 1); 938 939 // node_modules/@base-ui/utils/reactVersion.mjs 940 var React7 = __toESM(require_react(), 1); 941 var majorVersion = parseInt(React7.version, 10); 942 function isReactVersionAtLeast(reactVersionToCheck) { 943 return majorVersion >= reactVersionToCheck; 944 } 945 946 // node_modules/@base-ui/utils/getReactElementRef.mjs 947 function getReactElementRef(element) { 948 if (!/* @__PURE__ */ React8.isValidElement(element)) { 949 return null; 950 } 951 const reactElement = element; 952 const propsWithRef = reactElement.props; 953 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; 954 } 955 956 // node_modules/@base-ui/utils/mergeObjects.mjs 957 function mergeObjects(a, b) { 958 if (a && !b) { 959 return a; 960 } 961 if (!a && b) { 962 return b; 963 } 964 if (a || b) { 965 return { 966 ...a, 967 ...b 968 }; 969 } 970 return void 0; 971 } 972 973 // node_modules/@base-ui/utils/empty.mjs 974 function NOOP() { 975 } 976 var EMPTY_ARRAY = Object.freeze([]); 977 var EMPTY_OBJECT = Object.freeze({}); 978 979 // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs 980 function getStateAttributesProps(state, customMapping) { 981 const props = {}; 982 for (const key in state) { 983 const value = state[key]; 984 if (customMapping?.hasOwnProperty(key)) { 985 const customProps = customMapping[key](value); 986 if (customProps != null) { 987 Object.assign(props, customProps); 988 } 989 continue; 990 } 991 if (value === true) { 992 props[`data-$key.toLowerCase()}`] = ""; 993 } else if (value) { 994 props[`data-$key.toLowerCase()}`] = value.toString(); 995 } 996 } 997 return props; 998 } 999 1000 // node_modules/@base-ui/react/utils/resolveClassName.mjs 1001 function resolveClassName(className, state) { 1002 return typeof className === "function" ? className(state) : className; 1003 } 1004 1005 // node_modules/@base-ui/react/utils/resolveStyle.mjs 1006 function resolveStyle(style, state) { 1007 return typeof style === "function" ? style(state) : style; 1008 } 1009 1010 // node_modules/@base-ui/react/merge-props/mergeProps.mjs 1011 var EMPTY_PROPS = {}; 1012 function mergeProps(a, b, c, d, e) { 1013 if (!c && !d && !e && !a) { 1014 return createInitialMergedProps(b); 1015 } 1016 let merged = createInitialMergedProps(a); 1017 if (b) { 1018 merged = mergeInto(merged, b); 1019 } 1020 if (c) { 1021 merged = mergeInto(merged, c); 1022 } 1023 if (d) { 1024 merged = mergeInto(merged, d); 1025 } 1026 if (e) { 1027 merged = mergeInto(merged, e); 1028 } 1029 return merged; 1030 } 1031 function mergePropsN(props) { 1032 if (props.length === 0) { 1033 return EMPTY_PROPS; 1034 } 1035 if (props.length === 1) { 1036 return createInitialMergedProps(props[0]); 1037 } 1038 let merged = createInitialMergedProps(props[0]); 1039 for (let i = 1; i < props.length; i += 1) { 1040 merged = mergeInto(merged, props[i]); 1041 } 1042 return merged; 1043 } 1044 function createInitialMergedProps(inputProps) { 1045 if (isPropsGetter(inputProps)) { 1046 return { 1047 ...resolvePropsGetter(inputProps, EMPTY_PROPS) 1048 }; 1049 } 1050 return copyInitialProps(inputProps); 1051 } 1052 function mergeInto(merged, inputProps) { 1053 if (isPropsGetter(inputProps)) { 1054 return resolvePropsGetter(inputProps, merged); 1055 } 1056 return mutablyMergeInto(merged, inputProps); 1057 } 1058 function copyInitialProps(inputProps) { 1059 const copiedProps = { 1060 ...inputProps 1061 }; 1062 for (const propName in copiedProps) { 1063 const propValue = copiedProps[propName]; 1064 if (isEventHandler(propName, propValue)) { 1065 copiedProps[propName] = wrapEventHandler(propValue); 1066 } 1067 } 1068 return copiedProps; 1069 } 1070 function mutablyMergeInto(mergedProps, externalProps) { 1071 if (!externalProps) { 1072 return mergedProps; 1073 } 1074 for (const propName in externalProps) { 1075 const externalPropValue = externalProps[propName]; 1076 switch (propName) { 1077 case "style": { 1078 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); 1079 break; 1080 } 1081 case "className": { 1082 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); 1083 break; 1084 } 1085 default: { 1086 if (isEventHandler(propName, externalPropValue)) { 1087 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); 1088 } else { 1089 mergedProps[propName] = externalPropValue; 1090 } 1091 } 1092 } 1093 } 1094 return mergedProps; 1095 } 1096 function isEventHandler(key, value) { 1097 const code0 = key.charCodeAt(0); 1098 const code1 = key.charCodeAt(1); 1099 const code2 = key.charCodeAt(2); 1100 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); 1101 } 1102 function isPropsGetter(inputProps) { 1103 return typeof inputProps === "function"; 1104 } 1105 function resolvePropsGetter(inputProps, previousProps) { 1106 if (isPropsGetter(inputProps)) { 1107 return inputProps(previousProps); 1108 } 1109 return inputProps ?? EMPTY_PROPS; 1110 } 1111 function mergeEventHandlers(ourHandler, theirHandler) { 1112 if (!theirHandler) { 1113 return ourHandler; 1114 } 1115 if (!ourHandler) { 1116 return wrapEventHandler(theirHandler); 1117 } 1118 return (...args) => { 1119 const event = args[0]; 1120 if (isSyntheticEvent(event)) { 1121 const baseUIEvent = event; 1122 makeEventPreventable(baseUIEvent); 1123 const result2 = theirHandler(...args); 1124 if (!baseUIEvent.baseUIHandlerPrevented) { 1125 ourHandler?.(...args); 1126 } 1127 return result2; 1128 } 1129 const result = theirHandler(...args); 1130 ourHandler?.(...args); 1131 return result; 1132 }; 1133 } 1134 function wrapEventHandler(handler) { 1135 if (!handler) { 1136 return handler; 1137 } 1138 return (...args) => { 1139 const event = args[0]; 1140 if (isSyntheticEvent(event)) { 1141 makeEventPreventable(event); 1142 } 1143 return handler(...args); 1144 }; 1145 } 1146 function makeEventPreventable(event) { 1147 event.preventBaseUIHandler = () => { 1148 event.baseUIHandlerPrevented = true; 1149 }; 1150 return event; 1151 } 1152 function mergeClassNames(ourClassName, theirClassName) { 1153 if (theirClassName) { 1154 if (ourClassName) { 1155 return theirClassName + " " + ourClassName; 1156 } 1157 return theirClassName; 1158 } 1159 return ourClassName; 1160 } 1161 function isSyntheticEvent(event) { 1162 return event != null && typeof event === "object" && "nativeEvent" in event; 1163 } 1164 1165 // node_modules/@base-ui/react/internals/useRenderElement.mjs 1166 var import_react = __toESM(require_react(), 1); 1167 function useRenderElement(element, componentProps, params = {}) { 1168 const renderProp = componentProps.render; 1169 const outProps = useRenderElementProps(componentProps, params); 1170 if (params.enabled === false) { 1171 return null; 1172 } 1173 const state = params.state ?? EMPTY_OBJECT; 1174 return evaluateRenderProp(element, renderProp, outProps, state); 1175 } 1176 function useRenderElementProps(componentProps, params = {}) { 1177 const { 1178 className: classNameProp, 1179 style: styleProp, 1180 render: renderProp 1181 } = componentProps; 1182 const { 1183 state = EMPTY_OBJECT, 1184 ref, 1185 props, 1186 stateAttributesMapping: stateAttributesMapping4, 1187 enabled = true 1188 } = params; 1189 const className = enabled ? resolveClassName(classNameProp, state) : void 0; 1190 const style = enabled ? resolveStyle(styleProp, state) : void 0; 1191 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping4) : EMPTY_OBJECT; 1192 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; 1193 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; 1194 if (typeof document !== "undefined") { 1195 if (!enabled) { 1196 void useMergedRefs(null, null); 1197 } else if (Array.isArray(ref)) { 1198 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); 1199 } else { 1200 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); 1201 } 1202 } 1203 if (!enabled) { 1204 return EMPTY_OBJECT; 1205 } 1206 if (className !== void 0) { 1207 outProps.className = mergeClassNames(outProps.className, className); 1208 } 1209 if (style !== void 0) { 1210 outProps.style = mergeObjects(outProps.style, style); 1211 } 1212 return outProps; 1213 } 1214 function resolveRenderFunctionProps(props) { 1215 if (Array.isArray(props)) { 1216 return mergePropsN(props); 1217 } 1218 return mergeProps(void 0, props); 1219 } 1220 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); 1221 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; 1222 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; 1223 function evaluateRenderProp(element, render, props, state) { 1224 if (render) { 1225 if (typeof render === "function") { 1226 if (true) { 1227 warnIfRenderPropLooksLikeComponent(render); 1228 } 1229 return render(props, state); 1230 } 1231 const mergedProps = mergeProps(props, render.props); 1232 mergedProps.ref = props.ref; 1233 let newElement = render; 1234 if (newElement?.$$typeof === REACT_LAZY_TYPE) { 1235 const children = React9.Children.toArray(render); 1236 newElement = children[0]; 1237 } 1238 if (true) { 1239 if (!/* @__PURE__ */ React9.isValidElement(newElement)) { 1240 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")); 1241 } 1242 } 1243 return /* @__PURE__ */ React9.cloneElement(newElement, mergedProps); 1244 } 1245 if (element) { 1246 if (typeof element === "string") { 1247 return renderTag(element, props); 1248 } 1249 } 1250 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); 1251 } 1252 function warnIfRenderPropLooksLikeComponent(renderFn) { 1253 const functionName = renderFn.name; 1254 if (functionName.length === 0) { 1255 return; 1256 } 1257 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { 1258 return; 1259 } 1260 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { 1261 return; 1262 } 1263 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"); 1264 } 1265 function renderTag(Tag, props) { 1266 if (Tag === "button") { 1267 return /* @__PURE__ */ (0, import_react.createElement)("button", { 1268 type: "button", 1269 ...props, 1270 key: props.key 1271 }); 1272 } 1273 if (Tag === "img") { 1274 return /* @__PURE__ */ (0, import_react.createElement)("img", { 1275 alt: "", 1276 ...props, 1277 key: props.key 1278 }); 1279 } 1280 return /* @__PURE__ */ React9.createElement(Tag, props); 1281 } 1282 1283 // node_modules/@base-ui/utils/useId.mjs 1284 var React10 = __toESM(require_react(), 1); 1285 var globalId = 0; 1286 function useGlobalId(idOverride, prefix = "mui") { 1287 const [defaultId, setDefaultId] = React10.useState(idOverride); 1288 const id = idOverride || defaultId; 1289 React10.useEffect(() => { 1290 if (defaultId == null) { 1291 globalId += 1; 1292 setDefaultId(`$prefix}-$globalId}`); 1293 } 1294 }, [defaultId, prefix]); 1295 return id; 1296 } 1297 var maybeReactUseId = SafeReact.useId; 1298 function useId(idOverride, prefix) { 1299 if (maybeReactUseId !== void 0) { 1300 const reactId = maybeReactUseId(); 1301 return idOverride ?? (prefix ? `$prefix}-$reactId}` : reactId); 1302 } 1303 return useGlobalId(idOverride, prefix); 1304 } 1305 1306 // node_modules/@base-ui/react/internals/useBaseUiId.mjs 1307 function useBaseUiId(idOverride) { 1308 return useId(idOverride, "base-ui"); 1309 } 1310 1311 // node_modules/@base-ui/react/internals/reason-parts.mjs 1312 var reason_parts_exports = {}; 1313 __export(reason_parts_exports, { 1314 cancelOpen: () => cancelOpen, 1315 chipRemovePress: () => chipRemovePress, 1316 clearPress: () => clearPress, 1317 closePress: () => closePress, 1318 closeWatcher: () => closeWatcher, 1319 decrementPress: () => decrementPress, 1320 disabled: () => disabled, 1321 drag: () => drag, 1322 escapeKey: () => escapeKey, 1323 focusOut: () => focusOut, 1324 imperativeAction: () => imperativeAction, 1325 incrementPress: () => incrementPress, 1326 initial: () => initial, 1327 inputBlur: () => inputBlur, 1328 inputChange: () => inputChange, 1329 inputClear: () => inputClear, 1330 inputPaste: () => inputPaste, 1331 inputPress: () => inputPress, 1332 itemPress: () => itemPress, 1333 keyboard: () => keyboard, 1334 linkPress: () => linkPress, 1335 listNavigation: () => listNavigation, 1336 missing: () => missing, 1337 none: () => none, 1338 outsidePress: () => outsidePress, 1339 pointer: () => pointer, 1340 scrub: () => scrub, 1341 siblingOpen: () => siblingOpen, 1342 swipe: () => swipe, 1343 trackPress: () => trackPress, 1344 triggerFocus: () => triggerFocus, 1345 triggerHover: () => triggerHover, 1346 triggerPress: () => triggerPress, 1347 wheel: () => wheel, 1348 windowResize: () => windowResize 1349 }); 1350 var none = "none"; 1351 var triggerPress = "trigger-press"; 1352 var triggerHover = "trigger-hover"; 1353 var triggerFocus = "trigger-focus"; 1354 var outsidePress = "outside-press"; 1355 var itemPress = "item-press"; 1356 var closePress = "close-press"; 1357 var linkPress = "link-press"; 1358 var clearPress = "clear-press"; 1359 var chipRemovePress = "chip-remove-press"; 1360 var trackPress = "track-press"; 1361 var incrementPress = "increment-press"; 1362 var decrementPress = "decrement-press"; 1363 var inputChange = "input-change"; 1364 var inputClear = "input-clear"; 1365 var inputBlur = "input-blur"; 1366 var inputPaste = "input-paste"; 1367 var inputPress = "input-press"; 1368 var focusOut = "focus-out"; 1369 var escapeKey = "escape-key"; 1370 var closeWatcher = "close-watcher"; 1371 var listNavigation = "list-navigation"; 1372 var keyboard = "keyboard"; 1373 var pointer = "pointer"; 1374 var drag = "drag"; 1375 var wheel = "wheel"; 1376 var scrub = "scrub"; 1377 var cancelOpen = "cancel-open"; 1378 var siblingOpen = "sibling-open"; 1379 var disabled = "disabled"; 1380 var missing = "missing"; 1381 var initial = "initial"; 1382 var imperativeAction = "imperative-action"; 1383 var swipe = "swipe"; 1384 var windowResize = "window-resize"; 1385 1386 // node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs 1387 function createChangeEventDetails(reason, event, trigger, customProperties) { 1388 let canceled = false; 1389 let allowPropagation = false; 1390 const custom = customProperties ?? EMPTY_OBJECT; 1391 const details = { 1392 reason, 1393 event: event ?? new Event("base-ui"), 1394 cancel() { 1395 canceled = true; 1396 }, 1397 allowPropagation() { 1398 allowPropagation = true; 1399 }, 1400 get isCanceled() { 1401 return canceled; 1402 }, 1403 get isPropagationAllowed() { 1404 return allowPropagation; 1405 }, 1406 trigger, 1407 ...custom 1408 }; 1409 return details; 1410 } 1411 1412 // node_modules/@base-ui/react/internals/useTransitionStatus.mjs 1413 var React12 = __toESM(require_react(), 1); 1414 1415 // node_modules/@base-ui/utils/useOnMount.mjs 1416 var React11 = __toESM(require_react(), 1); 1417 function useOnMount(fn) { 1418 React11.useEffect(fn, EMPTY_ARRAY); 1419 } 1420 1421 // node_modules/@base-ui/utils/useAnimationFrame.mjs 1422 var EMPTY = null; 1423 var LAST_RAF = globalThis.requestAnimationFrame; 1424 var Scheduler = class { 1425 /* This implementation uses an array as a backing data-structure for frame callbacks. 1426 * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it 1427 * never calls the native `cancelAnimationFrame` if there are no frames left. This can 1428 * be much more efficient if there is a call pattern that alterns as 1429 * "request-cancel-request-cancel-…". 1430 * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation 1431 * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */ 1432 callbacks = []; 1433 callbacksCount = 0; 1434 nextId = 1; 1435 startId = 1; 1436 isScheduled = false; 1437 tick = (timestamp) => { 1438 this.isScheduled = false; 1439 const currentCallbacks = this.callbacks; 1440 const currentCallbacksCount = this.callbacksCount; 1441 this.callbacks = []; 1442 this.callbacksCount = 0; 1443 this.startId = this.nextId; 1444 if (currentCallbacksCount > 0) { 1445 for (let i = 0; i < currentCallbacks.length; i += 1) { 1446 currentCallbacks[i]?.(timestamp); 1447 } 1448 } 1449 }; 1450 request(fn) { 1451 const id = this.nextId; 1452 this.nextId += 1; 1453 this.callbacks.push(fn); 1454 this.callbacksCount += 1; 1455 const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true); 1456 if (!this.isScheduled || didRAFChange) { 1457 requestAnimationFrame(this.tick); 1458 this.isScheduled = true; 1459 } 1460 return id; 1461 } 1462 cancel(id) { 1463 const index = id - this.startId; 1464 if (index < 0 || index >= this.callbacks.length) { 1465 return; 1466 } 1467 this.callbacks[index] = null; 1468 this.callbacksCount -= 1; 1469 } 1470 }; 1471 var scheduler = new Scheduler(); 1472 var AnimationFrame = class _AnimationFrame { 1473 static create() { 1474 return new _AnimationFrame(); 1475 } 1476 static request(fn) { 1477 return scheduler.request(fn); 1478 } 1479 static cancel(id) { 1480 return scheduler.cancel(id); 1481 } 1482 currentId = EMPTY; 1483 /** 1484 * Executes `fn` after `delay`, clearing any previously scheduled call. 1485 */ 1486 request(fn) { 1487 this.cancel(); 1488 this.currentId = scheduler.request(() => { 1489 this.currentId = EMPTY; 1490 fn(); 1491 }); 1492 } 1493 cancel = () => { 1494 if (this.currentId !== EMPTY) { 1495 scheduler.cancel(this.currentId); 1496 this.currentId = EMPTY; 1497 } 1498 }; 1499 disposeEffect = () => { 1500 return this.cancel; 1501 }; 1502 }; 1503 function useAnimationFrame() { 1504 const timeout = useRefWithInit(AnimationFrame.create).current; 1505 useOnMount(timeout.disposeEffect); 1506 return timeout; 1507 } 1508 1509 // node_modules/@base-ui/react/internals/useTransitionStatus.mjs 1510 function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) { 1511 const [transitionStatus, setTransitionStatus] = React12.useState(open && enableIdleState ? "idle" : void 0); 1512 const [mounted, setMounted] = React12.useState(open); 1513 if (open && !mounted) { 1514 setMounted(true); 1515 setTransitionStatus("starting"); 1516 } 1517 if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) { 1518 setTransitionStatus("ending"); 1519 } 1520 if (!open && !mounted && transitionStatus === "ending") { 1521 setTransitionStatus(void 0); 1522 } 1523 useIsoLayoutEffect(() => { 1524 if (!open && mounted && transitionStatus !== "ending" && deferEndingState) { 1525 const frame = AnimationFrame.request(() => { 1526 setTransitionStatus("ending"); 1527 }); 1528 return () => { 1529 AnimationFrame.cancel(frame); 1530 }; 1531 } 1532 return void 0; 1533 }, [open, mounted, transitionStatus, deferEndingState]); 1534 useIsoLayoutEffect(() => { 1535 if (!open || enableIdleState) { 1536 return void 0; 1537 } 1538 const frame = AnimationFrame.request(() => { 1539 setTransitionStatus(void 0); 1540 }); 1541 return () => { 1542 AnimationFrame.cancel(frame); 1543 }; 1544 }, [enableIdleState, open]); 1545 useIsoLayoutEffect(() => { 1546 if (!open || !enableIdleState) { 1547 return void 0; 1548 } 1549 if (open && mounted && transitionStatus !== "idle") { 1550 setTransitionStatus("starting"); 1551 } 1552 const frame = AnimationFrame.request(() => { 1553 setTransitionStatus("idle"); 1554 }); 1555 return () => { 1556 AnimationFrame.cancel(frame); 1557 }; 1558 }, [enableIdleState, open, mounted, transitionStatus]); 1559 return { 1560 mounted, 1561 setMounted, 1562 transitionStatus 1563 }; 1564 } 1565 1566 // node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs 1567 var React13 = __toESM(require_react(), 1); 1568 function useCompositeListItem(params = {}) { 1569 const { 1570 guess, 1571 label, 1572 metadata, 1573 textRef, 1574 index: externalIndex 1575 } = params; 1576 const { 1577 register, 1578 unregister, 1579 subscribeMapChange, 1580 nextIndexRef 1581 } = useCompositeListContext(); 1582 const indexRef = React13.useRef(-1); 1583 const [internalIndex, setInternalIndex] = React13.useState(externalIndex == null && guess ? () => { 1584 if (indexRef.current === -1) { 1585 const newIndex = nextIndexRef.current; 1586 nextIndexRef.current += 1; 1587 indexRef.current = newIndex; 1588 } 1589 return indexRef.current; 1590 } : -1); 1591 const index = externalIndex ?? internalIndex; 1592 const componentRef = React13.useRef(null); 1593 const ref = React13.useCallback((node) => { 1594 const previousNode = componentRef.current; 1595 if (previousNode) { 1596 unregister(previousNode); 1597 } 1598 componentRef.current = node; 1599 if (node) { 1600 register(node, { 1601 metadata: metadata ?? null, 1602 index: externalIndex ?? null, 1603 label, 1604 textRef 1605 }); 1606 } 1607 }, [externalIndex, register, unregister, metadata, label, textRef]); 1608 useIsoLayoutEffect(() => { 1609 if (externalIndex != null) { 1610 return void 0; 1611 } 1612 return subscribeMapChange((map) => { 1613 const i = componentRef.current ? map.get(componentRef.current)?.index : null; 1614 if (i != null) { 1615 setInternalIndex(i); 1616 } 1617 }); 1618 }, [externalIndex, subscribeMapChange]); 1619 return { 1620 ref, 1621 index 1622 }; 1623 } 1624 1625 // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs 1626 var STARTING_HOOK = { 1627 "data-starting-style": "" 1628 }; 1629 var ENDING_HOOK = { 1630 "data-ending-style": "" 1631 }; 1632 var transitionStatusMapping = { 1633 transitionStatus(value) { 1634 if (value === "starting") { 1635 return STARTING_HOOK; 1636 } 1637 if (value === "ending") { 1638 return ENDING_HOOK; 1639 } 1640 return null; 1641 } 1642 }; 1643 1644 // node_modules/@base-ui/react/internals/use-button/useButton.mjs 1645 var React16 = __toESM(require_react(), 1); 1646 1647 // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs 1648 function hasWindow() { 1649 return typeof window !== "undefined"; 1650 } 1651 function getWindow(node) { 1652 var _node$ownerDocument; 1653 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 1654 } 1655 function isElement(value) { 1656 if (!hasWindow()) { 1657 return false; 1658 } 1659 return value instanceof Element || value instanceof getWindow(value).Element; 1660 } 1661 function isHTMLElement(value) { 1662 if (!hasWindow()) { 1663 return false; 1664 } 1665 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 1666 } 1667 function isShadowRoot(value) { 1668 if (!hasWindow() || typeof ShadowRoot === "undefined") { 1669 return false; 1670 } 1671 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 1672 } 1673 function getComputedStyle2(element) { 1674 return getWindow(element).getComputedStyle(element); 1675 } 1676 1677 // node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs 1678 var React14 = __toESM(require_react(), 1); 1679 var CompositeRootContext = /* @__PURE__ */ React14.createContext(void 0); 1680 if (true) CompositeRootContext.displayName = "CompositeRootContext"; 1681 function useCompositeRootContext(optional = false) { 1682 const context = React14.useContext(CompositeRootContext); 1683 if (context === void 0 && !optional) { 1684 throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage_default(16)); 1685 } 1686 return context; 1687 } 1688 1689 // node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs 1690 var React15 = __toESM(require_react(), 1); 1691 function useFocusableWhenDisabled(parameters) { 1692 const { 1693 focusableWhenDisabled, 1694 disabled: disabled2, 1695 composite = false, 1696 tabIndex: tabIndexProp = 0, 1697 isNativeButton 1698 } = parameters; 1699 const isFocusableComposite = composite && focusableWhenDisabled !== false; 1700 const isNonFocusableComposite = composite && focusableWhenDisabled === false; 1701 const props = React15.useMemo(() => { 1702 const additionalProps = { 1703 // allow Tabbing away from focusableWhenDisabled elements 1704 onKeyDown(event) { 1705 if (disabled2 && focusableWhenDisabled && event.key !== "Tab") { 1706 event.preventDefault(); 1707 } 1708 } 1709 }; 1710 if (!composite) { 1711 additionalProps.tabIndex = tabIndexProp; 1712 if (!isNativeButton && disabled2) { 1713 additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1; 1714 } 1715 } 1716 if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) { 1717 additionalProps["aria-disabled"] = disabled2; 1718 } 1719 if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) { 1720 additionalProps.disabled = disabled2; 1721 } 1722 return additionalProps; 1723 }, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]); 1724 return { 1725 props 1726 }; 1727 } 1728 1729 // node_modules/@base-ui/utils/owner.mjs 1730 function ownerDocument(node) { 1731 return node?.ownerDocument || document; 1732 } 1733 1734 // node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs 1735 function dispatchClickWithModifiers(target, sourceEvent, { 1736 detail = 0 1737 } = {}) { 1738 target.dispatchEvent(new (getWindow(target)).PointerEvent("click", { 1739 bubbles: true, 1740 cancelable: true, 1741 composed: true, 1742 detail, 1743 shiftKey: sourceEvent.shiftKey, 1744 ctrlKey: sourceEvent.ctrlKey, 1745 altKey: sourceEvent.altKey, 1746 metaKey: sourceEvent.metaKey 1747 })); 1748 } 1749 1750 // node_modules/@base-ui/react/internals/use-button/useButton.mjs 1751 function useButton(parameters = {}) { 1752 const { 1753 disabled: disabled2 = false, 1754 focusableWhenDisabled, 1755 tabIndex = 0, 1756 native: isNativeButton = true, 1757 composite: compositeProp 1758 } = parameters; 1759 const elementRef = React16.useRef(null); 1760 const compositeRootContext = useCompositeRootContext(true); 1761 const isCompositeItem = compositeProp ?? compositeRootContext !== void 0; 1762 const { 1763 props: focusableWhenDisabledProps 1764 } = useFocusableWhenDisabled({ 1765 focusableWhenDisabled, 1766 disabled: disabled2, 1767 composite: isCompositeItem, 1768 tabIndex, 1769 isNativeButton 1770 }); 1771 if (true) { 1772 React16.useEffect(() => { 1773 if (!elementRef.current) { 1774 return; 1775 } 1776 const isButtonTag = isButtonElement(elementRef.current); 1777 if (isNativeButton) { 1778 if (!isButtonTag) { 1779 const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; 1780 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`."; 1781 error(`$message}$ownerStackMessage}`); 1782 } 1783 } else if (isButtonTag) { 1784 const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; 1785 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`."; 1786 error(`$message}$ownerStackMessage}`); 1787 } 1788 }, [isNativeButton]); 1789 } 1790 const updateDisabled = React16.useCallback(() => { 1791 const element = elementRef.current; 1792 if (!isButtonElement(element)) { 1793 return; 1794 } 1795 if (isCompositeItem && disabled2 && focusableWhenDisabledProps.disabled === void 0 && element.disabled) { 1796 element.disabled = false; 1797 } 1798 }, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]); 1799 useIsoLayoutEffect(updateDisabled, [updateDisabled]); 1800 const getButtonProps = React16.useCallback((externalProps = {}) => { 1801 const { 1802 onClick: externalOnClick, 1803 onMouseDown: externalOnMouseDown, 1804 onKeyUp: externalOnKeyUp, 1805 onKeyDown: externalOnKeyDown, 1806 onPointerDown: externalOnPointerDown, 1807 ...otherExternalProps 1808 } = externalProps; 1809 return mergeProps({ 1810 onClick(event) { 1811 if (disabled2) { 1812 event.preventDefault(); 1813 return; 1814 } 1815 externalOnClick?.(event); 1816 }, 1817 onMouseDown(event) { 1818 if (!disabled2) { 1819 externalOnMouseDown?.(event); 1820 } 1821 }, 1822 onKeyDown(event) { 1823 if (disabled2) { 1824 return; 1825 } 1826 makeEventPreventable(event); 1827 externalOnKeyDown?.(event); 1828 if (event.baseUIHandlerPrevented) { 1829 return; 1830 } 1831 const isCurrentTarget = event.target === event.currentTarget; 1832 const currentTarget = event.currentTarget; 1833 const isButton = isButtonElement(currentTarget); 1834 const isLink = !isNativeButton && isValidLinkElement(currentTarget); 1835 const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink); 1836 const isEnterKey = event.key === "Enter"; 1837 const isSpaceKey = event.key === " "; 1838 const role = currentTarget.getAttribute("role"); 1839 const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell"; 1840 if (isCurrentTarget && isCompositeItem && isSpaceKey) { 1841 if (event.defaultPrevented && isTextNavigationRole) { 1842 return; 1843 } 1844 event.preventDefault(); 1845 if (!isNativeButton || isButton) { 1846 event.preventBaseUIHandler(); 1847 dispatchClickWithModifiers(currentTarget, event); 1848 } 1849 return; 1850 } 1851 if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) { 1852 if (isCurrentTarget && isLink && isSpaceKey) { 1853 event.preventDefault(); 1854 } 1855 return; 1856 } 1857 if (event.defaultPrevented) { 1858 return; 1859 } 1860 event.preventDefault(); 1861 if (isEnterKey) { 1862 event.preventBaseUIHandler(); 1863 dispatchClickWithModifiers(currentTarget, event); 1864 } 1865 }, 1866 onKeyUp(event) { 1867 if (disabled2) { 1868 return; 1869 } 1870 makeEventPreventable(event); 1871 externalOnKeyUp?.(event); 1872 if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") { 1873 event.preventDefault(); 1874 return; 1875 } 1876 if (event.baseUIHandlerPrevented) { 1877 return; 1878 } 1879 if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === " ") { 1880 event.preventBaseUIHandler(); 1881 dispatchClickWithModifiers(event.currentTarget, event); 1882 } 1883 }, 1884 onPointerDown(event) { 1885 if (disabled2) { 1886 event.preventDefault(); 1887 return; 1888 } 1889 externalOnPointerDown?.(event); 1890 } 1891 }, isNativeButton ? { 1892 type: "button" 1893 } : { 1894 role: "button" 1895 }, focusableWhenDisabledProps, otherExternalProps); 1896 }, [disabled2, focusableWhenDisabledProps, isCompositeItem, isNativeButton]); 1897 const buttonRef = useStableCallback((element) => { 1898 elementRef.current = element; 1899 updateDisabled(); 1900 }); 1901 return { 1902 getButtonProps, 1903 buttonRef 1904 }; 1905 } 1906 function isButtonElement(elem) { 1907 return isHTMLElement(elem) && elem.tagName === "BUTTON"; 1908 } 1909 function isValidLinkElement(elem) { 1910 return isHTMLElement(elem) && elem.tagName === "A" && Boolean(elem.href); 1911 } 1912 1913 // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs 1914 var React17 = __toESM(require_react(), 1); 1915 1916 // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs 1917 var ReactDOM = __toESM(require_react_dom(), 1); 1918 1919 // node_modules/@base-ui/react/utils/resolveRef.mjs 1920 function resolveRef(maybeRef) { 1921 if (maybeRef == null) { 1922 return maybeRef; 1923 } 1924 return "current" in maybeRef ? maybeRef.current : maybeRef; 1925 } 1926 1927 // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs 1928 function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false) { 1929 const frame = useAnimationFrame(); 1930 return useStableCallback((fnToExecute, signal = null) => { 1931 frame.cancel(); 1932 const element = resolveRef(elementOrRef); 1933 if (element == null) { 1934 return; 1935 } 1936 const resolvedElement = element; 1937 const done = () => { 1938 ReactDOM.flushSync(fnToExecute); 1939 }; 1940 if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { 1941 fnToExecute(); 1942 return; 1943 } 1944 function exec() { 1945 Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => { 1946 if (!signal?.aborted) { 1947 done(); 1948 } 1949 }, () => { 1950 if (signal?.aborted) { 1951 return; 1952 } 1953 const currentAnimations = resolvedElement.getAnimations(); 1954 if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { 1955 exec(); 1956 return; 1957 } 1958 done(); 1959 }); 1960 } 1961 if (waitForStartingStyleRemoved) { 1962 const startingStyleAttribute = "data-starting-style"; 1963 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 1964 frame.request(exec); 1965 return; 1966 } 1967 const attributeObserver = new MutationObserver(() => { 1968 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 1969 attributeObserver.disconnect(); 1970 exec(); 1971 } 1972 }); 1973 attributeObserver.observe(resolvedElement, { 1974 attributes: true, 1975 attributeFilter: [startingStyleAttribute] 1976 }); 1977 signal?.addEventListener("abort", () => attributeObserver.disconnect(), { 1978 once: true 1979 }); 1980 return; 1981 } 1982 frame.request(exec); 1983 }); 1984 } 1985 1986 // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs 1987 function useOpenChangeComplete(parameters) { 1988 const { 1989 enabled = true, 1990 open, 1991 ref, 1992 onComplete: onCompleteParam 1993 } = parameters; 1994 const onComplete = useStableCallback(onCompleteParam); 1995 const runOnceAnimationsFinish = useAnimationsFinished(ref, open); 1996 React17.useEffect(() => { 1997 if (!enabled) { 1998 return void 0; 1999 } 2000 const abortController = new AbortController(); 2001 runOnceAnimationsFinish(onComplete, abortController.signal); 2002 return () => { 2003 abortController.abort(); 2004 }; 2005 }, [enabled, open, onComplete, runOnceAnimationsFinish]); 2006 } 2007 2008 // node_modules/@base-ui/utils/useTimeout.mjs 2009 var EMPTY2 = 0; 2010 var Timeout = class _Timeout { 2011 static create() { 2012 return new _Timeout(); 2013 } 2014 currentId = EMPTY2; 2015 /** 2016 * Executes `fn` after `delay`, clearing any previously scheduled call. 2017 */ 2018 start(delay, fn) { 2019 this.clear(); 2020 this.currentId = setTimeout(() => { 2021 this.currentId = EMPTY2; 2022 fn(); 2023 }, delay); 2024 } 2025 isStarted() { 2026 return this.currentId !== EMPTY2; 2027 } 2028 clear = () => { 2029 if (this.currentId !== EMPTY2) { 2030 clearTimeout(this.currentId); 2031 this.currentId = EMPTY2; 2032 } 2033 }; 2034 disposeEffect = () => { 2035 return this.clear; 2036 }; 2037 }; 2038 function useTimeout() { 2039 const timeout = useRefWithInit(Timeout.create).current; 2040 useOnMount(timeout.disposeEffect); 2041 return timeout; 2042 } 2043 2044 // node_modules/@base-ui/react/internals/shadowDom.mjs 2045 function activeElement(doc) { 2046 let element = doc.activeElement; 2047 while (element?.shadowRoot?.activeElement != null) { 2048 element = element.shadowRoot.activeElement; 2049 } 2050 return element; 2051 } 2052 function contains(parent, child) { 2053 if (!parent || !child) { 2054 return false; 2055 } 2056 const rootNode = child.getRootNode?.(); 2057 if (parent.contains(child)) { 2058 return true; 2059 } 2060 if (rootNode && isShadowRoot(rootNode)) { 2061 let next = child; 2062 while (next) { 2063 if (parent === next) { 2064 return true; 2065 } 2066 next = next.parentNode || next.host; 2067 } 2068 } 2069 return false; 2070 } 2071 function getTarget(event) { 2072 if ("composedPath" in event) { 2073 return event.composedPath()[0]; 2074 } 2075 return event.target; 2076 } 2077 2078 // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 2079 var round = Math.round; 2080 2081 // node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs 2082 function isIndexOutOfListBounds(list, index) { 2083 return index < 0 || index >= list.length; 2084 } 2085 function getMinListIndex(listRef, disabledIndices) { 2086 return findNonDisabledListIndex(listRef.current, { 2087 disabledIndices 2088 }); 2089 } 2090 function getMaxListIndex(listRef, disabledIndices) { 2091 return findNonDisabledListIndex(listRef.current, { 2092 decrement: true, 2093 startingIndex: listRef.current.length, 2094 disabledIndices 2095 }); 2096 } 2097 function findNonDisabledListIndex(list, { 2098 startingIndex = -1, 2099 decrement = false, 2100 disabledIndices, 2101 amount = 1 2102 } = {}) { 2103 let index = startingIndex; 2104 do { 2105 index += decrement ? -amount : amount; 2106 } while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices)); 2107 return index; 2108 } 2109 function isListIndexDisabled(list, index, disabledIndices) { 2110 const isExplicitlyDisabled = typeof disabledIndices === "function" ? disabledIndices(index) : disabledIndices?.includes(index) ?? false; 2111 if (isExplicitlyDisabled) { 2112 return true; 2113 } 2114 const element = list[index]; 2115 if (!element) { 2116 return false; 2117 } 2118 if (!isElementVisible(element)) { 2119 return true; 2120 } 2121 if (element.matches(":disabled")) { 2122 return true; 2123 } 2124 return !disabledIndices && (element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true"); 2125 } 2126 function isHiddenByStyles(styles) { 2127 return styles.visibility === "hidden" || styles.visibility === "collapse"; 2128 } 2129 function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) { 2130 if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) { 2131 return false; 2132 } 2133 if (typeof element.checkVisibility === "function") { 2134 return element.checkVisibility(); 2135 } 2136 return styles.display !== "none" && styles.display !== "contents"; 2137 } 2138 2139 // node_modules/@base-ui/utils/useForcedRerendering.mjs 2140 var React18 = __toESM(require_react(), 1); 2141 function useForcedRerendering() { 2142 const [, setState] = React18.useState({}); 2143 return React18.useCallback(() => { 2144 setState({}); 2145 }, []); 2146 } 2147 2148 // node_modules/@base-ui/react/internals/composite/composite.mjs 2149 var ARROW_UP = "ArrowUp"; 2150 var ARROW_DOWN = "ArrowDown"; 2151 var ARROW_LEFT = "ArrowLeft"; 2152 var ARROW_RIGHT = "ArrowRight"; 2153 var HOME = "Home"; 2154 var END = "End"; 2155 var COMPOSITE_KEYS = /* @__PURE__ */ new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END]); 2156 var SHIFT = "Shift"; 2157 var MODIFIER_KEYS = [SHIFT, "Control", "Alt", "Meta"]; 2158 function isInputElement(element) { 2159 return isHTMLElement(element) && element.tagName === "INPUT"; 2160 } 2161 function isNativeInput(element) { 2162 if (isInputElement(element) && element.selectionStart != null) { 2163 return true; 2164 } 2165 if (isHTMLElement(element) && element.tagName === "TEXTAREA") { 2166 return true; 2167 } 2168 return false; 2169 } 2170 function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) { 2171 if (!scrollContainer || !element || !element.scrollTo) { 2172 return; 2173 } 2174 let targetX = scrollContainer.scrollLeft; 2175 let targetY = scrollContainer.scrollTop; 2176 const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth; 2177 const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight; 2178 if (isOverflowingX && orientation !== "vertical") { 2179 const elementOffsetLeft = getOffset(scrollContainer, element, "left"); 2180 const containerStyles = getStyles(scrollContainer); 2181 const elementStyles = getStyles(element); 2182 if (direction === "ltr") { 2183 if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) { 2184 targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight; 2185 } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) { 2186 targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft; 2187 } 2188 } 2189 if (direction === "rtl") { 2190 if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) { 2191 targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft; 2192 } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) { 2193 targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight; 2194 } 2195 } 2196 } 2197 if (isOverflowingY && orientation !== "horizontal") { 2198 const elementOffsetTop = getOffset(scrollContainer, element, "top"); 2199 const containerStyles = getStyles(scrollContainer); 2200 const elementStyles = getStyles(element); 2201 if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) { 2202 targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop; 2203 } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) { 2204 targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom; 2205 } 2206 } 2207 scrollContainer.scrollTo({ 2208 left: targetX, 2209 top: targetY, 2210 behavior: "auto" 2211 }); 2212 } 2213 function getOffset(ancestor, element, side) { 2214 const propName = side === "left" ? "offsetLeft" : "offsetTop"; 2215 let result = 0; 2216 while (element.offsetParent) { 2217 result += element[propName]; 2218 if (element.offsetParent === ancestor) { 2219 break; 2220 } 2221 element = element.offsetParent; 2222 } 2223 return result; 2224 } 2225 function getStyles(element) { 2226 const styles = getComputedStyle(element); 2227 return { 2228 scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0, 2229 scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0, 2230 scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0, 2231 scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0, 2232 scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0, 2233 scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0, 2234 scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0, 2235 scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0 2236 }; 2237 } 2238 2239 // node_modules/@base-ui/utils/inertValue.mjs 2240 function inertValue(value) { 2241 if (isReactVersionAtLeast(19)) { 2242 return value; 2243 } 2244 return value ? "true" : void 0; 2245 } 2246 2247 // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs 2248 var React19 = __toESM(require_react(), 1); 2249 2250 // node_modules/@base-ui/react/internals/field-constants/constants.mjs 2251 var DEFAULT_VALIDITY_STATE = { 2252 badInput: false, 2253 customError: false, 2254 patternMismatch: false, 2255 rangeOverflow: false, 2256 rangeUnderflow: false, 2257 stepMismatch: false, 2258 tooLong: false, 2259 tooShort: false, 2260 typeMismatch: false, 2261 valid: null, 2262 valueMissing: false 2263 }; 2264 var DEFAULT_FIELD_STATE_ATTRIBUTES = { 2265 valid: null, 2266 touched: false, 2267 dirty: false, 2268 filled: false, 2269 focused: false 2270 }; 2271 var DEFAULT_FIELD_ROOT_STATE = { 2272 disabled: false, 2273 ...DEFAULT_FIELD_STATE_ATTRIBUTES 2274 }; 2275 var fieldValidityMapping = { 2276 valid(value) { 2277 if (value === null) { 2278 return null; 2279 } 2280 if (value) { 2281 return { 2282 "data-valid": "" 2283 }; 2284 } 2285 return { 2286 "data-invalid": "" 2287 }; 2288 } 2289 }; 2290 2291 // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs 2292 var DEFAULT_FIELD_ROOT_CONTEXT = { 2293 invalid: void 0, 2294 name: void 0, 2295 validityData: { 2296 state: DEFAULT_VALIDITY_STATE, 2297 errors: [], 2298 error: "", 2299 value: "", 2300 initialValue: null 2301 }, 2302 setValidityData: NOOP, 2303 disabled: void 0, 2304 setTouched: NOOP, 2305 setDirty: NOOP, 2306 setFilled: NOOP, 2307 setFocused: NOOP, 2308 validationMode: "onSubmit", 2309 shouldValidateOnChange: () => false, 2310 state: DEFAULT_FIELD_ROOT_STATE, 2311 registerFieldControl: NOOP, 2312 validation: { 2313 getValidationProps: (_disabled, props = EMPTY_OBJECT) => props, 2314 inputRef: { 2315 current: null 2316 }, 2317 registeredInputs: /* @__PURE__ */ new Map(), 2318 registerInput: NOOP, 2319 getInputControl: () => null, 2320 commit: async () => { 2321 }, 2322 change: NOOP 2323 } 2324 }; 2325 var FieldRootContext = /* @__PURE__ */ React19.createContext(DEFAULT_FIELD_ROOT_CONTEXT); 2326 if (true) FieldRootContext.displayName = "FieldRootContext"; 2327 function useFieldRootContext(optional = true) { 2328 const context = React19.useContext(FieldRootContext); 2329 if (context.setValidityData === NOOP && !optional) { 2330 throw new Error(true ? "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>." : formatErrorMessage_default(28)); 2331 } 2332 return context; 2333 } 2334 2335 // node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs 2336 function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name16) { 2337 const { 2338 registerFieldControl 2339 } = useFieldRootContext(); 2340 const sourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol()); 2341 useIsoLayoutEffect(() => { 2342 const source = sourceRef.current; 2343 if (!enabled) { 2344 registerFieldControl(source, void 0); 2345 return; 2346 } 2347 const registration = { 2348 controlRef, 2349 getValue: getFormValueOverride, 2350 id, 2351 name: name16, 2352 value 2353 }; 2354 registerFieldControl(source, registration); 2355 }, [controlRef, enabled, getFormValueOverride, id, name16, registerFieldControl, sourceRef, value]); 2356 useIsoLayoutEffect(() => { 2357 const source = sourceRef.current; 2358 return () => { 2359 registerFieldControl(source, void 0); 2360 }; 2361 }, [registerFieldControl, sourceRef]); 2362 } 2363 2364 // node_modules/@base-ui/react/internals/form-context/FormContext.mjs 2365 var React20 = __toESM(require_react(), 1); 2366 var FormContext = /* @__PURE__ */ React20.createContext({ 2367 elementRef: { 2368 current: null 2369 }, 2370 formRef: { 2371 current: { 2372 fields: /* @__PURE__ */ new Map() 2373 } 2374 }, 2375 errors: {}, 2376 clearErrors: NOOP, 2377 validationMode: "onSubmit", 2378 submitAttemptedRef: { 2379 current: false 2380 } 2381 }); 2382 if (true) FormContext.displayName = "FormContext"; 2383 function useFormContext() { 2384 return React20.useContext(FormContext); 2385 } 2386 2387 // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs 2388 var React22 = __toESM(require_react(), 1); 2389 2390 // node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs 2391 var React21 = __toESM(require_react(), 1); 2392 var LabelableContext = /* @__PURE__ */ React21.createContext({ 2393 controlId: void 0, 2394 registerControlId: NOOP, 2395 labelId: void 0, 2396 setLabelId: NOOP, 2397 messageIds: [], 2398 setMessageIds: NOOP, 2399 getDescriptionProps: (externalProps) => externalProps 2400 }); 2401 if (true) LabelableContext.displayName = "LabelableContext"; 2402 function useLabelableContext() { 2403 return React21.useContext(LabelableContext); 2404 } 2405 2406 // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs 2407 function useLabelableId(params = {}) { 2408 const { 2409 id, 2410 implicit = false, 2411 controlRef 2412 } = params; 2413 const { 2414 controlId, 2415 registerControlId 2416 } = useLabelableContext(); 2417 const defaultId = useBaseUiId(id); 2418 const controlIdForEffect = implicit ? controlId : void 0; 2419 const controlSourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol()); 2420 const hasRegisteredRef = React22.useRef(false); 2421 const hadExplicitIdRef = React22.useRef(id != null); 2422 const unregisterControlId = useStableCallback(() => { 2423 if (!hasRegisteredRef.current || registerControlId === NOOP) { 2424 return; 2425 } 2426 hasRegisteredRef.current = false; 2427 registerControlId(controlSourceRef.current, void 0); 2428 }); 2429 useIsoLayoutEffect(() => { 2430 if (registerControlId === NOOP) { 2431 return void 0; 2432 } 2433 let nextId; 2434 if (implicit) { 2435 const elem = controlRef?.current; 2436 if (isElement(elem) && elem.closest("label") != null) { 2437 nextId = id ?? null; 2438 } else { 2439 nextId = controlIdForEffect ?? defaultId; 2440 } 2441 } else if (id != null) { 2442 hadExplicitIdRef.current = true; 2443 nextId = id; 2444 } else if (hadExplicitIdRef.current) { 2445 nextId = defaultId; 2446 } else { 2447 unregisterControlId(); 2448 return void 0; 2449 } 2450 if (nextId === void 0) { 2451 unregisterControlId(); 2452 return void 0; 2453 } 2454 hasRegisteredRef.current = true; 2455 registerControlId(controlSourceRef.current, nextId); 2456 return void 0; 2457 }, [id, controlRef, controlIdForEffect, registerControlId, implicit, defaultId, controlSourceRef, unregisterControlId]); 2458 React22.useEffect(() => { 2459 return unregisterControlId; 2460 }, [unregisterControlId]); 2461 return controlId ?? defaultId; 2462 } 2463 2464 // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs 2465 var React23 = __toESM(require_react(), 1); 2466 var DirectionContext = /* @__PURE__ */ React23.createContext(void 0); 2467 if (true) DirectionContext.displayName = "DirectionContext"; 2468 function useDirection() { 2469 const context = React23.useContext(DirectionContext); 2470 return context?.direction ?? "ltr"; 2471 } 2472 2473 // node_modules/@base-ui/react/field/item/FieldItemContext.mjs 2474 var React24 = __toESM(require_react(), 1); 2475 var FieldItemContext = /* @__PURE__ */ React24.createContext({ 2476 disabled: false 2477 }); 2478 if (true) FieldItemContext.displayName = "FieldItemContext"; 2479 function useFieldItemContext() { 2480 const context = React24.useContext(FieldItemContext); 2481 return context; 2482 } 2483 2484 // node_modules/@base-ui/react/field/root/useFieldValidation.mjs 2485 var React25 = __toESM(require_react(), 1); 2486 2487 // node_modules/@base-ui/react/field/utils/getCombinedFieldValidityData.mjs 2488 function getCombinedFieldValidityData(validityData, invalid) { 2489 return { 2490 ...validityData, 2491 state: { 2492 ...validityData.state, 2493 valid: !invalid && validityData.state.valid 2494 } 2495 }; 2496 } 2497 2498 // node_modules/@base-ui/react/field/root/useFieldValidation.mjs 2499 var validityKeys = Object.keys(DEFAULT_VALIDITY_STATE); 2500 function isEligibleInput(input, formElement) { 2501 if (input.matches(":disabled")) { 2502 return false; 2503 } 2504 if (!formElement || input.form === formElement) { 2505 return true; 2506 } 2507 return input.form === null && !input.hasAttribute("form"); 2508 } 2509 function findRepresentativeInput(inputs, formElement) { 2510 let fallback = null; 2511 for (const input of inputs.keys()) { 2512 if (!isEligibleInput(input, formElement)) { 2513 continue; 2514 } 2515 if (!input.validity.valid) { 2516 return input; 2517 } 2518 fallback ??= input; 2519 } 2520 return fallback; 2521 } 2522 function clearCustomValidity(element, inputs) { 2523 for (const input of inputs.keys()) { 2524 input.setCustomValidity(""); 2525 } 2526 element?.setCustomValidity(""); 2527 } 2528 function useFieldValidation(params) { 2529 const { 2530 elementRef, 2531 formRef 2532 } = useFormContext(); 2533 const { 2534 setValidityData, 2535 validate, 2536 validityData, 2537 validationDebounceTime, 2538 invalid, 2539 markedDirtyRef, 2540 state, 2541 shouldValidateOnChange, 2542 registeredFieldIdRef 2543 } = params; 2544 const { 2545 controlId, 2546 getDescriptionProps 2547 } = useLabelableContext(); 2548 const timeout = useTimeout(); 2549 const inputRef = React25.useRef(null); 2550 const registeredInputs = useRefWithInit(() => /* @__PURE__ */ new Map()).current; 2551 const validationCommitIdRef = React25.useRef(0); 2552 const registerInput = React25.useCallback((element, registration) => { 2553 registeredInputs.set(element, registration); 2554 return () => { 2555 registeredInputs.delete(element); 2556 }; 2557 }, [registeredInputs]); 2558 const getInputControl = useStableCallback(() => { 2559 const element = findRepresentativeInput(registeredInputs, elementRef.current); 2560 return element && registeredInputs.get(element)?.controlRef.current || null; 2561 }); 2562 const commit = useStableCallback(async (value, revalidate = false) => { 2563 validationCommitIdRef.current += 1; 2564 const validationCommitId = validationCommitIdRef.current; 2565 function updateRegisteredFieldValidity(nextValidityData2, externalInvalid = invalid) { 2566 const fieldId = registeredFieldIdRef.current ?? controlId; 2567 if (fieldId == null) { 2568 return; 2569 } 2570 const currentFieldData = formRef.current.fields.get(fieldId); 2571 if (!currentFieldData) { 2572 return; 2573 } 2574 const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData2, externalInvalid); 2575 formRef.current.fields.set(fieldId, { 2576 ...currentFieldData, 2577 validityData: validityDataWithFormErrors 2578 }); 2579 } 2580 function publishAllValid(input, externalInvalid) { 2581 const nextValidityData2 = { 2582 value, 2583 state: { 2584 ...DEFAULT_VALIDITY_STATE, 2585 valid: true 2586 }, 2587 error: "", 2588 errors: [], 2589 initialValue: validityData.initialValue 2590 }; 2591 clearCustomValidity(input, registeredInputs); 2592 updateRegisteredFieldValidity(nextValidityData2, externalInvalid); 2593 setValidityData(nextValidityData2); 2594 } 2595 const element = registeredInputs.size > 0 ? findRepresentativeInput(registeredInputs, elementRef.current) : inputRef.current; 2596 if (revalidate) { 2597 if (state.valid !== false || !element) { 2598 return; 2599 } 2600 const currentNativeValidity = element.validity; 2601 if (!currentNativeValidity.valueMissing) { 2602 publishAllValid(element, false); 2603 return; 2604 } 2605 for (const key of validityKeys) { 2606 if (key !== "valid" && key !== "valueMissing" && key !== "customError" && currentNativeValidity[key]) { 2607 return; 2608 } 2609 } 2610 } 2611 function getState(el) { 2612 const computedState = validityKeys.reduce((acc, key) => { 2613 acc[key] = el.validity[key]; 2614 return acc; 2615 }, {}); 2616 let hasOnlyValueMissingError = false; 2617 for (const key of validityKeys) { 2618 if (key === "valid") { 2619 continue; 2620 } 2621 if (key === "valueMissing" && computedState[key]) { 2622 hasOnlyValueMissingError = true; 2623 } else if (computedState[key]) { 2624 return computedState; 2625 } 2626 } 2627 if (hasOnlyValueMissingError && !markedDirtyRef.current) { 2628 computedState.valid = true; 2629 computedState.valueMissing = false; 2630 } 2631 return computedState; 2632 } 2633 timeout.clear(); 2634 let result = null; 2635 let validationErrors = []; 2636 const nextState = element ? getState(element) : { 2637 ...DEFAULT_VALIDITY_STATE, 2638 valid: true 2639 }; 2640 let defaultValidationMessage; 2641 const isValidatingOnChange = shouldValidateOnChange(); 2642 if (element && element.validationMessage && !isValidatingOnChange) { 2643 defaultValidationMessage = element.validationMessage; 2644 validationErrors = [element.validationMessage]; 2645 } else { 2646 const formValues = Array.from(formRef.current.fields.values()).reduce((acc, field) => { 2647 if (field.name) { 2648 acc[field.name] = field.getValue(); 2649 } 2650 return acc; 2651 }, {}); 2652 const resultOrPromise = validate(value, formValues); 2653 if (typeof resultOrPromise === "object" && resultOrPromise !== null && "then" in resultOrPromise) { 2654 result = await resultOrPromise; 2655 if (validationCommitId !== validationCommitIdRef.current) { 2656 return; 2657 } 2658 } else { 2659 result = resultOrPromise; 2660 } 2661 if (result !== null) { 2662 nextState.valid = false; 2663 nextState.customError = true; 2664 if (Array.isArray(result)) { 2665 validationErrors = result; 2666 element?.setCustomValidity(result.join("\n")); 2667 } else if (result) { 2668 validationErrors = [result]; 2669 element?.setCustomValidity(result); 2670 } 2671 } else if (isValidatingOnChange) { 2672 clearCustomValidity(element, registeredInputs); 2673 nextState.customError = false; 2674 if (element && element.validationMessage) { 2675 defaultValidationMessage = element.validationMessage; 2676 validationErrors = [element.validationMessage]; 2677 } else if ((!element || element.validity.valid) && !nextState.valid) { 2678 nextState.valid = true; 2679 } 2680 } 2681 } 2682 const nextValidityData = { 2683 value, 2684 state: nextState, 2685 error: defaultValidationMessage ?? (Array.isArray(result) ? result[0] : result ?? ""), 2686 errors: validationErrors, 2687 initialValue: validityData.initialValue 2688 }; 2689 updateRegisteredFieldValidity(nextValidityData); 2690 setValidityData(nextValidityData); 2691 }); 2692 const change = useStableCallback((value) => { 2693 timeout.clear(); 2694 const validateOnChange = shouldValidateOnChange(); 2695 if (validateOnChange && value !== "" && validationDebounceTime) { 2696 validationCommitIdRef.current += 1; 2697 timeout.start(validationDebounceTime, () => { 2698 commit(value); 2699 }); 2700 } else { 2701 commit(value, !validateOnChange); 2702 } 2703 }); 2704 const getValidationProps = React25.useCallback((disabled2, externalProps = {}) => mergeProps(getDescriptionProps(externalProps), state.valid === false && !state.disabled && !disabled2 ? { 2705 "aria-invalid": true 2706 } : EMPTY_OBJECT), [getDescriptionProps, state.disabled, state.valid]); 2707 return React25.useMemo(() => ({ 2708 getValidationProps, 2709 inputRef, 2710 registeredInputs, 2711 registerInput, 2712 getInputControl, 2713 commit, 2714 change 2715 }), [getValidationProps, registeredInputs, registerInput, getInputControl, commit, change]); 2716 } 2717 2718 // node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs 2719 function useRegisteredLabelId(idProp, setLabelId) { 2720 const id = useBaseUiId(idProp); 2721 useIsoLayoutEffect(() => { 2722 setLabelId(id); 2723 return () => { 2724 setLabelId((currentId) => currentId === id ? void 0 : currentId); 2725 }; 2726 }, [id, setLabelId]); 2727 return id; 2728 } 2729 2730 // node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs 2731 function useLabel(params = {}) { 2732 const { 2733 id: idProp, 2734 fallbackControlId, 2735 native = false, 2736 setLabelId: setLabelIdProp, 2737 focusControl: focusControlProp 2738 } = params; 2739 const { 2740 controlId: contextControlId, 2741 setLabelId: setContextLabelId 2742 } = useLabelableContext(); 2743 const syncLabelId = useStableCallback((nextLabelId) => { 2744 setContextLabelId(nextLabelId); 2745 setLabelIdProp?.(nextLabelId); 2746 }); 2747 const id = useRegisteredLabelId(idProp, syncLabelId); 2748 const resolvedControlId = contextControlId ?? fallbackControlId; 2749 function focusControl(event) { 2750 if (focusControlProp) { 2751 focusControlProp(event, resolvedControlId); 2752 return; 2753 } 2754 if (!resolvedControlId) { 2755 return; 2756 } 2757 const controlElement = ownerDocument(event.currentTarget).getElementById(resolvedControlId); 2758 if (isHTMLElement(controlElement)) { 2759 focusElementWithVisible(controlElement); 2760 } 2761 } 2762 function handleInteraction(event) { 2763 const target = getTarget(event.nativeEvent); 2764 if (target?.closest("button,input,select,textarea")) { 2765 return; 2766 } 2767 if (!event.defaultPrevented && event.detail > 1) { 2768 event.preventDefault(); 2769 } 2770 if (native) { 2771 return; 2772 } 2773 focusControl(event); 2774 } 2775 return native ? { 2776 id, 2777 htmlFor: resolvedControlId ?? void 0, 2778 onMouseDown: handleInteraction 2779 } : { 2780 id, 2781 onClick: handleInteraction, 2782 onPointerDown(event) { 2783 event.preventDefault(); 2784 } 2785 }; 2786 } 2787 function focusElementWithVisible(element) { 2788 element.focus({ 2789 // Available from Chrome 144+ (January 2026). 2790 // Safari and Firefox already support it. 2791 focusVisible: true 2792 }); 2793 } 2794 2795 // node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs 2796 var React26 = __toESM(require_react(), 1); 2797 function useCompositeItem(params = {}) { 2798 const { 2799 highlightItemOnHover, 2800 highlightedIndex, 2801 onHighlightedIndexChange 2802 } = useCompositeRootContext(); 2803 const { 2804 ref, 2805 index 2806 } = useCompositeListItem(params); 2807 const isHighlighted = highlightedIndex === index; 2808 const itemRef = React26.useRef(null); 2809 const mergedRef = useMergedRefs(ref, itemRef); 2810 const compositeProps = { 2811 tabIndex: isHighlighted ? 0 : -1, 2812 onFocus() { 2813 onHighlightedIndexChange(index); 2814 }, 2815 onMouseMove() { 2816 const item = itemRef.current; 2817 if (!highlightItemOnHover || !item) { 2818 return; 2819 } 2820 const disabled2 = item.hasAttribute("disabled") || item.ariaDisabled === "true"; 2821 if (!isHighlighted && !disabled2) { 2822 item.focus(); 2823 } 2824 } 2825 }; 2826 return { 2827 compositeProps, 2828 compositeRef: mergedRef, 2829 index 2830 }; 2831 } 2832 2833 // node_modules/@base-ui/react/utils/getCssDimensions.mjs 2834 function getCssDimensions(element) { 2835 const css = getComputedStyle2(element); 2836 let width = parseFloat(css.width) || 0; 2837 let height = parseFloat(css.height) || 0; 2838 const hasOffset = isHTMLElement(element); 2839 const offsetWidth = hasOffset ? element.offsetWidth : width; 2840 const offsetHeight = hasOffset ? element.offsetHeight : height; 2841 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 2842 if (shouldFallback) { 2843 width = offsetWidth; 2844 height = offsetHeight; 2845 } 2846 return { 2847 width, 2848 height 2849 }; 2850 } 2851 2852 // node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs 2853 var React27 = __toESM(require_react(), 1); 2854 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); 2855 var DirectionProvider = function DirectionProvider2(props) { 2856 const { 2857 direction = "ltr" 2858 } = props; 2859 const contextValue = React27.useMemo(() => ({ 2860 direction 2861 }), [direction]); 2862 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DirectionContext.Provider, { 2863 value: contextValue, 2864 children: props.children 2865 }); 2866 }; 2867 if (true) DirectionProvider.displayName = "DirectionProvider"; 2868 2869 // node_modules/@base-ui/utils/isElementDisabled.mjs 2870 function isElementDisabled(element) { 2871 return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true"; 2872 } 2873 2874 // node_modules/@base-ui/react/internals/csp-context/CSPContext.mjs 2875 var React28 = __toESM(require_react(), 1); 2876 var CSPContext = /* @__PURE__ */ React28.createContext(void 0); 2877 if (true) CSPContext.displayName = "CSPContext"; 2878 var DEFAULT_CSP_CONTEXT_VALUE = { 2879 disableStyleElements: false 2880 }; 2881 function useCSPContext() { 2882 return React28.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE; 2883 } 2884 2885 // node_modules/@base-ui/react/field/index.parts.mjs 2886 var index_parts_exports = {}; 2887 __export(index_parts_exports, { 2888 Control: () => FieldControl, 2889 Description: () => FieldDescription, 2890 Error: () => FieldError, 2891 Item: () => FieldItem, 2892 Label: () => FieldLabel, 2893 Root: () => FieldRoot, 2894 Validity: () => FieldValidity 2895 }); 2896 2897 // node_modules/@base-ui/react/field/root/FieldRoot.mjs 2898 var React32 = __toESM(require_react(), 1); 2899 2900 // node_modules/@base-ui/react/fieldset/root/FieldsetRootContext.mjs 2901 var React29 = __toESM(require_react(), 1); 2902 var FieldsetRootContext = /* @__PURE__ */ React29.createContext(void 0); 2903 if (true) FieldsetRootContext.displayName = "FieldsetRootContext"; 2904 function useFieldsetRootContext(optional = false) { 2905 const context = React29.useContext(FieldsetRootContext); 2906 if (!context && !optional) { 2907 throw new Error(true ? "Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>." : formatErrorMessage_default(86)); 2908 } 2909 return context; 2910 } 2911 2912 // node_modules/@base-ui/react/internals/labelable-provider/LabelableProvider.mjs 2913 var React30 = __toESM(require_react(), 1); 2914 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); 2915 var LabelableProvider = function LabelableProvider2(props) { 2916 const defaultId = useBaseUiId(); 2917 const initialControlId = props.controlId === void 0 ? defaultId : props.controlId; 2918 const [controlId, setControlIdState] = React30.useState(initialControlId); 2919 const [labelId, setLabelId] = React30.useState(props.labelId); 2920 const [messageIds, setMessageIds] = React30.useState([]); 2921 const registrationsRef = useRefWithInit(() => /* @__PURE__ */ new Map()); 2922 const { 2923 messageIds: parentMessageIds 2924 } = useLabelableContext(); 2925 const registerControlId = useStableCallback((source, nextId) => { 2926 const registrations = registrationsRef.current; 2927 if (nextId === void 0) { 2928 registrations.delete(source); 2929 return; 2930 } 2931 registrations.set(source, nextId); 2932 setControlIdState((prev) => { 2933 if (registrations.size === 0) { 2934 return void 0; 2935 } 2936 let nextControlId; 2937 for (const id of registrations.values()) { 2938 if (prev !== void 0 && id === prev) { 2939 return prev; 2940 } 2941 if (nextControlId === void 0) { 2942 nextControlId = id; 2943 } 2944 } 2945 return nextControlId; 2946 }); 2947 }); 2948 const getDescriptionProps = React30.useCallback((externalProps) => { 2949 const ids = externalProps["aria-describedby"] ? externalProps["aria-describedby"].split(" ") : []; 2950 ids.push(...parentMessageIds, ...messageIds); 2951 return { 2952 ...externalProps, 2953 "aria-describedby": Array.from(new Set(ids)).join(" ") || void 0 2954 }; 2955 }, [parentMessageIds, messageIds]); 2956 const contextValue = React30.useMemo(() => ({ 2957 controlId, 2958 registerControlId, 2959 labelId, 2960 setLabelId, 2961 messageIds, 2962 setMessageIds, 2963 getDescriptionProps 2964 }), [controlId, registerControlId, labelId, setLabelId, messageIds, setMessageIds, getDescriptionProps]); 2965 return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LabelableContext.Provider, { 2966 value: contextValue, 2967 children: props.children 2968 }); 2969 }; 2970 if (true) LabelableProvider.displayName = "LabelableProvider"; 2971 2972 // node_modules/@base-ui/react/internals/field-register-control/useFieldControlRegistration.mjs 2973 var React31 = __toESM(require_react(), 1); 2974 function useFieldControlRegistration(params) { 2975 const { 2976 commit, 2977 invalid, 2978 markedDirtyRef, 2979 name: name16, 2980 setRegisteredFieldName, 2981 registeredFieldIdRef, 2982 setValidityData, 2983 validityData 2984 } = params; 2985 const { 2986 formRef 2987 } = useFormContext(); 2988 const activeFieldControlSourceRef = React31.useRef(null); 2989 const registrationRef = React31.useRef(null); 2990 const initialValueCapturedRef = React31.useRef(false); 2991 const getValueForForm = useStableCallback(() => { 2992 const registration = registrationRef.current; 2993 if (!registration) { 2994 return void 0; 2995 } 2996 if (registration.getValue) { 2997 return registration.getValue(); 2998 } 2999 return registration.value; 3000 }); 3001 function getRegistrationValue(registration) { 3002 return registration.value === void 0 ? getValueForForm() : registration.value; 3003 } 3004 const validate = useStableCallback(() => { 3005 const registration = registrationRef.current; 3006 markedDirtyRef.current = true; 3007 if (!registration) { 3008 commit(validityData.value); 3009 return; 3010 } 3011 commit(getRegistrationValue(registration)); 3012 }); 3013 function refreshRegistration() { 3014 const registration = registrationRef.current; 3015 if (!registration || !registration.id) { 3016 return; 3017 } 3018 formRef.current.fields.set(registration.id, { 3019 getValue: getValueForForm, 3020 name: name16 ?? registration.name, 3021 controlRef: registration.controlRef, 3022 validityData: getCombinedFieldValidityData(validityData, invalid), 3023 validate 3024 }); 3025 } 3026 function deleteRegistration(id = registrationRef.current?.id) { 3027 if (id) { 3028 formRef.current.fields.delete(id); 3029 } 3030 } 3031 function captureInitialValue(registration) { 3032 if (initialValueCapturedRef.current) { 3033 return; 3034 } 3035 initialValueCapturedRef.current = true; 3036 const initialValue = getRegistrationValue(registration); 3037 setValidityData((prev) => prev.initialValue === initialValue ? prev : { 3038 ...prev, 3039 initialValue 3040 }); 3041 } 3042 useIsoLayoutEffect(() => { 3043 const registration = registrationRef.current; 3044 if (!registration || !registration.id) { 3045 return; 3046 } 3047 setRegisteredFieldName(name16 ? void 0 : registration.name); 3048 formRef.current.fields.set(registration.id, { 3049 getValue: getValueForForm, 3050 name: name16 ?? registration.name, 3051 controlRef: registration.controlRef, 3052 validityData: getCombinedFieldValidityData(validityData, invalid), 3053 validate 3054 }); 3055 }, [formRef, getValueForForm, invalid, name16, setRegisteredFieldName, validate, validityData]); 3056 useIsoLayoutEffect(() => { 3057 const fields = formRef.current.fields; 3058 return () => { 3059 const id = registrationRef.current?.id; 3060 if (id) { 3061 fields.delete(id); 3062 } 3063 }; 3064 }, [formRef]); 3065 const register = useStableCallback((source, registration) => { 3066 if (!registration) { 3067 if (activeFieldControlSourceRef.current === source) { 3068 activeFieldControlSourceRef.current = null; 3069 deleteRegistration(); 3070 registrationRef.current = null; 3071 setRegisteredFieldName(void 0); 3072 registeredFieldIdRef.current = void 0; 3073 } 3074 return; 3075 } 3076 const previousId = registrationRef.current?.id; 3077 activeFieldControlSourceRef.current = source; 3078 registrationRef.current = registration; 3079 if (!name16) { 3080 setRegisteredFieldName(registration.name); 3081 } 3082 registeredFieldIdRef.current = registration.id; 3083 if (previousId && previousId !== registration.id) { 3084 deleteRegistration(previousId); 3085 } 3086 captureInitialValue(registration); 3087 refreshRegistration(); 3088 }); 3089 return [validate, register]; 3090 } 3091 3092 // node_modules/@base-ui/react/field/root/FieldRoot.mjs 3093 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); 3094 var FieldRootInner = /* @__PURE__ */ React32.forwardRef(function FieldRootInner2(componentProps, forwardedRef) { 3095 const { 3096 errors, 3097 validationMode: formValidationMode, 3098 submitAttemptedRef 3099 } = useFormContext(); 3100 const { 3101 render, 3102 className, 3103 validate: validateProp, 3104 validationDebounceTime = 0, 3105 validationMode = formValidationMode, 3106 name: name16, 3107 disabled: disabledProp = false, 3108 invalid: invalidProp, 3109 dirty: dirtyProp, 3110 touched: touchedProp, 3111 actionsRef, 3112 style, 3113 ...elementProps 3114 } = componentProps; 3115 const disabledFieldset = useFieldsetRootContext(true)?.disabled; 3116 const validate = useStableCallback(validateProp || (() => null)); 3117 const disabled2 = disabledFieldset || disabledProp; 3118 const [touchedState, setTouchedUnwrapped] = React32.useState(false); 3119 const [dirtyState, setDirtyUnwrapped] = React32.useState(false); 3120 const [filled, setFilled] = React32.useState(false); 3121 const [focused, setFocused] = React32.useState(false); 3122 const dirty = dirtyProp ?? dirtyState; 3123 const touched = touchedProp ?? touchedState; 3124 const markedDirtyRef = React32.useRef(dirty); 3125 const registeredFieldIdRef = React32.useRef(void 0); 3126 const [registeredFieldName, setRegisteredFieldName] = React32.useState(); 3127 const effectiveName = name16 ?? registeredFieldName; 3128 useIsoLayoutEffect(() => { 3129 if (dirtyProp !== void 0) { 3130 markedDirtyRef.current = dirtyProp; 3131 } 3132 }, [dirtyProp]); 3133 const setDirty = useStableCallback((value) => { 3134 if (dirtyProp !== void 0) { 3135 return; 3136 } 3137 if (value) { 3138 markedDirtyRef.current = true; 3139 } 3140 setDirtyUnwrapped(value); 3141 }); 3142 const setTouched = useStableCallback((value) => { 3143 if (touchedProp !== void 0) { 3144 return; 3145 } 3146 setTouchedUnwrapped(value); 3147 }); 3148 const shouldValidateOnChange = useStableCallback(() => validationMode === "onChange" || validationMode === "onSubmit" && submitAttemptedRef.current); 3149 const formError = effectiveName && Object.hasOwn(errors, effectiveName) ? errors[effectiveName] : null; 3150 const hasFormError = !!(Array.isArray(formError) ? formError.length : formError); 3151 const invalid = invalidProp === true || hasFormError; 3152 const [validityData, setValidityData] = React32.useState({ 3153 state: DEFAULT_VALIDITY_STATE, 3154 error: "", 3155 errors: [], 3156 value: null, 3157 initialValue: null 3158 }); 3159 const valid = !invalid && (disabled2 ? null : validityData.state.valid); 3160 const state = React32.useMemo(() => ({ 3161 disabled: disabled2, 3162 touched, 3163 dirty, 3164 valid, 3165 filled, 3166 focused 3167 }), [disabled2, touched, dirty, valid, filled, focused]); 3168 const validation = useFieldValidation({ 3169 setValidityData, 3170 validate, 3171 validityData, 3172 validationDebounceTime, 3173 invalid, 3174 markedDirtyRef, 3175 state, 3176 shouldValidateOnChange, 3177 registeredFieldIdRef 3178 }); 3179 const [validateFieldControl, registerFieldControl] = useFieldControlRegistration({ 3180 commit: validation.commit, 3181 invalid, 3182 markedDirtyRef, 3183 name: name16, 3184 setRegisteredFieldName, 3185 registeredFieldIdRef, 3186 setValidityData, 3187 validityData 3188 }); 3189 React32.useImperativeHandle(actionsRef, () => ({ 3190 validate: validateFieldControl 3191 }), [validateFieldControl]); 3192 const contextValue = React32.useMemo(() => ({ 3193 invalid, 3194 name: effectiveName, 3195 validityData, 3196 setValidityData, 3197 disabled: disabled2, 3198 setTouched, 3199 setDirty, 3200 setFilled, 3201 setFocused, 3202 validationMode, 3203 shouldValidateOnChange, 3204 state, 3205 registerFieldControl, 3206 validation 3207 }), [invalid, effectiveName, validityData, disabled2, setTouched, setDirty, setFilled, setFocused, validationMode, shouldValidateOnChange, state, registerFieldControl, validation]); 3208 const element = useRenderElement("div", componentProps, { 3209 ref: forwardedRef, 3210 state, 3211 props: elementProps, 3212 stateAttributesMapping: fieldValidityMapping 3213 }); 3214 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FieldRootContext.Provider, { 3215 value: contextValue, 3216 children: element 3217 }); 3218 }); 3219 if (true) FieldRootInner.displayName = "FieldRootInner"; 3220 var FieldRoot = /* @__PURE__ */ React32.forwardRef(function FieldRoot2(componentProps, forwardedRef) { 3221 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(LabelableProvider, { 3222 children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FieldRootInner, { 3223 ...componentProps, 3224 ref: forwardedRef 3225 }) 3226 }); 3227 }); 3228 if (true) FieldRoot.displayName = "FieldRoot"; 3229 3230 // node_modules/@base-ui/react/field/label/FieldLabel.mjs 3231 var React33 = __toESM(require_react(), 1); 3232 var FieldLabel = /* @__PURE__ */ React33.forwardRef(function FieldLabel2(componentProps, forwardedRef) { 3233 const { 3234 render, 3235 className, 3236 style, 3237 id: idProp, 3238 nativeLabel = true, 3239 ...elementProps 3240 } = componentProps; 3241 const fieldRootContext = useFieldRootContext(false); 3242 const fieldItemContext = useFieldItemContext(); 3243 const { 3244 labelId 3245 } = useLabelableContext(); 3246 const state = { 3247 ...fieldRootContext.state, 3248 disabled: fieldRootContext.disabled || fieldItemContext.disabled 3249 }; 3250 const labelRef = React33.useRef(null); 3251 const labelProps = useLabel({ 3252 id: labelId ?? idProp, 3253 native: nativeLabel 3254 }); 3255 if (true) { 3256 React33.useEffect(() => { 3257 if (!labelRef.current) { 3258 return; 3259 } 3260 const isLabelTag = labelRef.current.tagName === "LABEL"; 3261 if (nativeLabel) { 3262 if (!isLabelTag) { 3263 const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; 3264 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`."; 3265 error(`$message}$ownerStackMessage}`); 3266 } 3267 } else if (isLabelTag) { 3268 const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; 3269 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`."; 3270 error(`$message}$ownerStackMessage}`); 3271 } 3272 }, [nativeLabel]); 3273 } 3274 const element = useRenderElement("label", componentProps, { 3275 ref: [forwardedRef, labelRef], 3276 state, 3277 props: [labelProps, elementProps], 3278 stateAttributesMapping: fieldValidityMapping 3279 }); 3280 return element; 3281 }); 3282 if (true) FieldLabel.displayName = "FieldLabel"; 3283 3284 // node_modules/@base-ui/react/field/error/FieldError.mjs 3285 var React34 = __toESM(require_react(), 1); 3286 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); 3287 var stateAttributesMapping = { 3288 ...fieldValidityMapping, 3289 ...transitionStatusMapping 3290 }; 3291 var FieldError = /* @__PURE__ */ React34.forwardRef(function FieldError2(componentProps, forwardedRef) { 3292 const { 3293 render, 3294 id: idProp, 3295 className, 3296 match, 3297 style, 3298 ...elementProps 3299 } = componentProps; 3300 const id = useBaseUiId(idProp); 3301 const { 3302 validityData, 3303 state: fieldState, 3304 name: name16 3305 } = useFieldRootContext(false); 3306 const { 3307 setMessageIds 3308 } = useLabelableContext(); 3309 const { 3310 errors 3311 } = useFormContext(); 3312 const formError = name16 && Object.hasOwn(errors, name16) ? errors[name16] : null; 3313 const hasFormError = !!(Array.isArray(formError) ? formError.length : formError); 3314 const hasSpecificMatch = typeof match === "string"; 3315 let rendered = false; 3316 if (match === true) { 3317 rendered = true; 3318 } else if (fieldState.disabled) { 3319 rendered = false; 3320 } else if (hasSpecificMatch) { 3321 rendered = Boolean(validityData.state[match]); 3322 } else { 3323 rendered = hasFormError || validityData.state.valid === false; 3324 } 3325 const { 3326 mounted, 3327 transitionStatus, 3328 setMounted 3329 } = useTransitionStatus(rendered); 3330 useIsoLayoutEffect(() => { 3331 if (!rendered || !id) { 3332 return void 0; 3333 } 3334 setMessageIds((v) => v.concat(id)); 3335 return () => { 3336 setMessageIds((v) => v.filter((item) => item !== id)); 3337 }; 3338 }, [rendered, id, setMessageIds]); 3339 const errorRef = React34.useRef(null); 3340 const [lastRenderedMessage, setLastRenderedMessage] = React34.useState(null); 3341 const [lastRenderedMessageKey, setLastRenderedMessageKey] = React34.useState(null); 3342 let error2 = validityData.error; 3343 if (!hasSpecificMatch && hasFormError) { 3344 error2 = formError; 3345 } else if (validityData.errors.length > 1) { 3346 error2 = validityData.errors; 3347 } 3348 let errorMessage = error2; 3349 if (Array.isArray(error2)) { 3350 errorMessage = error2.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("ul", { 3351 children: error2.map((message) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", { 3352 children: message 3353 }, message)) 3354 }) : error2[0]; 3355 } 3356 const errorKey = Array.isArray(error2) ? JSON.stringify(error2) : error2; 3357 if (rendered && errorKey !== lastRenderedMessageKey) { 3358 setLastRenderedMessageKey(errorKey); 3359 setLastRenderedMessage(errorMessage); 3360 } 3361 useOpenChangeComplete({ 3362 open: rendered, 3363 ref: errorRef, 3364 onComplete() { 3365 if (!rendered) { 3366 setMounted(false); 3367 } 3368 } 3369 }); 3370 const state = { 3371 ...fieldState, 3372 transitionStatus 3373 }; 3374 const element = useRenderElement("div", componentProps, { 3375 ref: [forwardedRef, errorRef], 3376 state, 3377 props: [{ 3378 id, 3379 children: rendered ? errorMessage : lastRenderedMessage 3380 }, elementProps], 3381 stateAttributesMapping, 3382 enabled: mounted 3383 }); 3384 if (!mounted) { 3385 return null; 3386 } 3387 return element; 3388 }); 3389 if (true) FieldError.displayName = "FieldError"; 3390 3391 // node_modules/@base-ui/react/field/description/FieldDescription.mjs 3392 var React35 = __toESM(require_react(), 1); 3393 var FieldDescription = /* @__PURE__ */ React35.forwardRef(function FieldDescription2(componentProps, forwardedRef) { 3394 const { 3395 render, 3396 id: idProp, 3397 className, 3398 style, 3399 ...elementProps 3400 } = componentProps; 3401 const id = useBaseUiId(idProp); 3402 const fieldRootContext = useFieldRootContext(false); 3403 const fieldItemContext = useFieldItemContext(); 3404 const { 3405 setMessageIds 3406 } = useLabelableContext(); 3407 const state = { 3408 ...fieldRootContext.state, 3409 disabled: fieldRootContext.disabled || fieldItemContext.disabled 3410 }; 3411 useIsoLayoutEffect(() => { 3412 if (!id) { 3413 return void 0; 3414 } 3415 setMessageIds((v) => v.concat(id)); 3416 return () => { 3417 setMessageIds((v) => v.filter((item) => item !== id)); 3418 }; 3419 }, [id, setMessageIds]); 3420 const element = useRenderElement("p", componentProps, { 3421 ref: forwardedRef, 3422 state, 3423 props: [{ 3424 id 3425 }, elementProps], 3426 stateAttributesMapping: fieldValidityMapping 3427 }); 3428 return element; 3429 }); 3430 if (true) FieldDescription.displayName = "FieldDescription"; 3431 3432 // node_modules/@base-ui/react/field/control/FieldControl.mjs 3433 var React36 = __toESM(require_react(), 1); 3434 var FieldControl = /* @__PURE__ */ React36.forwardRef(function FieldControl2(componentProps, forwardedRef) { 3435 const { 3436 render, 3437 className, 3438 id: idProp, 3439 name: nameProp, 3440 value: valueProp, 3441 disabled: disabledProp = false, 3442 onValueChange, 3443 defaultValue, 3444 autoFocus = false, 3445 style, 3446 ...elementProps 3447 } = componentProps; 3448 const { 3449 state: fieldState, 3450 name: fieldName, 3451 disabled: fieldDisabled, 3452 setTouched, 3453 setDirty, 3454 validityData, 3455 setFocused, 3456 setFilled, 3457 validationMode, 3458 validation 3459 } = useFieldRootContext(); 3460 const { 3461 clearErrors 3462 } = useFormContext(); 3463 const disabled2 = fieldDisabled || disabledProp; 3464 const name16 = fieldName ?? nameProp; 3465 const state = { 3466 ...fieldState, 3467 disabled: disabled2 3468 }; 3469 const { 3470 labelId 3471 } = useLabelableContext(); 3472 const id = useLabelableId({ 3473 id: idProp 3474 }); 3475 useIsoLayoutEffect(() => { 3476 const hasExternalValue = valueProp != null; 3477 if (validation.inputRef.current?.value || hasExternalValue && valueProp !== "") { 3478 setFilled(true); 3479 } else if (hasExternalValue && valueProp === "") { 3480 setFilled(false); 3481 } 3482 }, [validation.inputRef, setFilled, valueProp]); 3483 const inputRef = React36.useRef(null); 3484 useIsoLayoutEffect(() => { 3485 if (autoFocus && inputRef.current === activeElement(ownerDocument(inputRef.current))) { 3486 setFocused(true); 3487 } 3488 }, [autoFocus, setFocused]); 3489 const [valueUnwrapped] = useControlled({ 3490 controlled: valueProp, 3491 default: defaultValue, 3492 name: "FieldControl", 3493 state: "value" 3494 }); 3495 const isControlled = valueProp !== void 0; 3496 const value = isControlled ? valueUnwrapped : void 0; 3497 const getValueFromInput = useStableCallback(() => validation.inputRef.current?.value); 3498 useRegisterFieldControl(validation.inputRef, id, value, getValueFromInput, !disabled2, nameProp); 3499 const element = useRenderElement("input", componentProps, { 3500 ref: [forwardedRef, inputRef], 3501 state, 3502 props: [{ 3503 id, 3504 disabled: disabled2, 3505 name: name16, 3506 ref: validation.inputRef, 3507 "aria-labelledby": labelId, 3508 autoFocus, 3509 ...isControlled ? { 3510 value 3511 } : { 3512 defaultValue 3513 }, 3514 onChange(event) { 3515 const inputValue = event.currentTarget.value; 3516 onValueChange?.(inputValue, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent)); 3517 setDirty(inputValue !== (validityData.initialValue ?? "")); 3518 setFilled(inputValue !== ""); 3519 if (!event.nativeEvent.defaultPrevented) { 3520 clearErrors(name16); 3521 validation.change(inputValue); 3522 } 3523 }, 3524 onFocus() { 3525 setFocused(true); 3526 }, 3527 onBlur(event) { 3528 setTouched(true); 3529 setFocused(false); 3530 if (validationMode === "onBlur") { 3531 validation.commit(event.currentTarget.value); 3532 } 3533 }, 3534 onKeyDown(event) { 3535 if (event.currentTarget.tagName === "INPUT" && event.key === "Enter") { 3536 setTouched(true); 3537 validation.commit(event.currentTarget.value); 3538 } 3539 } 3540 }, elementProps, (props) => validation.getValidationProps(disabled2, props)], 3541 stateAttributesMapping: fieldValidityMapping 3542 }); 3543 return element; 3544 }); 3545 if (true) FieldControl.displayName = "FieldControl"; 3546 3547 // node_modules/@base-ui/react/field/validity/FieldValidity.mjs 3548 var React37 = __toESM(require_react(), 1); 3549 var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); 3550 var FieldValidity = function FieldValidity2(props) { 3551 const { 3552 children 3553 } = props; 3554 const { 3555 validityData, 3556 invalid 3557 } = useFieldRootContext(false); 3558 const combinedFieldValidityData = React37.useMemo(() => getCombinedFieldValidityData(validityData, invalid), [validityData, invalid]); 3559 const isInvalid = combinedFieldValidityData.state.valid === false; 3560 const { 3561 transitionStatus 3562 } = useTransitionStatus(isInvalid); 3563 const fieldValidityState = React37.useMemo(() => { 3564 return { 3565 ...combinedFieldValidityData, 3566 validity: combinedFieldValidityData.state, 3567 transitionStatus 3568 }; 3569 }, [combinedFieldValidityData, transitionStatus]); 3570 return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(React37.Fragment, { 3571 children: children(fieldValidityState) 3572 }); 3573 }; 3574 if (true) FieldValidity.displayName = "FieldValidity"; 3575 3576 // node_modules/@base-ui/react/field/item/FieldItem.mjs 3577 var React38 = __toESM(require_react(), 1); 3578 var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); 3579 var FieldItem = /* @__PURE__ */ React38.forwardRef(function FieldItem2(componentProps, forwardedRef) { 3580 const { 3581 render, 3582 className, 3583 style, 3584 disabled: disabledProp = false, 3585 ...elementProps 3586 } = componentProps; 3587 const { 3588 state: fieldState, 3589 disabled: rootDisabled 3590 } = useFieldRootContext(false); 3591 const disabled2 = rootDisabled || disabledProp; 3592 const state = { 3593 ...fieldState, 3594 disabled: disabled2 3595 }; 3596 const fieldItemContext = React38.useMemo(() => ({ 3597 disabled: disabled2 3598 }), [disabled2]); 3599 const element = useRenderElement("div", componentProps, { 3600 ref: forwardedRef, 3601 state, 3602 props: elementProps, 3603 stateAttributesMapping: fieldValidityMapping 3604 }); 3605 return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(LabelableProvider, { 3606 children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FieldItemContext.Provider, { 3607 value: fieldItemContext, 3608 children: element 3609 }) 3610 }); 3611 }); 3612 if (true) FieldItem.displayName = "FieldItem"; 3613 3614 // node_modules/@base-ui/react/input/Input.mjs 3615 var React39 = __toESM(require_react(), 1); 3616 var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); 3617 var Input = /* @__PURE__ */ React39.forwardRef(function Input2(props, forwardedRef) { 3618 return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(index_parts_exports.Control, { 3619 ref: forwardedRef, 3620 ...props 3621 }); 3622 }); 3623 if (true) Input.displayName = "Input"; 3624 3625 // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs 3626 var React41 = __toESM(require_react(), 1); 3627 3628 // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs 3629 var React40 = __toESM(require_react(), 1); 3630 3631 // node_modules/@base-ui/react/internals/composite/constants.mjs 3632 var ACTIVE_COMPOSITE_ITEM = "data-composite-item-active"; 3633 3634 // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs 3635 var EMPTY_ARRAY2 = []; 3636 function useCompositeRoot(params) { 3637 const { 3638 loopFocus = true, 3639 orientation = "both", 3640 grid, 3641 onLoop, 3642 direction, 3643 highlightedIndex: externalHighlightedIndex, 3644 onHighlightedIndexChange: externalSetHighlightedIndex, 3645 rootRef: externalRef, 3646 enableHomeAndEndKeys = false, 3647 stopEventPropagation, 3648 disabledIndices, 3649 modifierKeys = EMPTY_ARRAY2 3650 } = params; 3651 const [internalHighlightedIndex, internalSetHighlightedIndex] = React40.useState(0); 3652 const isGrid = grid != null; 3653 const rootRef = React40.useRef(null); 3654 const mergedRef = useMergedRefs(rootRef, externalRef); 3655 const elementsRef = React40.useRef([]); 3656 const hasSetDefaultIndexRef = React40.useRef(false); 3657 const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex; 3658 const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => { 3659 (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index); 3660 if (shouldScrollIntoView) { 3661 const newActiveItem = elementsRef.current[index]; 3662 scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation); 3663 } 3664 }); 3665 const onMapChange = useStableCallback((map) => { 3666 if (map.size === 0 || hasSetDefaultIndexRef.current) { 3667 return; 3668 } 3669 hasSetDefaultIndexRef.current = true; 3670 const sortedElements = Array.from(map.keys()); 3671 const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null; 3672 const activeIndex = activeItem ? map.get(activeItem)?.index ?? -1 : -1; 3673 if (activeIndex !== -1) { 3674 onHighlightedIndexChange(activeIndex); 3675 } else if (isListIndexDisabled(sortedElements, highlightedIndex, disabledIndices)) { 3676 const firstEnabledIndex = findNonDisabledListIndex(sortedElements, { 3677 disabledIndices 3678 }); 3679 if (!isIndexOutOfListBounds(sortedElements, firstEnabledIndex)) { 3680 onHighlightedIndexChange(firstEnabledIndex); 3681 } 3682 } 3683 scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation); 3684 }); 3685 useIsoLayoutEffect(() => { 3686 if (disabledIndices == null || externalHighlightedIndex != null || !hasSetDefaultIndexRef.current) { 3687 return; 3688 } 3689 const elements = elementsRef.current; 3690 if (isListIndexDisabled(elements, highlightedIndex, disabledIndices)) { 3691 const firstEnabledIndex = findNonDisabledListIndex(elements, { 3692 disabledIndices 3693 }); 3694 if (!isIndexOutOfListBounds(elements, firstEnabledIndex)) { 3695 onHighlightedIndexChange(firstEnabledIndex); 3696 } 3697 } 3698 }, [disabledIndices, externalHighlightedIndex, highlightedIndex, elementsRef, onHighlightedIndexChange]); 3699 const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => { 3700 if (!onLoop) { 3701 return nextIndex; 3702 } 3703 return onLoop(event, prevIndex, nextIndex, elementsRef); 3704 }); 3705 const onKeyDown = useStableCallback((event) => { 3706 const isHomeOrEnd = event.key === HOME || event.key === END; 3707 if (!COMPOSITE_KEYS.has(event.key) || !enableHomeAndEndKeys && isHomeOrEnd) { 3708 return; 3709 } 3710 if (isModifierKeySet(event, modifierKeys)) { 3711 return; 3712 } 3713 const element = rootRef.current; 3714 if (!element) { 3715 return; 3716 } 3717 const isRtl = direction === "rtl"; 3718 const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT; 3719 const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT; 3720 const forwardKey = orientation === "vertical" ? ARROW_DOWN : horizontalForwardKey; 3721 const backwardKey = orientation === "vertical" ? ARROW_UP : horizontalBackwardKey; 3722 const target = getTarget(event.nativeEvent); 3723 if (target != null && isNativeInput(target) && !isElementDisabled(target)) { 3724 const selectionStart = target.selectionStart; 3725 const selectionEnd = target.selectionEnd; 3726 const textContent = target.value; 3727 if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) { 3728 return; 3729 } 3730 if (event.key !== backwardKey && selectionStart < textContent.length) { 3731 return; 3732 } 3733 if (event.key !== forwardKey && selectionStart > 0) { 3734 return; 3735 } 3736 } 3737 let nextIndex = highlightedIndex; 3738 const minIndex = getMinListIndex(elementsRef, disabledIndices); 3739 const maxIndex = getMaxListIndex(elementsRef, disabledIndices); 3740 if (grid != null) { 3741 nextIndex = grid({ 3742 disabledIndices, 3743 elementsRef, 3744 event, 3745 highlightedIndex, 3746 loopFocus, 3747 maxIndex, 3748 minIndex, 3749 onLoop: wrappedOnLoop, 3750 orientation, 3751 rtl: isRtl 3752 }); 3753 } 3754 const isForwardKey = orientation !== "vertical" && event.key === horizontalForwardKey || orientation !== "horizontal" && event.key === ARROW_DOWN; 3755 const isBackwardKey = orientation !== "vertical" && event.key === horizontalBackwardKey || orientation !== "horizontal" && event.key === ARROW_UP; 3756 if (enableHomeAndEndKeys) { 3757 if (event.key === HOME) { 3758 nextIndex = minIndex; 3759 } else if (event.key === END) { 3760 nextIndex = maxIndex; 3761 } 3762 } 3763 if (nextIndex === highlightedIndex && (isForwardKey || isBackwardKey)) { 3764 if (loopFocus && nextIndex === maxIndex && isForwardKey) { 3765 nextIndex = minIndex; 3766 if (onLoop) { 3767 nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef); 3768 } 3769 } else if (loopFocus && nextIndex === minIndex && isBackwardKey) { 3770 nextIndex = maxIndex; 3771 if (onLoop) { 3772 nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef); 3773 } 3774 } else { 3775 nextIndex = findNonDisabledListIndex(elementsRef.current, { 3776 startingIndex: nextIndex, 3777 decrement: isBackwardKey, 3778 disabledIndices 3779 }); 3780 } 3781 } 3782 if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) { 3783 if (stopEventPropagation) { 3784 event.stopPropagation(); 3785 } 3786 if (isGrid || isHomeOrEnd || isForwardKey || isBackwardKey) { 3787 event.preventDefault(); 3788 } 3789 onHighlightedIndexChange(nextIndex, true); 3790 queueMicrotask(() => { 3791 elementsRef.current[nextIndex]?.focus(); 3792 }); 3793 } 3794 }); 3795 const props = { 3796 ref: mergedRef, 3797 onFocus(event) { 3798 const element = rootRef.current; 3799 const target = getTarget(event.nativeEvent); 3800 if (!element || target == null || !isNativeInput(target)) { 3801 return; 3802 } 3803 target.setSelectionRange(0, target.value.length); 3804 }, 3805 onKeyDown 3806 }; 3807 return { 3808 props, 3809 highlightedIndex, 3810 onHighlightedIndexChange, 3811 elementsRef, 3812 onMapChange, 3813 relayKeyboardEvent: onKeyDown 3814 }; 3815 } 3816 function isModifierKeySet(event, ignoredModifierKeys) { 3817 for (const key of MODIFIER_KEYS) { 3818 if (ignoredModifierKeys.includes(key)) { 3819 continue; 3820 } 3821 if (event.getModifierState(key)) { 3822 return true; 3823 } 3824 } 3825 return false; 3826 } 3827 3828 // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs 3829 var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); 3830 function CompositeRoot(componentProps) { 3831 const { 3832 render, 3833 className, 3834 style, 3835 refs = EMPTY_ARRAY, 3836 props = EMPTY_ARRAY, 3837 state = EMPTY_OBJECT, 3838 stateAttributesMapping: stateAttributesMapping4, 3839 highlightedIndex: highlightedIndexProp, 3840 onHighlightedIndexChange: onHighlightedIndexChangeProp, 3841 orientation, 3842 grid, 3843 loopFocus, 3844 onLoop, 3845 enableHomeAndEndKeys, 3846 onMapChange: onMapChangeProp, 3847 stopEventPropagation = true, 3848 rootRef, 3849 disabledIndices, 3850 modifierKeys, 3851 highlightItemOnHover = false, 3852 tag = "div", 3853 ...elementProps 3854 } = componentProps; 3855 const direction = useDirection(); 3856 const { 3857 props: defaultProps, 3858 highlightedIndex, 3859 onHighlightedIndexChange, 3860 elementsRef, 3861 onMapChange: onMapChangeUnwrapped, 3862 relayKeyboardEvent 3863 } = useCompositeRoot({ 3864 grid, 3865 loopFocus, 3866 onLoop, 3867 orientation, 3868 highlightedIndex: highlightedIndexProp, 3869 onHighlightedIndexChange: onHighlightedIndexChangeProp, 3870 rootRef, 3871 stopEventPropagation, 3872 enableHomeAndEndKeys, 3873 direction, 3874 disabledIndices, 3875 modifierKeys 3876 }); 3877 const element = useRenderElement(tag, componentProps, { 3878 state, 3879 ref: refs, 3880 props: [defaultProps, ...props, elementProps], 3881 stateAttributesMapping: stateAttributesMapping4 3882 }); 3883 const contextValue = React41.useMemo(() => ({ 3884 highlightedIndex, 3885 onHighlightedIndexChange, 3886 highlightItemOnHover, 3887 relayKeyboardEvent 3888 }), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]); 3889 return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CompositeRootContext.Provider, { 3890 value: contextValue, 3891 children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CompositeList, { 3892 elementsRef, 3893 onMapChange: (newMap) => { 3894 onMapChangeProp?.(newMap); 3895 onMapChangeUnwrapped(newMap); 3896 }, 3897 children: element 3898 }) 3899 }); 3900 } 3901 3902 // node_modules/@base-ui/react/internals/prehydrationScript.stub.mjs 3903 var script = ""; 3904 3905 // node_modules/@base-ui/react/utils/useIsHydrating.mjs 3906 var import_shim = __toESM(require_shim(), 1); 3907 function subscribe() { 3908 return NOOP; 3909 } 3910 function getSnapshot() { 3911 return false; 3912 } 3913 function getServerSnapshot() { 3914 return true; 3915 } 3916 function useIsHydrating() { 3917 return (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot); 3918 } 3919 3920 // node_modules/@base-ui/react/internals/PrehydrationScript.mjs 3921 var React42 = __toESM(require_react(), 1); 3922 var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); 3923 function PrehydrationScript(props) { 3924 const { 3925 script: script2 3926 } = props; 3927 const { 3928 nonce 3929 } = useCSPContext(); 3930 const isHydrating = useIsHydrating(); 3931 if (!isHydrating) { 3932 return null; 3933 } 3934 return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("script", { 3935 nonce, 3936 dangerouslySetInnerHTML: { 3937 __html: script2 3938 }, 3939 suppressHydrationWarning: true 3940 }); 3941 } 3942 3943 // node_modules/@base-ui/react/tabs/index.parts.mjs 3944 var index_parts_exports2 = {}; 3945 __export(index_parts_exports2, { 3946 Indicator: () => TabsIndicator, 3947 List: () => TabsList, 3948 Panel: () => TabsPanel, 3949 Root: () => TabsRoot, 3950 Tab: () => TabsTab 3951 }); 3952 3953 // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs 3954 var React44 = __toESM(require_react(), 1); 3955 3956 // node_modules/@base-ui/react/tabs/root/TabsRootContext.mjs 3957 var React43 = __toESM(require_react(), 1); 3958 var TabsRootContext = /* @__PURE__ */ React43.createContext(void 0); 3959 if (true) TabsRootContext.displayName = "TabsRootContext"; 3960 function useTabsRootContext() { 3961 const context = React43.useContext(TabsRootContext); 3962 if (context === void 0) { 3963 throw new Error(true ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage_default(64)); 3964 } 3965 return context; 3966 } 3967 3968 // node_modules/@base-ui/react/tabs/root/stateAttributesMapping.mjs 3969 var tabsStateAttributesMapping = { 3970 tabActivationDirection: (dir) => ({ 3971 "data-activation-direction": dir 3972 }) 3973 }; 3974 3975 // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs 3976 var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); 3977 var TabsRoot = /* @__PURE__ */ React44.forwardRef(function TabsRoot2(componentProps, forwardedRef) { 3978 const { 3979 className, 3980 defaultValue: defaultValueProp = 0, 3981 onValueChange: onValueChangeProp, 3982 orientation = "horizontal", 3983 render, 3984 value: valueProp, 3985 style, 3986 ...elementProps 3987 } = componentProps; 3988 const hasExplicitDefaultValueProp = componentProps.defaultValue !== void 0; 3989 const tabPanelRefs = React44.useRef([]); 3990 const [mountedTabPanels, setMountedTabPanels] = React44.useState(() => /* @__PURE__ */ new Map()); 3991 const [value, setValue] = useControlled({ 3992 controlled: valueProp, 3993 default: defaultValueProp, 3994 name: "Tabs", 3995 state: "value" 3996 }); 3997 const isControlled = valueProp !== void 0; 3998 const [tabMap, setTabMap] = React44.useState(() => /* @__PURE__ */ new Map()); 3999 const lastKnownTabElementRef = React44.useRef(void 0); 4000 const getTabElementBySelectedValue = React44.useCallback((selectedValue) => findTabElement(tabMap, selectedValue), [tabMap]); 4001 const [activationDirectionState, setActivationDirectionState] = React44.useState(() => ({ 4002 previousValue: value, 4003 tabActivationDirection: "none" 4004 })); 4005 const { 4006 previousValue, 4007 tabActivationDirection: committedTabActivationDirection 4008 } = activationDirectionState; 4009 let tabActivationDirection = committedTabActivationDirection; 4010 let directionComputationIncomplete = false; 4011 if (previousValue !== value) { 4012 tabActivationDirection = computeActivationDirection(previousValue, value, orientation, tabMap); 4013 directionComputationIncomplete = previousValue != null && value != null && getTabElementBySelectedValue(value) == null; 4014 } 4015 const nextPreviousValue = directionComputationIncomplete ? previousValue : value; 4016 const shouldSyncActivationDirectionState = previousValue !== nextPreviousValue || committedTabActivationDirection !== tabActivationDirection; 4017 useIsoLayoutEffect(() => { 4018 if (!shouldSyncActivationDirectionState) { 4019 return; 4020 } 4021 setActivationDirectionState({ 4022 previousValue: nextPreviousValue, 4023 tabActivationDirection 4024 }); 4025 }, [nextPreviousValue, shouldSyncActivationDirectionState, tabActivationDirection]); 4026 const onValueChange = useStableCallback((newValue, eventDetails) => { 4027 const activationDirection = computeActivationDirection(value, newValue, orientation, tabMap); 4028 eventDetails.activationDirection = activationDirection; 4029 onValueChangeProp?.(newValue, eventDetails); 4030 if (eventDetails.isCanceled) { 4031 return; 4032 } 4033 setValue(newValue); 4034 }); 4035 const notifyAutomaticValueChange = useStableCallback((nextValue, reason) => { 4036 onValueChangeProp?.(nextValue, createChangeEventDetails(reason, void 0, void 0, { 4037 activationDirection: "none" 4038 })); 4039 }); 4040 const registerMountedTabPanel = useStableCallback((panelValue, panelId) => { 4041 setMountedTabPanels((prev) => { 4042 const next = new Map(prev); 4043 next.set(panelValue, panelId); 4044 return next; 4045 }); 4046 return () => { 4047 setMountedTabPanels((prev) => { 4048 if (prev.get(panelValue) !== panelId) { 4049 return prev; 4050 } 4051 const next = new Map(prev); 4052 next.delete(panelValue); 4053 return next; 4054 }); 4055 }; 4056 }); 4057 const getTabPanelIdByValue = React44.useCallback((tabValue) => { 4058 return mountedTabPanels.get(tabValue); 4059 }, [mountedTabPanels]); 4060 const getTabIdByPanelValue = React44.useCallback((tabPanelValue) => { 4061 for (const tabMetadata of tabMap.values()) { 4062 if (tabPanelValue === tabMetadata.value) { 4063 return tabMetadata.id; 4064 } 4065 } 4066 return void 0; 4067 }, [tabMap]); 4068 const tabsContextValue = React44.useMemo(() => ({ 4069 getTabElementBySelectedValue, 4070 getTabIdByPanelValue, 4071 getTabPanelIdByValue, 4072 onValueChange, 4073 orientation, 4074 registerMountedTabPanel, 4075 setTabMap, 4076 tabActivationDirection, 4077 value 4078 }), [getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, tabActivationDirection, value]); 4079 const selectedTabMetadata = React44.useMemo(() => { 4080 for (const tabMetadata of tabMap.values()) { 4081 if (tabMetadata.value === value) { 4082 return tabMetadata; 4083 } 4084 } 4085 return void 0; 4086 }, [tabMap, value]); 4087 const firstEnabledTabValue = React44.useMemo(() => { 4088 for (const tabMetadata of tabMap.values()) { 4089 if (!tabMetadata.disabled) { 4090 return tabMetadata.value; 4091 } 4092 } 4093 return void 0; 4094 }, [tabMap]); 4095 const shouldNotifyInitialValueChangeRef = React44.useRef(!hasExplicitDefaultValueProp); 4096 const initialDefaultValueRef = React44.useRef(defaultValueProp); 4097 const shouldHonorDisabledDefaultValueRef = React44.useRef(hasExplicitDefaultValueProp); 4098 const didRegisterTabsRef = React44.useRef(false); 4099 useIsoLayoutEffect(() => { 4100 if (isControlled) { 4101 return; 4102 } 4103 function commitAutomaticValueChange(fallbackValue, fallbackReason) { 4104 setValue(fallbackValue); 4105 setActivationDirectionState({ 4106 previousValue: fallbackValue, 4107 tabActivationDirection: "none" 4108 }); 4109 notifyAutomaticValueChange(fallbackValue, fallbackReason); 4110 shouldNotifyInitialValueChangeRef.current = false; 4111 } 4112 if (tabMap.size === 0) { 4113 if (didRegisterTabsRef.current && value !== null && !lastKnownTabElementRef.current?.isConnected) { 4114 commitAutomaticValueChange(null, reason_parts_exports.missing); 4115 } 4116 return; 4117 } 4118 didRegisterTabsRef.current = true; 4119 lastKnownTabElementRef.current = tabMap.keys().next().value; 4120 const selectionIsDisabled = selectedTabMetadata?.disabled; 4121 const selectionIsMissing = selectedTabMetadata == null && value !== null; 4122 if (!selectionIsDisabled && value === initialDefaultValueRef.current) { 4123 shouldHonorDisabledDefaultValueRef.current = false; 4124 } 4125 if (shouldHonorDisabledDefaultValueRef.current && selectionIsDisabled && value === initialDefaultValueRef.current) { 4126 return; 4127 } 4128 const shouldNotifyInitialValueChange = shouldNotifyInitialValueChangeRef.current; 4129 if (selectionIsDisabled || selectionIsMissing) { 4130 const fallbackValue = firstEnabledTabValue ?? null; 4131 if (value === fallbackValue) { 4132 shouldNotifyInitialValueChangeRef.current = false; 4133 return; 4134 } 4135 let fallbackReason = reason_parts_exports.missing; 4136 if (shouldNotifyInitialValueChange) { 4137 fallbackReason = reason_parts_exports.initial; 4138 } else if (selectionIsDisabled) { 4139 fallbackReason = reason_parts_exports.disabled; 4140 } 4141 commitAutomaticValueChange(fallbackValue, fallbackReason); 4142 return; 4143 } 4144 if (shouldNotifyInitialValueChange && selectedTabMetadata != null) { 4145 notifyAutomaticValueChange(value, reason_parts_exports.initial); 4146 shouldNotifyInitialValueChangeRef.current = false; 4147 } 4148 }, [firstEnabledTabValue, isControlled, notifyAutomaticValueChange, selectedTabMetadata, setValue, tabMap, value]); 4149 const state = { 4150 orientation, 4151 tabActivationDirection 4152 }; 4153 const element = useRenderElement("div", componentProps, { 4154 state, 4155 ref: forwardedRef, 4156 props: elementProps, 4157 stateAttributesMapping: tabsStateAttributesMapping 4158 }); 4159 return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabsRootContext.Provider, { 4160 value: tabsContextValue, 4161 children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CompositeList, { 4162 elementsRef: tabPanelRefs, 4163 children: element 4164 }) 4165 }); 4166 }); 4167 if (true) TabsRoot.displayName = "TabsRoot"; 4168 function findTabElement(tabMap, value) { 4169 for (const [tabElement, tabMetadata] of tabMap.entries()) { 4170 if (value === tabMetadata.value) { 4171 return tabElement; 4172 } 4173 } 4174 return null; 4175 } 4176 function computeActivationDirection(oldValue, newValue, orientation, tabMap) { 4177 if (oldValue == null || newValue == null) { 4178 return "none"; 4179 } 4180 const [positionProp, backward, forward] = orientation === "horizontal" ? ["left", "left", "right"] : ["top", "up", "down"]; 4181 const oldTab = findTabElement(tabMap, oldValue); 4182 const newTab = findTabElement(tabMap, newValue); 4183 if (oldTab == null || newTab == null) { 4184 if (oldTab !== newTab && (typeof oldValue === "number" || typeof oldValue === "string") && typeof oldValue === typeof newValue) { 4185 return newValue > oldValue ? forward : backward; 4186 } 4187 return "none"; 4188 } 4189 const oldPosition = oldTab.getBoundingClientRect()[positionProp]; 4190 const newPosition = newTab.getBoundingClientRect()[positionProp]; 4191 if (newPosition < oldPosition) { 4192 return backward; 4193 } 4194 if (newPosition > oldPosition) { 4195 return forward; 4196 } 4197 return "none"; 4198 } 4199 4200 // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs 4201 var React46 = __toESM(require_react(), 1); 4202 4203 // node_modules/@base-ui/react/tabs/list/TabsListContext.mjs 4204 var React45 = __toESM(require_react(), 1); 4205 var TabsListContext = /* @__PURE__ */ React45.createContext(void 0); 4206 if (true) TabsListContext.displayName = "TabsListContext"; 4207 function useTabsListContext() { 4208 const context = React45.useContext(TabsListContext); 4209 if (context === void 0) { 4210 throw new Error(true ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage_default(65)); 4211 } 4212 return context; 4213 } 4214 4215 // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs 4216 var TabsTab = /* @__PURE__ */ React46.forwardRef(function TabsTab2(componentProps, forwardedRef) { 4217 const { 4218 className, 4219 disabled: disabled2 = false, 4220 render, 4221 value, 4222 id: idProp, 4223 nativeButton = true, 4224 style, 4225 ...elementProps 4226 } = componentProps; 4227 const { 4228 value: activeTabValue, 4229 getTabPanelIdByValue, 4230 onValueChange, 4231 orientation, 4232 tabActivationDirection 4233 } = useTabsRootContext(); 4234 const { 4235 activateOnFocus, 4236 registerTabResizeObserverElement, 4237 tabsListElement 4238 } = useTabsListContext(); 4239 const { 4240 highlightedIndex, 4241 onHighlightedIndexChange 4242 } = useCompositeRootContext(); 4243 const id = useBaseUiId(idProp); 4244 const tabMetadata = React46.useMemo(() => ({ 4245 disabled: disabled2, 4246 id, 4247 value 4248 }), [disabled2, id, value]); 4249 const { 4250 compositeProps, 4251 compositeRef, 4252 index 4253 // hook is used instead of the CompositeItem component 4254 // because the index is needed for Tab internals 4255 } = useCompositeItem({ 4256 metadata: tabMetadata 4257 }); 4258 const active = value === activeTabValue; 4259 const isNavigatingRef = React46.useRef(false); 4260 const unobserveTabElementRef = React46.useRef(null); 4261 const observeTabElement = useStableCallback((element2) => { 4262 unobserveTabElementRef.current?.(); 4263 unobserveTabElementRef.current = element2 ? registerTabResizeObserverElement(element2) : null; 4264 }); 4265 useIsoLayoutEffect(() => { 4266 if (isNavigatingRef.current) { 4267 isNavigatingRef.current = false; 4268 return; 4269 } 4270 if (!(active && index > -1 && highlightedIndex !== index)) { 4271 return; 4272 } 4273 const listElement = tabsListElement; 4274 if (listElement != null) { 4275 const activeEl = activeElement(ownerDocument(listElement)); 4276 if (activeEl && contains(listElement, activeEl)) { 4277 return; 4278 } 4279 } 4280 if (!disabled2) { 4281 onHighlightedIndexChange(index); 4282 } 4283 }, [active, index, highlightedIndex, onHighlightedIndexChange, disabled2, tabsListElement]); 4284 const { 4285 getButtonProps, 4286 buttonRef 4287 } = useButton({ 4288 disabled: disabled2, 4289 native: nativeButton, 4290 focusableWhenDisabled: true 4291 }); 4292 const tabPanelId = getTabPanelIdByValue(value); 4293 const isPressingRef = React46.useRef(false); 4294 const isMainButtonRef = React46.useRef(false); 4295 function activate(event) { 4296 onValueChange(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, { 4297 activationDirection: "none" 4298 })); 4299 } 4300 function onClick(event) { 4301 if (active || disabled2) { 4302 return; 4303 } 4304 activate(event); 4305 } 4306 function onFocus(event) { 4307 if (active || disabled2) { 4308 return; 4309 } 4310 if (activateOnFocus && (!isPressingRef.current || // keyboard or touch focus 4311 isMainButtonRef.current)) { 4312 activate(event); 4313 } 4314 } 4315 function onPointerDown(event) { 4316 if (active || disabled2) { 4317 return; 4318 } 4319 isPressingRef.current = true; 4320 isMainButtonRef.current = event.button === 0; 4321 const doc = ownerDocument(event.currentTarget); 4322 function handlePointerEnd() { 4323 isPressingRef.current = false; 4324 isMainButtonRef.current = false; 4325 doc.removeEventListener("pointerup", handlePointerEnd); 4326 doc.removeEventListener("pointercancel", handlePointerEnd); 4327 } 4328 doc.addEventListener("pointerup", handlePointerEnd); 4329 doc.addEventListener("pointercancel", handlePointerEnd); 4330 } 4331 const state = { 4332 disabled: disabled2, 4333 active, 4334 orientation, 4335 tabActivationDirection 4336 }; 4337 const element = useRenderElement("button", componentProps, { 4338 state, 4339 ref: [forwardedRef, buttonRef, compositeRef, observeTabElement], 4340 props: [compositeProps, { 4341 role: "tab", 4342 "aria-controls": tabPanelId, 4343 "aria-selected": active, 4344 id, 4345 onClick, 4346 onFocus, 4347 onPointerDown, 4348 [ACTIVE_COMPOSITE_ITEM]: active ? "" : void 0, 4349 onKeyDownCapture() { 4350 isNavigatingRef.current = true; 4351 } 4352 }, elementProps, getButtonProps], 4353 stateAttributesMapping: tabsStateAttributesMapping 4354 }); 4355 return element; 4356 }); 4357 if (true) TabsTab.displayName = "TabsTab"; 4358 4359 // node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs 4360 var React47 = __toESM(require_react(), 1); 4361 var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); 4362 var _PrehydrationScript; 4363 var stateAttributesMapping2 = { 4364 ...tabsStateAttributesMapping, 4365 activeTabPosition: () => null, 4366 activeTabSize: () => null 4367 }; 4368 var TabsIndicator = /* @__PURE__ */ React47.forwardRef(function TabsIndicator2(componentProps, forwardedRef) { 4369 const { 4370 className, 4371 render, 4372 renderBeforeHydration = false, 4373 style: styleProp, 4374 ...elementProps 4375 } = componentProps; 4376 const { 4377 getTabElementBySelectedValue, 4378 orientation, 4379 tabActivationDirection, 4380 value 4381 } = useTabsRootContext(); 4382 const { 4383 tabsListElement, 4384 registerIndicatorUpdateListener 4385 } = useTabsListContext(); 4386 const rerender = useForcedRerendering(); 4387 React47.useEffect(() => { 4388 return registerIndicatorUpdateListener(rerender); 4389 }, [registerIndicatorUpdateListener, rerender]); 4390 let left = 0; 4391 let right = 0; 4392 let top = 0; 4393 let bottom = 0; 4394 let width = 0; 4395 let height = 0; 4396 let isTabSelected = false; 4397 if (value != null && tabsListElement != null) { 4398 const activeTab = getTabElementBySelectedValue(value); 4399 if (activeTab != null) { 4400 isTabSelected = true; 4401 const { 4402 width: computedWidth, 4403 height: computedHeight 4404 } = getCssDimensions(activeTab); 4405 const { 4406 width: tabListWidth, 4407 height: tabListHeight 4408 } = getCssDimensions(tabsListElement); 4409 const tabRect = activeTab.getBoundingClientRect(); 4410 const tabsListRect = tabsListElement.getBoundingClientRect(); 4411 const scaleX = tabListWidth > 0 ? tabsListRect.width / tabListWidth : 1; 4412 const scaleY = tabListHeight > 0 ? tabsListRect.height / tabListHeight : 1; 4413 const hasNonZeroScale = scaleX > Number.EPSILON && scaleY > Number.EPSILON; 4414 if (hasNonZeroScale) { 4415 const tabLeftDelta = tabRect.left - tabsListRect.left; 4416 const tabTopDelta = tabRect.top - tabsListRect.top; 4417 left = tabLeftDelta / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft; 4418 top = tabTopDelta / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop; 4419 } else { 4420 left = activeTab.offsetLeft; 4421 top = activeTab.offsetTop; 4422 } 4423 width = computedWidth; 4424 height = computedHeight; 4425 right = tabsListElement.scrollWidth - left - width; 4426 bottom = tabsListElement.scrollHeight - top - height; 4427 } 4428 } 4429 const activeTabPosition = isTabSelected ? { 4430 left, 4431 right, 4432 top, 4433 bottom 4434 } : null; 4435 const activeTabSize = isTabSelected ? { 4436 width, 4437 height 4438 } : null; 4439 const style = isTabSelected ? { 4440 "--active-tab-left": `$left}px`, 4441 "--active-tab-right": `$right}px`, 4442 "--active-tab-top": `$top}px`, 4443 "--active-tab-bottom": `$bottom}px`, 4444 "--active-tab-width": `$width}px`, 4445 "--active-tab-height": `$height}px` 4446 } : void 0; 4447 const displayIndicator = isTabSelected && width > 0 && height > 0; 4448 const state = { 4449 orientation, 4450 activeTabPosition, 4451 activeTabSize, 4452 tabActivationDirection 4453 }; 4454 const element = useRenderElement("span", componentProps, { 4455 state, 4456 ref: forwardedRef, 4457 props: [{ 4458 role: "presentation", 4459 style, 4460 hidden: !displayIndicator 4461 // do not display the indicator before the layout is settled 4462 }, elementProps, { 4463 suppressHydrationWarning: true 4464 }], 4465 stateAttributesMapping: stateAttributesMapping2 4466 }); 4467 if (value == null) { 4468 return null; 4469 } 4470 return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(React47.Fragment, { 4471 children: [element, renderBeforeHydration && (_PrehydrationScript || (_PrehydrationScript = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PrehydrationScript, { 4472 script 4473 })))] 4474 }); 4475 }); 4476 if (true) TabsIndicator.displayName = "TabsIndicator"; 4477 4478 // node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs 4479 var React48 = __toESM(require_react(), 1); 4480 var stateAttributesMapping3 = { 4481 ...tabsStateAttributesMapping, 4482 ...transitionStatusMapping 4483 }; 4484 var TabsPanel = /* @__PURE__ */ React48.forwardRef(function TabsPanel2(componentProps, forwardedRef) { 4485 const { 4486 className, 4487 value, 4488 render, 4489 keepMounted = false, 4490 style, 4491 ...elementProps 4492 } = componentProps; 4493 const { 4494 value: selectedValue, 4495 getTabIdByPanelValue, 4496 orientation, 4497 tabActivationDirection, 4498 registerMountedTabPanel 4499 } = useTabsRootContext(); 4500 const id = useBaseUiId(); 4501 const { 4502 ref: listItemRef, 4503 index 4504 } = useCompositeListItem(); 4505 const open = value === selectedValue; 4506 const { 4507 mounted, 4508 transitionStatus, 4509 setMounted 4510 } = useTransitionStatus(open); 4511 const hidden = !mounted; 4512 const correspondingTabId = getTabIdByPanelValue(value); 4513 const state = { 4514 hidden, 4515 orientation, 4516 tabActivationDirection, 4517 transitionStatus 4518 }; 4519 const panelRef = React48.useRef(null); 4520 const element = useRenderElement("div", componentProps, { 4521 state, 4522 ref: [forwardedRef, listItemRef, panelRef], 4523 props: [{ 4524 "aria-labelledby": correspondingTabId, 4525 hidden, 4526 id, 4527 role: "tabpanel", 4528 tabIndex: open ? 0 : -1, 4529 inert: inertValue(!open), 4530 // Computed key: a plain literal key fails the DOM-props excess property check. 4531 ["data-index"]: index 4532 }, elementProps], 4533 stateAttributesMapping: stateAttributesMapping3 4534 }); 4535 useOpenChangeComplete({ 4536 open, 4537 ref: panelRef, 4538 onComplete() { 4539 if (!open) { 4540 setMounted(false); 4541 } 4542 } 4543 }); 4544 useIsoLayoutEffect(() => { 4545 if (id == null || hidden && !keepMounted) { 4546 return void 0; 4547 } 4548 return registerMountedTabPanel(value, id); 4549 }, [hidden, keepMounted, value, id, registerMountedTabPanel]); 4550 const shouldRender = keepMounted || mounted; 4551 if (!shouldRender) { 4552 return null; 4553 } 4554 return element; 4555 }); 4556 if (true) TabsPanel.displayName = "TabsPanel"; 4557 4558 // node_modules/@base-ui/react/tabs/list/TabsList.mjs 4559 var React49 = __toESM(require_react(), 1); 4560 var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); 4561 var TabsList = /* @__PURE__ */ React49.forwardRef(function TabsList2(componentProps, forwardedRef) { 4562 const { 4563 activateOnFocus = false, 4564 className, 4565 loopFocus = true, 4566 render, 4567 style, 4568 ...elementProps 4569 } = componentProps; 4570 const { 4571 orientation, 4572 setTabMap, 4573 tabActivationDirection 4574 } = useTabsRootContext(); 4575 const [highlightedTabIndex, setHighlightedTabIndex] = React49.useState(0); 4576 const [tabsListElement, setTabsListElement] = React49.useState(null); 4577 const indicatorUpdateListenersRef = React49.useRef(/* @__PURE__ */ new Set()); 4578 const tabResizeObserverElementsRef = React49.useRef(/* @__PURE__ */ new Set()); 4579 const resizeObserverRef = React49.useRef(null); 4580 useIsoLayoutEffect(() => { 4581 if (typeof ResizeObserver === "undefined") { 4582 return void 0; 4583 } 4584 const resizeObserver = new ResizeObserver(() => { 4585 indicatorUpdateListenersRef.current.forEach((listener) => { 4586 listener(); 4587 }); 4588 }); 4589 resizeObserverRef.current = resizeObserver; 4590 if (tabsListElement) { 4591 resizeObserver.observe(tabsListElement); 4592 } 4593 tabResizeObserverElementsRef.current.forEach((element) => { 4594 resizeObserver.observe(element); 4595 }); 4596 return () => { 4597 resizeObserver.disconnect(); 4598 resizeObserverRef.current = null; 4599 }; 4600 }, [tabsListElement]); 4601 const registerIndicatorUpdateListener = useStableCallback((listener) => { 4602 indicatorUpdateListenersRef.current.add(listener); 4603 return () => { 4604 indicatorUpdateListenersRef.current.delete(listener); 4605 }; 4606 }); 4607 const registerTabResizeObserverElement = useStableCallback((element) => { 4608 tabResizeObserverElementsRef.current.add(element); 4609 resizeObserverRef.current?.observe(element); 4610 return () => { 4611 tabResizeObserverElementsRef.current.delete(element); 4612 resizeObserverRef.current?.unobserve(element); 4613 }; 4614 }); 4615 const state = { 4616 orientation, 4617 tabActivationDirection 4618 }; 4619 const defaultProps = { 4620 "aria-orientation": orientation === "vertical" ? "vertical" : void 0, 4621 role: "tablist" 4622 }; 4623 const tabsListContextValue = React49.useMemo(() => ({ 4624 activateOnFocus, 4625 registerIndicatorUpdateListener, 4626 registerTabResizeObserverElement, 4627 tabsListElement 4628 }), [activateOnFocus, registerIndicatorUpdateListener, registerTabResizeObserverElement, tabsListElement]); 4629 return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TabsListContext.Provider, { 4630 value: tabsListContextValue, 4631 children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CompositeRoot, { 4632 render, 4633 className, 4634 style, 4635 state, 4636 refs: [forwardedRef, setTabsListElement], 4637 props: [defaultProps, elementProps], 4638 stateAttributesMapping: tabsStateAttributesMapping, 4639 highlightedIndex: highlightedTabIndex, 4640 enableHomeAndEndKeys: true, 4641 loopFocus, 4642 orientation, 4643 onHighlightedIndexChange: setHighlightedTabIndex, 4644 onMapChange: setTabMap, 4645 disabledIndices: EMPTY_ARRAY 4646 }) 4647 }); 4648 }); 4649 if (true) TabsList.displayName = "TabsList"; 4650 4651 // node_modules/@base-ui/react/use-render/useRender.mjs 4652 function useRender(params) { 4653 return useRenderElement(params.defaultTagName ?? "div", params, params); 4654 } 4655 4656 // packages/ui/build-module/utils/direction-provider.mjs 4657 var import_i18n3 = __toESM(require_i18n(), 1); 4658 var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); 4659 function DirectionProvider3({ children }) { 4660 return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DirectionProvider, { direction: (0, import_i18n3.isRTL)() ? "rtl" : "ltr", children }); 4661 } 4662 4663 // packages/ui/build-module/link/link.mjs 4664 var import_element2 = __toESM(require_element(), 1); 4665 var import_i18n4 = __toESM(require_i18n(), 1); 4666 var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); 4667 var STYLE_HASH_ATTRIBUTE = "data-wp-hash"; 4668 function getRuntime() { 4669 const globalScope = globalThis; 4670 if (globalScope.__wpStyleRuntime) { 4671 return globalScope.__wpStyleRuntime; 4672 } 4673 globalScope.__wpStyleRuntime = { 4674 documents: /* @__PURE__ */ new Map(), 4675 styles: /* @__PURE__ */ new Map(), 4676 injectedStyles: /* @__PURE__ */ new WeakMap() 4677 }; 4678 if (typeof document !== "undefined") { 4679 registerDocument(document); 4680 } 4681 return globalScope.__wpStyleRuntime; 4682 } 4683 function documentContainsStyleHash(targetDocument, hash) { 4684 if (!targetDocument.head) { 4685 return false; 4686 } 4687 for (const style of targetDocument.head.querySelectorAll( 4688 `style[$STYLE_HASH_ATTRIBUTE}]` 4689 )) { 4690 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) { 4691 return true; 4692 } 4693 } 4694 return false; 4695 } 4696 function injectStyle(targetDocument, hash, css) { 4697 if (!targetDocument.head) { 4698 return; 4699 } 4700 const runtime = getRuntime(); 4701 let injectedStyles = runtime.injectedStyles.get(targetDocument); 4702 if (!injectedStyles) { 4703 injectedStyles = /* @__PURE__ */ new Set(); 4704 runtime.injectedStyles.set(targetDocument, injectedStyles); 4705 } 4706 if (injectedStyles.has(hash)) { 4707 return; 4708 } 4709 if (documentContainsStyleHash(targetDocument, hash)) { 4710 injectedStyles.add(hash); 4711 return; 4712 } 4713 const style = targetDocument.createElement("style"); 4714 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash); 4715 style.appendChild(targetDocument.createTextNode(css)); 4716 targetDocument.head.appendChild(style); 4717 injectedStyles.add(hash); 4718 } 4719 function registerDocument(targetDocument) { 4720 const runtime = getRuntime(); 4721 runtime.documents.set( 4722 targetDocument, 4723 (runtime.documents.get(targetDocument) ?? 0) + 1 4724 ); 4725 for (const [hash, css] of runtime.styles) { 4726 injectStyle(targetDocument, hash, css); 4727 } 4728 return () => { 4729 const count = runtime.documents.get(targetDocument); 4730 if (count === void 0) { 4731 return; 4732 } 4733 if (count <= 1) { 4734 runtime.documents.delete(targetDocument); 4735 return; 4736 } 4737 runtime.documents.set(targetDocument, count - 1); 4738 }; 4739 } 4740 function registerStyle(hash, css) { 4741 const runtime = getRuntime(); 4742 runtime.styles.set(hash, css); 4743 for (const targetDocument of runtime.documents.keys()) { 4744 injectStyle(targetDocument, hash, css); 4745 } 4746 } 4747 if (typeof process === "undefined" || true) { 4748 registerStyle("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 4749 } 4750 var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 4751 if (typeof process === "undefined" || true) { 4752 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))}}}"); 4753 } 4754 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" }; 4755 if (typeof process === "undefined" || true) { 4756 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"}}}'); 4757 } 4758 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" }; 4759 if (typeof process === "undefined" || true) { 4760 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)}"); 4761 } 4762 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" }; 4763 var Link = (0, import_element2.forwardRef)(function Link2({ 4764 children, 4765 variant = "default", 4766 tone = "brand", 4767 openInNewTab = false, 4768 target, 4769 render, 4770 className, 4771 ...props 4772 }, ref) { 4773 const shouldShowNewTabIndicator = openInNewTab || /^_blank$/i.test(target ?? ""); 4774 const element = useRender({ 4775 render, 4776 defaultTagName: "a", 4777 ref, 4778 props: mergeProps(props, { 4779 className: clsx_default( 4780 global_css_defense_default.a, 4781 resets_default["box-sizing"], 4782 focus_module_default["outset-ring--focus-except-active"], 4783 variant !== "unstyled" && style_default.link, 4784 variant !== "unstyled" && style_default[`is-$tone}`], 4785 variant === "unstyled" && style_default["is-unstyled"], 4786 className 4787 ), 4788 target: target ?? (openInNewTab ? "_blank" : void 0), 4789 children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [ 4790 children, 4791 shouldShowNewTabIndicator && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)( 4792 "span", 4793 { 4794 className: style_default["link-icon"], 4795 role: "img", 4796 "aria-label": ( 4797 /* translators: accessibility text appended to link text */ 4798 (0, import_i18n4.__)("(opens in a new tab)") 4799 ) 4800 } 4801 ) 4802 ] }) 4803 }) 4804 }); 4805 return element; 4806 }); 4807 4808 // packages/ui/build-module/icon/icon.mjs 4809 var import_element3 = __toESM(require_element(), 1); 4810 var import_primitives18 = __toESM(require_primitives(), 1); 4811 var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); 4812 var Icon = (0, import_element3.forwardRef)(function Icon2({ icon, size = 24, style, ...restProps }, ref) { 4813 const mergedStyle = icon.props.style || style ? { ...icon.props.style, ...style } : void 0; 4814 return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 4815 import_primitives18.SVG, 4816 { 4817 ref, 4818 ...icon.props, 4819 ...restProps, 4820 ...mergedStyle ? { style: mergedStyle } : {}, 4821 width: size, 4822 height: size 4823 } 4824 ); 4825 }); 4826 4827 // packages/ui/build-module/visually-hidden/visually-hidden.mjs 4828 var import_element4 = __toESM(require_element(), 1); 4829 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash"; 4830 function getRuntime2() { 4831 const globalScope = globalThis; 4832 if (globalScope.__wpStyleRuntime) { 4833 return globalScope.__wpStyleRuntime; 4834 } 4835 globalScope.__wpStyleRuntime = { 4836 documents: /* @__PURE__ */ new Map(), 4837 styles: /* @__PURE__ */ new Map(), 4838 injectedStyles: /* @__PURE__ */ new WeakMap() 4839 }; 4840 if (typeof document !== "undefined") { 4841 registerDocument2(document); 4842 } 4843 return globalScope.__wpStyleRuntime; 4844 } 4845 function documentContainsStyleHash2(targetDocument, hash) { 4846 if (!targetDocument.head) { 4847 return false; 4848 } 4849 for (const style of targetDocument.head.querySelectorAll( 4850 `style[$STYLE_HASH_ATTRIBUTE2}]` 4851 )) { 4852 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) { 4853 return true; 4854 } 4855 } 4856 return false; 4857 } 4858 function injectStyle2(targetDocument, hash, css) { 4859 if (!targetDocument.head) { 4860 return; 4861 } 4862 const runtime = getRuntime2(); 4863 let injectedStyles = runtime.injectedStyles.get(targetDocument); 4864 if (!injectedStyles) { 4865 injectedStyles = /* @__PURE__ */ new Set(); 4866 runtime.injectedStyles.set(targetDocument, injectedStyles); 4867 } 4868 if (injectedStyles.has(hash)) { 4869 return; 4870 } 4871 if (documentContainsStyleHash2(targetDocument, hash)) { 4872 injectedStyles.add(hash); 4873 return; 4874 } 4875 const style = targetDocument.createElement("style"); 4876 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash); 4877 style.appendChild(targetDocument.createTextNode(css)); 4878 targetDocument.head.appendChild(style); 4879 injectedStyles.add(hash); 4880 } 4881 function registerDocument2(targetDocument) { 4882 const runtime = getRuntime2(); 4883 runtime.documents.set( 4884 targetDocument, 4885 (runtime.documents.get(targetDocument) ?? 0) + 1 4886 ); 4887 for (const [hash, css] of runtime.styles) { 4888 injectStyle2(targetDocument, hash, css); 4889 } 4890 return () => { 4891 const count = runtime.documents.get(targetDocument); 4892 if (count === void 0) { 4893 return; 4894 } 4895 if (count <= 1) { 4896 runtime.documents.delete(targetDocument); 4897 return; 4898 } 4899 runtime.documents.set(targetDocument, count - 1); 4900 }; 4901 } 4902 function registerStyle2(hash, css) { 4903 const runtime = getRuntime2(); 4904 runtime.styles.set(hash, css); 4905 for (const targetDocument of runtime.documents.keys()) { 4906 injectStyle2(targetDocument, hash, css); 4907 } 4908 } 4909 if (typeof process === "undefined" || true) { 4910 registerStyle2("fa606a57ae", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}}"); 4911 } 4912 var style_default2 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" }; 4913 var VisuallyHidden = (0, import_element4.forwardRef)( 4914 function VisuallyHidden2({ render, ...restProps }, ref) { 4915 const element = useRender({ 4916 render, 4917 ref, 4918 props: mergeProps( 4919 { className: style_default2["visually-hidden"] }, 4920 restProps, 4921 { 4922 // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it. 4923 "data-visually-hidden": "" 4924 } 4925 ) 4926 }); 4927 return element; 4928 } 4929 ); 4930 4931 // packages/ui/build-module/stack/stack.mjs 4932 var import_element5 = __toESM(require_element(), 1); 4933 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash"; 4934 function getRuntime3() { 4935 const globalScope = globalThis; 4936 if (globalScope.__wpStyleRuntime) { 4937 return globalScope.__wpStyleRuntime; 4938 } 4939 globalScope.__wpStyleRuntime = { 4940 documents: /* @__PURE__ */ new Map(), 4941 styles: /* @__PURE__ */ new Map(), 4942 injectedStyles: /* @__PURE__ */ new WeakMap() 4943 }; 4944 if (typeof document !== "undefined") { 4945 registerDocument3(document); 4946 } 4947 return globalScope.__wpStyleRuntime; 4948 } 4949 function documentContainsStyleHash3(targetDocument, hash) { 4950 if (!targetDocument.head) { 4951 return false; 4952 } 4953 for (const style of targetDocument.head.querySelectorAll( 4954 `style[$STYLE_HASH_ATTRIBUTE3}]` 4955 )) { 4956 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) { 4957 return true; 4958 } 4959 } 4960 return false; 4961 } 4962 function injectStyle3(targetDocument, hash, css) { 4963 if (!targetDocument.head) { 4964 return; 4965 } 4966 const runtime = getRuntime3(); 4967 let injectedStyles = runtime.injectedStyles.get(targetDocument); 4968 if (!injectedStyles) { 4969 injectedStyles = /* @__PURE__ */ new Set(); 4970 runtime.injectedStyles.set(targetDocument, injectedStyles); 4971 } 4972 if (injectedStyles.has(hash)) { 4973 return; 4974 } 4975 if (documentContainsStyleHash3(targetDocument, hash)) { 4976 injectedStyles.add(hash); 4977 return; 4978 } 4979 const style = targetDocument.createElement("style"); 4980 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash); 4981 style.appendChild(targetDocument.createTextNode(css)); 4982 targetDocument.head.appendChild(style); 4983 injectedStyles.add(hash); 4984 } 4985 function registerDocument3(targetDocument) { 4986 const runtime = getRuntime3(); 4987 runtime.documents.set( 4988 targetDocument, 4989 (runtime.documents.get(targetDocument) ?? 0) + 1 4990 ); 4991 for (const [hash, css] of runtime.styles) { 4992 injectStyle3(targetDocument, hash, css); 4993 } 4994 return () => { 4995 const count = runtime.documents.get(targetDocument); 4996 if (count === void 0) { 4997 return; 4998 } 4999 if (count <= 1) { 5000 runtime.documents.delete(targetDocument); 5001 return; 5002 } 5003 runtime.documents.set(targetDocument, count - 1); 5004 }; 5005 } 5006 function registerStyle3(hash, css) { 5007 const runtime = getRuntime3(); 5008 runtime.styles.set(hash, css); 5009 for (const targetDocument of runtime.documents.keys()) { 5010 injectStyle3(targetDocument, hash, css); 5011 } 5012 } 5013 if (typeof process === "undefined" || true) { 5014 registerStyle3("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}"); 5015 } 5016 var style_default3 = { "stack": "_19ce0419607e1896__stack" }; 5017 var gapTokens = { 5018 xs: "var(--wpds-dimension-gap-xs, 4px)", 5019 sm: "var(--wpds-dimension-gap-sm, 8px)", 5020 md: "var(--wpds-dimension-gap-md, 12px)", 5021 lg: "var(--wpds-dimension-gap-lg, 16px)", 5022 xl: "var(--wpds-dimension-gap-xl, 24px)", 5023 "2xl": "var(--wpds-dimension-gap-2xl, 32px)", 5024 "3xl": "var(--wpds-dimension-gap-3xl, 40px)" 5025 }; 5026 var Stack = (0, import_element5.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) { 5027 const style = { 5028 gap: gap && gapTokens[gap], 5029 alignItems: align, 5030 justifyContent: justify, 5031 flexDirection: direction, 5032 flexWrap: wrap 5033 }; 5034 const element = useRender({ 5035 render, 5036 ref, 5037 props: mergeProps(props, { style, className: style_default3.stack }) 5038 }); 5039 return element; 5040 }); 5041 5042 // packages/ui/build-module/utils/use-schedule-validation.mjs 5043 var import_compose = __toESM(require_compose(), 1); 5044 var import_element6 = __toESM(require_element(), 1); 5045 function useScheduleValidation(validate) { 5046 const validateEvent = (0, import_compose.useEvent)(validate); 5047 const timerRef = (0, import_element6.useRef)(null); 5048 const unmountedRef = (0, import_element6.useRef)(false); 5049 const scheduleValidation = (0, import_element6.useCallback)(() => { 5050 if (unmountedRef.current) { 5051 return; 5052 } 5053 if (timerRef.current) { 5054 clearTimeout(timerRef.current); 5055 } 5056 timerRef.current = setTimeout(() => { 5057 validateEvent(); 5058 timerRef.current = null; 5059 }, 0); 5060 }, [validateEvent]); 5061 (0, import_element6.useEffect)(() => { 5062 unmountedRef.current = false; 5063 return () => { 5064 unmountedRef.current = true; 5065 if (timerRef.current) { 5066 clearTimeout(timerRef.current); 5067 } 5068 }; 5069 }, []); 5070 return scheduleValidation; 5071 } 5072 5073 // packages/ui/build-module/form/primitives/input/input.mjs 5074 var import_element9 = __toESM(require_element(), 1); 5075 5076 // packages/ui/build-module/form/primitives/input-layout/input-layout.mjs 5077 var import_element7 = __toESM(require_element(), 1); 5078 var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); 5079 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash"; 5080 function getRuntime4() { 5081 const globalScope = globalThis; 5082 if (globalScope.__wpStyleRuntime) { 5083 return globalScope.__wpStyleRuntime; 5084 } 5085 globalScope.__wpStyleRuntime = { 5086 documents: /* @__PURE__ */ new Map(), 5087 styles: /* @__PURE__ */ new Map(), 5088 injectedStyles: /* @__PURE__ */ new WeakMap() 5089 }; 5090 if (typeof document !== "undefined") { 5091 registerDocument4(document); 5092 } 5093 return globalScope.__wpStyleRuntime; 5094 } 5095 function documentContainsStyleHash4(targetDocument, hash) { 5096 if (!targetDocument.head) { 5097 return false; 5098 } 5099 for (const style of targetDocument.head.querySelectorAll( 5100 `style[$STYLE_HASH_ATTRIBUTE4}]` 5101 )) { 5102 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) { 5103 return true; 5104 } 5105 } 5106 return false; 5107 } 5108 function injectStyle4(targetDocument, hash, css) { 5109 if (!targetDocument.head) { 5110 return; 5111 } 5112 const runtime = getRuntime4(); 5113 let injectedStyles = runtime.injectedStyles.get(targetDocument); 5114 if (!injectedStyles) { 5115 injectedStyles = /* @__PURE__ */ new Set(); 5116 runtime.injectedStyles.set(targetDocument, injectedStyles); 5117 } 5118 if (injectedStyles.has(hash)) { 5119 return; 5120 } 5121 if (documentContainsStyleHash4(targetDocument, hash)) { 5122 injectedStyles.add(hash); 5123 return; 5124 } 5125 const style = targetDocument.createElement("style"); 5126 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash); 5127 style.appendChild(targetDocument.createTextNode(css)); 5128 targetDocument.head.appendChild(style); 5129 injectedStyles.add(hash); 5130 } 5131 function registerDocument4(targetDocument) { 5132 const runtime = getRuntime4(); 5133 runtime.documents.set( 5134 targetDocument, 5135 (runtime.documents.get(targetDocument) ?? 0) + 1 5136 ); 5137 for (const [hash, css] of runtime.styles) { 5138 injectStyle4(targetDocument, hash, css); 5139 } 5140 return () => { 5141 const count = runtime.documents.get(targetDocument); 5142 if (count === void 0) { 5143 return; 5144 } 5145 if (count <= 1) { 5146 runtime.documents.delete(targetDocument); 5147 return; 5148 } 5149 runtime.documents.set(targetDocument, count - 1); 5150 }; 5151 } 5152 function registerStyle4(hash, css) { 5153 const runtime = getRuntime4(); 5154 runtime.styles.set(hash, css); 5155 for (const targetDocument of runtime.documents.keys()) { 5156 injectStyle4(targetDocument, hash, css); 5157 } 5158 } 5159 if (typeof process === "undefined" || true) { 5160 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)}"); 5161 } 5162 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" }; 5163 if (typeof process === "undefined" || true) { 5164 registerStyle4("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 5165 } 5166 var resets_default2 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 5167 if (typeof process === "undefined" || true) { 5168 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))}}}}'); 5169 } 5170 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" }; 5171 var InputLayout = (0, import_element7.forwardRef)( 5172 function InputLayout2({ 5173 className, 5174 children, 5175 visuallyDisabled, 5176 size = "default", 5177 isBorderless, 5178 prefix, 5179 suffix, 5180 ...restProps 5181 }, ref) { 5182 return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)( 5183 "div", 5184 { 5185 ref, 5186 className: clsx_default( 5187 global_css_defense_default2.div, 5188 resets_default2["box-sizing"], 5189 style_default4["input-layout"], 5190 style_default4[`is-size-$size}`], 5191 visuallyDisabled && style_default4["is-disabled"], 5192 isBorderless && style_default4["is-borderless"], 5193 className 5194 ), 5195 ...restProps, 5196 children: [ 5197 import_element7.Children.count(prefix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( 5198 "div", 5199 { 5200 className: style_default4["slot-wrapper"], 5201 "data-slot-type": "prefix", 5202 children: prefix 5203 } 5204 ), 5205 children, 5206 import_element7.Children.count(suffix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( 5207 "div", 5208 { 5209 className: style_default4["slot-wrapper"], 5210 "data-slot-type": "suffix", 5211 children: suffix 5212 } 5213 ) 5214 ] 5215 } 5216 ); 5217 } 5218 ); 5219 5220 // packages/ui/build-module/form/primitives/input-layout/slot.mjs 5221 var import_element8 = __toESM(require_element(), 1); 5222 var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); 5223 var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash"; 5224 function getRuntime5() { 5225 const globalScope = globalThis; 5226 if (globalScope.__wpStyleRuntime) { 5227 return globalScope.__wpStyleRuntime; 5228 } 5229 globalScope.__wpStyleRuntime = { 5230 documents: /* @__PURE__ */ new Map(), 5231 styles: /* @__PURE__ */ new Map(), 5232 injectedStyles: /* @__PURE__ */ new WeakMap() 5233 }; 5234 if (typeof document !== "undefined") { 5235 registerDocument5(document); 5236 } 5237 return globalScope.__wpStyleRuntime; 5238 } 5239 function documentContainsStyleHash5(targetDocument, hash) { 5240 if (!targetDocument.head) { 5241 return false; 5242 } 5243 for (const style of targetDocument.head.querySelectorAll( 5244 `style[$STYLE_HASH_ATTRIBUTE5}]` 5245 )) { 5246 if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) { 5247 return true; 5248 } 5249 } 5250 return false; 5251 } 5252 function injectStyle5(targetDocument, hash, css) { 5253 if (!targetDocument.head) { 5254 return; 5255 } 5256 const runtime = getRuntime5(); 5257 let injectedStyles = runtime.injectedStyles.get(targetDocument); 5258 if (!injectedStyles) { 5259 injectedStyles = /* @__PURE__ */ new Set(); 5260 runtime.injectedStyles.set(targetDocument, injectedStyles); 5261 } 5262 if (injectedStyles.has(hash)) { 5263 return; 5264 } 5265 if (documentContainsStyleHash5(targetDocument, hash)) { 5266 injectedStyles.add(hash); 5267 return; 5268 } 5269 const style = targetDocument.createElement("style"); 5270 style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash); 5271 style.appendChild(targetDocument.createTextNode(css)); 5272 targetDocument.head.appendChild(style); 5273 injectedStyles.add(hash); 5274 } 5275 function registerDocument5(targetDocument) { 5276 const runtime = getRuntime5(); 5277 runtime.documents.set( 5278 targetDocument, 5279 (runtime.documents.get(targetDocument) ?? 0) + 1 5280 ); 5281 for (const [hash, css] of runtime.styles) { 5282 injectStyle5(targetDocument, hash, css); 5283 } 5284 return () => { 5285 const count = runtime.documents.get(targetDocument); 5286 if (count === void 0) { 5287 return; 5288 } 5289 if (count <= 1) { 5290 runtime.documents.delete(targetDocument); 5291 return; 5292 } 5293 runtime.documents.set(targetDocument, count - 1); 5294 }; 5295 } 5296 function registerStyle5(hash, css) { 5297 const runtime = getRuntime5(); 5298 runtime.styles.set(hash, css); 5299 for (const targetDocument of runtime.documents.keys()) { 5300 injectStyle5(targetDocument, hash, css); 5301 } 5302 } 5303 if (typeof process === "undefined" || true) { 5304 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))}}}}'); 5305 } 5306 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" }; 5307 var InputLayoutSlot = (0, import_element8.forwardRef)(function InputLayoutSlot2({ padding = "default", className, ...restProps }, ref) { 5308 return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( 5309 "div", 5310 { 5311 ref, 5312 className: clsx_default( 5313 style_default5["input-layout-slot"], 5314 style_default5[`is-padding-$padding}`], 5315 className 5316 ), 5317 ...restProps 5318 } 5319 ); 5320 }); 5321 InputLayoutSlot.displayName = "InputLayout.Slot"; 5322 5323 // packages/ui/build-module/form/primitives/input-layout/index.mjs 5324 var InputLayout3 = Object.assign(InputLayout, { 5325 Slot: InputLayoutSlot 5326 }); 5327 5328 // packages/ui/build-module/form/primitives/input/input.mjs 5329 var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); 5330 var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash"; 5331 function getRuntime6() { 5332 const globalScope = globalThis; 5333 if (globalScope.__wpStyleRuntime) { 5334 return globalScope.__wpStyleRuntime; 5335 } 5336 globalScope.__wpStyleRuntime = { 5337 documents: /* @__PURE__ */ new Map(), 5338 styles: /* @__PURE__ */ new Map(), 5339 injectedStyles: /* @__PURE__ */ new WeakMap() 5340 }; 5341 if (typeof document !== "undefined") { 5342 registerDocument6(document); 5343 } 5344 return globalScope.__wpStyleRuntime; 5345 } 5346 function documentContainsStyleHash6(targetDocument, hash) { 5347 if (!targetDocument.head) { 5348 return false; 5349 } 5350 for (const style of targetDocument.head.querySelectorAll( 5351 `style[$STYLE_HASH_ATTRIBUTE6}]` 5352 )) { 5353 if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) { 5354 return true; 5355 } 5356 } 5357 return false; 5358 } 5359 function injectStyle6(targetDocument, hash, css) { 5360 if (!targetDocument.head) { 5361 return; 5362 } 5363 const runtime = getRuntime6(); 5364 let injectedStyles = runtime.injectedStyles.get(targetDocument); 5365 if (!injectedStyles) { 5366 injectedStyles = /* @__PURE__ */ new Set(); 5367 runtime.injectedStyles.set(targetDocument, injectedStyles); 5368 } 5369 if (injectedStyles.has(hash)) { 5370 return; 5371 } 5372 if (documentContainsStyleHash6(targetDocument, hash)) { 5373 injectedStyles.add(hash); 5374 return; 5375 } 5376 const style = targetDocument.createElement("style"); 5377 style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash); 5378 style.appendChild(targetDocument.createTextNode(css)); 5379 targetDocument.head.appendChild(style); 5380 injectedStyles.add(hash); 5381 } 5382 function registerDocument6(targetDocument) { 5383 const runtime = getRuntime6(); 5384 runtime.documents.set( 5385 targetDocument, 5386 (runtime.documents.get(targetDocument) ?? 0) + 1 5387 ); 5388 for (const [hash, css] of runtime.styles) { 5389 injectStyle6(targetDocument, hash, css); 5390 } 5391 return () => { 5392 const count = runtime.documents.get(targetDocument); 5393 if (count === void 0) { 5394 return; 5395 } 5396 if (count <= 1) { 5397 runtime.documents.delete(targetDocument); 5398 return; 5399 } 5400 runtime.documents.set(targetDocument, count - 1); 5401 }; 5402 } 5403 function registerStyle6(hash, css) { 5404 const runtime = getRuntime6(); 5405 runtime.styles.set(hash, css); 5406 for (const targetDocument of runtime.documents.keys()) { 5407 injectStyle6(targetDocument, hash, css); 5408 } 5409 } 5410 if (typeof process === "undefined" || true) { 5411 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)}"); 5412 } 5413 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" }; 5414 if (typeof process === "undefined" || true) { 5415 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))}}}"); 5416 } 5417 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" }; 5418 if (typeof process === "undefined" || true) { 5419 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}}}}}"); 5420 } 5421 var style_default6 = { "input": "_2ae7be2fc1bb17a3__input" }; 5422 var Input3 = (0, import_element9.forwardRef)(function Input22({ className, size = "default", prefix, suffix, style, ...restProps }, ref) { 5423 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 5424 InputLayout3, 5425 { 5426 className: clsx_default( 5427 focus_module_default2["outset-ring--focus-within"], 5428 className 5429 ), 5430 style, 5431 size, 5432 visuallyDisabled: restProps.disabled, 5433 prefix, 5434 suffix, 5435 children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 5436 Input, 5437 { 5438 ref, 5439 className: clsx_default(global_css_defense_default3.input, style_default6.input), 5440 ...restProps 5441 } 5442 ) 5443 } 5444 ); 5445 }); 5446 5447 // packages/ui/build-module/form/primitives/control-with-error/control-with-error.mjs 5448 var import_i18n5 = __toESM(require_i18n(), 1); 5449 var import_element11 = __toESM(require_element(), 1); 5450 5451 // packages/ui/build-module/spinner/spinner.mjs 5452 var import_element10 = __toESM(require_element(), 1); 5453 var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); 5454 var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash"; 5455 function getRuntime7() { 5456 const globalScope = globalThis; 5457 if (globalScope.__wpStyleRuntime) { 5458 return globalScope.__wpStyleRuntime; 5459 } 5460 globalScope.__wpStyleRuntime = { 5461 documents: /* @__PURE__ */ new Map(), 5462 styles: /* @__PURE__ */ new Map(), 5463 injectedStyles: /* @__PURE__ */ new WeakMap() 5464 }; 5465 if (typeof document !== "undefined") { 5466 registerDocument7(document); 5467 } 5468 return globalScope.__wpStyleRuntime; 5469 } 5470 function documentContainsStyleHash7(targetDocument, hash) { 5471 if (!targetDocument.head) { 5472 return false; 5473 } 5474 for (const style of targetDocument.head.querySelectorAll( 5475 `style[$STYLE_HASH_ATTRIBUTE7}]` 5476 )) { 5477 if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) { 5478 return true; 5479 } 5480 } 5481 return false; 5482 } 5483 function injectStyle7(targetDocument, hash, css) { 5484 if (!targetDocument.head) { 5485 return; 5486 } 5487 const runtime = getRuntime7(); 5488 let injectedStyles = runtime.injectedStyles.get(targetDocument); 5489 if (!injectedStyles) { 5490 injectedStyles = /* @__PURE__ */ new Set(); 5491 runtime.injectedStyles.set(targetDocument, injectedStyles); 5492 } 5493 if (injectedStyles.has(hash)) { 5494 return; 5495 } 5496 if (documentContainsStyleHash7(targetDocument, hash)) { 5497 injectedStyles.add(hash); 5498 return; 5499 } 5500 const style = targetDocument.createElement("style"); 5501 style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash); 5502 style.appendChild(targetDocument.createTextNode(css)); 5503 targetDocument.head.appendChild(style); 5504 injectedStyles.add(hash); 5505 } 5506 function registerDocument7(targetDocument) { 5507 const runtime = getRuntime7(); 5508 runtime.documents.set( 5509 targetDocument, 5510 (runtime.documents.get(targetDocument) ?? 0) + 1 5511 ); 5512 for (const [hash, css] of runtime.styles) { 5513 injectStyle7(targetDocument, hash, css); 5514 } 5515 return () => { 5516 const count = runtime.documents.get(targetDocument); 5517 if (count === void 0) { 5518 return; 5519 } 5520 if (count <= 1) { 5521 runtime.documents.delete(targetDocument); 5522 return; 5523 } 5524 runtime.documents.set(targetDocument, count - 1); 5525 }; 5526 } 5527 function registerStyle7(hash, css) { 5528 const runtime = getRuntime7(); 5529 runtime.styles.set(hash, css); 5530 for (const targetDocument of runtime.documents.keys()) { 5531 injectStyle7(targetDocument, hash, css); 5532 } 5533 } 5534 if (typeof process === "undefined" || true) { 5535 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)}}}}"); 5536 } 5537 var style_default7 = { "spinner": "ab4d64c07c0ba587__spinner", "track": "dc51f80c84b35fe2__track", "indicator": "a7654e10245bb7d2__indicator", "spinner-spin": "_02322d973909703c__spinner-spin" }; 5538 var Spinner = (0, import_element10.forwardRef)( 5539 function Spinner2({ className, ...props }, ref) { 5540 return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)( 5541 "svg", 5542 { 5543 className: clsx_default(style_default7.spinner, className), 5544 viewBox: "0 0 100 100", 5545 xmlns: "http://www.w3.org/2000/svg", 5546 role: "presentation", 5547 focusable: "false", 5548 ...props, 5549 ref, 5550 children: [ 5551 /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( 5552 "circle", 5553 { 5554 className: style_default7.track, 5555 cx: "50", 5556 cy: "50", 5557 r: "50", 5558 vectorEffect: "non-scaling-stroke" 5559 } 5560 ), 5561 /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( 5562 "path", 5563 { 5564 className: style_default7.indicator, 5565 d: "m 50 0 a 50 50 0 0 1 50 50", 5566 vectorEffect: "non-scaling-stroke" 5567 } 5568 ) 5569 ] 5570 } 5571 ); 5572 } 5573 ); 5574 5575 // packages/ui/build-module/form/primitives/validity-indicator/validity-indicator.mjs 5576 var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); 5577 var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash"; 5578 function getRuntime8() { 5579 const globalScope = globalThis; 5580 if (globalScope.__wpStyleRuntime) { 5581 return globalScope.__wpStyleRuntime; 5582 } 5583 globalScope.__wpStyleRuntime = { 5584 documents: /* @__PURE__ */ new Map(), 5585 styles: /* @__PURE__ */ new Map(), 5586 injectedStyles: /* @__PURE__ */ new WeakMap() 5587 }; 5588 if (typeof document !== "undefined") { 5589 registerDocument8(document); 5590 } 5591 return globalScope.__wpStyleRuntime; 5592 } 5593 function documentContainsStyleHash8(targetDocument, hash) { 5594 if (!targetDocument.head) { 5595 return false; 5596 } 5597 for (const style of targetDocument.head.querySelectorAll( 5598 `style[$STYLE_HASH_ATTRIBUTE8}]` 5599 )) { 5600 if (style.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) { 5601 return true; 5602 } 5603 } 5604 return false; 5605 } 5606 function injectStyle8(targetDocument, hash, css) { 5607 if (!targetDocument.head) { 5608 return; 5609 } 5610 const runtime = getRuntime8(); 5611 let injectedStyles = runtime.injectedStyles.get(targetDocument); 5612 if (!injectedStyles) { 5613 injectedStyles = /* @__PURE__ */ new Set(); 5614 runtime.injectedStyles.set(targetDocument, injectedStyles); 5615 } 5616 if (injectedStyles.has(hash)) { 5617 return; 5618 } 5619 if (documentContainsStyleHash8(targetDocument, hash)) { 5620 injectedStyles.add(hash); 5621 return; 5622 } 5623 const style = targetDocument.createElement("style"); 5624 style.setAttribute(STYLE_HASH_ATTRIBUTE8, hash); 5625 style.appendChild(targetDocument.createTextNode(css)); 5626 targetDocument.head.appendChild(style); 5627 injectedStyles.add(hash); 5628 } 5629 function registerDocument8(targetDocument) { 5630 const runtime = getRuntime8(); 5631 runtime.documents.set( 5632 targetDocument, 5633 (runtime.documents.get(targetDocument) ?? 0) + 1 5634 ); 5635 for (const [hash, css] of runtime.styles) { 5636 injectStyle8(targetDocument, hash, css); 5637 } 5638 return () => { 5639 const count = runtime.documents.get(targetDocument); 5640 if (count === void 0) { 5641 return; 5642 } 5643 if (count <= 1) { 5644 runtime.documents.delete(targetDocument); 5645 return; 5646 } 5647 runtime.documents.set(targetDocument, count - 1); 5648 }; 5649 } 5650 function registerStyle8(hash, css) { 5651 const runtime = getRuntime8(); 5652 runtime.styles.set(hash, css); 5653 for (const targetDocument of runtime.documents.keys()) { 5654 injectStyle8(targetDocument, hash, css); 5655 } 5656 } 5657 if (typeof process === "undefined" || true) { 5658 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)}"); 5659 } 5660 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" }; 5661 if (typeof process === "undefined" || true) { 5662 registerStyle8("bd510b0d40", '@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,#007f2f)}.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)}}}}'); 5663 } 5664 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" }; 5665 var ICON = { 5666 valid: published_default, 5667 invalid: error_default 5668 }; 5669 function ValidityIndicator({ 5670 id, 5671 type, 5672 message 5673 }) { 5674 return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)( 5675 "p", 5676 { 5677 id, 5678 className: clsx_default( 5679 global_css_defense_default4.p, 5680 style_default8.indicator, 5681 style_default8[`is-$type}`] 5682 ), 5683 children: [ 5684 type === "validating" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Spinner, { className: style_default8["indicator-spinner"] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)( 5685 Icon, 5686 { 5687 className: style_default8["indicator-icon"], 5688 icon: ICON[type], 5689 size: 16, 5690 fill: "currentColor" 5691 } 5692 ), 5693 message 5694 ] 5695 } 5696 ); 5697 } 5698 5699 // packages/ui/build-module/form/primitives/control-with-error/control-with-error.mjs 5700 var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); 5701 var DEFAULT_RENDER = (props) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Stack, { ...props, direction: "column", gap: "sm" }); 5702 function appendRequiredIndicator(label, required, markWhenOptional) { 5703 let suffix; 5704 if (required && !markWhenOptional) { 5705 suffix = `(${(0, import_i18n5.__)("Required")})`; 5706 } else if (!required && markWhenOptional) { 5707 suffix = `(${(0, import_i18n5.__)("Optional")})`; 5708 } 5709 if (!suffix) { 5710 return label; 5711 } 5712 if (typeof label === "string") { 5713 return `$label} $suffix}`; 5714 } 5715 return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [ 5716 label, 5717 " ", 5718 suffix 5719 ] }); 5720 } 5721 var VALIDITY_VISIBLE_ATTRIBUTE = "data-validity-visible"; 5722 var ControlWithError = (0, import_element11.forwardRef)(function ControlWithError2({ 5723 required, 5724 markWhenOptional, 5725 customValidity, 5726 getValidityTarget, 5727 children, 5728 render = DEFAULT_RENDER, 5729 ...restProps 5730 }, forwardedRef) { 5731 const [errorMessage, setErrorMessage] = (0, import_element11.useState)(); 5732 const [statusMessage, setStatusMessage] = (0, import_element11.useState)(); 5733 const [showMessage, setShowMessage] = (0, import_element11.useState)(false); 5734 const [isTouched, setIsTouched] = (0, import_element11.useState)(false); 5735 const wrapperRef = (0, import_element11.useRef)(null); 5736 (0, import_element11.useEffect)(() => { 5737 const validityTarget = getValidityTarget(); 5738 const handler = () => { 5739 if (customValidity?.type !== "validating") { 5740 setErrorMessage(validityTarget?.validationMessage); 5741 } 5742 setShowMessage(true); 5743 validityTarget?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, ""); 5744 }; 5745 validityTarget?.addEventListener("invalid", handler); 5746 return () => validityTarget?.removeEventListener("invalid", handler); 5747 }, [customValidity?.type, getValidityTarget]); 5748 (0, import_element11.useEffect)(() => { 5749 const validityTarget = getValidityTarget(); 5750 const suppressNativePopover = (event) => { 5751 event.preventDefault(); 5752 if (!event.isTrusted) { 5753 return; 5754 } 5755 const target = event.target; 5756 const firstErrorInForm = Array.from( 5757 target.form?.elements ?? [] 5758 ).find((el) => !el.validity.valid); 5759 if (!target.form || firstErrorInForm === target) { 5760 target.focus(); 5761 } 5762 }; 5763 const radioSiblings = validityTarget?.type === "radio" && validityTarget?.name ? Array.from( 5764 wrapperRef.current?.querySelectorAll( 5765 `input[type="radio"][name="$validityTarget?.name}"]` 5766 ) ?? [] 5767 ).filter((sibling) => sibling !== validityTarget) : []; 5768 validityTarget?.addEventListener("invalid", suppressNativePopover); 5769 radioSiblings.forEach( 5770 (sibling) => sibling.addEventListener("invalid", suppressNativePopover) 5771 ); 5772 return () => { 5773 validityTarget?.removeEventListener( 5774 "invalid", 5775 suppressNativePopover 5776 ); 5777 radioSiblings.forEach( 5778 (sibling) => sibling.removeEventListener("invalid", suppressNativePopover) 5779 ); 5780 }; 5781 }, [getValidityTarget]); 5782 (0, import_element11.useEffect)(() => { 5783 const validityTarget = getValidityTarget(); 5784 if (!customValidity?.type) { 5785 validityTarget?.setCustomValidity(""); 5786 setErrorMessage(validityTarget?.validationMessage); 5787 setStatusMessage(void 0); 5788 return; 5789 } 5790 switch (customValidity.type) { 5791 case "validating": { 5792 validityTarget?.setCustomValidity(""); 5793 setErrorMessage(void 0); 5794 setStatusMessage({ 5795 type: "validating", 5796 message: customValidity.message 5797 }); 5798 break; 5799 } 5800 case "valid": { 5801 validityTarget?.setCustomValidity(""); 5802 setErrorMessage(validityTarget?.validationMessage); 5803 setStatusMessage({ 5804 type: "valid", 5805 message: customValidity.message 5806 }); 5807 break; 5808 } 5809 case "invalid": { 5810 validityTarget?.setCustomValidity( 5811 customValidity.message ?? "" 5812 ); 5813 setErrorMessage(validityTarget?.validationMessage); 5814 setStatusMessage(void 0); 5815 break; 5816 } 5817 } 5818 }, [customValidity, getValidityTarget]); 5819 (0, import_element11.useEffect)(() => { 5820 if (!isTouched || showMessage) { 5821 return; 5822 } 5823 if (customValidity?.type === "validating") { 5824 const timer = setTimeout(() => { 5825 setShowMessage(true); 5826 }, 1e3); 5827 return () => clearTimeout(timer); 5828 } 5829 setShowMessage(true); 5830 }, [isTouched, customValidity?.type, showMessage]); 5831 const onBlur = (event) => { 5832 if (event.relatedTarget && event.currentTarget.contains(event.relatedTarget)) { 5833 return; 5834 } 5835 if (!isTouched) { 5836 setIsTouched(true); 5837 getValidityTarget()?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, ""); 5838 } 5839 const validityTarget = getValidityTarget(); 5840 const isValidating = customValidity?.type === "validating"; 5841 window.queueMicrotask(() => { 5842 if (!isValidating) { 5843 setErrorMessage(validityTarget?.validationMessage); 5844 } 5845 }); 5846 }; 5847 const messageId = (0, import_element11.useId)(); 5848 const message = (() => { 5849 if (errorMessage) { 5850 return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( 5851 ValidityIndicator, 5852 { 5853 id: messageId, 5854 type: "invalid", 5855 message: errorMessage 5856 } 5857 ); 5858 } 5859 if (statusMessage?.type) { 5860 return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( 5861 ValidityIndicator, 5862 { 5863 id: messageId, 5864 type: statusMessage.type, 5865 message: statusMessage.message 5866 } 5867 ); 5868 } 5869 return null; 5870 })(); 5871 const visibleMessage = showMessage ? message : null; 5872 (0, import_element11.useEffect)(() => { 5873 const target = getValidityTarget(); 5874 if (!target) { 5875 return; 5876 } 5877 function setDescribedBy(el, shouldAdd) { 5878 const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter((id) => id && id !== messageId); 5879 if (shouldAdd) { 5880 ids.push(messageId); 5881 } 5882 if (ids.length) { 5883 el.setAttribute("aria-describedby", ids.join(" ")); 5884 } else { 5885 el.removeAttribute("aria-describedby"); 5886 } 5887 } 5888 setDescribedBy(target, !!visibleMessage); 5889 return () => setDescribedBy(target, false); 5890 }, [visibleMessage, messageId, getValidityTarget]); 5891 return useRender({ 5892 render, 5893 ref: [forwardedRef, wrapperRef], 5894 props: mergeProps(restProps, { 5895 onBlur, 5896 children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [ 5897 (0, import_element11.cloneElement)(children, { 5898 label: appendRequiredIndicator( 5899 children.props.label, 5900 required, 5901 markWhenOptional 5902 ), 5903 required 5904 }), 5905 visibleMessage 5906 ] }) 5907 }) 5908 }); 5909 }); 5910 5911 // packages/ui/build-module/form/primitives/field/index.mjs 5912 var field_exports = {}; 5913 __export(field_exports, { 5914 Control: () => Control, 5915 Description: () => Description, 5916 Details: () => Details, 5917 Item: () => Item, 5918 Label: () => Label, 5919 Root: () => Root, 5920 VisualLabel: () => VisualLabel 5921 }); 5922 5923 // packages/ui/build-module/form/primitives/field/root.mjs 5924 var import_element12 = __toESM(require_element(), 1); 5925 var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1); 5926 var STYLE_HASH_ATTRIBUTE9 = "data-wp-hash"; 5927 function getRuntime9() { 5928 const globalScope = globalThis; 5929 if (globalScope.__wpStyleRuntime) { 5930 return globalScope.__wpStyleRuntime; 5931 } 5932 globalScope.__wpStyleRuntime = { 5933 documents: /* @__PURE__ */ new Map(), 5934 styles: /* @__PURE__ */ new Map(), 5935 injectedStyles: /* @__PURE__ */ new WeakMap() 5936 }; 5937 if (typeof document !== "undefined") { 5938 registerDocument9(document); 5939 } 5940 return globalScope.__wpStyleRuntime; 5941 } 5942 function documentContainsStyleHash9(targetDocument, hash) { 5943 if (!targetDocument.head) { 5944 return false; 5945 } 5946 for (const style of targetDocument.head.querySelectorAll( 5947 `style[$STYLE_HASH_ATTRIBUTE9}]` 5948 )) { 5949 if (style.getAttribute(STYLE_HASH_ATTRIBUTE9) === hash) { 5950 return true; 5951 } 5952 } 5953 return false; 5954 } 5955 function injectStyle9(targetDocument, hash, css) { 5956 if (!targetDocument.head) { 5957 return; 5958 } 5959 const runtime = getRuntime9(); 5960 let injectedStyles = runtime.injectedStyles.get(targetDocument); 5961 if (!injectedStyles) { 5962 injectedStyles = /* @__PURE__ */ new Set(); 5963 runtime.injectedStyles.set(targetDocument, injectedStyles); 5964 } 5965 if (injectedStyles.has(hash)) { 5966 return; 5967 } 5968 if (documentContainsStyleHash9(targetDocument, hash)) { 5969 injectedStyles.add(hash); 5970 return; 5971 } 5972 const style = targetDocument.createElement("style"); 5973 style.setAttribute(STYLE_HASH_ATTRIBUTE9, hash); 5974 style.appendChild(targetDocument.createTextNode(css)); 5975 targetDocument.head.appendChild(style); 5976 injectedStyles.add(hash); 5977 } 5978 function registerDocument9(targetDocument) { 5979 const runtime = getRuntime9(); 5980 runtime.documents.set( 5981 targetDocument, 5982 (runtime.documents.get(targetDocument) ?? 0) + 1 5983 ); 5984 for (const [hash, css] of runtime.styles) { 5985 injectStyle9(targetDocument, hash, css); 5986 } 5987 return () => { 5988 const count = runtime.documents.get(targetDocument); 5989 if (count === void 0) { 5990 return; 5991 } 5992 if (count <= 1) { 5993 runtime.documents.delete(targetDocument); 5994 return; 5995 } 5996 runtime.documents.set(targetDocument, count - 1); 5997 }; 5998 } 5999 function registerStyle9(hash, css) { 6000 const runtime = getRuntime9(); 6001 runtime.styles.set(hash, css); 6002 for (const targetDocument of runtime.documents.keys()) { 6003 injectStyle9(targetDocument, hash, css); 6004 } 6005 } 6006 if (typeof process === "undefined" || true) { 6007 registerStyle9("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 6008 } 6009 var resets_default3 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 6010 var DEFAULT_RENDER2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Stack, { ...props, direction: "column", gap: "sm" }); 6011 var Root = (0, import_element12.forwardRef)(function Root2({ className, render = DEFAULT_RENDER2, ...restProps }, ref) { 6012 return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( 6013 index_parts_exports.Root, 6014 { 6015 ref, 6016 className: clsx_default(resets_default3["box-sizing"], className), 6017 render, 6018 ...restProps 6019 } 6020 ); 6021 }); 6022 6023 // packages/ui/build-module/form/primitives/field/item.mjs 6024 var import_element13 = __toESM(require_element(), 1); 6025 var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1); 6026 var Item = (0, import_element13.forwardRef)(function Item2(props, ref) { 6027 return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(index_parts_exports.Item, { ref, ...props }); 6028 }); 6029 6030 // packages/ui/build-module/form/primitives/field/label.mjs 6031 var import_element14 = __toESM(require_element(), 1); 6032 var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1); 6033 var STYLE_HASH_ATTRIBUTE10 = "data-wp-hash"; 6034 function getRuntime10() { 6035 const globalScope = globalThis; 6036 if (globalScope.__wpStyleRuntime) { 6037 return globalScope.__wpStyleRuntime; 6038 } 6039 globalScope.__wpStyleRuntime = { 6040 documents: /* @__PURE__ */ new Map(), 6041 styles: /* @__PURE__ */ new Map(), 6042 injectedStyles: /* @__PURE__ */ new WeakMap() 6043 }; 6044 if (typeof document !== "undefined") { 6045 registerDocument10(document); 6046 } 6047 return globalScope.__wpStyleRuntime; 6048 } 6049 function documentContainsStyleHash10(targetDocument, hash) { 6050 if (!targetDocument.head) { 6051 return false; 6052 } 6053 for (const style of targetDocument.head.querySelectorAll( 6054 `style[$STYLE_HASH_ATTRIBUTE10}]` 6055 )) { 6056 if (style.getAttribute(STYLE_HASH_ATTRIBUTE10) === hash) { 6057 return true; 6058 } 6059 } 6060 return false; 6061 } 6062 function injectStyle10(targetDocument, hash, css) { 6063 if (!targetDocument.head) { 6064 return; 6065 } 6066 const runtime = getRuntime10(); 6067 let injectedStyles = runtime.injectedStyles.get(targetDocument); 6068 if (!injectedStyles) { 6069 injectedStyles = /* @__PURE__ */ new Set(); 6070 runtime.injectedStyles.set(targetDocument, injectedStyles); 6071 } 6072 if (injectedStyles.has(hash)) { 6073 return; 6074 } 6075 if (documentContainsStyleHash10(targetDocument, hash)) { 6076 injectedStyles.add(hash); 6077 return; 6078 } 6079 const style = targetDocument.createElement("style"); 6080 style.setAttribute(STYLE_HASH_ATTRIBUTE10, hash); 6081 style.appendChild(targetDocument.createTextNode(css)); 6082 targetDocument.head.appendChild(style); 6083 injectedStyles.add(hash); 6084 } 6085 function registerDocument10(targetDocument) { 6086 const runtime = getRuntime10(); 6087 runtime.documents.set( 6088 targetDocument, 6089 (runtime.documents.get(targetDocument) ?? 0) + 1 6090 ); 6091 for (const [hash, css] of runtime.styles) { 6092 injectStyle10(targetDocument, hash, css); 6093 } 6094 return () => { 6095 const count = runtime.documents.get(targetDocument); 6096 if (count === void 0) { 6097 return; 6098 } 6099 if (count <= 1) { 6100 runtime.documents.delete(targetDocument); 6101 return; 6102 } 6103 runtime.documents.set(targetDocument, count - 1); 6104 }; 6105 } 6106 function registerStyle10(hash, css) { 6107 const runtime = getRuntime10(); 6108 runtime.styles.set(hash, css); 6109 for (const targetDocument of runtime.documents.keys()) { 6110 injectStyle10(targetDocument, hash, css); 6111 } 6112 } 6113 if (typeof process === "undefined" || true) { 6114 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)}}}'); 6115 } 6116 var field_default = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" }; 6117 var Label = (0, import_element14.forwardRef)( 6118 function Label2({ className, hideFromVision, variant, ...restProps }, ref) { 6119 const label = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 6120 index_parts_exports.Label, 6121 { 6122 ref, 6123 className: clsx_default( 6124 field_default.label, 6125 variant && field_default[`is-$variant}`], 6126 className 6127 ), 6128 ...restProps 6129 } 6130 ); 6131 if (hideFromVision) { 6132 return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(VisuallyHidden, { render: label }); 6133 } 6134 return label; 6135 } 6136 ); 6137 6138 // packages/ui/build-module/form/primitives/field/description.mjs 6139 var import_element15 = __toESM(require_element(), 1); 6140 var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1); 6141 var STYLE_HASH_ATTRIBUTE11 = "data-wp-hash"; 6142 function getRuntime11() { 6143 const globalScope = globalThis; 6144 if (globalScope.__wpStyleRuntime) { 6145 return globalScope.__wpStyleRuntime; 6146 } 6147 globalScope.__wpStyleRuntime = { 6148 documents: /* @__PURE__ */ new Map(), 6149 styles: /* @__PURE__ */ new Map(), 6150 injectedStyles: /* @__PURE__ */ new WeakMap() 6151 }; 6152 if (typeof document !== "undefined") { 6153 registerDocument11(document); 6154 } 6155 return globalScope.__wpStyleRuntime; 6156 } 6157 function documentContainsStyleHash11(targetDocument, hash) { 6158 if (!targetDocument.head) { 6159 return false; 6160 } 6161 for (const style of targetDocument.head.querySelectorAll( 6162 `style[$STYLE_HASH_ATTRIBUTE11}]` 6163 )) { 6164 if (style.getAttribute(STYLE_HASH_ATTRIBUTE11) === hash) { 6165 return true; 6166 } 6167 } 6168 return false; 6169 } 6170 function injectStyle11(targetDocument, hash, css) { 6171 if (!targetDocument.head) { 6172 return; 6173 } 6174 const runtime = getRuntime11(); 6175 let injectedStyles = runtime.injectedStyles.get(targetDocument); 6176 if (!injectedStyles) { 6177 injectedStyles = /* @__PURE__ */ new Set(); 6178 runtime.injectedStyles.set(targetDocument, injectedStyles); 6179 } 6180 if (injectedStyles.has(hash)) { 6181 return; 6182 } 6183 if (documentContainsStyleHash11(targetDocument, hash)) { 6184 injectedStyles.add(hash); 6185 return; 6186 } 6187 const style = targetDocument.createElement("style"); 6188 style.setAttribute(STYLE_HASH_ATTRIBUTE11, hash); 6189 style.appendChild(targetDocument.createTextNode(css)); 6190 targetDocument.head.appendChild(style); 6191 injectedStyles.add(hash); 6192 } 6193 function registerDocument11(targetDocument) { 6194 const runtime = getRuntime11(); 6195 runtime.documents.set( 6196 targetDocument, 6197 (runtime.documents.get(targetDocument) ?? 0) + 1 6198 ); 6199 for (const [hash, css] of runtime.styles) { 6200 injectStyle11(targetDocument, hash, css); 6201 } 6202 return () => { 6203 const count = runtime.documents.get(targetDocument); 6204 if (count === void 0) { 6205 return; 6206 } 6207 if (count <= 1) { 6208 runtime.documents.delete(targetDocument); 6209 return; 6210 } 6211 runtime.documents.set(targetDocument, count - 1); 6212 }; 6213 } 6214 function registerStyle11(hash, css) { 6215 const runtime = getRuntime11(); 6216 runtime.styles.set(hash, css); 6217 for (const targetDocument of runtime.documents.keys()) { 6218 injectStyle11(targetDocument, hash, css); 6219 } 6220 } 6221 if (typeof process === "undefined" || true) { 6222 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)}"); 6223 } 6224 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" }; 6225 if (typeof process === "undefined" || true) { 6226 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)}}}'); 6227 } 6228 var field_default2 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" }; 6229 var Description = (0, import_element15.forwardRef)(function Description2({ className, ...restProps }, ref) { 6230 return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( 6231 index_parts_exports.Description, 6232 { 6233 ref, 6234 className: clsx_default( 6235 global_css_defense_default5.p, 6236 field_default2.description, 6237 className 6238 ), 6239 ...restProps 6240 } 6241 ); 6242 }); 6243 6244 // packages/ui/build-module/form/primitives/field/details.mjs 6245 var import_element16 = __toESM(require_element(), 1); 6246 var import_i18n6 = __toESM(require_i18n(), 1); 6247 var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1); 6248 var STYLE_HASH_ATTRIBUTE12 = "data-wp-hash"; 6249 function getRuntime12() { 6250 const globalScope = globalThis; 6251 if (globalScope.__wpStyleRuntime) { 6252 return globalScope.__wpStyleRuntime; 6253 } 6254 globalScope.__wpStyleRuntime = { 6255 documents: /* @__PURE__ */ new Map(), 6256 styles: /* @__PURE__ */ new Map(), 6257 injectedStyles: /* @__PURE__ */ new WeakMap() 6258 }; 6259 if (typeof document !== "undefined") { 6260 registerDocument12(document); 6261 } 6262 return globalScope.__wpStyleRuntime; 6263 } 6264 function documentContainsStyleHash12(targetDocument, hash) { 6265 if (!targetDocument.head) { 6266 return false; 6267 } 6268 for (const style of targetDocument.head.querySelectorAll( 6269 `style[$STYLE_HASH_ATTRIBUTE12}]` 6270 )) { 6271 if (style.getAttribute(STYLE_HASH_ATTRIBUTE12) === hash) { 6272 return true; 6273 } 6274 } 6275 return false; 6276 } 6277 function injectStyle12(targetDocument, hash, css) { 6278 if (!targetDocument.head) { 6279 return; 6280 } 6281 const runtime = getRuntime12(); 6282 let injectedStyles = runtime.injectedStyles.get(targetDocument); 6283 if (!injectedStyles) { 6284 injectedStyles = /* @__PURE__ */ new Set(); 6285 runtime.injectedStyles.set(targetDocument, injectedStyles); 6286 } 6287 if (injectedStyles.has(hash)) { 6288 return; 6289 } 6290 if (documentContainsStyleHash12(targetDocument, hash)) { 6291 injectedStyles.add(hash); 6292 return; 6293 } 6294 const style = targetDocument.createElement("style"); 6295 style.setAttribute(STYLE_HASH_ATTRIBUTE12, hash); 6296 style.appendChild(targetDocument.createTextNode(css)); 6297 targetDocument.head.appendChild(style); 6298 injectedStyles.add(hash); 6299 } 6300 function registerDocument12(targetDocument) { 6301 const runtime = getRuntime12(); 6302 runtime.documents.set( 6303 targetDocument, 6304 (runtime.documents.get(targetDocument) ?? 0) + 1 6305 ); 6306 for (const [hash, css] of runtime.styles) { 6307 injectStyle12(targetDocument, hash, css); 6308 } 6309 return () => { 6310 const count = runtime.documents.get(targetDocument); 6311 if (count === void 0) { 6312 return; 6313 } 6314 if (count <= 1) { 6315 runtime.documents.delete(targetDocument); 6316 return; 6317 } 6318 runtime.documents.set(targetDocument, count - 1); 6319 }; 6320 } 6321 function registerStyle12(hash, css) { 6322 const runtime = getRuntime12(); 6323 runtime.styles.set(hash, css); 6324 for (const targetDocument of runtime.documents.keys()) { 6325 injectStyle12(targetDocument, hash, css); 6326 } 6327 } 6328 if (typeof process === "undefined" || true) { 6329 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)}}}'); 6330 } 6331 var field_default3 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" }; 6332 var Details = (0, import_element16.forwardRef)( 6333 function Details2({ className, ...restProps }, ref) { 6334 return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [ 6335 /* @__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.") }), 6336 /* @__PURE__ */ (0, import_jsx_runtime46.jsx)( 6337 "div", 6338 { 6339 ref, 6340 className: clsx_default(field_default3.description, className), 6341 ...restProps 6342 } 6343 ) 6344 ] }); 6345 } 6346 ); 6347 6348 // packages/ui/build-module/form/primitives/field/control.mjs 6349 var import_element17 = __toESM(require_element(), 1); 6350 var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1); 6351 var Control = (0, import_element17.forwardRef)( 6352 function Control2(props, ref) { 6353 return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(index_parts_exports.Control, { ref, ...props }); 6354 } 6355 ); 6356 6357 // packages/ui/build-module/form/primitives/field/visual-label.mjs 6358 var import_element18 = __toESM(require_element(), 1); 6359 var STYLE_HASH_ATTRIBUTE13 = "data-wp-hash"; 6360 function getRuntime13() { 6361 const globalScope = globalThis; 6362 if (globalScope.__wpStyleRuntime) { 6363 return globalScope.__wpStyleRuntime; 6364 } 6365 globalScope.__wpStyleRuntime = { 6366 documents: /* @__PURE__ */ new Map(), 6367 styles: /* @__PURE__ */ new Map(), 6368 injectedStyles: /* @__PURE__ */ new WeakMap() 6369 }; 6370 if (typeof document !== "undefined") { 6371 registerDocument13(document); 6372 } 6373 return globalScope.__wpStyleRuntime; 6374 } 6375 function documentContainsStyleHash13(targetDocument, hash) { 6376 if (!targetDocument.head) { 6377 return false; 6378 } 6379 for (const style of targetDocument.head.querySelectorAll( 6380 `style[$STYLE_HASH_ATTRIBUTE13}]` 6381 )) { 6382 if (style.getAttribute(STYLE_HASH_ATTRIBUTE13) === hash) { 6383 return true; 6384 } 6385 } 6386 return false; 6387 } 6388 function injectStyle13(targetDocument, hash, css) { 6389 if (!targetDocument.head) { 6390 return; 6391 } 6392 const runtime = getRuntime13(); 6393 let injectedStyles = runtime.injectedStyles.get(targetDocument); 6394 if (!injectedStyles) { 6395 injectedStyles = /* @__PURE__ */ new Set(); 6396 runtime.injectedStyles.set(targetDocument, injectedStyles); 6397 } 6398 if (injectedStyles.has(hash)) { 6399 return; 6400 } 6401 if (documentContainsStyleHash13(targetDocument, hash)) { 6402 injectedStyles.add(hash); 6403 return; 6404 } 6405 const style = targetDocument.createElement("style"); 6406 style.setAttribute(STYLE_HASH_ATTRIBUTE13, hash); 6407 style.appendChild(targetDocument.createTextNode(css)); 6408 targetDocument.head.appendChild(style); 6409 injectedStyles.add(hash); 6410 } 6411 function registerDocument13(targetDocument) { 6412 const runtime = getRuntime13(); 6413 runtime.documents.set( 6414 targetDocument, 6415 (runtime.documents.get(targetDocument) ?? 0) + 1 6416 ); 6417 for (const [hash, css] of runtime.styles) { 6418 injectStyle13(targetDocument, hash, css); 6419 } 6420 return () => { 6421 const count = runtime.documents.get(targetDocument); 6422 if (count === void 0) { 6423 return; 6424 } 6425 if (count <= 1) { 6426 runtime.documents.delete(targetDocument); 6427 return; 6428 } 6429 runtime.documents.set(targetDocument, count - 1); 6430 }; 6431 } 6432 function registerStyle13(hash, css) { 6433 const runtime = getRuntime13(); 6434 runtime.styles.set(hash, css); 6435 for (const targetDocument of runtime.documents.keys()) { 6436 injectStyle13(targetDocument, hash, css); 6437 } 6438 } 6439 if (typeof process === "undefined" || true) { 6440 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)}}}'); 6441 } 6442 var field_default4 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" }; 6443 var VisualLabel = (0, import_element18.forwardRef)( 6444 function VisualLabel2({ className, render, variant, ...restProps }, ref) { 6445 return useRender({ 6446 defaultTagName: "span", 6447 render, 6448 ref, 6449 props: mergeProps(restProps, { 6450 className: clsx_default( 6451 field_default4.label, 6452 variant && field_default4[`is-$variant}`], 6453 className 6454 ) 6455 }) 6456 }); 6457 } 6458 ); 6459 VisualLabel.displayName = "Field.VisualLabel"; 6460 6461 // packages/ui/build-module/form/input-control/input-control.mjs 6462 var import_element19 = __toESM(require_element(), 1); 6463 var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1); 6464 var STYLE_HASH_ATTRIBUTE14 = "data-wp-hash"; 6465 function getRuntime14() { 6466 const globalScope = globalThis; 6467 if (globalScope.__wpStyleRuntime) { 6468 return globalScope.__wpStyleRuntime; 6469 } 6470 globalScope.__wpStyleRuntime = { 6471 documents: /* @__PURE__ */ new Map(), 6472 styles: /* @__PURE__ */ new Map(), 6473 injectedStyles: /* @__PURE__ */ new WeakMap() 6474 }; 6475 if (typeof document !== "undefined") { 6476 registerDocument14(document); 6477 } 6478 return globalScope.__wpStyleRuntime; 6479 } 6480 function documentContainsStyleHash14(targetDocument, hash) { 6481 if (!targetDocument.head) { 6482 return false; 6483 } 6484 for (const style of targetDocument.head.querySelectorAll( 6485 `style[$STYLE_HASH_ATTRIBUTE14}]` 6486 )) { 6487 if (style.getAttribute(STYLE_HASH_ATTRIBUTE14) === hash) { 6488 return true; 6489 } 6490 } 6491 return false; 6492 } 6493 function injectStyle14(targetDocument, hash, css) { 6494 if (!targetDocument.head) { 6495 return; 6496 } 6497 const runtime = getRuntime14(); 6498 let injectedStyles = runtime.injectedStyles.get(targetDocument); 6499 if (!injectedStyles) { 6500 injectedStyles = /* @__PURE__ */ new Set(); 6501 runtime.injectedStyles.set(targetDocument, injectedStyles); 6502 } 6503 if (injectedStyles.has(hash)) { 6504 return; 6505 } 6506 if (documentContainsStyleHash14(targetDocument, hash)) { 6507 injectedStyles.add(hash); 6508 return; 6509 } 6510 const style = targetDocument.createElement("style"); 6511 style.setAttribute(STYLE_HASH_ATTRIBUTE14, hash); 6512 style.appendChild(targetDocument.createTextNode(css)); 6513 targetDocument.head.appendChild(style); 6514 injectedStyles.add(hash); 6515 } 6516 function registerDocument14(targetDocument) { 6517 const runtime = getRuntime14(); 6518 runtime.documents.set( 6519 targetDocument, 6520 (runtime.documents.get(targetDocument) ?? 0) + 1 6521 ); 6522 for (const [hash, css] of runtime.styles) { 6523 injectStyle14(targetDocument, hash, css); 6524 } 6525 return () => { 6526 const count = runtime.documents.get(targetDocument); 6527 if (count === void 0) { 6528 return; 6529 } 6530 if (count <= 1) { 6531 runtime.documents.delete(targetDocument); 6532 return; 6533 } 6534 runtime.documents.set(targetDocument, count - 1); 6535 }; 6536 } 6537 function registerStyle14(hash, css) { 6538 const runtime = getRuntime14(); 6539 runtime.styles.set(hash, css); 6540 for (const targetDocument of runtime.documents.keys()) { 6541 injectStyle14(targetDocument, hash, css); 6542 } 6543 } 6544 if (typeof process === "undefined" || true) { 6545 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}}}}}"); 6546 } 6547 var style_default9 = { "root": "a9211a7e6af24bed__root" }; 6548 var InputControl = (0, import_element19.forwardRef)( 6549 function InputControl2({ 6550 className, 6551 label, 6552 description, 6553 details, 6554 hideLabelFromVision, 6555 ...restProps 6556 }, ref) { 6557 return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(field_exports.Root, { className: clsx_default(style_default9.root, className), children: [ 6558 /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(field_exports.Label, { hideFromVision: hideLabelFromVision, children: label }), 6559 /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Input3, { ref, ...restProps }), 6560 description && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(field_exports.Description, { children: description }), 6561 details && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(field_exports.Details, { children: details }) 6562 ] }); 6563 } 6564 ); 6565 6566 // packages/ui/build-module/form/with-validation/validated-input-control/validated-input-control.mjs 6567 var import_element20 = __toESM(require_element(), 1); 6568 var import_compose2 = __toESM(require_compose(), 1); 6569 var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1); 6570 var ValidatedInputControl = (0, import_element20.forwardRef)(function ValidatedInputControl2({ required, markWhenOptional, customValidity, ...restProps }, forwardedRef) { 6571 const validityTargetRef = (0, import_element20.useRef)(null); 6572 const mergedRefs = (0, import_compose2.useMergeRefs)([forwardedRef, validityTargetRef]); 6573 return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 6574 ControlWithError, 6575 { 6576 required, 6577 markWhenOptional, 6578 customValidity, 6579 getValidityTarget: () => validityTargetRef.current, 6580 children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InputControl, { ref: mergedRefs, ...restProps }) 6581 } 6582 ); 6583 }); 6584 6585 // packages/ui/build-module/tabs/index.mjs 6586 var tabs_exports = {}; 6587 __export(tabs_exports, { 6588 List: () => List, 6589 Panel: () => Panel, 6590 Root: () => Root3, 6591 Tab: () => Tab 6592 }); 6593 6594 // packages/ui/build-module/tabs/list.mjs 6595 var import_element21 = __toESM(require_element(), 1); 6596 var import_compose3 = __toESM(require_compose(), 1); 6597 var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1); 6598 var STYLE_HASH_ATTRIBUTE15 = "data-wp-hash"; 6599 function getRuntime15() { 6600 const globalScope = globalThis; 6601 if (globalScope.__wpStyleRuntime) { 6602 return globalScope.__wpStyleRuntime; 6603 } 6604 globalScope.__wpStyleRuntime = { 6605 documents: /* @__PURE__ */ new Map(), 6606 styles: /* @__PURE__ */ new Map(), 6607 injectedStyles: /* @__PURE__ */ new WeakMap() 6608 }; 6609 if (typeof document !== "undefined") { 6610 registerDocument15(document); 6611 } 6612 return globalScope.__wpStyleRuntime; 6613 } 6614 function documentContainsStyleHash15(targetDocument, hash) { 6615 if (!targetDocument.head) { 6616 return false; 6617 } 6618 for (const style of targetDocument.head.querySelectorAll( 6619 `style[$STYLE_HASH_ATTRIBUTE15}]` 6620 )) { 6621 if (style.getAttribute(STYLE_HASH_ATTRIBUTE15) === hash) { 6622 return true; 6623 } 6624 } 6625 return false; 6626 } 6627 function injectStyle15(targetDocument, hash, css) { 6628 if (!targetDocument.head) { 6629 return; 6630 } 6631 const runtime = getRuntime15(); 6632 let injectedStyles = runtime.injectedStyles.get(targetDocument); 6633 if (!injectedStyles) { 6634 injectedStyles = /* @__PURE__ */ new Set(); 6635 runtime.injectedStyles.set(targetDocument, injectedStyles); 6636 } 6637 if (injectedStyles.has(hash)) { 6638 return; 6639 } 6640 if (documentContainsStyleHash15(targetDocument, hash)) { 6641 injectedStyles.add(hash); 6642 return; 6643 } 6644 const style = targetDocument.createElement("style"); 6645 style.setAttribute(STYLE_HASH_ATTRIBUTE15, hash); 6646 style.appendChild(targetDocument.createTextNode(css)); 6647 targetDocument.head.appendChild(style); 6648 injectedStyles.add(hash); 6649 } 6650 function registerDocument15(targetDocument) { 6651 const runtime = getRuntime15(); 6652 runtime.documents.set( 6653 targetDocument, 6654 (runtime.documents.get(targetDocument) ?? 0) + 1 6655 ); 6656 for (const [hash, css] of runtime.styles) { 6657 injectStyle15(targetDocument, hash, css); 6658 } 6659 return () => { 6660 const count = runtime.documents.get(targetDocument); 6661 if (count === void 0) { 6662 return; 6663 } 6664 if (count <= 1) { 6665 runtime.documents.delete(targetDocument); 6666 return; 6667 } 6668 runtime.documents.set(targetDocument, count - 1); 6669 }; 6670 } 6671 function registerStyle15(hash, css) { 6672 const runtime = getRuntime15(); 6673 runtime.styles.set(hash, css); 6674 for (const targetDocument of runtime.documents.keys()) { 6675 injectStyle15(targetDocument, hash, css); 6676 } 6677 } 6678 if (typeof process === "undefined" || true) { 6679 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}}}}'); 6680 } 6681 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" }; 6682 var SCROLL_EPSILON = 1; 6683 var List = (0, import_element21.forwardRef)( 6684 function TabList({ 6685 children, 6686 variant = "default", 6687 className, 6688 activateOnFocus, 6689 ...otherProps 6690 }, forwardedRef) { 6691 const [listEl, setListEl] = (0, import_element21.useState)(null); 6692 const [overflow, setOverflow] = (0, import_element21.useState)({ 6693 first: false, 6694 last: false, 6695 isScrolling: false 6696 }); 6697 (0, import_element21.useEffect)(() => { 6698 if (!listEl) { 6699 return; 6700 } 6701 const measureOverflow = () => { 6702 const { scrollWidth, clientWidth, scrollLeft } = listEl; 6703 const maxScroll = Math.max(scrollWidth - clientWidth, 0); 6704 const direction = listEl.dir || (typeof window !== "undefined" ? window.getComputedStyle(listEl).direction : "ltr"); 6705 const scrollFromStart = direction === "rtl" && scrollLeft < 0 ? ( 6706 // In RTL layouts, scrollLeft is typically 0 at the visual "start" 6707 // (right edge) and becomes negative toward the "end" (left edge). 6708 // Normalize value for correct first/last detection logic. 6709 -scrollLeft 6710 ) : scrollLeft; 6711 const next = { 6712 first: scrollFromStart > SCROLL_EPSILON, 6713 last: scrollFromStart < maxScroll - SCROLL_EPSILON, 6714 isScrolling: scrollWidth > clientWidth 6715 }; 6716 setOverflow( 6717 (prev) => prev.first === next.first && prev.last === next.last && prev.isScrolling === next.isScrolling ? prev : next 6718 ); 6719 }; 6720 const resizeObserver = new ResizeObserver(measureOverflow); 6721 const observeTabs = () => { 6722 resizeObserver.disconnect(); 6723 resizeObserver.observe(listEl); 6724 listEl.querySelectorAll('[role="tab"]').forEach((tab) => resizeObserver.observe(tab)); 6725 }; 6726 const mutationObserver = new MutationObserver(observeTabs); 6727 mutationObserver.observe(listEl, { 6728 childList: true, 6729 subtree: true 6730 }); 6731 let scrollTick = false; 6732 const throttleMeasureOverflowOnScroll = () => { 6733 if (!scrollTick) { 6734 requestAnimationFrame(() => { 6735 measureOverflow(); 6736 scrollTick = false; 6737 }); 6738 scrollTick = true; 6739 } 6740 }; 6741 listEl.addEventListener( 6742 "scroll", 6743 throttleMeasureOverflowOnScroll, 6744 { passive: true } 6745 ); 6746 observeTabs(); 6747 measureOverflow(); 6748 return () => { 6749 listEl.removeEventListener( 6750 "scroll", 6751 throttleMeasureOverflowOnScroll 6752 ); 6753 resizeObserver.disconnect(); 6754 mutationObserver.disconnect(); 6755 }; 6756 }, [listEl]); 6757 const mergedListRef = (0, import_compose3.useMergeRefs)([ 6758 forwardedRef, 6759 (el) => setListEl(el) 6760 ]); 6761 return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)( 6762 index_parts_exports2.List, 6763 { 6764 ref: mergedListRef, 6765 activateOnFocus, 6766 "data-select-on-move": activateOnFocus ? "true" : "false", 6767 className: clsx_default( 6768 style_default10.tablist, 6769 overflow.first && style_default10["is-overflowing-first"], 6770 overflow.last && style_default10["is-overflowing-last"], 6771 style_default10[`is-$variant}-variant`], 6772 className 6773 ), 6774 ...otherProps, 6775 tabIndex: otherProps.tabIndex ?? (overflow.isScrolling ? -1 : void 0), 6776 children: [ 6777 children, 6778 /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(index_parts_exports2.Indicator, { className: style_default10.indicator }) 6779 ] 6780 } 6781 ); 6782 } 6783 ); 6784 6785 // packages/ui/build-module/tabs/panel.mjs 6786 var import_element23 = __toESM(require_element(), 1); 6787 6788 // packages/ui/build-module/tabs/context.mjs 6789 var import_element22 = __toESM(require_element(), 1); 6790 var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1); 6791 var VALIDATION_ENABLED = true; 6792 var TabsValidationContext = VALIDATION_ENABLED ? (0, import_element22.createContext)(null) : null; 6793 function useRegisterTabDev() { 6794 const context = (0, import_element22.useContext)(TabsValidationContext); 6795 (0, import_element22.useEffect)(() => { 6796 if (context) { 6797 return context.registerTab(); 6798 } 6799 return void 0; 6800 }, [context]); 6801 } 6802 function useRegisterTabProd() { 6803 } 6804 var useRegisterTab = VALIDATION_ENABLED ? useRegisterTabDev : useRegisterTabProd; 6805 function useRegisterPanelDev() { 6806 const context = (0, import_element22.useContext)(TabsValidationContext); 6807 (0, import_element22.useEffect)(() => { 6808 if (context) { 6809 return context.registerPanel(); 6810 } 6811 return void 0; 6812 }, [context]); 6813 } 6814 function useRegisterPanelProd() { 6815 } 6816 var useRegisterPanel = VALIDATION_ENABLED ? useRegisterPanelDev : useRegisterPanelProd; 6817 function TabsValidationProviderDev({ 6818 children 6819 }) { 6820 const tabCountRef = (0, import_element22.useRef)(0); 6821 const panelCountRef = (0, import_element22.useRef)(0); 6822 const scheduleValidation = useScheduleValidation(() => { 6823 const tabCount = tabCountRef.current; 6824 const panelCount = panelCountRef.current; 6825 if (tabCount !== panelCount) { 6826 throw new Error( 6827 `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.` 6828 ); 6829 } 6830 }); 6831 const registerTab = (0, import_element22.useCallback)(() => { 6832 tabCountRef.current += 1; 6833 scheduleValidation(); 6834 return () => { 6835 tabCountRef.current -= 1; 6836 scheduleValidation(); 6837 }; 6838 }, [scheduleValidation]); 6839 const registerPanel = (0, import_element22.useCallback)(() => { 6840 panelCountRef.current += 1; 6841 scheduleValidation(); 6842 return () => { 6843 panelCountRef.current -= 1; 6844 scheduleValidation(); 6845 }; 6846 }, [scheduleValidation]); 6847 const contextValue = (0, import_element22.useMemo)( 6848 () => ({ 6849 registerTab, 6850 registerPanel 6851 }), 6852 [registerTab, registerPanel] 6853 ); 6854 return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TabsValidationContext.Provider, { value: contextValue, children }); 6855 } 6856 function TabsValidationProviderProd({ 6857 children 6858 }) { 6859 return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children }); 6860 } 6861 var TabsValidationProvider = VALIDATION_ENABLED ? TabsValidationProviderDev : TabsValidationProviderProd; 6862 6863 // packages/ui/build-module/tabs/panel.mjs 6864 var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1); 6865 var STYLE_HASH_ATTRIBUTE16 = "data-wp-hash"; 6866 function getRuntime16() { 6867 const globalScope = globalThis; 6868 if (globalScope.__wpStyleRuntime) { 6869 return globalScope.__wpStyleRuntime; 6870 } 6871 globalScope.__wpStyleRuntime = { 6872 documents: /* @__PURE__ */ new Map(), 6873 styles: /* @__PURE__ */ new Map(), 6874 injectedStyles: /* @__PURE__ */ new WeakMap() 6875 }; 6876 if (typeof document !== "undefined") { 6877 registerDocument16(document); 6878 } 6879 return globalScope.__wpStyleRuntime; 6880 } 6881 function documentContainsStyleHash16(targetDocument, hash) { 6882 if (!targetDocument.head) { 6883 return false; 6884 } 6885 for (const style of targetDocument.head.querySelectorAll( 6886 `style[$STYLE_HASH_ATTRIBUTE16}]` 6887 )) { 6888 if (style.getAttribute(STYLE_HASH_ATTRIBUTE16) === hash) { 6889 return true; 6890 } 6891 } 6892 return false; 6893 } 6894 function injectStyle16(targetDocument, hash, css) { 6895 if (!targetDocument.head) { 6896 return; 6897 } 6898 const runtime = getRuntime16(); 6899 let injectedStyles = runtime.injectedStyles.get(targetDocument); 6900 if (!injectedStyles) { 6901 injectedStyles = /* @__PURE__ */ new Set(); 6902 runtime.injectedStyles.set(targetDocument, injectedStyles); 6903 } 6904 if (injectedStyles.has(hash)) { 6905 return; 6906 } 6907 if (documentContainsStyleHash16(targetDocument, hash)) { 6908 injectedStyles.add(hash); 6909 return; 6910 } 6911 const style = targetDocument.createElement("style"); 6912 style.setAttribute(STYLE_HASH_ATTRIBUTE16, hash); 6913 style.appendChild(targetDocument.createTextNode(css)); 6914 targetDocument.head.appendChild(style); 6915 injectedStyles.add(hash); 6916 } 6917 function registerDocument16(targetDocument) { 6918 const runtime = getRuntime16(); 6919 runtime.documents.set( 6920 targetDocument, 6921 (runtime.documents.get(targetDocument) ?? 0) + 1 6922 ); 6923 for (const [hash, css] of runtime.styles) { 6924 injectStyle16(targetDocument, hash, css); 6925 } 6926 return () => { 6927 const count = runtime.documents.get(targetDocument); 6928 if (count === void 0) { 6929 return; 6930 } 6931 if (count <= 1) { 6932 runtime.documents.delete(targetDocument); 6933 return; 6934 } 6935 runtime.documents.set(targetDocument, count - 1); 6936 }; 6937 } 6938 function registerStyle16(hash, css) { 6939 const runtime = getRuntime16(); 6940 runtime.styles.set(hash, css); 6941 for (const targetDocument of runtime.documents.keys()) { 6942 injectStyle16(targetDocument, hash, css); 6943 } 6944 } 6945 if (typeof process === "undefined" || true) { 6946 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)}"); 6947 } 6948 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" }; 6949 if (typeof process === "undefined" || true) { 6950 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))}}}"); 6951 } 6952 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" }; 6953 var Panel = (0, import_element23.forwardRef)( 6954 function TabPanel({ className, ...otherProps }, forwardedRef) { 6955 useRegisterPanel(); 6956 return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 6957 index_parts_exports2.Panel, 6958 { 6959 ref: forwardedRef, 6960 className: clsx_default( 6961 global_css_defense_default6.div, 6962 focus_module_default3["outset-ring--focus-visible"], 6963 className 6964 ), 6965 ...otherProps 6966 } 6967 ); 6968 } 6969 ); 6970 6971 // packages/ui/build-module/tabs/root.mjs 6972 var import_element24 = __toESM(require_element(), 1); 6973 var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1); 6974 var Root3 = (0, import_element24.forwardRef)( 6975 function TabsRoot3({ ...otherProps }, forwardedRef) { 6976 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 }) }) }); 6977 } 6978 ); 6979 6980 // packages/ui/build-module/tabs/tab.mjs 6981 var import_element25 = __toESM(require_element(), 1); 6982 var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1); 6983 var STYLE_HASH_ATTRIBUTE17 = "data-wp-hash"; 6984 function getRuntime17() { 6985 const globalScope = globalThis; 6986 if (globalScope.__wpStyleRuntime) { 6987 return globalScope.__wpStyleRuntime; 6988 } 6989 globalScope.__wpStyleRuntime = { 6990 documents: /* @__PURE__ */ new Map(), 6991 styles: /* @__PURE__ */ new Map(), 6992 injectedStyles: /* @__PURE__ */ new WeakMap() 6993 }; 6994 if (typeof document !== "undefined") { 6995 registerDocument17(document); 6996 } 6997 return globalScope.__wpStyleRuntime; 6998 } 6999 function documentContainsStyleHash17(targetDocument, hash) { 7000 if (!targetDocument.head) { 7001 return false; 7002 } 7003 for (const style of targetDocument.head.querySelectorAll( 7004 `style[$STYLE_HASH_ATTRIBUTE17}]` 7005 )) { 7006 if (style.getAttribute(STYLE_HASH_ATTRIBUTE17) === hash) { 7007 return true; 7008 } 7009 } 7010 return false; 7011 } 7012 function injectStyle17(targetDocument, hash, css) { 7013 if (!targetDocument.head) { 7014 return; 7015 } 7016 const runtime = getRuntime17(); 7017 let injectedStyles = runtime.injectedStyles.get(targetDocument); 7018 if (!injectedStyles) { 7019 injectedStyles = /* @__PURE__ */ new Set(); 7020 runtime.injectedStyles.set(targetDocument, injectedStyles); 7021 } 7022 if (injectedStyles.has(hash)) { 7023 return; 7024 } 7025 if (documentContainsStyleHash17(targetDocument, hash)) { 7026 injectedStyles.add(hash); 7027 return; 7028 } 7029 const style = targetDocument.createElement("style"); 7030 style.setAttribute(STYLE_HASH_ATTRIBUTE17, hash); 7031 style.appendChild(targetDocument.createTextNode(css)); 7032 targetDocument.head.appendChild(style); 7033 injectedStyles.add(hash); 7034 } 7035 function registerDocument17(targetDocument) { 7036 const runtime = getRuntime17(); 7037 runtime.documents.set( 7038 targetDocument, 7039 (runtime.documents.get(targetDocument) ?? 0) + 1 7040 ); 7041 for (const [hash, css] of runtime.styles) { 7042 injectStyle17(targetDocument, hash, css); 7043 } 7044 return () => { 7045 const count = runtime.documents.get(targetDocument); 7046 if (count === void 0) { 7047 return; 7048 } 7049 if (count <= 1) { 7050 runtime.documents.delete(targetDocument); 7051 return; 7052 } 7053 runtime.documents.set(targetDocument, count - 1); 7054 }; 7055 } 7056 function registerStyle17(hash, css) { 7057 const runtime = getRuntime17(); 7058 runtime.styles.set(hash, css); 7059 for (const targetDocument of runtime.documents.keys()) { 7060 injectStyle17(targetDocument, hash, css); 7061 } 7062 } 7063 if (typeof process === "undefined" || true) { 7064 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}}}}'); 7065 } 7066 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" }; 7067 var Tab = (0, import_element25.forwardRef)(function Tab2({ className, children, ...otherProps }, forwardedRef) { 7068 useRegisterTab(); 7069 return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)( 7070 index_parts_exports2.Tab, 7071 { 7072 ref: forwardedRef, 7073 className: clsx_default(style_default11.tab, className), 7074 ...otherProps, 7075 children: [ 7076 /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: style_default11["tab-children"], children }), 7077 /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { icon: chevron_right_default, className: style_default11["tab-chevron"] }) 7078 ] 7079 } 7080 ); 7081 }); 7082 7083 // packages/format-library/build-module/image/index.mjs 7084 var import_i18n7 = __toESM(require_i18n(), 1); 7085 var import_element26 = __toESM(require_element(), 1); 7086 var import_rich_text3 = __toESM(require_rich_text(), 1); 7087 var import_block_editor3 = __toESM(require_block_editor(), 1); 7088 var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1); 7089 var ALLOWED_MEDIA_TYPES = ["image"]; 7090 var name3 = "core/image"; 7091 var title3 = (0, import_i18n7.__)("Inline image"); 7092 function getCurrentImageId(activeObjectAttributes) { 7093 if (!activeObjectAttributes?.className) { 7094 return void 0; 7095 } 7096 const [, id] = activeObjectAttributes.className.match(/wp-image-(\d+)/) ?? []; 7097 return id ? parseInt(id, 10) : void 0; 7098 } 7099 var image = { 7100 name: name3, 7101 title: title3, 7102 keywords: [(0, import_i18n7.__)("photo"), (0, import_i18n7.__)("media")], 7103 object: true, 7104 tagName: "img", 7105 className: null, 7106 attributes: { 7107 className: "class", 7108 style: "style", 7109 url: "src", 7110 alt: "alt" 7111 }, 7112 edit: Edit 7113 }; 7114 function InlineUI({ 7115 value, 7116 onChange, 7117 activeObjectAttributes, 7118 contentRef 7119 }) { 7120 const style = activeObjectAttributes?.style; 7121 const alt = activeObjectAttributes?.alt; 7122 const width = style?.replace(/\D/g, ""); 7123 const [editedWidth, setEditedWidth] = (0, import_element26.useState)(width); 7124 const [editedAlt, setEditedAlt] = (0, import_element26.useState)(alt); 7125 const hasChanged = editedWidth !== width || editedAlt !== alt; 7126 const popoverAnchor = (0, import_rich_text3.useAnchor)({ 7127 // eslint-disable-next-line react-hooks/refs 7128 editableContentElement: contentRef.current, 7129 settings: image 7130 }); 7131 return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 7132 import_components.Popover, 7133 { 7134 focusOnMount: false, 7135 anchor: popoverAnchor, 7136 className: "block-editor-format-toolbar__image-popover", 7137 children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 7138 "form", 7139 { 7140 className: "block-editor-format-toolbar__image-container-content", 7141 onSubmit: (event) => { 7142 const newReplacements = value.replacements.slice(); 7143 newReplacements[value.start] = { 7144 type: name3, 7145 attributes: { 7146 ...activeObjectAttributes, 7147 style: editedWidth ? `width: $editedWidth}px;` : "", 7148 alt: editedAlt ?? "" 7149 } 7150 }; 7151 onChange({ 7152 ...value, 7153 replacements: newReplacements 7154 }); 7155 event.preventDefault(); 7156 }, 7157 children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Stack, { direction: "column", gap: "lg", children: [ 7158 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 7159 import_components.__experimentalNumberControl, 7160 { 7161 label: (0, import_i18n7.__)("Width"), 7162 value: editedWidth, 7163 min: 1, 7164 onChange: (newWidth) => { 7165 setEditedWidth(newWidth); 7166 } 7167 } 7168 ), 7169 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 7170 import_components.TextareaControl, 7171 { 7172 label: (0, import_i18n7.__)("Alternative text"), 7173 value: editedAlt ?? "", 7174 onChange: (newAlt) => { 7175 setEditedAlt(newAlt); 7176 }, 7177 help: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [ 7178 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 7179 Link, 7180 { 7181 openInNewTab: true, 7182 href: ( 7183 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 7184 (0, import_i18n7.__)( 7185 "https://www.w3.org/WAI/tutorials/images/decision-tree/" 7186 ) 7187 ), 7188 children: (0, import_i18n7.__)( 7189 "Describe the purpose of the image." 7190 ) 7191 } 7192 ), 7193 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("br", {}), 7194 (0, import_i18n7.__)("Leave empty if decorative.") 7195 ] }) 7196 } 7197 ), 7198 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 7199 import_components.Button, 7200 { 7201 disabled: !hasChanged, 7202 accessibleWhenDisabled: true, 7203 variant: "primary", 7204 type: "submit", 7205 size: "compact", 7206 children: (0, import_i18n7.__)("Apply") 7207 } 7208 ) }) 7209 ] }) 7210 } 7211 ) 7212 } 7213 ); 7214 } 7215 function Edit({ 7216 value, 7217 onChange, 7218 onFocus, 7219 isObjectActive, 7220 activeObjectAttributes, 7221 contentRef 7222 }) { 7223 return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_block_editor3.MediaUploadCheck, { children: [ 7224 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 7225 import_block_editor3.MediaUpload, 7226 { 7227 allowedTypes: ALLOWED_MEDIA_TYPES, 7228 value: getCurrentImageId(activeObjectAttributes), 7229 onSelect: ({ 7230 id, 7231 url, 7232 alt, 7233 width: imgWidth 7234 }) => { 7235 onChange( 7236 (0, import_rich_text3.insertObject)(value, { 7237 type: name3, 7238 attributes: { 7239 className: `wp-image-$id}`, 7240 style: `width: $Math.min( 7241 imgWidth, 7242 150 7243 )}px;`, 7244 url, 7245 alt 7246 } 7247 }) 7248 ); 7249 onFocus(); 7250 }, 7251 render: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 7252 import_block_editor3.RichTextToolbarButton, 7253 { 7254 icon: inline_image_default, 7255 title: isObjectActive ? (0, import_i18n7.__)("Replace image") : title3, 7256 onClick: open, 7257 isActive: isObjectActive 7258 } 7259 ) 7260 } 7261 ), 7262 isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 7263 InlineUI, 7264 { 7265 value, 7266 onChange, 7267 activeObjectAttributes, 7268 contentRef 7269 } 7270 ) 7271 ] }); 7272 } 7273 7274 // packages/format-library/build-module/italic/index.mjs 7275 var import_i18n8 = __toESM(require_i18n(), 1); 7276 var import_rich_text4 = __toESM(require_rich_text(), 1); 7277 var import_block_editor4 = __toESM(require_block_editor(), 1); 7278 var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1); 7279 var name4 = "core/italic"; 7280 var title4 = (0, import_i18n8.__)("Italic"); 7281 var italic = { 7282 name: name4, 7283 title: title4, 7284 tagName: "em", 7285 className: null, 7286 edit({ 7287 isActive, 7288 value, 7289 onChange, 7290 onFocus, 7291 isVisible = true 7292 }) { 7293 function onToggle() { 7294 onChange((0, import_rich_text4.toggleFormat)(value, { type: name4, title: title4 })); 7295 } 7296 function onClick() { 7297 onChange((0, import_rich_text4.toggleFormat)(value, { type: name4, title: title4 })); 7298 onFocus(); 7299 } 7300 return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [ 7301 /* @__PURE__ */ (0, import_jsx_runtime56.jsx)( 7302 import_block_editor4.RichTextShortcut, 7303 { 7304 type: "primary", 7305 character: "i", 7306 onUse: onToggle 7307 } 7308 ), 7309 isVisible && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)( 7310 import_block_editor4.RichTextToolbarButton, 7311 { 7312 name: "italic", 7313 icon: format_italic_default, 7314 title: title4, 7315 onClick, 7316 isActive, 7317 shortcutType: "primary", 7318 shortcutCharacter: "i" 7319 } 7320 ), 7321 /* @__PURE__ */ (0, import_jsx_runtime56.jsx)( 7322 import_block_editor4.__unstableRichTextInputEvent, 7323 { 7324 inputType: "formatItalic", 7325 onInput: onToggle 7326 } 7327 ) 7328 ] }); 7329 } 7330 }; 7331 7332 // packages/format-library/build-module/link/index.mjs 7333 var import_i18n11 = __toESM(require_i18n(), 1); 7334 var import_element29 = __toESM(require_element(), 1); 7335 var import_rich_text6 = __toESM(require_rich_text(), 1); 7336 var import_url3 = __toESM(require_url(), 1); 7337 var import_block_editor6 = __toESM(require_block_editor(), 1); 7338 var import_html_entities = __toESM(require_html_entities(), 1); 7339 var import_a11y2 = __toESM(require_a11y(), 1); 7340 7341 // packages/format-library/build-module/link/inline.mjs 7342 var import_element28 = __toESM(require_element(), 1); 7343 var import_i18n10 = __toESM(require_i18n(), 1); 7344 var import_a11y = __toESM(require_a11y(), 1); 7345 var import_components3 = __toESM(require_components(), 1); 7346 var import_url2 = __toESM(require_url(), 1); 7347 var import_rich_text5 = __toESM(require_rich_text(), 1); 7348 var import_block_editor5 = __toESM(require_block_editor(), 1); 7349 var import_data = __toESM(require_data(), 1); 7350 7351 // packages/format-library/build-module/link/utils.mjs 7352 var import_url = __toESM(require_url(), 1); 7353 function isValidHref(href) { 7354 if (!href) { 7355 return false; 7356 } 7357 const trimmedHref = href.trim(); 7358 if (!trimmedHref) { 7359 return false; 7360 } 7361 if (/^\S+:/.test(trimmedHref)) { 7362 const protocol = (0, import_url.getProtocol)(trimmedHref); 7363 if (!protocol || !(0, import_url.isValidProtocol)(protocol)) { 7364 return false; 7365 } 7366 if (protocol.startsWith("http") && !/^https?:\/\/[^\/\s]/i.test(trimmedHref)) { 7367 return false; 7368 } 7369 const authority = (0, import_url.getAuthority)(trimmedHref); 7370 if (!authority || !(0, import_url.isValidAuthority)(authority)) { 7371 return false; 7372 } 7373 const path = (0, import_url.getPath)(trimmedHref); 7374 if (path && !(0, import_url.isValidPath)(path)) { 7375 return false; 7376 } 7377 const queryString = (0, import_url.getQueryString)(trimmedHref); 7378 if (queryString && !(0, import_url.isValidQueryString)(queryString)) { 7379 return false; 7380 } 7381 const fragment = (0, import_url.getFragment)(trimmedHref); 7382 if (fragment && !(0, import_url.isValidFragment)(fragment)) { 7383 return false; 7384 } 7385 } 7386 if (trimmedHref.startsWith("#") && !(0, import_url.isValidFragment)(trimmedHref)) { 7387 return false; 7388 } 7389 return true; 7390 } 7391 function createLinkFormat({ 7392 url, 7393 type, 7394 id, 7395 opensInNewWindow, 7396 nofollow, 7397 cssClasses 7398 }) { 7399 const format = { 7400 type: "core/link", 7401 attributes: { 7402 url 7403 } 7404 }; 7405 if (type) { 7406 format.attributes.type = type; 7407 } 7408 if (id) { 7409 format.attributes.id = id; 7410 } 7411 if (opensInNewWindow) { 7412 format.attributes.target = "_blank"; 7413 format.attributes.rel = format.attributes.rel ? format.attributes.rel + " noopener" : "noopener"; 7414 } 7415 if (nofollow) { 7416 format.attributes.rel = format.attributes.rel ? format.attributes.rel + " nofollow" : "nofollow"; 7417 } 7418 const trimmedCssClasses = cssClasses?.trim(); 7419 if (trimmedCssClasses?.length) { 7420 format.attributes.class = trimmedCssClasses; 7421 } 7422 return format; 7423 } 7424 function getFormatBoundary(value, format, startIndex = value.start, endIndex = value.end) { 7425 const EMPTY_BOUNDARIES = { 7426 start: void 0, 7427 end: void 0 7428 }; 7429 const { formats } = value; 7430 let targetFormat; 7431 let initialIndex; 7432 if (!formats?.length) { 7433 return EMPTY_BOUNDARIES; 7434 } 7435 const newFormats = formats.slice(); 7436 const formatAtStart = newFormats[startIndex]?.find( 7437 ({ type }) => type === format.type 7438 ); 7439 const formatAtEnd = newFormats[endIndex]?.find( 7440 ({ type }) => type === format.type 7441 ); 7442 const formatAtEndMinusOne = newFormats[endIndex - 1]?.find( 7443 ({ type }) => type === format.type 7444 ); 7445 if (!!formatAtStart) { 7446 targetFormat = formatAtStart; 7447 initialIndex = startIndex; 7448 } else if (!!formatAtEnd) { 7449 targetFormat = formatAtEnd; 7450 initialIndex = endIndex; 7451 } else if (!!formatAtEndMinusOne) { 7452 targetFormat = formatAtEndMinusOne; 7453 initialIndex = endIndex - 1; 7454 } else { 7455 return EMPTY_BOUNDARIES; 7456 } 7457 const index = newFormats[initialIndex].indexOf(targetFormat); 7458 startIndex = walkToStart(newFormats, initialIndex, targetFormat, index); 7459 endIndex = walkToEnd(newFormats, initialIndex, targetFormat, index); 7460 startIndex = startIndex < 0 ? 0 : startIndex; 7461 return { 7462 start: startIndex, 7463 end: endIndex + 1 7464 }; 7465 } 7466 function walkToBoundary(formats, initialIndex, targetFormatRef, formatIndex, direction) { 7467 let index = initialIndex; 7468 const directions = { 7469 forwards: 1, 7470 backwards: -1 7471 }; 7472 const directionIncrement = directions[direction] || 1; 7473 const inverseDirectionIncrement = directionIncrement * -1; 7474 while (formats[index] && formats[index][formatIndex] === targetFormatRef) { 7475 index = index + directionIncrement; 7476 } 7477 index = index + inverseDirectionIncrement; 7478 return index; 7479 } 7480 var walkToStart = (...args) => walkToBoundary(...args, "backwards"); 7481 var walkToEnd = (...args) => walkToBoundary(...args, "forwards"); 7482 7483 // packages/format-library/build-module/link/css-classes-setting.mjs 7484 var import_element27 = __toESM(require_element(), 1); 7485 var import_compose4 = __toESM(require_compose(), 1); 7486 var import_i18n9 = __toESM(require_i18n(), 1); 7487 var import_components2 = __toESM(require_components(), 1); 7488 var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1); 7489 var CSSClassesSettingComponent = ({ 7490 setting, 7491 value, 7492 onChange 7493 }) => { 7494 const hasValue = !!value?.cssClasses?.length; 7495 const [isSettingActive, setIsSettingActive] = (0, import_element27.useState)(hasValue); 7496 const instanceId = (0, import_compose4.useInstanceId)(CSSClassesSettingComponent); 7497 const controlledRegionId = `css-classes-setting-$instanceId}`; 7498 const handleSettingChange = (newValue) => { 7499 const sanitizedValue = typeof newValue === "string" ? newValue.replace(/,/g, " ").replace(/\s+/g, " ").trim() : newValue; 7500 onChange({ 7501 ...value, 7502 [setting.id]: sanitizedValue 7503 }); 7504 }; 7505 const handleCheckboxChange = () => { 7506 if (isSettingActive) { 7507 if (hasValue) { 7508 handleSettingChange(""); 7509 } 7510 setIsSettingActive(false); 7511 } else { 7512 setIsSettingActive(true); 7513 } 7514 }; 7515 return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("fieldset", { children: [ 7516 /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("legend", {}), children: setting.title }), 7517 /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Stack, { direction: "column", gap: "md", children: [ 7518 /* @__PURE__ */ (0, import_jsx_runtime57.jsx)( 7519 import_components2.CheckboxControl, 7520 { 7521 label: setting.title, 7522 onChange: handleCheckboxChange, 7523 checked: isSettingActive || hasValue, 7524 "aria-expanded": isSettingActive, 7525 "aria-controls": isSettingActive ? controlledRegionId : void 0 7526 } 7527 ), 7528 isSettingActive && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { id: controlledRegionId, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)( 7529 import_components2.__experimentalInputControl, 7530 { 7531 label: (0, import_i18n9.__)("CSS classes"), 7532 value: value?.cssClasses, 7533 onChange: handleSettingChange, 7534 help: (0, import_i18n9.__)( 7535 "Separate multiple classes with spaces." 7536 ), 7537 __unstableInputWidth: "100%" 7538 } 7539 ) }) 7540 ] }) 7541 ] }); 7542 }; 7543 var css_classes_setting_default = CSSClassesSettingComponent; 7544 7545 // packages/format-library/build-module/link/inline.mjs 7546 var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1); 7547 var LINK_SETTINGS = [ 7548 ...import_block_editor5.LinkControl.DEFAULT_LINK_SETTINGS, 7549 { 7550 id: "nofollow", 7551 title: (0, import_i18n10.__)("Mark as nofollow") 7552 }, 7553 { 7554 id: "cssClasses", 7555 title: (0, import_i18n10.__)("Additional CSS class(es)"), 7556 render: (setting, value, onChange) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)( 7557 css_classes_setting_default, 7558 { 7559 setting, 7560 value, 7561 onChange 7562 } 7563 ) 7564 } 7565 ]; 7566 function InlineLinkUI({ 7567 isActive, 7568 activeAttributes, 7569 value, 7570 onChange, 7571 onFocusOutside, 7572 stopAddingLink, 7573 contentRef, 7574 focusOnMount 7575 }) { 7576 const richLinkTextValue = getRichTextValueFromSelection(value, isActive); 7577 const richTextText = richLinkTextValue.text; 7578 const { selectionChange } = (0, import_data.useDispatch)(import_block_editor5.store); 7579 const { createPageEntity, userCanCreatePages, selectionStart } = (0, import_data.useSelect)( 7580 (select) => { 7581 const { getSettings, getSelectionStart } = select(import_block_editor5.store); 7582 const _settings = getSettings(); 7583 return { 7584 createPageEntity: _settings.__experimentalCreatePageEntity, 7585 userCanCreatePages: _settings.__experimentalUserCanCreatePages, 7586 selectionStart: getSelectionStart() 7587 }; 7588 }, 7589 [] 7590 ); 7591 const linkValue = (0, import_element28.useMemo)( 7592 () => ({ 7593 url: activeAttributes.url, 7594 type: activeAttributes.type, 7595 id: activeAttributes.id, 7596 opensInNewTab: activeAttributes.target === "_blank", 7597 nofollow: activeAttributes.rel?.includes("nofollow"), 7598 title: richTextText, 7599 cssClasses: activeAttributes.class 7600 }), 7601 [ 7602 activeAttributes.class, 7603 activeAttributes.id, 7604 activeAttributes.rel, 7605 activeAttributes.target, 7606 activeAttributes.type, 7607 activeAttributes.url, 7608 richTextText 7609 ] 7610 ); 7611 function removeLink() { 7612 const newValue = (0, import_rich_text5.removeFormat)(value, "core/link"); 7613 onChange(newValue); 7614 stopAddingLink(); 7615 (0, import_a11y.speak)((0, import_i18n10.__)("Link removed."), "assertive"); 7616 } 7617 function onChangeLink(nextValue) { 7618 const hasLink = linkValue?.url; 7619 const isNewLink = !hasLink; 7620 nextValue = { 7621 ...linkValue, 7622 ...nextValue 7623 }; 7624 const newUrl = (0, import_url2.prependHTTPS)(nextValue?.url ?? ""); 7625 const linkFormat = createLinkFormat({ 7626 url: newUrl, 7627 type: nextValue.type, 7628 id: nextValue.id !== void 0 && nextValue.id !== null ? String(nextValue.id) : void 0, 7629 opensInNewWindow: nextValue.opensInNewTab, 7630 nofollow: nextValue.nofollow, 7631 cssClasses: nextValue.cssClasses 7632 }); 7633 const newText = nextValue.title || newUrl; 7634 let newValue; 7635 if ((0, import_rich_text5.isCollapsed)(value) && !isActive) { 7636 const inserted = (0, import_rich_text5.insert)(value, newText); 7637 newValue = (0, import_rich_text5.applyFormat)( 7638 inserted, 7639 linkFormat, 7640 value.start, 7641 value.start + newText.length 7642 ); 7643 onChange(newValue); 7644 stopAddingLink(); 7645 selectionChange({ 7646 clientId: selectionStart.clientId, 7647 identifier: selectionStart.attributeKey, 7648 start: value.start + newText.length + 1 7649 }); 7650 return; 7651 } else if (newText === richTextText) { 7652 const boundary = getFormatBoundary(value, { 7653 type: "core/link" 7654 }); 7655 newValue = (0, import_rich_text5.applyFormat)( 7656 value, 7657 linkFormat, 7658 boundary.start, 7659 boundary.end 7660 ); 7661 } else { 7662 newValue = (0, import_rich_text5.create)({ text: newText }); 7663 newValue = (0, import_rich_text5.applyFormat)(newValue, linkFormat, 0, newText.length); 7664 const boundary = getFormatBoundary(value, { 7665 type: "core/link" 7666 }); 7667 const splitValue = (0, import_rich_text5.split)(value, boundary.start, boundary.start); 7668 if (!splitValue) { 7669 return; 7670 } 7671 const [valBefore, valAfter] = splitValue; 7672 const newValAfter = (0, import_rich_text5.replace)(valAfter, richTextText, newValue); 7673 newValue = (0, import_rich_text5.concat)(valBefore, newValAfter); 7674 } 7675 onChange(newValue); 7676 if (!isNewLink) { 7677 stopAddingLink(); 7678 } 7679 if (!isValidHref(newUrl)) { 7680 (0, import_a11y.speak)( 7681 (0, import_i18n10.__)( 7682 "Warning: the link has been inserted but may have errors. Please test it." 7683 ), 7684 "assertive" 7685 ); 7686 } else if (isActive) { 7687 (0, import_a11y.speak)((0, import_i18n10.__)("Link edited."), "assertive"); 7688 } else { 7689 (0, import_a11y.speak)((0, import_i18n10.__)("Link inserted."), "assertive"); 7690 } 7691 } 7692 const anchorSettings = { ...link, isActive }; 7693 const popoverAnchor = (0, import_rich_text5.useAnchor)({ 7694 // eslint-disable-next-line react-hooks/refs 7695 editableContentElement: contentRef.current, 7696 settings: anchorSettings 7697 }); 7698 async function handleCreate(pageTitle) { 7699 const page = await createPageEntity({ 7700 title: pageTitle, 7701 status: "draft" 7702 }); 7703 return { 7704 id: page.id, 7705 type: page.type, 7706 title: page.title.rendered, 7707 url: page.link, 7708 kind: "post-type" 7709 }; 7710 } 7711 function createButtonText(searchTerm) { 7712 return (0, import_element28.createInterpolateElement)( 7713 (0, import_i18n10.sprintf)( 7714 /* translators: %s: search term. */ 7715 (0, import_i18n10.__)("Create page: <mark>%s</mark>"), 7716 searchTerm 7717 ), 7718 { mark: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("mark", {}) } 7719 ); 7720 } 7721 return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)( 7722 import_components3.Popover, 7723 { 7724 anchor: popoverAnchor, 7725 animate: false, 7726 onClose: stopAddingLink, 7727 onFocusOutside, 7728 placement: "bottom", 7729 offset: 8, 7730 shift: true, 7731 focusOnMount, 7732 constrainTabbing: true, 7733 children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)( 7734 import_block_editor5.LinkControl, 7735 { 7736 value: linkValue, 7737 onChange: onChangeLink, 7738 onRemove: removeLink, 7739 hasRichPreviews: true, 7740 createSuggestion: createPageEntity && handleCreate, 7741 withCreateSuggestion: userCanCreatePages, 7742 createSuggestionButtonText: createButtonText, 7743 hasTextControl: true, 7744 settings: LINK_SETTINGS, 7745 showInitialSuggestions: true, 7746 suggestionsQuery: { 7747 // always show Pages as initial suggestions 7748 initialSuggestionsSearchOptions: { 7749 type: "post", 7750 subtype: "page", 7751 perPage: 20 7752 } 7753 } 7754 } 7755 ) 7756 } 7757 ); 7758 } 7759 function getRichTextValueFromSelection(value, isActive) { 7760 let textStart = value.start; 7761 let textEnd = value.end; 7762 if (isActive) { 7763 const boundary = getFormatBoundary(value, { 7764 type: "core/link" 7765 }); 7766 textStart = boundary.start ?? value.start; 7767 textEnd = boundary.end ?? value.end; 7768 } 7769 return (0, import_rich_text5.slice)(value, textStart, textEnd); 7770 } 7771 var inline_default = InlineLinkUI; 7772 7773 // packages/format-library/build-module/link/index.mjs 7774 var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1); 7775 var name5 = "core/link"; 7776 var title5 = (0, import_i18n11.__)("Link"); 7777 function Edit2({ 7778 isActive, 7779 activeAttributes, 7780 value, 7781 onChange, 7782 onFocus, 7783 contentRef, 7784 isVisible = true 7785 }) { 7786 const [addingLink, setAddingLink] = (0, import_element29.useState)(false); 7787 const [openedBy, setOpenedBy] = (0, import_element29.useState)(null); 7788 (0, import_element29.useEffect)(() => { 7789 if (!isActive) { 7790 setAddingLink(false); 7791 } 7792 }, [isActive]); 7793 (0, import_element29.useLayoutEffect)(() => { 7794 const editableContentElement = contentRef.current; 7795 if (!editableContentElement) { 7796 return; 7797 } 7798 function handleClick(event) { 7799 const link2 = event.target.closest( 7800 "[contenteditable] a" 7801 ); 7802 if (!link2 || // other formats (e.g. bold) may be nested within the link. 7803 !isActive) { 7804 return; 7805 } 7806 setAddingLink(true); 7807 setOpenedBy({ 7808 el: link2, 7809 action: "click" 7810 }); 7811 } 7812 editableContentElement.addEventListener("click", handleClick); 7813 return () => { 7814 editableContentElement.removeEventListener("click", handleClick); 7815 }; 7816 }, [contentRef, isActive]); 7817 function addLink(target) { 7818 const text = (0, import_rich_text6.getTextContent)((0, import_rich_text6.slice)(value)); 7819 if (!isActive && text && (0, import_url3.isURL)(text) && isValidHref(text)) { 7820 onChange( 7821 (0, import_rich_text6.applyFormat)(value, { 7822 type: name5, 7823 attributes: { url: text } 7824 }) 7825 ); 7826 } else if (!isActive && text && (0, import_url3.isEmail)(text)) { 7827 onChange( 7828 (0, import_rich_text6.applyFormat)(value, { 7829 type: name5, 7830 attributes: { url: `mailto:$text}` } 7831 }) 7832 ); 7833 } else if (!isActive && text && (0, import_url3.isPhoneNumber)(text)) { 7834 onChange( 7835 (0, import_rich_text6.applyFormat)(value, { 7836 type: name5, 7837 attributes: { url: `tel:$text.replace(/\D/g, "")}` } 7838 }) 7839 ); 7840 } else { 7841 if (target) { 7842 setOpenedBy({ 7843 el: target, 7844 action: null 7845 // We don't need to distinguish between click or keyboard here 7846 }); 7847 } 7848 setAddingLink(true); 7849 } 7850 } 7851 function stopAddingLink() { 7852 setAddingLink(false); 7853 if (openedBy?.el?.tagName === "BUTTON") { 7854 openedBy.el.focus(); 7855 } else { 7856 onFocus(); 7857 } 7858 setOpenedBy(null); 7859 } 7860 function onFocusOutside() { 7861 setAddingLink(false); 7862 setOpenedBy(null); 7863 } 7864 function onRemoveFormat() { 7865 onChange((0, import_rich_text6.removeFormat)(value, name5)); 7866 (0, import_a11y2.speak)((0, import_i18n11.__)("Link removed."), "assertive"); 7867 } 7868 const shouldAutoFocus = !(openedBy?.el?.tagName === "A" && openedBy?.action === "click"); 7869 const hasSelection = !(0, import_rich_text6.isCollapsed)(value); 7870 return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [ 7871 hasSelection && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)( 7872 import_block_editor6.RichTextShortcut, 7873 { 7874 type: "primary", 7875 character: "k", 7876 onUse: addLink 7877 } 7878 ), 7879 /* @__PURE__ */ (0, import_jsx_runtime59.jsx)( 7880 import_block_editor6.RichTextShortcut, 7881 { 7882 type: "primaryShift", 7883 character: "k", 7884 onUse: onRemoveFormat 7885 } 7886 ), 7887 isVisible && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)( 7888 import_block_editor6.RichTextToolbarButton, 7889 { 7890 name: "link", 7891 icon: link_default, 7892 title: isActive ? (0, import_i18n11.__)("Link") : title5, 7893 onClick: (event) => { 7894 addLink(event.currentTarget); 7895 }, 7896 isActive: isActive || addingLink, 7897 shortcutType: "primary", 7898 shortcutCharacter: "k", 7899 "aria-haspopup": "true", 7900 "aria-expanded": addingLink 7901 } 7902 ), 7903 isVisible && addingLink && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)( 7904 inline_default, 7905 { 7906 stopAddingLink, 7907 onFocusOutside, 7908 isActive, 7909 activeAttributes, 7910 value, 7911 onChange, 7912 contentRef, 7913 focusOnMount: shouldAutoFocus ? "firstElement" : false 7914 } 7915 ) 7916 ] }); 7917 } 7918 var link = { 7919 name: name5, 7920 title: title5, 7921 tagName: "a", 7922 className: null, 7923 attributes: { 7924 url: "href", 7925 type: "data-type", 7926 id: "data-id", 7927 _id: "id", 7928 target: "target", 7929 rel: "rel", 7930 class: "class" 7931 }, 7932 __unstablePasteRule(value, { html, plainText }) { 7933 const pastedText = (html || plainText).replace(/<[^>]+>/g, "").trim(); 7934 if (!(0, import_url3.isURL)(pastedText) || !/^https?:/.test(pastedText)) { 7935 return value; 7936 } 7937 window.console.log("Created link:\n\n", pastedText); 7938 const format = { 7939 type: name5, 7940 attributes: { 7941 url: (0, import_html_entities.decodeEntities)(pastedText) 7942 } 7943 }; 7944 if ((0, import_rich_text6.isCollapsed)(value)) { 7945 return (0, import_rich_text6.insert)( 7946 value, 7947 (0, import_rich_text6.applyFormat)( 7948 (0, import_rich_text6.create)({ text: plainText }), 7949 format, 7950 0, 7951 plainText.length 7952 ) 7953 ); 7954 } 7955 return (0, import_rich_text6.applyFormat)(value, format); 7956 }, 7957 edit: Edit2 7958 }; 7959 7960 // packages/format-library/build-module/strikethrough/index.mjs 7961 var import_i18n12 = __toESM(require_i18n(), 1); 7962 var import_rich_text7 = __toESM(require_rich_text(), 1); 7963 var import_block_editor7 = __toESM(require_block_editor(), 1); 7964 var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1); 7965 var name6 = "core/strikethrough"; 7966 var title6 = (0, import_i18n12.__)("Strikethrough"); 7967 var strikethrough = { 7968 name: name6, 7969 title: title6, 7970 tagName: "s", 7971 className: null, 7972 edit({ isActive, value, onChange, onFocus }) { 7973 function onClick() { 7974 onChange((0, import_rich_text7.toggleFormat)(value, { type: name6, title: title6 })); 7975 onFocus(); 7976 } 7977 return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [ 7978 /* @__PURE__ */ (0, import_jsx_runtime60.jsx)( 7979 import_block_editor7.RichTextShortcut, 7980 { 7981 type: "access", 7982 character: "d", 7983 onUse: onClick 7984 } 7985 ), 7986 /* @__PURE__ */ (0, import_jsx_runtime60.jsx)( 7987 import_block_editor7.RichTextToolbarButton, 7988 { 7989 icon: format_strikethrough_default, 7990 title: title6, 7991 onClick, 7992 isActive, 7993 role: "menuitemcheckbox" 7994 } 7995 ) 7996 ] }); 7997 } 7998 }; 7999 8000 // packages/format-library/build-module/underline/index.mjs 8001 var import_i18n13 = __toESM(require_i18n(), 1); 8002 var import_rich_text8 = __toESM(require_rich_text(), 1); 8003 var import_block_editor8 = __toESM(require_block_editor(), 1); 8004 var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1); 8005 var name7 = "core/underline"; 8006 var title7 = (0, import_i18n13.__)("Underline"); 8007 var underline = { 8008 name: name7, 8009 title: title7, 8010 tagName: "span", 8011 className: null, 8012 attributes: { 8013 style: "style" 8014 }, 8015 edit({ value, onChange }) { 8016 const onToggle = () => { 8017 onChange( 8018 (0, import_rich_text8.toggleFormat)(value, { 8019 type: name7, 8020 attributes: { 8021 style: "text-decoration: underline;" 8022 }, 8023 title: title7 8024 }) 8025 ); 8026 }; 8027 return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [ 8028 /* @__PURE__ */ (0, import_jsx_runtime61.jsx)( 8029 import_block_editor8.RichTextShortcut, 8030 { 8031 type: "primary", 8032 character: "u", 8033 onUse: onToggle 8034 } 8035 ), 8036 /* @__PURE__ */ (0, import_jsx_runtime61.jsx)( 8037 import_block_editor8.__unstableRichTextInputEvent, 8038 { 8039 inputType: "formatUnderline", 8040 onInput: onToggle 8041 } 8042 ) 8043 ] }); 8044 } 8045 }; 8046 8047 // packages/format-library/build-module/text-color/index.mjs 8048 var import_i18n15 = __toESM(require_i18n(), 1); 8049 var import_element31 = __toESM(require_element(), 1); 8050 var import_block_editor10 = __toESM(require_block_editor(), 1); 8051 var import_rich_text10 = __toESM(require_rich_text(), 1); 8052 8053 // packages/format-library/build-module/text-color/inline.mjs 8054 var import_element30 = __toESM(require_element(), 1); 8055 var import_data2 = __toESM(require_data(), 1); 8056 var import_rich_text9 = __toESM(require_rich_text(), 1); 8057 var import_block_editor9 = __toESM(require_block_editor(), 1); 8058 var import_components4 = __toESM(require_components(), 1); 8059 var import_i18n14 = __toESM(require_i18n(), 1); 8060 var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1); 8061 var TABS = [ 8062 { name: "color", title: (0, import_i18n14.__)("Text") }, 8063 { name: "backgroundColor", title: (0, import_i18n14.__)("Background") } 8064 ]; 8065 function parseCSS(css = "") { 8066 return css.split(";").reduce( 8067 (accumulator, rule) => { 8068 if (rule) { 8069 const [property, value] = rule.split(":"); 8070 if (property === "color") { 8071 accumulator.color = value; 8072 } 8073 if (property === "background-color" && value !== transparentValue) { 8074 accumulator.backgroundColor = value; 8075 } 8076 } 8077 return accumulator; 8078 }, 8079 {} 8080 ); 8081 } 8082 function parseClassName(className = "", colorSettings) { 8083 return className.split(" ").reduce((accumulator, name16) => { 8084 if (name16.startsWith("has-") && name16.endsWith("-color")) { 8085 const colorSlug = name16.replace(/^has-/, "").replace(/-color$/, ""); 8086 const colorObject = (0, import_block_editor9.getColorObjectByAttributeValues)( 8087 colorSettings, 8088 colorSlug 8089 ); 8090 accumulator.color = colorObject.color; 8091 } 8092 return accumulator; 8093 }, {}); 8094 } 8095 function getActiveColors(value, name16, colorSettings) { 8096 const activeColorFormat = (0, import_rich_text9.getActiveFormat)(value, name16); 8097 if (!activeColorFormat) { 8098 return {}; 8099 } 8100 return { 8101 ...parseCSS(activeColorFormat.attributes?.style), 8102 ...parseClassName(activeColorFormat.attributes?.class, colorSettings) 8103 }; 8104 } 8105 function setColors(value, name16, colorSettings, colors) { 8106 const { color, backgroundColor } = { 8107 ...getActiveColors(value, name16, colorSettings), 8108 ...colors 8109 }; 8110 if (!color && !backgroundColor) { 8111 return (0, import_rich_text9.removeFormat)(value, name16); 8112 } 8113 const styles = []; 8114 const classNames = []; 8115 const attributes = {}; 8116 if (backgroundColor) { 8117 styles.push(["background-color", backgroundColor].join(":")); 8118 } else { 8119 styles.push(["background-color", transparentValue].join(":")); 8120 } 8121 if (color) { 8122 const colorObject = (0, import_block_editor9.getColorObjectByColorValue)(colorSettings, color); 8123 if (colorObject && colorObject.slug) { 8124 const colorClassName = (0, import_block_editor9.getColorClassName)( 8125 "color", 8126 colorObject.slug 8127 ); 8128 if (colorClassName) { 8129 classNames.push(colorClassName); 8130 } 8131 } else { 8132 styles.push(["color", color].join(":")); 8133 } 8134 } 8135 if (styles.length) { 8136 attributes.style = styles.join(";"); 8137 } 8138 if (classNames.length) { 8139 attributes.class = classNames.join(" "); 8140 } 8141 return (0, import_rich_text9.applyFormat)(value, { type: name16, attributes }); 8142 } 8143 function ColorPicker({ name: name16, property, value, onChange }) { 8144 const colors = (0, import_data2.useSelect)((select) => { 8145 const { getSettings } = select(import_block_editor9.store); 8146 return getSettings().colors ?? []; 8147 }, []); 8148 const activeColors = (0, import_element30.useMemo)( 8149 () => getActiveColors(value, name16, colors), 8150 [name16, value, colors] 8151 ); 8152 return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)( 8153 import_block_editor9.ColorPalette, 8154 { 8155 value: activeColors[property], 8156 onChange: (color) => { 8157 onChange( 8158 setColors(value, name16, colors, { [property]: color }) 8159 ); 8160 }, 8161 enableAlpha: true, 8162 __experimentalIsRenderedInSidebar: true 8163 } 8164 ); 8165 } 8166 function InlineColorUI({ 8167 name: name16, 8168 value, 8169 onChange, 8170 onClose, 8171 contentRef, 8172 isActive 8173 }) { 8174 const anchorSettings = { ...textColor, isActive }; 8175 const popoverAnchor = (0, import_rich_text9.useAnchor)({ 8176 // eslint-disable-next-line react-hooks/refs 8177 editableContentElement: contentRef.current, 8178 settings: anchorSettings 8179 }); 8180 return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)( 8181 import_components4.Popover, 8182 { 8183 onClose, 8184 className: "format-library__inline-color-popover", 8185 anchor: popoverAnchor, 8186 children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(tabs_exports.Root, { defaultValue: TABS[0].name, children: [ 8187 /* @__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)) }), 8188 TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)( 8189 tabs_exports.Panel, 8190 { 8191 value: tab.name, 8192 tabIndex: -1, 8193 children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)( 8194 ColorPicker, 8195 { 8196 name: name16, 8197 property: tab.name, 8198 value, 8199 onChange 8200 } 8201 ) 8202 }, 8203 tab.name 8204 )) 8205 ] }) 8206 } 8207 ); 8208 } 8209 8210 // packages/format-library/build-module/text-color/index.mjs 8211 var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1); 8212 var transparentValue = "rgba(0, 0, 0, 0)"; 8213 var name8 = "core/text-color"; 8214 var title8 = (0, import_i18n15.__)("Highlight"); 8215 var EMPTY_ARRAY3 = []; 8216 function getComputedStyleProperty(element, property) { 8217 const { ownerDocument: ownerDocument2 } = element; 8218 const { defaultView } = ownerDocument2; 8219 const style = defaultView?.getComputedStyle(element); 8220 const value = style?.getPropertyValue(property); 8221 if (property === "background-color" && value === transparentValue && element.parentElement) { 8222 return getComputedStyleProperty(element.parentElement, property); 8223 } 8224 return value; 8225 } 8226 function fillComputedColors(element, { color, backgroundColor }) { 8227 if (!element || !color && !backgroundColor) { 8228 return; 8229 } 8230 return { 8231 color: color || getComputedStyleProperty(element, "color"), 8232 backgroundColor: backgroundColor === transparentValue ? getComputedStyleProperty(element, "background-color") : backgroundColor 8233 }; 8234 } 8235 function TextColorEdit({ 8236 value, 8237 onChange, 8238 isActive, 8239 activeAttributes, 8240 contentRef 8241 }) { 8242 const [allowCustomControl, colors = EMPTY_ARRAY3] = (0, import_block_editor10.useSettings)( 8243 "color.custom", 8244 "color.palette" 8245 ); 8246 const [isAddingColor, setIsAddingColor] = (0, import_element31.useState)(false); 8247 const colorIndicatorStyle = (0, import_element31.useMemo)( 8248 () => fillComputedColors( 8249 contentRef.current, 8250 getActiveColors(value, name8, colors) 8251 ), 8252 [contentRef, value, colors] 8253 ); 8254 const hasColorsToChoose = !!colors.length || allowCustomControl; 8255 if (!hasColorsToChoose && !isActive) { 8256 return null; 8257 } 8258 return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [ 8259 /* @__PURE__ */ (0, import_jsx_runtime63.jsx)( 8260 import_block_editor10.RichTextToolbarButton, 8261 { 8262 className: "format-library-text-color-button", 8263 isActive, 8264 icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)( 8265 icon_default, 8266 { 8267 icon: Object.keys(activeAttributes).length ? text_color_default : color_default, 8268 style: colorIndicatorStyle 8269 } 8270 ), 8271 title: title8, 8272 onClick: hasColorsToChoose ? () => setIsAddingColor(true) : () => onChange((0, import_rich_text10.removeFormat)(value, name8)), 8273 role: "menuitemcheckbox" 8274 } 8275 ), 8276 isAddingColor && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)( 8277 InlineColorUI, 8278 { 8279 name: name8, 8280 onClose: () => setIsAddingColor(false), 8281 value, 8282 onChange, 8283 contentRef, 8284 isActive 8285 } 8286 ) 8287 ] }); 8288 } 8289 var textColor = { 8290 name: name8, 8291 title: title8, 8292 tagName: "mark", 8293 className: "has-inline-color", 8294 attributes: { 8295 style: "style", 8296 class: "class" 8297 }, 8298 edit: TextColorEdit 8299 }; 8300 8301 // packages/format-library/build-module/subscript/index.mjs 8302 var import_i18n16 = __toESM(require_i18n(), 1); 8303 var import_rich_text11 = __toESM(require_rich_text(), 1); 8304 var import_block_editor11 = __toESM(require_block_editor(), 1); 8305 var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1); 8306 var name9 = "core/subscript"; 8307 var title9 = (0, import_i18n16.__)("Subscript"); 8308 var subscript = { 8309 name: name9, 8310 title: title9, 8311 tagName: "sub", 8312 className: null, 8313 edit({ isActive, value, onChange, onFocus }) { 8314 function onToggle() { 8315 onChange((0, import_rich_text11.toggleFormat)(value, { type: name9, title: title9 })); 8316 } 8317 function onClick() { 8318 onToggle(); 8319 onFocus(); 8320 } 8321 return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)( 8322 import_block_editor11.RichTextToolbarButton, 8323 { 8324 icon: subscript_default, 8325 title: title9, 8326 onClick, 8327 isActive, 8328 role: "menuitemcheckbox" 8329 } 8330 ); 8331 } 8332 }; 8333 8334 // packages/format-library/build-module/superscript/index.mjs 8335 var import_i18n17 = __toESM(require_i18n(), 1); 8336 var import_rich_text12 = __toESM(require_rich_text(), 1); 8337 var import_block_editor12 = __toESM(require_block_editor(), 1); 8338 var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1); 8339 var name10 = "core/superscript"; 8340 var title10 = (0, import_i18n17.__)("Superscript"); 8341 var superscript = { 8342 name: name10, 8343 title: title10, 8344 tagName: "sup", 8345 className: null, 8346 edit({ isActive, value, onChange, onFocus }) { 8347 function onToggle() { 8348 onChange((0, import_rich_text12.toggleFormat)(value, { type: name10, title: title10 })); 8349 } 8350 function onClick() { 8351 onToggle(); 8352 onFocus(); 8353 } 8354 return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)( 8355 import_block_editor12.RichTextToolbarButton, 8356 { 8357 icon: superscript_default, 8358 title: title10, 8359 onClick, 8360 isActive, 8361 role: "menuitemcheckbox" 8362 } 8363 ); 8364 } 8365 }; 8366 8367 // packages/format-library/build-module/keyboard/index.mjs 8368 var import_i18n18 = __toESM(require_i18n(), 1); 8369 var import_rich_text13 = __toESM(require_rich_text(), 1); 8370 var import_block_editor13 = __toESM(require_block_editor(), 1); 8371 var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1); 8372 var name11 = "core/keyboard"; 8373 var title11 = (0, import_i18n18.__)("Keyboard input"); 8374 var keyboard2 = { 8375 name: name11, 8376 title: title11, 8377 tagName: "kbd", 8378 className: null, 8379 edit({ isActive, value, onChange, onFocus }) { 8380 function onToggle() { 8381 onChange((0, import_rich_text13.toggleFormat)(value, { type: name11, title: title11 })); 8382 } 8383 function onClick() { 8384 onToggle(); 8385 onFocus(); 8386 } 8387 return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)( 8388 import_block_editor13.RichTextToolbarButton, 8389 { 8390 icon: button_default, 8391 title: title11, 8392 onClick, 8393 isActive, 8394 role: "menuitemcheckbox" 8395 } 8396 ); 8397 } 8398 }; 8399 8400 // packages/format-library/build-module/unknown/index.mjs 8401 var import_i18n19 = __toESM(require_i18n(), 1); 8402 var import_rich_text14 = __toESM(require_rich_text(), 1); 8403 var import_block_editor14 = __toESM(require_block_editor(), 1); 8404 var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1); 8405 var name12 = "core/unknown"; 8406 var title12 = (0, import_i18n19.__)("Clear Unknown Formatting"); 8407 function selectionContainsUnknownFormats(value) { 8408 if ((0, import_rich_text14.isCollapsed)(value)) { 8409 return false; 8410 } 8411 const selectedValue = (0, import_rich_text14.slice)(value); 8412 return selectedValue.formats.some((formats) => { 8413 return formats.some((format) => format.type === name12); 8414 }); 8415 } 8416 var unknown = { 8417 name: name12, 8418 title: title12, 8419 tagName: "*", 8420 className: null, 8421 edit({ isActive, value, onChange, onFocus }) { 8422 if (!isActive && !selectionContainsUnknownFormats(value)) { 8423 return null; 8424 } 8425 function onClick() { 8426 onChange((0, import_rich_text14.removeFormat)(value, name12)); 8427 onFocus(); 8428 } 8429 return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)( 8430 import_block_editor14.RichTextToolbarButton, 8431 { 8432 name: "unknown", 8433 icon: help_default, 8434 title: title12, 8435 onClick, 8436 isActive: true 8437 } 8438 ); 8439 } 8440 }; 8441 8442 // packages/format-library/build-module/language/index.mjs 8443 var import_i18n20 = __toESM(require_i18n(), 1); 8444 var import_block_editor15 = __toESM(require_block_editor(), 1); 8445 var import_components5 = __toESM(require_components(), 1); 8446 var import_element32 = __toESM(require_element(), 1); 8447 var import_rich_text15 = __toESM(require_rich_text(), 1); 8448 var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1); 8449 var name13 = "core/language"; 8450 var title13 = (0, import_i18n20.__)("Language"); 8451 var language = { 8452 name: name13, 8453 title: title13, 8454 tagName: "bdo", 8455 className: null, 8456 attributes: { 8457 lang: "lang", 8458 dir: "dir" 8459 }, 8460 edit: Edit3 8461 }; 8462 function Edit3({ isActive, value, onChange, contentRef }) { 8463 const [isPopoverVisible, setIsPopoverVisible] = (0, import_element32.useState)(false); 8464 const togglePopover = () => { 8465 setIsPopoverVisible((state) => !state); 8466 }; 8467 return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [ 8468 /* @__PURE__ */ (0, import_jsx_runtime68.jsx)( 8469 import_block_editor15.RichTextToolbarButton, 8470 { 8471 icon: language_default, 8472 label: title13, 8473 title: title13, 8474 onClick: () => { 8475 if (isActive) { 8476 onChange((0, import_rich_text15.removeFormat)(value, name13)); 8477 } else { 8478 togglePopover(); 8479 } 8480 }, 8481 isActive, 8482 role: "menuitemcheckbox" 8483 } 8484 ), 8485 isPopoverVisible && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)( 8486 InlineLanguageUI, 8487 { 8488 value, 8489 onChange, 8490 onClose: togglePopover, 8491 contentRef 8492 } 8493 ) 8494 ] }); 8495 } 8496 function InlineLanguageUI({ 8497 value, 8498 contentRef, 8499 onChange, 8500 onClose 8501 }) { 8502 const popoverAnchor = (0, import_rich_text15.useAnchor)({ 8503 // eslint-disable-next-line react-hooks/refs 8504 editableContentElement: contentRef.current, 8505 settings: language 8506 }); 8507 const [lang, setLang] = (0, import_element32.useState)(""); 8508 const [dir, setDir] = (0, import_element32.useState)("ltr"); 8509 return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)( 8510 import_components5.Popover, 8511 { 8512 className: "block-editor-format-toolbar__language-popover", 8513 anchor: popoverAnchor, 8514 onClose, 8515 children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)( 8516 Stack, 8517 { 8518 render: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("form", {}), 8519 direction: "column", 8520 gap: "lg", 8521 className: "block-editor-format-toolbar__language-container-content", 8522 onSubmit: (event) => { 8523 event.preventDefault(); 8524 onChange( 8525 (0, import_rich_text15.applyFormat)(value, { 8526 type: name13, 8527 attributes: { 8528 lang, 8529 dir 8530 } 8531 }) 8532 ); 8533 onClose(); 8534 }, 8535 children: [ 8536 /* @__PURE__ */ (0, import_jsx_runtime68.jsx)( 8537 import_components5.TextControl, 8538 { 8539 label: title13, 8540 value: lang, 8541 onChange: (val) => setLang(val), 8542 help: (0, import_i18n20.__)( 8543 'A valid language attribute, like "en" or "fr".' 8544 ) 8545 } 8546 ), 8547 /* @__PURE__ */ (0, import_jsx_runtime68.jsx)( 8548 import_components5.SelectControl, 8549 { 8550 label: (0, import_i18n20.__)("Text direction"), 8551 value: dir, 8552 options: [ 8553 { 8554 label: (0, import_i18n20.__)("Left to right"), 8555 value: "ltr" 8556 }, 8557 { 8558 label: (0, import_i18n20.__)("Right to left"), 8559 value: "rtl" 8560 } 8561 ], 8562 onChange: (val) => setDir(val) 8563 } 8564 ), 8565 /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)( 8566 import_components5.Button, 8567 { 8568 __next40pxDefaultSize: true, 8569 variant: "primary", 8570 type: "submit", 8571 text: (0, import_i18n20.__)("Apply") 8572 } 8573 ) }) 8574 ] 8575 } 8576 ) 8577 } 8578 ); 8579 } 8580 8581 // packages/format-library/build-module/math/index.mjs 8582 var import_i18n21 = __toESM(require_i18n(), 1); 8583 var import_element33 = __toESM(require_element(), 1); 8584 var import_rich_text16 = __toESM(require_rich_text(), 1); 8585 var import_block_editor16 = __toESM(require_block_editor(), 1); 8586 var import_components6 = __toESM(require_components(), 1); 8587 var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1); 8588 var name14 = "core/math"; 8589 var title14 = (0, import_i18n21.__)("Math"); 8590 function InlineUI2({ 8591 value, 8592 onChange, 8593 activeAttributes, 8594 contentRef, 8595 latexToMathML 8596 }) { 8597 const [latex, setLatex] = (0, import_element33.useState)( 8598 activeAttributes?.["data-latex"] || "" 8599 ); 8600 const [error2, setError] = (0, import_element33.useState)(null); 8601 const formRef = (0, import_element33.useRef)(null); 8602 const popoverAnchor = (0, import_rich_text16.useAnchor)({ 8603 // eslint-disable-next-line react-hooks/refs 8604 editableContentElement: contentRef.current, 8605 settings: math 8606 }); 8607 const handleLatexChange = (newLatex) => { 8608 setLatex(newLatex); 8609 let mathML = ""; 8610 if (newLatex && latexToMathML) { 8611 try { 8612 mathML = latexToMathML(newLatex, { displayMode: false }); 8613 setError(null); 8614 } catch (err) { 8615 setError( 8616 err instanceof Error ? err.message : (0, import_i18n21.__)("Could not parse the LaTeX math syntax.") 8617 ); 8618 } 8619 } else { 8620 setError(null); 8621 } 8622 const newReplacements = value.replacements.slice(); 8623 newReplacements[value.start] = { 8624 type: name14, 8625 attributes: { 8626 "data-latex": newLatex 8627 }, 8628 innerHTML: mathML 8629 }; 8630 onChange({ 8631 ...value, 8632 replacements: newReplacements 8633 }); 8634 }; 8635 return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)( 8636 import_components6.Popover, 8637 { 8638 placement: "bottom-start", 8639 offset: 8, 8640 focusOnMount: false, 8641 anchor: popoverAnchor, 8642 onFocusOutside: () => formRef.current?.reportValidity(), 8643 className: "block-editor-format-toolbar__math-popover", 8644 children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)( 8645 "form", 8646 { 8647 ref: formRef, 8648 style: { minWidth: "300px", padding: "4px" }, 8649 onSubmit: (event) => event.preventDefault(), 8650 children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)( 8651 ValidatedInputControl, 8652 { 8653 hideLabelFromVision: true, 8654 label: (0, import_i18n21.__)("LaTeX math syntax"), 8655 value: latex, 8656 customValidity: error2 ? { type: "invalid", message: error2 } : void 0, 8657 onValueChange: handleLatexChange, 8658 placeholder: (0, import_i18n21.__)("e.g., x^2, \\frac{a}{b}"), 8659 autoComplete: "off", 8660 className: "block-editor-format-toolbar__math-input" 8661 } 8662 ) 8663 } 8664 ) 8665 } 8666 ); 8667 } 8668 function Edit4({ 8669 value, 8670 onChange, 8671 onFocus, 8672 isObjectActive, 8673 activeObjectAttributes, 8674 contentRef 8675 }) { 8676 const [latexToMathML, setLatexToMathML] = (0, import_element33.useState)(); 8677 (0, import_element33.useEffect)(() => { 8678 import("@wordpress/latex-to-mathml").then((module) => { 8679 setLatexToMathML(() => module.default); 8680 }); 8681 }, []); 8682 function onClick() { 8683 let newValue; 8684 if (isObjectActive) { 8685 const latex = activeObjectAttributes?.["data-latex"] || ""; 8686 newValue = (0, import_rich_text16.insert)(value, latex); 8687 newValue.start = newValue.end - latex.length; 8688 } else { 8689 const selectedText = (0, import_rich_text16.getTextContent)((0, import_rich_text16.slice)(value)); 8690 let innerHTML = ""; 8691 if (selectedText && latexToMathML) { 8692 try { 8693 innerHTML = latexToMathML(selectedText, { 8694 displayMode: false 8695 }); 8696 } catch { 8697 } 8698 } 8699 newValue = (0, import_rich_text16.insertObject)(value, { 8700 type: name14, 8701 attributes: { "data-latex": selectedText }, 8702 innerHTML 8703 }); 8704 newValue.start = newValue.end - 1; 8705 } 8706 onChange(newValue); 8707 onFocus(); 8708 } 8709 return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [ 8710 /* @__PURE__ */ (0, import_jsx_runtime69.jsx)( 8711 import_block_editor16.RichTextToolbarButton, 8712 { 8713 icon: math_default, 8714 title: title14, 8715 onClick, 8716 isActive: isObjectActive 8717 } 8718 ), 8719 isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)( 8720 InlineUI2, 8721 { 8722 value, 8723 onChange, 8724 activeAttributes: activeObjectAttributes, 8725 contentRef, 8726 latexToMathML 8727 } 8728 ) 8729 ] }); 8730 } 8731 var math = { 8732 name: name14, 8733 title: title14, 8734 tagName: "math", 8735 className: null, 8736 attributes: { 8737 "data-latex": "data-latex" 8738 }, 8739 contentEditable: false, 8740 edit: Edit4 8741 }; 8742 8743 // packages/format-library/build-module/non-breaking-space/index.mjs 8744 var import_i18n22 = __toESM(require_i18n(), 1); 8745 var import_rich_text17 = __toESM(require_rich_text(), 1); 8746 var import_block_editor17 = __toESM(require_block_editor(), 1); 8747 var import_components7 = __toESM(require_components(), 1); 8748 var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1); 8749 var name15 = "core/non-breaking-space"; 8750 var title15 = (0, import_i18n22.__)("Non breaking space"); 8751 function PopoverAnchor({ contentRef }) { 8752 const popoverAnchor = (0, import_rich_text17.useAnchor)({ 8753 // eslint-disable-next-line react-hooks/refs 8754 editableContentElement: contentRef.current, 8755 settings: nonBreakingSpace 8756 }); 8757 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") }) }); 8758 } 8759 var nonBreakingSpace = { 8760 name: name15, 8761 title: title15, 8762 tagName: "span", 8763 className: "non-breaking-space", 8764 edit({ value, onChange, contentRef }) { 8765 function addNonBreakingSpace() { 8766 onChange((0, import_rich_text17.insert)(value, "\xA0")); 8767 } 8768 const selectedValue = value.start && value.end ? value.text.slice(value.start, value.end) : null; 8769 return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [ 8770 /* @__PURE__ */ (0, import_jsx_runtime70.jsx)( 8771 import_block_editor17.RichTextShortcut, 8772 { 8773 type: "primaryShift", 8774 character: " ", 8775 onUse: addNonBreakingSpace 8776 } 8777 ), 8778 selectedValue === "\xA0" && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PopoverAnchor, { contentRef }) 8779 ] }); 8780 }, 8781 __experimentalCreatePrepareEditableTree() { 8782 return (formats, text) => { 8783 const NBSP = "\xA0"; 8784 let record = { formats, text }; 8785 let index = -1; 8786 do { 8787 index = text.indexOf(NBSP, index + 1); 8788 if (index !== -1) { 8789 record = (0, import_rich_text17.applyFormat)( 8790 record, 8791 { type: name15 }, 8792 index, 8793 index + 1 8794 ); 8795 } 8796 } while (index !== -1); 8797 return record.formats; 8798 }; 8799 } 8800 }; 8801 8802 // packages/format-library/build-module/default-formats.mjs 8803 var default_formats_default = [ 8804 bold, 8805 code, 8806 image, 8807 italic, 8808 link, 8809 strikethrough, 8810 underline, 8811 textColor, 8812 subscript, 8813 superscript, 8814 keyboard2, 8815 unknown, 8816 language, 8817 math, 8818 nonBreakingSpace 8819 ]; 8820 8821 // packages/format-library/build-module/index.mjs 8822 default_formats_default.forEach( 8823 ({ name: name16, ...settings }) => (0, import_rich_text18.registerFormatType)(name16, settings) 8824 ); 8825 })(); 8826 /*! Bundled license information: 8827 8828 use-sync-external-store/cjs/use-sync-external-store-shim.development.js: 8829 (** 8830 * @license React 8831 * use-sync-external-store-shim.development.js 8832 * 8833 * Copyright (c) Meta Platforms, Inc. and affiliates. 8834 * 8835 * This source code is licensed under the MIT license found in the 8836 * LICENSE file in the root directory of this source tree. 8837 *) 8838 */ 8839 (window.wp ||= {}).formatLibrary = wp.formatLibrary; 8840 })();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Wed Sep 16 08:20:31 2026 | Cross-referenced by PHPXref |