1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="0afa157f-aa29-987e-f1e7-b8dafce28fee")}catch(e){}}(); 2(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([typeof document === "object" ? document.currentScript : undefined, 3991918, 820783, 4((__turbopack_context__) => { 5"use strict"; 6 7// MERGED MODULE: [project]/node_modules/@radix-ui/react-slot/dist/index.mjs [app-client] (ecmascript) 8;
9// src/slot.tsx 10var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 11// MERGED MODULE: [project]/node_modules/@radix-ui/react-compose-refs/dist/index.mjs [app-client] (ecmascript) 12; 13var __TURBOPACK__imported__module__271645__1 = __TURBOPACK__imported__module__271645__; 14var __defProp = Object.defineProperty; 15var __name = (target, value)=>__defProp(target, "name", { 16 value, 17 configurable: true 18 }); 19; 20function setRef(ref, value) { 21 if (typeof ref === "function") { 22 return ref(value); 23 } else if (ref !== null && ref !== void 0) { 24 ref.current = value; 25 } 26} 27__name(setRef, "setRef"); 28function composeRefs() { 29 for(var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++){ 30 refs[_key] = arguments[_key]; 31 } 32 return (node)=>{ 33 let hasCleanup = false; 34 const cleanups = refs.map((ref)=>{ 35 const cleanup = setRef(ref, node); 36 if (!hasCleanup && typeof cleanup == "function") { 37 hasCleanup = true; 38 } 39 return cleanup; 40 }); 41 if (hasCleanup) { 42 return ()=>{ 43 for(let i = 0; i < cleanups.length; i++){ 44 const cleanup = cleanups[i]; 45 if (typeof cleanup == "function") { 46 cleanup(); 47 } else { 48 setRef(refs[i], null); 49 } 50 } 51 }; 52 } 53 }; 54} 55__name(composeRefs, "composeRefs"); 56function useComposedRefs() { 57 for(var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++){ 58 refs[_key] = arguments[_key]; 59 } 60 return __TURBOPACK__imported__module__271645__1["useCallback"](composeRefs(...refs), refs); 61} 62__name(useComposedRefs, "useComposedRefs"); 63; 64__turbopack_context__.s([ 65 "useComposedRefs", 66 0, 67 useComposedRefs 68], 820783); 69var __defProp1 = Object.defineProperty; 70var __name1 = (target, value)=>__defProp1(target, "name", { 71 value, 72 configurable: true 73 }); 74; 75; 76// @__NO_SIDE_EFFECTS__ 77function createSlot(ownerName) { 78 const Slot2 = __TURBOPACK__imported__module__271645__.forwardRef((props, forwardedRef)=>{ 79 var _slottableElement_props; 80 let { children, ...slotProps } = props; 81 let slottableElement = null; 82 let hasSlottable = false; 83 const newChildren = []; 84 if (isLazyComponent(children) && typeof use === "function") { 85 children = use(children._payload); 86 } 87 __TURBOPACK__imported__module__271645__.Children.forEach(children, (maybeSlottable)=>{ 88 if (isSlottable(maybeSlottable)) { 89 var _slottableElement_props; 90 hasSlottable = true; 91 const slottable = maybeSlottable; 92 let child = "child" in slottable.props ? slottable.props.child : slottable.props.children; 93 if (isLazyComponent(child) && typeof use === "function") { 94 child = use(child._payload); 95 } 96 slottableElement = getSlottableElementFromSlottable(slottable, child); 97 newChildren.push(slottableElement === null || slottableElement === void 0 ? void 0 : (_slottableElement_props = slottableElement.props) === null || _slottableElement_props === void 0 ? void 0 : _slottableElement_props.children); 98 } else { 99 newChildren.push(maybeSlottable); 100 } 101 }); 102 if (slottableElement) { 103 slottableElement = __TURBOPACK__imported__module__271645__.cloneElement(slottableElement, void 0, newChildren); 104 } else if (// A `Slottable` was found but it didn't resolve to a single element (e.g. 105 // it wrapped multiple elements, text, or a render-prop `child` that 106 // wasn't an element). Don't fall back to treating the `Slottable` wrapper 107 // itself as the slot target â throw a descriptive error below instead. 108 !hasSlottable && __TURBOPACK__imported__module__271645__.Children.count(children) === 1 && __TURBOPACK__imported__module__271645__.isValidElement(children)) { 109 slottableElement = children; 110 } 111 const slottableElementRef = slottableElement ? getElementRef(slottableElement) : void 0; 112 const composedRef = useComposedRefs(forwardedRef, slottableElementRef); 113 if (!slottableElement) { 114 if (children || children === 0) { 115 throw new Error(hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName)); 116 } 117 return children; 118 } 119 const mergedProps = mergeProps(slotProps, (_slottableElement_props = slottableElement.props) !== null && _slottableElement_props !== void 0 ? _slottableElement_props : {}); 120 if (slottableElement.type !== __TURBOPACK__imported__module__271645__.Fragment) { 121 mergedProps.ref = forwardedRef ? composedRef : slottableElementRef; 122 } 123 return __TURBOPACK__imported__module__271645__.cloneElement(slottableElement, mergedProps); 124 }); 125 Slot2.displayName = "".concat(ownerName, ".Slot"); 126 return Slot2; 127} 128__name1(createSlot, "createSlot"); 129var Slot = /* @__PURE__ */ createSlot("Slot"); 130var SLOTTABLE_IDENTIFIER = Symbol.for("radix.slottable"); 131// @__NO_SIDE_EFFECTS__ 132function createSlottable(ownerName) { 133 const Slottable2 = /* @__PURE__ */ __name1((props)=>"child" in props ? props.children(props.child) : props.children, "Slottable");
134 Slottable2.displayName = "".concat(ownerName, ".Slottable"); 135 Slottable2.__radixId = SLOTTABLE_IDENTIFIER; 136 return Slottable2; 137} 138__name1(createSlottable, "createSlottable"); 139var Slottable = /* @__PURE__ */ createSlottable("Slottable"); 140var getSlottableElementFromSlottable = /* @__PURE__ */ __name1((slottable, child)=>{ 141 if ("child" in slottable.props) { 142 const child2 = slottable.props.child; 143 if (!__TURBOPACK__imported__module__271645__.isValidElement(child2)) return null; 144 return __TURBOPACK__imported__module__271645__.cloneElement(child2, void 0, slottable.props.children(child2.props.children)); 145 } 146 return __TURBOPACK__imported__module__271645__.isValidElement(child) ? child : null; 147}, "getSlottableElementFromSlottable"); 148function mergeProps(slotProps, childProps) { 149 const overrideProps = { 150 ...childProps 151 }; 152 for(const propName in childProps){ 153 const slotPropValue = slotProps[propName]; 154 const childPropValue = childProps[propName]; 155 const isHandler = /^on[A-Z]/.test(propName); 156 if (isHandler) { 157 if (slotPropValue && childPropValue) { 158 overrideProps[propName] = function() { 159 for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ 160 args[_key] = arguments[_key]; 161 } 162 const result = childPropValue(...args); 163 slotPropValue(...args); 164 return result; 165 }; 166 } else if (slotPropValue) { 167 overrideProps[propName] = slotPropValue; 168 } 169 } else if (propName === "style") { 170 overrideProps[propName] = { 171 ...slotPropValue, 172 ...childPropValue 173 }; 174 } else if (propName === "className") { 175 overrideProps[propName] = [ 176 slotPropValue, 177 childPropValue 178 ].filter(Boolean).join(" "); 179 } 180 } 181 return { 182 ...slotProps, 183 ...overrideProps 184 }; 185} 186__name1(mergeProps, "mergeProps"); 187function getElementRef(element) { 188 var _Object_getOwnPropertyDescriptor, _Object_getOwnPropertyDescriptor1; 189 let getter = (_Object_getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor(element.props, "ref")) === null || _Object_getOwnPropertyDescriptor === void 0 ? void 0 : _Object_getOwnPropertyDescriptor.get; 190 let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; 191 if (mayWarn) { 192 return element.ref; 193 } 194 getter = (_Object_getOwnPropertyDescriptor1 = Object.getOwnPropertyDescriptor(element, "ref")) === null || _Object_getOwnPropertyDescriptor1 === void 0 ? void 0 : _Object_getOwnPropertyDescriptor1.get; 195 mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; 196 if (mayWarn) { 197 return element.props.ref; 198 } 199 return element.props.ref || element.ref; 200} 201__name1(getElementRef, "getElementRef"); 202function isSlottable(child) { 203 return __TURBOPACK__imported__module__271645__.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER; 204} 205__name1(isSlottable, "isSlottable"); 206var REACT_LAZY_TYPE = Symbol.for("react.lazy"); 207function isLazyComponent(element) { 208 return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload); 209} 210__name1(isLazyComponent, "isLazyComponent"); 211function isPromiseLike(value) { 212 return typeof value === "object" && value !== null && "then" in value; 213} 214__name1(isPromiseLike, "isPromiseLike"); 215var createSlotError = /* @__PURE__ */ __name1((ownerName)=>{ 216 return "".concat(ownerName, " failed to slot onto its children. Expected a single React element child or `Slottable`."); 217}, "createSlotError"); 218var createSlottableError = /* @__PURE__ */ __name1((ownerName)=>{ 219 return "".concat(ownerName, " failed to slot onto its `Slottable`. Expected `Slottable` to re
219ceive a single React element child."); 220}, "createSlottableError"); 221var use = __TURBOPACK__imported__module__271645__[" use ".trim().toString()]; 222; 223__turbopack_context__.s([ 224 "Slot", 225 0, 226 Slot, 227 "createSlot", 228 0, 229 createSlot, 230 "createSlottable", 231 0, 232 createSlottable 233], 991918); 234}), 235248425, ((__turbopack_context__) => { 236"use strict"; 237
238// src/primitive.tsx 239var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 240var __TURBOPACK__imported__module__174080__ = __turbopack_context__.i(174080); 241var __TURBOPACK__imported__module__991918__ = __turbopack_context__.i(991918); 242var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 243var __defProp = Object.defineProperty; 244var __name = (target, value)=>__defProp(target, "name", { 245 value, 246 configurable: true 247 }); 248; 249; 250; 251; 252var NODES = [ 253 "a", 254 "button", 255 "div", 256 "form", 257 "h2", 258 "h3", 259 "img", 260 "input", 261 "label", 262 "li", 263 "nav", 264 "ol", 265 "p", 266 "select", 267 "span", 268 "svg", 269 "ul" 270]; 271var Primitive = NODES.reduce((primitive, node)=>{ 272 const Slot = (0, __TURBOPACK__imported__module__991918__["createSlot"])("Primitive.".concat(node)); 273 const Node = __TURBOPACK__imported__module__271645__["forwardRef"]((props, forwardedRef)=>{ 274 const { asChild, ...primitiveProps } = props; 275 const Comp = asChild ? Slot : node; 276 if (typeof window !== "undefined") { 277 window[Symbol.for("radix-ui")] = true; 278 } 279 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(Comp, { 280 ...primitiveProps, 281 ref: forwardedRef 282 }); 283 }); 284 Node.displayName = "Primitive.".concat(node); 285 return { 286 ...primitive, 287 [node]: Node 288 }; 289}, {}); 290function dispatchDiscreteCustomEvent(target, event) { 291 if (target) __TURBOPACK__imported__module__174080__["flushSync"](()=>target.dispatchEvent(event)); 292} 293__name(dispatchDiscreteCustomEvent, "dispatchDiscreteCustomEvent"); 294var Root = Primitive; 295; 296__turbopack_context__.s([ 297 "Primitive", 298 0, 299 Primitive, 300 "dispatchDiscreteCustomEvent", 301 0, 302 dispatchDiscreteCustomEvent 303]); 304}), 305981140, ((__turbopack_context__) => { 306"use strict"; 307 308var __defProp = Object.defineProperty; 309var __name = (target, value)=>__defProp(target, "name", { 310 value, 311 configurable: true 312 });
313// src/primitive.tsx 314var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); 315function composeEventHandlers(originalEventHandler, ourEventHandler) { 316 let { checkForDefaultPrevented = true } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; 317 return /* @__PURE__ */ __name(function handleEvent(event) { 318 originalEventHandler === null || originalEventHandler === void 0 ? void 0 : originalEventHandler(event); 319 if (checkForDefaultPrevented === false || !event || !event.defaultPrevented) { 320 return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event); 321 } 322 }, "handleEvent"); 323} 324__name(composeEventHandlers, "composeEventHandlers"); 325function getOwnerWindow(element) { 326 var _ref; 327 var _element_ownerDocument; 328 if (!canUseDOM) { 329 throw new Error("Cannot access window outside of the DOM"); 330 } 331 return (_ref = element === null || element === void 0 ? void 0 : (_element_ownerDocument = element.ownerDocument) === null || _element_ownerDocument === void 0 ? void 0 : _element_ownerDocument.defaultView) !== null && _ref !== void 0 ? _ref : window; 332} 333__name(getOwnerWindow, "getOwnerWindow"); 334function getOwnerDocument(element) { 335 var _ref; 336 if (!canUseDOM) { 337 throw new Error("Cannot access document outside of the DOM"); 338 } 339 return (_ref = element === null || element === void 0 ? void 0 : element.ownerDocument) !== null && _ref !== void 0 ? _ref : document; 340} 341__name(getOwnerDocument, "getOwnerDocument"); 342function getActiveElement(node) { 343 let activeDescendant = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; 344 const { activeElement } = getOwnerDocument(node); 345 if (!(activeElement === null || activeElement === void 0 ? void 0 : activeElement.nodeName)) { 346 return null; 347 } 348 if (isFrame(activeElement) && activeElement.contentDocument) { 349 return getActiveElement(activeElement.contentDocument.body, activeDescendant); 350 } 351 if (activeDescendant) { 352 const id = activeElement.getAttribute("aria-activedescendant"); 353 if (id) { 354 const element = getOwnerDocument(activeElement).getElementById(id); 355 if (element) { 356 return element; 357 } 358 } 359 } 360 return activeElement; 361} 362__name(getActiveElement, "getActiveElement"); 363function isFrame(element) { 364 return element.tagName === "IFRAME"; 365} 366__name(isFrame, "isFrame"); 367; 368__turbopack_context__.s([ 369 "composeEventHandlers", 370 0, 371 composeEventHandlers 372]); 373}), 37430030, ((__turbopack_context__) => { 375"use strict"; 376
377// src/create-context.tsx 378var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 379var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 380var __defProp = Object.defineProperty; 381var __name = (target, value)=>__defProp(target, "name", { 382 value, 383 configurable: true 384 }); 385; 386; 387// @__NO_SIDE_EFFECTS__ 388function createContext2(rootComponentName, defaultContext) { 389 const Context = __TURBOPACK__imported__module__271645__["createContext"](defaultContext); 390 Context.displayName = rootComponentName + "Context"; 391 const Provider = /* @__PURE__ */ __name((props)=>{ 392 const { children, ...context } = props; 393 const value = __TURBOPACK__imported__module__271645__["useMemo"](()=>context, Object.values(context)); 394 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(Context.Provider, { 395 value, 396 children 397 }); 398 }, "Provider"); 399 Provider.displayName = rootComponentName + "Provider"; 400 function useContext2(consumerName) { 401 let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 402 const { optional = false } = options; 403 const context = __TURBOPACK__imported__module__271645__["useContext"](Context); 404 if (context) return context; 405 if (defaultContext !== void 0) return defaultContext; 406 if (optional) return void 0; 407 throw new Error("`".concat(consumerName, "` must be used within `").concat(rootComponentName, "`")); 408 } 409 __name(useContext2, "useContext"); 410 return [ 411 Provider, 412 useContext2 413 ]; 414} 415__name(createContext2, "createContext"); 416// @__NO_SIDE_EFFECTS__ 417function createContextScope(scopeName) { 418 let createContextScopeDeps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; 419 let defaultContexts = []; 420 function createContext3(rootComponentName, defaultContext) { 421 const BaseContext = __TURBOPACK__imported__module__271645__["createContext"](defaultContext); 422 BaseContext.displayName = rootComponentName + "Context"; 423 const index = defaultContexts.length; 424 defaultContexts = [ 425 ...defaultContexts, 426 defaultContext 427 ]; 428 const Provider = /* @__PURE__ */ __name((props)=>{ 429 var _scope_scopeName; 430 const { scope, children, ...context } = props; 431 const Context = (scope === null || scope === void 0 ? void 0 : (_scope_scopeName = scope[scopeName]) === null || _scope_scopeName === void 0 ? void 0 : _scope_scopeName[index]) || BaseContext; 432 const value = __TURBOPACK__imported__module__271645__["useMemo"](()=>context, Object.values(context)); 433 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(Context.Provider, { 434 value, 435 children 436 }); 437 }, "Provider"); 438 Provider.displayName = rootComponentName + "Provider"; 439 function useContext2(consumerName, scope) { 440 let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; 441 var _scope_scopeName; 442 const { optional = false } = options; 443 const Context = (scope === null || scope === void 0 ? void 0 : (_scope_scopeName = scope[scopeName]) === null || _scope_scopeName === void 0 ? void 0 : _scope_scopeName[index]) || BaseContext; 444 const context = __TURBOPACK__imported__module__271645__["useContext"](Context); 445 if (context) return context; 446 if (defaultContext !== void 0) return defaultContext; 447 if (optional) return void 0; 448 throw new Error("`".concat(consumerName, "` must be used within `").concat(rootComponentName, "`")); 449 } 450 __name(useContext2, "useContext"); 451 return [ 452 Provider, 453 useContext2 454 ]; 455 } 456 __name(createContext3, "createContext"); 457 const createScope = /* @__PURE__ */ __name(()=>{ 458 const scopeContexts = defaultContexts.map((defaultContext)=>{ 459 return __TURBOPACK__imported__module__271645__["createContext"](defaultContext); 460 }); 461 return /* @__PURE__ */ __name(function useScope(scope) { 462 const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts; 463 return __TURBOPACK__imported__module__271645__["useMemo"](()=>({ 464 ["__scope".concat(scopeName)]: { 465 ...scope, 466 [scopeName]: contexts 467 } 468 }), [ 469 scope, 470 contexts 471 ]); 472 }, "useScope"); 473 }, "createScope"); 474 createScope.scopeName = scopeName; 475 return [ 476 createContext3, 477 composeContextScopes(createScope, ...createContextScopeDeps) 478 ]; 479} 480__name(createContextScope, "createContextScope"); 481function composeContextScopes() { 482 for(var _len = arguments.length, scopes = new Array(_len), _key = 0; _key < _len; _key++){ 483 scopes[_key] = arguments[_key]; 484 } 485 const baseScope = scopes[0]; 486 if (scopes.length === 1) return baseScope; 487 const createScope = /* @__PURE__ */ __name(()=>{
488 const scopeHooks = scopes.map((createScope2)=>({ 489 useScope: createScope2(), 490 scopeName: createScope2.scopeName 491 })); 492 return /* @__PURE__ */ __name(function useComposedScopes(overrideScopes) { 493 const nextScopes = scopeHooks.reduce((nextScopes2, param)=>{ 494 let { useScope, scopeName } = param; 495 const scopeProps = useScope(overrideScopes); 496 const currentScope = scopeProps["__scope".concat(scopeName)]; 497 return { 498 ...nextScopes2, 499 ...currentScope 500 }; 501 }, {}); 502 return __TURBOPACK__imported__module__271645__["useMemo"](()=>({ 503 ["__scope".concat(baseScope.scopeName)]: nextScopes 504 }), [ 505 nextScopes 506 ]); 507 }, "useComposedScopes"); 508 }, "createScope"); 509 createScope.scopeName = baseScope.scopeName; 510 return createScope; 511} 512__name(composeContextScopes, "composeContextScopes"); 513; 514__turbopack_context__.s([ 515 "createContextScope", 516 0, 517 createContextScope 518]); 519}), 520934620, ((__turbopack_context__) => { 521"use strict"; 522
523// src/use-layout-effect.tsx 524var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 525var _globalThis; 526; 527var useLayoutEffect2 = ((_globalThis = globalThis) === null || _globalThis === void 0 ? void 0 : _globalThis.document) ? __TURBOPACK__imported__module__271645__["useLayoutEffect"] : ()=>{}; 528; 529__turbopack_context__.s([ 530 "useLayoutEffect", 531 0, 532 useLayoutEffect2 533]); 534}), 535705844, ((__turbopack_context__) => { 536"use strict"; 537
538// src/internal/is-development.false.ts 539var IS_DEVELOPMENT = false; 540; 541__turbopack_context__.s([ 542 "IS_DEVELOPMENT", 543 0, 544 IS_DEVELOPMENT 545]); 546}), 547369340, ((__turbopack_context__) => { 548"use strict"; 549 550// MERGED MODULE: [project]/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs [app-client] (ecmascript) 551;
552// src/use-controllable-state.tsx 553var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 554var __TURBOPACK__imported__module__705844__ = __turbopack_context__.i(705844); 555var __TURBOPACK__imported__module__934620__ = __turbopack_context__.i(934620); 556// MERGED MODULE: [project]/node_modules/@radix-ui/react-use-effect-event/dist/index.mjs [app-client] (ecmascript) 557; 558var __TURBOPACK__imported__module__934620__1 = __TURBOPACK__imported__module__934620__; 559var __TURBOPACK__imported__module__271645__1 = __TURBOPACK__imported__module__271645__; 560var __defProp = Object.defineProperty; 561var __name = (target, value)=>__defProp(target, "name", { 562 value, 563 configurable: true 564 }); 565; 566; 567var useReactEffectEvent = __TURBOPACK__imported__module__271645__1[" useEffectEvent ".trim().toString()]; 568var useReactInsertionEffect = __TURBOPACK__imported__module__271645__1[" useInsertionEffect ".trim().toString()]; 569function useEffectEvent(callback) { 570 if (typeof useReactEffectEvent === "function") { 571 return useReactEffectEvent(callback); 572 } 573 const ref = __TURBOPACK__imported__module__271645__1.useRef(()=>{ 574 throw new Error("Cannot call an event handler while rendering."); 575 }); 576 if (typeof useReactInsertionEffect === "function") { 577 useReactInsertionEffect(()=>{ 578 ref.current = callback; 579 }); 580 } else { 581 (0, __TURBOPACK__imported__module__934620__1["useLayoutEffect"])(()=>{ 582 ref.current = callback; 583 }); 584 } 585 return __TURBOPACK__imported__module__271645__1.useMemo(()=>function() { 586 for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ 587 args[_key] = arguments[_key]; 588 } 589 var _ref_current; 590 return (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.call(ref, ...args); 591 }, []); 592} 593__name(useEffectEvent, "useEffectEvent"); 594; 595var __defProp1 = Object.defineProperty; 596var __name1 = (target, value)=>__defProp1(target, "name", { 597 value, 598 configurable: true 599 }); 600; 601; 602; 603var useInsertionEffect = __TURBOPACK__imported__module__271645__[" useInsertionEffect ".trim().toString()] || __TURBOPACK__imported__module__934620__["useLayoutEffect"]; 604function useControllableState(param) { 605 let { prop, defaultProp, onChange = /* @__PURE__ */ __name1(()=>{}, "onChange"), caller } = param; 606 const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({ 607 defaultProp, 608 onChange 609 }); 610 const isControlled = prop !== void 0; 611 const value = isControlled ? prop : uncontrolledProp; 612 if (__TURBOPACK__imported__module__705844__["IS_DEVELOPMENT"]) { 613 const isControlledRef = __TURBOPACK__imported__module__271645__.useRef(prop !== void 0); 614 __TURBOPACK__imported__module__271645__.useEffect(()=>{ 615 const wasControlled = isControlledRef.current; 616 if (wasControlled !== isControlled) { 617 const from = wasControlled ? "controlled" : "uncontrolled"; 618 const to = isControlled ? "controlled" : "uncontrolled"; 619 console.warn("".concat(caller, " is changing from ").concat(from, " to ").concat(to, ". Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.")); 620 } 621 isControlledRef.current = isControlled; 622 }, [ 623 isControlled, 624 caller 625 ]); 626 } 627 const setValue = __TURBOPACK__imported__module__271645__.useCallback((nextValue)=>{ 628 if (isControlled) { 629 const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue; 630 if (value2 !== prop) { 631 var _onChangeRef_current; 632 (_onChangeRef_current = onChangeRef.current) === null || _onChangeRef_current === void 0 ? void 0 : _onChangeRef_current.call(onChangeRef, value2); 633 } 634 } else { 635 setUncontrolledProp(nextValue); 636 } 637 }, [ 638 isControlled, 639 prop, 640 setUncontrolledProp, 641 onChangeRef 642 ]); 643 return [ 644 value, 645 setValue 646 ]; 647} 648__name1(useControllableState, "useControllableState"); 649function useUncontrolledState(param) { 650 let { defaultProp, onChange } = param; 651 const [value, setValue] = __TURBOPACK__imported__module__271645__.useState(defaultProp); 652 const prevValueRef = __TURBOPACK__imported__module__271645__.useRef(value); 653 const onChangeRef = __TURBOPACK__imported__module__271645__.useRef(onChange); 654 useInsertionEffect(()=>{ 655 onChangeRef.current = onChange; 656 }, [ 657 onChange 658 ]); 659 __TURBOPACK__imported__module__271645__.useEffect(()=>{ 660 if (prevValueRef.current !== value) { 661 var _onChangeRef_current; 662 (_onChangeRef_current = onChangeRef.current) === null || _onChangeRef_current === void 0 ? void 0 : _onChangeRef_current.call(onChangeRef, value); 663 prevValueRef.current = value; 664 } 665 }, [ 666 value, 667 prevValueRef 668 ]); 669 return [ 670 value, 671 setValue, 672 onChangeRef 673 ]; 674} 675__name1(useUncontrolledState, "useUncontrolledState"); 676function isFunction(value) { 677 return typeof value === "function"; 678} 679__name1(isFunction, "isFunction"); 680; 681; 682; 683var SYNC_STATE = Symbol("RADIX:SYNC_STATE"); 684function useControllableStateReducer(reducer, userArgs, initialArg, init) { 685 const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs; 686 const isControlled = controlledState !== void 0; 687 const onChange = useEffectEvent(onChangeProp); 688 if (__TURBOPACK__imported__module__705844__["IS_DEVELOPMENT"]) { 689 const isControlledRef = __TURBOPACK__imported__module__271645__.useRef(controlledState !== void 0); 690 __TURBOPACK__imported__module__271645__.useEffect(()=>{ 691 const wasControlled = isControlledRef.current; 692 if (wasControlled !== isControlled) { 693 const from = wasControlled ? "controlled" : "uncontrolled"; 694 const to = isControlled ? "controlled" : "uncontrolled"; 695 console.warn("".concat(caller, " is changing from ").concat(from, " to ").concat(to, ". Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.")); 696 } 697 isControlledRef.current = isControlled; 698 }, [ 699 isControlled, 700 caller 701 ]); 702 } 703 const args = [ 704 { 705 ...initialArg, 706 state: defaultProp 707 } 708 ]; 709 if (init) { 710 args.push(init); 711 } 712 const [internalState, dispatch] = __TURBOPACK__imported__module__271645__.useReducer((state2, action)=>{ 713 if (action.type === SYNC_STATE) { 714 return { 715 ...state2, 716 state: action.state 717 }; 718 } 719 const next = reducer(state2, action); 720 if (isControlled && !Object.is(next.state, state2.state)) { 721 onChange(next.state); 722 } 723 return next; 724 }, ...args); 725 const uncontrolledState = internalState.state; 726 const prevValueRef = __TURBOPACK__imported__module__271645__.useRef(uncontrolledState); 727 __TURBOPACK__imported__module__271645__.useEffect(()=>{ 728 if (prevValueRef.current !== uncontrolledState) { 729 prevValueRef.current = uncontrolledState; 730 if (!isControlled) { 731 onChange(uncontrolledState); 732 } 733 } 734 }, [ 735 uncontrolledState, 736 prevValueRef, 737 isControlled 738 ]); 739 const state = __TURBOPACK__imported__module__271645__.useMemo(()=>{ 740 const isControlled2 = controlledState !== void 0; 741 if (isControlled2) { 742 return { 743 ...internalState, 744 state: controlledState 745 }; 746 } 747 return internalState; 748 }, [ 749 internalState, 750 controlledState 751 ]); 752 __TURBOPACK__imported__module__271645__.useEffect(()=>{ 753 if (isControlled && !Object.is(controlledState, internalState.state)) { 754 dispatch({ 755 type: SYNC_STATE, 756 state: controlledState 757 }); 758 } 759 }, [ 760 controlledState, 761 internalState.state, 762 isControlled 763 ]); 764 return [ 765 state, 766 dispatch 767 ]; 768} 769__name1(useControllableStateReducer, "useControllableStateReducer"); 770; 771__turbopack_context__.s([ 772 "useControllableState", 773 0, 774 useControllableState 775], 369340); 776}), 777296626, ((__turbopack_context__) => { 778"use strict"; 779
780// src/presence.tsx 781var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 782var __TURBOPACK__imported__module__934620__ = __turbopack_context__.i(934620); 783"use client"; 784var __defProp = Object.defineProperty; 785var __name = (target, value)=>__defProp(target, "name", { 786 value, 787 configurable: true 788 }); 789; 790; 791; 792function useStateMachine(initialState, machine) { 793 return __TURBOPACK__imported__module__271645__["useReducer"]((state, event)=>{ 794 const nextState = machine[state][event]; 795 return nextState !== null && nextState !== void 0 ? nextState : state; 796 }, initialState); 797} 798__name(useStateMachine, "useStateMachine");
799// src/presence.tsx 800var Presence = /* @__PURE__ */ __name((props)=>{ 801 const { present, children } = props; 802 const presence = usePresence(present); 803 const child = typeof children === "function" ? children({ 804 present: presence.isPresent 805 }) : __TURBOPACK__imported__module__271645__["Children"].only(children); 806 const ref = useStableComposedRefs(presence.ref, getElementRef(child)); 807 const forceMount = typeof children === "function"; 808 return forceMount || presence.isPresent ? __TURBOPACK__imported__module__271645__["cloneElement"](child, { 809 ref 810 }) : null; 811}, "Presence"); 812function usePresence(present) { 813 const [node, setNode] = __TURBOPACK__imported__module__271645__["useState"](); 814 const stylesRef = __TURBOPACK__imported__module__271645__["useRef"](null); 815 const prevPresentRef = __TURBOPACK__imported__module__271645__["useRef"](present); 816 const prevAnimationNameRef = __TURBOPACK__imported__module__271645__["useRef"]("none"); 817 const mountAnimationNameRef = __TURBOPACK__imported__module__271645__["useRef"](void 0); 818 const initialState = present ? "mounted" : "unmounted"; 819 const [state, send] = useStateMachine(initialState, { 820 mounted: { 821 UNMOUNT: "unmounted", 822 ANIMATION_OUT: "unmountSuspended" 823 }, 824 unmountSuspended: { 825 MOUNT: "mounted", 826 ANIMATION_END: "unmounted" 827 }, 828 unmounted: { 829 MOUNT: "mounted" 830 } 831 }); 832 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 833 if (state === "mounted") { 834 var _mountAnimationNameRef_current; 835 prevAnimationNameRef.current = (_mountAnimationNameRef_current = mountAnimationNameRef.current) !== null && _mountAnimationNameRef_current !== void 0 ? _mountAnimationNameRef_current : getAnimationName(stylesRef.current); 836 mountAnimationNameRef.current = void 0; 837 } else { 838 prevAnimationNameRef.current = "none"; 839 } 840 }, [ 841 state 842 ]); 843 (0, __TURBOPACK__imported__module__934620__["useLayoutEffect"])(()=>{ 844 const styles = stylesRef.current; 845 const wasPresent = prevPresentRef.current; 846 const hasPresentChanged = wasPresent !== present; 847 if (hasPresentChanged) { 848 const prevAnimationName = prevAnimationNameRef.current; 849 const currentAnimationName = getAnimationName(styles); 850 if (present) { 851 mountAnimationNameRef.current = currentAnimationName; 852 send("MOUNT"); 853 } else if (currentAnimationName === "none" || (styles === null || styles === void 0 ? void 0 : styles.display) === "none") { 854 send("UNMOUNT"); 855 } else { 856 const isAnimating = prevAnimationName !== currentAnimationName; 857 if (wasPresent && isAnimating) { 858 send("ANIMATION_OUT"); 859 } else { 860 send("UNMOUNT"); 861 } 862 } 863 prevPresentRef.current = present; 864 } 865 }, [ 866 present, 867 send 868 ]); 869 (0, __TURBOPACK__imported__module__934620__["useLayoutEffect"])(()=>{ 870 if (node) { 871 var _node_ownerDocument_defaultView; 872 let timeoutId; 873 const ownerWindow = (_node_ownerDocument_defaultView = node.ownerDocument.defaultView) !== null && _node_ownerDocument_defaultView !== void 0 ? _node_ownerDocument_defaultView : window; 874 const handleAnimationEnd = /* @__PURE__ */ __name((event)=>{ 875 const currentAnimationName = getAnimationName(stylesRef.current); 876 const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName)); 877 if (event.target === node && isCurrentAnimation) { 878 send("ANIMATION_END"); 879 if (!prevPresentRef.current) { 880 const currentFillMode = node.style.animationFillMode; 881 node.style.animationFillMode = "forwards"; 882 timeoutId = ownerWindow.setTimeout(()=>{ 883 if (node.style.animationFillMode === "forwards") { 884 node.style.animationFillMode = currentFillMode; 885 } 886 }); 887 } 888 } 889 }, "handleAnimationEnd"); 890 const handleAnimationStart = /* @__PURE__ */ __name((event)=>{ 891 if (event.target === node) { 892 prevAnimationNameRef.current = getAnimationName(stylesRef.current); 893 } 894 }, "handleAnimationStart"); 895 node.addEventListener("animationstart", handleAnimationStart); 896 node.addEventListener("animationcancel", handleAnimationEnd); 897 node.addEventListener("animationend", handleAnimationEnd); 898 return ()=>{ 899 ownerWindow.clearTimeout(timeoutId); 900 node.removeEventListener("animationstart", handleAnimationStart); 901 node.removeEventListener("animationcancel", handleAnimationEnd); 902 node.removeEventListener("animationend", handleAnimationEnd); 903 }; 904 } else { 905 send("ANIMATION_END"); 906 } 907 }, [ 908 node, 909 send 910 ]); 911 return { 912 isPresent: [ 913 "mounted", 914 "unmountSuspended" 915 ].includes(state), 916 ref: __TURBOPACK__imported__module__271645__["useCallback"]((node2)=>{ 917 if (node2) { 918 const styles = getComputedStyle(node2); 919 stylesRef.current = styles; 920 mountAnimationNameRef.current = getAnimationName(styles); 921 } else { 922 stylesRef.current = null; 923 } 924 setNode(node2); 925 }, []) 926 }; 927} 928__name(usePresence, "usePresence"); 929function setRef(ref, value) { 930 if (typeof ref === "function") { 931 return ref(value); 932 } else if (ref !== null && ref !== void 0) { 933 ref.current = value; 934 } 935} 936__name(setRef, "setRef"); 937function useStableComposedRefs() { 938 for(var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++){ 939 refs[_key] = arguments[_key]; 940 } 941 const refsRef = __TURBOPACK__imported__module__271645__["useRef"](refs); 942 refsRef.current = refs; 943 return __TURBOPACK__imported__module__271645__["useCallback"]((node)=>{ 944 const currentRefs = refsRef.current; 945 let hasCleanup = false;
946 const cleanups = currentRefs.map((ref)=>{ 947 const cleanup = setRef(ref, node); 948 if (!hasCleanup && typeof cleanup === "function") { 949 hasCleanup = true; 950 } 951 return cleanup; 952 }); 953 if (hasCleanup) { 954 return ()=>{ 955 for(let i = 0; i < cleanups.length; i++){ 956 const cleanup = cleanups[i]; 957 if (typeof cleanup === "function") { 958 cleanup(); 959 } else { 960 setRef(currentRefs[i], null); 961 } 962 } 963 }; 964 } 965 }, []); 966} 967__name(useStableComposedRefs, "useStableComposedRefs"); 968function getAnimationName(styles) { 969 return (styles === null || styles === void 0 ? void 0 : styles.animationName) || "none"; 970} 971__name(getAnimationName, "getAnimationName"); 972function getElementRef(element) { 973 var _Object_getOwnPropertyDescriptor, _Object_getOwnPropertyDescriptor1; 974 let getter = (_Object_getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor(element.props, "ref")) === null || _Object_getOwnPropertyDescriptor === void 0 ? void 0 : _Object_getOwnPropertyDescriptor.get; 975 let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; 976 if (mayWarn) { 977 return element.ref; 978 } 979 getter = (_Object_getOwnPropertyDescriptor1 = Object.getOwnPropertyDescriptor(element, "ref")) === null || _Object_getOwnPropertyDescriptor1 === void 0 ? void 0 : _Object_getOwnPropertyDescriptor1.get; 980 mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; 981 if (mayWarn) { 982 return element.props.ref; 983 } 984 return element.props.ref || element.ref; 985} 986__name(getElementRef, "getElementRef"); 987var Root = Presence; 988; 989__turbopack_context__.s([ 990 "Presence", 991 0, 992 Presence 993]); 994}), 995610772, ((__turbopack_context__) => { 996"use strict"; 997
998// src/id.tsx 999var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 1000var __TURBOPACK__imported__module__934620__ = __turbopack_context__.i(934620); 1001var __defProp = Object.defineProperty; 1002var __name = (target, value)=>__defProp(target, "name", { 1003 value, 1004 configurable: true 1005 }); 1006; 1007; 1008var useReactId = __TURBOPACK__imported__module__271645__[" useId ".trim().toString()] || (()=>void 0); 1009var count = 0; 1010function useId(deterministicId) { 1011 const [id, setId] = __TURBOPACK__imported__module__271645__.useState(useReactId()); 1012 (0, __TURBOPACK__imported__module__934620__["useLayoutEffect"])(()=>{ 1013 if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String(count++)); 1014 }, [ 1015 deterministicId 1016 ]); 1017 return deterministicId || (id ? "radix-".concat(id) : ""); 1018} 1019__name(useId, "useId"); 1020; 1021__turbopack_context__.s([ 1022 "useId", 1023 0, 1024 useId 1025]); 1026}), 102730207, ((__turbopack_context__) => { 1028"use strict"; 1029
1030// src/use-callback-ref.tsx 1031var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 1032var __defProp = Object.defineProperty; 1033var __name = (target, value)=>__defProp(target, "name", { 1034 value, 1035 configurable: true 1036 }); 1037; 1038function useCallbackRef(callback) { 1039 const callbackRef = __TURBOPACK__imported__module__271645__["useRef"](callback); 1040 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 1041 callbackRef.current = callback; 1042 }); 1043 return __TURBOPACK__imported__module__271645__["useMemo"](()=>function() { 1044 for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ 1045 args[_key] = arguments[_key]; 1046 } 1047 var _callbackRef_current; 1048 return (_callbackRef_current = callbackRef.current) === null || _callbackRef_current === void 0 ? void 0 : _callbackRef_current.call(callbackRef, ...args); 1049 }, []); 1050} 1051__name(useCallbackRef, "useCallbackRef"); 1052; 1053__turbopack_context__.s([ 1054 "useCallbackRef", 1055 0, 1056 useCallbackRef 1057]); 1058}), 1059774606, ((__turbopack_context__) => { 1060"use strict"; 1061
1062// src/portal.tsx 1063var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 1064var __TURBOPACK__imported__module__174080__ = __turbopack_context__.i(174080); 1065var __TURBOPACK__imported__module__248425__ = __turbopack_context__.i(248425); 1066var __TURBOPACK__imported__module__934620__ = __turbopack_context__.i(934620); 1067var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 1068"use client"; 1069var __defProp = Object.defineProperty; 1070var __name = (target, value)=>__defProp(target, "name", { 1071 value, 1072 configurable: true 1073 }); 1074; 1075; 1076; 1077; 1078; 1079var Portal = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](/* @__PURE__ */ __name(function Portal2(props, forwardedRef) { 1080 var _globalThis_document, _globalThis; 1081 const { container: containerProp, ...portalProps } = props; 1082 const [mounted, setMounted] = __TURBOPACK__imported__module__271645__["useState"](false); 1083 (0, __TURBOPACK__imported__module__934620__["useLayoutEffect"])(()=>setMounted(true), []); 1084 const container = containerProp || mounted && ((_globalThis = globalThis) === null || _globalThis === void 0 ? void 0 : (_globalThis_document = _globalThis.document) === null || _globalThis_document === void 0 ? void 0 : _globalThis_document.body); 1085 return container ? __TURBOPACK__imported__module__174080__["createPortal"](/* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__248425__["Primitive"].div, { 1086 ...portalProps, 1087 ref: forwardedRef 1088 }), container) : null; 1089}, "Portal")); 1090var Root = Portal; 1091; 1092__turbopack_context__.s([ 1093 "Portal", 1094 0, 1095 Portal, 1096 "Root", 1097 0, 1098 Root 1099]); 1100}), 1101726330, ((__turbopack_context__) => { 1102"use strict"; 1103
1104// src/dismissable-layer.tsx 1105var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 1106var __TURBOPACK__imported__module__981140__ = __turbopack_context__.i(981140); 1107var __TURBOPACK__imported__module__248425__ = __turbopack_context__.i(248425); 1108var __TURBOPACK__imported__module__820783__ = __turbopack_context__.i(820783); 1109var __TURBOPACK__imported__module__30207__ = __turbopack_context__.i(30207); 1110var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 1111"use client"; 1112var __defProp = Object.defineProperty; 1113var __name = (target, value)=>__defProp(target, "name", { 1114 value, 1115 configurable: true 1116 }); 1117; 1118; 1119; 1120; 1121; 1122; 1123var CONTEXT_UPDATE = "dismissableLayer.update"; 1124var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside"; 1125var FOCUS_OUTSIDE = "dismissableLayer.focusOutside"; 1126var originalBodyPointerEvents; 1127var DismissableLayerContext = __TURBOPACK__imported__module__271645__["createContext"]({ 1128 layers: /* @__PURE__ */ new Set(), 1129 layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(), 1130 branches: /* @__PURE__ */ new Set(), 1131 // Outside elements that belong to a layer's own dismiss affordance (eg, a 1132 // dialog overlay). Pressing them should dismiss the layer regardless of 1133 // whether or not they stop propagation. 1134 // 1135 // See https://github.com/radix-ui/primitives/issues/3346 1136 dismissableSurfaces: /* @__PURE__ */ new Set() 1137}); 1138var DismissableLayer = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](// blank line to reduce diff noise 1139/* @__PURE__ */ __name(function DismissableLayer2(props, forwardedRef) { 1140 var _ref; 1141 var _globalThis; 1142 const { disableOutsidePointerEvents = false, deferPointerDownOutside = false, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, ...layerProps } = props; 1143 const context = __TURBOPACK__imported__module__271645__["useContext"](DismissableLayerContext); 1144 const [node, setNode] = __TURBOPACK__imported__module__271645__["useState"](null); 1145 const ownerDocument = (_ref = node === null || node === void 0 ? void 0 : node.ownerDocument) !== null && _ref !== void 0 ? _ref : (_globalThis = globalThis) === null || _globalThis === void 0 ? void 0 : _globalThis.document; 1146 const [, force] = __TURBOPACK__imported__module__271645__["useState"]({}); 1147 const composedRefs = (0, __TURBOPACK__imported__module__820783__["useComposedRefs"])(forwardedRef, setNode); 1148 const layers = Array.from(context.layers); 1149 const [highestLayerWithOutsidePointerEventsDisabled] = [ 1150 ...context.layersWithOutsidePointerEventsDisabled 1151 ].slice(-1); 1152 const highestLayerWithOutsidePointerEventsDisabledIndex = highestLayerWithOutsidePointerEventsDisabled ? layers.indexOf(highestLayerWithOutsidePointerEventsDisabled) : -1; 1153 const index = node ? layers.indexOf(node) : -1; 1154 const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0; 1155 const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; 1156 const isDeferredPointerDownOutsideRef = __TURBOPACK__imported__module__271645__["useRef"](false); 1157 const pointerDownOutside = usePointerDownOutside((event)=>{ 1158 onPointerDownOutside === null || onPointerDownOutside === void 0 ? void 0 : onPointerDownOutside(event); 1159 onInteractOutside === null || onInteractOutside === void 0 ? void 0 : onInteractOutside(event); 1160 if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss(); 1161 }, { 1162 ownerDocument, 1163 deferPointerDownOutside, 1164 isDeferredPointerDownOutsideRef, 1165 dismissableSurfaces: context.dismissableSurfaces, 1166 shouldHandlePointerDownOutside: __TURBOPACK__imported__module__271645__["useCallback"]((target)=>{ 1167 if (!(target instanceof Node)) { 1168 return false; 1169 } 1170 const isPointerDownOnBranch = [ 1171 ...context.branches 1172 ].some((branch)=>branch.contains(target)); 1173 return isPointerEventsEnabled && !isPointerDownOnBranch; 1174 }, [ 1175 context.branches, 1176 isPointerEventsEnabled 1177 ]) 1178 }); 1179 const focusOutside = useFocusOutside((event)=>{ 1180 if (deferPointerDownOutside && isDeferredPointerDownOutsideRef.current) { 1181 return; 1182 } 1183 const target = event.target; 1184 const isFocusInBranch = [ 1185 ...context.branches 1186 ].some((branch)=>branch.contains(target)); 1187 if (isFocusInBranch) return; 1188 onFocusOutside === null || onFocusOutside === void 0 ? void 0 : onFocusOutside(event); 1189 onInteractOutside === null || onInteractOutside === void 0 ? void 0 : onInteractOutside(event); 1190 if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss(); 1191 }, ownerDocument); 1192 const isHighestLayer = node ? index === layers.length - 1 : false;
1193 const handleKeyDown = (0, __TURBOPACK__imported__module__30207__["useCallbackRef"])((event)=>{ 1194 if (event.key !== "Escape") { 1195 return; 1196 } 1197 onEscapeKeyDown === null || onEscapeKeyDown === void 0 ? void 0 : onEscapeKeyDown(event); 1198 if (!event.defaultPrevented && onDismiss) { 1199 event.preventDefault(); 1200 onDismiss(); 1201 } 1202 }); 1203 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 1204 if (!isHighestLayer) { 1205 return; 1206 } 1207 ownerDocument.addEventListener("keydown", handleKeyDown, { 1208 capture: true 1209 }); 1210 return ()=>ownerDocument.removeEventListener("keydown", handleKeyDown, { 1211 capture: true 1212 }); 1213 }, [ 1214 ownerDocument, 1215 isHighestLayer, 1216 handleKeyDown 1217 ]); 1218 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 1219 if (!node) return; 1220 if (disableOutsidePointerEvents) { 1221 if (context.layersWithOutsidePointerEventsDisabled.size === 0) { 1222 originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; 1223 ownerDocument.body.style.pointerEvents = "none"; 1224 } 1225 context.layersWithOutsidePointerEventsDisabled.add(node); 1226 } 1227 context.layers.add(node); 1228 dispatchUpdate(); 1229 return ()=>{ 1230 if (disableOutsidePointerEvents) { 1231 context.layersWithOutsidePointerEventsDisabled.delete(node); 1232 if (context.layersWithOutsidePointerEventsDisabled.size === 0) { 1233 ownerDocument.body.style.pointerEvents = originalBodyPointerEvents; 1234 } 1235 } 1236 }; 1237 }, [ 1238 node, 1239 ownerDocument, 1240 disableOutsidePointerEvents, 1241 context 1242 ]); 1243 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 1244 return ()=>{ 1245 if (!node) return; 1246 context.layers.delete(node); 1247 context.layersWithOutsidePointerEventsDisabled.delete(node); 1248 dispatchUpdate(); 1249 }; 1250 }, [ 1251 node, 1252 context 1253 ]); 1254 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 1255 const handleUpdate = /* @__PURE__ */ __name(()=>force({}), "handleUpdate"); 1256 document.addEventListener(CONTEXT_UPDATE, handleUpdate); 1257 return ()=>document.removeEventListener(CONTEXT_UPDATE, handleUpdate); 1258 }, []); 1259 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__248425__["Primitive"].div, { 1260 ...layerProps, 1261 ref: composedRefs, 1262 style: { 1263 pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0, 1264 ...props.style 1265 }, 1266 onFocusCapture: (0, __TURBOPACK__imported__module__981140__["composeEventHandlers"])(props.onFocusCapture, focusOutside.onFocusCapture), 1267 onBlurCapture: (0, __TURBOPACK__imported__module__981140__["composeEventHandlers"])(props.onBlurCapture, focusOutside.onBlurCapture), 1268 onPointerDownCapture: (0, __TURBOPACK__imported__module__981140__["composeEventHandlers"])(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture) 1269 }); 1270}, "DismissableLayer")); 1271var DismissableLayerBranch = /* @__PURE__ */ __TURBOPACK__imported__module__271645__["forwardRef"](/* @__PURE__ */ __name(function DismissableLayerBranch2(props, forwardedRef) { 1272 const context = __TURBOPACK__imported__module__271645__["useContext"](DismissableLayerContext); 1273 const ref = __TURBOPACK__imported__module__271645__["useRef"](null); 1274 const composedRefs = (0, __TURBOPACK__imported__module__820783__["useComposedRefs"])(forwardedRef, ref); 1275 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 1276 const node = ref.current; 1277 if (node) { 1278 context.branches.add(node); 1279 return ()=>{ 1280 context.branches.delete(node); 1281 }; 1282 } 1283 }, [ 1284 context.branches 1285 ]); 1286 return /* @__PURE__ */ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__248425__["Primitive"].div, { 1287 ...props, 1288 ref: composedRefs 1289 }); 1290}, "DismissableLayerBranch")); 1291function useDismissableLayerSurface() { 1292 const context = __TURBOPACK__imported__module__271645__["useContext"](DismissableLayerContext); 1293 const [node, setNode] = __TURBOPACK__imported__module__271645__["useState"](null); 1294 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 1295 if (!node) { 1296 return; 1297 } 1298 context.dismissableSurfaces.add(node); 1299 return ()=>{ 1300 context.dismissableSurfaces.delete(node); 1301 }; 1302 }, [ 1303 node, 1304 context.dismissableSurfaces 1305 ]); 1306 return setNode; 1307} 1308__name(useDismissableLayerSurface, "useDismissableLayerSurface");
1309var IS_TRUE = /* @__PURE__ */ __name(()=>true, "IS_TRUE"); 1310function usePointerDownOutside(onPointerDownOutside, args) { 1311 var _globalThis; 1312 const { ownerDocument = (_globalThis = globalThis) === null || _globalThis === void 0 ? void 0 : _globalThis.document, deferPointerDownOutside = false, isDeferredPointerDownOutsideRef, dismissableSurfaces, shouldHandlePointerDownOutside = IS_TRUE } = args; 1313 const handlePointerDownOutside = (0, __TURBOPACK__imported__module__30207__["useCallbackRef"])(onPointerDownOutside); 1314 const isPointerInsideReactTreeRef = __TURBOPACK__imported__module__271645__["useRef"](false); 1315 const isPointerDownOutsideRef = __TURBOPACK__imported__module__271645__["useRef"](false); 1316 const interceptedOutsideInteractionEventsRef = __TURBOPACK__imported__module__271645__["useRef"](/* @__PURE__ */ new Map()); 1317 const handleClickRef = __TURBOPACK__imported__module__271645__["useRef"](()=>{}); 1318 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 1319 function resetOutsideInteraction() { 1320 isPointerDownOutsideRef.current = false; 1321 isDeferredPointerDownOutsideRef.current = false; 1322 interceptedOutsideInteractionEventsRef.current.clear(); 1323 } 1324 __name(resetOutsideInteraction, "resetOutsideInteraction"); 1325 function isOutsideInteractionIntercepted() { 1326 return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean); 1327 } 1328 __name(isOutsideInteractionIntercepted, "isOutsideInteractionIntercepted"); 1329 function handleInteractionCapture(event) { 1330 if (!isPointerDownOutsideRef.current) { 1331 return; 1332 } 1333 const target = event.target; 1334 const isDismissableSurface = target instanceof Node && [ 1335 ...dismissableSurfaces 1336 ].some((surface)=>surface.contains(target)); 1337 if (!isDismissableSurface) { 1338 interceptedOutsideInteractionEventsRef.current.set(event.type, true); 1339 } 1340 if (event.type === "click") { 1341 window.setTimeout(()=>{ 1342 if (isPointerDownOutsideRef.current) { 1343 handleClickRef.current(); 1344 } 1345 }, 0); 1346 } 1347 } 1348 __name(handleInteractionCapture, "handleInteractionCapture"); 1349 function handleInteractionBubble(event) { 1350 if (isPointerDownOutsideRef.current) { 1351 interceptedOutsideInteractionEventsRef.current.set(event.type, false); 1352 } 1353 } 1354 __name(handleInteractionBubble, "handleInteractionBubble"); 1355 const handlePointerDown = /* @__PURE__ */ __name((event)=>{ 1356 if (event.target && !isPointerInsideReactTreeRef.current) { 1357 let handleAndDispatchPointerDownOutsideEvent2 = function() { 1358 ownerDocument.removeEventListener("click", handleClickRef.current); 1359 const wasOutsideInteractionIntercepted = isOutsideInteractionIntercepted(); 1360 resetOutsideInteraction(); 1361 if (!wasOutsideInteractionIntercepted) { 1362 handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, { 1363 discrete: true 1364 }); 1365 } 1366 }; 1367 var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2; 1368 __name(handleAndDispatchPointerDownOutsideEvent2, "handleAndDispatchPointerDownOutsideEvent"); 1369 if (!shouldHandlePointerDownOutside(event.target)) { 1370 ownerDocument.removeEventListener("click", handleClickRef.current); 1371 resetOutsideInteraction(); 1372 isPointerInsideReactTreeRef.current = false; 1373 return; 1374 } 1375 const eventDetail = { 1376 originalEvent: event 1377 }; 1378 isPointerDownOutsideRef.current = true; 1379 isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0; 1380 interceptedOutsideInteractionEventsRef.current.clear(); 1381 if (!deferPointerDownOutside || event.button !== 0) { 1382 handleAndDispatchPointerDownOutsideEvent2(); 1383 } else { 1384 ownerDocument.removeEventListener("click", handleClickRef.current); 1385 handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2; 1386 ownerDocument.addEventListener("click", handleClickRef.current, { 1387 once: true 1388 }); 1389 } 1390 } else { 1391 ownerDocument.removeEventListener("click", handleClickRef.current); 1392 resetOutsideInteraction(); 1393 } 1394 isPointerInsideReactTreeRef.current = false;
1395 }, "handlePointerDown"); 1396 const outsideInteractionEvents = [ 1397 "pointerup", 1398 "mousedown", 1399 "mouseup", 1400 "touchstart", 1401 "touchend", 1402 "click" 1403 ]; 1404 for (const eventName of outsideInteractionEvents){ 1405 ownerDocument.addEventListener(eventName, handleInteractionCapture, true); 1406 ownerDocument.addEventListener(eventName, handleInteractionBubble); 1407 } 1408 const timerId = window.setTimeout(()=>{ 1409 ownerDocument.addEventListener("pointerdown", handlePointerDown); 1410 }, 0); 1411 return ()=>{ 1412 window.clearTimeout(timerId); 1413 ownerDocument.removeEventListener("pointerdown", handlePointerDown); 1414 ownerDocument.removeEventListener("click", handleClickRef.current); 1415 for (const eventName of outsideInteractionEvents){ 1416 ownerDocument.removeEventListener(eventName, handleInteractionCapture, true); 1417 ownerDocument.removeEventListener(eventName, handleInteractionBubble); 1418 } 1419 }; 1420 }, [ 1421 ownerDocument, 1422 handlePointerDownOutside, 1423 deferPointerDownOutside, 1424 isDeferredPointerDownOutsideRef, 1425 dismissableSurfaces, 1426 shouldHandlePointerDownOutside 1427 ]); 1428 return { 1429 // ensures we check React component tree (not just DOM tree) 1430 onPointerDownCapture: /* @__PURE__ */ __name(()=>isPointerInsideReactTreeRef.current = true, "onPointerDownCapture") 1431 }; 1432} 1433__name(usePointerDownOutside, "usePointerDownOutside"); 1434function useFocusOutside(onFocusOutside) { 1435 let ownerDocument = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : (()=>{ 1436 var _globalThis; 1437 return (_globalThis = globalThis) === null || _globalThis === void 0 ? void 0 : _globalThis.document; 1438 })(); 1439 const handleFocusOutside = (0, __TURBOPACK__imported__module__30207__["useCallbackRef"])(onFocusOutside); 1440 const isFocusInsideReactTreeRef = __TURBOPACK__imported__module__271645__["useRef"](false); 1441 __TURBOPACK__imported__module__271645__["useEffect"](()=>{ 1442 const handleFocus = /* @__PURE__ */ __name((event)=>{ 1443 if (event.target && !isFocusInsideReactTreeRef.current) { 1444 const eventDetail = { 1445 originalEvent: event 1446 }; 1447 handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { 1448 discrete: false 1449 }); 1450 } 1451 }, "handleFocus"); 1452 ownerDocument.addEventListener("focusin", handleFocus); 1453 return ()=>ownerDocument.removeEventListener("focusin", handleFocus); 1454 }, [ 1455 ownerDocument, 1456 handleFocusOutside 1457 ]); 1458 return { 1459 onFocusCapture: /* @__PURE__ */ __name(()=>isFocusInsideReactTreeRef.current = true, "onFocusCapture"), 1460 onBlurCapture: /* @__PURE__ */ __name(()=>isFocusInsideReactTreeRef.current = false, "onBlurCapture") 1461 }; 1462} 1463__name(useFocusOutside, "useFocusOutside"); 1464function dispatchUpdate() { 1465 const event = new CustomEvent(CONTEXT_UPDATE); 1466 document.dispatchEvent(event); 1467} 1468__name(dispatchUpdate, "dispatchUpdate"); 1469function handleAndDispatchCustomEvent(name, handler, detail, param) { 1470 let { discrete } = param; 1471 const target = detail.originalEvent.target; 1472 const event = new CustomEvent(name, { 1473 bubbles: false, 1474 cancelable: true, 1475 detail 1476 }); 1477 if (handler) target.addEventListener(name, handler, { 1478 once: true 1479 }); 1480 if (discrete) { 1481 (0, __TURBOPACK__imported__module__248425__["dispatchDiscreteCustomEvent"])(target, event); 1482 } else { 1483 target.dispatchEvent(event); 1484 } 1485} 1486__name(handleAndDispatchCustomEvent, "handleAndDispatchCustomEvent"); 1487var Root = DismissableLayer; 1488var Branch = DismissableLayerBranch; 1489; 1490__turbopack_context__.s([ 1491 "DismissableLayer", 1492 0, 1493 DismissableLayer, 1494 "useDismissableLayerSurface", 1495 0, 1496 useDismissableLayerSurface 1497]); 1498}), 1499]); 1500 1501//# debugId=0afa157f-aa29-987e-f1e7-b8dafce28fee
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.