| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 var __create = Object.create; 2 var __defProp = Object.defineProperty; 3 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 4 var __getOwnPropNames = Object.getOwnPropertyNames; 5 var __getProtoOf = Object.getPrototypeOf; 6 var __hasOwnProp = Object.prototype.hasOwnProperty; 7 var __commonJS = (cb, mod) => function __require() { 8 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 9 }; 10 var __export = (target, all) => { 11 for (var name in all) 12 __defProp(target, name, { get: all[name], enumerable: true }); 13 }; 14 var __copyProps = (to, from, except, desc) => { 15 if (from && typeof from === "object" || typeof from === "function") { 16 for (let key of __getOwnPropNames(from)) 17 if (!__hasOwnProp.call(to, key) && key !== except) 18 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 19 } 20 return to; 21 }; 22 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 23 // If the importer is in node compatibility mode or this is not an ESM 24 // file that has been converted to a CommonJS file using a Babel- 25 // compatible transform (i.e. "__esModule" has not been set), then set 26 // "default" to the CommonJS "module.exports" for node compatibility. 27 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 28 mod 29 )); 30 31 // package-external:@wordpress/i18n 32 var require_i18n = __commonJS({ 33 "package-external:@wordpress/i18n"(exports, module) { 34 module.exports = window.wp.i18n; 35 } 36 }); 37 38 // vendor-external:react 39 var require_react = __commonJS({ 40 "vendor-external:react"(exports, module) { 41 module.exports = window.React; 42 } 43 }); 44 45 // vendor-external:react/jsx-runtime 46 var require_jsx_runtime = __commonJS({ 47 "vendor-external:react/jsx-runtime"(exports, module) { 48 module.exports = window.ReactJSXRuntime; 49 } 50 }); 51 52 // vendor-external:react-dom 53 var require_react_dom = __commonJS({ 54 "vendor-external:react-dom"(exports, module) { 55 module.exports = window.ReactDOM; 56 } 57 }); 58 59 // package-external:@wordpress/element 60 var require_element = __commonJS({ 61 "package-external:@wordpress/element"(exports, module) { 62 module.exports = window.wp.element; 63 } 64 }); 65 66 // package-external:@wordpress/warning 67 var require_warning = __commonJS({ 68 "package-external:@wordpress/warning"(exports, module) { 69 module.exports = window.wp.warning; 70 } 71 }); 72 73 // package-external:@wordpress/primitives 74 var require_primitives = __commonJS({ 75 "package-external:@wordpress/primitives"(exports, module) { 76 module.exports = window.wp.primitives; 77 } 78 }); 79 80 // node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js 81 var require_use_sync_external_store_shim_development = __commonJS({ 82 "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { 83 "use strict"; 84 (function() { 85 function is(x, y) { 86 return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; 87 } 88 function useSyncExternalStore$2(subscribe, getSnapshot) { 89 didWarnOld18Alpha || void 0 === React54.startTransition || (didWarnOld18Alpha = true, console.error( 90 "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." 91 )); 92 var value = getSnapshot(); 93 if (!didWarnUncachedGetSnapshot) { 94 var cachedValue = getSnapshot(); 95 objectIs(value, cachedValue) || (console.error( 96 "The result of getSnapshot should be cached to avoid an infinite loop" 97 ), didWarnUncachedGetSnapshot = true); 98 } 99 cachedValue = useState19({ 100 inst: { value, getSnapshot } 101 }); 102 var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; 103 useLayoutEffect3( 104 function() { 105 inst.value = value; 106 inst.getSnapshot = getSnapshot; 107 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 108 }, 109 [subscribe, value, getSnapshot] 110 ); 111 useEffect15( 112 function() { 113 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 114 return subscribe(function() { 115 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 116 }); 117 }, 118 [subscribe] 119 ); 120 useDebugValue2(value); 121 return value; 122 } 123 function checkIfSnapshotChanged(inst) { 124 var latestGetSnapshot = inst.getSnapshot; 125 inst = inst.value; 126 try { 127 var nextValue = latestGetSnapshot(); 128 return !objectIs(inst, nextValue); 129 } catch (error) { 130 return true; 131 } 132 } 133 function useSyncExternalStore$1(subscribe, getSnapshot) { 134 return getSnapshot(); 135 } 136 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); 137 var React54 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState19 = React54.useState, useEffect15 = React54.useEffect, useLayoutEffect3 = React54.useLayoutEffect, useDebugValue2 = React54.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; 138 exports.useSyncExternalStore = void 0 !== React54.useSyncExternalStore ? React54.useSyncExternalStore : shim; 139 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); 140 })(); 141 } 142 }); 143 144 // node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/index.js 145 var require_shim = __commonJS({ 146 "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/index.js"(exports, module) { 147 "use strict"; 148 if (false) { 149 module.exports = null; 150 } else { 151 module.exports = require_use_sync_external_store_shim_development(); 152 } 153 } 154 }); 155 156 // node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js 157 var require_with_selector_development = __commonJS({ 158 "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) { 159 "use strict"; 160 (function() { 161 function is(x, y) { 162 return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; 163 } 164 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); 165 var React54 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef20 = React54.useRef, useEffect15 = React54.useEffect, useMemo18 = React54.useMemo, useDebugValue2 = React54.useDebugValue; 166 exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { 167 var instRef = useRef20(null); 168 if (null === instRef.current) { 169 var inst = { hasValue: false, value: null }; 170 instRef.current = inst; 171 } else inst = instRef.current; 172 instRef = useMemo18( 173 function() { 174 function memoizedSelector(nextSnapshot) { 175 if (!hasMemo) { 176 hasMemo = true; 177 memoizedSnapshot = nextSnapshot; 178 nextSnapshot = selector(nextSnapshot); 179 if (void 0 !== isEqual && inst.hasValue) { 180 var currentSelection = inst.value; 181 if (isEqual(currentSelection, nextSnapshot)) 182 return memoizedSelection = currentSelection; 183 } 184 return memoizedSelection = nextSnapshot; 185 } 186 currentSelection = memoizedSelection; 187 if (objectIs(memoizedSnapshot, nextSnapshot)) 188 return currentSelection; 189 var nextSelection = selector(nextSnapshot); 190 if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) 191 return memoizedSnapshot = nextSnapshot, currentSelection; 192 memoizedSnapshot = nextSnapshot; 193 return memoizedSelection = nextSelection; 194 } 195 var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; 196 return [ 197 function() { 198 return memoizedSelector(getSnapshot()); 199 }, 200 null === maybeGetServerSnapshot ? void 0 : function() { 201 return memoizedSelector(maybeGetServerSnapshot()); 202 } 203 ]; 204 }, 205 [getSnapshot, getServerSnapshot, selector, isEqual] 206 ); 207 var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]); 208 useEffect15( 209 function() { 210 inst.hasValue = true; 211 inst.value = value; 212 }, 213 [value] 214 ); 215 useDebugValue2(value); 216 return value; 217 }; 218 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); 219 })(); 220 } 221 }); 222 223 // node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/with-selector.js 224 var require_with_selector = __commonJS({ 225 "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) { 226 "use strict"; 227 if (false) { 228 module.exports = null; 229 } else { 230 module.exports = require_with_selector_development(); 231 } 232 } 233 }); 234 235 // package-external:@wordpress/compose 236 var require_compose = __commonJS({ 237 "package-external:@wordpress/compose"(exports, module) { 238 module.exports = window.wp.compose; 239 } 240 }); 241 242 // package-external:@wordpress/theme 243 var require_theme = __commonJS({ 244 "package-external:@wordpress/theme"(exports, module) { 245 module.exports = window.wp.theme; 246 } 247 }); 248 249 // package-external:@wordpress/private-apis 250 var require_private_apis = __commonJS({ 251 "package-external:@wordpress/private-apis"(exports, module) { 252 module.exports = window.wp.privateApis; 253 } 254 }); 255 256 // package-external:@wordpress/core-data 257 var require_core_data = __commonJS({ 258 "package-external:@wordpress/core-data"(exports, module) { 259 module.exports = window.wp.coreData; 260 } 261 }); 262 263 // package-external:@wordpress/components 264 var require_components = __commonJS({ 265 "package-external:@wordpress/components"(exports, module) { 266 module.exports = window.wp.components; 267 } 268 }); 269 270 // package-external:@wordpress/data 271 var require_data = __commonJS({ 272 "package-external:@wordpress/data"(exports, module) { 273 module.exports = window.wp.data; 274 } 275 }); 276 277 // package-external:@wordpress/url 278 var require_url = __commonJS({ 279 "package-external:@wordpress/url"(exports, module) { 280 module.exports = window.wp.url; 281 } 282 }); 283 284 // package-external:@wordpress/html-entities 285 var require_html_entities = __commonJS({ 286 "package-external:@wordpress/html-entities"(exports, module) { 287 module.exports = window.wp.htmlEntities; 288 } 289 }); 290 291 // packages/core-fields/build-module/attachment/alt_text/field.mjs 292 var import_i18n3 = __toESM(require_i18n(), 1); 293 294 // packages/ui/build-module/avatar/index.mjs 295 var avatar_exports = {}; 296 __export(avatar_exports, { 297 Fallback: () => Fallback, 298 Image: () => Image, 299 Initials: () => Initials, 300 Root: () => Root 301 }); 302 303 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/avatar/index.parts.mjs 304 var index_parts_exports = {}; 305 __export(index_parts_exports, { 306 Fallback: () => AvatarFallback, 307 Image: () => AvatarImage, 308 Root: () => AvatarRoot 309 }); 310 311 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/avatar/root/AvatarRoot.mjs 312 var React6 = __toESM(require_react(), 1); 313 314 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useRenderElement.mjs 315 var React4 = __toESM(require_react(), 1); 316 317 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useRefWithInit.mjs 318 var React = __toESM(require_react(), 1); 319 var UNINITIALIZED = {}; 320 function useRefWithInit(init, initArg) { 321 const ref = React.useRef(UNINITIALIZED); 322 if (ref.current === UNINITIALIZED) { 323 ref.current = init(initArg); 324 } 325 return ref; 326 } 327 328 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useMergedRefs.mjs 329 function useMergedRefs(a, b, c, d) { 330 const forkRef = useRefWithInit(createForkRef).current; 331 if (didChange(forkRef, a, b, c, d)) { 332 update(forkRef, [a, b, c, d]); 333 } 334 return forkRef.callback; 335 } 336 function useMergedRefsN(refs) { 337 const forkRef = useRefWithInit(createForkRef).current; 338 if (didChangeN(forkRef, refs)) { 339 update(forkRef, refs); 340 } 341 return forkRef.callback; 342 } 343 function createForkRef() { 344 return { 345 callback: null, 346 cleanup: null, 347 refs: [] 348 }; 349 } 350 function didChange(forkRef, a, b, c, d) { 351 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d; 352 } 353 function didChangeN(forkRef, newRefs) { 354 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]); 355 } 356 function update(forkRef, refs) { 357 forkRef.refs = refs; 358 if (refs.every((ref) => ref == null)) { 359 forkRef.callback = null; 360 return; 361 } 362 forkRef.callback = (instance) => { 363 if (forkRef.cleanup) { 364 forkRef.cleanup(); 365 forkRef.cleanup = null; 366 } 367 if (instance != null) { 368 const cleanupCallbacks = Array(refs.length).fill(null); 369 for (let i = 0; i < refs.length; i += 1) { 370 const ref = refs[i]; 371 if (ref == null) { 372 continue; 373 } 374 switch (typeof ref) { 375 case "function": { 376 const refCleanup = ref(instance); 377 if (typeof refCleanup === "function") { 378 cleanupCallbacks[i] = refCleanup; 379 } 380 break; 381 } 382 case "object": { 383 ref.current = instance; 384 break; 385 } 386 default: 387 } 388 } 389 forkRef.cleanup = () => { 390 for (let i = 0; i < refs.length; i += 1) { 391 const ref = refs[i]; 392 if (ref == null) { 393 continue; 394 } 395 switch (typeof ref) { 396 case "function": { 397 const cleanupCallback = cleanupCallbacks[i]; 398 if (typeof cleanupCallback === "function") { 399 cleanupCallback(); 400 } else { 401 void ref(null); 402 } 403 break; 404 } 405 case "object": { 406 ref.current = null; 407 break; 408 } 409 default: 410 } 411 } 412 }; 413 } 414 }; 415 } 416 417 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/getReactElementRef.mjs 418 var React3 = __toESM(require_react(), 1); 419 420 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/reactVersion.mjs 421 var React2 = __toESM(require_react(), 1); 422 var majorVersion = parseInt(React2.version, 10); 423 function isReactVersionAtLeast(reactVersionToCheck) { 424 return majorVersion >= reactVersionToCheck; 425 } 426 427 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/getReactElementRef.mjs 428 function getReactElementRef(element) { 429 if (!/* @__PURE__ */ React3.isValidElement(element)) { 430 return null; 431 } 432 const reactElement = element; 433 const propsWithRef = reactElement.props; 434 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; 435 } 436 437 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/mergeObjects.mjs 438 function mergeObjects(a, b) { 439 if (a && !b) { 440 return a; 441 } 442 if (!a && b) { 443 return b; 444 } 445 if (a || b) { 446 return { 447 ...a, 448 ...b 449 }; 450 } 451 return void 0; 452 } 453 454 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/createLogOnce.mjs 455 var loggedMessages; 456 if (true) { 457 loggedMessages = /* @__PURE__ */ new Set(); 458 } 459 function createLogOnce(severity, prefix) { 460 return function logOnce(...messages) { 461 if (true) { 462 const message = messages.join(" "); 463 const output = prefix ? `$prefix}: $message}` : message; 464 const key = `$severity}:$output}`; 465 if (!loggedMessages.has(key)) { 466 loggedMessages.add(key); 467 if (severity === "warn") { 468 console.warn(output); 469 } else { 470 console.error(output); 471 } 472 } 473 } 474 }; 475 } 476 477 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/warn.mjs 478 var warn = createLogOnce("warn", "Base UI"); 479 480 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/empty.mjs 481 function NOOP() { 482 } 483 var EMPTY_ARRAY = Object.freeze([]); 484 var EMPTY_OBJECT = Object.freeze({}); 485 486 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs 487 function getStateAttributesProps(state, customMapping) { 488 const props = {}; 489 for (const key in state) { 490 const value = state[key]; 491 if (customMapping?.hasOwnProperty(key)) { 492 const customProps = customMapping[key](value); 493 if (customProps != null) { 494 Object.assign(props, customProps); 495 } 496 continue; 497 } 498 if (value === true) { 499 props[`data-$key.toLowerCase()}`] = ""; 500 } else if (value) { 501 props[`data-$key.toLowerCase()}`] = value.toString(); 502 } 503 } 504 return props; 505 } 506 507 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/resolveClassName.mjs 508 function resolveClassName(className, state) { 509 return typeof className === "function" ? className(state) : className; 510 } 511 512 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/resolveStyle.mjs 513 function resolveStyle(style, state) { 514 return typeof style === "function" ? style(state) : style; 515 } 516 517 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/merge-props/mergeProps.mjs 518 var EMPTY_PROPS = {}; 519 function mergeProps(a, b, c, d, e) { 520 if (!c && !d && !e && !a) { 521 return createInitialMergedProps(b); 522 } 523 let merged = createInitialMergedProps(a); 524 if (b) { 525 merged = mergeInto(merged, b); 526 } 527 if (c) { 528 merged = mergeInto(merged, c); 529 } 530 if (d) { 531 merged = mergeInto(merged, d); 532 } 533 if (e) { 534 merged = mergeInto(merged, e); 535 } 536 return merged; 537 } 538 function mergePropsN(props) { 539 if (props.length === 0) { 540 return EMPTY_PROPS; 541 } 542 if (props.length === 1) { 543 return createInitialMergedProps(props[0]); 544 } 545 let merged = createInitialMergedProps(props[0]); 546 for (let i = 1; i < props.length; i += 1) { 547 merged = mergeInto(merged, props[i]); 548 } 549 return merged; 550 } 551 function createInitialMergedProps(inputProps) { 552 if (isPropsGetter(inputProps)) { 553 return { 554 ...inputProps(EMPTY_PROPS) 555 }; 556 } 557 return copyInitialProps(inputProps); 558 } 559 function mergeInto(merged, inputProps) { 560 if (isPropsGetter(inputProps)) { 561 return inputProps(merged); 562 } 563 return mutablyMergeInto(merged, inputProps); 564 } 565 function copyInitialProps(inputProps) { 566 const copiedProps = { 567 ...inputProps 568 }; 569 for (const propName in copiedProps) { 570 const propValue = copiedProps[propName]; 571 if (isEventHandler(propName, propValue)) { 572 copiedProps[propName] = wrapEventHandler(propValue); 573 } 574 } 575 return copiedProps; 576 } 577 function mutablyMergeInto(mergedProps, externalProps) { 578 if (!externalProps) { 579 return mergedProps; 580 } 581 for (const propName in externalProps) { 582 const externalPropValue = externalProps[propName]; 583 switch (propName) { 584 case "style": { 585 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); 586 break; 587 } 588 case "className": { 589 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); 590 break; 591 } 592 default: { 593 if (isEventHandler(propName, externalPropValue)) { 594 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); 595 } else { 596 mergedProps[propName] = externalPropValue; 597 } 598 } 599 } 600 } 601 return mergedProps; 602 } 603 function isEventHandler(key, value) { 604 const code0 = key.charCodeAt(0); 605 const code1 = key.charCodeAt(1); 606 const code2 = key.charCodeAt(2); 607 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); 608 } 609 function isPropsGetter(inputProps) { 610 return typeof inputProps === "function"; 611 } 612 function mergeEventHandlers(ourHandler, theirHandler) { 613 if (!theirHandler) { 614 return ourHandler; 615 } 616 if (!ourHandler) { 617 return wrapEventHandler(theirHandler); 618 } 619 return (...args) => { 620 const event = args[0]; 621 if (isSyntheticEvent(event)) { 622 const baseUIEvent = event; 623 makeEventPreventable(baseUIEvent); 624 const result2 = theirHandler(...args); 625 if (!baseUIEvent.baseUIHandlerPrevented) { 626 ourHandler?.(...args); 627 } 628 return result2; 629 } 630 const result = theirHandler(...args); 631 ourHandler?.(...args); 632 return result; 633 }; 634 } 635 function wrapEventHandler(handler) { 636 if (!handler) { 637 return handler; 638 } 639 return (...args) => { 640 const event = args[0]; 641 if (isSyntheticEvent(event)) { 642 makeEventPreventable(event); 643 } 644 return handler(...args); 645 }; 646 } 647 function makeEventPreventable(event) { 648 event.preventBaseUIHandler = () => { 649 event.baseUIHandlerPrevented = true; 650 }; 651 return event; 652 } 653 function mergeClassNames(ourClassName, theirClassName) { 654 if (theirClassName) { 655 if (ourClassName) { 656 return theirClassName + " " + ourClassName; 657 } 658 return theirClassName; 659 } 660 return ourClassName; 661 } 662 function isSyntheticEvent(event) { 663 return event != null && typeof event === "object" && "nativeEvent" in event; 664 } 665 666 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useRenderElement.mjs 667 var import_react = __toESM(require_react(), 1); 668 function useRenderElement(element, componentProps, params = {}) { 669 let renderProp = componentProps.render; 670 if (params.enabled !== false) { 671 renderProp = unwrapLazyRenderProp(renderProp); 672 } 673 const outProps = useRenderElementProps(componentProps, params, renderProp); 674 if (params.enabled === false) { 675 return null; 676 } 677 const state = params.state ?? EMPTY_OBJECT; 678 return evaluateRenderProp(element, renderProp, outProps, state); 679 } 680 function useRenderElementProps(componentProps, params, renderProp) { 681 const { 682 className: classNameProp, 683 style: styleProp 684 } = componentProps; 685 const { 686 state = EMPTY_OBJECT, 687 ref, 688 props, 689 stateAttributesMapping: stateAttributesMapping2, 690 enabled = true 691 } = params; 692 const className = enabled ? resolveClassName(classNameProp, state) : void 0; 693 const style = enabled ? resolveStyle(styleProp, state) : void 0; 694 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping2) : EMPTY_OBJECT; 695 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; 696 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; 697 if (typeof document !== "undefined") { 698 if (!enabled) { 699 void useMergedRefs(null, null); 700 } else if (Array.isArray(ref)) { 701 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); 702 } else { 703 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); 704 } 705 } 706 if (!enabled) { 707 return EMPTY_OBJECT; 708 } 709 if (className !== void 0) { 710 outProps.className = mergeClassNames(outProps.className, className); 711 } 712 if (style !== void 0) { 713 outProps.style = mergeObjects(outProps.style, style); 714 } 715 return outProps; 716 } 717 function resolveRenderFunctionProps(props) { 718 if (Array.isArray(props)) { 719 return mergePropsN(props); 720 } 721 return mergeProps(void 0, props); 722 } 723 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); 724 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; 725 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; 726 function unwrapLazyRenderProp(render) { 727 if (render?.$$typeof !== REACT_LAZY_TYPE) { 728 return render; 729 } 730 const unwrapped = React4.Children.toArray(render)[0]; 731 return /* @__PURE__ */ React4.isValidElement(unwrapped) ? unwrapped : render; 732 } 733 function evaluateRenderProp(element, render, props, state) { 734 if (render) { 735 if (typeof render === "function") { 736 if (true) { 737 warnIfRenderPropLooksLikeComponent(render); 738 } 739 return render(props, state); 740 } 741 const mergedProps = mergeProps(props, render.props); 742 mergedProps.ref = props.ref; 743 if (true) { 744 if (!/* @__PURE__ */ React4.isValidElement(render)) { 745 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")); 746 } 747 } 748 return /* @__PURE__ */ React4.cloneElement(render, mergedProps); 749 } 750 return renderTag(element, props); 751 } 752 function warnIfRenderPropLooksLikeComponent(renderFn) { 753 const functionName = renderFn.name; 754 if (functionName.length === 0) { 755 return; 756 } 757 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { 758 return; 759 } 760 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { 761 return; 762 } 763 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"); 764 } 765 function renderTag(Tag, props) { 766 if (Tag === "button") { 767 return /* @__PURE__ */ (0, import_react.createElement)("button", { 768 type: "button", 769 ...props, 770 key: props.key 771 }); 772 } 773 if (Tag === "img") { 774 return /* @__PURE__ */ (0, import_react.createElement)("img", { 775 alt: "", 776 ...props, 777 key: props.key 778 }); 779 } 780 return /* @__PURE__ */ React4.createElement(Tag, props); 781 } 782 783 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/avatar/root/AvatarRootContext.mjs 784 var React5 = __toESM(require_react(), 1); 785 var AvatarRootContext = /* @__PURE__ */ React5.createContext(void 0); 786 if (true) AvatarRootContext.displayName = "AvatarRootContext"; 787 function useAvatarRootContext() { 788 const context = React5.useContext(AvatarRootContext); 789 if (context === void 0) { 790 throw new Error(true ? "Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>." : formatErrorMessage_default(13)); 791 } 792 return context; 793 } 794 795 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/avatar/root/stateAttributesMapping.mjs 796 var avatarStateAttributesMapping = { 797 imageLoadingStatus: () => null 798 }; 799 800 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/avatar/root/AvatarRoot.mjs 801 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); 802 var AvatarRoot = /* @__PURE__ */ React6.forwardRef(function AvatarRoot2(componentProps, forwardedRef) { 803 const { 804 className, 805 render, 806 style, 807 ...elementProps 808 } = componentProps; 809 const [imageLoadingStatus, setImageLoadingStatus] = React6.useState("idle"); 810 const state = { 811 imageLoadingStatus 812 }; 813 const contextValue = React6.useMemo(() => ({ 814 imageLoadingStatus, 815 setImageLoadingStatus 816 }), [imageLoadingStatus, setImageLoadingStatus]); 817 const element = useRenderElement("span", componentProps, { 818 state, 819 ref: forwardedRef, 820 props: elementProps, 821 stateAttributesMapping: avatarStateAttributesMapping 822 }); 823 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AvatarRootContext.Provider, { 824 value: contextValue, 825 children: element 826 }); 827 }); 828 if (true) AvatarRoot.displayName = "AvatarRoot"; 829 830 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/avatar/image/AvatarImage.mjs 831 var React13 = __toESM(require_react(), 1); 832 833 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/safeReact.mjs 834 var React7 = __toESM(require_react(), 1); 835 var SafeReact = { 836 ...React7 837 }; 838 839 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useStableCallback.mjs 840 var useInsertionEffect = SafeReact.useInsertionEffect; 841 var useSafeInsertionEffect = ( 842 // React 17 doesn't have useInsertionEffect. 843 useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. 844 useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn() 845 ); 846 function useStableCallback(callback) { 847 const stable = useRefWithInit(createStableCallback).current; 848 stable.next = callback; 849 useSafeInsertionEffect(stable.effect); 850 return stable.trampoline; 851 } 852 function createStableCallback() { 853 const stable = { 854 next: void 0, 855 callback: assertNotCalled, 856 trampoline: (...args) => stable.callback?.(...args), 857 effect: () => { 858 stable.callback = stable.next; 859 } 860 }; 861 return stable; 862 } 863 function assertNotCalled() { 864 if (true) { 865 throw ( 866 /* minify-error-disabled */ 867 new Error("Base UI: Cannot call an event handler while rendering.") 868 ); 869 } 870 } 871 872 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useIsoLayoutEffect.mjs 873 var React8 = __toESM(require_react(), 1); 874 var noop = () => { 875 }; 876 var useIsoLayoutEffect = typeof document !== "undefined" ? React8.useLayoutEffect : noop; 877 878 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs 879 var React10 = __toESM(require_react(), 1); 880 881 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs 882 var ReactDOM = __toESM(require_react_dom(), 1); 883 884 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useOnMount.mjs 885 var React9 = __toESM(require_react(), 1); 886 function useOnMount(fn) { 887 React9.useEffect(fn, EMPTY_ARRAY); 888 } 889 890 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useAnimationFrame.mjs 891 var EMPTY = null; 892 var LAST_RAF = globalThis.requestAnimationFrame; 893 var Scheduler = class { 894 /* This implementation uses an array as a backing data-structure for frame callbacks. 895 * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it 896 * never calls the native `cancelAnimationFrame` if there are no frames left. This can 897 * be much more efficient if there is a call pattern that alterns as 898 * "request-cancel-request-cancel-…". 899 * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation 900 * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */ 901 callbacks = []; 902 callbacksCount = 0; 903 nextId = 1; 904 startId = 1; 905 isScheduled = false; 906 tick = (timestamp) => { 907 this.isScheduled = false; 908 const currentCallbacks = this.callbacks; 909 const currentCallbacksCount = this.callbacksCount; 910 this.callbacks = []; 911 this.callbacksCount = 0; 912 this.startId = this.nextId; 913 if (currentCallbacksCount > 0) { 914 for (let i = 0; i < currentCallbacks.length; i += 1) { 915 currentCallbacks[i]?.(timestamp); 916 } 917 } 918 }; 919 request(fn) { 920 const id = this.nextId; 921 this.nextId += 1; 922 this.callbacks.push(fn); 923 this.callbacksCount += 1; 924 const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true); 925 if (!this.isScheduled || didRAFChange) { 926 requestAnimationFrame(this.tick); 927 this.isScheduled = true; 928 } 929 return id; 930 } 931 cancel(id) { 932 const index2 = id - this.startId; 933 if (index2 < 0 || index2 >= this.callbacks.length) { 934 return; 935 } 936 if (this.callbacks[index2] === null) { 937 return; 938 } 939 this.callbacks[index2] = null; 940 this.callbacksCount -= 1; 941 } 942 }; 943 var scheduler = new Scheduler(); 944 var AnimationFrame = class _AnimationFrame { 945 static create() { 946 return new _AnimationFrame(); 947 } 948 static request(fn) { 949 return scheduler.request(fn); 950 } 951 static cancel(id) { 952 return scheduler.cancel(id); 953 } 954 currentId = EMPTY; 955 /** 956 * Executes `fn` after `delay`, clearing any previously scheduled call. 957 */ 958 request(fn) { 959 this.cancel(); 960 this.currentId = scheduler.request(() => { 961 this.currentId = EMPTY; 962 fn(); 963 }); 964 } 965 cancel = () => { 966 if (this.currentId !== EMPTY) { 967 scheduler.cancel(this.currentId); 968 this.currentId = EMPTY; 969 } 970 }; 971 disposeEffect = () => { 972 return this.cancel; 973 }; 974 }; 975 function useAnimationFrame() { 976 const timeout = useRefWithInit(AnimationFrame.create).current; 977 useOnMount(timeout.disposeEffect); 978 return timeout; 979 } 980 981 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/resolveRef.mjs 982 function resolveRef(maybeRef) { 983 if (maybeRef == null) { 984 return maybeRef; 985 } 986 return "current" in maybeRef ? maybeRef.current : maybeRef; 987 } 988 989 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/getFiniteAnimations.mjs 990 function getFiniteAnimations(element, options) { 991 return element.getAnimations(options).filter((animation) => { 992 const timing = animation.effect?.getTiming(); 993 return timing?.duration !== Infinity && timing?.iterations !== Infinity; 994 }); 995 } 996 997 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs 998 var startingStyle = "data-starting-style"; 999 var endingStyle = "data-ending-style"; 1000 1001 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs 1002 var pendingCallbacks = null; 1003 function flushBeforePaint(fn) { 1004 if (!pendingCallbacks) { 1005 const callbacks = []; 1006 pendingCallbacks = callbacks; 1007 queueMicrotask(() => { 1008 pendingCallbacks = null; 1009 ReactDOM.flushSync(() => { 1010 for (const callback of callbacks) { 1011 callback(); 1012 } 1013 }); 1014 }); 1015 } 1016 pendingCallbacks.push(fn); 1017 } 1018 function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) { 1019 const frame = useAnimationFrame(); 1020 return useStableCallback((fnToExecute, signal = null) => { 1021 frame.cancel(); 1022 const element = resolveRef(elementOrRef); 1023 if (element == null) { 1024 return; 1025 } 1026 const resolvedElement = element; 1027 const done = () => { 1028 if (!batch) { 1029 ReactDOM.flushSync(fnToExecute); 1030 return; 1031 } 1032 flushBeforePaint(() => { 1033 if (!signal?.aborted) { 1034 fnToExecute(); 1035 } 1036 }); 1037 }; 1038 if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { 1039 fnToExecute(); 1040 return; 1041 } 1042 function exec() { 1043 Promise.all(getFiniteAnimations(resolvedElement).map((animation) => animation.finished.then(NOOP))).then(() => { 1044 if (!signal?.aborted) { 1045 done(); 1046 } 1047 }, () => { 1048 if (signal?.aborted) { 1049 return; 1050 } 1051 const currentAnimations = getFiniteAnimations(resolvedElement); 1052 if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { 1053 exec(); 1054 return; 1055 } 1056 done(); 1057 }); 1058 } 1059 if (waitForStartingStyleRemoved) { 1060 const startingStyleAttribute = startingStyle; 1061 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 1062 frame.request(exec); 1063 return; 1064 } 1065 const attributeObserver = new MutationObserver(() => { 1066 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 1067 attributeObserver.disconnect(); 1068 exec(); 1069 } 1070 }); 1071 attributeObserver.observe(resolvedElement, { 1072 attributes: true, 1073 attributeFilter: [startingStyleAttribute] 1074 }); 1075 signal?.addEventListener("abort", () => attributeObserver.disconnect(), { 1076 once: true 1077 }); 1078 return; 1079 } 1080 frame.request(exec); 1081 }); 1082 } 1083 1084 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs 1085 function useOpenChangeComplete(parameters) { 1086 const { 1087 enabled = true, 1088 open: open2, 1089 ref, 1090 batch = false, 1091 onComplete: onCompleteParam 1092 } = parameters; 1093 const onComplete = useStableCallback(onCompleteParam); 1094 const runOnceAnimationsFinish = useAnimationsFinished(ref, open2, batch); 1095 React10.useEffect(() => { 1096 if (!enabled) { 1097 return void 0; 1098 } 1099 const abortController = new AbortController(); 1100 runOnceAnimationsFinish(onComplete, abortController.signal); 1101 return () => { 1102 abortController.abort(); 1103 }; 1104 }, [enabled, open2, onComplete, runOnceAnimationsFinish]); 1105 } 1106 1107 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/stateAttributesMapping.mjs 1108 var STARTING_HOOK = { 1109 [startingStyle]: "" 1110 }; 1111 var ENDING_HOOK = { 1112 [endingStyle]: "" 1113 }; 1114 var transitionStatusMapping = { 1115 transitionStatus(value) { 1116 if (value === "starting") { 1117 return STARTING_HOOK; 1118 } 1119 if (value === "ending") { 1120 return ENDING_HOOK; 1121 } 1122 return null; 1123 } 1124 }; 1125 1126 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useTransitionStatus.mjs 1127 var React11 = __toESM(require_react(), 1); 1128 function useTransitionStatus(open2, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) { 1129 const [transitionStatus, setTransitionStatus] = React11.useState(open2 && enableIdleState ? "idle" : void 0); 1130 const [mounted, setMounted] = React11.useState(open2 && !animateInitialOpen); 1131 if (open2 && !mounted) { 1132 setMounted(true); 1133 setTransitionStatus("starting"); 1134 } 1135 if (!open2 && mounted && transitionStatus !== "ending" && !deferEndingState) { 1136 setTransitionStatus("ending"); 1137 } 1138 if (!open2 && !mounted && transitionStatus === "ending") { 1139 setTransitionStatus(void 0); 1140 } 1141 useIsoLayoutEffect(() => { 1142 if (!open2 && mounted && transitionStatus !== "ending" && deferEndingState) { 1143 const frame = AnimationFrame.request(() => { 1144 setTransitionStatus("ending"); 1145 }); 1146 return () => { 1147 AnimationFrame.cancel(frame); 1148 }; 1149 } 1150 return void 0; 1151 }, [open2, mounted, transitionStatus, deferEndingState]); 1152 useIsoLayoutEffect(() => { 1153 if (!open2 || enableIdleState || transitionStatus === void 0) { 1154 return void 0; 1155 } 1156 const frame = AnimationFrame.request(() => { 1157 setTransitionStatus(void 0); 1158 }); 1159 return () => { 1160 AnimationFrame.cancel(frame); 1161 }; 1162 }, [enableIdleState, open2, transitionStatus]); 1163 useIsoLayoutEffect(() => { 1164 if (!open2 || !enableIdleState) { 1165 return void 0; 1166 } 1167 if (open2 && mounted && transitionStatus !== "idle") { 1168 setTransitionStatus("starting"); 1169 } 1170 const frame = AnimationFrame.request(() => { 1171 setTransitionStatus("idle"); 1172 }); 1173 return () => { 1174 AnimationFrame.cancel(frame); 1175 }; 1176 }, [enableIdleState, open2, mounted, transitionStatus]); 1177 return { 1178 mounted, 1179 setMounted, 1180 transitionStatus 1181 }; 1182 } 1183 1184 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/avatar/image/useImageLoadingStatus.mjs 1185 var React12 = __toESM(require_react(), 1); 1186 function useImageLoadingStatus(src, { 1187 referrerPolicy, 1188 crossOrigin, 1189 sizes, 1190 srcSet 1191 }, enabled) { 1192 const state = React12.useState("idle"); 1193 const setLoadingStatus = state[1]; 1194 useIsoLayoutEffect(() => { 1195 if (!enabled) { 1196 return NOOP; 1197 } 1198 if (!src && !srcSet) { 1199 setLoadingStatus("error"); 1200 return NOOP; 1201 } 1202 let isMounted = true; 1203 const image = new window.Image(); 1204 const updateStatus = (status) => () => { 1205 if (!isMounted) { 1206 return; 1207 } 1208 setLoadingStatus(status); 1209 }; 1210 setLoadingStatus("loading"); 1211 image.onload = updateStatus("loaded"); 1212 image.onerror = updateStatus("error"); 1213 if (referrerPolicy) { 1214 image.referrerPolicy = referrerPolicy; 1215 } 1216 image.crossOrigin = crossOrigin ?? null; 1217 if (sizes) { 1218 image.sizes = sizes; 1219 } 1220 if (srcSet) { 1221 image.srcset = srcSet; 1222 } 1223 if (src) { 1224 image.src = src; 1225 } 1226 if (image.complete) { 1227 setLoadingStatus(image.naturalWidth > 0 ? "loaded" : "error"); 1228 } 1229 return () => { 1230 isMounted = false; 1231 }; 1232 }, [enabled, src, srcSet, sizes, crossOrigin, referrerPolicy, setLoadingStatus]); 1233 return state; 1234 } 1235 1236 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/avatar/image/AvatarImage.mjs 1237 var stateAttributesMapping = { 1238 ...avatarStateAttributesMapping, 1239 ...transitionStatusMapping 1240 }; 1241 var AvatarImage = /* @__PURE__ */ React13.forwardRef(function AvatarImage2(componentProps, forwardedRef) { 1242 const { 1243 className, 1244 render, 1245 onLoadingStatusChange: onLoadingStatusChangeProp, 1246 keepMounted = false, 1247 style, 1248 // Split out so they can be applied after every other prop. React 17 and 18 set attributes in 1249 // props order, and Safari and Firefox start fetching as soon as `src` lands, ignoring a 1250 // `loading` or `srcSet` that arrives after it. React 19 orders these itself. 1251 sizes, 1252 srcSet, 1253 src, 1254 ...elementProps 1255 } = componentProps; 1256 const { 1257 setImageLoadingStatus: setRootImageLoadingStatus 1258 } = useAvatarRootContext(); 1259 const [imageLoadingStatus, setImageLoadingStatus] = useImageLoadingStatus(src, componentProps, !keepMounted); 1260 const isVisible = imageLoadingStatus === "loaded"; 1261 const { 1262 mounted, 1263 transitionStatus, 1264 setMounted 1265 } = useTransitionStatus(isVisible); 1266 const imageRef = React13.useRef(null); 1267 const initialCommitRef = React13.useRef(true); 1268 useIsoLayoutEffect(() => { 1269 if (!keepMounted) { 1270 return; 1271 } 1272 const isInitialCommit = initialCommitRef.current; 1273 initialCommitRef.current = false; 1274 const image = imageRef.current; 1275 if (!image) { 1276 return; 1277 } 1278 if (!image.complete) { 1279 setImageLoadingStatus("loading"); 1280 return; 1281 } 1282 const status = image.naturalWidth > 0 ? "loaded" : "error"; 1283 setImageLoadingStatus(status); 1284 if (status === "loaded" && isInitialCommit) { 1285 setMounted(true); 1286 } 1287 }, [keepMounted, src, srcSet, sizes, elementProps.crossOrigin, elementProps.referrerPolicy, render, setImageLoadingStatus, setMounted]); 1288 const renderedStatusProps = keepMounted ? { 1289 // Presence no longer implies the image loaded, so the not-loaded states need their own 1290 // styling hooks. Scoped to `keepMounted` so the default mode, where the element only 1291 // exists once loaded, doesn't pick them up while it animates out. 1292 "data-loading": imageLoadingStatus === "loading" ? "" : void 0, 1293 "data-error": imageLoadingStatus === "error" ? "" : void 0, 1294 // Until the image is displayable, the fallback owns the accessible name; without this 1295 // both would be exposed to assistive technology at once (including in server HTML). 1296 "aria-hidden": imageLoadingStatus !== "loaded" || void 0, 1297 onLoad() { 1298 setImageLoadingStatus("loaded"); 1299 }, 1300 onError() { 1301 setImageLoadingStatus("error"); 1302 } 1303 } : void 0; 1304 const handleLoadingStatusChange = useStableCallback((status) => { 1305 onLoadingStatusChangeProp?.(status); 1306 setRootImageLoadingStatus(status); 1307 }); 1308 useIsoLayoutEffect(() => { 1309 if (imageLoadingStatus !== "idle") { 1310 handleLoadingStatusChange(imageLoadingStatus); 1311 } 1312 }, [imageLoadingStatus, handleLoadingStatusChange]); 1313 useIsoLayoutEffect(() => { 1314 return () => setRootImageLoadingStatus("idle"); 1315 }, [setRootImageLoadingStatus]); 1316 useOpenChangeComplete({ 1317 enabled: !isVisible, 1318 open: isVisible, 1319 ref: imageRef, 1320 onComplete() { 1321 if (!isVisible) { 1322 setMounted(false); 1323 } 1324 } 1325 }); 1326 const state = { 1327 imageLoadingStatus, 1328 // The element never unmounts with `keepMounted`, so an exit transition would play and then 1329 // reverse itself once the status is cleared. `data-loading`/`data-error` cover that state. 1330 transitionStatus: keepMounted && transitionStatus === "ending" ? void 0 : transitionStatus 1331 }; 1332 const shouldRender = keepMounted || mounted; 1333 const sourceProps = {}; 1334 if (sizes !== void 0) { 1335 sourceProps.sizes = sizes; 1336 } 1337 if (srcSet !== void 0) { 1338 sourceProps.srcSet = srcSet; 1339 } 1340 if (src !== void 0) { 1341 sourceProps.src = src; 1342 } 1343 const element = useRenderElement("img", componentProps, { 1344 state, 1345 ref: [forwardedRef, imageRef], 1346 props: [renderedStatusProps, elementProps, sourceProps], 1347 stateAttributesMapping, 1348 enabled: shouldRender 1349 }); 1350 if (!shouldRender) { 1351 return null; 1352 } 1353 return element; 1354 }); 1355 if (true) AvatarImage.displayName = "AvatarImage"; 1356 1357 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/avatar/fallback/AvatarFallback.mjs 1358 var React14 = __toESM(require_react(), 1); 1359 1360 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useTimeout.mjs 1361 var EMPTY2 = 0; 1362 var Timeout = class _Timeout { 1363 static create() { 1364 return new _Timeout(); 1365 } 1366 currentId = EMPTY2; 1367 /** 1368 * Executes `fn` after `delay`, clearing any previously scheduled call. 1369 */ 1370 start(delay, fn) { 1371 this.clear(); 1372 this.currentId = setTimeout(() => { 1373 this.currentId = EMPTY2; 1374 fn(); 1375 }, delay); 1376 } 1377 isStarted() { 1378 return this.currentId !== EMPTY2; 1379 } 1380 clear = () => { 1381 if (this.currentId !== EMPTY2) { 1382 clearTimeout(this.currentId); 1383 this.currentId = EMPTY2; 1384 } 1385 }; 1386 disposeEffect = () => { 1387 return this.clear; 1388 }; 1389 }; 1390 function useTimeout() { 1391 const timeout = useRefWithInit(Timeout.create).current; 1392 useOnMount(timeout.disposeEffect); 1393 return timeout; 1394 } 1395 1396 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/avatar/fallback/AvatarFallback.mjs 1397 var AvatarFallback = /* @__PURE__ */ React14.forwardRef(function AvatarFallback2(componentProps, forwardedRef) { 1398 const { 1399 className, 1400 render, 1401 delay = 0, 1402 style, 1403 ...elementProps 1404 } = componentProps; 1405 const { 1406 imageLoadingStatus 1407 } = useAvatarRootContext(); 1408 const [delayPassed, setDelayPassed] = React14.useState(delay === 0); 1409 const timeout = useTimeout(); 1410 React14.useEffect(() => { 1411 if (delay > 0) { 1412 timeout.start(delay, () => setDelayPassed(true)); 1413 } else { 1414 setDelayPassed(true); 1415 } 1416 return timeout.clear; 1417 }, [timeout, delay]); 1418 const state = { 1419 imageLoadingStatus 1420 }; 1421 const element = useRenderElement("span", componentProps, { 1422 state, 1423 ref: forwardedRef, 1424 props: elementProps, 1425 stateAttributesMapping: avatarStateAttributesMapping, 1426 enabled: imageLoadingStatus !== "loaded" && (delay === 0 || delayPassed) 1427 }); 1428 return element; 1429 }); 1430 if (true) AvatarFallback.displayName = "AvatarFallback"; 1431 1432 // node_modules/.store/clsx@2.1.1-XOLP1vUL9vEGfpiXm37fAw/node_modules/clsx/dist/clsx.mjs 1433 function r(e) { 1434 var t, f, n = ""; 1435 if ("string" == typeof e || "number" == typeof e) n += e; 1436 else if ("object" == typeof e) if (Array.isArray(e)) { 1437 var o = e.length; 1438 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); 1439 } else for (f in e) e[f] && (n && (n += " "), n += f); 1440 return n; 1441 } 1442 function clsx() { 1443 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); 1444 return n; 1445 } 1446 var clsx_default = clsx; 1447 1448 // packages/ui/build-module/avatar/root.mjs 1449 var import_element = __toESM(require_element(), 1); 1450 1451 // packages/ui/build-module/avatar/dev-warnings.mjs 1452 var import_warning = __toESM(require_warning(), 1); 1453 function warnAvatarColor(color) { 1454 if (color === void 0) { 1455 return; 1456 } 1457 const tokens = color.match( 1458 /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|(?:[-\w\u0080-\uFFFF]|\\(?:[\da-fA-F]{1,6}[ \t\r\n\f]?|[^\r\n\f]))+/g 1459 ); 1460 if (tokens?.some((token) => token.toLowerCase() === "currentcolor")) { 1461 (0, import_warning.default)( 1462 "Avatar.Root: `color` contains `currentColor`, which can produce insufficient contrast in colored fallbacks. Use a color that does not depend on the foreground." 1463 ); 1464 return; 1465 } 1466 if (typeof CSS === "undefined" || !CSS.supports) { 1467 return; 1468 } 1469 if (!CSS.supports("color", color)) { 1470 (0, import_warning.default)( 1471 "Avatar.Root: The browser does not support the `color` value. Use a valid CSS color supported by this browser." 1472 ); 1473 } else if ( 1474 // Browsers without relative colors retain the neutral fallback. 1475 CSS.supports("color", "rgb(from red r g b / 1)") && !CSS.supports("color", `rgb(from $color} r g b / 1)`) 1476 ) { 1477 (0, import_warning.default)( 1478 "Avatar.Root: `color` cannot be used as a colored fallback fill. Use an explicit CSS color instead of a CSS-wide keyword such as `inherit`." 1479 ); 1480 } 1481 } 1482 1483 // packages/ui/build-module/avatar/root.mjs 1484 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); 1485 var STYLE_HASH_ATTRIBUTE = "data-wp-hash"; 1486 function getRuntime() { 1487 const globalScope = globalThis; 1488 if (globalScope.__wpStyleRuntime) { 1489 return globalScope.__wpStyleRuntime; 1490 } 1491 globalScope.__wpStyleRuntime = { 1492 documents: /* @__PURE__ */ new Map(), 1493 styles: /* @__PURE__ */ new Map(), 1494 injectedStyles: /* @__PURE__ */ new WeakMap() 1495 }; 1496 if (typeof document !== "undefined") { 1497 registerDocument(document); 1498 } 1499 return globalScope.__wpStyleRuntime; 1500 } 1501 function documentContainsStyleHash(targetDocument, hash) { 1502 if (!targetDocument.head) { 1503 return false; 1504 } 1505 for (const style of targetDocument.head.querySelectorAll( 1506 `style[$STYLE_HASH_ATTRIBUTE}]` 1507 )) { 1508 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) { 1509 return true; 1510 } 1511 } 1512 return false; 1513 } 1514 function injectStyle(targetDocument, hash, css) { 1515 if (!targetDocument.head) { 1516 return; 1517 } 1518 const runtime = getRuntime(); 1519 let injectedStyles = runtime.injectedStyles.get(targetDocument); 1520 if (!injectedStyles) { 1521 injectedStyles = /* @__PURE__ */ new Set(); 1522 runtime.injectedStyles.set(targetDocument, injectedStyles); 1523 } 1524 if (injectedStyles.has(hash)) { 1525 return; 1526 } 1527 if (documentContainsStyleHash(targetDocument, hash)) { 1528 injectedStyles.add(hash); 1529 return; 1530 } 1531 const style = targetDocument.createElement("style"); 1532 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash); 1533 style.appendChild(targetDocument.createTextNode(css)); 1534 targetDocument.head.appendChild(style); 1535 injectedStyles.add(hash); 1536 } 1537 function registerDocument(targetDocument) { 1538 const runtime = getRuntime(); 1539 runtime.documents.set( 1540 targetDocument, 1541 (runtime.documents.get(targetDocument) ?? 0) + 1 1542 ); 1543 for (const [hash, css] of runtime.styles) { 1544 injectStyle(targetDocument, hash, css); 1545 } 1546 return () => { 1547 const count = runtime.documents.get(targetDocument); 1548 if (count === void 0) { 1549 return; 1550 } 1551 if (count <= 1) { 1552 runtime.documents.delete(targetDocument); 1553 return; 1554 } 1555 runtime.documents.set(targetDocument, count - 1); 1556 }; 1557 } 1558 function registerStyle(hash, css) { 1559 const runtime = getRuntime(); 1560 runtime.styles.set(hash, css); 1561 for (const targetDocument of runtime.documents.keys()) { 1562 injectStyle(targetDocument, hash, css); 1563 } 1564 } 1565 if (typeof process === "undefined" || true) { 1566 registerStyle("37477070fb", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.ccc29f9575c4c758__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 1567 } 1568 var resets_default = { "box-sizing": "ccc29f9575c4c758__box-sizing" }; 1569 if (typeof process === "undefined" || true) { 1570 registerStyle("726f348f3f", "._78c10a0773e51a91__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)}._5b33aa2d48624b4f__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)}}._980b3b4776ac8f81__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._43e478b4279a076c__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._698099e25b0fb1a6__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)._326aee4184d261fd__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)}.e9576240835601ba__a,.e9576240835601ba__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)}._3f05789653864a73__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)}._3c72ff72abe57859__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._79d16267c15d9eb2__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}"); 1571 } 1572 var global_css_defense_default = { "button": "_78c10a0773e51a91__button", "input": "_5b33aa2d48624b4f__input", "textarea": "_980b3b4776ac8f81__textarea", "div": "_43e478b4279a076c__div", "p": "_698099e25b0fb1a6__p", "heading": "_326aee4184d261fd__heading", "a": "e9576240835601ba__a", "ol": "_3f05789653864a73__ol", "li": "_3c72ff72abe57859__li", "span": "_79d16267c15d9eb2__span" }; 1573 if (typeof process === "undefined" || true) { 1574 registerStyle("2657a3ab0c", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a9728400af96db77__root{--_wp-ui-avatar-size:var(--wpds-dimension-size-md,32px);--_gcd-span-position:relative;--_gcd-span-display:inline-flex;--_gcd-span-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);--_gcd-span-font-size:var(--_wp-ui-avatar-font-size);--_wp-ui-avatar-font-size:var(--wpds-typography-font-size-sm,12px);align-items:center;background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);block-size:var(--_wp-ui-avatar-size);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:50%;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:inline-flex;flex-shrink:0;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(--_wp-ui-avatar-font-size);font-weight:var(--wpds-typography-font-weight-emphasis,600);inline-size:var(--_wp-ui-avatar-size);justify-content:center;line-height:1;position:relative;vertical-align:middle}._81a33c129d7cbe31__has-color:after{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--_wp-ui-avatar-color);border-radius:inherit;content:"";inset:calc(var(--wpds-border-width-xs, 1px)*-1);pointer-events:none;position:absolute}._32e65dea77285874__is-square{border-radius:var(--wpds-border-radius-sm,2px)}._7d2020337343df5a__is-xs{--_wp-ui-avatar-size:var(--wpds-dimension-size-2xs,16px);--_wp-ui-avatar-font-size:calc(var(--_wp-ui-avatar-size)/2)}._216fb78a075c5ab4__is-sm{--_wp-ui-avatar-size:var(--wpds-dimension-size-sm,24px);--_wp-ui-avatar-font-size:var(--wpds-typography-font-size-xs,11px)}.b552ab04a3b94ae9__is-lg{--_wp-ui-avatar-size:var(--wpds-dimension-size-lg,40px);--_wp-ui-avatar-font-size:var(--wpds-typography-font-size-md,13px)}.f8a7646462ff80d1__is-xl{--_wp-ui-avatar-size:calc(var(--wpds-dimension-size-md, 32px)*2);--_wp-ui-avatar-font-size:var(--wpds-typography-font-size-xl,20px)}._411c43ac028fe4be__image,._7883f856336224e2__fallback{block-size:100%;border-radius:inherit;inline-size:100%;inset:0;position:absolute}._411c43ac028fe4be__image{object-fit:cover;@media not (prefers-reduced-motion){transition:opacity var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1));&[data-error],&[data-loading],&[data-starting-style]{opacity:0}}&[data-ending-style],&[data-error],&[data-loading]{visibility:hidden}}._7883f856336224e2__fallback{--_gcd-span-position:absolute;--_gcd-span-display:flex;align-items:center;display:flex;justify-content:center;overflow:hidden;white-space:nowrap;>svg{block-size:100%;flex-shrink:0;inline-size:100%}>.dc9b5131d4746aa6__person-icon{block-size:110%;color:var(--wpds-color-stroke-surface-neutral-strong,#8d8d8d);inline-size:110%;translate:0 15%}}@media not (forced-colors:active){@supports (color:rgb(from green r g b/1)) and (color:color(from green srgb-linear round(up,r) g b/1)){._81a33c129d7cbe31__has-color:has(>._7883f856336224e2__fallback){border:none}._81a33c129d7cbe31__has-color:has(>._7883f856336224e2__fallback):after{content:none}._81a33c129d7cbe31__has-color>._7883f856336224e2__fallback{--_wp-ui-avatar-background:rgb(from var(--_wp-ui-avatar-color) clamp(0,r,255) clamp(0,g,255) clamp(0,b,255)/1);--_wp-ui-avatar-contrast-target:4.55;background-color:var(--_wp-ui-avatar-background)}._81a33c129d7cbe31__has-color>._7883f856336224e2__fallback>.dc9b5131d4746aa6__person-icon{--_wp-ui-avatar-contrast-target:3.05}._81a33c129d7cbe31__has-color>._7883f856336224e2__fallback,._81a33c129d7cbe31__has-color>._7883f856336224e2__fallback>.dc9b5131d4746aa6__person-icon{--_wp-ui-avatar-luminance:calc(0.2126 * r + 0.7152 * g + 0.0722 * b);--_wp-ui-avatar-light-foreground:round(up,clamp(0,calc(0.17913 - var(--_wp-ui-avatar-luminance)),1));--_wp-ui-avatar-dark-tint:clamp(0,calc(((var(--_wp-ui-avatar-luminance) + 0.05)/var(--_wp-ui-avatar-contrast-target) - 0.05)/max(0.000001, var(--_wp-ui-avatar-luminance))),1);--_wp-ui-avatar-light-tint:clamp(0,calc((1.05 - var(--_wp-ui-avatar-contrast-target)*(var(--_wp-ui-avatar-luminance) + 0.05))/max(0.000001, 1 - var(--_wp-ui-avatar-luminance))),1);--_wp-ui-avatar-tint:calc(var(--_wp-ui-avatar-light-foreground)*var(--_wp-ui-avatar-light-tint) + (1 - var(--_wp-ui-avatar-light-foreground))*var(--_wp-ui-avatar-dark-tint));color:color(from var(--_wp-ui-avatar-background) srgb-linear calc(var(--_wp-ui-avatar-light-foreground) + (r - var(--_wp-ui-avatar-light-foreground)) * var(--_wp-ui-avatar-tint)) calc(var(--_wp-ui-avatar-light-foreground) + (g - var(--_wp-ui-avatar-light-foreground)) * var(--_wp-ui-avatar-tint)) calc(var(--_wp-ui-avatar-light-foreground) + (b - var(--_wp-ui-avatar-light-foreground)) * var(--_wp-ui-avatar-tint))/1)}}}}}'); 1575 } 1576 var style_default = { "root": "a9728400af96db77__root", "has-color": "_81a33c129d7cbe31__has-color", "is-square": "_32e65dea77285874__is-square", "is-xs": "_7d2020337343df5a__is-xs", "is-sm": "_216fb78a075c5ab4__is-sm", "is-lg": "b552ab04a3b94ae9__is-lg", "is-xl": "f8a7646462ff80d1__is-xl", "image": "_411c43ac028fe4be__image", "fallback": "_7883f856336224e2__fallback", "person-icon": "dc9b5131d4746aa6__person-icon" }; 1577 var Root = (0, import_element.forwardRef)( 1578 function AvatarRoot3({ size: size4 = "md", shape = "circle", color, className, style, ...props }, ref) { 1579 if (true) { 1580 warnAvatarColor(color); 1581 } 1582 const customProperties = color === void 0 ? style : { ...style, "--_wp-ui-avatar-color": color }; 1583 return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( 1584 index_parts_exports.Root, 1585 { 1586 ref, 1587 style: customProperties, 1588 className: clsx_default( 1589 resets_default["box-sizing"], 1590 global_css_defense_default.span, 1591 style_default.root, 1592 style_default[`is-$size4}`], 1593 shape === "square" && style_default["is-square"], 1594 color !== void 0 && style_default["has-color"], 1595 className 1596 ), 1597 ...props 1598 } 1599 ); 1600 } 1601 ); 1602 1603 // packages/ui/build-module/avatar/image.mjs 1604 var import_element2 = __toESM(require_element(), 1); 1605 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); 1606 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash"; 1607 function getRuntime2() { 1608 const globalScope = globalThis; 1609 if (globalScope.__wpStyleRuntime) { 1610 return globalScope.__wpStyleRuntime; 1611 } 1612 globalScope.__wpStyleRuntime = { 1613 documents: /* @__PURE__ */ new Map(), 1614 styles: /* @__PURE__ */ new Map(), 1615 injectedStyles: /* @__PURE__ */ new WeakMap() 1616 }; 1617 if (typeof document !== "undefined") { 1618 registerDocument2(document); 1619 } 1620 return globalScope.__wpStyleRuntime; 1621 } 1622 function documentContainsStyleHash2(targetDocument, hash) { 1623 if (!targetDocument.head) { 1624 return false; 1625 } 1626 for (const style of targetDocument.head.querySelectorAll( 1627 `style[$STYLE_HASH_ATTRIBUTE2}]` 1628 )) { 1629 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) { 1630 return true; 1631 } 1632 } 1633 return false; 1634 } 1635 function injectStyle2(targetDocument, hash, css) { 1636 if (!targetDocument.head) { 1637 return; 1638 } 1639 const runtime = getRuntime2(); 1640 let injectedStyles = runtime.injectedStyles.get(targetDocument); 1641 if (!injectedStyles) { 1642 injectedStyles = /* @__PURE__ */ new Set(); 1643 runtime.injectedStyles.set(targetDocument, injectedStyles); 1644 } 1645 if (injectedStyles.has(hash)) { 1646 return; 1647 } 1648 if (documentContainsStyleHash2(targetDocument, hash)) { 1649 injectedStyles.add(hash); 1650 return; 1651 } 1652 const style = targetDocument.createElement("style"); 1653 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash); 1654 style.appendChild(targetDocument.createTextNode(css)); 1655 targetDocument.head.appendChild(style); 1656 injectedStyles.add(hash); 1657 } 1658 function registerDocument2(targetDocument) { 1659 const runtime = getRuntime2(); 1660 runtime.documents.set( 1661 targetDocument, 1662 (runtime.documents.get(targetDocument) ?? 0) + 1 1663 ); 1664 for (const [hash, css] of runtime.styles) { 1665 injectStyle2(targetDocument, hash, css); 1666 } 1667 return () => { 1668 const count = runtime.documents.get(targetDocument); 1669 if (count === void 0) { 1670 return; 1671 } 1672 if (count <= 1) { 1673 runtime.documents.delete(targetDocument); 1674 return; 1675 } 1676 runtime.documents.set(targetDocument, count - 1); 1677 }; 1678 } 1679 function registerStyle2(hash, css) { 1680 const runtime = getRuntime2(); 1681 runtime.styles.set(hash, css); 1682 for (const targetDocument of runtime.documents.keys()) { 1683 injectStyle2(targetDocument, hash, css); 1684 } 1685 } 1686 if (typeof process === "undefined" || true) { 1687 registerStyle2("2657a3ab0c", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a9728400af96db77__root{--_wp-ui-avatar-size:var(--wpds-dimension-size-md,32px);--_gcd-span-position:relative;--_gcd-span-display:inline-flex;--_gcd-span-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);--_gcd-span-font-size:var(--_wp-ui-avatar-font-size);--_wp-ui-avatar-font-size:var(--wpds-typography-font-size-sm,12px);align-items:center;background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);block-size:var(--_wp-ui-avatar-size);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:50%;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:inline-flex;flex-shrink:0;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(--_wp-ui-avatar-font-size);font-weight:var(--wpds-typography-font-weight-emphasis,600);inline-size:var(--_wp-ui-avatar-size);justify-content:center;line-height:1;position:relative;vertical-align:middle}._81a33c129d7cbe31__has-color:after{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--_wp-ui-avatar-color);border-radius:inherit;content:"";inset:calc(var(--wpds-border-width-xs, 1px)*-1);pointer-events:none;position:absolute}._32e65dea77285874__is-square{border-radius:var(--wpds-border-radius-sm,2px)}._7d2020337343df5a__is-xs{--_wp-ui-avatar-size:var(--wpds-dimension-size-2xs,16px);--_wp-ui-avatar-font-size:calc(var(--_wp-ui-avatar-size)/2)}._216fb78a075c5ab4__is-sm{--_wp-ui-avatar-size:var(--wpds-dimension-size-sm,24px);--_wp-ui-avatar-font-size:var(--wpds-typography-font-size-xs,11px)}.b552ab04a3b94ae9__is-lg{--_wp-ui-avatar-size:var(--wpds-dimension-size-lg,40px);--_wp-ui-avatar-font-size:var(--wpds-typography-font-size-md,13px)}.f8a7646462ff80d1__is-xl{--_wp-ui-avatar-size:calc(var(--wpds-dimension-size-md, 32px)*2);--_wp-ui-avatar-font-size:var(--wpds-typography-font-size-xl,20px)}._411c43ac028fe4be__image,._7883f856336224e2__fallback{block-size:100%;border-radius:inherit;inline-size:100%;inset:0;position:absolute}._411c43ac028fe4be__image{object-fit:cover;@media not (prefers-reduced-motion){transition:opacity var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1));&[data-error],&[data-loading],&[data-starting-style]{opacity:0}}&[data-ending-style],&[data-error],&[data-loading]{visibility:hidden}}._7883f856336224e2__fallback{--_gcd-span-position:absolute;--_gcd-span-display:flex;align-items:center;display:flex;justify-content:center;overflow:hidden;white-space:nowrap;>svg{block-size:100%;flex-shrink:0;inline-size:100%}>.dc9b5131d4746aa6__person-icon{block-size:110%;color:var(--wpds-color-stroke-surface-neutral-strong,#8d8d8d);inline-size:110%;translate:0 15%}}@media not (forced-colors:active){@supports (color:rgb(from green r g b/1)) and (color:color(from green srgb-linear round(up,r) g b/1)){._81a33c129d7cbe31__has-color:has(>._7883f856336224e2__fallback){border:none}._81a33c129d7cbe31__has-color:has(>._7883f856336224e2__fallback):after{content:none}._81a33c129d7cbe31__has-color>._7883f856336224e2__fallback{--_wp-ui-avatar-background:rgb(from var(--_wp-ui-avatar-color) clamp(0,r,255) clamp(0,g,255) clamp(0,b,255)/1);--_wp-ui-avatar-contrast-target:4.55;background-color:var(--_wp-ui-avatar-background)}._81a33c129d7cbe31__has-color>._7883f856336224e2__fallback>.dc9b5131d4746aa6__person-icon{--_wp-ui-avatar-contrast-target:3.05}._81a33c129d7cbe31__has-color>._7883f856336224e2__fallback,._81a33c129d7cbe31__has-color>._7883f856336224e2__fallback>.dc9b5131d4746aa6__person-icon{--_wp-ui-avatar-luminance:calc(0.2126 * r + 0.7152 * g + 0.0722 * b);--_wp-ui-avatar-light-foreground:round(up,clamp(0,calc(0.17913 - var(--_wp-ui-avatar-luminance)),1));--_wp-ui-avatar-dark-tint:clamp(0,calc(((var(--_wp-ui-avatar-luminance) + 0.05)/var(--_wp-ui-avatar-contrast-target) - 0.05)/max(0.000001, var(--_wp-ui-avatar-luminance))),1);--_wp-ui-avatar-light-tint:clamp(0,calc((1.05 - var(--_wp-ui-avatar-contrast-target)*(var(--_wp-ui-avatar-luminance) + 0.05))/max(0.000001, 1 - var(--_wp-ui-avatar-luminance))),1);--_wp-ui-avatar-tint:calc(var(--_wp-ui-avatar-light-foreground)*var(--_wp-ui-avatar-light-tint) + (1 - var(--_wp-ui-avatar-light-foreground))*var(--_wp-ui-avatar-dark-tint));color:color(from var(--_wp-ui-avatar-background) srgb-linear calc(var(--_wp-ui-avatar-light-foreground) + (r - var(--_wp-ui-avatar-light-foreground)) * var(--_wp-ui-avatar-tint)) calc(var(--_wp-ui-avatar-light-foreground) + (g - var(--_wp-ui-avatar-light-foreground)) * var(--_wp-ui-avatar-tint)) calc(var(--_wp-ui-avatar-light-foreground) + (b - var(--_wp-ui-avatar-light-foreground)) * var(--_wp-ui-avatar-tint))/1)}}}}}'); 1688 } 1689 var style_default2 = { "root": "a9728400af96db77__root", "has-color": "_81a33c129d7cbe31__has-color", "is-square": "_32e65dea77285874__is-square", "is-xs": "_7d2020337343df5a__is-xs", "is-sm": "_216fb78a075c5ab4__is-sm", "is-lg": "b552ab04a3b94ae9__is-lg", "is-xl": "f8a7646462ff80d1__is-xl", "image": "_411c43ac028fe4be__image", "fallback": "_7883f856336224e2__fallback", "person-icon": "dc9b5131d4746aa6__person-icon" }; 1690 var Image = (0, import_element2.forwardRef)( 1691 function AvatarImage3({ className, ...props }, ref) { 1692 return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( 1693 index_parts_exports.Image, 1694 { 1695 ref, 1696 className: clsx_default(style_default2.image, className), 1697 ...props 1698 } 1699 ); 1700 } 1701 ); 1702 1703 // packages/ui/build-module/avatar/fallback.mjs 1704 var import_element14 = __toESM(require_element(), 1); 1705 var import_primitives2 = __toESM(require_primitives(), 1); 1706 1707 // packages/ui/build-module/icon/icon.mjs 1708 var import_element3 = __toESM(require_element(), 1); 1709 var import_primitives = __toESM(require_primitives(), 1); 1710 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); 1711 var Icon = (0, import_element3.forwardRef)( 1712 function UnforwardedIcon({ icon, size: size4 = 24, style, ...restProps }, ref) { 1713 const mergedStyle = icon.props.style || style ? { ...icon.props.style, ...style } : void 0; 1714 return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( 1715 import_primitives.SVG, 1716 { 1717 ref, 1718 ...icon.props, 1719 ...restProps, 1720 ...mergedStyle ? { style: mergedStyle } : {}, 1721 width: size4, 1722 height: size4 1723 } 1724 ); 1725 } 1726 ); 1727 1728 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useId.mjs 1729 var React16 = __toESM(require_react(), 1); 1730 1731 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useForcedRerendering.mjs 1732 var React15 = __toESM(require_react(), 1); 1733 function useForcedRerendering() { 1734 const [, setState] = React15.useState({}); 1735 return React15.useCallback(() => { 1736 setState({}); 1737 }, []); 1738 } 1739 1740 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useId.mjs 1741 var globalId = 0; 1742 function useGlobalId(idOverride, prefix = "mui") { 1743 const defaultId = React16.useRef(void 0); 1744 const forceRerender = useForcedRerendering(); 1745 const id = idOverride ?? defaultId.current; 1746 React16.useEffect(() => { 1747 if (defaultId.current == null) { 1748 globalId += 1; 1749 defaultId.current = `$prefix}-$globalId}`; 1750 if (idOverride == null) { 1751 forceRerender(); 1752 } 1753 } 1754 }, [idOverride, prefix, forceRerender]); 1755 return id; 1756 } 1757 var maybeReactUseId = SafeReact.useId; 1758 function useId(idOverride, prefix) { 1759 if (maybeReactUseId !== void 0) { 1760 const reactId = maybeReactUseId(); 1761 return idOverride ?? (prefix ? `$prefix}-$reactId}` : reactId); 1762 } 1763 return useGlobalId(idOverride, prefix); 1764 } 1765 1766 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useBaseUiId.mjs 1767 function useBaseUiId(idOverride) { 1768 return useId(idOverride, "base-ui"); 1769 } 1770 1771 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs 1772 function createChangeEventDetails(reason, event, trigger, customProperties) { 1773 let canceled = false; 1774 let allowPropagation = false; 1775 const custom = customProperties ?? EMPTY_OBJECT; 1776 const details = { 1777 reason, 1778 event: event ?? new Event("base-ui"), 1779 cancel() { 1780 canceled = true; 1781 }, 1782 allowPropagation() { 1783 allowPropagation = true; 1784 }, 1785 get isCanceled() { 1786 return canceled; 1787 }, 1788 get isPropagationAllowed() { 1789 return allowPropagation; 1790 }, 1791 trigger, 1792 ...custom 1793 }; 1794 return details; 1795 } 1796 1797 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/reason-parts.mjs 1798 var reason_parts_exports = {}; 1799 __export(reason_parts_exports, { 1800 cancelOpen: () => cancelOpen, 1801 chipRemovePress: () => chipRemovePress, 1802 clearPress: () => clearPress, 1803 closePress: () => closePress, 1804 closeWatcher: () => closeWatcher, 1805 decrementPress: () => decrementPress, 1806 disabled: () => disabled, 1807 drag: () => drag, 1808 escapeKey: () => escapeKey, 1809 focusOut: () => focusOut, 1810 imperativeAction: () => imperativeAction, 1811 incrementPress: () => incrementPress, 1812 initial: () => initial, 1813 inputBlur: () => inputBlur, 1814 inputChange: () => inputChange, 1815 inputClear: () => inputClear, 1816 inputPaste: () => inputPaste, 1817 inputPress: () => inputPress, 1818 itemPress: () => itemPress, 1819 keyboard: () => keyboard, 1820 linkPress: () => linkPress, 1821 listNavigation: () => listNavigation, 1822 missing: () => missing, 1823 none: () => none, 1824 outsidePress: () => outsidePress, 1825 pointer: () => pointer, 1826 popupClose: () => popupClose, 1827 scrub: () => scrub, 1828 siblingOpen: () => siblingOpen, 1829 swipe: () => swipe, 1830 trackPress: () => trackPress, 1831 triggerFocus: () => triggerFocus, 1832 triggerHover: () => triggerHover, 1833 triggerPress: () => triggerPress, 1834 wheel: () => wheel, 1835 windowResize: () => windowResize 1836 }); 1837 var none = "none"; 1838 var triggerPress = "trigger-press"; 1839 var triggerHover = "trigger-hover"; 1840 var triggerFocus = "trigger-focus"; 1841 var outsidePress = "outside-press"; 1842 var itemPress = "item-press"; 1843 var closePress = "close-press"; 1844 var linkPress = "link-press"; 1845 var clearPress = "clear-press"; 1846 var chipRemovePress = "chip-remove-press"; 1847 var trackPress = "track-press"; 1848 var incrementPress = "increment-press"; 1849 var decrementPress = "decrement-press"; 1850 var inputChange = "input-change"; 1851 var inputClear = "input-clear"; 1852 var inputBlur = "input-blur"; 1853 var inputPaste = "input-paste"; 1854 var inputPress = "input-press"; 1855 var focusOut = "focus-out"; 1856 var escapeKey = "escape-key"; 1857 var closeWatcher = "close-watcher"; 1858 var listNavigation = "list-navigation"; 1859 var keyboard = "keyboard"; 1860 var pointer = "pointer"; 1861 var drag = "drag"; 1862 var wheel = "wheel"; 1863 var scrub = "scrub"; 1864 var popupClose = "popup-close"; 1865 var cancelOpen = "cancel-open"; 1866 var siblingOpen = "sibling-open"; 1867 var disabled = "disabled"; 1868 var missing = "missing"; 1869 var initial = "initial"; 1870 var imperativeAction = "imperative-action"; 1871 var swipe = "swipe"; 1872 var windowResize = "window-resize"; 1873 1874 // node_modules/.store/@floating-ui/utils@0.2.12-gOxTzMf36nCrbeHpEew-rw/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs 1875 function hasWindow() { 1876 return typeof window !== "undefined"; 1877 } 1878 function getNodeName(node) { 1879 if (isNode(node)) { 1880 return (node.nodeName || "").toLowerCase(); 1881 } 1882 return "#document"; 1883 } 1884 function getWindow(node) { 1885 var _node$ownerDocument; 1886 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 1887 } 1888 function getDocumentElement(node) { 1889 var _ref; 1890 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; 1891 } 1892 function isNode(value) { 1893 if (!hasWindow()) { 1894 return false; 1895 } 1896 return value instanceof Node || value instanceof getWindow(value).Node; 1897 } 1898 function isElement(value) { 1899 if (!hasWindow()) { 1900 return false; 1901 } 1902 return value instanceof Element || value instanceof getWindow(value).Element; 1903 } 1904 function isHTMLElement(value) { 1905 if (!hasWindow()) { 1906 return false; 1907 } 1908 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 1909 } 1910 function isShadowRoot(value) { 1911 if (!hasWindow() || typeof ShadowRoot === "undefined") { 1912 return false; 1913 } 1914 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 1915 } 1916 function isOverflowElement(element) { 1917 const { 1918 overflow, 1919 overflowX, 1920 overflowY, 1921 display 1922 } = getComputedStyle2(element); 1923 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents"; 1924 } 1925 function isTableElement(element) { 1926 return /^(table|td|th)$/.test(getNodeName(element)); 1927 } 1928 function isTopLayer(element) { 1929 try { 1930 if (element.matches(":popover-open")) { 1931 return true; 1932 } 1933 } catch (_e) { 1934 } 1935 try { 1936 return element.matches(":modal"); 1937 } catch (_e) { 1938 return false; 1939 } 1940 } 1941 var willChangeRe = /transform|translate|scale|rotate|perspective|filter/; 1942 var containRe = /paint|layout|strict|content/; 1943 var isNotNone = (value) => !!value && value !== "none"; 1944 var isWebKitValue; 1945 function isContainingBlock(elementOrCss) { 1946 const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss; 1947 return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || ""); 1948 } 1949 function getContainingBlock(element) { 1950 let currentNode = getParentNode(element); 1951 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 1952 if (isContainingBlock(currentNode)) { 1953 return currentNode; 1954 } else if (isTopLayer(currentNode)) { 1955 return null; 1956 } 1957 currentNode = getParentNode(currentNode); 1958 } 1959 return null; 1960 } 1961 function isWebKit() { 1962 if (isWebKitValue == null) { 1963 isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"); 1964 } 1965 return isWebKitValue; 1966 } 1967 function isLastTraversableNode(node) { 1968 return /^(html|body|#document)$/.test(getNodeName(node)); 1969 } 1970 function getComputedStyle2(element) { 1971 return getWindow(element).getComputedStyle(element); 1972 } 1973 function getNodeScroll(element) { 1974 if (isElement(element)) { 1975 return { 1976 scrollLeft: element.scrollLeft, 1977 scrollTop: element.scrollTop 1978 }; 1979 } 1980 return { 1981 scrollLeft: element.scrollX, 1982 scrollTop: element.scrollY 1983 }; 1984 } 1985 function getParentNode(node) { 1986 if (getNodeName(node) === "html") { 1987 return node; 1988 } 1989 const result = ( 1990 // Step into the shadow DOM of the parent of a slotted node. 1991 node.assignedSlot || // DOM Element detected. 1992 node.parentNode || // ShadowRoot detected. 1993 isShadowRoot(node) && node.host || // Fallback. 1994 getDocumentElement(node) 1995 ); 1996 return isShadowRoot(result) ? result.host : result; 1997 } 1998 function getNearestOverflowAncestor(node) { 1999 const parentNode = getParentNode(node); 2000 if (isLastTraversableNode(parentNode)) { 2001 return (node.ownerDocument || node).body; 2002 } 2003 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 2004 return parentNode; 2005 } 2006 return getNearestOverflowAncestor(parentNode); 2007 } 2008 function getOverflowAncestors(node, list, traverseIframes) { 2009 var _node$ownerDocument2; 2010 if (list === void 0) { 2011 list = []; 2012 } 2013 if (traverseIframes === void 0) { 2014 traverseIframes = true; 2015 } 2016 const scrollableAncestor = getNearestOverflowAncestor(node); 2017 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 2018 const win = getWindow(scrollableAncestor); 2019 if (isBody) { 2020 const frameElement = getFrameElement(win); 2021 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 2022 } else { 2023 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 2024 } 2025 } 2026 function getFrameElement(win) { 2027 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 2028 } 2029 2030 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/owner.mjs 2031 function ownerDocument(node) { 2032 return node?.ownerDocument || document; 2033 } 2034 2035 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/addEventListener.mjs 2036 function addEventListener(target, type, listener, options) { 2037 target.addEventListener(type, listener, options); 2038 return () => { 2039 target.removeEventListener(type, listener, options); 2040 }; 2041 } 2042 2043 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useValueAsRef.mjs 2044 function useValueAsRef(value) { 2045 const latest = useRefWithInit(createLatestRef, value).current; 2046 latest.next = value; 2047 useIsoLayoutEffect(latest.effect); 2048 return latest; 2049 } 2050 function createLatestRef(value) { 2051 const latest = { 2052 current: value, 2053 next: value, 2054 effect: () => { 2055 latest.current = latest.next; 2056 } 2057 }; 2058 return latest; 2059 } 2060 2061 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/parts.mjs 2062 var parts_exports = {}; 2063 __export(parts_exports, { 2064 engine: () => engine_exports, 2065 env: () => env_exports, 2066 mediaQuery: () => media_query_exports, 2067 os: () => os_exports, 2068 screenReader: () => screen_reader_exports 2069 }); 2070 2071 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/os.mjs 2072 var os_exports = {}; 2073 __export(os_exports, { 2074 android: () => android, 2075 apple: () => apple, 2076 ios: () => ios, 2077 linux: () => linux, 2078 mac: () => mac, 2079 windows: () => windows 2080 }); 2081 2082 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/shared.mjs 2083 function readRawData() { 2084 if (typeof navigator === "undefined") { 2085 return { 2086 userAgent: "", 2087 platform: "", 2088 maxTouchPoints: 0 2089 }; 2090 } 2091 if (true) { 2092 const uaData = navigator.userAgentData; 2093 if (uaData && Array.isArray(uaData.brands)) { 2094 return { 2095 userAgent: uaData.brands.map(({ 2096 brand, 2097 version: version2 2098 }) => `$brand}/$version2}`).join(" "), 2099 platform: uaData.platform ?? navigator.platform ?? "", 2100 maxTouchPoints: navigator.maxTouchPoints ?? 0 2101 }; 2102 } 2103 } 2104 return { 2105 userAgent: navigator.userAgent, 2106 platform: navigator.platform ?? "", 2107 maxTouchPoints: navigator.maxTouchPoints ?? 0 2108 }; 2109 } 2110 var { 2111 userAgent, 2112 platform, 2113 maxTouchPoints 2114 } = readRawData(); 2115 var lowerUserAgent = userAgent.toLowerCase(); 2116 var lowerPlatform = platform.toLowerCase(); 2117 2118 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/os.mjs 2119 var ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === "macintel" && maxTouchPoints > 1; 2120 var ANDROID_STRING = "android"; 2121 var android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING); 2122 var mac = !ios && lowerPlatform.startsWith("mac"); 2123 var windows = lowerPlatform.startsWith("win"); 2124 var linux = !android && /^(linux|chrome os)/.test(lowerPlatform); 2125 var apple = mac || ios; 2126 2127 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/engine.mjs 2128 var engine_exports = {}; 2129 __export(engine_exports, { 2130 blink: () => blink, 2131 gecko: () => gecko, 2132 webkit: () => webkit 2133 }); 2134 var webkit = typeof CSS !== "undefined" && !!CSS.supports?.("-webkit-backdrop-filter:none"); 2135 var gecko = !webkit && lowerUserAgent.includes("firefox"); 2136 var blink = !webkit && lowerUserAgent.includes("chrom"); 2137 2138 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/screen-reader.mjs 2139 var screen_reader_exports = {}; 2140 __export(screen_reader_exports, { 2141 voiceOver: () => voiceOver 2142 }); 2143 var voiceOver = apple; 2144 2145 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/env.mjs 2146 var env_exports = {}; 2147 __export(env_exports, { 2148 jsdom: () => jsdom 2149 }); 2150 var jsdom = /jsdom|happydom/.test(lowerUserAgent); 2151 2152 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/media-query.mjs 2153 var media_query_exports = {}; 2154 __export(media_query_exports, { 2155 iOS: () => iOS 2156 }); 2157 var iOS = "@supports (-webkit-touch-callout: none)"; 2158 2159 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs 2160 var React17 = __toESM(require_react(), 1); 2161 2162 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/event.mjs 2163 function isReactEvent(event) { 2164 return "nativeEvent" in event; 2165 } 2166 function isVirtualClick(event) { 2167 if (event.pointerType === "" && event.isTrusted) { 2168 return true; 2169 } 2170 if (parts_exports.os.android && event.pointerType) { 2171 return event.type === "click" && event.buttons === 1; 2172 } 2173 return event.detail === 0 && !event.pointerType; 2174 } 2175 function isMouseLikePointerType(pointerType, strict) { 2176 const values = ["mouse", "pen"]; 2177 if (!strict) { 2178 values.push("", void 0); 2179 } 2180 return values.includes(pointerType); 2181 } 2182 function isClickLikeEvent(event) { 2183 const type = event.type; 2184 return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup"; 2185 } 2186 2187 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/shadowDom.mjs 2188 function activeElement(doc) { 2189 let element = doc.activeElement; 2190 while (element?.shadowRoot?.activeElement != null) { 2191 element = element.shadowRoot.activeElement; 2192 } 2193 return element; 2194 } 2195 function contains(parent, child) { 2196 if (!parent || !child) { 2197 return false; 2198 } 2199 const rootNode = child.getRootNode?.(); 2200 if (parent.contains(child)) { 2201 return true; 2202 } 2203 if (rootNode && isShadowRoot(rootNode)) { 2204 let next = child; 2205 while (next) { 2206 if (parent === next) { 2207 return true; 2208 } 2209 next = next.parentNode || next.host; 2210 } 2211 } 2212 return false; 2213 } 2214 function closest(node, selector) { 2215 let current = node; 2216 while (current) { 2217 if (isElement(current) && current.matches(selector)) { 2218 return current; 2219 } 2220 current = current.assignedSlot ?? current.parentNode ?? (isShadowRoot(current) ? current.host : null); 2221 } 2222 return null; 2223 } 2224 function getTarget(event) { 2225 if ("composedPath" in event) { 2226 return event.composedPath()[0] ?? event.target; 2227 } 2228 return event.target; 2229 } 2230 2231 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs 2232 var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable"; 2233 var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; 2234 2235 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs 2236 var open = "data-open"; 2237 var closed = "data-closed"; 2238 var anchorHidden = "data-anchor-hidden"; 2239 2240 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs 2241 var CommonTriggerDataAttributes_exports = {}; 2242 __export(CommonTriggerDataAttributes_exports, { 2243 popupOpen: () => popupOpen, 2244 pressed: () => pressed 2245 }); 2246 var popupOpen = "data-popup-open"; 2247 var pressed = "data-pressed"; 2248 2249 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popupStateMapping.mjs 2250 var TRIGGER_HOOK = { 2251 [popupOpen]: "" 2252 }; 2253 var PRESSABLE_TRIGGER_HOOK = { 2254 [popupOpen]: "", 2255 [pressed]: "" 2256 }; 2257 var POPUP_OPEN_HOOK = { 2258 [open]: "" 2259 }; 2260 var POPUP_CLOSED_HOOK = { 2261 [closed]: "" 2262 }; 2263 var ANCHOR_HIDDEN_HOOK = { 2264 [anchorHidden]: "" 2265 }; 2266 var triggerOpenStateMapping = { 2267 open(value) { 2268 if (value) { 2269 return TRIGGER_HOOK; 2270 } 2271 return null; 2272 } 2273 }; 2274 var popupStateMapping = { 2275 open(value) { 2276 if (value) { 2277 return POPUP_OPEN_HOOK; 2278 } 2279 return POPUP_CLOSED_HOOK; 2280 }, 2281 anchorHidden(value) { 2282 if (value) { 2283 return ANCHOR_HIDDEN_HOOK; 2284 } 2285 return null; 2286 } 2287 }; 2288 var popupTransitionStateMapping = { 2289 ...popupStateMapping, 2290 ...transitionStatusMapping 2291 }; 2292 2293 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs 2294 var popupOpen2 = CommonTriggerDataAttributes_exports.popupOpen; 2295 var triggerDisabled = "data-trigger-disabled"; 2296 2297 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/element.mjs 2298 function isTargetInsideEnabledTrigger(target, triggerElements) { 2299 if (!isElement(target)) { 2300 return false; 2301 } 2302 const targetElement = target; 2303 if (triggerElements.hasElement(targetElement)) { 2304 return !targetElement.hasAttribute(triggerDisabled); 2305 } 2306 for (const [, trigger] of triggerElements.entries()) { 2307 if (contains(trigger, targetElement)) { 2308 return !trigger.hasAttribute(triggerDisabled); 2309 } 2310 } 2311 return false; 2312 } 2313 function isEventTargetWithin(event, node) { 2314 if (node == null) { 2315 return false; 2316 } 2317 if ("composedPath" in event) { 2318 return event.composedPath().includes(node); 2319 } 2320 const eventAgain = event; 2321 return eventAgain.target != null && node.contains(eventAgain.target); 2322 } 2323 function isRootElement(element) { 2324 return element.matches("html,body"); 2325 } 2326 function isTypeableElement(element) { 2327 return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR); 2328 } 2329 function isInteractiveElement(element) { 2330 return closest(element, `button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),$TYPEABLE_SELECTOR}`) != null; 2331 } 2332 function matchesFocusVisible(element) { 2333 if (!element || parts_exports.env.jsdom) { 2334 return true; 2335 } 2336 try { 2337 return element.matches(":focus-visible"); 2338 } catch (_e) { 2339 return true; 2340 } 2341 } 2342 2343 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs 2344 function resolveValue(value, pointerType) { 2345 if (pointerType != null && !isMouseLikePointerType(pointerType)) { 2346 return 0; 2347 } 2348 if (typeof value === "function") { 2349 return value(); 2350 } 2351 return value; 2352 } 2353 function getDelay(value, prop, pointerType) { 2354 const result = resolveValue(value, pointerType); 2355 if (typeof result === "number") { 2356 return result; 2357 } 2358 return result?.[prop]; 2359 } 2360 function getRestMs(value) { 2361 if (typeof value === "function") { 2362 return value(); 2363 } 2364 return value; 2365 } 2366 function isClickLikeOpenEvent(openEventType, interactedInside) { 2367 return interactedInside || openEventType === "click" || openEventType === "mousedown"; 2368 } 2369 function isHoverOpenEvent(openEventType) { 2370 return openEventType?.includes("mouse") && openEventType !== "mousedown"; 2371 } 2372 2373 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs 2374 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); 2375 var FloatingDelayGroupContext = /* @__PURE__ */ React17.createContext({ 2376 hasProvider: false, 2377 timeoutMs: 0, 2378 delayRef: { 2379 current: 0 2380 }, 2381 initialDelayRef: { 2382 current: 0 2383 }, 2384 timeout: new Timeout(), 2385 currentIdRef: { 2386 current: null 2387 }, 2388 currentContextRef: { 2389 current: null 2390 } 2391 }); 2392 if (true) FloatingDelayGroupContext.displayName = "FloatingDelayGroupContext"; 2393 function resetDelayRef(delayRef, initialDelayRef) { 2394 delayRef.current = initialDelayRef.current; 2395 } 2396 function FloatingDelayGroup(props) { 2397 const { 2398 children, 2399 delay, 2400 timeoutMs = 0 2401 } = props; 2402 const delayRef = React17.useRef(delay); 2403 const initialDelayRef = React17.useRef(delay); 2404 const currentIdRef = React17.useRef(null); 2405 const currentContextRef = React17.useRef(null); 2406 const timeout = useTimeout(); 2407 useIsoLayoutEffect(() => { 2408 initialDelayRef.current = delay; 2409 if (!currentIdRef.current) { 2410 delayRef.current = delay; 2411 return; 2412 } 2413 delayRef.current = { 2414 open: getDelay(delayRef.current, "open"), 2415 close: getDelay(delay, "close") 2416 }; 2417 }, [delay, currentIdRef, delayRef, initialDelayRef]); 2418 return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FloatingDelayGroupContext.Provider, { 2419 value: React17.useMemo(() => ({ 2420 hasProvider: true, 2421 delayRef, 2422 initialDelayRef, 2423 currentIdRef, 2424 timeoutMs, 2425 currentContextRef, 2426 timeout 2427 }), [timeoutMs, timeout]), 2428 children 2429 }); 2430 } 2431 function useDelayGroup(store, options = { 2432 open: false 2433 }) { 2434 const { 2435 open: open2 2436 } = options; 2437 const floatingId = store.useState("floatingId"); 2438 const groupContext = React17.useContext(FloatingDelayGroupContext); 2439 const { 2440 currentIdRef, 2441 delayRef, 2442 timeoutMs, 2443 initialDelayRef, 2444 currentContextRef, 2445 hasProvider, 2446 timeout 2447 } = groupContext; 2448 const [isInstantPhase, setIsInstantPhase] = React17.useState(false); 2449 const openRef = React17.useRef(open2); 2450 useIsoLayoutEffect(() => { 2451 openRef.current = open2; 2452 }, [open2]); 2453 useIsoLayoutEffect(() => { 2454 function unset() { 2455 currentContextRef.current?.setIsInstantPhase(false); 2456 currentIdRef.current = null; 2457 currentContextRef.current = null; 2458 delayRef.current = initialDelayRef.current; 2459 timeout.clear(); 2460 } 2461 if (!currentIdRef.current) { 2462 return void 0; 2463 } 2464 if (!open2 && currentIdRef.current === floatingId) { 2465 setIsInstantPhase(false); 2466 if (timeoutMs) { 2467 const closingId = floatingId; 2468 timeout.start(timeoutMs, () => { 2469 if (store.select("open") || currentIdRef.current && currentIdRef.current !== closingId) { 2470 return; 2471 } 2472 unset(); 2473 }); 2474 return () => { 2475 if (openRef.current || currentIdRef.current !== closingId) { 2476 timeout.clear(); 2477 } 2478 }; 2479 } 2480 unset(); 2481 } 2482 return void 0; 2483 }, [open2, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store]); 2484 useIsoLayoutEffect(() => { 2485 if (!open2) { 2486 return; 2487 } 2488 const prevContext = currentContextRef.current; 2489 const prevId = currentIdRef.current; 2490 timeout.clear(); 2491 currentContextRef.current = { 2492 onOpenChange: store.setOpen, 2493 setIsInstantPhase 2494 }; 2495 currentIdRef.current = floatingId; 2496 delayRef.current = { 2497 open: 0, 2498 close: getDelay(initialDelayRef.current, "close") 2499 }; 2500 if (prevId !== null && prevId !== floatingId) { 2501 setIsInstantPhase(true); 2502 prevContext?.setIsInstantPhase(true); 2503 prevContext?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.none)); 2504 } else { 2505 setIsInstantPhase(false); 2506 prevContext?.setIsInstantPhase(false); 2507 } 2508 }, [open2, floatingId, store, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]); 2509 useIsoLayoutEffect(() => { 2510 return () => { 2511 if (currentIdRef.current === floatingId) { 2512 currentContextRef.current = null; 2513 if (!openRef.current) { 2514 return; 2515 } 2516 currentIdRef.current = null; 2517 resetDelayRef(delayRef, initialDelayRef); 2518 timeout.clear(); 2519 } 2520 }; 2521 }, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]); 2522 return React17.useMemo(() => ({ 2523 activeIdRef: currentIdRef, 2524 hasProvider, 2525 delayRef, 2526 isInstantPhase 2527 }), [currentIdRef, hasProvider, delayRef, isInstantPhase]); 2528 } 2529 2530 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/mergeCleanups.mjs 2531 function mergeCleanups(...cleanups) { 2532 return () => { 2533 for (let i = 0; i < cleanups.length; i += 1) { 2534 const cleanup = cleanups[i]; 2535 if (cleanup) { 2536 cleanup(); 2537 } 2538 } 2539 }; 2540 } 2541 2542 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/FocusGuard.mjs 2543 var React18 = __toESM(require_react(), 1); 2544 2545 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/visuallyHidden.mjs 2546 var visuallyHiddenBase = { 2547 clipPath: "inset(50%)", 2548 overflow: "hidden", 2549 whiteSpace: "nowrap", 2550 border: 0, 2551 padding: 0, 2552 width: 1, 2553 height: 1, 2554 margin: -1 2555 }; 2556 var visuallyHidden = { 2557 ...visuallyHiddenBase, 2558 position: "fixed", 2559 margin: 0, 2560 top: 0, 2561 left: 0 2562 }; 2563 var visuallyHiddenInput = { 2564 ...visuallyHiddenBase, 2565 position: "absolute" 2566 }; 2567 2568 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/FocusGuard.mjs 2569 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); 2570 var FocusGuard = /* @__PURE__ */ React18.forwardRef(function FocusGuard2(props, ref) { 2571 const [role, setRole] = React18.useState(); 2572 useIsoLayoutEffect(() => { 2573 if (parts_exports.screenReader.voiceOver && parts_exports.engine.webkit) { 2574 setRole("button"); 2575 } 2576 }, []); 2577 const restProps = { 2578 tabIndex: 0, 2579 // Role is only for VoiceOver 2580 role 2581 }; 2582 return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { 2583 ...props, 2584 ref, 2585 style: visuallyHidden, 2586 "aria-hidden": role ? void 0 : true, 2587 ...restProps, 2588 "data-base-ui-focus-guard": "" 2589 }); 2590 }); 2591 if (true) FocusGuard.displayName = "FocusGuard"; 2592 2593 // node_modules/.store/@floating-ui/utils@0.2.12-gOxTzMf36nCrbeHpEew-rw/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 2594 var min = Math.min; 2595 var max = Math.max; 2596 var round = Math.round; 2597 var floor = Math.floor; 2598 var createCoords = (v) => ({ 2599 x: v, 2600 y: v 2601 }); 2602 var oppositeSideMap = { 2603 left: "right", 2604 right: "left", 2605 bottom: "top", 2606 top: "bottom" 2607 }; 2608 function clamp(start, value, end) { 2609 return max(start, min(value, end)); 2610 } 2611 function evaluate(value, param) { 2612 return typeof value === "function" ? value(param) : value; 2613 } 2614 function getSide(placement) { 2615 return placement.split("-")[0]; 2616 } 2617 function getAlignment(placement) { 2618 return placement.split("-")[1]; 2619 } 2620 function getOppositeAxis(axis) { 2621 return axis === "x" ? "y" : "x"; 2622 } 2623 function getAxisLength(axis) { 2624 return axis === "y" ? "height" : "width"; 2625 } 2626 function getSideAxis(placement) { 2627 const firstChar = placement[0]; 2628 return firstChar === "t" || firstChar === "b" ? "y" : "x"; 2629 } 2630 function getAlignmentAxis(placement) { 2631 return getOppositeAxis(getSideAxis(placement)); 2632 } 2633 function getAlignmentSides(placement, rects, rtl) { 2634 if (rtl === void 0) { 2635 rtl = false; 2636 } 2637 const alignment = getAlignment(placement); 2638 const alignmentAxis = getAlignmentAxis(placement); 2639 const length = getAxisLength(alignmentAxis); 2640 let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; 2641 if (rects.reference[length] > rects.floating[length]) { 2642 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 2643 } 2644 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 2645 } 2646 function getExpandedPlacements(placement) { 2647 const oppositePlacement = getOppositePlacement(placement); 2648 return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; 2649 } 2650 function getOppositeAlignmentPlacement(placement) { 2651 return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start"); 2652 } 2653 var lrPlacement = ["left", "right"]; 2654 var rlPlacement = ["right", "left"]; 2655 var tbPlacement = ["top", "bottom"]; 2656 var btPlacement = ["bottom", "top"]; 2657 function getSideList(side, isStart, rtl) { 2658 switch (side) { 2659 case "top": 2660 case "bottom": 2661 if (rtl) return isStart ? rlPlacement : lrPlacement; 2662 return isStart ? lrPlacement : rlPlacement; 2663 case "left": 2664 case "right": 2665 return isStart ? tbPlacement : btPlacement; 2666 default: 2667 return []; 2668 } 2669 } 2670 function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 2671 const alignment = getAlignment(placement); 2672 let list = getSideList(getSide(placement), direction === "start", rtl); 2673 if (alignment) { 2674 list = list.map((side) => side + "-" + alignment); 2675 if (flipAlignment) { 2676 list = list.concat(list.map(getOppositeAlignmentPlacement)); 2677 } 2678 } 2679 return list; 2680 } 2681 function getOppositePlacement(placement) { 2682 const side = getSide(placement); 2683 return oppositeSideMap[side] + placement.slice(side.length); 2684 } 2685 function expandPaddingObject(padding) { 2686 var _padding$top, _padding$right, _padding$bottom, _padding$left; 2687 return { 2688 top: (_padding$top = padding.top) != null ? _padding$top : 0, 2689 right: (_padding$right = padding.right) != null ? _padding$right : 0, 2690 bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0, 2691 left: (_padding$left = padding.left) != null ? _padding$left : 0 2692 }; 2693 } 2694 function getPaddingObject(padding) { 2695 return typeof padding !== "number" ? expandPaddingObject(padding) : { 2696 top: padding, 2697 right: padding, 2698 bottom: padding, 2699 left: padding 2700 }; 2701 } 2702 function rectToClientRect(rect) { 2703 const { 2704 x, 2705 y, 2706 width, 2707 height 2708 } = rect; 2709 return { 2710 width, 2711 height, 2712 top: y, 2713 left: x, 2714 right: x + width, 2715 bottom: y + height, 2716 x, 2717 y 2718 }; 2719 } 2720 2721 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs 2722 function isHiddenByStyles(styles) { 2723 return styles.visibility === "hidden" || styles.visibility === "collapse"; 2724 } 2725 function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) { 2726 if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) { 2727 return false; 2728 } 2729 if (typeof element.checkVisibility === "function") { 2730 return element.checkVisibility(); 2731 } 2732 return styles.display !== "none" && styles.display !== "contents"; 2733 } 2734 2735 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs 2736 var CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]'; 2737 function getParentElement(element) { 2738 const assignedSlot = element.assignedSlot; 2739 if (assignedSlot) { 2740 return assignedSlot; 2741 } 2742 if (element.parentElement) { 2743 return element.parentElement; 2744 } 2745 const rootNode = element.getRootNode(); 2746 return isShadowRoot(rootNode) ? rootNode.host : null; 2747 } 2748 function getDetailsSummary(details) { 2749 for (const child of Array.from(details.children)) { 2750 if (getNodeName(child) === "summary") { 2751 return child; 2752 } 2753 } 2754 return null; 2755 } 2756 function isWithinOpenDetailsSummary(element, details) { 2757 const summary = getDetailsSummary(details); 2758 return !!summary && (element === summary || contains(summary, element)); 2759 } 2760 function isFocusableCandidate(element) { 2761 const nodeName = element ? getNodeName(element) : ""; 2762 return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== "summary" || element.parentElement != null && getNodeName(element.parentElement) === "details" && getDetailsSummary(element.parentElement) === element) && (nodeName !== "details" || getDetailsSummary(element) == null) && (nodeName !== "input" || element.type !== "hidden"); 2763 } 2764 function isFocusableElement(element) { 2765 if (!isFocusableCandidate(element) || !element.isConnected || element.matches(":disabled")) { 2766 return false; 2767 } 2768 for (let current = element; current; current = getParentElement(current)) { 2769 const isAncestor = current !== element; 2770 const isSlot = getNodeName(current) === "slot"; 2771 if (current.hasAttribute("inert")) { 2772 return false; 2773 } 2774 if (isAncestor && getNodeName(current) === "details" && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute("hidden") || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) { 2775 return false; 2776 } 2777 } 2778 return true; 2779 } 2780 function isVisibleInTabbableTree(element, isAncestor) { 2781 const styles = getComputedStyle2(element); 2782 if (!isAncestor) { 2783 return isElementVisible(element, styles); 2784 } 2785 return styles.display !== "none"; 2786 } 2787 function getTabIndex(element) { 2788 const tabIndex = element.tabIndex; 2789 if (tabIndex < 0) { 2790 const nodeName = getNodeName(element); 2791 if (nodeName === "details" || nodeName === "audio" || nodeName === "video" || isHTMLElement(element) && element.isContentEditable) { 2792 return 0; 2793 } 2794 } 2795 return tabIndex; 2796 } 2797 function getNamedRadioInput(element) { 2798 if (getNodeName(element) !== "input") { 2799 return null; 2800 } 2801 const input = element; 2802 return input.type === "radio" && input.name !== "" ? input : null; 2803 } 2804 function isTabbableRadio(element, candidates) { 2805 const input = getNamedRadioInput(element); 2806 if (!input) { 2807 return true; 2808 } 2809 const checkedRadio = candidates.find((candidate) => { 2810 const radio = getNamedRadioInput(candidate); 2811 return radio?.name === input.name && radio.form === input.form && radio.checked; 2812 }); 2813 if (checkedRadio) { 2814 return checkedRadio === input; 2815 } 2816 return candidates.find((candidate) => { 2817 const radio = getNamedRadioInput(candidate); 2818 return radio?.name === input.name && radio.form === input.form; 2819 }) === input; 2820 } 2821 function getComposedChildren(container) { 2822 if (isHTMLElement(container) && getNodeName(container) === "slot") { 2823 const assignedElements = container.assignedElements({ 2824 flatten: true 2825 }); 2826 if (assignedElements.length > 0) { 2827 return assignedElements; 2828 } 2829 } 2830 if (isHTMLElement(container) && container.shadowRoot) { 2831 return Array.from(container.shadowRoot.children); 2832 } 2833 return Array.from(container.children); 2834 } 2835 function appendCandidates(container, list) { 2836 getComposedChildren(container).forEach((child) => { 2837 if (isFocusableCandidate(child)) { 2838 list.push(child); 2839 } 2840 appendCandidates(child, list); 2841 }); 2842 } 2843 function appendMatchingElements(container, selector, list) { 2844 getComposedChildren(container).forEach((child) => { 2845 if (isHTMLElement(child) && child.matches(selector)) { 2846 list.push(child); 2847 } 2848 appendMatchingElements(child, selector, list); 2849 }); 2850 } 2851 function focusable(container) { 2852 const candidates = []; 2853 appendCandidates(container, candidates); 2854 return candidates.filter(isFocusableElement); 2855 } 2856 function tabbable(container) { 2857 const candidates = focusable(container); 2858 return candidates.filter((element) => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates)); 2859 } 2860 function getTabbableIn(container, dir) { 2861 const list = tabbable(container); 2862 const len = list.length; 2863 if (len === 0) { 2864 return void 0; 2865 } 2866 const active = activeElement(ownerDocument(container)); 2867 const index2 = list.indexOf(active); 2868 const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir; 2869 return list[nextIndex]; 2870 } 2871 function getNextTabbable(referenceElement) { 2872 return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement; 2873 } 2874 function getPreviousTabbable(referenceElement) { 2875 return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement; 2876 } 2877 function isOutsideEvent(event, container) { 2878 const containerElement = container || event.currentTarget; 2879 const relatedTarget = event.relatedTarget; 2880 return !relatedTarget || !contains(containerElement, relatedTarget); 2881 } 2882 function disableFocusInside(container) { 2883 const tabbableElements = tabbable(container); 2884 tabbableElements.forEach((element) => { 2885 element.dataset.tabindex = element.getAttribute("tabindex") || ""; 2886 element.setAttribute("tabindex", "-1"); 2887 }); 2888 } 2889 function enableFocusInside(container) { 2890 const elements = []; 2891 appendMatchingElements(container, "[data-tabindex]", elements); 2892 elements.forEach((element) => { 2893 const tabindex = element.dataset.tabindex; 2894 delete element.dataset.tabindex; 2895 if (tabindex) { 2896 element.setAttribute("tabindex", tabindex); 2897 } else { 2898 element.removeAttribute("tabindex"); 2899 } 2900 }); 2901 } 2902 2903 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs 2904 function getNodeChildren(nodes, id, onlyOpenChildren = true) { 2905 const directChildren = nodes.filter((node) => node.parentId === id); 2906 return directChildren.flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]); 2907 } 2908 2909 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs 2910 function createAttribute(name) { 2911 return `data-base-ui-$name}`; 2912 } 2913 2914 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs 2915 var React19 = __toESM(require_react(), 1); 2916 var ReactDOM2 = __toESM(require_react_dom(), 1); 2917 2918 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/constants.mjs 2919 var DISABLED_TRANSITIONS_STYLE = { 2920 style: { 2921 transition: "none" 2922 } 2923 }; 2924 var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore"; 2925 var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore"; 2926 var BASE_UI_SWIPE_IGNORE_SELECTOR = `[$BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`; 2927 var LEGACY_SWIPE_IGNORE_SELECTOR = `[$LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`; 2928 var POPUP_COLLISION_AVOIDANCE = { 2929 fallbackAxisSide: "end" 2930 }; 2931 var ownerVisuallyHidden = { 2932 clipPath: "inset(50%)", 2933 position: "fixed", 2934 top: 0, 2935 left: 0 2936 }; 2937 2938 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs 2939 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); 2940 var PortalContext = /* @__PURE__ */ React19.createContext(null); 2941 if (true) PortalContext.displayName = "PortalContext"; 2942 var usePortalContext = () => React19.useContext(PortalContext); 2943 var attr = createAttribute("portal"); 2944 function useFloatingPortalNode(props = {}) { 2945 const { 2946 ref, 2947 container: containerProp, 2948 componentProps = EMPTY_OBJECT, 2949 elementProps 2950 } = props; 2951 const uniqueId = useId(); 2952 const portalContext = usePortalContext(); 2953 const parentPortalNode = portalContext?.portalNode; 2954 const [containerElement, setContainerElement] = React19.useState(null); 2955 const [portalNode, setPortalNode] = React19.useState(null); 2956 const setPortalNodeRef = useStableCallback((node) => { 2957 if (node !== null) { 2958 setPortalNode(node); 2959 } 2960 }); 2961 const containerRef = React19.useRef(null); 2962 useIsoLayoutEffect(() => { 2963 if (containerProp === null) { 2964 if (containerRef.current) { 2965 containerRef.current = null; 2966 setPortalNode(null); 2967 setContainerElement(null); 2968 } 2969 return; 2970 } 2971 const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body; 2972 if (resolvedContainer == null) { 2973 if (containerRef.current) { 2974 containerRef.current = null; 2975 setPortalNode(null); 2976 setContainerElement(null); 2977 } 2978 return; 2979 } 2980 if (containerRef.current !== resolvedContainer) { 2981 containerRef.current = resolvedContainer; 2982 setPortalNode(null); 2983 setContainerElement(resolvedContainer); 2984 } 2985 }, [containerProp, parentPortalNode]); 2986 const portalElement = useRenderElement("div", componentProps, { 2987 ref: [ref, setPortalNodeRef], 2988 props: [{ 2989 id: uniqueId, 2990 [attr]: "" 2991 }, elementProps] 2992 }); 2993 const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null; 2994 return { 2995 node: portalNode, 2996 // `id` and `render` props can override or remove the generated ID. Use the exact 2997 // rendered value so `aria-owns` never points at an ID absent from the DOM. 2998 nodeId: /* @__PURE__ */ React19.isValidElement(portalElement) ? portalElement.props.id : void 0, 2999 subtree: portalSubtree 3000 }; 3001 } 3002 var FloatingPortal = /* @__PURE__ */ React19.forwardRef(function FloatingPortal2(componentProps, forwardedRef) { 3003 const { 3004 render, 3005 className, 3006 style, 3007 children, 3008 container, 3009 portalOwnerRole, 3010 ...elementProps 3011 } = componentProps; 3012 const { 3013 node: portalNode, 3014 nodeId: portalNodeId, 3015 subtree: portalSubtree 3016 } = useFloatingPortalNode({ 3017 container, 3018 ref: forwardedRef, 3019 componentProps, 3020 elementProps 3021 }); 3022 const beforeOutsideRef = React19.useRef(null); 3023 const afterOutsideRef = React19.useRef(null); 3024 const beforeInsideRef = React19.useRef(null); 3025 const afterInsideRef = React19.useRef(null); 3026 const [focusManagerState, setFocusManagerState] = React19.useState(null); 3027 const focusInsideDisabledRef = React19.useRef(false); 3028 const modal = focusManagerState?.modal; 3029 const open2 = focusManagerState?.open; 3030 const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode; 3031 React19.useEffect(() => { 3032 if (!portalNode || modal) { 3033 return void 0; 3034 } 3035 function onFocus(event) { 3036 if (portalNode && event.relatedTarget && isOutsideEvent(event)) { 3037 if (event.type === "focusin") { 3038 if (focusInsideDisabledRef.current) { 3039 enableFocusInside(portalNode); 3040 focusInsideDisabledRef.current = false; 3041 } 3042 } else { 3043 disableFocusInside(portalNode); 3044 focusInsideDisabledRef.current = true; 3045 } 3046 } 3047 } 3048 return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true)); 3049 }, [portalNode, modal]); 3050 useIsoLayoutEffect(() => { 3051 if (!portalNode || open2 !== true || !focusInsideDisabledRef.current) { 3052 return; 3053 } 3054 enableFocusInside(portalNode); 3055 focusInsideDisabledRef.current = false; 3056 }, [open2, portalNode]); 3057 const portalContextValue = React19.useMemo(() => ({ 3058 beforeOutsideRef, 3059 afterOutsideRef, 3060 beforeInsideRef, 3061 afterInsideRef, 3062 portalNode, 3063 setFocusManagerState 3064 }), [portalNode]); 3065 return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(React19.Fragment, { 3066 children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(PortalContext.Provider, { 3067 value: portalContextValue, 3068 children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FocusGuard, { 3069 "data-type": "outside", 3070 ref: beforeOutsideRef, 3071 onFocus: (event) => { 3072 if (isOutsideEvent(event, portalNode)) { 3073 beforeInsideRef.current?.focus(); 3074 } else { 3075 const domReference = focusManagerState ? focusManagerState.domReference : null; 3076 const prevTabbable = getPreviousTabbable(domReference); 3077 prevTabbable?.focus(); 3078 } 3079 } 3080 }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { 3081 role: portalOwnerRole, 3082 "aria-owns": portalNodeId, 3083 style: ownerVisuallyHidden 3084 }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FocusGuard, { 3085 "data-type": "outside", 3086 ref: afterOutsideRef, 3087 onFocus: (event) => { 3088 if (isOutsideEvent(event, portalNode)) { 3089 afterInsideRef.current?.focus(); 3090 } else { 3091 const domReference = focusManagerState ? focusManagerState.domReference : null; 3092 const nextTabbable = getNextTabbable(domReference); 3093 nextTabbable?.focus(); 3094 if (focusManagerState?.closeOnFocusOut) { 3095 focusManagerState?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent)); 3096 } 3097 } 3098 } 3099 })] 3100 })] 3101 }); 3102 }); 3103 if (true) FloatingPortal.displayName = "FloatingPortal"; 3104 3105 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs 3106 var React20 = __toESM(require_react(), 1); 3107 3108 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs 3109 function createEventEmitter() { 3110 const map = /* @__PURE__ */ new Map(); 3111 return { 3112 emit(event, data) { 3113 map.get(event)?.forEach((listener) => listener(data)); 3114 }, 3115 on(event, listener) { 3116 if (!map.has(event)) { 3117 map.set(event, /* @__PURE__ */ new Set()); 3118 } 3119 map.get(event).add(listener); 3120 }, 3121 off(event, listener) { 3122 map.get(event)?.delete(listener); 3123 } 3124 }; 3125 } 3126 3127 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs 3128 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); 3129 var FloatingNodeContext = /* @__PURE__ */ React20.createContext(null); 3130 if (true) FloatingNodeContext.displayName = "FloatingNodeContext"; 3131 var FloatingTreeContext = /* @__PURE__ */ React20.createContext(null); 3132 if (true) FloatingTreeContext.displayName = "FloatingTreeContext"; 3133 var useFloatingParentNodeId = () => React20.useContext(FloatingNodeContext)?.id || null; 3134 var useFloatingTree = (externalTree) => { 3135 const contextTree = React20.useContext(FloatingTreeContext); 3136 return externalTree ?? contextTree; 3137 }; 3138 3139 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs 3140 var React21 = __toESM(require_react(), 1); 3141 function createVirtualElement(domElement, data) { 3142 let offsetX = null; 3143 let offsetY = null; 3144 let isAutoUpdateEvent = false; 3145 return { 3146 contextElement: domElement || void 0, 3147 getBoundingClientRect() { 3148 const domRect = domElement?.getBoundingClientRect() || { 3149 width: 0, 3150 height: 0, 3151 x: 0, 3152 y: 0 3153 }; 3154 const isXAxis = data.axis === "x" || data.axis === "both"; 3155 const isYAxis = data.axis === "y" || data.axis === "both"; 3156 const canTrackCursorOnAutoUpdate = ["mouseenter", "mousemove"].includes(data.dataRef.current.openEvent?.type || "") && data.pointerType !== "touch"; 3157 const width = data.axis === "y" ? domRect.width : 0; 3158 const height = data.axis === "x" ? domRect.height : 0; 3159 let x = domRect.x; 3160 let y = domRect.y; 3161 if (offsetX == null && data.x && isXAxis) { 3162 offsetX = domRect.x - data.x; 3163 } 3164 if (offsetY == null && data.y && isYAxis) { 3165 offsetY = domRect.y - data.y; 3166 } 3167 x -= offsetX || 0; 3168 y -= offsetY || 0; 3169 if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) { 3170 x = isXAxis && data.x != null ? data.x : x; 3171 y = isYAxis && data.y != null ? data.y : y; 3172 } 3173 isAutoUpdateEvent = true; 3174 return { 3175 width, 3176 height, 3177 x, 3178 y, 3179 top: y, 3180 right: x + width, 3181 bottom: y + height, 3182 left: x 3183 }; 3184 } 3185 }; 3186 } 3187 function isMouseBasedEvent(event) { 3188 return event != null && event.clientX != null; 3189 } 3190 function useClientPoint(store, props = {}) { 3191 const { 3192 enabled = true, 3193 axis = "both" 3194 } = props; 3195 const open2 = store.useState("open"); 3196 const floating = store.useState("floatingElement"); 3197 const domReference = store.useState("domReferenceElement"); 3198 const dataRef = store.context.dataRef; 3199 const initialRef = React21.useRef(false); 3200 const cleanupListenerRef = React21.useRef(null); 3201 const [pointerType, setPointerType] = React21.useState(); 3202 const [reactive, setReactive] = React21.useState([]); 3203 const resetReference = useStableCallback((reference2) => { 3204 store.set("positionReference", reference2); 3205 }); 3206 const setReference = useStableCallback((newX, newY, referenceElement) => { 3207 if (initialRef.current) { 3208 return; 3209 } 3210 if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) { 3211 return; 3212 } 3213 store.set("positionReference", createVirtualElement(referenceElement ?? domReference, { 3214 x: newX, 3215 y: newY, 3216 axis, 3217 dataRef, 3218 pointerType 3219 })); 3220 }); 3221 const handleReferenceEnterOrMove = useStableCallback((event) => { 3222 if (!open2) { 3223 setReference(event.clientX, event.clientY, event.currentTarget); 3224 } else if (!cleanupListenerRef.current) { 3225 setReference(event.clientX, event.clientY, event.currentTarget); 3226 setReactive([]); 3227 } 3228 }); 3229 const openCheck = isMouseLikePointerType(pointerType) ? floating : open2; 3230 React21.useEffect(() => { 3231 if (!enabled) { 3232 resetReference(domReference); 3233 return void 0; 3234 } 3235 if (!openCheck) { 3236 return void 0; 3237 } 3238 function cleanupListener() { 3239 cleanupListenerRef.current?.(); 3240 cleanupListenerRef.current = null; 3241 } 3242 const win = getWindow(floating); 3243 function handleMouseMove(event) { 3244 const target = getTarget(event); 3245 if (!contains(floating, target)) { 3246 setReference(event.clientX, event.clientY); 3247 } else { 3248 cleanupListener(); 3249 } 3250 } 3251 if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) { 3252 cleanupListenerRef.current = addEventListener(win, "mousemove", handleMouseMove); 3253 } else { 3254 resetReference(domReference); 3255 } 3256 return cleanupListener; 3257 }, [openCheck, enabled, floating, dataRef, domReference, store, setReference, resetReference, reactive]); 3258 React21.useEffect(() => () => { 3259 store.set("positionReference", null); 3260 }, [store]); 3261 React21.useEffect(() => { 3262 if (enabled && !floating) { 3263 initialRef.current = false; 3264 } 3265 }, [enabled, floating]); 3266 React21.useEffect(() => { 3267 if (!enabled && open2) { 3268 initialRef.current = true; 3269 } 3270 }, [enabled, open2]); 3271 const reference = React21.useMemo(() => { 3272 function setPointerTypeRef(event) { 3273 setPointerType(event.pointerType); 3274 } 3275 return { 3276 onPointerDown: setPointerTypeRef, 3277 onPointerEnter: setPointerTypeRef, 3278 onMouseMove: handleReferenceEnterOrMove, 3279 onMouseEnter: handleReferenceEnterOrMove 3280 }; 3281 }, [handleReferenceEnterOrMove]); 3282 return React21.useMemo(() => enabled ? { 3283 reference, 3284 trigger: reference 3285 } : {}, [enabled, reference]); 3286 } 3287 3288 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs 3289 var React22 = __toESM(require_react(), 1); 3290 function alwaysFalse() { 3291 return false; 3292 } 3293 function normalizeProp(normalizable) { 3294 return { 3295 escapeKey: typeof normalizable === "boolean" ? normalizable : normalizable?.escapeKey ?? false, 3296 outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true 3297 }; 3298 } 3299 function useDismiss(store, props = {}) { 3300 const { 3301 enabled = true, 3302 escapeKey: escapeKey2 = true, 3303 outsidePress: outsidePressProp = true, 3304 outsidePressEvent = "sloppy", 3305 referencePress = alwaysFalse, 3306 bubbles, 3307 externalTree 3308 } = props; 3309 const open2 = store.useState("open"); 3310 const floatingElement = store.useState("floatingElement"); 3311 const { 3312 dataRef, 3313 events 3314 } = store.context; 3315 const tree = useFloatingTree(externalTree); 3316 const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false); 3317 const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp; 3318 const outsidePressEnabled = outsidePress2 !== false; 3319 const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent); 3320 const { 3321 escapeKey: escapeKeyBubbles, 3322 outsidePress: outsidePressBubbles 3323 } = normalizeProp(bubbles); 3324 const pressStartedInsideRef = React22.useRef(false); 3325 const pressStartPreventedRef = React22.useRef(false); 3326 const suppressNextOutsideClickRef = React22.useRef(false); 3327 const sawPressWhileOpenRef = React22.useRef(false); 3328 const isComposingRef = React22.useRef(false); 3329 const currentPointerTypeRef = React22.useRef(""); 3330 const touchStateRef = React22.useRef(null); 3331 const cancelDismissOnEndTimeout = useTimeout(); 3332 const clearInsideReactTreeTimeout = useTimeout(); 3333 const compositionTimeout = useTimeout(); 3334 const clearInsideReactTree = useStableCallback(() => { 3335 clearInsideReactTreeTimeout.clear(); 3336 dataRef.current.insideReactTree = false; 3337 }); 3338 const hasBlockingChild = useStableCallback((bubbleKey) => { 3339 const nodeId = dataRef.current.floatingContext?.nodeId; 3340 const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : []; 3341 return children.some((child) => child.context?.open && !child.context.dataRef.current[bubbleKey]); 3342 }); 3343 const isEventWithinOwnElements = useStableCallback((event) => { 3344 return isEventTargetWithin(event, store.select("floatingElement")) || isEventTargetWithin(event, store.select("domReferenceElement")); 3345 }); 3346 const closeOnReferencePress = useStableCallback((event) => { 3347 if (!referencePress()) { 3348 return; 3349 } 3350 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent)); 3351 }); 3352 const closeOnEscapeKeyDown = useStableCallback((event) => { 3353 if (!open2 || !enabled || !escapeKey2 || event.key !== "Escape") { 3354 return; 3355 } 3356 const native = isReactEvent(event) ? event.nativeEvent : event; 3357 if (isComposingRef.current || native.isComposing) { 3358 return; 3359 } 3360 if (!escapeKeyBubbles && hasBlockingChild("__escapeKeyBubbles")) { 3361 return; 3362 } 3363 const eventDetails = createChangeEventDetails(reason_parts_exports.escapeKey, native); 3364 store.setOpen(false, eventDetails); 3365 if (!eventDetails.isCanceled) { 3366 event.preventDefault(); 3367 } 3368 if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) { 3369 event.stopPropagation(); 3370 } 3371 }); 3372 const markInsideReactTree = useStableCallback(() => { 3373 dataRef.current.insideReactTree = true; 3374 clearInsideReactTreeTimeout.start(0, clearInsideReactTree); 3375 }); 3376 const markPressStartedInsideReactTree = useStableCallback((event) => { 3377 if (!open2 || !enabled || event.button !== 0) { 3378 return; 3379 } 3380 const target = getTarget(event.nativeEvent); 3381 if (!contains(store.select("floatingElement"), target)) { 3382 return; 3383 } 3384 if (!pressStartedInsideRef.current) { 3385 pressStartedInsideRef.current = true; 3386 pressStartPreventedRef.current = false; 3387 } 3388 }); 3389 const markInsidePressStartPrevented = useStableCallback((event) => { 3390 if (!open2 || !enabled) { 3391 return; 3392 } 3393 if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) { 3394 return; 3395 } 3396 if (pressStartedInsideRef.current) { 3397 pressStartPreventedRef.current = true; 3398 } 3399 }); 3400 React22.useEffect(() => { 3401 function handleOpenChange(details) { 3402 if (!details.open) { 3403 sawPressWhileOpenRef.current = false; 3404 } 3405 } 3406 events.on("openchange", handleOpenChange); 3407 return () => { 3408 events.off("openchange", handleOpenChange); 3409 }; 3410 }, [events]); 3411 React22.useEffect(() => clearInsideReactTree, [clearInsideReactTree]); 3412 React22.useEffect(() => { 3413 if (!open2 || !enabled) { 3414 if (!open2) { 3415 sawPressWhileOpenRef.current = false; 3416 isComposingRef.current = false; 3417 currentPointerTypeRef.current = ""; 3418 touchStateRef.current = null; 3419 } 3420 return clearInsideReactTree; 3421 } 3422 dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; 3423 dataRef.current.__outsidePressBubbles = outsidePressBubbles; 3424 const preventedPressSuppressionTimeout = new Timeout(); 3425 const doc = ownerDocument(floatingElement); 3426 function handleCompositionStart() { 3427 compositionTimeout.clear(); 3428 isComposingRef.current = true; 3429 } 3430 function handleCompositionEnd() { 3431 isComposingRef.current = true; 3432 compositionTimeout.start( 3433 // 0ms or 1ms don't work in Safari. 5ms appears to consistently work. 3434 // Only apply to WebKit for the test to remain 0ms. 3435 parts_exports.engine.webkit ? 5 : 0, 3436 () => { 3437 isComposingRef.current = false; 3438 } 3439 ); 3440 } 3441 function suppressImmediateOutsideClickAfterPreventedStart() { 3442 suppressNextOutsideClickRef.current = true; 3443 preventedPressSuppressionTimeout.start(0, () => { 3444 suppressNextOutsideClickRef.current = false; 3445 }); 3446 } 3447 function resetPressStartState() { 3448 pressStartedInsideRef.current = false; 3449 pressStartPreventedRef.current = false; 3450 } 3451 function getOutsidePressEvent() { 3452 const type = currentPointerTypeRef.current; 3453 const computedType = type === "pen" || !type ? "mouse" : type; 3454 const outsidePressEventValue = getOutsidePressEventProp(); 3455 const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue; 3456 if (typeof resolved === "string") { 3457 return resolved; 3458 } 3459 return resolved[computedType]; 3460 } 3461 function shouldIgnoreEvent(event) { 3462 const computedOutsidePressEvent = getOutsidePressEvent(); 3463 return computedOutsidePressEvent === "intentional" && event.type !== "click" || computedOutsidePressEvent === "sloppy" && event.type === "click"; 3464 } 3465 function isEventWithinFloatingTree(event) { 3466 const nodeId = dataRef.current.floatingContext?.nodeId; 3467 const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => isEventTargetWithin(event, node.context?.elements.floating)); 3468 return isEventWithinOwnElements(event) || targetIsInsideChildren; 3469 } 3470 function closeOnPressOutside(event) { 3471 if (shouldIgnoreEvent(event)) { 3472 if (event.type !== "click" && !isEventWithinOwnElements(event)) { 3473 preventedPressSuppressionTimeout.clear(); 3474 suppressNextOutsideClickRef.current = false; 3475 } 3476 clearInsideReactTree(); 3477 return; 3478 } 3479 if (dataRef.current.insideReactTree) { 3480 clearInsideReactTree(); 3481 return; 3482 } 3483 const target = getTarget(event); 3484 const inertSelector = `[$createAttribute("inert")}]`; 3485 const targetRoot = isElement(target) ? target.getRootNode() : null; 3486 const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select("floatingElement"))).querySelectorAll(inertSelector)); 3487 const triggers = store.context.triggerElements; 3488 if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) { 3489 return; 3490 } 3491 let targetRootAncestor = isElement(target) ? target : null; 3492 while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) { 3493 const nextParent = getParentNode(targetRootAncestor); 3494 if (isLastTraversableNode(nextParent) || !isElement(nextParent)) { 3495 break; 3496 } 3497 targetRootAncestor = nextParent; 3498 } 3499 if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay). 3500 !contains(target, store.select("floatingElement")) && // If the target root element contains none of the markers, then the 3501 // element was injected after the floating element rendered. 3502 markers.every((marker) => !contains(targetRootAncestor, marker))) { 3503 return; 3504 } 3505 if (isHTMLElement(target) && !("touches" in event)) { 3506 const lastTraversableNode = isLastTraversableNode(target); 3507 const style = getComputedStyle2(target); 3508 const scrollRe = /auto|scroll/; 3509 const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX); 3510 const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY); 3511 const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth; 3512 const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight; 3513 const isRTL3 = style.direction === "rtl"; 3514 const pressedVerticalScrollbar = canScrollY && (isRTL3 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth); 3515 const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight; 3516 if (pressedVerticalScrollbar || pressedHorizontalScrollbar) { 3517 return; 3518 } 3519 } 3520 if (isEventWithinFloatingTree(event)) { 3521 return; 3522 } 3523 if (getOutsidePressEvent() === "intentional") { 3524 if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) { 3525 return; 3526 } 3527 if (suppressNextOutsideClickRef.current) { 3528 preventedPressSuppressionTimeout.clear(); 3529 suppressNextOutsideClickRef.current = false; 3530 return; 3531 } 3532 } 3533 if (typeof outsidePress2 === "function" && !outsidePress2(event)) { 3534 return; 3535 } 3536 if (hasBlockingChild("__outsidePressBubbles")) { 3537 return; 3538 } 3539 store.setOpen(false, createChangeEventDetails(reason_parts_exports.outsidePress, event)); 3540 clearInsideReactTree(); 3541 } 3542 function handlePointerDown(event) { 3543 if (getOutsidePressEvent() !== "sloppy" || event.pointerType === "touch" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) { 3544 return; 3545 } 3546 closeOnPressOutside(event); 3547 } 3548 function handleTouchStart(event) { 3549 if (getOutsidePressEvent() !== "sloppy" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) { 3550 return; 3551 } 3552 const touch = event.touches[0]; 3553 if (touch) { 3554 touchStateRef.current = { 3555 startTime: Date.now(), 3556 startX: touch.clientX, 3557 startY: touch.clientY, 3558 dismissOnTouchEnd: false, 3559 dismissOnMouseDown: true 3560 }; 3561 cancelDismissOnEndTimeout.start(1e3, () => { 3562 if (touchStateRef.current) { 3563 touchStateRef.current.dismissOnTouchEnd = false; 3564 touchStateRef.current.dismissOnMouseDown = false; 3565 } 3566 }); 3567 } 3568 } 3569 function addTargetEventListenerOnce(event, listener) { 3570 const target = getTarget(event); 3571 if (!target) { 3572 return; 3573 } 3574 const unsubscribe2 = addEventListener(target, event.type, () => { 3575 listener(event); 3576 unsubscribe2(); 3577 }); 3578 } 3579 function handleTouchStartCapture(event) { 3580 currentPointerTypeRef.current = "touch"; 3581 addTargetEventListenerOnce(event, handleTouchStart); 3582 } 3583 function closeOnPressOutsideCapture(event) { 3584 cancelDismissOnEndTimeout.clear(); 3585 if (event.type === "pointerdown") { 3586 if (event.button === 0) { 3587 sawPressWhileOpenRef.current = true; 3588 } 3589 currentPointerTypeRef.current = event.pointerType; 3590 } 3591 if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) { 3592 return; 3593 } 3594 addTargetEventListenerOnce(event, (targetEvent) => { 3595 if (targetEvent.type === "pointerdown") { 3596 handlePointerDown(targetEvent); 3597 } else { 3598 closeOnPressOutside(targetEvent); 3599 } 3600 }); 3601 } 3602 function handlePressEndCapture(event) { 3603 if (event.type === "pointercancel") { 3604 sawPressWhileOpenRef.current = false; 3605 } 3606 if (!pressStartedInsideRef.current) { 3607 return; 3608 } 3609 const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current; 3610 resetPressStartState(); 3611 if (getOutsidePressEvent() !== "intentional") { 3612 return; 3613 } 3614 if (event.type === "pointercancel") { 3615 if (pressStartedInsideDefaultPrevented) { 3616 suppressImmediateOutsideClickAfterPreventedStart(); 3617 } 3618 return; 3619 } 3620 if (isEventWithinFloatingTree(event)) { 3621 return; 3622 } 3623 if (pressStartedInsideDefaultPrevented) { 3624 suppressImmediateOutsideClickAfterPreventedStart(); 3625 return; 3626 } 3627 if (typeof outsidePress2 === "function" && !outsidePress2(event)) { 3628 return; 3629 } 3630 preventedPressSuppressionTimeout.clear(); 3631 suppressNextOutsideClickRef.current = true; 3632 clearInsideReactTree(); 3633 } 3634 function handleTouchMove(event) { 3635 if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) { 3636 return; 3637 } 3638 const touch = event.touches[0]; 3639 if (!touch) { 3640 return; 3641 } 3642 const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX); 3643 const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY); 3644 const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); 3645 if (distance > 5) { 3646 touchStateRef.current.dismissOnTouchEnd = true; 3647 } 3648 if (distance > 10) { 3649 closeOnPressOutside(event); 3650 cancelDismissOnEndTimeout.clear(); 3651 touchStateRef.current = null; 3652 } 3653 } 3654 function handleTouchMoveCapture(event) { 3655 addTargetEventListenerOnce(event, handleTouchMove); 3656 } 3657 function handleTouchEnd(event) { 3658 if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) { 3659 return; 3660 } 3661 if (touchStateRef.current.dismissOnTouchEnd) { 3662 closeOnPressOutside(event); 3663 } 3664 cancelDismissOnEndTimeout.clear(); 3665 touchStateRef.current = null; 3666 } 3667 function handleTouchEndCapture(event) { 3668 addTargetEventListenerOnce(event, handleTouchEnd); 3669 } 3670 const unsubscribe = mergeCleanups(escapeKey2 && mergeCleanups(addEventListener(doc, "keydown", closeOnEscapeKeyDown), addEventListener(doc, "compositionstart", handleCompositionStart), addEventListener(doc, "compositionend", handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, "click", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerdown", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerup", handlePressEndCapture, true), addEventListener(doc, "pointercancel", handlePressEndCapture, true), addEventListener(doc, "mousedown", closeOnPressOutsideCapture, true), addEventListener(doc, "mouseup", handlePressEndCapture, true), addEventListener(doc, "touchstart", handleTouchStartCapture, { 3671 capture: true, 3672 passive: true 3673 }), addEventListener(doc, "touchmove", handleTouchMoveCapture, { 3674 capture: true, 3675 passive: true 3676 }), addEventListener(doc, "touchend", handleTouchEndCapture, { 3677 capture: true, 3678 passive: true 3679 }))); 3680 return () => { 3681 unsubscribe(); 3682 preventedPressSuppressionTimeout.clear(); 3683 resetPressStartState(); 3684 suppressNextOutsideClickRef.current = false; 3685 }; 3686 }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open2, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout, compositionTimeout]); 3687 const reference = React22.useMemo(() => ({ 3688 onKeyDown: closeOnEscapeKeyDown, 3689 onPointerDown: closeOnReferencePress, 3690 onClick: closeOnReferencePress 3691 }), [closeOnEscapeKeyDown, closeOnReferencePress]); 3692 const floating = React22.useMemo(() => ({ 3693 onKeyDown: closeOnEscapeKeyDown, 3694 // `onMouseDown` may be blocked if `event.preventDefault()` is called in 3695 // `onPointerDown`, such as with <NumberField.ScrubArea>. 3696 // See https://github.com/mui/base-ui/pull/3379 3697 onPointerDown: markInsidePressStartPrevented, 3698 onMouseDown: markInsidePressStartPrevented, 3699 onClickCapture: markInsideReactTree, 3700 onMouseDownCapture(event) { 3701 markInsideReactTree(); 3702 markPressStartedInsideReactTree(event); 3703 }, 3704 onPointerDownCapture(event) { 3705 markInsideReactTree(); 3706 markPressStartedInsideReactTree(event); 3707 }, 3708 onMouseUpCapture: markInsideReactTree, 3709 onTouchEndCapture: markInsideReactTree, 3710 onTouchMoveCapture: markInsideReactTree 3711 }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]); 3712 return React22.useMemo(() => enabled ? { 3713 reference, 3714 floating, 3715 trigger: reference 3716 } : {}, [enabled, reference, floating]); 3717 } 3718 3719 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupHandle.mjs 3720 var BasePopupHandle = class { 3721 /** 3722 * Stores of every root currently using this handle, in attach order. A handle is meant to be used 3723 * by a single mounted root, but roots can transiently overlap (e.g. during an animated route 3724 * transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of 3725 * leaving a still-mounted root uncontrollable when a newer overlapping root detaches first. 3726 */ 3727 attachedStores = []; 3728 /** 3729 * Store of the root that currently controls the handle: the most recently attached one still 3730 * mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`. 3731 */ 3732 attachedStoreValue = null; 3733 /** 3734 * Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer. 3735 */ 3736 storeListeners = /* @__PURE__ */ new Set(); 3737 /** 3738 * Creates a handle backed by the store used while no root is attached. 3739 * 3740 * @param fallbackStore Inert, closed store handed to detached triggers while no root is attached, 3741 * so they can render and register without a mounted root. Triggers register into whichever store 3742 * `store` currently resolves to, so while detached they live in this store's trigger map and 3743 * migrate themselves to the root's store (and back) as it attaches/detaches. 3744 * @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces 3745 * `MenuHandle.open()` in warning text. 3746 * @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is 3747 * registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to, 3748 * so they throw; Dialog is not anchored and instead opens unassociated with a dev warning. 3749 */ 3750 constructor(fallbackStore, componentName, throwOnMissingTrigger = true) { 3751 this.fallbackStore = fallbackStore; 3752 this.componentName = componentName; 3753 this.throwOnMissingTrigger = throwOnMissingTrigger; 3754 } 3755 get attachedStore() { 3756 return this.attachedStoreValue; 3757 } 3758 /** 3759 * Store that detached triggers read from: the attached root's store, or an inert fallback store 3760 * used while no root is attached. 3761 * @internal 3762 */ 3763 get store() { 3764 return this.attachedStoreValue ?? this.fallbackStore; 3765 } 3766 /** 3767 * Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on 3768 * the handle during render because a handle can be shared by concurrent server-rendered requests. 3769 * @internal 3770 */ 3771 get serverStore() { 3772 return this.fallbackStore; 3773 } 3774 /** 3775 * Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind 3776 * when a root attaches or detaches. Returns a function that removes the listener. 3777 * @internal 3778 */ 3779 subscribeStore(listener) { 3780 this.storeListeners.add(listener); 3781 return () => { 3782 this.storeListeners.delete(listener); 3783 }; 3784 } 3785 /** 3786 * Points the handle at a root's store and notifies subscribers so detached triggers re-render and 3787 * re-register into it (their registration effect migrates them when the store pointer changes). 3788 * Returns a cleanup function that detaches the store again. 3789 * @internal 3790 */ 3791 attachStore(newStore) { 3792 this.attachedStores.push(newStore); 3793 this.setActiveStore(newStore); 3794 if (true) { 3795 if (this.attachedStores.length > 1) { 3796 const dev = this; 3797 (dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => { 3798 if (this.attachedStores.length > 1) { 3799 console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle."); 3800 } 3801 }); 3802 } 3803 } 3804 return () => { 3805 const index2 = this.attachedStores.lastIndexOf(newStore); 3806 if (index2 !== -1) { 3807 this.attachedStores.splice(index2, 1); 3808 } 3809 this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null); 3810 }; 3811 } 3812 /** 3813 * Sets the store that currently controls the handle and notifies subscribers when it changes, so 3814 * detached triggers re-render and migrate their registration to the new store. 3815 */ 3816 setActiveStore(store) { 3817 if (this.attachedStoreValue !== store) { 3818 this.attachedStoreValue = store; 3819 this.storeListeners.forEach((listener) => { 3820 listener(); 3821 }); 3822 } 3823 } 3824 /** 3825 * Opens the attached root's store and associates it with the trigger with the given id, or a 3826 * no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public 3827 * `open()` method, which only narrows the parameter type. 3828 * 3829 * When a trigger id is given but no matching trigger is registered, anchored popups throw (see 3830 * `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead. 3831 * 3832 * This method should only be called in an event handler or an effect (not during rendering). 3833 * 3834 * @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open 3835 * without associating any trigger. 3836 */ 3837 openByTrigger(triggerId) { 3838 const attachedStore = this.attachedStore; 3839 if (attachedStore === null) { 3840 if (true) { 3841 console.warn(`Base UI: $this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`); 3842 } 3843 return; 3844 } 3845 let triggerElement; 3846 if (triggerId) { 3847 for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) { 3848 triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId); 3849 } 3850 triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId); 3851 } 3852 if (triggerId && !triggerElement) { 3853 if (this.throwOnMissingTrigger) { 3854 throw new Error(true ? `Base UI: $this.componentName}Handle.open() was called with the trigger id "$triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted $this.componentName}.Trigger that has this handle set on its "handle" prop.` : formatErrorMessage_default(99, this.componentName, triggerId, this.componentName)); 3855 } 3856 if (true) { 3857 console.warn(`Base UI: $this.componentName}Handle.open: No trigger found with id "$triggerId}". The popup will open, but the trigger will not be associated with it.`); 3858 } 3859 } 3860 attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement)); 3861 } 3862 /** 3863 * Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning) 3864 * while no root is attached. Shared by every concrete handle's public `close()` method. 3865 * 3866 * This method should only be called in an event handler or an effect (not during rendering). 3867 */ 3868 closePopup() { 3869 const attachedStore = this.attachedStore; 3870 if (attachedStore === null) { 3871 if (true) { 3872 console.warn(`Base UI: $this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`); 3873 } 3874 return; 3875 } 3876 attachedStore.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)); 3877 } 3878 }; 3879 3880 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs 3881 var React24 = __toESM(require_react(), 1); 3882 var ReactDOM3 = __toESM(require_react_dom(), 1); 3883 3884 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs 3885 function useSyncedFloatingRootContext(options) { 3886 const { 3887 popupStore, 3888 treatPopupAsFloatingElement = false, 3889 floatingRootContext: store, 3890 floatingId, 3891 nested, 3892 onOpenChange 3893 } = options; 3894 const open2 = popupStore.useState("open"); 3895 const referenceElement = popupStore.useState("activeTriggerElement"); 3896 const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement"); 3897 const handleOpenChange = onOpenChange; 3898 popupStore.useSyncedValue("floatingId", floatingId); 3899 useIsoLayoutEffect(() => { 3900 const valuesToSync = { 3901 open: open2, 3902 floatingId, 3903 referenceElement, 3904 floatingElement 3905 }; 3906 if (isElement(referenceElement)) { 3907 valuesToSync.domReferenceElement = referenceElement; 3908 } 3909 if (store.state.positionReference === store.state.referenceElement) { 3910 valuesToSync.positionReference = referenceElement; 3911 } 3912 store.update(valuesToSync); 3913 }, [open2, floatingId, referenceElement, floatingElement, store]); 3914 store.context.onOpenChange = handleOpenChange; 3915 store.context.nested = nested; 3916 return store; 3917 } 3918 3919 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useUnmountAfterClose.mjs 3920 var React23 = __toESM(require_react(), 1); 3921 function useUnmountAfterClose(parameters) { 3922 const { 3923 open: open2, 3924 ref, 3925 preventUnmountOnClose, 3926 setPreventUnmountOnClose: setPreventUnmountOnCloseParam, 3927 onUnmount, 3928 animateInitialOpen 3929 } = parameters; 3930 const setPreventUnmountOnClose = useStableCallback(setPreventUnmountOnCloseParam); 3931 const { 3932 mounted, 3933 setMounted, 3934 transitionStatus 3935 } = useTransitionStatus(open2, false, false, animateInitialOpen); 3936 const preventUnmountingOnClose = open2 ? false : preventUnmountOnClose; 3937 useIsoLayoutEffect(() => { 3938 if (open2) { 3939 setPreventUnmountOnClose(false); 3940 } 3941 }, [open2, setPreventUnmountOnClose]); 3942 const mountedRef = React23.useRef(mounted); 3943 const pendingUnmountRef = React23.useRef(false); 3944 const rerender = useForcedRerendering(); 3945 const unmount = () => { 3946 mountedRef.current = false; 3947 setMounted(false); 3948 onUnmount(); 3949 }; 3950 useIsoLayoutEffect(() => { 3951 mountedRef.current = mounted; 3952 if (pendingUnmountRef.current) { 3953 pendingUnmountRef.current = false; 3954 if (!open2 && mounted) { 3955 unmount(); 3956 } 3957 } 3958 }); 3959 const forceUnmount = useStableCallback(() => { 3960 if (!mountedRef.current) { 3961 return; 3962 } 3963 if (open2) { 3964 pendingUnmountRef.current = true; 3965 rerender(); 3966 return; 3967 } 3968 unmount(); 3969 }); 3970 useOpenChangeComplete({ 3971 enabled: mounted && !open2 && !preventUnmountingOnClose, 3972 open: open2, 3973 ref, 3974 onComplete() { 3975 if (!open2) { 3976 forceUnmount(); 3977 } 3978 } 3979 }); 3980 return { 3981 mounted, 3982 transitionStatus, 3983 preventUnmountingOnClose, 3984 forceUnmount 3985 }; 3986 } 3987 3988 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs 3989 var FOCUSABLE_POPUP_PROPS = { 3990 tabIndex: -1, 3991 [FOCUSABLE_ATTRIBUTE]: "" 3992 }; 3993 function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) { 3994 const floatingId = useId(); 3995 const nested = useFloatingParentNodeId() != null; 3996 const store = useRefWithInit(() => createStore(floatingId, nested)).current; 3997 useSyncedFloatingRootContext({ 3998 popupStore: store, 3999 treatPopupAsFloatingElement, 4000 floatingRootContext: store.state.floatingRootContext, 4001 floatingId, 4002 nested, 4003 onOpenChange: store.setOpen 4004 }); 4005 return store; 4006 } 4007 function PopupHandleAttachment({ 4008 handle, 4009 store 4010 }) { 4011 useIsoLayoutEffect(() => { 4012 return handle.attachStore(store); 4013 }, [handle, store]); 4014 return null; 4015 } 4016 function syncTriggerCount(store) { 4017 const triggerCount = store.context.triggerElements.size; 4018 if (store.select("open") && store.state.triggerCount !== triggerCount) { 4019 store.set("triggerCount", triggerCount); 4020 } 4021 } 4022 function useTriggerRegistration(id, store) { 4023 const registrationRef = React24.useRef(null); 4024 return useStableCallback((element) => { 4025 const registration = registrationRef.current; 4026 if (registration !== null) { 4027 if (registration.element === element && registration.store === store && registration.id === id) { 4028 return; 4029 } 4030 registrationRef.current = null; 4031 const registeredStore = registration.store; 4032 if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) { 4033 registeredStore.context.triggerElements.delete(registration.id); 4034 syncTriggerCount(registeredStore); 4035 } 4036 } 4037 if (element !== null && id !== void 0) { 4038 registrationRef.current = { 4039 store, 4040 id, 4041 element 4042 }; 4043 store.context.triggerElements.add(id, element); 4044 syncTriggerCount(store); 4045 } 4046 }); 4047 } 4048 function createPopupOpenState(state, open2, trigger, preventUnmountOnClose = false) { 4049 let preventUnmountingOnClose = state.preventUnmountingOnClose; 4050 if (open2) { 4051 preventUnmountingOnClose = false; 4052 } else if (preventUnmountOnClose) { 4053 preventUnmountingOnClose = true; 4054 } 4055 const triggerId = trigger?.id ?? null; 4056 let activeTriggerId = state.activeTriggerId; 4057 let activeTriggerElement = state.activeTriggerElement; 4058 if (triggerId || open2) { 4059 activeTriggerId = triggerId; 4060 activeTriggerElement = trigger ?? null; 4061 } 4062 return { 4063 open: open2, 4064 preventUnmountingOnClose, 4065 activeTriggerId, 4066 activeTriggerElement, 4067 // An open request without a trigger (a handle's `open(null)` or `openWithPayload()`) must not 4068 // be reassociated with a lone registered trigger later on. Controlled and default opens never 4069 // pass through here, so they keep claiming a lone trigger. A close request keeps the flag: a 4070 // controlled root may decline it and stay open, so the Root clears the flag only once the 4071 // popup is effectively closed. 4072 openedWithoutTrigger: open2 ? trigger == null : state.openedWithoutTrigger 4073 }; 4074 } 4075 function attachPreventUnmountOnClose(eventDetails) { 4076 let preventUnmountOnClose = false; 4077 eventDetails.preventUnmountOnClose = () => { 4078 preventUnmountOnClose = true; 4079 }; 4080 return () => preventUnmountOnClose; 4081 } 4082 function applyPopupOpenChange(store, nextOpen, eventDetails, options = {}) { 4083 const reason = eventDetails.reason; 4084 const isHover = reason === reason_parts_exports.triggerHover; 4085 const isFocusOpen = nextOpen && reason === reason_parts_exports.triggerFocus; 4086 const isDismissClose = !nextOpen && (reason === reason_parts_exports.triggerPress || reason === reason_parts_exports.escapeKey); 4087 const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails); 4088 store.context.onOpenChange?.(nextOpen, eventDetails); 4089 if (eventDetails.isCanceled) { 4090 return; 4091 } 4092 options.onBeforeDispatch?.(); 4093 store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails); 4094 const changeState = () => { 4095 const popupOpenState = createPopupOpenState(store.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose()); 4096 const updatedState = { 4097 ...options.extraState, 4098 ...popupOpenState 4099 }; 4100 if (isFocusOpen) { 4101 updatedState.instantType = "focus"; 4102 } else if (isDismissClose) { 4103 updatedState.instantType = "dismiss"; 4104 } else if (isHover) { 4105 updatedState.instantType = void 0; 4106 } 4107 store.update(updatedState); 4108 }; 4109 if (isHover) { 4110 ReactDOM3.flushSync(changeState); 4111 } else { 4112 changeState(); 4113 } 4114 } 4115 function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) { 4116 const isMountedByThisTrigger = store.useState("isMountedByTrigger", triggerId); 4117 const baseRegisterTrigger = useTriggerRegistration(triggerId, store); 4118 const applyTriggerData = useStableCallback((element) => { 4119 const open2 = store.select("open"); 4120 const activeTriggerId = store.select("activeTriggerId"); 4121 if (activeTriggerId === triggerId) { 4122 const changes = { 4123 activeTriggerElement: element, 4124 ...open2 ? stateUpdates : null 4125 }; 4126 store.update(changes); 4127 return; 4128 } 4129 if (activeTriggerId == null && open2 && !store.state.openedWithoutTrigger) { 4130 const changes = { 4131 activeTriggerId: triggerId ?? null, 4132 activeTriggerElement: element, 4133 ...stateUpdates 4134 }; 4135 store.update(changes); 4136 } 4137 }); 4138 const registerTrigger = useStableCallback((element) => { 4139 baseRegisterTrigger(element); 4140 if (element) { 4141 applyTriggerData(element); 4142 } 4143 }); 4144 useIsoLayoutEffect(() => { 4145 registerTrigger(triggerElementRef.current); 4146 return () => registerTrigger(null); 4147 }, [registerTrigger, triggerElementRef, store, triggerId]); 4148 useIsoLayoutEffect(() => { 4149 if (isMountedByThisTrigger) { 4150 const changes = { 4151 activeTriggerElement: triggerElementRef.current, 4152 ...stateUpdates 4153 }; 4154 store.update(changes); 4155 } 4156 }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]); 4157 return { 4158 registerTrigger, 4159 isMountedByThisTrigger 4160 }; 4161 } 4162 function useImplicitActiveTrigger(store, options = {}) { 4163 const { 4164 closeOnActiveTriggerUnmount = false 4165 } = options; 4166 const resolvedActiveTriggerIdRef = React24.useRef(null); 4167 const open2 = store.useState("open"); 4168 const reactiveTriggerCount = store.useState("triggerCount"); 4169 const activeTriggerId = store.useState("activeTriggerId"); 4170 const reactiveActiveTriggerElement = store.useState("activeTriggerElement"); 4171 useIsoLayoutEffect(() => { 4172 if (!open2) { 4173 resolvedActiveTriggerIdRef.current = null; 4174 if (store.state.triggerCount !== 0) { 4175 store.set("triggerCount", 0); 4176 } 4177 if (store.state.openedWithoutTrigger) { 4178 store.set("openedWithoutTrigger", false); 4179 } 4180 return; 4181 } 4182 const triggerCount = store.context.triggerElements.size; 4183 const stateUpdates = {}; 4184 if (store.state.triggerCount !== triggerCount) { 4185 stateUpdates.triggerCount = triggerCount; 4186 } 4187 const currentActiveTriggerId = store.select("activeTriggerId"); 4188 let lostActiveTriggerId = null; 4189 if (currentActiveTriggerId) { 4190 const activeTriggerElement = store.context.triggerElements.getById(currentActiveTriggerId); 4191 if (!activeTriggerElement) { 4192 for (const [triggerId, triggerElement] of store.context.triggerElements.entries()) { 4193 if (triggerElement === store.state.activeTriggerElement) { 4194 stateUpdates.activeTriggerId = triggerId; 4195 stateUpdates.activeTriggerElement = triggerElement; 4196 resolvedActiveTriggerIdRef.current = triggerId; 4197 break; 4198 } 4199 } 4200 if (stateUpdates.activeTriggerId === void 0) { 4201 if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) { 4202 lostActiveTriggerId = currentActiveTriggerId; 4203 } else { 4204 resolvedActiveTriggerIdRef.current = null; 4205 } 4206 } 4207 } else { 4208 resolvedActiveTriggerIdRef.current = currentActiveTriggerId; 4209 if (activeTriggerElement !== store.state.activeTriggerElement) { 4210 stateUpdates.activeTriggerElement = activeTriggerElement; 4211 } 4212 } 4213 } else { 4214 resolvedActiveTriggerIdRef.current = null; 4215 } 4216 if (!lostActiveTriggerId && !currentActiveTriggerId && !store.state.openedWithoutTrigger && triggerCount === 1) { 4217 const iteratorResult = store.context.triggerElements.entries().next(); 4218 if (!iteratorResult.done) { 4219 const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value; 4220 stateUpdates.activeTriggerId = implicitTriggerId; 4221 stateUpdates.activeTriggerElement = implicitTriggerElement; 4222 resolvedActiveTriggerIdRef.current = implicitTriggerId; 4223 } 4224 } 4225 if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0 || stateUpdates.activeTriggerElement !== void 0) { 4226 store.update(stateUpdates); 4227 } 4228 if (lostActiveTriggerId) { 4229 if (closeOnActiveTriggerUnmount) { 4230 queueMicrotask(() => { 4231 if (store.select("open") && store.select("activeTriggerId") === lostActiveTriggerId && !store.context.triggerElements.getById(lostActiveTriggerId)) { 4232 const eventDetails = createChangeEventDetails(reason_parts_exports.none); 4233 store.setOpen(false, eventDetails); 4234 if (!eventDetails.isCanceled) { 4235 store.update({ 4236 activeTriggerId: null, 4237 activeTriggerElement: null 4238 }); 4239 } 4240 } 4241 }); 4242 } 4243 } 4244 }, [open2, store, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]); 4245 } 4246 function useOpenStateTransitions(open2, store, onUnmount, animateInitialOpen) { 4247 const { 4248 mounted, 4249 transitionStatus, 4250 forceUnmount 4251 } = useUnmountAfterClose({ 4252 open: open2, 4253 ref: store.context.popupRef, 4254 preventUnmountOnClose: store.useState("preventUnmountingOnClose"), 4255 setPreventUnmountOnClose: (preventUnmountOnClose) => store.set("preventUnmountingOnClose", preventUnmountOnClose), 4256 animateInitialOpen, 4257 onUnmount() { 4258 store.update({ 4259 activeTriggerId: null, 4260 activeTriggerElement: null, 4261 mounted: false, 4262 preventUnmountingOnClose: false 4263 }); 4264 onUnmount?.(); 4265 store.context.onOpenChangeComplete?.(false); 4266 } 4267 }); 4268 useRefWithInit(() => { 4269 store.set("mounted", mounted); 4270 return null; 4271 }); 4272 store.useSyncedValues({ 4273 mounted, 4274 transitionStatus 4275 }); 4276 return { 4277 forceUnmount, 4278 transitionStatus 4279 }; 4280 } 4281 function usePopupInteractionProps(store, statePart) { 4282 store.useSyncedValues(statePart); 4283 useIsoLayoutEffect(() => () => { 4284 store.update({ 4285 activeTriggerProps: EMPTY_OBJECT, 4286 inactiveTriggerProps: EMPTY_OBJECT, 4287 popupProps: EMPTY_OBJECT 4288 }); 4289 }, [store]); 4290 } 4291 4292 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs 4293 var devElementIdsByMap; 4294 function getDevElementIds(map) { 4295 devElementIdsByMap ??= /* @__PURE__ */ new WeakMap(); 4296 let elementIds = devElementIdsByMap.get(map); 4297 if (!elementIds) { 4298 elementIds = /* @__PURE__ */ new WeakMap(); 4299 devElementIdsByMap.set(map, elementIds); 4300 } 4301 return elementIds; 4302 } 4303 var PopupTriggerMap = class { 4304 idMap = /* @__PURE__ */ new Map(); 4305 /** 4306 * Adds a trigger element with the given ID. 4307 * 4308 * Note: The provided element is assumed to not be registered under multiple IDs. 4309 */ 4310 add(id, element) { 4311 if (true) { 4312 const elementIds = getDevElementIds(this); 4313 const existingId = elementIds.get(element); 4314 if (existingId !== void 0 && existingId !== id) { 4315 throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap."); 4316 } 4317 const previousElement = this.idMap.get(id); 4318 if (previousElement !== void 0 && previousElement !== element) { 4319 elementIds.delete(previousElement); 4320 } 4321 elementIds.set(element, id); 4322 } 4323 this.idMap.set(id, element); 4324 } 4325 /** 4326 * Removes the trigger element with the given ID. 4327 */ 4328 delete(id) { 4329 if (true) { 4330 const element = this.idMap.get(id); 4331 if (element !== void 0) { 4332 devElementIdsByMap?.get(this)?.delete(element); 4333 } 4334 } 4335 this.idMap.delete(id); 4336 } 4337 /** 4338 * Whether the given element is registered as a trigger. 4339 */ 4340 hasElement(element) { 4341 for (const registered of this.idMap.values()) { 4342 if (registered === element) { 4343 return true; 4344 } 4345 } 4346 return false; 4347 } 4348 /** 4349 * Whether there is a registered trigger element matching the given predicate. 4350 */ 4351 hasMatchingElement(predicate) { 4352 for (const element of this.idMap.values()) { 4353 if (predicate(element)) { 4354 return true; 4355 } 4356 } 4357 return false; 4358 } 4359 /** 4360 * Returns the trigger element associated with the given ID, or undefined if no such element exists. 4361 */ 4362 getById(id) { 4363 return this.idMap.get(id); 4364 } 4365 /** 4366 * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element]. 4367 */ 4368 entries() { 4369 return this.idMap.entries(); 4370 } 4371 /** 4372 * Returns an iterable of all registered trigger elements. 4373 */ 4374 elements() { 4375 return this.idMap.values(); 4376 } 4377 /** 4378 * Returns the number of registered trigger elements. 4379 */ 4380 get size() { 4381 return this.idMap.size; 4382 } 4383 }; 4384 4385 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/useStore.mjs 4386 var React26 = __toESM(require_react(), 1); 4387 var import_shim = __toESM(require_shim(), 1); 4388 var import_with_selector = __toESM(require_with_selector(), 1); 4389 4390 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/fastHooks.mjs 4391 var React25 = __toESM(require_react(), 1); 4392 var hooks = []; 4393 var currentInstance = void 0; 4394 function getInstance() { 4395 return currentInstance; 4396 } 4397 function register(hook) { 4398 hooks.push(hook); 4399 } 4400 function fastComponent(fn) { 4401 const FastComponent = (props, forwardedRef) => { 4402 const instance = useRefWithInit(createInstance).current; 4403 let result; 4404 try { 4405 currentInstance = instance; 4406 for (const hook of hooks) { 4407 hook.before(instance); 4408 } 4409 result = fn(props, forwardedRef); 4410 for (const hook of hooks) { 4411 hook.after(instance); 4412 } 4413 instance.didInitialize = true; 4414 } finally { 4415 currentInstance = void 0; 4416 } 4417 return result; 4418 }; 4419 FastComponent.displayName = fn.displayName || fn.name; 4420 return FastComponent; 4421 } 4422 function fastComponentRef(fn) { 4423 return /* @__PURE__ */ React25.forwardRef(fastComponent(fn)); 4424 } 4425 function createInstance() { 4426 return { 4427 didInitialize: false 4428 }; 4429 } 4430 4431 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/useStore.mjs 4432 var canUseRawUseSyncExternalStore = isReactVersionAtLeast(19); 4433 var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy; 4434 function useStore(store, selector, a1, a2, a3) { 4435 return useStoreImplementation(store, selector, a1, a2, a3); 4436 } 4437 function useStoreR19(store, selector, a1, a2, a3) { 4438 const getSelection = React26.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]); 4439 return (0, import_shim.useSyncExternalStore)(store.subscribe, getSelection, getSelection); 4440 } 4441 register({ 4442 before(instance) { 4443 instance.syncIndex = 0; 4444 if (!instance.didInitialize) { 4445 instance.syncTick = 1; 4446 instance.syncHooks = []; 4447 instance.didChangeStore = true; 4448 instance.getSnapshot = () => { 4449 let didChange2 = false; 4450 for (let i = 0; i < instance.syncHooks.length; i += 1) { 4451 const hook = instance.syncHooks[i]; 4452 const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3); 4453 if (!Object.is(hook.value, value)) { 4454 didChange2 = true; 4455 hook.value = value; 4456 } 4457 } 4458 if (didChange2) { 4459 instance.syncTick += 1; 4460 } 4461 return instance.syncTick; 4462 }; 4463 } 4464 }, 4465 after(instance) { 4466 if (instance.syncHooks.length > 0) { 4467 if (instance.didChangeStore) { 4468 instance.didChangeStore = false; 4469 instance.subscribe = (onStoreChange) => { 4470 const stores = /* @__PURE__ */ new Set(); 4471 for (const hook of instance.syncHooks) { 4472 stores.add(hook.store); 4473 } 4474 const unsubscribes = []; 4475 for (const store of stores) { 4476 unsubscribes.push(store.subscribe(onStoreChange)); 4477 } 4478 return () => { 4479 for (const unsubscribe of unsubscribes) { 4480 unsubscribe(); 4481 } 4482 }; 4483 }; 4484 } 4485 (0, import_shim.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot); 4486 } 4487 } 4488 }); 4489 function useStoreFast(store, selector, a1, a2, a3) { 4490 const instance = getInstance(); 4491 if (!instance) { 4492 return useStoreR19(store, selector, a1, a2, a3); 4493 } 4494 const index2 = instance.syncIndex; 4495 instance.syncIndex += 1; 4496 let hook; 4497 if (!instance.didInitialize) { 4498 hook = { 4499 store, 4500 selector, 4501 a1, 4502 a2, 4503 a3, 4504 value: selector(store.getSnapshot(), a1, a2, a3) 4505 }; 4506 instance.syncHooks.push(hook); 4507 } else { 4508 hook = instance.syncHooks[index2]; 4509 if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) { 4510 if (hook.store !== store) { 4511 instance.didChangeStore = true; 4512 } 4513 hook.store = store; 4514 hook.selector = selector; 4515 hook.a1 = a1; 4516 hook.a2 = a2; 4517 hook.a3 = a3; 4518 hook.value = selector(store.getSnapshot(), a1, a2, a3); 4519 } 4520 } 4521 return hook.value; 4522 } 4523 function useStoreLegacy(store, selector, a1, a2, a3) { 4524 return (0, import_with_selector.useSyncExternalStoreWithSelector)(store.subscribe, store.getSnapshot, store.getSnapshot, (state) => selector(state, a1, a2, a3)); 4525 } 4526 4527 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/Store.mjs 4528 var Store = class { 4529 /** 4530 * Creates a store with the given initial state, constructing the class it is called on. 4531 * Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that 4532 * class but degrades the inferred instance type to `Store`; use `new` there instead. 4533 */ 4534 static create(state) { 4535 return new this(state); 4536 } 4537 /** 4538 * The current state of the store. 4539 * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}. 4540 * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState). 4541 * The values can be used directly (to avoid subscribing to the store) in effects or event handlers. 4542 * 4543 * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification. 4544 */ 4545 // Internal state to handle recursive `setState()` calls 4546 constructor(state) { 4547 this.state = state; 4548 this.listeners = /* @__PURE__ */ new Set(); 4549 this.updateTick = 0; 4550 } 4551 /** 4552 * Registers a listener that will be called whenever the store's state changes. 4553 * 4554 * @param fn The listener function to be called on state changes. 4555 * @returns A function to unsubscribe the listener. 4556 */ 4557 subscribe = (fn) => { 4558 this.listeners.add(fn); 4559 return () => { 4560 this.listeners.delete(fn); 4561 }; 4562 }; 4563 /** 4564 * Returns the current state of the store. 4565 */ 4566 getSnapshot = () => { 4567 return this.state; 4568 }; 4569 /** 4570 * Updates the entire store's state and notifies all registered listeners. 4571 * 4572 * @param newState The new state to set for the store. 4573 */ 4574 setState(newState) { 4575 if (this.state === newState) { 4576 return; 4577 } 4578 this.state = newState; 4579 this.updateTick += 1; 4580 const currentTick = this.updateTick; 4581 for (const listener of this.listeners) { 4582 if (currentTick !== this.updateTick) { 4583 return; 4584 } 4585 listener(newState); 4586 } 4587 } 4588 /** 4589 * Merges the provided changes into the current state and notifies listeners if there are changes. 4590 * Each value must match its state key. Pass an exact known subset rather than a broad 4591 * `Partial<State>`, which may contain `undefined` for required state fields. 4592 * 4593 * @param changes An object containing the changes to apply to the current state. 4594 */ 4595 update(changes) { 4596 for (const key in changes) { 4597 if (!Object.is(this.state[key], changes[key])) { 4598 this.setState({ 4599 ...this.state, 4600 ...changes 4601 }); 4602 return; 4603 } 4604 } 4605 } 4606 /** 4607 * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed. 4608 * 4609 * @param key The key in the store's state to update. 4610 * @param value The new value to set for the specified key. 4611 */ 4612 set(key, value) { 4613 if (!Object.is(this.state[key], value)) { 4614 this.setState({ 4615 ...this.state, 4616 [key]: value 4617 }); 4618 } 4619 } 4620 /** 4621 * Gives the state a new reference and updates all registered listeners. 4622 */ 4623 notifyAll() { 4624 const newState = { 4625 ...this.state 4626 }; 4627 this.setState(newState); 4628 } 4629 use(selector, a1, a2, a3) { 4630 return useStore(this, selector, a1, a2, a3); 4631 } 4632 }; 4633 4634 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/ReactStore.mjs 4635 var React27 = __toESM(require_react(), 1); 4636 var ReactStore = class extends Store { 4637 /** 4638 * Creates a new ReactStore instance. 4639 * 4640 * @param state Initial state of the store. 4641 * @param context Non-reactive context values. 4642 * @param selectors Optional selectors for use with `useState`. 4643 */ 4644 constructor(state, context = {}, selectors3) { 4645 super(state); 4646 this.context = context; 4647 this.selectors = selectors3; 4648 } 4649 /** 4650 * Non-reactive values such as refs, callbacks, etc. 4651 */ 4652 /** 4653 * Synchronizes a single external value into the store. 4654 * 4655 * Note that the while the value in `state` is updated immediately, the value returned 4656 * by `useState` is updated before the next render (similarly to React's `useState`). 4657 */ 4658 useSyncedValue(key, value) { 4659 React27.useDebugValue(key); 4660 const store = this; 4661 useIsoLayoutEffect(() => { 4662 if (store.state[key] !== value) { 4663 store.set(key, value); 4664 } 4665 }, [store, key, value]); 4666 } 4667 /** 4668 * Synchronizes a single external value into the store and 4669 * cleans it up (sets to `undefined`) on unmount. 4670 * 4671 * Note that the while the value in `state` is updated immediately, the value returned 4672 * by `useState` is updated before the next render (similarly to React's `useState`). 4673 */ 4674 useSyncedValueWithCleanup(key, value) { 4675 const store = this; 4676 useIsoLayoutEffect(() => { 4677 if (store.state[key] !== value) { 4678 store.set(key, value); 4679 } 4680 return () => { 4681 store.set(key, void 0); 4682 }; 4683 }, [store, key, value]); 4684 } 4685 /** 4686 * Synchronizes multiple external values into the store. 4687 * Each value must match its state key. Pass an exact known subset rather than a broad 4688 * `Partial<State>`, which may contain `undefined` for required state fields. 4689 * 4690 * Note that the while the values in `state` are updated immediately, the values returned 4691 * by `useState` are updated before the next render (similarly to React's `useState`). 4692 * 4693 * @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted. 4694 */ 4695 useSyncedValues(statePart) { 4696 const store = this; 4697 if (true) { 4698 React27.useDebugValue(statePart, (p) => Object.keys(p)); 4699 const keys = React27.useRef(Object.keys(statePart)).current; 4700 const nextKeys = Object.keys(statePart); 4701 if (keys.length !== nextKeys.length || keys.some((key, index2) => key !== nextKeys[index2])) { 4702 console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable."); 4703 } 4704 } 4705 const dependencies = Object.values(statePart); 4706 useIsoLayoutEffect(() => { 4707 store.update(statePart); 4708 }, [store, ...dependencies]); 4709 } 4710 /** 4711 * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled` 4712 * is non-undefined, the store's state at `key` is updated to match `controlled`. 4713 */ 4714 useControlledProp(key, controlled) { 4715 React27.useDebugValue(key); 4716 const store = this; 4717 const isControlled = controlled !== void 0; 4718 useIsoLayoutEffect(() => { 4719 if (isControlled && !Object.is(store.state[key], controlled)) { 4720 store.setState({ 4721 ...store.state, 4722 [key]: controlled 4723 }); 4724 } 4725 }, [store, key, controlled, isControlled]); 4726 if (true) { 4727 const cache = this.controlledValues ??= /* @__PURE__ */ new Map(); 4728 if (!cache.has(key)) { 4729 cache.set(key, isControlled); 4730 } 4731 const previouslyControlled = cache.get(key); 4732 if (previouslyControlled !== void 0 && previouslyControlled !== isControlled) { 4733 console.error(`A component is changing the $previouslyControlled ? "" : "un"}controlled state of $key.toString()} to be $previouslyControlled ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`); 4734 } 4735 } 4736 } 4737 /** Gets the current value from the store using a selector with the provided key. 4738 * 4739 * @param key Key of the selector to use. 4740 */ 4741 select(key, a1, a2, a3) { 4742 const selector = this.selectors[key]; 4743 return selector(this.state, a1, a2, a3); 4744 } 4745 /** 4746 * Returns a value from the store's state using a selector function. 4747 * Used to subscribe to specific parts of the state. 4748 * This methods causes a rerender whenever the selected state changes. 4749 * 4750 * @param key Key of the selector to use. 4751 */ 4752 useState(key, a1, a2, a3) { 4753 React27.useDebugValue(key); 4754 return useStore(this, this.selectors[key], a1, a2, a3); 4755 } 4756 /** 4757 * Wraps a function with `useStableCallback` to ensure it has a stable reference 4758 * and assigns it to the context. 4759 * 4760 * @param key Key of the event callback. Must be a function in the context. 4761 * @param fn Function to assign. 4762 */ 4763 useContextCallback(key, fn) { 4764 React27.useDebugValue(key); 4765 const stableFunction = useStableCallback(fn ?? NOOP); 4766 this.context[key] = stableFunction; 4767 } 4768 /** 4769 * Returns a stable setter function for a specific key in the store's state. 4770 * It's commonly used to pass as a ref callback to React elements. 4771 * 4772 * @param key Key of the state to set. 4773 */ 4774 useStateSetter(key) { 4775 const ref = React27.useRef(void 0); 4776 if (ref.current === void 0) { 4777 ref.current = (value) => { 4778 this.set(key, value); 4779 }; 4780 } 4781 return ref.current; 4782 } 4783 /** 4784 * Observes changes derived from the store's selectors and calls the listener when the selected value changes. 4785 * 4786 * @param key Key of the selector to observe. 4787 * @param listener Listener function called when the selector result changes. 4788 */ 4789 observe(selector, listener) { 4790 let selectFn; 4791 if (typeof selector === "function") { 4792 selectFn = selector; 4793 } else { 4794 selectFn = this.selectors[selector]; 4795 } 4796 let prevValue = selectFn(this.state); 4797 listener(prevValue, prevValue, this); 4798 return this.subscribe((nextState) => { 4799 const nextValue = selectFn(nextState); 4800 if (!Object.is(prevValue, nextValue)) { 4801 const oldValue = prevValue; 4802 prevValue = nextValue; 4803 listener(nextValue, oldValue, this); 4804 } 4805 }); 4806 } 4807 }; 4808 4809 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs 4810 var selectors = { 4811 open: (state) => state.open, 4812 transitionStatus: (state) => state.transitionStatus, 4813 domReferenceElement: (state) => state.domReferenceElement, 4814 referenceElement: (state) => state.positionReference ?? state.referenceElement, 4815 floatingElement: (state) => state.floatingElement, 4816 floatingId: (state) => state.floatingId 4817 }; 4818 var FloatingRootStore = class extends ReactStore { 4819 constructor(options) { 4820 const { 4821 syncOnly, 4822 nested, 4823 onOpenChange, 4824 triggerElements, 4825 ...initialState 4826 } = options; 4827 super({ 4828 ...initialState, 4829 positionReference: initialState.referenceElement, 4830 domReferenceElement: initialState.referenceElement 4831 }, { 4832 onOpenChange, 4833 dataRef: { 4834 current: {} 4835 }, 4836 events: createEventEmitter(), 4837 nested, 4838 triggerElements 4839 }, selectors); 4840 this.syncOnly = syncOnly; 4841 } 4842 /** 4843 * Syncs the event used by hover logic to distinguish hover-open from click-like interaction. 4844 */ 4845 syncOpenEvent = (newOpen, event) => { 4846 if (!newOpen || !this.state.open || // Prevent a pending hover-open from overwriting a click-open event, while allowing 4847 // click events to upgrade a hover-open. 4848 event != null && isClickLikeEvent(event)) { 4849 this.context.dataRef.current.openEvent = newOpen ? event : void 0; 4850 } 4851 }; 4852 /** 4853 * Runs the root-owned side effects for an open state change. 4854 */ 4855 dispatchOpenChange = (newOpen, eventDetails) => { 4856 this.syncOpenEvent(newOpen, eventDetails.event); 4857 const details = { 4858 open: newOpen, 4859 reason: eventDetails.reason, 4860 nativeEvent: eventDetails.event, 4861 nested: this.context.nested, 4862 triggerElement: eventDetails.trigger 4863 }; 4864 this.context.events.emit("openchange", details); 4865 }; 4866 /** 4867 * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments. 4868 * 4869 * @param newOpen The new open state. 4870 * @param eventDetails Details about the event that triggered the open state change. 4871 */ 4872 setOpen = (newOpen, eventDetails) => { 4873 if (this.syncOnly) { 4874 this.context.onOpenChange?.(newOpen, eventDetails); 4875 return; 4876 } 4877 this.dispatchOpenChange(newOpen, eventDetails); 4878 this.context.onOpenChange?.(newOpen, eventDetails); 4879 }; 4880 }; 4881 4882 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/store.mjs 4883 function createInitialPopupStoreState(triggerElements, floatingId, nested = false) { 4884 return { 4885 open: false, 4886 openProp: void 0, 4887 mounted: false, 4888 transitionStatus: void 0, 4889 floatingRootContext: new FloatingRootStore({ 4890 open: false, 4891 transitionStatus: void 0, 4892 floatingElement: null, 4893 referenceElement: null, 4894 triggerElements, 4895 floatingId, 4896 syncOnly: true, 4897 nested, 4898 onOpenChange: void 0 4899 }), 4900 floatingId, 4901 triggerCount: 0, 4902 preventUnmountingOnClose: false, 4903 payload: void 0, 4904 activeTriggerId: null, 4905 activeTriggerElement: null, 4906 openedWithoutTrigger: false, 4907 triggerIdProp: void 0, 4908 popupElement: null, 4909 positionerElement: null, 4910 activeTriggerProps: EMPTY_OBJECT, 4911 inactiveTriggerProps: EMPTY_OBJECT, 4912 popupProps: EMPTY_OBJECT 4913 }; 4914 } 4915 var activeTriggerIdSelector = (state) => state.triggerIdProp ?? state.activeTriggerId; 4916 var openSelector = (state) => state.openProp ?? state.open; 4917 var popupIdSelector = (state) => { 4918 const popupId = state.popupElement?.id ?? state.floatingId; 4919 return popupId || void 0; 4920 }; 4921 function triggerOwnsOpenPopup(state, triggerId) { 4922 return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) === triggerId; 4923 } 4924 function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) { 4925 if (triggerOwnsOpenPopup(state, triggerId)) { 4926 return true; 4927 } 4928 return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) == null && !state.openedWithoutTrigger && state.triggerCount === 1; 4929 } 4930 var popupStoreSelectors = { 4931 open: openSelector, 4932 mounted: (state) => state.mounted, 4933 // `open` is written synchronously on an open change; `mounted`/`transitionStatus` sync in a 4934 // layout effect. Match useTransitionStatus so a retained popup does not miss its starting phase. 4935 transitionStatus: (state) => openSelector(state) && !state.mounted ? "starting" : state.transitionStatus, 4936 floatingRootContext: (state) => state.floatingRootContext, 4937 triggerCount: (state) => state.triggerCount, 4938 preventUnmountingOnClose: (state) => state.preventUnmountingOnClose, 4939 payload: (state) => state.payload, 4940 activeTriggerId: activeTriggerIdSelector, 4941 activeTriggerElement: (state) => state.mounted ? state.activeTriggerElement : null, 4942 popupId: popupIdSelector, 4943 /** 4944 * Whether the trigger with the given ID was used to open the popup. 4945 */ 4946 isTriggerActive: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId, 4947 /** 4948 * Whether the popup is open and was activated by a trigger with the given ID. 4949 */ 4950 isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId), 4951 /** 4952 * Whether the popup is mounted and was activated by a trigger with the given ID. 4953 */ 4954 isMountedByTrigger: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted, 4955 triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps, 4956 /** 4957 * Popup id for the trigger that currently owns the open popup. 4958 */ 4959 triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0, 4960 popupProps: (state) => state.popupProps, 4961 popupElement: (state) => state.popupElement, 4962 positionerElement: (state) => state.positionerElement 4963 }; 4964 4965 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs 4966 var React28 = __toESM(require_react(), 1); 4967 var import_shim2 = __toESM(require_shim(), 1); 4968 function usePopupHandleStore(handle) { 4969 const subscribe = React28.useCallback((listener) => { 4970 if (handle === void 0) { 4971 return NOOP; 4972 } 4973 return handle.subscribeStore(listener); 4974 }, [handle]); 4975 const getSnapshot = React28.useCallback(() => { 4976 return handle === void 0 ? void 0 : handle.store; 4977 }, [handle]); 4978 return (0, import_shim2.useSyncExternalStore)(subscribe, getSnapshot, () => handle?.serverStore); 4979 } 4980 4981 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useFocus.mjs 4982 var React29 = __toESM(require_react(), 1); 4983 var isMacSafari = parts_exports.os.mac && parts_exports.engine.webkit; 4984 function useFocus(store, props = {}) { 4985 const { 4986 enabled = true, 4987 delay 4988 } = props; 4989 const { 4990 events, 4991 dataRef 4992 } = store.context; 4993 const blockFocusRef = React29.useRef(false); 4994 const blockedReferenceRef = React29.useRef(null); 4995 const keyboardModalityRef = React29.useRef(true); 4996 const timeout = useTimeout(); 4997 React29.useEffect(() => { 4998 const domReference = store.select("domReferenceElement"); 4999 if (!enabled) { 5000 return void 0; 5001 } 5002 const win = getWindow(domReference); 5003 function onBlur() { 5004 const currentDomReference = store.select("domReferenceElement"); 5005 if (!store.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) { 5006 blockFocusRef.current = true; 5007 blockedReferenceRef.current = currentDomReference; 5008 } 5009 } 5010 function onKeyDown() { 5011 keyboardModalityRef.current = true; 5012 } 5013 function onPointerDown() { 5014 keyboardModalityRef.current = false; 5015 } 5016 return mergeCleanups(addEventListener(win, "blur", onBlur), isMacSafari && addEventListener(win, "keydown", onKeyDown, true), isMacSafari && addEventListener(win, "pointerdown", onPointerDown, true)); 5017 }, [store, enabled]); 5018 React29.useEffect(() => { 5019 if (!enabled) { 5020 return void 0; 5021 } 5022 function onOpenChangeLocal(details) { 5023 if (details.reason === reason_parts_exports.triggerPress || details.reason === reason_parts_exports.escapeKey) { 5024 const referenceElement = store.select("domReferenceElement"); 5025 if (isElement(referenceElement)) { 5026 blockedReferenceRef.current = referenceElement; 5027 blockFocusRef.current = true; 5028 } 5029 } 5030 } 5031 events.on("openchange", onOpenChangeLocal); 5032 return () => { 5033 events.off("openchange", onOpenChangeLocal); 5034 }; 5035 }, [events, enabled, store]); 5036 const reference = React29.useMemo(() => { 5037 function resetBlockedFocus() { 5038 blockFocusRef.current = false; 5039 blockedReferenceRef.current = null; 5040 } 5041 return { 5042 onMouseLeave() { 5043 resetBlockedFocus(); 5044 }, 5045 onFocus(event) { 5046 const focusTarget = event.currentTarget; 5047 if (blockFocusRef.current) { 5048 if (blockedReferenceRef.current === focusTarget) { 5049 return; 5050 } 5051 resetBlockedFocus(); 5052 } 5053 const target = getTarget(event.nativeEvent); 5054 if (isElement(target)) { 5055 if (isMacSafari && !event.relatedTarget) { 5056 if (!keyboardModalityRef.current && !isTypeableElement(target)) { 5057 return; 5058 } 5059 } else if (!matchesFocusVisible(target)) { 5060 return; 5061 } 5062 } 5063 const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements); 5064 const { 5065 nativeEvent, 5066 currentTarget 5067 } = event; 5068 if (store.select("open") && movedFromOtherEnabledTrigger || !delay) { 5069 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget)); 5070 return; 5071 } 5072 timeout.start(delay, () => { 5073 if (blockFocusRef.current) { 5074 return; 5075 } 5076 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget)); 5077 }); 5078 }, 5079 onBlur(event) { 5080 resetBlockedFocus(); 5081 const relatedTarget = event.relatedTarget; 5082 const nativeEvent = event.nativeEvent; 5083 const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside"; 5084 timeout.start(0, () => { 5085 const domReference = store.select("domReferenceElement"); 5086 const activeEl = activeElement(ownerDocument(domReference)); 5087 if (!relatedTarget && activeEl === domReference) { 5088 return; 5089 } 5090 if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) { 5091 return; 5092 } 5093 const nextFocusedElement = relatedTarget ?? activeEl; 5094 if (isTargetInsideEnabledTrigger(nextFocusedElement, store.context.triggerElements)) { 5095 return; 5096 } 5097 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent)); 5098 }); 5099 } 5100 }; 5101 }, [dataRef, delay, store, timeout]); 5102 return React29.useMemo(() => enabled ? { 5103 reference, 5104 trigger: reference 5105 } : {}, [enabled, reference]); 5106 } 5107 5108 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs 5109 var React30 = __toESM(require_react(), 1); 5110 5111 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverInteractionSharedState.mjs 5112 var HoverInteraction = class _HoverInteraction { 5113 pointerType = void 0; 5114 interactedInside = false; 5115 handler = void 0; 5116 blockMouseMove = true; 5117 performedPointerEventsMutation = false; 5118 pointerEventsScopeElement = null; 5119 pointerEventsReferenceElement = null; 5120 pointerEventsFloatingElement = null; 5121 restTimeoutPending = false; 5122 openChangeTimeout = new Timeout(); 5123 restTimeout = new Timeout(); 5124 handleCloseOptions = void 0; 5125 static create() { 5126 return new _HoverInteraction(); 5127 } 5128 dispose = () => { 5129 this.openChangeTimeout.clear(); 5130 this.restTimeout.clear(); 5131 }; 5132 disposeEffect = () => { 5133 return this.dispose; 5134 }; 5135 }; 5136 var pointerEventsMutationOwnerByScopeElement = /* @__PURE__ */ new WeakMap(); 5137 function clearSafePolygonPointerEventsMutation(instance) { 5138 if (!instance.performedPointerEventsMutation) { 5139 return; 5140 } 5141 const scopeElement = instance.pointerEventsScopeElement; 5142 if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) { 5143 instance.pointerEventsScopeElement?.style.removeProperty("pointer-events"); 5144 instance.pointerEventsReferenceElement?.style.removeProperty("pointer-events"); 5145 instance.pointerEventsFloatingElement?.style.removeProperty("pointer-events"); 5146 pointerEventsMutationOwnerByScopeElement.delete(scopeElement); 5147 } 5148 instance.performedPointerEventsMutation = false; 5149 instance.pointerEventsScopeElement = null; 5150 instance.pointerEventsReferenceElement = null; 5151 instance.pointerEventsFloatingElement = null; 5152 } 5153 function applySafePolygonPointerEventsMutation(instance, options) { 5154 const { 5155 scopeElement, 5156 referenceElement, 5157 floatingElement 5158 } = options; 5159 const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement); 5160 if (existingOwner && existingOwner !== instance) { 5161 clearSafePolygonPointerEventsMutation(existingOwner); 5162 } 5163 clearSafePolygonPointerEventsMutation(instance); 5164 instance.performedPointerEventsMutation = true; 5165 instance.pointerEventsScopeElement = scopeElement; 5166 instance.pointerEventsReferenceElement = referenceElement; 5167 instance.pointerEventsFloatingElement = floatingElement; 5168 pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance); 5169 scopeElement.style.pointerEvents = "none"; 5170 referenceElement.style.pointerEvents = "auto"; 5171 floatingElement.style.pointerEvents = "auto"; 5172 } 5173 function useHoverInteractionSharedState(store) { 5174 const data = store.context.dataRef.current; 5175 const instance = useRefWithInit(() => data.hoverInteractionState ?? HoverInteraction.create()).current; 5176 if (!data.hoverInteractionState) { 5177 data.hoverInteractionState = instance; 5178 } 5179 useOnMount(data.hoverInteractionState.disposeEffect); 5180 return data.hoverInteractionState; 5181 } 5182 5183 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs 5184 function useHoverFloatingInteraction(store, parameters = {}) { 5185 const { 5186 enabled = true, 5187 closeDelay: closeDelayProp = 0, 5188 nodeId: nodeIdProp 5189 } = parameters; 5190 const open2 = store.useState("open"); 5191 const floatingElement = store.useState("floatingElement"); 5192 const domReferenceElement = store.useState("domReferenceElement"); 5193 const { 5194 dataRef 5195 } = store.context; 5196 const tree = useFloatingTree(); 5197 const parentId = useFloatingParentNodeId(); 5198 const instance = useHoverInteractionSharedState(store); 5199 const childClosedTimeout = useTimeout(); 5200 const isClickLikeOpenEvent2 = useStableCallback(() => { 5201 return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside); 5202 }); 5203 const isHoverOpen = useStableCallback(() => { 5204 return isHoverOpenEvent(dataRef.current.openEvent?.type); 5205 }); 5206 const clearPointerEvents = useStableCallback(() => { 5207 clearSafePolygonPointerEventsMutation(instance); 5208 }); 5209 useIsoLayoutEffect(() => { 5210 if (!open2) { 5211 instance.pointerType = void 0; 5212 instance.restTimeoutPending = false; 5213 instance.interactedInside = false; 5214 clearPointerEvents(); 5215 } 5216 }, [open2, instance, clearPointerEvents]); 5217 React30.useEffect(() => { 5218 return clearPointerEvents; 5219 }, [clearPointerEvents]); 5220 useIsoLayoutEffect(() => { 5221 if (!enabled) { 5222 return void 0; 5223 } 5224 if (open2 && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) { 5225 const ref = domReferenceElement; 5226 const floatingEl = floatingElement; 5227 const doc = ownerDocument(floatingElement); 5228 const parentFloating = tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.elements.floating; 5229 if (parentFloating) { 5230 parentFloating.style.pointerEvents = ""; 5231 } 5232 const cachedScopeElement = instance.pointerEventsScopeElement !== floatingEl ? instance.pointerEventsScopeElement : null; 5233 const parentScopeElement = parentFloating !== floatingEl ? parentFloating : null; 5234 const scopeElement = instance.handleCloseOptions?.getScope?.() ?? cachedScopeElement ?? parentScopeElement ?? closest(ref, "[data-rootownerid]") ?? doc.body; 5235 applySafePolygonPointerEventsMutation(instance, { 5236 scopeElement, 5237 referenceElement: ref, 5238 floatingElement: floatingEl 5239 }); 5240 return () => { 5241 clearPointerEvents(); 5242 }; 5243 } 5244 return void 0; 5245 }, [enabled, open2, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]); 5246 React30.useEffect(() => { 5247 if (!enabled) { 5248 return void 0; 5249 } 5250 function hasParentChildren() { 5251 return !!(tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0); 5252 } 5253 function closeWithDelay(event) { 5254 const closeDelay = getDelay(closeDelayProp, "close", instance.pointerType); 5255 const close = () => { 5256 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 5257 tree?.events.emit("floating.closed", event); 5258 }; 5259 if (closeDelay) { 5260 instance.openChangeTimeout.start(closeDelay, close); 5261 } else { 5262 instance.openChangeTimeout.clear(); 5263 close(); 5264 } 5265 } 5266 function handleInteractInside(event) { 5267 const target = getTarget(event); 5268 if (!isInteractiveElement(target)) { 5269 instance.interactedInside = false; 5270 return; 5271 } 5272 instance.interactedInside = closest(target, "[aria-haspopup]") != null; 5273 } 5274 function onFloatingMouseEnter() { 5275 instance.openChangeTimeout.clear(); 5276 childClosedTimeout.clear(); 5277 tree?.events.off("floating.closed", onNodeClosed); 5278 clearPointerEvents(); 5279 } 5280 function onFloatingMouseLeave(event) { 5281 if (hasParentChildren() && tree) { 5282 tree.events.on("floating.closed", onNodeClosed); 5283 return; 5284 } 5285 if (isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) { 5286 return; 5287 } 5288 const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp; 5289 const relatedTarget = event.relatedTarget; 5290 const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some((node) => contains(node.context?.elements.floating, relatedTarget)); 5291 if (isMovingIntoDescendantFloating) { 5292 return; 5293 } 5294 if (instance.handler) { 5295 instance.handler(event); 5296 return; 5297 } 5298 clearPointerEvents(); 5299 if (isHoverOpen() && !isClickLikeOpenEvent2()) { 5300 closeWithDelay(event); 5301 } 5302 } 5303 function onNodeClosed(event) { 5304 if (!tree || !parentId || hasParentChildren()) { 5305 return; 5306 } 5307 childClosedTimeout.start(0, () => { 5308 tree.events.off("floating.closed", onNodeClosed); 5309 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 5310 tree.events.emit("floating.closed", event); 5311 }); 5312 } 5313 const floating = floatingElement; 5314 return mergeCleanups(floating && addEventListener(floating, "mouseenter", onFloatingMouseEnter), floating && addEventListener(floating, "mouseleave", onFloatingMouseLeave), floating && addEventListener(floating, "pointerdown", handleInteractInside, true), () => { 5315 tree?.events.off("floating.closed", onNodeClosed); 5316 }); 5317 }, [enabled, floatingElement, store, dataRef, closeDelayProp, nodeIdProp, isHoverOpen, isClickLikeOpenEvent2, clearPointerEvents, instance, tree, parentId, childClosedTimeout]); 5318 } 5319 5320 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverReferenceInteraction.mjs 5321 var React31 = __toESM(require_react(), 1); 5322 var ReactDOM4 = __toESM(require_react_dom(), 1); 5323 var EMPTY_REF = { 5324 current: null 5325 }; 5326 function useHoverReferenceInteraction(store, props = {}) { 5327 const { 5328 enabled = true, 5329 delay = 0, 5330 handleClose = null, 5331 mouseOnly = false, 5332 restMs = 0, 5333 move = true, 5334 triggerElementRef = EMPTY_REF, 5335 externalTree, 5336 isActiveTrigger = true, 5337 getHandleCloseContext, 5338 isClosing, 5339 shouldOpen: shouldOpenProp, 5340 guardStaleOpen = false 5341 } = props; 5342 const { 5343 dataRef, 5344 events 5345 } = store.context; 5346 const tree = useFloatingTree(externalTree); 5347 const instance = useHoverInteractionSharedState(store); 5348 const isHoverCloseActiveRef = React31.useRef(false); 5349 const handleCloseRef = useValueAsRef(handleClose); 5350 const delayRef = useValueAsRef(delay); 5351 const restMsRef = useValueAsRef(restMs); 5352 const enabledRef = useValueAsRef(enabled); 5353 const shouldOpenRef = useValueAsRef(shouldOpenProp); 5354 const isClosingRef = useValueAsRef(isClosing); 5355 const isClickLikeOpenEvent2 = useStableCallback(() => { 5356 return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside); 5357 }); 5358 const checkShouldOpen = useStableCallback(() => { 5359 return shouldOpenRef.current?.() !== false; 5360 }); 5361 const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => { 5362 const allTriggers = store.context.triggerElements; 5363 if (allTriggers.hasElement(currentTarget)) { 5364 return !currentDomReference || !contains(currentDomReference, currentTarget); 5365 } 5366 if (!isElement(target)) { 5367 return false; 5368 } 5369 const targetElement = target; 5370 return allTriggers.hasMatchingElement((trigger) => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement)); 5371 }); 5372 const cleanupMouseMoveHandler = useStableCallback(() => { 5373 if (!instance.handler) { 5374 return; 5375 } 5376 const doc = ownerDocument(store.select("domReferenceElement")); 5377 doc.removeEventListener("mousemove", instance.handler); 5378 instance.handler = void 0; 5379 }); 5380 const clearPointerEvents = useStableCallback(() => { 5381 clearSafePolygonPointerEventsMutation(instance); 5382 }); 5383 if (isActiveTrigger) { 5384 instance.handleCloseOptions = handleClose?.__options; 5385 } 5386 React31.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]); 5387 React31.useEffect(() => { 5388 if (!enabled) { 5389 return void 0; 5390 } 5391 function onOpenChangeLocal(details) { 5392 if (!details.open) { 5393 isHoverCloseActiveRef.current = details.reason === reason_parts_exports.triggerHover; 5394 cleanupMouseMoveHandler(); 5395 instance.openChangeTimeout.clear(); 5396 instance.restTimeout.clear(); 5397 instance.blockMouseMove = true; 5398 instance.restTimeoutPending = false; 5399 } else { 5400 isHoverCloseActiveRef.current = false; 5401 } 5402 } 5403 events.on("openchange", onOpenChangeLocal); 5404 return () => { 5405 events.off("openchange", onOpenChangeLocal); 5406 }; 5407 }, [enabled, events, instance, cleanupMouseMoveHandler]); 5408 React31.useEffect(() => { 5409 if (!enabled) { 5410 return void 0; 5411 } 5412 function closeWithDelay(event, runElseBranch = true) { 5413 const closeDelay = getDelay(delayRef.current, "close", instance.pointerType); 5414 if (closeDelay) { 5415 instance.openChangeTimeout.start(closeDelay, () => { 5416 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 5417 tree?.events.emit("floating.closed", event); 5418 }); 5419 } else if (runElseBranch) { 5420 instance.openChangeTimeout.clear(); 5421 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 5422 tree?.events.emit("floating.closed", event); 5423 } 5424 } 5425 const trigger = triggerElementRef.current ?? (isActiveTrigger ? store.select("domReferenceElement") : null); 5426 if (!isElement(trigger)) { 5427 return void 0; 5428 } 5429 function onMouseEnter(event) { 5430 instance.openChangeTimeout.clear(); 5431 instance.blockMouseMove = false; 5432 if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) { 5433 return; 5434 } 5435 const restMsValue = getRestMs(restMsRef.current); 5436 const openDelay = getDelay(delayRef.current, "open", instance.pointerType); 5437 const eventTarget = getTarget(event); 5438 const currentTarget = event.currentTarget ?? null; 5439 const currentDomReference = store.select("domReferenceElement"); 5440 let triggerNode = currentTarget; 5441 if (isElement(eventTarget) && !store.context.triggerElements.hasElement(eventTarget)) { 5442 for (const triggerElement of store.context.triggerElements.elements()) { 5443 if (contains(triggerElement, eventTarget)) { 5444 triggerNode = triggerElement; 5445 break; 5446 } 5447 } 5448 } 5449 if (isElement(currentTarget) && isElement(currentDomReference) && !store.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) { 5450 triggerNode = currentDomReference; 5451 } 5452 const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget); 5453 const isOpen = store.select("open"); 5454 const isInClosingTransition = isClosingRef.current?.() ?? store.select("transitionStatus") === "ending"; 5455 const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current; 5456 const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition; 5457 const isRestOnlyDelay = restMsValue > 0 && !openDelay; 5458 const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition; 5459 const shouldOpen = !isOpen || isOverInactive; 5460 if (shouldOpenImmediately) { 5461 if (checkShouldOpen()) { 5462 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 5463 } 5464 return; 5465 } 5466 if (isRestOnlyDelay) { 5467 return; 5468 } 5469 if (openDelay) { 5470 instance.openChangeTimeout.start(openDelay, () => { 5471 if (shouldOpen && checkShouldOpen()) { 5472 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 5473 } 5474 }); 5475 } else if (shouldOpen) { 5476 if (checkShouldOpen()) { 5477 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 5478 } 5479 } 5480 } 5481 function onMouseLeave(event) { 5482 if (isClickLikeOpenEvent2()) { 5483 clearPointerEvents(); 5484 return; 5485 } 5486 cleanupMouseMoveHandler(); 5487 const domReferenceElement = store.select("domReferenceElement"); 5488 const doc = ownerDocument(domReferenceElement); 5489 instance.restTimeout.clear(); 5490 instance.restTimeoutPending = false; 5491 const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.(); 5492 if (isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) { 5493 return; 5494 } 5495 if (handleCloseRef.current && handleCloseContextBase) { 5496 if (!store.select("open")) { 5497 instance.openChangeTimeout.clear(); 5498 } 5499 const currentTrigger = triggerElementRef.current; 5500 instance.handler = handleCloseRef.current({ 5501 ...handleCloseContextBase, 5502 tree, 5503 x: event.clientX, 5504 y: event.clientY, 5505 onClose() { 5506 clearPointerEvents(); 5507 cleanupMouseMoveHandler(); 5508 if (enabledRef.current && !isClickLikeOpenEvent2() && currentTrigger === store.select("domReferenceElement")) { 5509 closeWithDelay(event, true); 5510 } 5511 } 5512 }); 5513 doc.addEventListener("mousemove", instance.handler); 5514 instance.handler(event); 5515 return; 5516 } 5517 const shouldClose = instance.pointerType === "touch" ? !contains(store.select("floatingElement"), event.relatedTarget) : true; 5518 if (shouldClose) { 5519 closeWithDelay(event); 5520 } 5521 } 5522 function onMouseOut(event) { 5523 if (contains(trigger, event.relatedTarget)) { 5524 return; 5525 } 5526 instance.openChangeTimeout.clear(); 5527 instance.restTimeout.clear(); 5528 instance.restTimeoutPending = false; 5529 } 5530 const staleOpenGuard = guardStaleOpen ? addEventListener(trigger, "mouseout", onMouseOut) : void 0; 5531 if (move) { 5532 return mergeCleanups(addEventListener(trigger, "mousemove", onMouseEnter, { 5533 once: true 5534 }), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard); 5535 } 5536 return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard); 5537 }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen, guardStaleOpen]); 5538 return React31.useMemo(() => { 5539 if (!enabled) { 5540 return void 0; 5541 } 5542 function setPointerRef(event) { 5543 instance.pointerType = event.pointerType; 5544 } 5545 return { 5546 onPointerDown: setPointerRef, 5547 onPointerEnter: setPointerRef, 5548 onMouseMove(event) { 5549 const { 5550 nativeEvent 5551 } = event; 5552 const trigger = event.currentTarget; 5553 const currentDomReference = store.select("domReferenceElement"); 5554 const currentOpen = store.select("open"); 5555 const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target); 5556 if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) { 5557 return; 5558 } 5559 if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) { 5560 const floatingElement = store.select("floatingElement"); 5561 if (floatingElement) { 5562 const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body; 5563 applySafePolygonPointerEventsMutation(instance, { 5564 scopeElement, 5565 referenceElement: trigger, 5566 floatingElement 5567 }); 5568 } 5569 } 5570 const restMsValue = getRestMs(restMsRef.current); 5571 if (currentOpen && !isOverInactive || restMsValue === 0) { 5572 return; 5573 } 5574 if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) { 5575 return; 5576 } 5577 instance.restTimeout.clear(); 5578 function handleMouseMove() { 5579 instance.restTimeoutPending = false; 5580 if (isClickLikeOpenEvent2()) { 5581 return; 5582 } 5583 const latestOpen = store.select("open"); 5584 if (!instance.blockMouseMove && (!latestOpen || isOverInactive) && checkShouldOpen()) { 5585 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, nativeEvent, trigger)); 5586 } 5587 } 5588 if (instance.pointerType === "touch") { 5589 ReactDOM4.flushSync(() => { 5590 handleMouseMove(); 5591 }); 5592 } else if (isOverInactive && currentOpen) { 5593 handleMouseMove(); 5594 } else { 5595 instance.restTimeoutPending = true; 5596 instance.restTimeout.start(restMsValue, handleMouseMove); 5597 } 5598 } 5599 }; 5600 }, [enabled, instance, isClickLikeOpenEvent2, isOverInactiveTrigger, mouseOnly, store, restMsRef, checkShouldOpen]); 5601 } 5602 5603 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/safePolygon.mjs 5604 var CURSOR_SPEED_THRESHOLD = 0.1; 5605 var CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD; 5606 var POLYGON_BUFFER = 0.5; 5607 function hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) { 5608 return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi; 5609 } 5610 function isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) { 5611 let isInsideValue = false; 5612 if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) { 5613 isInsideValue = !isInsideValue; 5614 } 5615 if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) { 5616 isInsideValue = !isInsideValue; 5617 } 5618 if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) { 5619 isInsideValue = !isInsideValue; 5620 } 5621 if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) { 5622 isInsideValue = !isInsideValue; 5623 } 5624 return isInsideValue; 5625 } 5626 function isInsideRect(pointX, pointY, rect) { 5627 return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height; 5628 } 5629 function isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) { 5630 const minX = Math.min(x1, x2); 5631 const maxX = Math.max(x1, x2); 5632 const minY = Math.min(y1, y2); 5633 const maxY = Math.max(y1, y2); 5634 return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY; 5635 } 5636 function safePolygon(options = {}) { 5637 const { 5638 blockPointerEvents = false 5639 } = options; 5640 const timeout = new Timeout(); 5641 const fn = ({ 5642 x, 5643 y, 5644 placement, 5645 elements, 5646 onClose, 5647 nodeId, 5648 tree 5649 }) => { 5650 const side = placement?.split("-")[0]; 5651 let hasLanded = false; 5652 let lastX = null; 5653 let lastY = null; 5654 let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0; 5655 function isCursorMovingSlowly(nextX, nextY) { 5656 const currentTime = performance.now(); 5657 const elapsedTime = currentTime - lastCursorTime; 5658 if (lastX === null || lastY === null || elapsedTime === 0) { 5659 lastX = nextX; 5660 lastY = nextY; 5661 lastCursorTime = currentTime; 5662 return false; 5663 } 5664 const deltaX = nextX - lastX; 5665 const deltaY = nextY - lastY; 5666 const distanceSquared = deltaX * deltaX + deltaY * deltaY; 5667 const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED; 5668 lastX = nextX; 5669 lastY = nextY; 5670 lastCursorTime = currentTime; 5671 return distanceSquared < thresholdSquared; 5672 } 5673 function close() { 5674 timeout.clear(); 5675 onClose(); 5676 } 5677 return function onMouseMove(event) { 5678 timeout.clear(); 5679 const domReference = elements.domReference; 5680 const floating = elements.floating; 5681 if (!domReference || !floating || side == null || x == null || y == null) { 5682 return void 0; 5683 } 5684 const { 5685 clientX, 5686 clientY 5687 } = event; 5688 const target = getTarget(event); 5689 const isLeave = event.type === "mouseleave"; 5690 const isOverFloatingEl = contains(floating, target); 5691 const isOverReferenceEl = contains(domReference, target); 5692 if (isOverFloatingEl) { 5693 hasLanded = true; 5694 if (!isLeave) { 5695 return void 0; 5696 } 5697 } 5698 if (isOverReferenceEl) { 5699 hasLanded = false; 5700 if (!isLeave) { 5701 hasLanded = true; 5702 return void 0; 5703 } 5704 } 5705 if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) { 5706 return void 0; 5707 } 5708 function hasOpenChildNode() { 5709 return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0); 5710 } 5711 function closeIfNoOpenChild() { 5712 if (!hasOpenChildNode()) { 5713 close(); 5714 } 5715 } 5716 if (hasOpenChildNode()) { 5717 return void 0; 5718 } 5719 const refRect = domReference.getBoundingClientRect(); 5720 const rect = floating.getBoundingClientRect(); 5721 const cursorLeaveFromRight = x > rect.right - rect.width / 2; 5722 const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2; 5723 const isFloatingWider = rect.width > refRect.width; 5724 const isFloatingTaller = rect.height > refRect.height; 5725 const left = (isFloatingWider ? refRect : rect).left; 5726 const right = (isFloatingWider ? refRect : rect).right; 5727 const top = (isFloatingTaller ? refRect : rect).top; 5728 const bottom = (isFloatingTaller ? refRect : rect).bottom; 5729 if (side === "top" && y >= refRect.bottom - 1 || side === "bottom" && y <= refRect.top + 1 || side === "left" && x >= refRect.right - 1 || side === "right" && x <= refRect.left + 1) { 5730 closeIfNoOpenChild(); 5731 return void 0; 5732 } 5733 let isInsideTroughRect = false; 5734 switch (side) { 5735 case "top": 5736 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1); 5737 break; 5738 case "bottom": 5739 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1); 5740 break; 5741 case "left": 5742 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top); 5743 break; 5744 case "right": 5745 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top); 5746 break; 5747 default: 5748 } 5749 if (isInsideTroughRect) { 5750 return void 0; 5751 } 5752 if (hasLanded && !isInsideRect(clientX, clientY, refRect)) { 5753 closeIfNoOpenChild(); 5754 return void 0; 5755 } 5756 if (!isLeave && isCursorMovingSlowly(clientX, clientY)) { 5757 closeIfNoOpenChild(); 5758 return void 0; 5759 } 5760 let isInsidePolygon = false; 5761 switch (side) { 5762 case "top": { 5763 const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 5764 const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 5765 const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 5766 const cursorPointY = y + POLYGON_BUFFER + 1; 5767 const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top; 5768 const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER; 5769 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight); 5770 break; 5771 } 5772 case "bottom": { 5773 const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 5774 const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 5775 const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 5776 const cursorPointY = y - POLYGON_BUFFER; 5777 const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom; 5778 const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER; 5779 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight); 5780 break; 5781 } 5782 case "left": { 5783 const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 5784 const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 5785 const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 5786 const cursorPointX = x + POLYGON_BUFFER + 1; 5787 const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left; 5788 const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER; 5789 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY); 5790 break; 5791 } 5792 case "right": { 5793 const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 5794 const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 5795 const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 5796 const cursorPointX = x - POLYGON_BUFFER; 5797 const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right; 5798 const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER; 5799 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom); 5800 break; 5801 } 5802 default: 5803 } 5804 if (!isInsidePolygon) { 5805 closeIfNoOpenChild(); 5806 } else if (!hasLanded) { 5807 timeout.start(40, closeIfNoOpenChild); 5808 } 5809 return void 0; 5810 }; 5811 }; 5812 fn.__options = { 5813 ...options, 5814 blockPointerEvents 5815 }; 5816 return fn; 5817 } 5818 5819 // node_modules/.store/@floating-ui/core@1.8.0-3V8aS7jJHHGcsCINjP9-5A/node_modules/@floating-ui/core/dist/floating-ui.core.mjs 5820 function computeCoordsFromPlacement(_ref, placement, rtl) { 5821 let { 5822 reference, 5823 floating 5824 } = _ref; 5825 const sideAxis = getSideAxis(placement); 5826 const alignmentAxis = getAlignmentAxis(placement); 5827 const alignLength = getAxisLength(alignmentAxis); 5828 const side = getSide(placement); 5829 const isVertical = sideAxis === "y"; 5830 const commonX = reference.x + reference.width / 2 - floating.width / 2; 5831 const commonY = reference.y + reference.height / 2 - floating.height / 2; 5832 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 5833 let coords; 5834 switch (side) { 5835 case "top": 5836 coords = { 5837 x: commonX, 5838 y: reference.y - floating.height 5839 }; 5840 break; 5841 case "bottom": 5842 coords = { 5843 x: commonX, 5844 y: reference.y + reference.height 5845 }; 5846 break; 5847 case "right": 5848 coords = { 5849 x: reference.x + reference.width, 5850 y: commonY 5851 }; 5852 break; 5853 case "left": 5854 coords = { 5855 x: reference.x - floating.width, 5856 y: commonY 5857 }; 5858 break; 5859 default: 5860 coords = { 5861 x: reference.x, 5862 y: reference.y 5863 }; 5864 } 5865 const alignment = getAlignment(placement); 5866 if (alignment) { 5867 coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1); 5868 } 5869 return coords; 5870 } 5871 async function detectOverflow(state, options) { 5872 var _await$platform$isEle; 5873 if (options === void 0) { 5874 options = {}; 5875 } 5876 const { 5877 x, 5878 y, 5879 platform: platform3, 5880 rects, 5881 elements, 5882 strategy 5883 } = state; 5884 const { 5885 boundary = "clippingAncestors", 5886 rootBoundary = "viewport", 5887 elementContext = "floating", 5888 altBoundary = false, 5889 padding = 0 5890 } = evaluate(options, state); 5891 const paddingObject = getPaddingObject(padding); 5892 const altContext = elementContext === "floating" ? "reference" : "floating"; 5893 const element = elements[altBoundary ? altContext : elementContext]; 5894 const clippingClientRect = rectToClientRect(await platform3.getClippingRect({ 5895 element: ((_await$platform$isEle = await (platform3.isElement == null ? void 0 : platform3.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform3.getDocumentElement == null ? void 0 : platform3.getDocumentElement(elements.floating)), 5896 boundary, 5897 rootBoundary, 5898 strategy 5899 })); 5900 const rect = elementContext === "floating" ? { 5901 x, 5902 y, 5903 width: rects.floating.width, 5904 height: rects.floating.height 5905 } : rects.reference; 5906 const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements.floating)); 5907 const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) && await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || { 5908 x: 1, 5909 y: 1 5910 }; 5911 const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({ 5912 elements, 5913 rect, 5914 offsetParent, 5915 strategy 5916 }) : rect); 5917 return { 5918 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 5919 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 5920 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 5921 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 5922 }; 5923 } 5924 var MAX_RESET_COUNT = 50; 5925 var computePosition = async (reference, floating, config) => { 5926 const { 5927 placement = "bottom", 5928 strategy = "absolute", 5929 middleware = [], 5930 platform: platform3 5931 } = config; 5932 const platformWithDetectOverflow = platform3.detectOverflow ? platform3 : { 5933 ...platform3, 5934 detectOverflow 5935 }; 5936 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating)); 5937 let rects = await platform3.getElementRects({ 5938 reference, 5939 floating, 5940 strategy 5941 }); 5942 let { 5943 x, 5944 y 5945 } = computeCoordsFromPlacement(rects, placement, rtl); 5946 let statefulPlacement = placement; 5947 let resetCount = 0; 5948 const middlewareData = {}; 5949 for (let i = 0; i < middleware.length; i++) { 5950 const currentMiddleware = middleware[i]; 5951 if (!currentMiddleware) { 5952 continue; 5953 } 5954 const { 5955 name, 5956 fn 5957 } = currentMiddleware; 5958 const { 5959 x: nextX, 5960 y: nextY, 5961 data, 5962 reset 5963 } = await fn({ 5964 x, 5965 y, 5966 initialPlacement: placement, 5967 placement: statefulPlacement, 5968 strategy, 5969 middlewareData, 5970 rects, 5971 platform: platformWithDetectOverflow, 5972 elements: { 5973 reference, 5974 floating 5975 } 5976 }); 5977 x = nextX != null ? nextX : x; 5978 y = nextY != null ? nextY : y; 5979 middlewareData[name] = { 5980 ...middlewareData[name], 5981 ...data 5982 }; 5983 if (reset && resetCount < MAX_RESET_COUNT) { 5984 resetCount++; 5985 if (typeof reset === "object") { 5986 if (reset.placement) { 5987 statefulPlacement = reset.placement; 5988 } 5989 if (reset.rects) { 5990 rects = reset.rects === true ? await platform3.getElementRects({ 5991 reference, 5992 floating, 5993 strategy 5994 }) : reset.rects; 5995 } 5996 ({ 5997 x, 5998 y 5999 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 6000 } 6001 i = -1; 6002 } 6003 } 6004 return { 6005 x, 6006 y, 6007 placement: statefulPlacement, 6008 strategy, 6009 middlewareData 6010 }; 6011 }; 6012 var flip = function(options) { 6013 if (options === void 0) { 6014 options = {}; 6015 } 6016 return { 6017 name: "flip", 6018 options, 6019 async fn(state) { 6020 var _middlewareData$arrow, _middlewareData$flip; 6021 const { 6022 placement, 6023 middlewareData, 6024 rects, 6025 initialPlacement, 6026 platform: platform3, 6027 elements 6028 } = state; 6029 const { 6030 mainAxis: checkMainAxis = true, 6031 crossAxis: checkCrossAxis = true, 6032 fallbackPlacements: specifiedFallbackPlacements, 6033 fallbackStrategy = "bestFit", 6034 fallbackAxisSideDirection = "none", 6035 flipAlignment = true, 6036 ...detectOverflowOptions 6037 } = evaluate(options, state); 6038 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 6039 return {}; 6040 } 6041 const side = getSide(placement); 6042 const initialSideAxis = getSideAxis(initialPlacement); 6043 const isBasePlacement = getSide(initialPlacement) === initialPlacement; 6044 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)); 6045 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 6046 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none"; 6047 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 6048 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 6049 } 6050 const placements2 = [initialPlacement, ...fallbackPlacements]; 6051 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 6052 const overflows = []; 6053 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 6054 if (checkMainAxis) { 6055 overflows.push(overflow[side]); 6056 } 6057 if (checkCrossAxis) { 6058 const sides2 = getAlignmentSides(placement, rects, rtl); 6059 overflows.push(overflow[sides2[0]], overflow[sides2[1]]); 6060 } 6061 overflowsData = [...overflowsData, { 6062 placement, 6063 overflows 6064 }]; 6065 if (!overflows.every((side2) => side2 <= 0)) { 6066 var _middlewareData$flip2, _overflowsData$filter; 6067 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 6068 const nextPlacement = placements2[nextIndex]; 6069 if (nextPlacement) { 6070 const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false; 6071 if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis 6072 // overflows the main axis. 6073 overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { 6074 return { 6075 data: { 6076 index: nextIndex, 6077 overflows: overflowsData 6078 }, 6079 reset: { 6080 placement: nextPlacement 6081 } 6082 }; 6083 } 6084 } 6085 let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; 6086 if (!resetPlacement) { 6087 switch (fallbackStrategy) { 6088 case "bestFit": { 6089 var _overflowsData$filter2; 6090 const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => { 6091 if (hasFallbackAxisSideDirection) { 6092 const currentSideAxis = getSideAxis(d.placement); 6093 return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal 6094 // reading directions favoring greater width. 6095 currentSideAxis === "y"; 6096 } 6097 return true; 6098 }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; 6099 if (placement2) { 6100 resetPlacement = placement2; 6101 } 6102 break; 6103 } 6104 case "initialPlacement": 6105 resetPlacement = initialPlacement; 6106 break; 6107 } 6108 } 6109 if (placement !== resetPlacement) { 6110 return { 6111 reset: { 6112 placement: resetPlacement 6113 } 6114 }; 6115 } 6116 } 6117 return {}; 6118 } 6119 }; 6120 }; 6121 var originSides = /* @__PURE__ */ new Set(["left", "top"]); 6122 async function convertValueToCoords(state, options) { 6123 const { 6124 placement, 6125 platform: platform3, 6126 elements 6127 } = state; 6128 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)); 6129 const side = getSide(placement); 6130 const alignment = getAlignment(placement); 6131 const isVertical = getSideAxis(placement) === "y"; 6132 const mainAxisMulti = originSides.has(side) ? -1 : 1; 6133 const crossAxisMulti = rtl && isVertical ? -1 : 1; 6134 const rawValue = evaluate(options, state); 6135 let { 6136 mainAxis, 6137 crossAxis, 6138 alignmentAxis 6139 } = typeof rawValue === "number" ? { 6140 mainAxis: rawValue, 6141 crossAxis: 0, 6142 alignmentAxis: null 6143 } : { 6144 mainAxis: rawValue.mainAxis || 0, 6145 crossAxis: rawValue.crossAxis || 0, 6146 alignmentAxis: rawValue.alignmentAxis 6147 }; 6148 if (alignment && typeof alignmentAxis === "number") { 6149 crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; 6150 } 6151 return isVertical ? { 6152 x: crossAxis * crossAxisMulti, 6153 y: mainAxis * mainAxisMulti 6154 } : { 6155 x: mainAxis * mainAxisMulti, 6156 y: crossAxis * crossAxisMulti 6157 }; 6158 } 6159 var offset = function(options) { 6160 if (options === void 0) { 6161 options = 0; 6162 } 6163 return { 6164 name: "offset", 6165 options, 6166 async fn(state) { 6167 var _middlewareData$offse, _middlewareData$arrow; 6168 const { 6169 x, 6170 y, 6171 placement, 6172 middlewareData 6173 } = state; 6174 const diffCoords = await convertValueToCoords(state, options); 6175 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 6176 return {}; 6177 } 6178 return { 6179 x: x + diffCoords.x, 6180 y: y + diffCoords.y, 6181 data: { 6182 ...diffCoords, 6183 placement 6184 } 6185 }; 6186 } 6187 }; 6188 }; 6189 var shift = function(options) { 6190 if (options === void 0) { 6191 options = {}; 6192 } 6193 return { 6194 name: "shift", 6195 options, 6196 async fn(state) { 6197 const { 6198 x, 6199 y, 6200 placement, 6201 platform: platform3 6202 } = state; 6203 const { 6204 mainAxis: checkMainAxis = true, 6205 crossAxis: checkCrossAxis = false, 6206 limiter = { 6207 fn: (_ref) => { 6208 let { 6209 x: x2, 6210 y: y2 6211 } = _ref; 6212 return { 6213 x: x2, 6214 y: y2 6215 }; 6216 } 6217 }, 6218 ...detectOverflowOptions 6219 } = evaluate(options, state); 6220 const coords = { 6221 x, 6222 y 6223 }; 6224 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 6225 const crossAxis = getSideAxis(placement); 6226 const mainAxis = getOppositeAxis(crossAxis); 6227 let mainAxisCoord = coords[mainAxis]; 6228 let crossAxisCoord = coords[crossAxis]; 6229 const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]); 6230 if (checkMainAxis) { 6231 mainAxisCoord = clampCoord(mainAxis, mainAxisCoord); 6232 } 6233 if (checkCrossAxis) { 6234 crossAxisCoord = clampCoord(crossAxis, crossAxisCoord); 6235 } 6236 const limitedCoords = limiter.fn({ 6237 ...state, 6238 [mainAxis]: mainAxisCoord, 6239 [crossAxis]: crossAxisCoord 6240 }); 6241 return { 6242 ...limitedCoords, 6243 data: { 6244 x: limitedCoords.x - x, 6245 y: limitedCoords.y - y, 6246 enabled: { 6247 [mainAxis]: checkMainAxis, 6248 [crossAxis]: checkCrossAxis 6249 } 6250 } 6251 }; 6252 } 6253 }; 6254 }; 6255 var limitShift = function(options) { 6256 if (options === void 0) { 6257 options = {}; 6258 } 6259 return { 6260 options, 6261 fn(state) { 6262 var _rawOffset$mainAxis, _rawOffset$crossAxis; 6263 const { 6264 x, 6265 y, 6266 placement, 6267 rects, 6268 middlewareData 6269 } = state; 6270 const { 6271 offset: offset4 = 0, 6272 mainAxis: checkMainAxis = true, 6273 crossAxis: checkCrossAxis = true 6274 } = evaluate(options, state); 6275 const coords = { 6276 x, 6277 y 6278 }; 6279 const crossAxis = getSideAxis(placement); 6280 const mainAxis = getOppositeAxis(crossAxis); 6281 let mainAxisCoord = coords[mainAxis]; 6282 let crossAxisCoord = coords[crossAxis]; 6283 const rawOffset = evaluate(offset4, state); 6284 const computedOffset = typeof rawOffset === "number" ? { 6285 mainAxis: rawOffset, 6286 crossAxis: 0 6287 } : { 6288 mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0, 6289 crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0 6290 }; 6291 if (checkMainAxis) { 6292 const len = mainAxis === "y" ? "height" : "width"; 6293 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; 6294 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; 6295 if (mainAxisCoord < limitMin) { 6296 mainAxisCoord = limitMin; 6297 } else if (mainAxisCoord > limitMax) { 6298 mainAxisCoord = limitMax; 6299 } 6300 } 6301 if (checkCrossAxis) { 6302 var _middlewareData$offse, _middlewareData$offse2; 6303 const len = mainAxis === "y" ? "width" : "height"; 6304 const isOriginSide = originSides.has(getSide(placement)); 6305 const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); 6306 const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); 6307 if (crossAxisCoord < limitMin) { 6308 crossAxisCoord = limitMin; 6309 } else if (crossAxisCoord > limitMax) { 6310 crossAxisCoord = limitMax; 6311 } 6312 } 6313 return { 6314 [mainAxis]: mainAxisCoord, 6315 [crossAxis]: crossAxisCoord 6316 }; 6317 } 6318 }; 6319 }; 6320 var size = function(options) { 6321 if (options === void 0) { 6322 options = {}; 6323 } 6324 return { 6325 name: "size", 6326 options, 6327 async fn(state) { 6328 const { 6329 placement, 6330 rects, 6331 platform: platform3, 6332 elements 6333 } = state; 6334 const { 6335 apply = () => { 6336 }, 6337 ...detectOverflowOptions 6338 } = evaluate(options, state); 6339 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 6340 const side = getSide(placement); 6341 const alignment = getAlignment(placement); 6342 const isYAxis = getSideAxis(placement) === "y"; 6343 const { 6344 width, 6345 height 6346 } = rects.floating; 6347 let heightSide; 6348 let widthSide; 6349 if (side === "top" || side === "bottom") { 6350 heightSide = side; 6351 widthSide = alignment === (await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right"; 6352 } else { 6353 widthSide = side; 6354 heightSide = alignment === "end" ? "top" : "bottom"; 6355 } 6356 const maximumClippingHeight = height - overflow.top - overflow.bottom; 6357 const maximumClippingWidth = width - overflow.left - overflow.right; 6358 const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); 6359 const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); 6360 const shiftData = state.middlewareData.shift; 6361 const noShift = !shiftData; 6362 let availableHeight2 = overflowAvailableHeight; 6363 let availableWidth2 = overflowAvailableWidth; 6364 if (shiftData != null && shiftData.enabled.x) { 6365 availableWidth2 = maximumClippingWidth; 6366 } 6367 if (shiftData != null && shiftData.enabled.y) { 6368 availableHeight2 = maximumClippingHeight; 6369 } 6370 if (noShift && !alignment) { 6371 if (isYAxis) { 6372 availableWidth2 = width - 2 * max(overflow.left, overflow.right); 6373 } else { 6374 availableHeight2 = height - 2 * max(overflow.top, overflow.bottom); 6375 } 6376 } 6377 await apply({ 6378 ...state, 6379 availableWidth: availableWidth2, 6380 availableHeight: availableHeight2 6381 }); 6382 const nextDimensions = await platform3.getDimensions(elements.floating); 6383 if (width !== nextDimensions.width || height !== nextDimensions.height) { 6384 return { 6385 reset: { 6386 rects: true 6387 } 6388 }; 6389 } 6390 return {}; 6391 } 6392 }; 6393 }; 6394 6395 // node_modules/.store/@floating-ui/dom@1.8.0-vHXcr4FgWneV0cgwFw-d7A/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs 6396 function getCssDimensions(element) { 6397 const css = getComputedStyle2(element); 6398 let width = parseFloat(css.width) || 0; 6399 let height = parseFloat(css.height) || 0; 6400 const hasOffset = isHTMLElement(element); 6401 const offsetWidth = hasOffset ? element.offsetWidth : width; 6402 const offsetHeight = hasOffset ? element.offsetHeight : height; 6403 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 6404 if (shouldFallback) { 6405 width = offsetWidth; 6406 height = offsetHeight; 6407 } 6408 return { 6409 width, 6410 height, 6411 $: shouldFallback 6412 }; 6413 } 6414 function unwrapElement(element) { 6415 return !isElement(element) ? element.contextElement : element; 6416 } 6417 function getScale(element) { 6418 const domElement = unwrapElement(element); 6419 if (!isHTMLElement(domElement)) { 6420 return createCoords(1); 6421 } 6422 const rect = domElement.getBoundingClientRect(); 6423 const { 6424 width, 6425 height, 6426 $ 6427 } = getCssDimensions(domElement); 6428 let x = ($ ? round(rect.width) : rect.width) / width; 6429 let y = ($ ? round(rect.height) : rect.height) / height; 6430 if (!x || !Number.isFinite(x)) { 6431 x = 1; 6432 } 6433 if (!y || !Number.isFinite(y)) { 6434 y = 1; 6435 } 6436 return { 6437 x, 6438 y 6439 }; 6440 } 6441 var noOffsets = /* @__PURE__ */ createCoords(0); 6442 function getVisualOffsets(element) { 6443 const win = getWindow(element); 6444 if (!isWebKit() || !win.visualViewport) { 6445 return noOffsets; 6446 } 6447 return { 6448 x: win.visualViewport.offsetLeft, 6449 y: win.visualViewport.offsetTop 6450 }; 6451 } 6452 function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 6453 if (isFixed === void 0) { 6454 isFixed = false; 6455 } 6456 return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element); 6457 } 6458 function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 6459 if (includeScale === void 0) { 6460 includeScale = false; 6461 } 6462 if (isFixedStrategy === void 0) { 6463 isFixedStrategy = false; 6464 } 6465 const clientRect = element.getBoundingClientRect(); 6466 const domElement = unwrapElement(element); 6467 let scale = createCoords(1); 6468 if (includeScale) { 6469 if (offsetParent) { 6470 if (isElement(offsetParent)) { 6471 scale = getScale(offsetParent); 6472 } 6473 } else { 6474 scale = getScale(element); 6475 } 6476 } 6477 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 6478 let x = (clientRect.left + visualOffsets.x) / scale.x; 6479 let y = (clientRect.top + visualOffsets.y) / scale.y; 6480 let width = clientRect.width / scale.x; 6481 let height = clientRect.height / scale.y; 6482 if (domElement && offsetParent) { 6483 const win = getWindow(domElement); 6484 const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; 6485 let currentWin = win; 6486 let currentIFrame = getFrameElement(currentWin); 6487 while (currentIFrame && offsetWin !== currentWin) { 6488 const iframeScale = getScale(currentIFrame); 6489 const iframeRect = currentIFrame.getBoundingClientRect(); 6490 const css = getComputedStyle2(currentIFrame); 6491 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 6492 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 6493 x *= iframeScale.x; 6494 y *= iframeScale.y; 6495 width *= iframeScale.x; 6496 height *= iframeScale.y; 6497 x += left; 6498 y += top; 6499 currentWin = getWindow(currentIFrame); 6500 currentIFrame = getFrameElement(currentWin); 6501 } 6502 } 6503 return rectToClientRect({ 6504 width, 6505 height, 6506 x, 6507 y 6508 }); 6509 } 6510 function getWindowScrollBarX(element, rect) { 6511 const leftScroll = getNodeScroll(element).scrollLeft; 6512 if (!rect) { 6513 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 6514 } 6515 return rect.left + leftScroll; 6516 } 6517 function getHTMLOffset(documentElement, scroll) { 6518 const htmlRect = documentElement.getBoundingClientRect(); 6519 const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); 6520 const y = htmlRect.top + scroll.scrollTop; 6521 return { 6522 x, 6523 y 6524 }; 6525 } 6526 function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { 6527 let { 6528 elements, 6529 rect, 6530 offsetParent, 6531 strategy 6532 } = _ref; 6533 const isFixed = strategy === "fixed"; 6534 const documentElement = getDocumentElement(offsetParent); 6535 const topLayer = elements ? isTopLayer(elements.floating) : false; 6536 if (offsetParent === documentElement || topLayer && isFixed) { 6537 return rect; 6538 } 6539 let scroll = { 6540 scrollLeft: 0, 6541 scrollTop: 0 6542 }; 6543 let scale = createCoords(1); 6544 const offsets = createCoords(0); 6545 const isOffsetParentAnElement = isHTMLElement(offsetParent); 6546 if (isOffsetParentAnElement || !isFixed) { 6547 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 6548 scroll = getNodeScroll(offsetParent); 6549 } 6550 if (isOffsetParentAnElement) { 6551 const offsetRect = getBoundingClientRect(offsetParent); 6552 scale = getScale(offsetParent); 6553 offsets.x = offsetRect.x + offsetParent.clientLeft; 6554 offsets.y = offsetRect.y + offsetParent.clientTop; 6555 } 6556 } 6557 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 6558 return { 6559 width: rect.width * scale.x, 6560 height: rect.height * scale.y, 6561 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, 6562 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y 6563 }; 6564 } 6565 function getClientRects(element) { 6566 return element.getClientRects ? Array.from(element.getClientRects()) : []; 6567 } 6568 function getDocumentRect(html) { 6569 const scroll = getNodeScroll(html); 6570 const body = html.ownerDocument.body; 6571 const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); 6572 const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); 6573 let x = -scroll.scrollLeft + getWindowScrollBarX(html); 6574 const y = -scroll.scrollTop; 6575 if (getComputedStyle2(body).direction === "rtl") { 6576 x += max(html.clientWidth, body.clientWidth) - width; 6577 } 6578 return { 6579 width, 6580 height, 6581 x, 6582 y 6583 }; 6584 } 6585 var SCROLLBAR_MAX = 25; 6586 function getViewportRect(element, strategy, rootBoundary) { 6587 if (rootBoundary === void 0) { 6588 rootBoundary = "viewport"; 6589 } 6590 const isLayoutViewport = rootBoundary === "layoutViewport"; 6591 const win = getWindow(element); 6592 const html = getDocumentElement(element); 6593 const visualViewport = win.visualViewport; 6594 let width = html.clientWidth; 6595 let height = html.clientHeight; 6596 let x = 0; 6597 let y = 0; 6598 if (visualViewport) { 6599 const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed"; 6600 if (isLayoutViewport) { 6601 if (!layoutRelativeClientCoords) { 6602 x = -visualViewport.offsetLeft; 6603 y = -visualViewport.offsetTop; 6604 } 6605 } else { 6606 width = visualViewport.width; 6607 height = visualViewport.height; 6608 if (layoutRelativeClientCoords) { 6609 x = visualViewport.offsetLeft; 6610 y = visualViewport.offsetTop; 6611 } 6612 } 6613 } 6614 const windowScrollbarX = getWindowScrollBarX(html); 6615 if (windowScrollbarX <= 0) { 6616 const doc = html.ownerDocument; 6617 const body = doc.body; 6618 const bodyStyles = getComputedStyle(body); 6619 const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; 6620 const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); 6621 const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth; 6622 if (gutter <= SCROLLBAR_MAX) { 6623 width -= gutter; 6624 } 6625 } 6626 return { 6627 width, 6628 height, 6629 x, 6630 y 6631 }; 6632 } 6633 function getInnerBoundingClientRect(element, strategy) { 6634 const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); 6635 const top = clientRect.top + element.clientTop; 6636 const left = clientRect.left + element.clientLeft; 6637 const scale = getScale(element); 6638 const width = element.clientWidth * scale.x; 6639 const height = element.clientHeight * scale.y; 6640 const x = left * scale.x; 6641 const y = top * scale.y; 6642 return { 6643 width, 6644 height, 6645 x, 6646 y 6647 }; 6648 } 6649 function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 6650 let rect; 6651 if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") { 6652 rect = getViewportRect(element, strategy, clippingAncestor); 6653 } else if (clippingAncestor === "document") { 6654 rect = getDocumentRect(getDocumentElement(element)); 6655 } else if (isElement(clippingAncestor)) { 6656 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 6657 } else { 6658 const visualOffsets = getVisualOffsets(element); 6659 rect = { 6660 x: clippingAncestor.x - visualOffsets.x, 6661 y: clippingAncestor.y - visualOffsets.y, 6662 width: clippingAncestor.width, 6663 height: clippingAncestor.height 6664 }; 6665 } 6666 return rectToClientRect(rect); 6667 } 6668 function getClippingElementAncestors(element, cache) { 6669 const cachedResult = cache.get(element); 6670 if (cachedResult) { 6671 return cachedResult; 6672 } 6673 let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); 6674 let lastKeptComputedStyle = null; 6675 const elementIsFixed = getComputedStyle2(element).position === "fixed"; 6676 let currentNode = elementIsFixed ? getParentNode(element) : element; 6677 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 6678 const computedStyle = getComputedStyle2(currentNode); 6679 const currentNodeIsContaining = isContainingBlock(currentNode); 6680 const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : ""; 6681 const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static"); 6682 if (shouldDropCurrentNode) { 6683 result = result.filter((ancestor) => ancestor !== currentNode); 6684 } else { 6685 lastKeptComputedStyle = computedStyle; 6686 } 6687 currentNode = getParentNode(currentNode); 6688 } 6689 cache.set(element, result); 6690 return result; 6691 } 6692 function getClippingRect(_ref) { 6693 let { 6694 element, 6695 boundary, 6696 rootBoundary, 6697 strategy 6698 } = _ref; 6699 const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 6700 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 6701 const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy); 6702 let top = firstRect.top; 6703 let right = firstRect.right; 6704 let bottom = firstRect.bottom; 6705 let left = firstRect.left; 6706 for (let i = 1; i < clippingAncestors.length; i++) { 6707 const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy); 6708 top = max(rect.top, top); 6709 right = min(rect.right, right); 6710 bottom = min(rect.bottom, bottom); 6711 left = max(rect.left, left); 6712 } 6713 return { 6714 width: right - left, 6715 height: bottom - top, 6716 x: left, 6717 y: top 6718 }; 6719 } 6720 function getDimensions(element) { 6721 const { 6722 width, 6723 height 6724 } = getCssDimensions(element); 6725 return { 6726 width, 6727 height 6728 }; 6729 } 6730 function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 6731 const isOffsetParentAnElement = isHTMLElement(offsetParent); 6732 const documentElement = getDocumentElement(offsetParent); 6733 const isFixed = strategy === "fixed"; 6734 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 6735 let scroll = { 6736 scrollLeft: 0, 6737 scrollTop: 0 6738 }; 6739 const offsets = createCoords(0); 6740 if (isOffsetParentAnElement || !isFixed) { 6741 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 6742 scroll = getNodeScroll(offsetParent); 6743 } 6744 if (isOffsetParentAnElement) { 6745 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 6746 offsets.x = offsetRect.x + offsetParent.clientLeft; 6747 offsets.y = offsetRect.y + offsetParent.clientTop; 6748 } 6749 } 6750 if (!isOffsetParentAnElement && documentElement) { 6751 offsets.x = getWindowScrollBarX(documentElement); 6752 } 6753 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 6754 const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 6755 const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 6756 return { 6757 x, 6758 y, 6759 width: rect.width, 6760 height: rect.height 6761 }; 6762 } 6763 function isStaticPositioned(element) { 6764 return getComputedStyle2(element).position === "static"; 6765 } 6766 function getTrueOffsetParent(element, polyfill) { 6767 if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") { 6768 return null; 6769 } 6770 if (polyfill) { 6771 return polyfill(element); 6772 } 6773 let rawOffsetParent = element.offsetParent; 6774 if (getDocumentElement(element) === rawOffsetParent) { 6775 rawOffsetParent = rawOffsetParent.ownerDocument.body; 6776 } 6777 return rawOffsetParent; 6778 } 6779 function getOffsetParent(element, polyfill) { 6780 const win = getWindow(element); 6781 if (isTopLayer(element)) { 6782 return win; 6783 } 6784 if (!isHTMLElement(element)) { 6785 let svgOffsetParent = getParentNode(element); 6786 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 6787 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 6788 return svgOffsetParent; 6789 } 6790 svgOffsetParent = getParentNode(svgOffsetParent); 6791 } 6792 return win; 6793 } 6794 let offsetParent = getTrueOffsetParent(element, polyfill); 6795 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 6796 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 6797 } 6798 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 6799 return win; 6800 } 6801 return offsetParent || getContainingBlock(element) || win; 6802 } 6803 var getElementRects = async function(data) { 6804 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 6805 const getDimensionsFn = this.getDimensions; 6806 const floatingDimensions = await getDimensionsFn(data.floating); 6807 return { 6808 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), 6809 floating: { 6810 x: 0, 6811 y: 0, 6812 width: floatingDimensions.width, 6813 height: floatingDimensions.height 6814 } 6815 }; 6816 }; 6817 function isRTL(element) { 6818 return getComputedStyle2(element).direction === "rtl"; 6819 } 6820 var platform2 = { 6821 convertOffsetParentRelativeRectToViewportRelativeRect, 6822 getDocumentElement, 6823 getClippingRect, 6824 getOffsetParent, 6825 getElementRects, 6826 getClientRects, 6827 getDimensions, 6828 getScale, 6829 isElement, 6830 isRTL 6831 }; 6832 function rectsAreEqual(a, b) { 6833 return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; 6834 } 6835 function observeMove(element, onMove, ancestorResize) { 6836 let io = null; 6837 let timeoutId; 6838 const root = getDocumentElement(element); 6839 function cleanup() { 6840 var _io; 6841 clearTimeout(timeoutId); 6842 (_io = io) == null || _io.disconnect(); 6843 io = null; 6844 } 6845 function refresh(skip, threshold) { 6846 if (skip === void 0) { 6847 skip = false; 6848 } 6849 if (threshold === void 0) { 6850 threshold = 1; 6851 } 6852 cleanup(); 6853 const elementRectForRootMargin = element.getBoundingClientRect(); 6854 const { 6855 left, 6856 top, 6857 width, 6858 height 6859 } = elementRectForRootMargin; 6860 if (!skip) { 6861 onMove(); 6862 } 6863 if (!width || !height) { 6864 return; 6865 } 6866 const insetTop = floor(top); 6867 const insetRight = floor(root.clientWidth - (left + width)); 6868 const insetBottom = floor(root.clientHeight - (top + height)); 6869 const insetLeft = floor(left); 6870 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 6871 const options = { 6872 rootMargin, 6873 threshold: max(0, min(1, threshold)) || 1 6874 }; 6875 let isFirstUpdate = true; 6876 function handleObserve(entries) { 6877 const ratio = entries[0].intersectionRatio; 6878 if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 6879 return refresh(); 6880 } 6881 if (ratio !== threshold) { 6882 if (!isFirstUpdate) { 6883 return refresh(); 6884 } 6885 if (!ratio) { 6886 timeoutId = setTimeout(() => { 6887 refresh(false, 1e-7); 6888 }, 1e3); 6889 } else { 6890 refresh(false, ratio); 6891 } 6892 } 6893 isFirstUpdate = false; 6894 } 6895 try { 6896 io = new IntersectionObserver(handleObserve, { 6897 ...options, 6898 // Handle <iframe>s 6899 root: root.ownerDocument 6900 }); 6901 } catch (_e) { 6902 io = new IntersectionObserver(handleObserve, options); 6903 } 6904 io.observe(element); 6905 } 6906 const win = getWindow(element); 6907 const handleResize = () => refresh(ancestorResize); 6908 win.addEventListener("resize", handleResize); 6909 refresh(true); 6910 return () => { 6911 win.removeEventListener("resize", handleResize); 6912 cleanup(); 6913 }; 6914 } 6915 function autoUpdate(reference, floating, update2, options) { 6916 if (options === void 0) { 6917 options = {}; 6918 } 6919 const { 6920 ancestorScroll = true, 6921 ancestorResize = true, 6922 elementResize = typeof ResizeObserver === "function", 6923 layoutShift = typeof IntersectionObserver === "function", 6924 animationFrame = false 6925 } = options; 6926 const referenceEl = unwrapElement(reference); 6927 const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : []; 6928 ancestors.forEach((ancestor) => { 6929 ancestorScroll && ancestor.addEventListener("scroll", update2); 6930 ancestorResize && ancestor.addEventListener("resize", update2); 6931 }); 6932 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2, ancestorResize) : null; 6933 let reobserveFrame = -1; 6934 let resizeObserver = null; 6935 if (elementResize) { 6936 resizeObserver = new ResizeObserver((_ref) => { 6937 let [firstEntry] = _ref; 6938 if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) { 6939 resizeObserver.unobserve(floating); 6940 cancelAnimationFrame(reobserveFrame); 6941 reobserveFrame = requestAnimationFrame(() => { 6942 var _resizeObserver; 6943 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 6944 }); 6945 } 6946 update2(); 6947 }); 6948 if (referenceEl && !animationFrame) { 6949 resizeObserver.observe(referenceEl); 6950 } 6951 if (floating) { 6952 resizeObserver.observe(floating); 6953 } 6954 } 6955 let frameId; 6956 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 6957 if (animationFrame) { 6958 frameLoop(); 6959 } 6960 function frameLoop() { 6961 const nextRefRect = getBoundingClientRect(reference); 6962 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 6963 update2(); 6964 } 6965 prevRefRect = nextRefRect; 6966 frameId = requestAnimationFrame(frameLoop); 6967 } 6968 update2(); 6969 return () => { 6970 var _resizeObserver2; 6971 ancestors.forEach((ancestor) => { 6972 ancestorScroll && ancestor.removeEventListener("scroll", update2); 6973 ancestorResize && ancestor.removeEventListener("resize", update2); 6974 }); 6975 cleanupIo == null || cleanupIo(); 6976 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 6977 resizeObserver = null; 6978 if (animationFrame) { 6979 cancelAnimationFrame(frameId); 6980 } 6981 }; 6982 } 6983 var offset2 = offset; 6984 var shift2 = shift; 6985 var flip2 = flip; 6986 var size2 = size; 6987 var limitShift2 = limitShift; 6988 var computePosition2 = (reference, floating, options) => { 6989 const cache = /* @__PURE__ */ new Map(); 6990 const mergedOptions = options != null ? options : {}; 6991 const platformWithCache = { 6992 ...platform2, 6993 ...mergedOptions.platform, 6994 _c: cache 6995 }; 6996 return computePosition(reference, floating, { 6997 ...mergedOptions, 6998 platform: platformWithCache 6999 }); 7000 }; 7001 7002 // node_modules/.store/@floating-ui/react-dom@2.1.9-AxWcAwqlMfOrAFOinFKSVg/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs 7003 var React32 = __toESM(require_react(), 1); 7004 var import_react2 = __toESM(require_react(), 1); 7005 var ReactDOM5 = __toESM(require_react_dom(), 1); 7006 var isClient = typeof document !== "undefined"; 7007 var noop2 = function noop3() { 7008 }; 7009 var index = isClient ? import_react2.useLayoutEffect : noop2; 7010 function deepEqual(a, b) { 7011 if (a === b) { 7012 return true; 7013 } 7014 if (typeof a !== typeof b) { 7015 return false; 7016 } 7017 if (typeof a === "function" && a.toString() === b.toString()) { 7018 return true; 7019 } 7020 let length; 7021 let i; 7022 let keys; 7023 if (a && b && typeof a === "object") { 7024 if (Array.isArray(a)) { 7025 length = a.length; 7026 if (length !== b.length) return false; 7027 for (i = length; i-- !== 0; ) { 7028 if (!deepEqual(a[i], b[i])) { 7029 return false; 7030 } 7031 } 7032 return true; 7033 } 7034 keys = Object.keys(a); 7035 length = keys.length; 7036 if (length !== Object.keys(b).length) { 7037 return false; 7038 } 7039 for (i = length; i-- !== 0; ) { 7040 if (!{}.hasOwnProperty.call(b, keys[i])) { 7041 return false; 7042 } 7043 } 7044 for (i = length; i-- !== 0; ) { 7045 const key = keys[i]; 7046 if (key === "_owner" && a.$$typeof) { 7047 continue; 7048 } 7049 if (!deepEqual(a[key], b[key])) { 7050 return false; 7051 } 7052 } 7053 return true; 7054 } 7055 return a !== a && b !== b; 7056 } 7057 function getDPR(element) { 7058 if (typeof window === "undefined") { 7059 return 1; 7060 } 7061 const win = element.ownerDocument.defaultView || window; 7062 return win.devicePixelRatio || 1; 7063 } 7064 function roundByDPR(element, value) { 7065 const dpr = getDPR(element); 7066 return Math.round(value * dpr) / dpr; 7067 } 7068 function useLatestRef(value) { 7069 const ref = React32.useRef(value); 7070 index(() => { 7071 ref.current = value; 7072 }); 7073 return ref; 7074 } 7075 function useFloating(options) { 7076 if (options === void 0) { 7077 options = {}; 7078 } 7079 const { 7080 placement = "bottom", 7081 strategy = "absolute", 7082 middleware = [], 7083 platform: platform3, 7084 elements: { 7085 reference: externalReference, 7086 floating: externalFloating 7087 } = {}, 7088 transform = true, 7089 whileElementsMounted, 7090 open: open2 7091 } = options; 7092 const [data, setData] = React32.useState({ 7093 x: 0, 7094 y: 0, 7095 strategy, 7096 placement, 7097 middlewareData: {}, 7098 isPositioned: false 7099 }); 7100 const [latestMiddleware, setLatestMiddleware] = React32.useState(middleware); 7101 if (!deepEqual(latestMiddleware, middleware)) { 7102 setLatestMiddleware(middleware); 7103 } 7104 const [_reference, _setReference] = React32.useState(null); 7105 const [_floating, _setFloating] = React32.useState(null); 7106 const setReference = React32.useCallback((node) => { 7107 if (node !== referenceRef.current) { 7108 referenceRef.current = node; 7109 _setReference(node); 7110 } 7111 }, []); 7112 const setFloating = React32.useCallback((node) => { 7113 if (node !== floatingRef.current) { 7114 floatingRef.current = node; 7115 _setFloating(node); 7116 } 7117 }, []); 7118 const referenceEl = externalReference || _reference; 7119 const floatingEl = externalFloating || _floating; 7120 const referenceRef = React32.useRef(null); 7121 const floatingRef = React32.useRef(null); 7122 const dataRef = React32.useRef(data); 7123 const hasWhileElementsMounted = whileElementsMounted != null; 7124 const whileElementsMountedRef = useLatestRef(whileElementsMounted); 7125 const platformRef = useLatestRef(platform3); 7126 const openRef = useLatestRef(open2); 7127 const update2 = React32.useCallback(() => { 7128 if (!referenceRef.current || !floatingRef.current) { 7129 return; 7130 } 7131 const config = { 7132 placement, 7133 strategy, 7134 middleware: latestMiddleware 7135 }; 7136 if (platformRef.current) { 7137 config.platform = platformRef.current; 7138 } 7139 computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => { 7140 const fullData = { 7141 ...data2, 7142 // The floating element's position may be recomputed while it's closed 7143 // but still mounted (such as when transitioning out). To ensure 7144 // `isPositioned` will be `false` initially on the next open, avoid 7145 // setting it to `true` when `open === false` (must be specified). 7146 isPositioned: openRef.current !== false 7147 }; 7148 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { 7149 dataRef.current = fullData; 7150 ReactDOM5.flushSync(() => { 7151 setData(fullData); 7152 }); 7153 } 7154 }); 7155 }, [latestMiddleware, placement, strategy, platformRef, openRef]); 7156 index(() => { 7157 if (open2 === false && dataRef.current.isPositioned) { 7158 dataRef.current.isPositioned = false; 7159 setData((data2) => ({ 7160 ...data2, 7161 isPositioned: false 7162 })); 7163 } 7164 }, [open2]); 7165 const isMountedRef = React32.useRef(false); 7166 index(() => { 7167 isMountedRef.current = true; 7168 return () => { 7169 isMountedRef.current = false; 7170 }; 7171 }, []); 7172 index(() => { 7173 if (referenceEl) referenceRef.current = referenceEl; 7174 if (floatingEl) floatingRef.current = floatingEl; 7175 if (referenceEl && floatingEl) { 7176 if (whileElementsMountedRef.current) { 7177 return whileElementsMountedRef.current(referenceEl, floatingEl, update2); 7178 } 7179 update2(); 7180 } 7181 }, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]); 7182 const refs = React32.useMemo(() => ({ 7183 reference: referenceRef, 7184 floating: floatingRef, 7185 setReference, 7186 setFloating 7187 }), [setReference, setFloating]); 7188 const elements = React32.useMemo(() => ({ 7189 reference: referenceEl, 7190 floating: floatingEl 7191 }), [referenceEl, floatingEl]); 7192 const floatingStyles = React32.useMemo(() => { 7193 const initialStyles = { 7194 position: strategy, 7195 left: 0, 7196 top: 0 7197 }; 7198 if (!elements.floating) { 7199 return initialStyles; 7200 } 7201 const x = roundByDPR(elements.floating, data.x); 7202 const y = roundByDPR(elements.floating, data.y); 7203 if (transform) { 7204 return { 7205 ...initialStyles, 7206 transform: "translate(" + x + "px, " + y + "px)", 7207 ...getDPR(elements.floating) >= 1.5 && { 7208 willChange: "transform" 7209 } 7210 }; 7211 } 7212 return { 7213 position: strategy, 7214 left: x, 7215 top: y 7216 }; 7217 }, [strategy, transform, elements.floating, data.x, data.y]); 7218 return React32.useMemo(() => ({ 7219 ...data, 7220 update: update2, 7221 refs, 7222 elements, 7223 floatingStyles 7224 }), [data, update2, refs, elements, floatingStyles]); 7225 } 7226 var offset3 = (options, deps) => { 7227 const result = offset2(options); 7228 return { 7229 name: result.name, 7230 fn: result.fn, 7231 options: [options, deps] 7232 }; 7233 }; 7234 var shift3 = (options, deps) => { 7235 const result = shift2(options); 7236 return { 7237 name: result.name, 7238 fn: result.fn, 7239 options: [options, deps] 7240 }; 7241 }; 7242 var limitShift3 = (options, deps) => { 7243 const result = limitShift2(options); 7244 return { 7245 fn: result.fn, 7246 options: [options, deps] 7247 }; 7248 }; 7249 var flip3 = (options, deps) => { 7250 const result = flip2(options); 7251 return { 7252 name: result.name, 7253 fn: result.fn, 7254 options: [options, deps] 7255 }; 7256 }; 7257 var size3 = (options, deps) => { 7258 const result = size2(options); 7259 return { 7260 name: result.name, 7261 fn: result.fn, 7262 options: [options, deps] 7263 }; 7264 }; 7265 7266 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/NullStore.mjs 7267 var NullStore = class extends ReactStore { 7268 // `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding 7269 // `setState` alone would neutralize them today. They are overridden explicitly so the store stays 7270 // inert even if a future base-class change stops routing a mutator through `setState`. 7271 setState(_newState) { 7272 } 7273 update(_changes) { 7274 } 7275 set(_key, _value) { 7276 } 7277 notifyAll() { 7278 } 7279 }; 7280 7281 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/inertValue.mjs 7282 function inertValue(value) { 7283 if (isReactVersionAtLeast(19)) { 7284 return value; 7285 } 7286 return value ? "true" : void 0; 7287 } 7288 7289 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs 7290 var React33 = __toESM(require_react(), 1); 7291 var DirectionContext = /* @__PURE__ */ React33.createContext(void 0); 7292 if (true) DirectionContext.displayName = "DirectionContext"; 7293 function useDirection() { 7294 const context = React33.useContext(DirectionContext); 7295 return context?.direction ?? "ltr"; 7296 } 7297 7298 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs 7299 var React35 = __toESM(require_react(), 1); 7300 7301 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs 7302 var React34 = __toESM(require_react(), 1); 7303 function useBaseUIFloating(options) { 7304 const { 7305 nodeId, 7306 externalTree, 7307 rootContext: store 7308 } = options; 7309 const referenceElement = store.useState("referenceElement"); 7310 const floatingElement = store.useState("floatingElement"); 7311 const domReferenceElement = store.useState("domReferenceElement"); 7312 const open2 = store.useState("open"); 7313 const floatingId = store.useState("floatingId"); 7314 const [positionReference, setPositionReferenceRaw] = React34.useState(null); 7315 const domReferenceRef = React34.useRef(null); 7316 const tree = useFloatingTree(externalTree); 7317 const storeElements = React34.useMemo(() => ({ 7318 reference: referenceElement, 7319 floating: floatingElement, 7320 domReference: domReferenceElement 7321 }), [referenceElement, floatingElement, domReferenceElement]); 7322 const position = useFloating({ 7323 ...options, 7324 elements: { 7325 ...storeElements, 7326 ...positionReference && { 7327 reference: positionReference 7328 } 7329 } 7330 }); 7331 const setPositionReference = React34.useCallback((node) => { 7332 const computedPositionReference = isElement(node) ? { 7333 getBoundingClientRect: () => node.getBoundingClientRect(), 7334 getClientRects: () => node.getClientRects(), 7335 contextElement: node 7336 } : node; 7337 setPositionReferenceRaw(computedPositionReference); 7338 position.refs.setReference(computedPositionReference); 7339 }, [position.refs]); 7340 const refs = React34.useMemo(() => ({ 7341 ...position.refs, 7342 setPositionReference, 7343 domReference: domReferenceRef 7344 }), [position.refs, setPositionReference]); 7345 const elements = React34.useMemo(() => ({ 7346 ...position.elements, 7347 domReference: domReferenceElement 7348 }), [position.elements, domReferenceElement]); 7349 const context = React34.useMemo(() => ({ 7350 ...position, 7351 dataRef: store.context.dataRef, 7352 open: open2, 7353 onOpenChange: store.setOpen, 7354 events: store.context.events, 7355 floatingId, 7356 refs, 7357 elements, 7358 nodeId, 7359 rootStore: store 7360 }), [position, refs, elements, nodeId, store, open2, floatingId]); 7361 useIsoLayoutEffect(() => { 7362 if (domReferenceElement) { 7363 domReferenceRef.current = domReferenceElement; 7364 } 7365 }, [domReferenceElement]); 7366 useIsoLayoutEffect(() => { 7367 store.context.dataRef.current.floatingContext = context; 7368 const node = tree?.nodesRef.current.find((n) => n.id === nodeId); 7369 if (node) { 7370 node.context = context; 7371 } 7372 }); 7373 return React34.useMemo(() => ({ 7374 ...position, 7375 context, 7376 refs, 7377 elements, 7378 rootStore: store 7379 }), [position, refs, elements, context, store]); 7380 } 7381 7382 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/middleware/arrow.mjs 7383 var baseArrow = (options) => ({ 7384 name: "arrow", 7385 options, 7386 async fn(state) { 7387 const { 7388 x, 7389 y, 7390 placement, 7391 rects, 7392 platform: platform3, 7393 elements, 7394 middlewareData 7395 } = state; 7396 const { 7397 element, 7398 padding = 0 7399 } = evaluate(options, state) || {}; 7400 if (element == null) { 7401 return {}; 7402 } 7403 const paddingObject = getPaddingObject(padding); 7404 const coords = { 7405 x, 7406 y 7407 }; 7408 const axis = getAlignmentAxis(placement); 7409 const length = getAxisLength(axis); 7410 const arrowDimensions = await platform3.getDimensions(element); 7411 const isYAxis = axis === "y"; 7412 const minProp = isYAxis ? "top" : "left"; 7413 const maxProp = isYAxis ? "bottom" : "right"; 7414 const clientProp = isYAxis ? "clientHeight" : "clientWidth"; 7415 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; 7416 const startDiff = coords[axis] - rects.reference[axis]; 7417 const clientSize = elements.floating[clientProp] || rects.floating[length]; 7418 const centerToReference = endDiff / 2 - startDiff / 2; 7419 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; 7420 const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding); 7421 const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding); 7422 const min2 = minPadding; 7423 const max2 = clientSize - arrowDimensions[length] - maxPadding; 7424 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; 7425 const offset4 = clamp(min2, center, max2); 7426 const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; 7427 const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0; 7428 return { 7429 [axis]: coords[axis] + alignmentOffset, 7430 data: { 7431 [axis]: offset4, 7432 centerOffset: center - offset4 - alignmentOffset, 7433 ...shouldAddOffset && { 7434 alignmentOffset 7435 } 7436 }, 7437 reset: shouldAddOffset 7438 }; 7439 } 7440 }); 7441 var arrow4 = (options, deps) => { 7442 const { 7443 name, 7444 fn 7445 } = baseArrow(options); 7446 return { 7447 name, 7448 fn, 7449 options: [options, deps] 7450 }; 7451 }; 7452 7453 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/hideMiddleware.mjs 7454 var hide4 = { 7455 name: "hide", 7456 async fn(state) { 7457 const { 7458 width, 7459 height, 7460 x, 7461 y 7462 } = state.rects.reference; 7463 const anchorHidden2 = width === 0 && height === 0 && x === 0 && y === 0; 7464 const overflow = await state.platform.detectOverflow(state, { 7465 elementContext: "reference" 7466 }); 7467 const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0; 7468 return { 7469 data: { 7470 referenceHidden: referenceHidden || anchorHidden2 7471 } 7472 }; 7473 } 7474 }; 7475 7476 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/adaptiveOriginConstants.mjs 7477 var DEFAULT_SIDES = { 7478 sideX: "left", 7479 sideY: "top" 7480 }; 7481 7482 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonPositionerCssVars.mjs 7483 var availableWidth = "--available-width"; 7484 var availableHeight = "--available-height"; 7485 var anchorWidth = "--anchor-width"; 7486 var anchorHeight = "--anchor-height"; 7487 var transformOrigin = "--transform-origin"; 7488 var positionerWidth = "--positioner-width"; 7489 var positionerHeight = "--positioner-height"; 7490 7491 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs 7492 var AVAILABLE_WIDTH_VAR = availableWidth; 7493 var AVAILABLE_HEIGHT_VAR = availableHeight; 7494 function getLogicalSide(sideParam, renderedSide, isRtl) { 7495 const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end"; 7496 const logicalRight = isRtl ? "inline-start" : "inline-end"; 7497 const logicalLeft = isRtl ? "inline-end" : "inline-start"; 7498 return { 7499 top: "top", 7500 right: isLogicalSideParam ? logicalRight : "right", 7501 bottom: "bottom", 7502 left: isLogicalSideParam ? logicalLeft : "left" 7503 }[renderedSide]; 7504 } 7505 function getOffsetData(state, sideParam, isRtl) { 7506 const { 7507 rects, 7508 placement 7509 } = state; 7510 const data = { 7511 side: getLogicalSide(sideParam, getSide(placement), isRtl), 7512 align: getAlignment(placement) || "center", 7513 anchor: { 7514 width: rects.reference.width, 7515 height: rects.reference.height 7516 }, 7517 positioner: { 7518 width: rects.floating.width, 7519 height: rects.floating.height 7520 } 7521 }; 7522 return data; 7523 } 7524 function useAnchorPositioning(params) { 7525 return useAnchorPositioningWithHook(params, useBaseUIFloating); 7526 } 7527 function useAnchorPositioningWithHook(params, useFloatingHook) { 7528 const { 7529 // Public parameters 7530 anchor, 7531 positionMethod = "absolute", 7532 side: sideParam = "bottom", 7533 sideOffset = 0, 7534 align = "center", 7535 alignOffset = 0, 7536 collisionBoundary, 7537 collisionPadding: collisionPaddingParam = 5, 7538 sticky = false, 7539 arrowPadding = 5, 7540 disableAnchorTracking = false, 7541 inline: inlineMiddleware, 7542 // Private parameters 7543 keepMounted = false, 7544 floatingRootContext, 7545 mounted, 7546 collisionAvoidance, 7547 shift: shift4, 7548 nodeId, 7549 adaptiveOrigin: adaptiveOrigin2, 7550 lazyFlip = false, 7551 externalTree 7552 } = params; 7553 const collisionAvoidanceSide = collisionAvoidance.side || "flip"; 7554 const collisionAvoidanceAlign = collisionAvoidance.align || "flip"; 7555 const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end"; 7556 const shiftCrossAxis = shift4?.crossAxis ?? false; 7557 const shiftRootBoundary = shift4?.rootBoundary; 7558 const anchorFn = typeof anchor === "function" ? anchor : void 0; 7559 const anchorFnCallback = useStableCallback(anchorFn); 7560 const anchorDep = anchorFn ? anchorFnCallback : anchor; 7561 const anchorValueRef = useValueAsRef(anchor); 7562 const mountedRef = useValueAsRef(mounted); 7563 const direction = useDirection(); 7564 const isRtl = direction === "rtl"; 7565 const [mountPlacement, setMountPlacement] = React35.useState(null); 7566 if (!mounted && mountPlacement !== null) { 7567 setMountPlacement(null); 7568 } 7569 const lockAlign = lazyFlip === "placement"; 7570 const mountSide = mountPlacement ? getSide(mountPlacement) : null; 7571 const mountAlign = mountPlacement && lockAlign ? getAlignment(mountPlacement) || "center" : null; 7572 const side = mountSide || { 7573 top: "top", 7574 right: "right", 7575 bottom: "bottom", 7576 left: "left", 7577 "inline-end": isRtl ? "left" : "right", 7578 "inline-start": isRtl ? "right" : "left" 7579 }[sideParam]; 7580 const placementAlign = mountAlign || align; 7581 const placement = placementAlign === "center" ? side : `$side}-$placementAlign}`; 7582 let collisionPadding = collisionPaddingParam; 7583 if (typeof collisionPadding === "number") { 7584 collisionPadding = { 7585 top: collisionPadding, 7586 right: collisionPadding, 7587 bottom: collisionPadding, 7588 left: collisionPadding 7589 }; 7590 } else if (collisionPadding) { 7591 collisionPadding = { 7592 top: collisionPadding.top || 0, 7593 right: collisionPadding.right || 0, 7594 bottom: collisionPadding.bottom || 0, 7595 left: collisionPadding.left || 0 7596 }; 7597 } 7598 const bias = 1; 7599 const biasTop = sideParam === "bottom" ? bias : 0; 7600 const biasBottom = sideParam === "top" ? bias : 0; 7601 const biasLeft = sideParam === "right" ? bias : 0; 7602 const biasRight = sideParam === "left" ? bias : 0; 7603 const commonCollisionProps = { 7604 boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary, 7605 padding: collisionPadding 7606 }; 7607 const arrowRef = React35.useRef(null); 7608 const sideOffsetRef = useValueAsRef(sideOffset); 7609 const alignOffsetRef = useValueAsRef(alignOffset); 7610 const sideOffsetDep = typeof sideOffset !== "function" ? sideOffset : 0; 7611 const alignOffsetDep = typeof alignOffset !== "function" ? alignOffset : 0; 7612 const middleware = []; 7613 if (inlineMiddleware) { 7614 middleware.push(inlineMiddleware); 7615 } 7616 middleware.push(offset3((state) => { 7617 const data = getOffsetData(state, sideParam, isRtl); 7618 const sideAxis = typeof sideOffsetRef.current === "function" ? sideOffsetRef.current(data) : sideOffsetRef.current; 7619 const alignAxis = typeof alignOffsetRef.current === "function" ? alignOffsetRef.current(data) : alignOffsetRef.current; 7620 return { 7621 mainAxis: sideAxis, 7622 crossAxis: alignAxis, 7623 alignmentAxis: alignAxis 7624 }; 7625 }, [sideOffsetDep, alignOffsetDep, isRtl, sideParam])); 7626 const shiftDisabled = collisionAvoidanceAlign === "none" && collisionAvoidanceSide !== "shift"; 7627 const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === "shift"); 7628 const flipMiddleware = collisionAvoidanceSide === "none" ? null : flip3({ 7629 ...commonCollisionProps, 7630 // Ensure the popup flips if it's been limited by its --available-height and it resizes. 7631 // Since the size() padding is smaller than the flip() padding, flip() will take precedence. 7632 padding: { 7633 top: collisionPadding.top + bias + biasTop, 7634 right: collisionPadding.right + bias + biasRight, 7635 bottom: collisionPadding.bottom + bias + biasBottom, 7636 left: collisionPadding.left + bias + biasLeft 7637 }, 7638 mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip", 7639 crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false, 7640 fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide 7641 }); 7642 const shiftMiddleware = shiftDisabled ? null : shift3({ 7643 ...commonCollisionProps, 7644 // Use the Layout Viewport to avoid shifting around when pinch-zooming. 7645 rootBoundary: shiftRootBoundary, 7646 mainAxis: collisionAvoidanceAlign !== "none", 7647 crossAxis: crossAxisShiftEnabled, 7648 limiter: sticky || shiftCrossAxis ? void 0 : limitShift3((limitData) => { 7649 if (!arrowRef.current) { 7650 return {}; 7651 } 7652 const { 7653 width, 7654 height 7655 } = arrowRef.current.getBoundingClientRect(); 7656 const sideAxis = getSideAxis(getSide(limitData.placement)); 7657 const arrowSize = sideAxis === "y" ? width : height; 7658 const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom; 7659 return { 7660 offset: arrowSize / 2 + offsetAmount / 2 7661 }; 7662 }) 7663 }, [commonCollisionProps, sticky, shiftCrossAxis, shiftRootBoundary, collisionPadding, collisionAvoidanceAlign]); 7664 if (collisionAvoidanceSide === "shift" || collisionAvoidanceAlign === "shift" || placementAlign === "center") { 7665 middleware.push(shiftMiddleware, flipMiddleware); 7666 } else { 7667 middleware.push(flipMiddleware, shiftMiddleware); 7668 } 7669 middleware.push(size3({ 7670 ...commonCollisionProps, 7671 apply({ 7672 elements: { 7673 floating 7674 }, 7675 availableWidth: availableWidth2, 7676 availableHeight: availableHeight2, 7677 rects 7678 }) { 7679 if (!mountedRef.current) { 7680 return; 7681 } 7682 const floatingStyle = floating.style; 7683 floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `$availableWidth2}px`); 7684 floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `$availableHeight2}px`); 7685 const dpr = getWindow(floating).devicePixelRatio || 1; 7686 const { 7687 x: x2, 7688 y: y2, 7689 width, 7690 height 7691 } = rects.reference; 7692 const anchorWidth2 = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr; 7693 const anchorHeight2 = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr; 7694 floatingStyle.setProperty(anchorWidth, `$anchorWidth2}px`); 7695 floatingStyle.setProperty(anchorHeight, `$anchorHeight2}px`); 7696 } 7697 }), arrow4((state) => ({ 7698 // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set, 7699 // we'll create a fake element. 7700 element: arrowRef.current || ownerDocument(state.elements.floating).createElement("div"), 7701 // No padding for the fake arrow: it would displace aligned popups on narrow anchors. 7702 padding: arrowRef.current ? arrowPadding : 0 7703 }), [arrowPadding]), { 7704 name: "transformOrigin", 7705 fn(state) { 7706 const { 7707 elements: { 7708 floating 7709 }, 7710 middlewareData: middlewareData2, 7711 placement: renderedPlacement2, 7712 platform: platform3, 7713 rects, 7714 y: y2 7715 } = state; 7716 const renderedSide2 = getSide(renderedPlacement2); 7717 const renderedAlign2 = getAlignment(renderedPlacement2); 7718 const isVertical = getSideAxis(renderedSide2) === "y"; 7719 const arrowEl = arrowRef.current; 7720 const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset; 7721 let crossOrigin; 7722 if (!arrowEl && renderedAlign2 && Math.abs(isVertical ? middlewareData2.shift?.x || 0 : middlewareData2.shift?.y || 0) <= 1) { 7723 crossOrigin = renderedAlign2 === "start" === (isVertical && platform3.isRTL?.(floating) === true) ? "100%" : "0%"; 7724 } else { 7725 const arrowOffset = isVertical ? middlewareData2.arrow?.x || 0 : middlewareData2.arrow?.y || 0; 7726 const arrowSize = isVertical ? arrowEl?.clientWidth || 0 : arrowEl?.clientHeight || 0; 7727 crossOrigin = `$arrowOffset + arrowSize / 2}px`; 7728 } 7729 let sideOrigin = renderedSide2 === "top" || renderedSide2 === "left" ? `calc(100% + $sideOffsetValue}px)` : `${-sideOffsetValue}px`; 7730 if (crossAxisShiftEnabled && isVertical && Math.abs(middlewareData2.shift?.y || 0) > sideOffsetValue) { 7731 sideOrigin = `$rects.reference.y + rects.reference.height / 2 - y2}px`; 7732 } 7733 floating.style.setProperty(transformOrigin, isVertical ? `$crossOrigin} $sideOrigin}` : `$sideOrigin} $crossOrigin}`); 7734 return {}; 7735 } 7736 }, hide4, adaptiveOrigin2); 7737 useIsoLayoutEffect(() => { 7738 if (!mounted && floatingRootContext) { 7739 floatingRootContext.update({ 7740 referenceElement: null, 7741 floatingElement: null, 7742 domReferenceElement: null, 7743 positionReference: null 7744 }); 7745 } 7746 }, [mounted, floatingRootContext]); 7747 const autoUpdateOptions = React35.useMemo(() => ({ 7748 ancestorScroll: !disableAnchorTracking, 7749 elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined", 7750 layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined" 7751 }), [disableAnchorTracking]); 7752 const { 7753 refs, 7754 elements, 7755 x, 7756 y, 7757 middlewareData, 7758 update: update2, 7759 placement: renderedPlacement, 7760 context, 7761 isPositioned, 7762 floatingStyles: originalFloatingStyles 7763 } = useFloatingHook({ 7764 rootContext: floatingRootContext, 7765 open: keepMounted ? mounted : void 0, 7766 placement, 7767 middleware, 7768 strategy: positionMethod, 7769 whileElementsMounted: keepMounted ? void 0 : (...args) => autoUpdate(...args, autoUpdateOptions), 7770 nodeId, 7771 externalTree 7772 }); 7773 const { 7774 sideX, 7775 sideY 7776 } = middlewareData.adaptiveOrigin || DEFAULT_SIDES; 7777 const resolvedPosition = isPositioned ? positionMethod : "fixed"; 7778 const floatingStyles = React35.useMemo(() => { 7779 let base; 7780 if (!isPositioned) { 7781 base = { 7782 position: resolvedPosition, 7783 top: 0, 7784 left: 0 7785 }; 7786 } else if (adaptiveOrigin2) { 7787 base = { 7788 position: resolvedPosition, 7789 [sideX]: x, 7790 [sideY]: y 7791 }; 7792 } else { 7793 base = { 7794 ...originalFloatingStyles, 7795 position: resolvedPosition 7796 }; 7797 } 7798 base[AVAILABLE_WIDTH_VAR] = "100vw"; 7799 base[AVAILABLE_HEIGHT_VAR] = "100vh"; 7800 if (!isPositioned) { 7801 base.opacity = 0; 7802 } 7803 return base; 7804 }, [adaptiveOrigin2, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]); 7805 const registeredPositionReferenceRef = React35.useRef(null); 7806 useIsoLayoutEffect(() => { 7807 if (!mounted) { 7808 return; 7809 } 7810 const anchorValue = anchorValueRef.current; 7811 const resolvedAnchor = typeof anchorValue === "function" ? anchorValue() : anchorValue; 7812 const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null; 7813 const finalAnchor = unwrappedElement || null; 7814 if (finalAnchor !== registeredPositionReferenceRef.current) { 7815 refs.setPositionReference(finalAnchor); 7816 registeredPositionReferenceRef.current = finalAnchor; 7817 } 7818 }, [mounted, refs, anchorDep, anchorValueRef]); 7819 React35.useEffect(() => { 7820 if (!mounted) { 7821 return; 7822 } 7823 const anchorValue = anchorValueRef.current; 7824 if (typeof anchorValue === "function") { 7825 return; 7826 } 7827 if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) { 7828 refs.setPositionReference(anchorValue.current); 7829 registeredPositionReferenceRef.current = anchorValue.current; 7830 } 7831 }, [mounted, refs, anchorDep, anchorValueRef]); 7832 React35.useEffect(() => { 7833 if (keepMounted && mounted && elements.reference && elements.floating) { 7834 return autoUpdate(elements.reference, elements.floating, update2, autoUpdateOptions); 7835 } 7836 return void 0; 7837 }, [keepMounted, mounted, elements, update2, autoUpdateOptions]); 7838 const renderedSide = getSide(renderedPlacement); 7839 const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl); 7840 const renderedAlign = getAlignment(renderedPlacement) || "center"; 7841 const anchorHidden2 = Boolean(middlewareData.hide?.referenceHidden); 7842 useIsoLayoutEffect(() => { 7843 if (lazyFlip && mounted && isPositioned && (renderedSide !== side || lockAlign && renderedAlign !== placementAlign)) { 7844 setMountPlacement(renderedPlacement); 7845 } 7846 }, [lazyFlip, lockAlign, mounted, isPositioned, renderedPlacement, renderedSide, renderedAlign, side, placementAlign]); 7847 const arrowStyles = React35.useMemo(() => ({ 7848 position: "absolute", 7849 top: middlewareData.arrow?.y, 7850 left: middlewareData.arrow?.x 7851 }), [middlewareData.arrow]); 7852 const arrowUncentered = middlewareData.arrow?.centerOffset !== 0; 7853 return React35.useMemo(() => ({ 7854 positionerStyles: floatingStyles, 7855 arrowStyles, 7856 arrowRef, 7857 arrowUncentered, 7858 side: logicalRenderedSide, 7859 align: renderedAlign, 7860 physicalSide: renderedSide, 7861 anchorHidden: anchorHidden2, 7862 refs, 7863 context, 7864 isPositioned, 7865 update: update2 7866 }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden2, refs, context, isPositioned, update2]); 7867 } 7868 function isRef(param) { 7869 return param != null && "current" in param; 7870 } 7871 7872 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/getDisabledMountTransitionStyles.mjs 7873 function getDisabledMountTransitionStyles(transitionStatus) { 7874 return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT; 7875 } 7876 7877 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePositioner.mjs 7878 function usePositioner(componentProps, state, { 7879 styles, 7880 transitionStatus, 7881 props, 7882 refs, 7883 hidden, 7884 inert = false 7885 }) { 7886 const style = { 7887 ...styles 7888 }; 7889 if (inert) { 7890 style.pointerEvents = "none"; 7891 } 7892 return useRenderElement("div", componentProps, { 7893 state, 7894 ref: refs, 7895 props: [{ 7896 role: "presentation", 7897 hidden, 7898 style 7899 }, getDisabledMountTransitionStyles(transitionStatus), props], 7900 stateAttributesMapping: popupStateMapping 7901 }); 7902 } 7903 7904 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePopupViewport.mjs 7905 var React39 = __toESM(require_react(), 1); 7906 var ReactDOM6 = __toESM(require_react_dom(), 1); 7907 7908 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/usePreviousValue.mjs 7909 var React36 = __toESM(require_react(), 1); 7910 function usePreviousValue(value) { 7911 const [state, setState] = React36.useState({ 7912 current: value, 7913 previous: null 7914 }); 7915 if (!Object.is(value, state.current)) { 7916 setState({ 7917 current: value, 7918 previous: state.current 7919 }); 7920 } 7921 return state.previous; 7922 } 7923 7924 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePopupAutoResize.mjs 7925 var React37 = __toESM(require_react(), 1); 7926 7927 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/getCssDimensions.mjs 7928 function getCssDimensions2(element) { 7929 const css = getComputedStyle2(element); 7930 let width = parseFloat(css.width) || 0; 7931 let height = parseFloat(css.height) || 0; 7932 const hasOffset = isHTMLElement(element); 7933 const offsetWidth = hasOffset ? element.offsetWidth : width; 7934 const offsetHeight = hasOffset ? element.offsetHeight : height; 7935 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 7936 if (shouldFallback) { 7937 width = offsetWidth; 7938 height = offsetHeight; 7939 } 7940 return { 7941 width, 7942 height 7943 }; 7944 } 7945 7946 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonPopupCssVars.mjs 7947 var popupWidth = "--popup-width"; 7948 var popupHeight = "--popup-height"; 7949 7950 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePopupAutoResize.mjs 7951 function usePopupAutoResize(parameters) { 7952 const { 7953 popupElement, 7954 positionerElement, 7955 content, 7956 mounted, 7957 onMeasureLayout: onMeasureLayoutParam, 7958 onMeasureLayoutComplete: onMeasureLayoutCompleteParam, 7959 side, 7960 direction 7961 } = parameters; 7962 const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true); 7963 const animationFrame = useAnimationFrame(); 7964 const committedDimensionsRef = React37.useRef(null); 7965 const onMeasureLayout = useStableCallback(onMeasureLayoutParam); 7966 const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam); 7967 const anchoringStyles = React37.useMemo(() => getPopupAnchoringStyles(side, direction), [side, direction]); 7968 useIsoLayoutEffect(() => { 7969 if (!mounted) { 7970 committedDimensionsRef.current = null; 7971 return void 0; 7972 } 7973 if (!popupElement || !positionerElement) { 7974 return void 0; 7975 } 7976 const restoreAnchoringStyles = applyElementStyles(popupElement, anchoringStyles); 7977 setPopupCssSize(popupElement, "auto"); 7978 const restorePopupPosition = overrideElementStyle(popupElement, "position", "static"); 7979 const restorePopupTransform = overrideElementStyle(popupElement, "transform", "none"); 7980 const restorePopupScale = overrideElementStyle(popupElement, "scale", "1"); 7981 const restorePositionerAvailableSize = applyElementStyles(positionerElement, { 7982 [availableWidth]: "max-content", 7983 [availableHeight]: "max-content" 7984 }); 7985 function restoreMeasurementOverrides() { 7986 restorePopupPosition(); 7987 restorePopupTransform(); 7988 restorePositionerAvailableSize(); 7989 restorePopupScale(); 7990 } 7991 onMeasureLayout?.(); 7992 if (committedDimensionsRef.current === null) { 7993 setPositionerCssSize(positionerElement, "max-content"); 7994 const dimensions = getCssDimensions2(popupElement); 7995 committedDimensionsRef.current = dimensions; 7996 setPositionerCssSize(positionerElement, dimensions); 7997 restoreMeasurementOverrides(); 7998 onMeasureLayoutComplete?.(null, dimensions); 7999 return restoreAnchoringStyles; 8000 } 8001 setPositionerCssSize(positionerElement, "max-content"); 8002 const previousDimensions = committedDimensionsRef.current; 8003 const newDimensions = getCssDimensions2(popupElement); 8004 committedDimensionsRef.current = newDimensions; 8005 setPopupCssSize(popupElement, previousDimensions); 8006 restoreMeasurementOverrides(); 8007 onMeasureLayoutComplete?.(previousDimensions, newDimensions); 8008 setPositionerCssSize(positionerElement, newDimensions); 8009 const abortController = new AbortController(); 8010 animationFrame.request(() => { 8011 setPopupCssSize(popupElement, newDimensions); 8012 runOnceAnimationsFinish(() => { 8013 popupElement.style.setProperty(popupWidth, "auto"); 8014 popupElement.style.setProperty(popupHeight, "auto"); 8015 }, abortController.signal); 8016 }); 8017 return () => { 8018 abortController.abort(); 8019 animationFrame.cancel(); 8020 restoreAnchoringStyles(); 8021 }; 8022 }, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]); 8023 } 8024 function getPopupAnchoringStyles(side, direction) { 8025 const isPhysicalTop = side === "top"; 8026 const isPhysicalLeft = side === "left" || side === (direction === "rtl" ? "inline-end" : "inline-start"); 8027 if (!isPhysicalTop && !isPhysicalLeft) { 8028 return EMPTY_OBJECT; 8029 } 8030 return { 8031 position: "absolute", 8032 [isPhysicalTop ? "bottom" : "top"]: "0", 8033 [isPhysicalLeft ? "right" : "left"]: "0" 8034 }; 8035 } 8036 function overrideElementStyle(element, property, value) { 8037 const originalValue = element.style.getPropertyValue(property); 8038 element.style.setProperty(property, value); 8039 return () => { 8040 element.style.setProperty(property, originalValue); 8041 }; 8042 } 8043 function applyElementStyles(element, styles) { 8044 const restorers = []; 8045 for (const [key, value] of Object.entries(styles)) { 8046 restorers.push(overrideElementStyle(element, key, value)); 8047 } 8048 return restorers.length ? () => { 8049 restorers.forEach((restore) => restore()); 8050 } : NOOP; 8051 } 8052 function setPopupCssSize(popupElement, size4) { 8053 const width = size4 === "auto" ? "auto" : `$size4.width}px`; 8054 const height = size4 === "auto" ? "auto" : `$size4.height}px`; 8055 popupElement.style.setProperty(popupWidth, width); 8056 popupElement.style.setProperty(popupHeight, height); 8057 } 8058 function setPositionerCssSize(positionerElement, size4) { 8059 const width = size4 === "max-content" ? "max-content" : `$size4.width}px`; 8060 const height = size4 === "max-content" ? "max-content" : `$size4.height}px`; 8061 positionerElement.style.setProperty(positionerWidth, width); 8062 positionerElement.style.setProperty(positionerHeight, height); 8063 } 8064 8065 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs 8066 var React38 = __toESM(require_react(), 1); 8067 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); 8068 var DirectionProvider = function DirectionProvider2(props) { 8069 const { 8070 direction = "ltr" 8071 } = props; 8072 const contextValue = React38.useMemo(() => ({ 8073 direction 8074 }), [direction]); 8075 return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DirectionContext.Provider, { 8076 value: contextValue, 8077 children: props.children 8078 }); 8079 }; 8080 if (true) DirectionProvider.displayName = "DirectionProvider"; 8081 8082 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/adaptiveOriginMiddleware.mjs 8083 var adaptiveOrigin = { 8084 name: "adaptiveOrigin", 8085 async fn(state) { 8086 const { 8087 x: rawX, 8088 y: rawY, 8089 rects: { 8090 floating: floatRect 8091 }, 8092 elements: { 8093 floating 8094 }, 8095 platform: platform3, 8096 strategy, 8097 placement 8098 } = state; 8099 const win = getWindow(floating); 8100 const styles = win.getComputedStyle(floating); 8101 const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== ""; 8102 if (!hasTransition) { 8103 return { 8104 x: rawX, 8105 y: rawY, 8106 data: DEFAULT_SIDES 8107 }; 8108 } 8109 const offsetParent = await platform3.getOffsetParent?.(floating); 8110 let offsetDimensions = { 8111 width: 0, 8112 height: 0 8113 }; 8114 if (strategy === "fixed" && win?.visualViewport) { 8115 offsetDimensions = { 8116 width: win.visualViewport.width, 8117 height: win.visualViewport.height 8118 }; 8119 } else if (offsetParent === win) { 8120 const doc = ownerDocument(floating); 8121 offsetDimensions = { 8122 width: doc.documentElement.clientWidth, 8123 height: doc.documentElement.clientHeight 8124 }; 8125 } else if (await platform3.isElement?.(offsetParent)) { 8126 offsetDimensions = await platform3.getDimensions(offsetParent); 8127 } 8128 const currentSide = getSide(placement); 8129 let x = rawX; 8130 let y = rawY; 8131 if (currentSide === "left") { 8132 x = offsetDimensions.width - (rawX + floatRect.width); 8133 } 8134 if (currentSide === "top") { 8135 y = offsetDimensions.height - (rawY + floatRect.height); 8136 } 8137 const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX; 8138 const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY; 8139 return { 8140 x, 8141 y, 8142 data: { 8143 sideX, 8144 sideY 8145 } 8146 }; 8147 } 8148 }; 8149 8150 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonViewportDataAttributes.mjs 8151 var activationDirection = "data-activation-direction"; 8152 8153 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePopupViewport.mjs 8154 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); 8155 var popupViewportStateMapping = { 8156 activationDirection: (value) => value ? { 8157 [activationDirection]: value 8158 } : null 8159 }; 8160 function usePopupViewport(parameters) { 8161 const { 8162 store, 8163 side, 8164 children 8165 } = parameters; 8166 const direction = useDirection(); 8167 const activeTrigger = store.useState("activeTriggerElement"); 8168 const activeTriggerId = store.useState("activeTriggerId"); 8169 const open2 = store.useState("open"); 8170 const payload = store.useState("payload"); 8171 const mounted = store.useState("mounted"); 8172 const popupElement = store.useState("popupElement"); 8173 const positionerElement = store.useState("positionerElement"); 8174 const previousActiveTrigger = usePreviousValue(open2 ? activeTrigger : null); 8175 const currentContentKey = usePopupContentKey(activeTriggerId, payload); 8176 const capturedNodeRef = React39.useRef(null); 8177 const [previousContentNode, setPreviousContentNode] = React39.useState(null); 8178 const [newTriggerOffset, setNewTriggerOffset] = React39.useState(null); 8179 const currentContainerRef = React39.useRef(null); 8180 const previousContainerRef = React39.useRef(null); 8181 const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true); 8182 const cleanupFrame = useAnimationFrame(); 8183 const cleanupControllerRef = React39.useRef(null); 8184 const [previousContentDimensions, setPreviousContentDimensions] = React39.useState(null); 8185 const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React39.useState(false); 8186 useIsoLayoutEffect(() => { 8187 store.set("adaptiveOrigin", adaptiveOrigin); 8188 return () => { 8189 store.set("adaptiveOrigin", void 0); 8190 }; 8191 }, [store]); 8192 const handleMeasureLayout = useStableCallback(() => { 8193 currentContainerRef.current?.style.setProperty("animation", "none"); 8194 currentContainerRef.current?.style.setProperty("transition", "none"); 8195 previousContainerRef.current?.style.setProperty("display", "none"); 8196 }); 8197 const handleMeasureLayoutComplete = useStableCallback((previousDimensions) => { 8198 currentContainerRef.current?.style.removeProperty("animation"); 8199 currentContainerRef.current?.style.removeProperty("transition"); 8200 previousContainerRef.current?.style.removeProperty("display"); 8201 if (previousDimensions) { 8202 setPreviousContentDimensions(previousDimensions); 8203 } 8204 }); 8205 const armViewportCleanup = useStableCallback(() => { 8206 cleanupControllerRef.current?.abort(); 8207 const controller = new AbortController(); 8208 cleanupControllerRef.current = controller; 8209 onAnimationsFinished(() => { 8210 setPreviousContentNode(null); 8211 setPreviousContentDimensions(null); 8212 capturedNodeRef.current = null; 8213 }, controller.signal); 8214 }); 8215 const lastHandledTriggerRef = React39.useRef(null); 8216 useIsoLayoutEffect(() => { 8217 if (!open2 || !mounted) { 8218 lastHandledTriggerRef.current = null; 8219 } 8220 }, [open2, mounted]); 8221 useIsoLayoutEffect(() => { 8222 if (open2 && activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) { 8223 setPreviousContentNode(capturedNodeRef.current); 8224 setShowStartingStyleAttribute(true); 8225 const offset4 = calculateRelativePosition(previousActiveTrigger, activeTrigger); 8226 setNewTriggerOffset(offset4); 8227 lastHandledTriggerRef.current = activeTrigger; 8228 } 8229 }, [open2, activeTrigger, previousActiveTrigger]); 8230 useIsoLayoutEffect(() => { 8231 if (previousContentNode == null) { 8232 return; 8233 } 8234 cleanupControllerRef.current?.abort(); 8235 setShowStartingStyleAttribute(true); 8236 cleanupFrame.request(() => { 8237 ReactDOM6.flushSync(() => { 8238 setShowStartingStyleAttribute(false); 8239 }); 8240 armViewportCleanup(); 8241 }); 8242 }, [currentContentKey, previousContentNode, armViewportCleanup, cleanupFrame]); 8243 useIsoLayoutEffect(() => { 8244 const source = currentContainerRef.current; 8245 if (!source) { 8246 return; 8247 } 8248 const wrapper = ownerDocument(source).createElement("div"); 8249 for (const child of Array.from(source.childNodes)) { 8250 wrapper.appendChild(child.cloneNode(true)); 8251 } 8252 capturedNodeRef.current = wrapper; 8253 }); 8254 const isTransitioning = previousContentNode != null; 8255 let childrenToRender; 8256 if (!isTransitioning) { 8257 childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { 8258 "data-current": true, 8259 ref: currentContainerRef, 8260 children 8261 }, currentContentKey); 8262 } else { 8263 childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(React39.Fragment, { 8264 children: [/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { 8265 "data-previous": true, 8266 inert: inertValue(true), 8267 ref: previousContainerRef, 8268 style: { 8269 ...previousContentDimensions ? { 8270 [popupWidth]: `$previousContentDimensions.width}px`, 8271 [popupHeight]: `$previousContentDimensions.height}px` 8272 } : null, 8273 position: "absolute" 8274 }, 8275 "data-ending-style": showStartingStyleAttribute ? void 0 : "" 8276 }, "previous"), /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { 8277 "data-current": true, 8278 ref: currentContainerRef, 8279 "data-starting-style": showStartingStyleAttribute ? "" : void 0, 8280 children 8281 }, currentContentKey)] 8282 }); 8283 } 8284 useIsoLayoutEffect(() => { 8285 const container = previousContainerRef.current; 8286 if (!container || !previousContentNode) { 8287 return; 8288 } 8289 container.replaceChildren(...Array.from(previousContentNode.childNodes)); 8290 }, [previousContentNode]); 8291 usePopupAutoResize({ 8292 popupElement, 8293 positionerElement, 8294 mounted, 8295 content: payload, 8296 onMeasureLayout: handleMeasureLayout, 8297 onMeasureLayoutComplete: handleMeasureLayoutComplete, 8298 side, 8299 direction 8300 }); 8301 const state = { 8302 activationDirection: getActivationDirection(newTriggerOffset), 8303 transitioning: isTransitioning 8304 }; 8305 return { 8306 children: childrenToRender, 8307 state 8308 }; 8309 } 8310 function getActivationDirection(offset4) { 8311 if (!offset4) { 8312 return void 0; 8313 } 8314 return `$getValueWithTolerance(offset4.horizontal, 5, "right", "left")} $getValueWithTolerance(offset4.vertical, 5, "down", "up")}`; 8315 } 8316 function getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) { 8317 if (value > tolerance) { 8318 return positiveLabel; 8319 } 8320 if (value < -tolerance) { 8321 return negativeLabel; 8322 } 8323 return ""; 8324 } 8325 function calculateRelativePosition(from, to) { 8326 const fromRect = from.getBoundingClientRect(); 8327 const toRect = to.getBoundingClientRect(); 8328 const fromCenter = { 8329 x: fromRect.left + fromRect.width / 2, 8330 y: fromRect.top + fromRect.height / 2 8331 }; 8332 const toCenter = { 8333 x: toRect.left + toRect.width / 2, 8334 y: toRect.top + toRect.height / 2 8335 }; 8336 return { 8337 horizontal: toCenter.x - fromCenter.x, 8338 vertical: toCenter.y - fromCenter.y 8339 }; 8340 } 8341 function usePopupContentKey(activeTriggerId, payload) { 8342 const [contentKey, setContentKey] = React39.useState(0); 8343 const previousActiveTriggerIdRef = React39.useRef(activeTriggerId); 8344 const previousPayloadRef = React39.useRef(payload); 8345 const pendingPayloadUpdateRef = React39.useRef(false); 8346 useIsoLayoutEffect(() => { 8347 const previousActiveTriggerId = previousActiveTriggerIdRef.current; 8348 const previousPayload = previousPayloadRef.current; 8349 const triggerIdChanged = activeTriggerId !== previousActiveTriggerId; 8350 const payloadChanged = payload !== previousPayload; 8351 if (triggerIdChanged) { 8352 setContentKey((value) => value + 1); 8353 pendingPayloadUpdateRef.current = !payloadChanged; 8354 } else if (pendingPayloadUpdateRef.current && payloadChanged) { 8355 setContentKey((value) => value + 1); 8356 pendingPayloadUpdateRef.current = false; 8357 } 8358 previousActiveTriggerIdRef.current = activeTriggerId; 8359 previousPayloadRef.current = payload; 8360 }, [activeTriggerId, payload]); 8361 return `$activeTriggerId ?? "current"}-$contentKey}`; 8362 } 8363 8364 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/FloatingPortalLite.mjs 8365 var React40 = __toESM(require_react(), 1); 8366 var ReactDOM7 = __toESM(require_react_dom(), 1); 8367 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); 8368 var FloatingPortalLite = /* @__PURE__ */ React40.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) { 8369 const { 8370 children, 8371 container, 8372 className, 8373 render, 8374 style, 8375 ...elementProps 8376 } = componentProps; 8377 const { 8378 node: portalNode, 8379 subtree: portalSubtree 8380 } = useFloatingPortalNode({ 8381 container, 8382 ref: forwardedRef, 8383 componentProps, 8384 elementProps 8385 }); 8386 if (!portalSubtree && !portalNode) { 8387 return null; 8388 } 8389 return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(React40.Fragment, { 8390 children: [portalSubtree, portalNode && /* @__PURE__ */ ReactDOM7.createPortal(children, portalNode)] 8391 }); 8392 }); 8393 if (true) FloatingPortalLite.displayName = "FloatingPortalLite"; 8394 8395 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/index.parts.mjs 8396 var index_parts_exports2 = {}; 8397 __export(index_parts_exports2, { 8398 Arrow: () => TooltipArrow, 8399 Handle: () => TooltipHandle, 8400 Popup: () => TooltipPopup, 8401 Portal: () => TooltipPortal, 8402 Positioner: () => TooltipPositioner, 8403 Provider: () => TooltipProvider, 8404 Root: () => TooltipRoot, 8405 Trigger: () => TooltipTrigger, 8406 Viewport: () => TooltipViewport, 8407 createHandle: () => createTooltipHandle 8408 }); 8409 8410 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs 8411 var React43 = __toESM(require_react(), 1); 8412 8413 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/root/TooltipRootContext.mjs 8414 var React41 = __toESM(require_react(), 1); 8415 var TooltipRootContext = /* @__PURE__ */ React41.createContext(void 0); 8416 if (true) TooltipRootContext.displayName = "TooltipRootContext"; 8417 function useTooltipRootContext(optional) { 8418 const context = React41.useContext(TooltipRootContext); 8419 if (context === void 0 && !optional) { 8420 throw new Error(true ? "Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>." : formatErrorMessage_default(72)); 8421 } 8422 return context; 8423 } 8424 8425 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/store/TooltipStore.mjs 8426 var React42 = __toESM(require_react(), 1); 8427 var selectors2 = { 8428 ...popupStoreSelectors, 8429 disabled: (state) => state.disabled, 8430 instantType: (state) => state.instantType, 8431 isInstantPhase: (state) => state.isInstantPhase, 8432 trackCursorAxis: (state) => state.trackCursorAxis, 8433 disableHoverablePopup: (state) => state.disableHoverablePopup, 8434 lastOpenChangeReason: (state) => state.openChangeReason, 8435 closeOnClick: (state) => state.closeOnClick, 8436 // Active and inactive trigger props are the same object, so a constant for triggers that discard 8437 // them keeps those triggers from re-rendering when the props change. 8438 appliedTriggerProps: (state, apply) => apply ? state.activeTriggerProps : void 0, 8439 closeDelay: (state) => state.closeDelay, 8440 adaptiveOrigin: (state) => state.adaptiveOrigin 8441 }; 8442 var TooltipStore = class extends ReactStore { 8443 constructor(initialState, floatingId, nested) { 8444 const triggerElements = new PopupTriggerMap(); 8445 super(createInitialState(initialState, triggerElements, floatingId, nested), createInitialContext(triggerElements), selectors2); 8446 } 8447 setOpen = (nextOpen, eventDetails) => { 8448 applyPopupOpenChange(this, nextOpen, eventDetails, { 8449 extraState: { 8450 openChangeReason: eventDetails.reason 8451 } 8452 }); 8453 }; 8454 // Used by trigger clicks to clear a delayed hover open without reporting a public open-state change. 8455 cancelPendingOpen(event) { 8456 this.state.floatingRootContext.dispatchOpenChange(false, createChangeEventDetails(reason_parts_exports.triggerPress, event)); 8457 } 8458 }; 8459 function createNullTooltipStore() { 8460 const triggerElements = new PopupTriggerMap(); 8461 const store = new NullStore(Object.freeze(createInitialState(void 0, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors2); 8462 return Object.assign(store, { 8463 setOpen: NOOP, 8464 cancelPendingOpen: NOOP 8465 }); 8466 } 8467 function createInitialState(initialState, triggerElements, floatingId, nested = false) { 8468 const state = { 8469 ...createInitialPopupStoreState(triggerElements, floatingId, nested), 8470 disabled: false, 8471 instantType: void 0, 8472 isInstantPhase: false, 8473 trackCursorAxis: "none", 8474 disableHoverablePopup: false, 8475 openChangeReason: null, 8476 closeOnClick: true, 8477 closeDelay: 0, 8478 adaptiveOrigin: void 0, 8479 ...initialState 8480 }; 8481 return state; 8482 } 8483 function createInitialContext(triggerElements) { 8484 return { 8485 popupRef: /* @__PURE__ */ React42.createRef(), 8486 onOpenChange: void 0, 8487 onOpenChangeComplete: void 0, 8488 triggerElements 8489 }; 8490 } 8491 8492 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs 8493 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); 8494 var TooltipRoot = fastComponent(function TooltipRoot2(props) { 8495 const { 8496 disabled: disabled2 = false, 8497 defaultOpen = false, 8498 open: openProp, 8499 disableHoverablePopup = false, 8500 trackCursorAxis = "none", 8501 actionsRef, 8502 onOpenChange, 8503 onOpenChangeComplete, 8504 handle, 8505 triggerId: triggerIdProp, 8506 defaultTriggerId: defaultTriggerIdProp = null, 8507 children 8508 } = props; 8509 const store = usePopupRootStore((floatingId, nested) => new TooltipStore({ 8510 open: defaultOpen, 8511 openProp, 8512 activeTriggerId: defaultTriggerIdProp, 8513 triggerIdProp 8514 }, floatingId, nested)); 8515 store.useControlledProp("openProp", openProp); 8516 store.useControlledProp("triggerIdProp", triggerIdProp); 8517 store.useContextCallback("onOpenChange", onOpenChange); 8518 store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete); 8519 const openState = store.useState("open"); 8520 const open2 = !disabled2 && openState; 8521 const activeTriggerId = store.useState("activeTriggerId"); 8522 const mounted = store.useState("mounted"); 8523 const payload = store.useState("payload"); 8524 store.useSyncedValues({ 8525 trackCursorAxis, 8526 disableHoverablePopup, 8527 disabled: disabled2 8528 }); 8529 useImplicitActiveTrigger(store, { 8530 closeOnActiveTriggerUnmount: true 8531 }); 8532 const { 8533 forceUnmount, 8534 transitionStatus 8535 } = useOpenStateTransitions(open2, store); 8536 const isInstantPhase = store.useState("isInstantPhase"); 8537 const instantType = store.useState("instantType"); 8538 const lastOpenChangeReason = store.useState("lastOpenChangeReason"); 8539 const previousInstantTypeRef = React43.useRef(null); 8540 useIsoLayoutEffect(() => { 8541 if (openState && disabled2) { 8542 store.setOpen(false, createChangeEventDetails(reason_parts_exports.disabled)); 8543 } 8544 }, [openState, disabled2, store]); 8545 useIsoLayoutEffect(() => { 8546 if (transitionStatus === "ending" && lastOpenChangeReason === reason_parts_exports.none || transitionStatus !== "ending" && isInstantPhase) { 8547 if (instantType !== "delay") { 8548 previousInstantTypeRef.current = instantType; 8549 } 8550 store.set("instantType", "delay"); 8551 } else if (previousInstantTypeRef.current !== null) { 8552 store.set("instantType", previousInstantTypeRef.current); 8553 previousInstantTypeRef.current = null; 8554 } 8555 }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store]); 8556 useIsoLayoutEffect(() => { 8557 if (open2) { 8558 if (activeTriggerId == null) { 8559 store.set("payload", void 0); 8560 } 8561 } 8562 }, [store, activeTriggerId, open2]); 8563 React43.useImperativeHandle(actionsRef, () => ({ 8564 unmount: forceUnmount, 8565 close: () => store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)) 8566 }), [forceUnmount, store]); 8567 const shouldRenderInteractions = open2 || mounted || !disabled2 && trackCursorAxis !== "none"; 8568 return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(TooltipRootContext.Provider, { 8569 value: store, 8570 children: [handle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PopupHandleAttachment, { 8571 handle, 8572 store 8573 }), shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipInteractions, { 8574 store, 8575 disabled: disabled2, 8576 trackCursorAxis 8577 }), typeof children === "function" ? children({ 8578 payload 8579 }) : children] 8580 }); 8581 }); 8582 if (true) TooltipRoot.displayName = "TooltipRoot"; 8583 function TooltipInteractions({ 8584 store, 8585 disabled: disabled2, 8586 trackCursorAxis 8587 }) { 8588 const floatingRootContext = store.useState("floatingRootContext"); 8589 const dismiss = useDismiss(floatingRootContext, { 8590 enabled: !disabled2, 8591 referencePress: () => store.select("closeOnClick") 8592 }); 8593 const clientPoint = useClientPoint(floatingRootContext, { 8594 enabled: !disabled2 && trackCursorAxis !== "none", 8595 axis: trackCursorAxis === "none" ? void 0 : trackCursorAxis 8596 }); 8597 const triggerProps = React43.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]); 8598 usePopupInteractionProps(store, { 8599 activeTriggerProps: triggerProps, 8600 inactiveTriggerProps: triggerProps, 8601 popupProps: dismiss.floating ?? EMPTY_OBJECT 8602 }); 8603 return null; 8604 } 8605 8606 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs 8607 var React45 = __toESM(require_react(), 1); 8608 8609 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/provider/TooltipProviderContext.mjs 8610 var React44 = __toESM(require_react(), 1); 8611 var TooltipProviderContext = /* @__PURE__ */ React44.createContext(void 0); 8612 if (true) TooltipProviderContext.displayName = "TooltipProviderContext"; 8613 function useTooltipProviderContext() { 8614 return React44.useContext(TooltipProviderContext); 8615 } 8616 8617 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/utils/constants.mjs 8618 var OPEN_DELAY = 600; 8619 8620 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs 8621 var TOOLTIP_TRIGGER_IDENTIFIER = "data-base-ui-tooltip-trigger"; 8622 function getTargetElement(event) { 8623 const target = getTarget(event); 8624 return isElement(target) ? target : null; 8625 } 8626 var TooltipTrigger = fastComponentRef(function TooltipTrigger2(componentProps, forwardedRef) { 8627 const { 8628 render, 8629 className, 8630 style, 8631 handle, 8632 payload, 8633 disabled: disabledProp, 8634 delay, 8635 closeOnClick = true, 8636 closeDelay, 8637 id: idProp, 8638 ...elementProps 8639 } = componentProps; 8640 const rootContext = useTooltipRootContext(true); 8641 const handleStore = usePopupHandleStore(handle); 8642 const store = handleStore ?? rootContext; 8643 if (!store) { 8644 throw new Error(true ? "Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle." : formatErrorMessage_default(82)); 8645 } 8646 const thisTriggerId = useBaseUiId(idProp); 8647 const isTriggerActive = store.useState("isTriggerActive", thisTriggerId); 8648 const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId); 8649 const floatingRootContext = store.useState("floatingRootContext"); 8650 const triggerElementRef = React45.useRef(null); 8651 const closeDelayWithDefault = closeDelay ?? 0; 8652 const { 8653 registerTrigger, 8654 isMountedByThisTrigger 8655 } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, { 8656 payload, 8657 closeOnClick, 8658 closeDelay: closeDelayWithDefault 8659 }); 8660 const providerDelay = useTooltipProviderContext(); 8661 const { 8662 activeIdRef, 8663 delayRef, 8664 isInstantPhase, 8665 hasProvider 8666 } = useDelayGroup(floatingRootContext, { 8667 open: isOpenedByThisTrigger 8668 }); 8669 const hoverInteraction = useHoverInteractionSharedState(floatingRootContext); 8670 store.useSyncedValue("isInstantPhase", isInstantPhase); 8671 const rootDisabled = store.useState("disabled"); 8672 const disabled2 = disabledProp ?? rootDisabled; 8673 const disabledRef = useValueAsRef(disabled2); 8674 const trackCursorAxis = store.useState("trackCursorAxis"); 8675 const disableHoverablePopup = store.useState("disableHoverablePopup"); 8676 const isNestedTriggerHoveredRef = React45.useRef(false); 8677 const nestedTriggerOpenTimeout = useTimeout(); 8678 const pointerTypeRef = React45.useRef(void 0); 8679 function getOpenDelay() { 8680 if (hasProvider && activeIdRef.current != null) { 8681 return 0; 8682 } 8683 return delay ?? providerDelay ?? OPEN_DELAY; 8684 } 8685 function isEnabledNestedTriggerTarget(target) { 8686 const triggerEl = triggerElementRef.current; 8687 if (!triggerEl || !target) { 8688 return false; 8689 } 8690 const nearestTrigger = closest(target, `[$TOOLTIP_TRIGGER_IDENTIFIER}]`); 8691 return nearestTrigger !== null && nearestTrigger !== triggerEl && contains(triggerEl, nearestTrigger); 8692 } 8693 function detectNestedTriggerHover(target) { 8694 const nestedTriggerHovered = isEnabledNestedTriggerTarget(target); 8695 isNestedTriggerHoveredRef.current = nestedTriggerHovered; 8696 if (nestedTriggerHovered) { 8697 hoverInteraction.openChangeTimeout.clear(); 8698 hoverInteraction.restTimeout.clear(); 8699 hoverInteraction.restTimeoutPending = false; 8700 nestedTriggerOpenTimeout.clear(); 8701 } 8702 return nestedTriggerHovered; 8703 } 8704 const hoverProps = useHoverReferenceInteraction(floatingRootContext, { 8705 enabled: !disabled2, 8706 mouseOnly: true, 8707 move: false, 8708 handleClose: !disableHoverablePopup && trackCursorAxis !== "both" ? safePolygon() : null, 8709 restMs: getOpenDelay, 8710 delay() { 8711 if (closeDelay == null && hasProvider) { 8712 return { 8713 close: getDelay(delayRef.current, "close") 8714 }; 8715 } 8716 return { 8717 close: closeDelayWithDefault 8718 }; 8719 }, 8720 triggerElementRef, 8721 isActiveTrigger: isTriggerActive, 8722 isClosing: () => store.select("transitionStatus") === "ending", 8723 shouldOpen() { 8724 return !isNestedTriggerHoveredRef.current; 8725 } 8726 }); 8727 const focusProps = useFocus(floatingRootContext, { 8728 enabled: !disabled2 8729 }).reference; 8730 const handleNestedTriggerHover = (event) => { 8731 const wasNestedTriggerHovered = isNestedTriggerHoveredRef.current; 8732 const target = getTargetElement(event); 8733 const nestedTriggerHovered = detectNestedTriggerHover(target); 8734 const triggerEl = triggerElementRef.current; 8735 const targetInsideTrigger = triggerEl && target && contains(triggerEl, target); 8736 if (nestedTriggerHovered && store.select("open") && store.select("lastOpenChangeReason") === reason_parts_exports.triggerHover) { 8737 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 8738 return; 8739 } 8740 if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store.select("open") && triggerEl && // Match the hover hook's non-strict mouse fallback for mouse-only event sequences. 8741 isMouseLikePointerType(pointerTypeRef.current)) { 8742 const open2 = () => { 8743 if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store.select("open")) { 8744 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerEl)); 8745 } 8746 }; 8747 const openDelay = getOpenDelay(); 8748 if (openDelay === 0) { 8749 nestedTriggerOpenTimeout.clear(); 8750 open2(); 8751 } else { 8752 nestedTriggerOpenTimeout.start(openDelay, open2); 8753 } 8754 } 8755 }; 8756 const rootTriggerProps = store.useState("appliedTriggerProps", isMountedByThisTrigger || trackCursorAxis !== "none"); 8757 const state = { 8758 open: isOpenedByThisTrigger 8759 }; 8760 const element = useRenderElement("button", componentProps, { 8761 state, 8762 ref: [forwardedRef, registerTrigger, triggerElementRef], 8763 props: [hoverProps, focusProps, rootTriggerProps, { 8764 onMouseOver(event) { 8765 handleNestedTriggerHover(event.nativeEvent); 8766 }, 8767 onFocus(event) { 8768 if (isEnabledNestedTriggerTarget(getTargetElement(event.nativeEvent))) { 8769 event.preventBaseUIHandler(); 8770 } 8771 }, 8772 onMouseLeave() { 8773 isNestedTriggerHoveredRef.current = false; 8774 nestedTriggerOpenTimeout.clear(); 8775 pointerTypeRef.current = void 0; 8776 }, 8777 onPointerEnter(event) { 8778 pointerTypeRef.current = event.pointerType; 8779 }, 8780 onPointerDown(event) { 8781 pointerTypeRef.current = event.pointerType; 8782 store.set("closeOnClick", closeOnClick); 8783 if (closeOnClick && !store.select("open")) { 8784 store.cancelPendingOpen(event.nativeEvent); 8785 } 8786 }, 8787 onClick(event) { 8788 if (closeOnClick && !store.select("open")) { 8789 store.cancelPendingOpen(event.nativeEvent); 8790 } 8791 }, 8792 id: thisTriggerId, 8793 [triggerDisabled]: disabled2 ? "" : void 0, 8794 [TOOLTIP_TRIGGER_IDENTIFIER]: disabled2 ? void 0 : "" 8795 }, elementProps], 8796 stateAttributesMapping: triggerOpenStateMapping 8797 }); 8798 return element; 8799 }); 8800 if (true) TooltipTrigger.displayName = "TooltipTrigger"; 8801 8802 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs 8803 var React47 = __toESM(require_react(), 1); 8804 8805 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/portal/TooltipPortalContext.mjs 8806 var React46 = __toESM(require_react(), 1); 8807 var TooltipPortalContext = /* @__PURE__ */ React46.createContext(void 0); 8808 if (true) TooltipPortalContext.displayName = "TooltipPortalContext"; 8809 function useTooltipPortalContext() { 8810 const value = React46.useContext(TooltipPortalContext); 8811 if (value === void 0) { 8812 throw new Error(true ? "Base UI: <Tooltip.Portal> is missing." : formatErrorMessage_default(70)); 8813 } 8814 return value; 8815 } 8816 8817 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs 8818 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); 8819 var TooltipPortal = /* @__PURE__ */ React47.forwardRef(function TooltipPortal2(props, forwardedRef) { 8820 const { 8821 keepMounted = false, 8822 ...portalProps 8823 } = props; 8824 const store = useTooltipRootContext(); 8825 const mounted = store.useState("mounted"); 8826 const shouldRender = mounted || keepMounted; 8827 if (!shouldRender) { 8828 return null; 8829 } 8830 return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipPortalContext.Provider, { 8831 value: keepMounted, 8832 children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FloatingPortalLite, { 8833 ref: forwardedRef, 8834 ...portalProps 8835 }) 8836 }); 8837 }); 8838 if (true) TooltipPortal.displayName = "TooltipPortal"; 8839 8840 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs 8841 var React49 = __toESM(require_react(), 1); 8842 8843 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/positioner/TooltipPositionerContext.mjs 8844 var React48 = __toESM(require_react(), 1); 8845 var TooltipPositionerContext = /* @__PURE__ */ React48.createContext(void 0); 8846 if (true) TooltipPositionerContext.displayName = "TooltipPositionerContext"; 8847 function useTooltipPositionerContext() { 8848 const context = React48.useContext(TooltipPositionerContext); 8849 if (context === void 0) { 8850 throw new Error(true ? "Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>." : formatErrorMessage_default(71)); 8851 } 8852 return context; 8853 } 8854 8855 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs 8856 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); 8857 var TooltipPositioner = /* @__PURE__ */ React49.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) { 8858 const { 8859 render, 8860 className, 8861 anchor, 8862 positionMethod = "absolute", 8863 side = "top", 8864 align = "center", 8865 sideOffset = 0, 8866 alignOffset = 0, 8867 collisionBoundary = "clipping-ancestors", 8868 collisionPadding = 5, 8869 arrowPadding = 5, 8870 sticky = false, 8871 disableAnchorTracking = false, 8872 collisionAvoidance = POPUP_COLLISION_AVOIDANCE, 8873 style, 8874 ...elementProps 8875 } = componentProps; 8876 const store = useTooltipRootContext(); 8877 const keepMounted = useTooltipPortalContext(); 8878 const open2 = store.useState("open"); 8879 const mounted = store.useState("mounted"); 8880 const trackCursorAxis = store.useState("trackCursorAxis"); 8881 const disableHoverablePopup = store.useState("disableHoverablePopup"); 8882 const floatingRootContext = store.useState("floatingRootContext"); 8883 const instantType = store.useState("instantType"); 8884 const transitionStatus = store.useState("transitionStatus"); 8885 const adaptiveOrigin2 = store.useState("adaptiveOrigin"); 8886 const positioning = useAnchorPositioning({ 8887 anchor, 8888 positionMethod, 8889 floatingRootContext, 8890 mounted, 8891 side, 8892 sideOffset, 8893 align, 8894 alignOffset, 8895 collisionBoundary, 8896 collisionPadding, 8897 sticky, 8898 arrowPadding, 8899 disableAnchorTracking, 8900 keepMounted, 8901 collisionAvoidance, 8902 adaptiveOrigin: adaptiveOrigin2 8903 }); 8904 const state = React49.useMemo(() => ({ 8905 open: open2, 8906 side: positioning.side, 8907 align: positioning.align, 8908 anchorHidden: positioning.anchorHidden, 8909 instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType 8910 }), [open2, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]); 8911 const element = usePositioner(componentProps, state, { 8912 styles: positioning.positionerStyles, 8913 transitionStatus, 8914 props: elementProps, 8915 refs: [forwardedRef, store.useStateSetter("positionerElement")], 8916 hidden: !mounted, 8917 inert: !open2 || trackCursorAxis === "both" || disableHoverablePopup 8918 }); 8919 return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipPositionerContext.Provider, { 8920 value: positioning, 8921 children: element 8922 }); 8923 }); 8924 if (true) TooltipPositioner.displayName = "TooltipPositioner"; 8925 8926 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/popup/TooltipPopup.mjs 8927 var React50 = __toESM(require_react(), 1); 8928 var TooltipPopup = /* @__PURE__ */ React50.forwardRef(function TooltipPopup2(componentProps, forwardedRef) { 8929 const { 8930 render, 8931 className, 8932 style, 8933 ...elementProps 8934 } = componentProps; 8935 const store = useTooltipRootContext(); 8936 const { 8937 side, 8938 align 8939 } = useTooltipPositionerContext(); 8940 const open2 = store.useState("open"); 8941 const instantType = store.useState("instantType"); 8942 const transitionStatus = store.useState("transitionStatus"); 8943 const popupProps = store.useState("popupProps"); 8944 const floatingContext = store.useState("floatingRootContext"); 8945 const disabled2 = store.useState("disabled"); 8946 const closeDelay = store.useState("closeDelay"); 8947 useOpenChangeComplete({ 8948 open: open2, 8949 ref: store.context.popupRef, 8950 onComplete() { 8951 if (open2) { 8952 store.context.onOpenChangeComplete?.(true); 8953 } 8954 } 8955 }); 8956 useHoverFloatingInteraction(floatingContext, { 8957 enabled: !disabled2, 8958 closeDelay 8959 }); 8960 const setPopupElement = store.useStateSetter("popupElement"); 8961 const state = { 8962 open: open2, 8963 side, 8964 align, 8965 instant: instantType, 8966 transitionStatus 8967 }; 8968 const element = useRenderElement("div", componentProps, { 8969 state, 8970 ref: [forwardedRef, store.context.popupRef, setPopupElement], 8971 props: [FOCUSABLE_POPUP_PROPS, popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps], 8972 stateAttributesMapping: popupTransitionStateMapping 8973 }); 8974 return element; 8975 }); 8976 if (true) TooltipPopup.displayName = "TooltipPopup"; 8977 8978 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/arrow/TooltipArrow.mjs 8979 var React51 = __toESM(require_react(), 1); 8980 var TooltipArrow = /* @__PURE__ */ React51.forwardRef(function TooltipArrow2(componentProps, forwardedRef) { 8981 const { 8982 render, 8983 className, 8984 style, 8985 ...elementProps 8986 } = componentProps; 8987 const store = useTooltipRootContext(); 8988 const { 8989 arrowRef, 8990 side, 8991 align, 8992 arrowUncentered, 8993 arrowStyles 8994 } = useTooltipPositionerContext(); 8995 const open2 = store.useState("open"); 8996 const instantType = store.useState("instantType"); 8997 const state = { 8998 open: open2, 8999 side, 9000 align, 9001 uncentered: arrowUncentered, 9002 instant: instantType 9003 }; 9004 const element = useRenderElement("div", componentProps, { 9005 state, 9006 ref: [forwardedRef, arrowRef], 9007 props: [{ 9008 style: arrowStyles, 9009 "aria-hidden": true 9010 }, elementProps], 9011 stateAttributesMapping: popupStateMapping 9012 }); 9013 return element; 9014 }); 9015 if (true) TooltipArrow.displayName = "TooltipArrow"; 9016 9017 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/provider/TooltipProvider.mjs 9018 var React52 = __toESM(require_react(), 1); 9019 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); 9020 var TooltipProvider = function TooltipProvider2(props) { 9021 const { 9022 delay, 9023 closeDelay, 9024 timeout = 400 9025 } = props; 9026 const delayValue = React52.useMemo(() => ({ 9027 open: delay, 9028 close: closeDelay 9029 }), [delay, closeDelay]); 9030 return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TooltipProviderContext.Provider, { 9031 value: delay, 9032 children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FloatingDelayGroup, { 9033 delay: delayValue, 9034 timeoutMs: timeout, 9035 children: props.children 9036 }) 9037 }); 9038 }; 9039 if (true) TooltipProvider.displayName = "TooltipProvider"; 9040 9041 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/viewport/TooltipViewport.mjs 9042 var React53 = __toESM(require_react(), 1); 9043 var TooltipViewport = /* @__PURE__ */ React53.forwardRef(function TooltipViewport2(componentProps, forwardedRef) { 9044 const { 9045 render, 9046 className, 9047 style, 9048 children, 9049 ...elementProps 9050 } = componentProps; 9051 const store = useTooltipRootContext(); 9052 const positioner = useTooltipPositionerContext(); 9053 const instantType = store.useState("instantType"); 9054 const { 9055 children: childrenToRender, 9056 state: viewportState 9057 } = usePopupViewport({ 9058 store, 9059 side: positioner.side, 9060 children 9061 }); 9062 const state = { 9063 activationDirection: viewportState.activationDirection, 9064 transitioning: viewportState.transitioning, 9065 instant: instantType 9066 }; 9067 return useRenderElement("div", componentProps, { 9068 state, 9069 ref: forwardedRef, 9070 props: [elementProps, { 9071 children: childrenToRender 9072 }], 9073 stateAttributesMapping: popupViewportStateMapping 9074 }); 9075 }); 9076 if (true) TooltipViewport.displayName = "TooltipViewport"; 9077 9078 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/store/TooltipHandle.mjs 9079 var TooltipHandle = class extends BasePopupHandle { 9080 constructor() { 9081 super(createNullTooltipStore(), "Tooltip"); 9082 } 9083 /** 9084 * Opens the tooltip and associates it with the trigger with the given id. 9085 * 9086 * This method should only be called in an event handler or an effect (not during rendering). 9087 * 9088 * @param triggerId ID of the trigger to associate with the tooltip. The trigger must be a matching 9089 * `Tooltip.Trigger` with this handle passed as a prop. 9090 */ 9091 open(triggerId) { 9092 this.openByTrigger(triggerId); 9093 } 9094 /** 9095 * Closes the tooltip. 9096 * 9097 * This method should only be called in an event handler or an effect (not during rendering). 9098 */ 9099 close() { 9100 this.closePopup(); 9101 } 9102 /** 9103 * Whether the tooltip is currently open. Returns `false` while no root is attached to the handle. 9104 */ 9105 get isOpen() { 9106 return this.attachedStore?.select("open") ?? false; 9107 } 9108 }; 9109 function createTooltipHandle() { 9110 return new TooltipHandle(); 9111 } 9112 9113 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/use-render/useRender.mjs 9114 function useRender(params) { 9115 return useRenderElement(params.defaultTagName ?? "div", params, params); 9116 } 9117 9118 // packages/ui/build-module/avatar/fallback-with-loading-delay.mjs 9119 var import_element13 = __toESM(require_element(), 1); 9120 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); 9121 function FallbackElement({ 9122 elementProps, 9123 render, 9124 state, 9125 enabled 9126 }) { 9127 return useRender({ 9128 defaultTagName: "span", 9129 // Forward the original state without adding useRender's automatic data attributes. 9130 render: typeof render === "function" ? (props) => render(props, state) : render, 9131 props: { ...elementProps }, 9132 enabled 9133 }); 9134 } 9135 var FallbackWithLoadingDelay = (0, import_element13.forwardRef)(function AvatarFallbackWithLoadingDelay({ delay = 0, render, ...props }, ref) { 9136 const [delayPassed, setDelayPassed] = (0, import_element13.useState)(delay === 0); 9137 (0, import_element13.useEffect)(() => { 9138 if (delay === 0) { 9139 setDelayPassed(true); 9140 return; 9141 } 9142 const timeout = setTimeout(() => setDelayPassed(true), delay); 9143 return () => clearTimeout(timeout); 9144 }, [delay]); 9145 return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( 9146 index_parts_exports.Fallback, 9147 { 9148 ...props, 9149 ref, 9150 delay: 0, 9151 render: (elementProps, state) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( 9152 FallbackElement, 9153 { 9154 elementProps, 9155 render, 9156 state, 9157 enabled: state.imageLoadingStatus !== "loading" || delayPassed 9158 } 9159 ) 9160 } 9161 ); 9162 }); 9163 9164 // packages/ui/build-module/avatar/fallback.mjs 9165 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); 9166 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash"; 9167 function getRuntime3() { 9168 const globalScope = globalThis; 9169 if (globalScope.__wpStyleRuntime) { 9170 return globalScope.__wpStyleRuntime; 9171 } 9172 globalScope.__wpStyleRuntime = { 9173 documents: /* @__PURE__ */ new Map(), 9174 styles: /* @__PURE__ */ new Map(), 9175 injectedStyles: /* @__PURE__ */ new WeakMap() 9176 }; 9177 if (typeof document !== "undefined") { 9178 registerDocument3(document); 9179 } 9180 return globalScope.__wpStyleRuntime; 9181 } 9182 function documentContainsStyleHash3(targetDocument, hash) { 9183 if (!targetDocument.head) { 9184 return false; 9185 } 9186 for (const style of targetDocument.head.querySelectorAll( 9187 `style[$STYLE_HASH_ATTRIBUTE3}]` 9188 )) { 9189 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) { 9190 return true; 9191 } 9192 } 9193 return false; 9194 } 9195 function injectStyle3(targetDocument, hash, css) { 9196 if (!targetDocument.head) { 9197 return; 9198 } 9199 const runtime = getRuntime3(); 9200 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9201 if (!injectedStyles) { 9202 injectedStyles = /* @__PURE__ */ new Set(); 9203 runtime.injectedStyles.set(targetDocument, injectedStyles); 9204 } 9205 if (injectedStyles.has(hash)) { 9206 return; 9207 } 9208 if (documentContainsStyleHash3(targetDocument, hash)) { 9209 injectedStyles.add(hash); 9210 return; 9211 } 9212 const style = targetDocument.createElement("style"); 9213 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash); 9214 style.appendChild(targetDocument.createTextNode(css)); 9215 targetDocument.head.appendChild(style); 9216 injectedStyles.add(hash); 9217 } 9218 function registerDocument3(targetDocument) { 9219 const runtime = getRuntime3(); 9220 runtime.documents.set( 9221 targetDocument, 9222 (runtime.documents.get(targetDocument) ?? 0) + 1 9223 ); 9224 for (const [hash, css] of runtime.styles) { 9225 injectStyle3(targetDocument, hash, css); 9226 } 9227 return () => { 9228 const count = runtime.documents.get(targetDocument); 9229 if (count === void 0) { 9230 return; 9231 } 9232 if (count <= 1) { 9233 runtime.documents.delete(targetDocument); 9234 return; 9235 } 9236 runtime.documents.set(targetDocument, count - 1); 9237 }; 9238 } 9239 function registerStyle3(hash, css) { 9240 const runtime = getRuntime3(); 9241 runtime.styles.set(hash, css); 9242 for (const targetDocument of runtime.documents.keys()) { 9243 injectStyle3(targetDocument, hash, css); 9244 } 9245 } 9246 if (typeof process === "undefined" || true) { 9247 registerStyle3("726f348f3f", "._78c10a0773e51a91__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)}._5b33aa2d48624b4f__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)}}._980b3b4776ac8f81__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._43e478b4279a076c__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._698099e25b0fb1a6__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)._326aee4184d261fd__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)}.e9576240835601ba__a,.e9576240835601ba__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)}._3f05789653864a73__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)}._3c72ff72abe57859__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._79d16267c15d9eb2__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}"); 9248 } 9249 var global_css_defense_default2 = { "button": "_78c10a0773e51a91__button", "input": "_5b33aa2d48624b4f__input", "textarea": "_980b3b4776ac8f81__textarea", "div": "_43e478b4279a076c__div", "p": "_698099e25b0fb1a6__p", "heading": "_326aee4184d261fd__heading", "a": "e9576240835601ba__a", "ol": "_3f05789653864a73__ol", "li": "_3c72ff72abe57859__li", "span": "_79d16267c15d9eb2__span" }; 9250 if (typeof process === "undefined" || true) { 9251 registerStyle3("2657a3ab0c", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a9728400af96db77__root{--_wp-ui-avatar-size:var(--wpds-dimension-size-md,32px);--_gcd-span-position:relative;--_gcd-span-display:inline-flex;--_gcd-span-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);--_gcd-span-font-size:var(--_wp-ui-avatar-font-size);--_wp-ui-avatar-font-size:var(--wpds-typography-font-size-sm,12px);align-items:center;background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);block-size:var(--_wp-ui-avatar-size);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:50%;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:inline-flex;flex-shrink:0;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(--_wp-ui-avatar-font-size);font-weight:var(--wpds-typography-font-weight-emphasis,600);inline-size:var(--_wp-ui-avatar-size);justify-content:center;line-height:1;position:relative;vertical-align:middle}._81a33c129d7cbe31__has-color:after{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--_wp-ui-avatar-color);border-radius:inherit;content:"";inset:calc(var(--wpds-border-width-xs, 1px)*-1);pointer-events:none;position:absolute}._32e65dea77285874__is-square{border-radius:var(--wpds-border-radius-sm,2px)}._7d2020337343df5a__is-xs{--_wp-ui-avatar-size:var(--wpds-dimension-size-2xs,16px);--_wp-ui-avatar-font-size:calc(var(--_wp-ui-avatar-size)/2)}._216fb78a075c5ab4__is-sm{--_wp-ui-avatar-size:var(--wpds-dimension-size-sm,24px);--_wp-ui-avatar-font-size:var(--wpds-typography-font-size-xs,11px)}.b552ab04a3b94ae9__is-lg{--_wp-ui-avatar-size:var(--wpds-dimension-size-lg,40px);--_wp-ui-avatar-font-size:var(--wpds-typography-font-size-md,13px)}.f8a7646462ff80d1__is-xl{--_wp-ui-avatar-size:calc(var(--wpds-dimension-size-md, 32px)*2);--_wp-ui-avatar-font-size:var(--wpds-typography-font-size-xl,20px)}._411c43ac028fe4be__image,._7883f856336224e2__fallback{block-size:100%;border-radius:inherit;inline-size:100%;inset:0;position:absolute}._411c43ac028fe4be__image{object-fit:cover;@media not (prefers-reduced-motion){transition:opacity var(--wpds-motion-duration-sm,.1s) var(--wpds-motion-easing-subtle,cubic-bezier(.15,0,.15,1));&[data-error],&[data-loading],&[data-starting-style]{opacity:0}}&[data-ending-style],&[data-error],&[data-loading]{visibility:hidden}}._7883f856336224e2__fallback{--_gcd-span-position:absolute;--_gcd-span-display:flex;align-items:center;display:flex;justify-content:center;overflow:hidden;white-space:nowrap;>svg{block-size:100%;flex-shrink:0;inline-size:100%}>.dc9b5131d4746aa6__person-icon{block-size:110%;color:var(--wpds-color-stroke-surface-neutral-strong,#8d8d8d);inline-size:110%;translate:0 15%}}@media not (forced-colors:active){@supports (color:rgb(from green r g b/1)) and (color:color(from green srgb-linear round(up,r) g b/1)){._81a33c129d7cbe31__has-color:has(>._7883f856336224e2__fallback){border:none}._81a33c129d7cbe31__has-color:has(>._7883f856336224e2__fallback):after{content:none}._81a33c129d7cbe31__has-color>._7883f856336224e2__fallback{--_wp-ui-avatar-background:rgb(from var(--_wp-ui-avatar-color) clamp(0,r,255) clamp(0,g,255) clamp(0,b,255)/1);--_wp-ui-avatar-contrast-target:4.55;background-color:var(--_wp-ui-avatar-background)}._81a33c129d7cbe31__has-color>._7883f856336224e2__fallback>.dc9b5131d4746aa6__person-icon{--_wp-ui-avatar-contrast-target:3.05}._81a33c129d7cbe31__has-color>._7883f856336224e2__fallback,._81a33c129d7cbe31__has-color>._7883f856336224e2__fallback>.dc9b5131d4746aa6__person-icon{--_wp-ui-avatar-luminance:calc(0.2126 * r + 0.7152 * g + 0.0722 * b);--_wp-ui-avatar-light-foreground:round(up,clamp(0,calc(0.17913 - var(--_wp-ui-avatar-luminance)),1));--_wp-ui-avatar-dark-tint:clamp(0,calc(((var(--_wp-ui-avatar-luminance) + 0.05)/var(--_wp-ui-avatar-contrast-target) - 0.05)/max(0.000001, var(--_wp-ui-avatar-luminance))),1);--_wp-ui-avatar-light-tint:clamp(0,calc((1.05 - var(--_wp-ui-avatar-contrast-target)*(var(--_wp-ui-avatar-luminance) + 0.05))/max(0.000001, 1 - var(--_wp-ui-avatar-luminance))),1);--_wp-ui-avatar-tint:calc(var(--_wp-ui-avatar-light-foreground)*var(--_wp-ui-avatar-light-tint) + (1 - var(--_wp-ui-avatar-light-foreground))*var(--_wp-ui-avatar-dark-tint));color:color(from var(--_wp-ui-avatar-background) srgb-linear calc(var(--_wp-ui-avatar-light-foreground) + (r - var(--_wp-ui-avatar-light-foreground)) * var(--_wp-ui-avatar-tint)) calc(var(--_wp-ui-avatar-light-foreground) + (g - var(--_wp-ui-avatar-light-foreground)) * var(--_wp-ui-avatar-tint)) calc(var(--_wp-ui-avatar-light-foreground) + (b - var(--_wp-ui-avatar-light-foreground)) * var(--_wp-ui-avatar-tint))/1)}}}}}'); 9252 } 9253 var style_default3 = { "root": "a9728400af96db77__root", "has-color": "_81a33c129d7cbe31__has-color", "is-square": "_32e65dea77285874__is-square", "is-xs": "_7d2020337343df5a__is-xs", "is-sm": "_216fb78a075c5ab4__is-sm", "is-lg": "b552ab04a3b94ae9__is-lg", "is-xl": "f8a7646462ff80d1__is-xl", "image": "_411c43ac028fe4be__image", "fallback": "_7883f856336224e2__fallback", "person-icon": "dc9b5131d4746aa6__person-icon" }; 9254 var person = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)( 9255 import_primitives2.SVG, 9256 { 9257 xmlns: "http://www.w3.org/2000/svg", 9258 viewBox: "0 0 24 24", 9259 style: { fill: "none" }, 9260 stroke: "currentColor", 9261 strokeWidth: 1.5, 9262 children: [ 9263 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives2.Circle, { cx: 12, cy: 8, r: 5 }), 9264 /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives2.Path, { d: "M20 21a8 8 0 0 0-16 0" }) 9265 ] 9266 } 9267 ); 9268 var Fallback = (0, import_element14.forwardRef)( 9269 function AvatarFallback3({ 9270 className, 9271 children = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)( 9272 Icon, 9273 { 9274 icon: person, 9275 role: "presentation", 9276 className: style_default3["person-icon"] 9277 } 9278 ), 9279 ...props 9280 }, ref) { 9281 return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)( 9282 FallbackWithLoadingDelay, 9283 { 9284 ref, 9285 className: clsx_default( 9286 style_default3.fallback, 9287 global_css_defense_default2.span, 9288 className 9289 ), 9290 ...props, 9291 children 9292 } 9293 ); 9294 } 9295 ); 9296 9297 // packages/ui/build-module/avatar/initials.mjs 9298 var import_element15 = __toESM(require_element(), 1); 9299 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); 9300 var Initials = (0, import_element15.forwardRef)( 9301 function AvatarInitials({ name, locale, ...props }, ref) { 9302 const segmenter = new Intl.Segmenter(locale, { 9303 granularity: "grapheme" 9304 }); 9305 const words = name?.trim().split(/\s+/) ?? []; 9306 const initials = words.filter((_, index2) => index2 === 0 || index2 === words.length - 1).map( 9307 (word) => segmenter.segment(word).containing(0)?.segment ?? "" 9308 ).join("").toLocaleUpperCase(locale); 9309 return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Fallback, { ...props, ref, children: initials || void 0 }); 9310 } 9311 ); 9312 9313 // packages/ui/build-module/text/text.mjs 9314 var import_element16 = __toESM(require_element(), 1); 9315 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash"; 9316 function getRuntime4() { 9317 const globalScope = globalThis; 9318 if (globalScope.__wpStyleRuntime) { 9319 return globalScope.__wpStyleRuntime; 9320 } 9321 globalScope.__wpStyleRuntime = { 9322 documents: /* @__PURE__ */ new Map(), 9323 styles: /* @__PURE__ */ new Map(), 9324 injectedStyles: /* @__PURE__ */ new WeakMap() 9325 }; 9326 if (typeof document !== "undefined") { 9327 registerDocument4(document); 9328 } 9329 return globalScope.__wpStyleRuntime; 9330 } 9331 function documentContainsStyleHash4(targetDocument, hash) { 9332 if (!targetDocument.head) { 9333 return false; 9334 } 9335 for (const style of targetDocument.head.querySelectorAll( 9336 `style[$STYLE_HASH_ATTRIBUTE4}]` 9337 )) { 9338 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) { 9339 return true; 9340 } 9341 } 9342 return false; 9343 } 9344 function injectStyle4(targetDocument, hash, css) { 9345 if (!targetDocument.head) { 9346 return; 9347 } 9348 const runtime = getRuntime4(); 9349 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9350 if (!injectedStyles) { 9351 injectedStyles = /* @__PURE__ */ new Set(); 9352 runtime.injectedStyles.set(targetDocument, injectedStyles); 9353 } 9354 if (injectedStyles.has(hash)) { 9355 return; 9356 } 9357 if (documentContainsStyleHash4(targetDocument, hash)) { 9358 injectedStyles.add(hash); 9359 return; 9360 } 9361 const style = targetDocument.createElement("style"); 9362 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash); 9363 style.appendChild(targetDocument.createTextNode(css)); 9364 targetDocument.head.appendChild(style); 9365 injectedStyles.add(hash); 9366 } 9367 function registerDocument4(targetDocument) { 9368 const runtime = getRuntime4(); 9369 runtime.documents.set( 9370 targetDocument, 9371 (runtime.documents.get(targetDocument) ?? 0) + 1 9372 ); 9373 for (const [hash, css] of runtime.styles) { 9374 injectStyle4(targetDocument, hash, css); 9375 } 9376 return () => { 9377 const count = runtime.documents.get(targetDocument); 9378 if (count === void 0) { 9379 return; 9380 } 9381 if (count <= 1) { 9382 runtime.documents.delete(targetDocument); 9383 return; 9384 } 9385 runtime.documents.set(targetDocument, count - 1); 9386 }; 9387 } 9388 function registerStyle4(hash, css) { 9389 const runtime = getRuntime4(); 9390 runtime.styles.set(hash, css); 9391 for (const targetDocument of runtime.documents.keys()) { 9392 injectStyle4(targetDocument, hash, css); 9393 } 9394 } 9395 if (typeof process === "undefined" || true) { 9396 registerStyle4("09bae534ff", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._9745ffa515d864cf__text{text-wrap:pretty;margin:0}._8882b6a7feb4fd3d__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._664e3e7687c45603__heading-xl,._8882b6a7feb4fd3d__heading-2xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600)}._664e3e7687c45603__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.dac661a5de0ed2bd__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}._59c7f3f740e2f96e__heading-md,.dac661a5de0ed2bd__heading-lg{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-sm,20px)}._59c7f3f740e2f96e__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.cf052fbad8d93b7e__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-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(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._212b9cfef57a0af4__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._07f57bc0aa36b2c6__body-lg,._212b9cfef57a0af4__body-xl{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}._07f57bc0aa36b2c6__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._0c6da4457aec9e62__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0c6da4457aec9e62__body-md,.b998f87ff17b7bec__body-sm{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}.b998f87ff17b7bec__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}'); 9397 } 9398 var style_default4 = { "text": "_9745ffa515d864cf__text", "heading-2xl": "_8882b6a7feb4fd3d__heading-2xl", "heading-xl": "_664e3e7687c45603__heading-xl", "heading-lg": "dac661a5de0ed2bd__heading-lg", "heading-md": "_59c7f3f740e2f96e__heading-md", "heading-sm": "cf052fbad8d93b7e__heading-sm", "body-xl": "_212b9cfef57a0af4__body-xl", "body-lg": "_07f57bc0aa36b2c6__body-lg", "body-md": "_0c6da4457aec9e62__body-md", "body-sm": "b998f87ff17b7bec__body-sm" }; 9399 if (typeof process === "undefined" || true) { 9400 registerStyle4("726f348f3f", "._78c10a0773e51a91__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)}._5b33aa2d48624b4f__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)}}._980b3b4776ac8f81__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._43e478b4279a076c__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._698099e25b0fb1a6__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)._326aee4184d261fd__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)}.e9576240835601ba__a,.e9576240835601ba__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)}._3f05789653864a73__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)}._3c72ff72abe57859__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._79d16267c15d9eb2__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}"); 9401 } 9402 var global_css_defense_default3 = { "button": "_78c10a0773e51a91__button", "input": "_5b33aa2d48624b4f__input", "textarea": "_980b3b4776ac8f81__textarea", "div": "_43e478b4279a076c__div", "p": "_698099e25b0fb1a6__p", "heading": "_326aee4184d261fd__heading", "a": "e9576240835601ba__a", "ol": "_3f05789653864a73__ol", "li": "_3c72ff72abe57859__li", "span": "_79d16267c15d9eb2__span" }; 9403 var Text = (0, import_element16.forwardRef)( 9404 function UnforwardedText({ variant = "body-md", render, className, ...props }, ref) { 9405 const element = useRender({ 9406 render, 9407 defaultTagName: "span", 9408 ref, 9409 props: mergeProps(props, { 9410 className: clsx_default( 9411 style_default4.text, 9412 global_css_defense_default3.heading, 9413 global_css_defense_default3.p, 9414 style_default4[variant], 9415 className 9416 ) 9417 }) 9418 }); 9419 return element; 9420 } 9421 ); 9422 9423 // packages/icons/build-module/library/audio.mjs 9424 var import_primitives3 = __toESM(require_primitives(), 1); 9425 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); 9426 var audio_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 9427 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives3.Path, { d: "M13.25 16.5C13.25 18.0188 12.0188 19.25 10.5 19.25C8.98122 19.25 7.75 18.0188 7.75 16.5C7.75 14.9812 8.98122 13.75 10.5 13.75C12.0188 13.75 13.25 14.9812 13.25 16.5Z", fill: "currentColor", stroke: "none" }), 9428 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives3.Path, { d: "M10.5 19.25C12.0188 19.25 13.25 18.0188 13.25 16.5C13.25 14.9812 12.0188 13.75 10.5 13.75C8.98122 13.75 7.75 14.9812 7.75 16.5C7.75 18.0188 8.98122 19.25 10.5 19.25ZM10.5 19.25C13.4867 19.25 13.75 16.5 13.75 15.1379V7.99998C13.75 4.9108 16.4 5.00254 18 5.00233" }) 9429 ] }); 9430 9431 // packages/icons/build-module/library/file.mjs 9432 var import_primitives4 = __toESM(require_primitives(), 1); 9433 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); 9434 var file_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 9435 /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives4.Path, { d: "M14 4.75V7.75C14 8.44036 14.5596 9 15.25 9H18.25" }), 9436 /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives4.Path, { d: "M5.75 18L5.75 6C5.75 5.30964 6.30964 4.75 7 4.75H14L18.25 9V18C18.25 18.6904 17.6904 19.25 17 19.25H7C6.30964 19.25 5.75 18.6904 5.75 18Z", strokeLinejoin: "round" }) 9437 ] }); 9438 9439 // packages/icons/build-module/library/image.mjs 9440 var import_primitives5 = __toESM(require_primitives(), 1); 9441 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); 9442 var image_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives5.Path, { d: "M19.25 14.2513L16.0707 11.0707C16.0317 11.0317 15.9683 11.0317 15.9293 11.0707L12.0584 14.9416C12.0245 14.9755 11.9713 14.9806 11.9316 14.9537L8.65791 12.7392C8.62313 12.7156 8.57736 12.7163 8.54332 12.7409L4.75 15.4808M19.25 14.2513V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V15.4808M19.25 14.2513V18C19.25 18.6904 18.6904 19.25 18 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V15.4808" }) }); 9443 9444 // packages/icons/build-module/library/video.mjs 9445 var import_primitives6 = __toESM(require_primitives(), 1); 9446 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); 9447 var video_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 9448 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives6.Path, { d: "M10 15L15 12L10 9V15Z", fill: "currentColor", stroke: "none" }), 9449 /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives6.Path, { d: "M4.75 6C4.75 5.30964 5.30964 4.75 6 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V18C19.25 18.6904 18.6904 19.25 18 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V6Z" }) 9450 ] }); 9451 9452 // packages/ui/build-module/utils/render-slot-with-children.mjs 9453 var import_element17 = __toESM(require_element(), 1); 9454 function renderSlotWithChildren(slot, defaultSlot, children) { 9455 return (0, import_element17.cloneElement)( 9456 slot ?? defaultSlot, 9457 { children } 9458 ); 9459 } 9460 9461 // packages/ui/build-module/utils/wp-compat-overlay-slot.mjs 9462 var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash"; 9463 function getRuntime5() { 9464 const globalScope = globalThis; 9465 if (globalScope.__wpStyleRuntime) { 9466 return globalScope.__wpStyleRuntime; 9467 } 9468 globalScope.__wpStyleRuntime = { 9469 documents: /* @__PURE__ */ new Map(), 9470 styles: /* @__PURE__ */ new Map(), 9471 injectedStyles: /* @__PURE__ */ new WeakMap() 9472 }; 9473 if (typeof document !== "undefined") { 9474 registerDocument5(document); 9475 } 9476 return globalScope.__wpStyleRuntime; 9477 } 9478 function documentContainsStyleHash5(targetDocument, hash) { 9479 if (!targetDocument.head) { 9480 return false; 9481 } 9482 for (const style of targetDocument.head.querySelectorAll( 9483 `style[$STYLE_HASH_ATTRIBUTE5}]` 9484 )) { 9485 if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) { 9486 return true; 9487 } 9488 } 9489 return false; 9490 } 9491 function injectStyle5(targetDocument, hash, css) { 9492 if (!targetDocument.head) { 9493 return; 9494 } 9495 const runtime = getRuntime5(); 9496 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9497 if (!injectedStyles) { 9498 injectedStyles = /* @__PURE__ */ new Set(); 9499 runtime.injectedStyles.set(targetDocument, injectedStyles); 9500 } 9501 if (injectedStyles.has(hash)) { 9502 return; 9503 } 9504 if (documentContainsStyleHash5(targetDocument, hash)) { 9505 injectedStyles.add(hash); 9506 return; 9507 } 9508 const style = targetDocument.createElement("style"); 9509 style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash); 9510 style.appendChild(targetDocument.createTextNode(css)); 9511 targetDocument.head.appendChild(style); 9512 injectedStyles.add(hash); 9513 } 9514 function registerDocument5(targetDocument) { 9515 const runtime = getRuntime5(); 9516 runtime.documents.set( 9517 targetDocument, 9518 (runtime.documents.get(targetDocument) ?? 0) + 1 9519 ); 9520 for (const [hash, css] of runtime.styles) { 9521 injectStyle5(targetDocument, hash, css); 9522 } 9523 return () => { 9524 const count = runtime.documents.get(targetDocument); 9525 if (count === void 0) { 9526 return; 9527 } 9528 if (count <= 1) { 9529 runtime.documents.delete(targetDocument); 9530 return; 9531 } 9532 runtime.documents.set(targetDocument, count - 1); 9533 }; 9534 } 9535 function registerStyle5(hash, css) { 9536 const runtime = getRuntime5(); 9537 runtime.styles.set(hash, css); 9538 for (const targetDocument of runtime.documents.keys()) { 9539 injectStyle5(targetDocument, hash, css); 9540 } 9541 } 9542 if (typeof process === "undefined" || true) { 9543 registerStyle5("40df669685", "._9e7887c25dedb459__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._9e7887c25dedb459__slot>*{pointer-events:auto}}}"); 9544 } 9545 var wp_compat_overlay_slot_default = { "slot": "_9e7887c25dedb459__slot" }; 9546 var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot"; 9547 function resolveOwnerDocument() { 9548 return typeof document === "undefined" ? null : document; 9549 } 9550 function isInWordPressEnvironment() { 9551 let topWp; 9552 try { 9553 topWp = window.top?.wp; 9554 } catch { 9555 } 9556 const wp = topWp ?? window.wp; 9557 return typeof wp?.components === "object" && wp.components !== null; 9558 } 9559 var cachedSlot = null; 9560 function ensureSlotIsAccessible(element) { 9561 element.setAttribute("aria-hidden", "false"); 9562 return element; 9563 } 9564 function createSlot(ownerDocument2) { 9565 const element = ownerDocument2.createElement("div"); 9566 element.setAttribute(WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, ""); 9567 if (wp_compat_overlay_slot_default.slot) { 9568 element.classList.add(wp_compat_overlay_slot_default.slot); 9569 } 9570 ownerDocument2.body.appendChild(element); 9571 return element; 9572 } 9573 function getWpCompatOverlaySlot() { 9574 if (typeof window === "undefined") { 9575 return void 0; 9576 } 9577 if (!isInWordPressEnvironment() && window.__wpUiCompatOverlaySlotEnabled !== true) { 9578 return void 0; 9579 } 9580 const ownerDocument2 = resolveOwnerDocument(); 9581 if (!ownerDocument2 || !ownerDocument2.body) { 9582 return void 0; 9583 } 9584 if (cachedSlot && cachedSlot.ownerDocument === ownerDocument2 && cachedSlot.isConnected) { 9585 return ensureSlotIsAccessible(cachedSlot); 9586 } 9587 const existing = ownerDocument2.querySelector( 9588 `[$WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]` 9589 ); 9590 if (existing instanceof HTMLDivElement) { 9591 cachedSlot = ensureSlotIsAccessible(existing); 9592 return cachedSlot; 9593 } 9594 if (cachedSlot?.isConnected) { 9595 cachedSlot.remove(); 9596 } 9597 cachedSlot = ensureSlotIsAccessible(createSlot(ownerDocument2)); 9598 return cachedSlot; 9599 } 9600 9601 // packages/ui/build-module/utils/direction-provider.mjs 9602 var import_i18n = __toESM(require_i18n(), 1); 9603 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); 9604 function DirectionProvider3({ children }) { 9605 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DirectionProvider, { direction: (0, import_i18n.isRTL)() ? "rtl" : "ltr", children }); 9606 } 9607 9608 // packages/ui/build-module/tooltip/index.mjs 9609 var tooltip_exports = {}; 9610 __export(tooltip_exports, { 9611 Popup: () => Popup, 9612 Portal: () => Portal, 9613 Positioner: () => Positioner, 9614 Provider: () => Provider, 9615 Root: () => Root2, 9616 Trigger: () => Trigger 9617 }); 9618 9619 // packages/ui/build-module/tooltip/popup.mjs 9620 var import_element20 = __toESM(require_element(), 1); 9621 9622 // packages/ui/build-module/tooltip/portal.mjs 9623 var import_element18 = __toESM(require_element(), 1); 9624 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); 9625 var Portal = (0, import_element18.forwardRef)( 9626 function TooltipPortal3({ container, ...restProps }, ref) { 9627 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( 9628 index_parts_exports2.Portal, 9629 { 9630 container: container === void 0 ? getWpCompatOverlaySlot() : container, 9631 ...restProps, 9632 ref 9633 } 9634 ); 9635 } 9636 ); 9637 9638 // packages/ui/build-module/tooltip/positioner.mjs 9639 var import_element19 = __toESM(require_element(), 1); 9640 var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); 9641 var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash"; 9642 function getRuntime6() { 9643 const globalScope = globalThis; 9644 if (globalScope.__wpStyleRuntime) { 9645 return globalScope.__wpStyleRuntime; 9646 } 9647 globalScope.__wpStyleRuntime = { 9648 documents: /* @__PURE__ */ new Map(), 9649 styles: /* @__PURE__ */ new Map(), 9650 injectedStyles: /* @__PURE__ */ new WeakMap() 9651 }; 9652 if (typeof document !== "undefined") { 9653 registerDocument6(document); 9654 } 9655 return globalScope.__wpStyleRuntime; 9656 } 9657 function documentContainsStyleHash6(targetDocument, hash) { 9658 if (!targetDocument.head) { 9659 return false; 9660 } 9661 for (const style of targetDocument.head.querySelectorAll( 9662 `style[$STYLE_HASH_ATTRIBUTE6}]` 9663 )) { 9664 if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) { 9665 return true; 9666 } 9667 } 9668 return false; 9669 } 9670 function injectStyle6(targetDocument, hash, css) { 9671 if (!targetDocument.head) { 9672 return; 9673 } 9674 const runtime = getRuntime6(); 9675 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9676 if (!injectedStyles) { 9677 injectedStyles = /* @__PURE__ */ new Set(); 9678 runtime.injectedStyles.set(targetDocument, injectedStyles); 9679 } 9680 if (injectedStyles.has(hash)) { 9681 return; 9682 } 9683 if (documentContainsStyleHash6(targetDocument, hash)) { 9684 injectedStyles.add(hash); 9685 return; 9686 } 9687 const style = targetDocument.createElement("style"); 9688 style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash); 9689 style.appendChild(targetDocument.createTextNode(css)); 9690 targetDocument.head.appendChild(style); 9691 injectedStyles.add(hash); 9692 } 9693 function registerDocument6(targetDocument) { 9694 const runtime = getRuntime6(); 9695 runtime.documents.set( 9696 targetDocument, 9697 (runtime.documents.get(targetDocument) ?? 0) + 1 9698 ); 9699 for (const [hash, css] of runtime.styles) { 9700 injectStyle6(targetDocument, hash, css); 9701 } 9702 return () => { 9703 const count = runtime.documents.get(targetDocument); 9704 if (count === void 0) { 9705 return; 9706 } 9707 if (count <= 1) { 9708 runtime.documents.delete(targetDocument); 9709 return; 9710 } 9711 runtime.documents.set(targetDocument, count - 1); 9712 }; 9713 } 9714 function registerStyle6(hash, css) { 9715 const runtime = getRuntime6(); 9716 runtime.styles.set(hash, css); 9717 for (const targetDocument of runtime.documents.keys()) { 9718 injectStyle6(targetDocument, hash, css); 9719 } 9720 } 9721 if (typeof process === "undefined" || true) { 9722 registerStyle6("37477070fb", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.ccc29f9575c4c758__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 9723 } 9724 var resets_default2 = { "box-sizing": "ccc29f9575c4c758__box-sizing" }; 9725 if (typeof process === "undefined" || true) { 9726 registerStyle6("aaf79ac691", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.b9266862d9435660__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._7bb3fd8a0810be6d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);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-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}'); 9727 } 9728 var style_default5 = { "positioner": "b9266862d9435660__positioner", "popup": "_7bb3fd8a0810be6d__popup" }; 9729 var Positioner = (0, import_element19.forwardRef)( 9730 function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) { 9731 return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( 9732 index_parts_exports2.Positioner, 9733 { 9734 ref, 9735 align, 9736 side, 9737 sideOffset, 9738 ...props, 9739 className: clsx_default( 9740 resets_default2["box-sizing"], 9741 style_default5.positioner, 9742 className 9743 ) 9744 } 9745 ); 9746 } 9747 ); 9748 9749 // packages/ui/build-module/utils/theme-provider.mjs 9750 var theme = __toESM(require_theme(), 1); 9751 9752 // packages/ui/build-module/lock-unlock.mjs 9753 var import_private_apis = __toESM(require_private_apis(), 1); 9754 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 9755 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 9756 "@wordpress/ui" 9757 ); 9758 9759 // packages/ui/build-module/utils/theme-provider.mjs 9760 function getThemeProvider() { 9761 const themePackage = theme; 9762 if (themePackage.ThemeProvider) { 9763 return themePackage.ThemeProvider; 9764 } 9765 if (!themePackage.privateApis) { 9766 throw new Error( 9767 "@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`." 9768 ); 9769 } 9770 return unlock( 9771 themePackage.privateApis 9772 ).ThemeProvider; 9773 } 9774 var ThemeProvider = getThemeProvider(); 9775 9776 // packages/ui/build-module/tooltip/popup.mjs 9777 var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); 9778 var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash"; 9779 function getRuntime7() { 9780 const globalScope = globalThis; 9781 if (globalScope.__wpStyleRuntime) { 9782 return globalScope.__wpStyleRuntime; 9783 } 9784 globalScope.__wpStyleRuntime = { 9785 documents: /* @__PURE__ */ new Map(), 9786 styles: /* @__PURE__ */ new Map(), 9787 injectedStyles: /* @__PURE__ */ new WeakMap() 9788 }; 9789 if (typeof document !== "undefined") { 9790 registerDocument7(document); 9791 } 9792 return globalScope.__wpStyleRuntime; 9793 } 9794 function documentContainsStyleHash7(targetDocument, hash) { 9795 if (!targetDocument.head) { 9796 return false; 9797 } 9798 for (const style of targetDocument.head.querySelectorAll( 9799 `style[$STYLE_HASH_ATTRIBUTE7}]` 9800 )) { 9801 if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) { 9802 return true; 9803 } 9804 } 9805 return false; 9806 } 9807 function injectStyle7(targetDocument, hash, css) { 9808 if (!targetDocument.head) { 9809 return; 9810 } 9811 const runtime = getRuntime7(); 9812 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9813 if (!injectedStyles) { 9814 injectedStyles = /* @__PURE__ */ new Set(); 9815 runtime.injectedStyles.set(targetDocument, injectedStyles); 9816 } 9817 if (injectedStyles.has(hash)) { 9818 return; 9819 } 9820 if (documentContainsStyleHash7(targetDocument, hash)) { 9821 injectedStyles.add(hash); 9822 return; 9823 } 9824 const style = targetDocument.createElement("style"); 9825 style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash); 9826 style.appendChild(targetDocument.createTextNode(css)); 9827 targetDocument.head.appendChild(style); 9828 injectedStyles.add(hash); 9829 } 9830 function registerDocument7(targetDocument) { 9831 const runtime = getRuntime7(); 9832 runtime.documents.set( 9833 targetDocument, 9834 (runtime.documents.get(targetDocument) ?? 0) + 1 9835 ); 9836 for (const [hash, css] of runtime.styles) { 9837 injectStyle7(targetDocument, hash, css); 9838 } 9839 return () => { 9840 const count = runtime.documents.get(targetDocument); 9841 if (count === void 0) { 9842 return; 9843 } 9844 if (count <= 1) { 9845 runtime.documents.delete(targetDocument); 9846 return; 9847 } 9848 runtime.documents.set(targetDocument, count - 1); 9849 }; 9850 } 9851 function registerStyle7(hash, css) { 9852 const runtime = getRuntime7(); 9853 runtime.styles.set(hash, css); 9854 for (const targetDocument of runtime.documents.keys()) { 9855 injectStyle7(targetDocument, hash, css); 9856 } 9857 } 9858 if (typeof process === "undefined" || true) { 9859 registerStyle7("aaf79ac691", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.b9266862d9435660__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._7bb3fd8a0810be6d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);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-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}'); 9860 } 9861 var style_default6 = { "positioner": "b9266862d9435660__positioner", "popup": "_7bb3fd8a0810be6d__popup" }; 9862 var POPUP_COLOR = { background: "#1e1e1e" }; 9863 var Popup = (0, import_element20.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) { 9864 const popupContent = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( 9865 index_parts_exports2.Popup, 9866 { 9867 ref, 9868 className: clsx_default(style_default6.popup, className), 9869 ...props, 9870 children 9871 } 9872 ) }); 9873 const positionedPopup = renderSlotWithChildren( 9874 positioner, 9875 /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Positioner, {}), 9876 popupContent 9877 ); 9878 return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Portal, {}), positionedPopup); 9879 }); 9880 9881 // packages/ui/build-module/tooltip/trigger.mjs 9882 var import_element21 = __toESM(require_element(), 1); 9883 var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); 9884 var Trigger = (0, import_element21.forwardRef)( 9885 function TooltipTrigger3(props, ref) { 9886 return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(index_parts_exports2.Trigger, { ref, ...props }); 9887 } 9888 ); 9889 9890 // packages/ui/build-module/tooltip/root.mjs 9891 var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); 9892 function Root2(props) { 9893 return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(index_parts_exports2.Root, { ...props }) }); 9894 } 9895 9896 // packages/ui/build-module/tooltip/provider.mjs 9897 var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); 9898 function Provider({ ...props }) { 9899 return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(index_parts_exports2.Provider, { ...props }); 9900 } 9901 9902 // packages/ui/build-module/link/link.mjs 9903 var import_element22 = __toESM(require_element(), 1); 9904 var import_i18n2 = __toESM(require_i18n(), 1); 9905 var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); 9906 var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash"; 9907 function getRuntime8() { 9908 const globalScope = globalThis; 9909 if (globalScope.__wpStyleRuntime) { 9910 return globalScope.__wpStyleRuntime; 9911 } 9912 globalScope.__wpStyleRuntime = { 9913 documents: /* @__PURE__ */ new Map(), 9914 styles: /* @__PURE__ */ new Map(), 9915 injectedStyles: /* @__PURE__ */ new WeakMap() 9916 }; 9917 if (typeof document !== "undefined") { 9918 registerDocument8(document); 9919 } 9920 return globalScope.__wpStyleRuntime; 9921 } 9922 function documentContainsStyleHash8(targetDocument, hash) { 9923 if (!targetDocument.head) { 9924 return false; 9925 } 9926 for (const style of targetDocument.head.querySelectorAll( 9927 `style[$STYLE_HASH_ATTRIBUTE8}]` 9928 )) { 9929 if (style.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) { 9930 return true; 9931 } 9932 } 9933 return false; 9934 } 9935 function injectStyle8(targetDocument, hash, css) { 9936 if (!targetDocument.head) { 9937 return; 9938 } 9939 const runtime = getRuntime8(); 9940 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9941 if (!injectedStyles) { 9942 injectedStyles = /* @__PURE__ */ new Set(); 9943 runtime.injectedStyles.set(targetDocument, injectedStyles); 9944 } 9945 if (injectedStyles.has(hash)) { 9946 return; 9947 } 9948 if (documentContainsStyleHash8(targetDocument, hash)) { 9949 injectedStyles.add(hash); 9950 return; 9951 } 9952 const style = targetDocument.createElement("style"); 9953 style.setAttribute(STYLE_HASH_ATTRIBUTE8, hash); 9954 style.appendChild(targetDocument.createTextNode(css)); 9955 targetDocument.head.appendChild(style); 9956 injectedStyles.add(hash); 9957 } 9958 function registerDocument8(targetDocument) { 9959 const runtime = getRuntime8(); 9960 runtime.documents.set( 9961 targetDocument, 9962 (runtime.documents.get(targetDocument) ?? 0) + 1 9963 ); 9964 for (const [hash, css] of runtime.styles) { 9965 injectStyle8(targetDocument, hash, css); 9966 } 9967 return () => { 9968 const count = runtime.documents.get(targetDocument); 9969 if (count === void 0) { 9970 return; 9971 } 9972 if (count <= 1) { 9973 runtime.documents.delete(targetDocument); 9974 return; 9975 } 9976 runtime.documents.set(targetDocument, count - 1); 9977 }; 9978 } 9979 function registerStyle8(hash, css) { 9980 const runtime = getRuntime8(); 9981 runtime.styles.set(hash, css); 9982 for (const targetDocument of runtime.documents.keys()) { 9983 injectStyle8(targetDocument, hash, css); 9984 } 9985 } 9986 if (typeof process === "undefined" || true) { 9987 registerStyle8("37477070fb", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.ccc29f9575c4c758__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 9988 } 9989 var resets_default3 = { "box-sizing": "ccc29f9575c4c758__box-sizing" }; 9990 if (typeof process === "undefined" || true) { 9991 registerStyle8("c13e206e92", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._0f52be5f1d4ce686__outset-ring--focus-within:focus-within,._8f922cee854f2408__outset-ring--focus-visible:focus-visible,.accedd6ae8fd878e__outset-ring--focus:focus{--_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))}._3ad2c88c126f2bdd__outset-ring--focus-within-except-active:focus-within,.c20f61b115485a7f__outset-ring--focus-except-active:focus{outline:none}._3ad2c88c126f2bdd__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c20f61b115485a7f__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))}}}"); 9992 } 9993 var focus_module_default = { "outset-ring--focus": "accedd6ae8fd878e__outset-ring--focus", "outset-ring--focus-visible": "_8f922cee854f2408__outset-ring--focus-visible", "outset-ring--focus-within": "_0f52be5f1d4ce686__outset-ring--focus-within", "outset-ring--focus-except-active": "c20f61b115485a7f__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3ad2c88c126f2bdd__outset-ring--focus-within-except-active" }; 9994 if (typeof process === "undefined" || true) { 9995 registerStyle8("c87d91cdf7", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a574f9f242212d58__link{--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);border-radius:var(--wpds-border-radius-sm,2px);text-decoration-thickness:from-font;text-underline-offset:.2em}._2d2f0506e717a46c__link-with-icon{text-decoration-line:none}._92b7b6a03fbb27ac__link-contents{text-decoration:inherit;text-decoration-line:underline}._69f40d9212adc58d__is-brand,._69f40d9212adc58d__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))}._69f40d9212adc58d__is-brand:active,._69f40d9212adc58d__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))}._9a9c54c6e67b4c3c__is-neutral,._9a9c54c6e67b4c3c__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)}._9a9c54c6e67b4c3c__is-neutral:active,._9a9c54c6e67b4c3c__is-neutral:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}._93be0b747897baad__is-unstyled{--_gcd-a-border-radius:0;--_gcd-a-color:inherit;color:inherit;text-decoration:none}._9c39df40fdc09594__link-icon{font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-padding-xs,4px);text-decoration:none}._9c39df40fdc09594__link-icon:after{content:"\\2060\\2197"}._9c39df40fdc09594__link-icon:dir(rtl):after{content:"\\2060\\2196"}}}'); 9996 } 9997 var style_default7 = { "link": "a574f9f242212d58__link", "link-with-icon": "_2d2f0506e717a46c__link-with-icon", "link-contents": "_92b7b6a03fbb27ac__link-contents", "is-brand": "_69f40d9212adc58d__is-brand", "is-neutral": "_9a9c54c6e67b4c3c__is-neutral", "is-unstyled": "_93be0b747897baad__is-unstyled", "link-icon": "_9c39df40fdc09594__link-icon" }; 9998 if (typeof process === "undefined" || true) { 9999 registerStyle8("726f348f3f", "._78c10a0773e51a91__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)}._5b33aa2d48624b4f__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)}}._980b3b4776ac8f81__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._43e478b4279a076c__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._698099e25b0fb1a6__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)._326aee4184d261fd__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)}.e9576240835601ba__a,.e9576240835601ba__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)}._3f05789653864a73__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)}._3c72ff72abe57859__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._79d16267c15d9eb2__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}"); 10000 } 10001 var global_css_defense_default4 = { "button": "_78c10a0773e51a91__button", "input": "_5b33aa2d48624b4f__input", "textarea": "_980b3b4776ac8f81__textarea", "div": "_43e478b4279a076c__div", "p": "_698099e25b0fb1a6__p", "heading": "_326aee4184d261fd__heading", "a": "e9576240835601ba__a", "ol": "_3f05789653864a73__ol", "li": "_3c72ff72abe57859__li", "span": "_79d16267c15d9eb2__span" }; 10002 var Link = (0, import_element22.forwardRef)( 10003 function UnforwardedLink({ 10004 children, 10005 variant = "default", 10006 tone = "brand", 10007 openInNewTab = false, 10008 target, 10009 render, 10010 className, 10011 ...props 10012 }, ref) { 10013 const shouldShowNewTabIndicator = openInNewTab || /^_blank$/i.test(target ?? ""); 10014 const element = useRender({ 10015 render, 10016 defaultTagName: "a", 10017 ref, 10018 props: mergeProps(props, { 10019 className: clsx_default( 10020 global_css_defense_default4.a, 10021 resets_default3["box-sizing"], 10022 focus_module_default["outset-ring--focus-except-active"], 10023 variant !== "unstyled" && style_default7.link, 10024 variant !== "unstyled" && shouldShowNewTabIndicator && style_default7["link-with-icon"], 10025 variant !== "unstyled" && style_default7[`is-$tone}`], 10026 variant === "unstyled" && style_default7["is-unstyled"], 10027 className 10028 ), 10029 target: target ?? (openInNewTab ? "_blank" : void 0), 10030 children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [ 10031 shouldShowNewTabIndicator && variant !== "unstyled" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: style_default7["link-contents"], children }) : children, 10032 shouldShowNewTabIndicator && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( 10033 "span", 10034 { 10035 className: style_default7["link-icon"], 10036 role: "img", 10037 "aria-label": ( 10038 /* translators: accessibility text appended to link text */ 10039 (0, import_i18n2.__)("(opens in a new tab)") 10040 ) 10041 } 10042 ) 10043 ] }) 10044 }) 10045 }); 10046 return element; 10047 } 10048 ); 10049 10050 // packages/ui/build-module/stack/stack.mjs 10051 var import_element23 = __toESM(require_element(), 1); 10052 var STYLE_HASH_ATTRIBUTE9 = "data-wp-hash"; 10053 function getRuntime9() { 10054 const globalScope = globalThis; 10055 if (globalScope.__wpStyleRuntime) { 10056 return globalScope.__wpStyleRuntime; 10057 } 10058 globalScope.__wpStyleRuntime = { 10059 documents: /* @__PURE__ */ new Map(), 10060 styles: /* @__PURE__ */ new Map(), 10061 injectedStyles: /* @__PURE__ */ new WeakMap() 10062 }; 10063 if (typeof document !== "undefined") { 10064 registerDocument9(document); 10065 } 10066 return globalScope.__wpStyleRuntime; 10067 } 10068 function documentContainsStyleHash9(targetDocument, hash) { 10069 if (!targetDocument.head) { 10070 return false; 10071 } 10072 for (const style of targetDocument.head.querySelectorAll( 10073 `style[$STYLE_HASH_ATTRIBUTE9}]` 10074 )) { 10075 if (style.getAttribute(STYLE_HASH_ATTRIBUTE9) === hash) { 10076 return true; 10077 } 10078 } 10079 return false; 10080 } 10081 function injectStyle9(targetDocument, hash, css) { 10082 if (!targetDocument.head) { 10083 return; 10084 } 10085 const runtime = getRuntime9(); 10086 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10087 if (!injectedStyles) { 10088 injectedStyles = /* @__PURE__ */ new Set(); 10089 runtime.injectedStyles.set(targetDocument, injectedStyles); 10090 } 10091 if (injectedStyles.has(hash)) { 10092 return; 10093 } 10094 if (documentContainsStyleHash9(targetDocument, hash)) { 10095 injectedStyles.add(hash); 10096 return; 10097 } 10098 const style = targetDocument.createElement("style"); 10099 style.setAttribute(STYLE_HASH_ATTRIBUTE9, hash); 10100 style.appendChild(targetDocument.createTextNode(css)); 10101 targetDocument.head.appendChild(style); 10102 injectedStyles.add(hash); 10103 } 10104 function registerDocument9(targetDocument) { 10105 const runtime = getRuntime9(); 10106 runtime.documents.set( 10107 targetDocument, 10108 (runtime.documents.get(targetDocument) ?? 0) + 1 10109 ); 10110 for (const [hash, css] of runtime.styles) { 10111 injectStyle9(targetDocument, hash, css); 10112 } 10113 return () => { 10114 const count = runtime.documents.get(targetDocument); 10115 if (count === void 0) { 10116 return; 10117 } 10118 if (count <= 1) { 10119 runtime.documents.delete(targetDocument); 10120 return; 10121 } 10122 runtime.documents.set(targetDocument, count - 1); 10123 }; 10124 } 10125 function registerStyle9(hash, css) { 10126 const runtime = getRuntime9(); 10127 runtime.styles.set(hash, css); 10128 for (const targetDocument of runtime.documents.keys()) { 10129 injectStyle9(targetDocument, hash, css); 10130 } 10131 } 10132 if (typeof process === "undefined" || true) { 10133 registerStyle9("67591fa198", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._8e8e79c1a2eec43b__stack{display:flex}}}"); 10134 } 10135 var style_default8 = { "stack": "_8e8e79c1a2eec43b__stack" }; 10136 var gapTokens = { 10137 xs: "var(--wpds-dimension-gap-xs, 4px)", 10138 sm: "var(--wpds-dimension-gap-sm, 8px)", 10139 md: "var(--wpds-dimension-gap-md, 12px)", 10140 lg: "var(--wpds-dimension-gap-lg, 16px)", 10141 xl: "var(--wpds-dimension-gap-xl, 24px)", 10142 "2xl": "var(--wpds-dimension-gap-2xl, 32px)", 10143 "3xl": "var(--wpds-dimension-gap-3xl, 40px)" 10144 }; 10145 var Stack = (0, import_element23.forwardRef)( 10146 function UnforwardedStack({ direction, gap, align, justify, wrap, render, ...props }, ref) { 10147 const style = { 10148 gap: gap && gapTokens[gap], 10149 alignItems: align, 10150 justifyContent: justify, 10151 flexDirection: direction, 10152 flexWrap: wrap 10153 }; 10154 const element = useRender({ 10155 render, 10156 ref, 10157 props: mergeProps(props, { 10158 style, 10159 className: style_default8.stack 10160 }) 10161 }); 10162 return element; 10163 } 10164 ); 10165 10166 // packages/core-fields/build-module/attachment/alt_text/field.mjs 10167 var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); 10168 var fieldExtensions = { 10169 description: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [ 10170 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( 10171 Link, 10172 { 10173 href: ( 10174 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 10175 (0, import_i18n3.__)( 10176 "https://www.w3.org/WAI/tutorials/images/decision-tree/" 10177 ) 10178 ), 10179 openInNewTab: true, 10180 children: (0, import_i18n3.__)("Describe the purpose of the image.") 10181 } 10182 ), 10183 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("br", {}), 10184 (0, import_i18n3.__)("Leave empty if decorative.") 10185 ] }), 10186 // Only images have an alternative text. 10187 isVisible: (item) => item?.media_type === "image", 10188 render: ({ item }) => item?.alt_text || "-" 10189 }; 10190 10191 // packages/core-fields/build-module/attachment/attached_to/edit.mjs 10192 var import_core_data = __toESM(require_core_data(), 1); 10193 var import_components = __toESM(require_components(), 1); 10194 var import_i18n4 = __toESM(require_i18n(), 1); 10195 var import_element24 = __toESM(require_element(), 1); 10196 var import_compose = __toESM(require_compose(), 1); 10197 var import_data = __toESM(require_data(), 1); 10198 10199 // packages/core-fields/build-module/attachment/get-rendered-content.mjs 10200 function getRenderedContent(content) { 10201 if (!content) { 10202 return ""; 10203 } 10204 if (typeof content === "string") { 10205 return content; 10206 } 10207 if (typeof content === "object") { 10208 return content.rendered || content.raw || ""; 10209 } 10210 return ""; 10211 } 10212 10213 // packages/core-fields/build-module/attachment/attached_to/edit.mjs 10214 var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); 10215 var STYLE_HASH_ATTRIBUTE10 = "data-wp-hash"; 10216 function getRuntime10() { 10217 const globalScope = globalThis; 10218 if (globalScope.__wpStyleRuntime) { 10219 return globalScope.__wpStyleRuntime; 10220 } 10221 globalScope.__wpStyleRuntime = { 10222 documents: /* @__PURE__ */ new Map(), 10223 styles: /* @__PURE__ */ new Map(), 10224 injectedStyles: /* @__PURE__ */ new WeakMap() 10225 }; 10226 if (typeof document !== "undefined") { 10227 registerDocument10(document); 10228 } 10229 return globalScope.__wpStyleRuntime; 10230 } 10231 function documentContainsStyleHash10(targetDocument, hash) { 10232 if (!targetDocument.head) { 10233 return false; 10234 } 10235 for (const style of targetDocument.head.querySelectorAll( 10236 `style[$STYLE_HASH_ATTRIBUTE10}]` 10237 )) { 10238 if (style.getAttribute(STYLE_HASH_ATTRIBUTE10) === hash) { 10239 return true; 10240 } 10241 } 10242 return false; 10243 } 10244 function injectStyle10(targetDocument, hash, css) { 10245 if (!targetDocument.head) { 10246 return; 10247 } 10248 const runtime = getRuntime10(); 10249 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10250 if (!injectedStyles) { 10251 injectedStyles = /* @__PURE__ */ new Set(); 10252 runtime.injectedStyles.set(targetDocument, injectedStyles); 10253 } 10254 if (injectedStyles.has(hash)) { 10255 return; 10256 } 10257 if (documentContainsStyleHash10(targetDocument, hash)) { 10258 injectedStyles.add(hash); 10259 return; 10260 } 10261 const style = targetDocument.createElement("style"); 10262 style.setAttribute(STYLE_HASH_ATTRIBUTE10, hash); 10263 style.appendChild(targetDocument.createTextNode(css)); 10264 targetDocument.head.appendChild(style); 10265 injectedStyles.add(hash); 10266 } 10267 function registerDocument10(targetDocument) { 10268 const runtime = getRuntime10(); 10269 runtime.documents.set( 10270 targetDocument, 10271 (runtime.documents.get(targetDocument) ?? 0) + 1 10272 ); 10273 for (const [hash, css] of runtime.styles) { 10274 injectStyle10(targetDocument, hash, css); 10275 } 10276 return () => { 10277 const count = runtime.documents.get(targetDocument); 10278 if (count === void 0) { 10279 return; 10280 } 10281 if (count <= 1) { 10282 runtime.documents.delete(targetDocument); 10283 return; 10284 } 10285 runtime.documents.set(targetDocument, count - 1); 10286 }; 10287 } 10288 function registerStyle10(hash, css) { 10289 const runtime = getRuntime10(); 10290 runtime.styles.set(hash, css); 10291 for (const targetDocument of runtime.documents.keys()) { 10292 injectStyle10(targetDocument, hash, css); 10293 } 10294 } 10295 if (typeof process === "undefined" || true) { 10296 registerStyle10("1a504e7637", ".components-popover__content:has(.e7c40a32a00ab056__attached-to){margin-block-end:96px}.components-popover__content:has(.e7c40a32a00ab056__attached-to):has(.components-form-token-field__suggestions-list){margin-block-end:0}.components-popover__content:has(.e7c40a32a00ab056__attached-to)\n.components-form-token-field__suggestions-list{block-size:96px;max-block-size:none}"); 10297 } 10298 var style_default9 = { "attached-to": "e7c40a32a00ab056__attached-to" }; 10299 function MediaAttachedToEdit({ 10300 data, 10301 onChange 10302 }) { 10303 const defaultPost = !!data.post && !!data?._embedded?.["wp:attached-to"]?.[0] ? [ 10304 { 10305 label: getRenderedContent( 10306 data._embedded?.["wp:attached-to"]?.[0]?.title 10307 ), 10308 value: data.post.toString() 10309 } 10310 ] : []; 10311 const [options, setOptions] = (0, import_element24.useState)(defaultPost); 10312 const [searchResults, setSearchResults] = (0, import_element24.useState)( 10313 [] 10314 ); 10315 const [isLoading, setIsLoading] = (0, import_element24.useState)(false); 10316 const [value, setValue] = (0, import_element24.useState)( 10317 data?.post?.toString() ?? null 10318 ); 10319 const postTypes = (0, import_data.useSelect)( 10320 (select) => select(import_core_data.store).getPostTypes(), 10321 [] 10322 ); 10323 const handleDetach = () => { 10324 onChange({ 10325 post: 0, 10326 _embedded: { ...data?._embedded, "wp:attached-to": void 0 } 10327 }); 10328 setValue(null); 10329 }; 10330 const onValueChange = async (filterValue) => { 10331 setIsLoading(true); 10332 const results = await (0, import_core_data.__experimentalFetchLinkSuggestions)( 10333 filterValue, 10334 /* 10335 * @TODO `fetchLinkSuggestions()` should accept `perPage` as an option argument. 10336 * `isInitialSuggestions` limits the result to 3, otherwise it's hardcoded to 20. 10337 */ 10338 { type: "post", isInitialSuggestions: true }, 10339 {} 10340 ); 10341 setSearchResults(results); 10342 const suggestions = results.map((result) => { 10343 return { 10344 label: result.title, 10345 value: result.id.toString() 10346 }; 10347 }); 10348 const includeCurrent = !filterValue && suggestions.findIndex((s) => s.value === value) === -1; 10349 setOptions(suggestions.concat(includeCurrent ? defaultPost : [])); 10350 setIsLoading(false); 10351 }; 10352 const debouncedValueChange = (0, import_compose.useDebounce)((0, import_compose.useEvent)(onValueChange), 300); 10353 const handleSelectOption = (selectedPostId) => { 10354 if (!selectedPostId) { 10355 handleDetach(); 10356 return; 10357 } 10358 setValue(selectedPostId); 10359 if (selectedPostId) { 10360 const selectedPost = searchResults.find( 10361 (result) => result.id === Number(selectedPostId) 10362 ); 10363 if (selectedPost && postTypes) { 10364 const postType = postTypes.find( 10365 (_postType) => _postType.slug === selectedPost?.type 10366 ); 10367 const attachedTo = { 10368 ...postType && { type: postType.slug }, 10369 id: Number(selectedPostId), 10370 title: { 10371 raw: selectedPost.title, 10372 rendered: selectedPost.title 10373 } 10374 }; 10375 onChange({ 10376 post: Number(selectedPostId), 10377 _embedded: { 10378 ...data?._embedded, 10379 "wp:attached-to": [attachedTo] 10380 } 10381 }); 10382 } 10383 } 10384 }; 10385 return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 10386 import_components.ComboboxControl, 10387 { 10388 className: style_default9["attached-to"], 10389 isLoading, 10390 label: (0, import_i18n4.__)("Attached to"), 10391 help: (0, import_i18n4.__)("Attach this file to a single post or page."), 10392 value, 10393 options, 10394 onFilterValueChange: (filterValue) => debouncedValueChange(filterValue), 10395 onChange: handleSelectOption, 10396 hideLabelFromVision: true, 10397 expandOnFocus: false 10398 } 10399 ); 10400 } 10401 10402 // packages/core-fields/build-module/attachment/attached_to/view.mjs 10403 var import_element25 = __toESM(require_element(), 1); 10404 var import_i18n5 = __toESM(require_i18n(), 1); 10405 var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); 10406 function MediaAttachedToView({ item }) { 10407 const [attachedPostTitle, setAttachedPostTitle] = (0, import_element25.useState)(null); 10408 const parentId = item.post; 10409 const embeddedPostId = item._embedded?.["wp:attached-to"]?.[0]?.id; 10410 const embeddedPostTitle = item._embedded?.["wp:attached-to"]?.[0]?.title; 10411 (0, import_element25.useEffect)(() => { 10412 if (!!parentId && parentId === embeddedPostId) { 10413 setAttachedPostTitle( 10414 getRenderedContent(embeddedPostTitle) || (0, import_i18n5.__)("(no title)") 10415 ); 10416 } 10417 if (!parentId) { 10418 setAttachedPostTitle((0, import_i18n5.__)("(Unattached)")); 10419 } 10420 }, [parentId, embeddedPostId, embeddedPostTitle]); 10421 return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: attachedPostTitle }); 10422 } 10423 10424 // packages/core-fields/build-module/attachment/attached_to/field.mjs 10425 var fieldExtensions2 = { 10426 Edit: MediaAttachedToEdit, 10427 render: MediaAttachedToView 10428 }; 10429 10430 // packages/core-fields/build-module/attachment/author/field.mjs 10431 var import_data2 = __toESM(require_data(), 1); 10432 var import_core_data2 = __toESM(require_core_data(), 1); 10433 10434 // packages/core-fields/build-module/shared/author/avatar.mjs 10435 var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); 10436 var STYLE_HASH_ATTRIBUTE11 = "data-wp-hash"; 10437 function getRuntime11() { 10438 const globalScope = globalThis; 10439 if (globalScope.__wpStyleRuntime) { 10440 return globalScope.__wpStyleRuntime; 10441 } 10442 globalScope.__wpStyleRuntime = { 10443 documents: /* @__PURE__ */ new Map(), 10444 styles: /* @__PURE__ */ new Map(), 10445 injectedStyles: /* @__PURE__ */ new WeakMap() 10446 }; 10447 if (typeof document !== "undefined") { 10448 registerDocument11(document); 10449 } 10450 return globalScope.__wpStyleRuntime; 10451 } 10452 function documentContainsStyleHash11(targetDocument, hash) { 10453 if (!targetDocument.head) { 10454 return false; 10455 } 10456 for (const style of targetDocument.head.querySelectorAll( 10457 `style[$STYLE_HASH_ATTRIBUTE11}]` 10458 )) { 10459 if (style.getAttribute(STYLE_HASH_ATTRIBUTE11) === hash) { 10460 return true; 10461 } 10462 } 10463 return false; 10464 } 10465 function injectStyle11(targetDocument, hash, css) { 10466 if (!targetDocument.head) { 10467 return; 10468 } 10469 const runtime = getRuntime11(); 10470 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10471 if (!injectedStyles) { 10472 injectedStyles = /* @__PURE__ */ new Set(); 10473 runtime.injectedStyles.set(targetDocument, injectedStyles); 10474 } 10475 if (injectedStyles.has(hash)) { 10476 return; 10477 } 10478 if (documentContainsStyleHash11(targetDocument, hash)) { 10479 injectedStyles.add(hash); 10480 return; 10481 } 10482 const style = targetDocument.createElement("style"); 10483 style.setAttribute(STYLE_HASH_ATTRIBUTE11, hash); 10484 style.appendChild(targetDocument.createTextNode(css)); 10485 targetDocument.head.appendChild(style); 10486 injectedStyles.add(hash); 10487 } 10488 function registerDocument11(targetDocument) { 10489 const runtime = getRuntime11(); 10490 runtime.documents.set( 10491 targetDocument, 10492 (runtime.documents.get(targetDocument) ?? 0) + 1 10493 ); 10494 for (const [hash, css] of runtime.styles) { 10495 injectStyle11(targetDocument, hash, css); 10496 } 10497 return () => { 10498 const count = runtime.documents.get(targetDocument); 10499 if (count === void 0) { 10500 return; 10501 } 10502 if (count <= 1) { 10503 runtime.documents.delete(targetDocument); 10504 return; 10505 } 10506 runtime.documents.set(targetDocument, count - 1); 10507 }; 10508 } 10509 function registerStyle11(hash, css) { 10510 const runtime = getRuntime11(); 10511 runtime.styles.set(hash, css); 10512 for (const targetDocument of runtime.documents.keys()) { 10513 injectStyle11(targetDocument, hash, css); 10514 } 10515 } 10516 if (typeof process === "undefined" || true) { 10517 registerStyle11("efeba968e6", "._4d84143be9dae462__icon,.dd9b5d817b3207dc__avatar{align-items:center;block-size:1lh;display:flex;flex-shrink:0;inline-size:var(--wpds-dimension-size-2xs,16px)}._4d84143be9dae462__icon svg{fill:currentColor;margin-inline:calc((var(--wpds-dimension-size-2xs, 16px) - var(--wpds-dimension-size-sm, 24px))/2)}.de468aa290326111__name{overflow:hidden;text-overflow:ellipsis}"); 10518 } 10519 var style_default10 = { "avatar": "dd9b5d817b3207dc__avatar", "icon": "_4d84143be9dae462__icon", "name": "de468aa290326111__name" }; 10520 function AuthorAvatar({ src }) { 10521 return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: style_default10.avatar, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(avatar_exports.Root, { size: "xs", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(avatar_exports.Image, { src, alt: "", keepMounted: true }) }) }); 10522 } 10523 10524 // packages/core-fields/build-module/attachment/author/view.mjs 10525 var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); 10526 var STYLE_HASH_ATTRIBUTE12 = "data-wp-hash"; 10527 function getRuntime12() { 10528 const globalScope = globalThis; 10529 if (globalScope.__wpStyleRuntime) { 10530 return globalScope.__wpStyleRuntime; 10531 } 10532 globalScope.__wpStyleRuntime = { 10533 documents: /* @__PURE__ */ new Map(), 10534 styles: /* @__PURE__ */ new Map(), 10535 injectedStyles: /* @__PURE__ */ new WeakMap() 10536 }; 10537 if (typeof document !== "undefined") { 10538 registerDocument12(document); 10539 } 10540 return globalScope.__wpStyleRuntime; 10541 } 10542 function documentContainsStyleHash12(targetDocument, hash) { 10543 if (!targetDocument.head) { 10544 return false; 10545 } 10546 for (const style of targetDocument.head.querySelectorAll( 10547 `style[$STYLE_HASH_ATTRIBUTE12}]` 10548 )) { 10549 if (style.getAttribute(STYLE_HASH_ATTRIBUTE12) === hash) { 10550 return true; 10551 } 10552 } 10553 return false; 10554 } 10555 function injectStyle12(targetDocument, hash, css) { 10556 if (!targetDocument.head) { 10557 return; 10558 } 10559 const runtime = getRuntime12(); 10560 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10561 if (!injectedStyles) { 10562 injectedStyles = /* @__PURE__ */ new Set(); 10563 runtime.injectedStyles.set(targetDocument, injectedStyles); 10564 } 10565 if (injectedStyles.has(hash)) { 10566 return; 10567 } 10568 if (documentContainsStyleHash12(targetDocument, hash)) { 10569 injectedStyles.add(hash); 10570 return; 10571 } 10572 const style = targetDocument.createElement("style"); 10573 style.setAttribute(STYLE_HASH_ATTRIBUTE12, hash); 10574 style.appendChild(targetDocument.createTextNode(css)); 10575 targetDocument.head.appendChild(style); 10576 injectedStyles.add(hash); 10577 } 10578 function registerDocument12(targetDocument) { 10579 const runtime = getRuntime12(); 10580 runtime.documents.set( 10581 targetDocument, 10582 (runtime.documents.get(targetDocument) ?? 0) + 1 10583 ); 10584 for (const [hash, css] of runtime.styles) { 10585 injectStyle12(targetDocument, hash, css); 10586 } 10587 return () => { 10588 const count = runtime.documents.get(targetDocument); 10589 if (count === void 0) { 10590 return; 10591 } 10592 if (count <= 1) { 10593 runtime.documents.delete(targetDocument); 10594 return; 10595 } 10596 runtime.documents.set(targetDocument, count - 1); 10597 }; 10598 } 10599 function registerStyle12(hash, css) { 10600 const runtime = getRuntime12(); 10601 runtime.styles.set(hash, css); 10602 for (const targetDocument of runtime.documents.keys()) { 10603 injectStyle12(targetDocument, hash, css); 10604 } 10605 } 10606 if (typeof process === "undefined" || true) { 10607 registerStyle12("efeba968e6", "._4d84143be9dae462__icon,.dd9b5d817b3207dc__avatar{align-items:center;block-size:1lh;display:flex;flex-shrink:0;inline-size:var(--wpds-dimension-size-2xs,16px)}._4d84143be9dae462__icon svg{fill:currentColor;margin-inline:calc((var(--wpds-dimension-size-2xs, 16px) - var(--wpds-dimension-size-sm, 24px))/2)}.de468aa290326111__name{overflow:hidden;text-overflow:ellipsis}"); 10608 } 10609 var style_default11 = { "avatar": "dd9b5d817b3207dc__avatar", "icon": "_4d84143be9dae462__icon", "name": "de468aa290326111__name" }; 10610 function AuthorView({ item }) { 10611 const author = item?._embedded?.author?.[0]; 10612 const text = author?.name; 10613 const imageUrl = author?.avatar_urls?.[48]; 10614 if (!text) { 10615 return null; 10616 } 10617 return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Stack, { direction: "row", gap: "xs", align: "flex-start", justify: "flex-start", children: [ 10618 !!imageUrl && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AuthorAvatar, { src: imageUrl }), 10619 /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: style_default11.name, children: text }) 10620 ] }); 10621 } 10622 10623 // packages/core-fields/build-module/attachment/author/field.mjs 10624 var fieldExtensions3 = { 10625 getElements: async () => { 10626 const authors = await (0, import_data2.resolveSelect)(import_core_data2.store).getEntityRecords( 10627 "root", 10628 "user", 10629 { 10630 per_page: -1, 10631 who: "authors", 10632 _fields: "id,name", 10633 context: "view" 10634 } 10635 ) ?? []; 10636 return authors.map(({ id, name }) => ({ 10637 value: id, 10638 label: name 10639 })); 10640 }, 10641 render: AuthorView 10642 }; 10643 10644 // packages/core-fields/build-module/attachment/get-raw-content.mjs 10645 function getRawContent(content) { 10646 if (!content) { 10647 return ""; 10648 } 10649 if (typeof content === "string") { 10650 return content; 10651 } 10652 if (typeof content === "object" && "raw" in content) { 10653 return content.raw || ""; 10654 } 10655 return ""; 10656 } 10657 10658 // packages/core-fields/build-module/attachment/caption/field.mjs 10659 var fieldExtensions4 = { 10660 getValue: ({ item }) => getRawContent(item?.caption), 10661 render: ({ item }) => getRawContent(item?.caption) || "-" 10662 }; 10663 10664 // packages/core-fields/build-module/attachment/description/field.mjs 10665 var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); 10666 var fieldExtensions5 = { 10667 getValue: ({ item }) => getRawContent(item?.description), 10668 render: ({ item }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: getRawContent(item?.description) || "-" }) 10669 }; 10670 10671 // packages/core-fields/build-module/attachment/filename/field.mjs 10672 var import_url2 = __toESM(require_url(), 1); 10673 10674 // packages/core-fields/build-module/attachment/filename/view.mjs 10675 var import_element26 = __toESM(require_element(), 1); 10676 var import_url = __toESM(require_url(), 1); 10677 var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); 10678 var STYLE_HASH_ATTRIBUTE13 = "data-wp-hash"; 10679 function getRuntime13() { 10680 const globalScope = globalThis; 10681 if (globalScope.__wpStyleRuntime) { 10682 return globalScope.__wpStyleRuntime; 10683 } 10684 globalScope.__wpStyleRuntime = { 10685 documents: /* @__PURE__ */ new Map(), 10686 styles: /* @__PURE__ */ new Map(), 10687 injectedStyles: /* @__PURE__ */ new WeakMap() 10688 }; 10689 if (typeof document !== "undefined") { 10690 registerDocument13(document); 10691 } 10692 return globalScope.__wpStyleRuntime; 10693 } 10694 function documentContainsStyleHash13(targetDocument, hash) { 10695 if (!targetDocument.head) { 10696 return false; 10697 } 10698 for (const style of targetDocument.head.querySelectorAll( 10699 `style[$STYLE_HASH_ATTRIBUTE13}]` 10700 )) { 10701 if (style.getAttribute(STYLE_HASH_ATTRIBUTE13) === hash) { 10702 return true; 10703 } 10704 } 10705 return false; 10706 } 10707 function injectStyle13(targetDocument, hash, css) { 10708 if (!targetDocument.head) { 10709 return; 10710 } 10711 const runtime = getRuntime13(); 10712 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10713 if (!injectedStyles) { 10714 injectedStyles = /* @__PURE__ */ new Set(); 10715 runtime.injectedStyles.set(targetDocument, injectedStyles); 10716 } 10717 if (injectedStyles.has(hash)) { 10718 return; 10719 } 10720 if (documentContainsStyleHash13(targetDocument, hash)) { 10721 injectedStyles.add(hash); 10722 return; 10723 } 10724 const style = targetDocument.createElement("style"); 10725 style.setAttribute(STYLE_HASH_ATTRIBUTE13, hash); 10726 style.appendChild(targetDocument.createTextNode(css)); 10727 targetDocument.head.appendChild(style); 10728 injectedStyles.add(hash); 10729 } 10730 function registerDocument13(targetDocument) { 10731 const runtime = getRuntime13(); 10732 runtime.documents.set( 10733 targetDocument, 10734 (runtime.documents.get(targetDocument) ?? 0) + 1 10735 ); 10736 for (const [hash, css] of runtime.styles) { 10737 injectStyle13(targetDocument, hash, css); 10738 } 10739 return () => { 10740 const count = runtime.documents.get(targetDocument); 10741 if (count === void 0) { 10742 return; 10743 } 10744 if (count <= 1) { 10745 runtime.documents.delete(targetDocument); 10746 return; 10747 } 10748 runtime.documents.set(targetDocument, count - 1); 10749 }; 10750 } 10751 function registerStyle13(hash, css) { 10752 const runtime = getRuntime13(); 10753 runtime.styles.set(hash, css); 10754 for (const targetDocument of runtime.documents.keys()) { 10755 injectStyle13(targetDocument, hash, css); 10756 } 10757 } 10758 if (typeof process === "undefined" || true) { 10759 registerStyle13("2ccce7fe48", ".dataviews-view-grid .d4415d2e9fe19d80__filename,.dataviews-view-list .d4415d2e9fe19d80__filename,.dataviews-view-table .d4415d2e9fe19d80__filename{display:inline-block;max-inline-size:15ch;overflow:hidden;text-overflow:ellipsis;vertical-align:top;white-space:nowrap}"); 10760 } 10761 var style_default12 = { "filename": "d4415d2e9fe19d80__filename" }; 10762 var TRUNCATE_LENGTH = 15; 10763 function FileNameView({ item }) { 10764 const fileName = (0, import_element26.useMemo)( 10765 () => item?.source_url ? (0, import_url.getFilename)(item.source_url) : null, 10766 [item?.source_url] 10767 ); 10768 if (!fileName) { 10769 return ""; 10770 } 10771 if (fileName.length <= TRUNCATE_LENGTH) { 10772 return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: style_default12.filename, children: fileName }); 10773 } 10774 return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(tooltip_exports.Root, { children: [ 10775 /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( 10776 tooltip_exports.Trigger, 10777 { 10778 render: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: style_default12.filename, children: fileName }) 10779 } 10780 ), 10781 /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(tooltip_exports.Popup, { children: fileName }) 10782 ] }); 10783 } 10784 10785 // packages/core-fields/build-module/attachment/filename/field.mjs 10786 var fieldExtensions6 = { 10787 getValue: ({ item }) => (0, import_url2.getFilename)(item?.source_url || ""), 10788 render: FileNameView 10789 }; 10790 10791 // packages/core-fields/build-module/attachment/filesize/field.mjs 10792 var import_i18n6 = __toESM(require_i18n(), 1); 10793 var KB_IN_BYTES = 1024; 10794 var MB_IN_BYTES = 1024 * KB_IN_BYTES; 10795 var GB_IN_BYTES = 1024 * MB_IN_BYTES; 10796 var TB_IN_BYTES = 1024 * GB_IN_BYTES; 10797 var PB_IN_BYTES = 1024 * TB_IN_BYTES; 10798 var EB_IN_BYTES = 1024 * PB_IN_BYTES; 10799 var ZB_IN_BYTES = 1024 * EB_IN_BYTES; 10800 var YB_IN_BYTES = 1024 * ZB_IN_BYTES; 10801 function getBytesString(bytes, unitSymbol, decimals = 2) { 10802 return (0, import_i18n6.sprintf)( 10803 // translators: 1: Actual bytes of a file. 2: The unit symbol (e.g. MB). 10804 (0, import_i18n6._x)("%1$s %2$s", "file size"), 10805 bytes.toLocaleString(void 0, { 10806 minimumFractionDigits: 0, 10807 maximumFractionDigits: decimals 10808 }), 10809 unitSymbol 10810 ); 10811 } 10812 function formatFileSize(bytes, decimals = 2) { 10813 if (bytes === 0) { 10814 return getBytesString(0, (0, import_i18n6._x)("B", "unit symbol"), decimals); 10815 } 10816 const quant = { 10817 /* translators: Unit symbol for yottabyte. */ 10818 [(0, import_i18n6._x)("YB", "unit symbol")]: YB_IN_BYTES, 10819 /* translators: Unit symbol for zettabyte. */ 10820 [(0, import_i18n6._x)("ZB", "unit symbol")]: ZB_IN_BYTES, 10821 /* translators: Unit symbol for exabyte. */ 10822 [(0, import_i18n6._x)("EB", "unit symbol")]: EB_IN_BYTES, 10823 /* translators: Unit symbol for petabyte. */ 10824 [(0, import_i18n6._x)("PB", "unit symbol")]: PB_IN_BYTES, 10825 /* translators: Unit symbol for terabyte. */ 10826 [(0, import_i18n6._x)("TB", "unit symbol")]: TB_IN_BYTES, 10827 /* translators: Unit symbol for gigabyte. */ 10828 [(0, import_i18n6._x)("GB", "unit symbol")]: GB_IN_BYTES, 10829 /* translators: Unit symbol for megabyte. */ 10830 [(0, import_i18n6._x)("MB", "unit symbol")]: MB_IN_BYTES, 10831 /* translators: Unit symbol for kilobyte. */ 10832 [(0, import_i18n6._x)("KB", "unit symbol")]: KB_IN_BYTES, 10833 /* translators: Unit symbol for byte. */ 10834 [(0, import_i18n6._x)("B", "unit symbol")]: 1 10835 }; 10836 for (const [unit, mag] of Object.entries(quant)) { 10837 if (bytes >= mag) { 10838 return getBytesString(bytes / mag, unit, decimals); 10839 } 10840 } 10841 return ""; 10842 } 10843 var fieldExtensions7 = { 10844 getValue: ({ item }) => item?.media_details?.filesize ? formatFileSize(item.media_details.filesize) : "", 10845 isVisible: (item) => !!item?.media_details?.filesize 10846 }; 10847 10848 // packages/core-fields/build-module/attachment/media_dimensions/field.mjs 10849 var import_i18n7 = __toESM(require_i18n(), 1); 10850 var fieldExtensions8 = { 10851 getValue: ({ item }) => item?.media_details?.width && item?.media_details?.height ? (0, import_i18n7.sprintf)( 10852 // translators: 1: Width. 2: Height. 10853 (0, import_i18n7._x)("%1$s × %2$s", "image dimensions"), 10854 item.media_details.width.toString(), 10855 item.media_details.height.toString() 10856 ) : "", 10857 isVisible: (item) => !!(item?.media_details?.width && item?.media_details?.height) 10858 }; 10859 10860 // packages/core-fields/build-module/attachment/media_thumbnail/view.mjs 10861 var import_data3 = __toESM(require_data(), 1); 10862 var import_core_data3 = __toESM(require_core_data(), 1); 10863 var import_element27 = __toESM(require_element(), 1); 10864 var import_url3 = __toESM(require_url(), 1); 10865 var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); 10866 var STYLE_HASH_ATTRIBUTE14 = "data-wp-hash"; 10867 function getRuntime14() { 10868 const globalScope = globalThis; 10869 if (globalScope.__wpStyleRuntime) { 10870 return globalScope.__wpStyleRuntime; 10871 } 10872 globalScope.__wpStyleRuntime = { 10873 documents: /* @__PURE__ */ new Map(), 10874 styles: /* @__PURE__ */ new Map(), 10875 injectedStyles: /* @__PURE__ */ new WeakMap() 10876 }; 10877 if (typeof document !== "undefined") { 10878 registerDocument14(document); 10879 } 10880 return globalScope.__wpStyleRuntime; 10881 } 10882 function documentContainsStyleHash14(targetDocument, hash) { 10883 if (!targetDocument.head) { 10884 return false; 10885 } 10886 for (const style of targetDocument.head.querySelectorAll( 10887 `style[$STYLE_HASH_ATTRIBUTE14}]` 10888 )) { 10889 if (style.getAttribute(STYLE_HASH_ATTRIBUTE14) === hash) { 10890 return true; 10891 } 10892 } 10893 return false; 10894 } 10895 function injectStyle14(targetDocument, hash, css) { 10896 if (!targetDocument.head) { 10897 return; 10898 } 10899 const runtime = getRuntime14(); 10900 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10901 if (!injectedStyles) { 10902 injectedStyles = /* @__PURE__ */ new Set(); 10903 runtime.injectedStyles.set(targetDocument, injectedStyles); 10904 } 10905 if (injectedStyles.has(hash)) { 10906 return; 10907 } 10908 if (documentContainsStyleHash14(targetDocument, hash)) { 10909 injectedStyles.add(hash); 10910 return; 10911 } 10912 const style = targetDocument.createElement("style"); 10913 style.setAttribute(STYLE_HASH_ATTRIBUTE14, hash); 10914 style.appendChild(targetDocument.createTextNode(css)); 10915 targetDocument.head.appendChild(style); 10916 injectedStyles.add(hash); 10917 } 10918 function registerDocument14(targetDocument) { 10919 const runtime = getRuntime14(); 10920 runtime.documents.set( 10921 targetDocument, 10922 (runtime.documents.get(targetDocument) ?? 0) + 1 10923 ); 10924 for (const [hash, css] of runtime.styles) { 10925 injectStyle14(targetDocument, hash, css); 10926 } 10927 return () => { 10928 const count = runtime.documents.get(targetDocument); 10929 if (count === void 0) { 10930 return; 10931 } 10932 if (count <= 1) { 10933 runtime.documents.delete(targetDocument); 10934 return; 10935 } 10936 runtime.documents.set(targetDocument, count - 1); 10937 }; 10938 } 10939 function registerStyle14(hash, css) { 10940 const runtime = getRuntime14(); 10941 runtime.styles.set(hash, css); 10942 for (const targetDocument of runtime.documents.keys()) { 10943 injectStyle14(targetDocument, hash, css); 10944 } 10945 } 10946 if (typeof process === "undefined" || true) { 10947 registerStyle14("745f53a63d", ".d31c1bb519429a5f__thumbnail{align-items:center;block-size:100%;display:flex;position:relative}@media not (prefers-reduced-motion){._1de2cd5c03163339__is-loaded img,.fa7f813024ab5e51__is-loading img{transition:opacity .1s linear}}.fa7f813024ab5e51__is-loading img{opacity:0}._1de2cd5c03163339__is-loaded img{opacity:1}._6fe4bbddd5625356__image{block-size:100%;display:block;inline-size:100%;object-fit:cover}._201afb54579badfa__stack{block-size:100%;box-sizing:border-box;color:var(--wpds-color-foreground-content-neutral-weak,#707070);inline-size:100%}._5fe1ffe29fe0dace__icon{fill:currentColor}._99ec2746aefe458f__filename{box-sizing:border-box;container-type:inline-size;inline-size:100%;padding:0 var(--wpds-dimension-padding-lg,16px);text-align:center}._5d94e568f29e1798__filename-text{display:block;margin-block-start:var(--wpds-dimension-gap-xs,4px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@container (max-width: 90px){._5d94e568f29e1798__filename-text{display:none}}"); 10948 } 10949 var style_default13 = { "thumbnail": "d31c1bb519429a5f__thumbnail", "is-loading": "fa7f813024ab5e51__is-loading", "is-loaded": "_1de2cd5c03163339__is-loaded", "image": "_6fe4bbddd5625356__image", "stack": "_201afb54579badfa__stack", "icon": "_5fe1ffe29fe0dace__icon", "filename": "_99ec2746aefe458f__filename", "filename-text": "_5d94e568f29e1798__filename-text" }; 10950 function getMediaTypeIcon(mimeType) { 10951 if (mimeType.startsWith("image/")) { 10952 return image_default; 10953 } 10954 if (mimeType.startsWith("video/")) { 10955 return video_default; 10956 } 10957 if (mimeType.startsWith("audio/")) { 10958 return audio_default; 10959 } 10960 return file_default; 10961 } 10962 function getBestImageUrl(media, configSizes) { 10963 const sizes = media?.media_details?.sizes; 10964 if (!sizes) { 10965 return media.source_url; 10966 } 10967 const targetWidth = configSizes ? parseInt(configSizes, 10) : NaN; 10968 if (Number.isNaN(targetWidth)) { 10969 return media.source_url; 10970 } 10971 const sorted = Object.values(sizes).filter( 10972 (size4) => typeof size4.width === "number" && !Number.isNaN(size4.width) 10973 ).toSorted((a, b) => a.width - b.width); 10974 if (!sorted.length) { 10975 return media.source_url; 10976 } 10977 const match = sorted.find((size4) => size4.width >= targetWidth) ?? sorted[sorted.length - 1]; 10978 return match.source_url; 10979 } 10980 function FallbackView({ 10981 item, 10982 filename 10983 }) { 10984 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: style_default13.thumbnail, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)( 10985 Stack, 10986 { 10987 direction: "column", 10988 justify: "center", 10989 align: "center", 10990 className: style_default13.stack, 10991 children: [ 10992 /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 10993 Icon, 10994 { 10995 className: style_default13.icon, 10996 icon: getMediaTypeIcon(item.mime_type || ""), 10997 size: 24 10998 } 10999 ), 11000 !!filename && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: style_default13.filename, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 11001 Text, 11002 { 11003 variant: "body-sm", 11004 className: style_default13["filename-text"], 11005 children: filename 11006 } 11007 ) }) 11008 ] 11009 } 11010 ) }); 11011 } 11012 function ImageView({ 11013 item, 11014 configSizes, 11015 onError 11016 }) { 11017 const imageUrl = getBestImageUrl(item, configSizes); 11018 const title = typeof item.title === "string" ? item.title : item.title?.raw; 11019 const [loadingState, setLoadingState] = (0, import_element27.useState)("loading"); 11020 (0, import_element27.useEffect)(() => { 11021 setLoadingState("loading"); 11022 }, [imageUrl]); 11023 const imgRef = (0, import_element27.useCallback)((img) => { 11024 if (img?.complete) { 11025 setLoadingState("instant"); 11026 } 11027 }, []); 11028 const handleLoad = () => { 11029 if (loadingState === "loading") { 11030 setLoadingState("loaded"); 11031 } 11032 }; 11033 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 11034 "div", 11035 { 11036 className: clsx_default(style_default13.thumbnail, { 11037 [style_default13["is-loading"]]: loadingState === "loading", 11038 [style_default13["is-loaded"]]: loadingState === "loaded" 11039 }), 11040 children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 11041 "img", 11042 { 11043 ref: imgRef, 11044 className: style_default13.image, 11045 src: imageUrl, 11046 alt: item.alt_text || title, 11047 onLoad: handleLoad, 11048 onError, 11049 loading: "lazy" 11050 } 11051 ) 11052 } 11053 ); 11054 } 11055 function MediaThumbnailView({ 11056 item, 11057 config 11058 }) { 11059 const [imageError, setImageError] = (0, import_element27.useState)(false); 11060 const _featuredMedia = (0, import_data3.useSelect)( 11061 (select) => { 11062 if (!item.featured_media) { 11063 return; 11064 } 11065 return select(import_core_data3.store).getEntityRecord( 11066 "postType", 11067 "attachment", 11068 item.featured_media 11069 ); 11070 }, 11071 [item.featured_media] 11072 ); 11073 const featuredMedia = item.featured_media ? _featuredMedia : item; 11074 if (!featuredMedia) { 11075 return null; 11076 } 11077 const filename = (0, import_url3.getFilename)(featuredMedia.source_url || ""); 11078 if (imageError || !(featuredMedia.mime_type || "").startsWith("image/")) { 11079 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FallbackView, { item: featuredMedia, filename: filename || "" }); 11080 } 11081 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 11082 ImageView, 11083 { 11084 item: featuredMedia, 11085 configSizes: config?.sizes, 11086 onError: () => setImageError(true) 11087 } 11088 ); 11089 } 11090 11091 // packages/core-fields/build-module/attachment/media_thumbnail/field.mjs 11092 var fieldExtensions9 = { 11093 render: MediaThumbnailView 11094 }; 11095 11096 // packages/core-fields/build-module/attachment/mime_type/field.mjs 11097 var fieldExtensions10 = { 11098 getValue: ({ item }) => item?.mime_type || "", 11099 render: ({ item }) => item?.mime_type || "-" 11100 }; 11101 11102 // packages/core-fields/build-module/shared/title/get-item-title.mjs 11103 var import_html_entities = __toESM(require_html_entities(), 1); 11104 var import_i18n8 = __toESM(require_i18n(), 1); 11105 function getItemTitle(item, fallback = (0, import_i18n8.__)("(no title)")) { 11106 let title = ""; 11107 if (typeof item.title === "string") { 11108 title = (0, import_html_entities.decodeEntities)(item.title); 11109 } else if (item.title && "rendered" in item.title) { 11110 title = (0, import_html_entities.decodeEntities)(item.title.rendered ?? ""); 11111 } else if (item.title && "raw" in item.title) { 11112 title = (0, import_html_entities.decodeEntities)(item.title.raw ?? ""); 11113 } 11114 return title || fallback; 11115 } 11116 11117 // packages/core-fields/build-module/shared/title/view.mjs 11118 var import_i18n9 = __toESM(require_i18n(), 1); 11119 var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); 11120 var STYLE_HASH_ATTRIBUTE15 = "data-wp-hash"; 11121 function getRuntime15() { 11122 const globalScope = globalThis; 11123 if (globalScope.__wpStyleRuntime) { 11124 return globalScope.__wpStyleRuntime; 11125 } 11126 globalScope.__wpStyleRuntime = { 11127 documents: /* @__PURE__ */ new Map(), 11128 styles: /* @__PURE__ */ new Map(), 11129 injectedStyles: /* @__PURE__ */ new WeakMap() 11130 }; 11131 if (typeof document !== "undefined") { 11132 registerDocument15(document); 11133 } 11134 return globalScope.__wpStyleRuntime; 11135 } 11136 function documentContainsStyleHash15(targetDocument, hash) { 11137 if (!targetDocument.head) { 11138 return false; 11139 } 11140 for (const style of targetDocument.head.querySelectorAll( 11141 `style[$STYLE_HASH_ATTRIBUTE15}]` 11142 )) { 11143 if (style.getAttribute(STYLE_HASH_ATTRIBUTE15) === hash) { 11144 return true; 11145 } 11146 } 11147 return false; 11148 } 11149 function injectStyle15(targetDocument, hash, css) { 11150 if (!targetDocument.head) { 11151 return; 11152 } 11153 const runtime = getRuntime15(); 11154 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11155 if (!injectedStyles) { 11156 injectedStyles = /* @__PURE__ */ new Set(); 11157 runtime.injectedStyles.set(targetDocument, injectedStyles); 11158 } 11159 if (injectedStyles.has(hash)) { 11160 return; 11161 } 11162 if (documentContainsStyleHash15(targetDocument, hash)) { 11163 injectedStyles.add(hash); 11164 return; 11165 } 11166 const style = targetDocument.createElement("style"); 11167 style.setAttribute(STYLE_HASH_ATTRIBUTE15, hash); 11168 style.appendChild(targetDocument.createTextNode(css)); 11169 targetDocument.head.appendChild(style); 11170 injectedStyles.add(hash); 11171 } 11172 function registerDocument15(targetDocument) { 11173 const runtime = getRuntime15(); 11174 runtime.documents.set( 11175 targetDocument, 11176 (runtime.documents.get(targetDocument) ?? 0) + 1 11177 ); 11178 for (const [hash, css] of runtime.styles) { 11179 injectStyle15(targetDocument, hash, css); 11180 } 11181 return () => { 11182 const count = runtime.documents.get(targetDocument); 11183 if (count === void 0) { 11184 return; 11185 } 11186 if (count <= 1) { 11187 runtime.documents.delete(targetDocument); 11188 return; 11189 } 11190 runtime.documents.set(targetDocument, count - 1); 11191 }; 11192 } 11193 function registerStyle15(hash, css) { 11194 const runtime = getRuntime15(); 11195 runtime.styles.set(hash, css); 11196 for (const targetDocument of runtime.documents.keys()) { 11197 injectStyle15(targetDocument, hash, css); 11198 } 11199 } 11200 if (typeof process === "undefined" || true) { 11201 registerStyle15("a4585ee5f7", "._6f88745c59f7b1df__title>span:first-child{display:block;flex-grow:0;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.bfcb43aba334e5f0__pattern-title>span:first-child{flex:1}"); 11202 } 11203 var style_default14 = { "title": "_6f88745c59f7b1df__title", "pattern-title": "bfcb43aba334e5f0__pattern-title" }; 11204 function BaseTitleView({ 11205 item, 11206 className, 11207 children 11208 }) { 11209 const renderedTitle = getItemTitle(item); 11210 return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)( 11211 Stack, 11212 { 11213 direction: "row", 11214 align: "center", 11215 justify: "flex-start", 11216 gap: "sm", 11217 className: clsx_default("fields-field__title", style_default14.title, className), 11218 children: [ 11219 /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: renderedTitle || (0, import_i18n9.__)("(no title)") }), 11220 children 11221 ] 11222 } 11223 ); 11224 } 11225 function TitleView({ item }) { 11226 return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(BaseTitleView, { item }); 11227 } 11228 11229 // packages/core-fields/build-module/attachment/title/field.mjs 11230 var fieldExtensions11 = { 11231 getValue: ({ item }) => getItemTitle(item), 11232 render: TitleView 11233 }; 11234 11235 // packages/core-fields/build-module/attachment/index.mjs 11236 var fields = { 11237 alt_text: fieldExtensions, 11238 attached_to: fieldExtensions2, 11239 author: fieldExtensions3, 11240 caption: fieldExtensions4, 11241 description: fieldExtensions5, 11242 filename: fieldExtensions6, 11243 filesize: fieldExtensions7, 11244 media_dimensions: fieldExtensions8, 11245 media_thumbnail: fieldExtensions9, 11246 mime_type: fieldExtensions10, 11247 title: fieldExtensions11 11248 }; 11249 var attachment_default = fields; 11250 export { 11251 attachment_default as default 11252 }; 11253 /*! Bundled license information: 11254 11255 use-sync-external-store/cjs/use-sync-external-store-shim.development.js: 11256 (** 11257 * @license React 11258 * use-sync-external-store-shim.development.js 11259 * 11260 * Copyright (c) Meta Platforms, Inc. and affiliates. 11261 * 11262 * This source code is licensed under the MIT license found in the 11263 * LICENSE file in the root directory of this source tree. 11264 *) 11265 11266 use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js: 11267 (** 11268 * @license React 11269 * use-sync-external-store-shim/with-selector.development.js 11270 * 11271 * Copyright (c) Meta Platforms, Inc. and affiliates. 11272 * 11273 * This source code is licensed under the MIT license found in the 11274 * LICENSE file in the root directory of this source tree. 11275 *) 11276 */
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Mon Nov 30 08:20:01 2026 | Cross-referenced by PHPXref |